/* AVL Press — the studio. The author's main menu on the left (SPEC-037), the
   book at hand on the right. Everything inherits the site palette from style.css. */

/* `hidden` has to win over everything below.
   The browser applies it as `display: none` at the lowest possible weight, so
   any class here that sets `display` -- and several do -- silently overrides
   it. That is how the studio ended up showing "your work" and a button to
   start a book to a visitor with no session: the markup said hidden and the
   stylesheet said grid, and the stylesheet won. */
[hidden] { display: none !important; }

/* style.css viste la web de venta, donde cada <section> es una franja con
   90px de aire arriba y abajo. El estudio NO es esa pagina: aqui las secciones
   son piezas de una herramienta, no franjas de un folleto. Sin esto aparecia
   un hueco muerto de 90px entre el titulo y el menu, y otro dentro de cada
   bloque. Se neutraliza solo dentro del estudio. */
.estudio > section, .estudio-columnas > section { padding: 0; }
/* SPEC-010: every section of the studio is a piece of the tool, never a 90px band.
   :where() keeps this rule at the weight of a bare `section`, so it still beats style.css's band (it loads later)
   but any card's own class (.space-block, .own-book, .historial, .editor-note…) keeps its padding: with
   `.estudio section` those cards lost it and their text touched the border. */
:where(.estudio) section { padding: 0; }
.estudio .bloque { padding-top: 1.75rem; }

/* ── SPEC-037: the author's main menu, mobile first ──────────────────────
   One left menu (MIS LIBROS unfolding into one row per book, the 13
   services in three groups, the administration, a footer with the account
   and the balance). On a phone the menu is a bar of four at the bottom
   (Mis libros · Servicios · Pedidos · Más) with sheets; from 900px it is a
   sticky column under the site bar that collapses to a 64px rail. Buttons
   are at least 44px high and the page never scrolls sideways at 390px.
   Icons come from the sprite inlined at the top of estudio.html.
   SPEC-071 RF1.1: the site bar is the whole bar of every page (links, tool
   circles, account disc, menu button), with the same spacing as /pricing: its links
   never wrap and the bar keeps the site's side padding. */
.site-nav.no-hero .wrap { gap: 28px; padding-inline: var(--nav-pad-x); }
.site-nav .links { flex-wrap: nowrap; gap: clamp(12px, 1.35vw, 20px); overflow-x: auto; scrollbar-width: none; }
.site-nav .links a { white-space: nowrap; letter-spacing: .07em; }
.site-nav .links > :first-child { margin-left: auto; }
.site-nav .logo { flex: 0 0 auto; margin-right: 4px; }
@media (max-width: 1240px) { .site-nav .links { font-size: 11.5px; } }

:root { --studio-gold: var(--gold); --studio-on-gold: #15171a; }
:root[data-theme="light"] { --studio-gold: var(--gold-soft); --studio-on-gold: #fffdf8; }
:root[data-theme="dark"] { --studio-gold: var(--gold); --studio-on-gold: #15171a; }
/* Mixed (the site's default): the menu, the book's band, the phone bars and the
   sheets keep the dark ink of the dark theme; the content stays on light paper. */
:root[data-mode="mixed"] :is(.studio-sidebar, .book-band, .studio-phone-bar, .studio-sheet, .estudio-cabecera) {
  --bg: #0a0d13; --bg2: #0e131c; --surface: #121823; --surface-2: #141b27; --line: #222b39; --line-2: #2d384a;
  --ink: #ece9e1; --muted: #9b9a91; --dim: #8a8f99; --faint: #54585f; --gold: #cda94e; --gold-soft: #e6cd86;
  --on-gold: #0a0d13; --studio-gold: #cda94e; --studio-on-gold: #15171a; --sh-card: 0 18px 40px rgba(0,0,0,.42);
  color-scheme: dark; color: var(--ink);
}
:root[data-mode="mixed"] :is(.studio-sidebar, .book-band, .studio-phone-bar, .studio-sheet) { --menu-fade: var(--bg); background: var(--bg); }
:root[data-mode="mixed"] .book-band { border-color: var(--line); }

.estudio { max-width: 60rem; margin: 0 auto; padding: calc(72px + 1rem) 16px calc(5.5rem + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
.estudio :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.estudio-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.estudio-eyebrow { margin: 0; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.estudio-cabecera h1 { font-family: Fraunces, Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; }

.estudio-aviso { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: .5rem; border: 1px solid currentColor; }
.estudio-aviso[hidden] { display: none !important; }
.estudio-aviso[data-kind="error"] { color: #f0a0a0; }
.estudio-aviso[data-kind="ok"] { color: #8fd1a8; }
:root[data-theme="light"] .estudio-aviso[data-kind="error"] { color: #a32020; }
:root[data-theme="light"] .estudio-aviso[data-kind="ok"] { color: #1d6b3c; }

.estudio-columnas { display: block; }

/* Line icons from the inlined sprite: currentColor, 1.5px stroke. */
.estudio .ic, .studio-sheet .ic, .studio-phone-bar .ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.estudio .btn-enlace .ic, .estudio .btn-secundario .ic, .estudio .btn-tenue .ic { width: 15px; height: 15px; margin-right: 4px; }
.ic-caret { width: 14px; height: 14px; color: var(--dim); }

/* ── The menu's pieces (shared by the sidebar and the phone sheets) ── */
.menu-section + .menu-section { margin-top: .5rem; }
.menu-heading { height: 18px; margin: 0 0 0 10px; color: var(--dim); font-size: .66rem; font-weight: 600; letter-spacing: .15em; line-height: 18px; text-transform: uppercase; white-space: nowrap; }
.menu-divider { height: 22px; margin: 0 0 0 10px; color: var(--dim); font-size: .6rem; font-weight: 500; letter-spacing: .09em; line-height: 22px; text-transform: uppercase; white-space: nowrap; }
.menu-entry { position: relative; display: flex; width: 100%; min-height: 44px; align-items: center; gap: 9px; padding: 5px 10px; border: 0; border-radius: 6px;
              background: transparent; color: var(--muted); font: inherit; cursor: pointer; text-align: left; text-decoration: none; transition: background .15s, color .15s; }
.menu-entry:hover, .menu-footer-link:hover, .menu-account-copy:hover { background: var(--surface-2); color: var(--ink); }
.menu-entry[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.menu-entry[aria-current="page"]::before { position: absolute; inset: 7px auto 7px 0; width: 3px; border-radius: 2px; background: var(--gold); content: ""; }
.menu-icon { width: 18px; height: 18px; color: var(--dim); }
.menu-entry[aria-current="page"] .menu-icon { color: var(--gold); }
.menu-label { display: -webkit-box; min-width: 0; overflow: hidden; flex: 1; font-size: .8rem; line-height: 1.2; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.menu-number { width: 14px; flex: 0 0 14px; color: var(--dim); font-size: .66rem; font-variant-numeric: tabular-nums; text-align: right; }
.menu-badge { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; padding: 0 5px; border: 1px solid var(--gold); border-radius: 20px; color: var(--gold); font-size: .66rem; }
.menu-badge[hidden] { display: none !important; }

/* MIS LIBROS: a disclosure that unfolds downward into one row per book. */
.menu-disclosure { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 9px; padding: 5px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; text-align: left; }
.menu-disclosure:hover { background: var(--surface-2); color: var(--ink); }
.menu-disclosure .menu-heading { flex: 1; margin: 0; color: var(--ink); }
.menu-disclosure .menu-icon { color: var(--gold); }
.menu-count { color: var(--dim); font-size: .66rem; font-variant-numeric: tabular-nums; }
.menu-caret { transition: transform .2s ease; }
.menu-disclosure[aria-expanded="false"] .menu-caret { transform: rotate(-90deg); }
.menu-book-list { padding: 2px 0 4px 6px; }
.menu-book-list[hidden] { display: none !important; }
.menu-book-filter { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px 4px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--dim); }
.menu-book-filter[hidden] { display: none !important; }
.menu-book-filter .ic { width: 14px; height: 14px; }
.menu-book-filter-input { width: 100%; min-width: 0; min-height: 34px; padding: 4px 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .78rem; }
.menu-book-filter-input:focus-visible { outline: none; }
.menu-book-filter:focus-within { border-color: var(--gold); }
.menu-book-rows { margin: 0; padding: 0; list-style: none; }
.menu-book-rows li[hidden] { display: none !important; }
.menu-book-rows.is-scrollable { max-height: 232px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; scrollbar-gutter: stable; }
.menu-book-rows.is-scrollable::-webkit-scrollbar { width: 6px; }
.menu-book-rows.is-scrollable::-webkit-scrollbar-track { background: transparent; }
.menu-book-rows.is-scrollable::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--line-2); }
.menu-book-rows.is-scrollable::after { position: sticky; bottom: 0; display: block; height: 24px; background: linear-gradient(to bottom, transparent, var(--menu-fade, var(--surface))); pointer-events: none; content: ""; }
.studio-sheet .menu-book-rows.is-scrollable { max-height: min(46vh, 400px); }
.menu-book-row { position: relative; display: flex; width: 100%; min-height: 44px; align-items: center; gap: 8px; padding: 4px 8px 4px 10px; border: 0; border-left: 1px solid var(--line); border-radius: 0 5px 5px 0;
                 background: transparent; color: var(--muted); font: inherit; cursor: pointer; text-align: left; }
.menu-book-row:hover { background: var(--surface-2); color: var(--ink); }
.menu-book-row[aria-current="page"] { border-left-color: var(--gold); background: var(--surface-2); color: var(--ink); }
.menu-book-title { display: block; min-width: 0; flex: 1; overflow: hidden; font-size: .78rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.menu-new-book { margin-top: 2px; color: var(--dim); }
.menu-new-book .ic { width: 14px; height: 14px; }
.menu-new-book:hover { color: var(--gold); }
.menu-book-rows-empty { padding: 6px 10px; color: var(--dim); font-size: .72rem; font-style: italic; }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border: 1.5px solid var(--line-2); border-radius: 50%; }
.status-dot[data-state="attention"] { border-color: var(--gold); background: var(--gold); }
.status-dot[data-state="progress"] { border-color: var(--dim); background: var(--dim); }

/* The footer: the account and, under it, the balance (SPEC-071 F2). The theme and the public site
   live in the site bar (its theme circle and its logo). */
.studio-sidebar-footer { display: flex; flex: 0 0 auto; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.menu-footer-link { display: flex; min-height: 36px; align-items: center; gap: 7px; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; text-align: left; text-decoration: none; }
.menu-footer-link .ic { width: 16px; height: 16px; color: var(--dim); }
.menu-footer-link .menu-label { flex: 0 1 auto; font-size: .78rem; }
.menu-account { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 2px; padding: 2px 4px; }
.menu-account .estudio-avatar { width: 34px; height: 34px; margin: 0; font-size: .62rem; }
.menu-account-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: flex-start; padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; line-height: 1.2; cursor: pointer; text-align: left; }
.menu-account-copy strong { font-size: .8rem; font-weight: 500; }
.menu-account-copy small { margin-top: 2px; color: var(--dim); font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.menu-account-copy[aria-pressed="true"] strong { color: var(--gold); }
/* SPEC-071 RF2.1-RF2.2: «Saldo: US$ 120», big, and «Cargar saldo» under it; the rail keeps the short amount. */
.menu-balance { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 4px 10px 2px; }
.menu-balance-amount { margin: 0; color: var(--ink); font-family: Fraunces, Georgia, serif; font-size: 1.2rem; font-weight: 500; line-height: 1.25; }
.menu-balance-amount strong { font-weight: 600; }
.menu-balance-label { color: var(--muted); font-size: .95rem; font-weight: 400; }
.menu-balance-topup { display: inline-flex; min-height: 30px; align-items: center; color: var(--muted); font-size: .78rem; text-decoration: underline; text-underline-offset: .2em; }
.menu-balance-topup:hover { color: var(--gold); }
.menu-balance-short { display: none; }
.sheet-balance { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }

/* ── The phone: a bar of four at the bottom and the sheets ── */
.studio-phone-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
                    padding: .25rem .4rem calc(.25rem + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.studio-phone-bar button { display: flex; min-width: 0; min-height: 52px; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                           padding: .3rem .25rem; border: 0; border-radius: .5rem; background: none; color: var(--dim); font: inherit; cursor: pointer; }
.studio-phone-bar .ic { width: 20px; height: 20px; }
.studio-phone-bar small { max-width: 100%; overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.studio-phone-bar button[aria-current="page"] { color: var(--gold); }
/* SPEC-071 RF1.4: a sheet opens between the site bar (72px) and the phone bar (75px), never over them. */
.studio-sheet { --menu-fade: var(--surface); position: fixed; inset: auto 10px 75px; width: min(430px, calc(100% - 20px)); max-height: min(80vh, 680px, calc(100vh - 72px - 75px - 12px)); margin: 0 0 0 auto; padding: 18px; overflow: auto;
                border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--sh-card); }
.studio-sheet::backdrop { background: rgba(10, 13, 19, .38); backdrop-filter: blur(3px); }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-heading .menu-heading { margin: 0; }
.sheet-close { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font: inherit; font-size: 19px; cursor: pointer; }
.studio-sheet .menu-entry, .studio-sheet .menu-book-row { min-height: 44px; }
.studio-sheet .menu-section { margin-top: 10px; }

/* ── The sidebar (desktop) ── */
@media (min-width: 900px) {
  /* SPEC-070 RF-D2: a short bottom padding, so at the end of a short page the sticky menu is not
     pushed up under the site's translucent bar (the dark band). */
  .estudio { max-width: 80.25rem; padding-bottom: 1rem; overflow-x: clip; }
  .estudio-cabecera { display: none; }
  .estudio-columnas { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2rem; align-items: start; }
  /* SPEC-070: room under the content for the fixed «Asistencia» button (the studio's own padding is short). */
  .estudio-columnas > :not(.studio-sidebar) { padding-bottom: 4rem; }
  .studio-sidebar { --studio-sidebar-top: calc(72px + 1rem); position: sticky; top: var(--studio-sidebar-top); display: flex; height: calc(100vh - var(--studio-sidebar-top) - 1rem); flex-direction: column; align-items: stretch;
                    width: 272px; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); box-sizing: border-box; --menu-fade: var(--surface); transition: width .18s ease; }
  .studio-sidebar-top { display: flex; justify-content: flex-end; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .studio-sidebar-toggle { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
  .studio-sidebar-toggle:hover { border-color: var(--line-2); color: var(--ink); }
  .studio-sidebar-toggle .ic { width: 16px; height: 16px; transition: transform .2s ease; }
  /* The menu scrolls inside; the footer stays visible below it. */
  .studio-menu { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 6px -4px; padding: 0 4px 2px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; scrollbar-gutter: stable; scroll-snap-type: y proximity; scroll-padding-bottom: 28px; }
  .studio-menu::-webkit-scrollbar { width: 6px; }
  .studio-menu::-webkit-scrollbar-track { background: transparent; }
  .studio-menu::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--line-2); }
  .studio-menu :is(.menu-entry, .menu-disclosure, .menu-heading, .menu-divider, .menu-book-row) { scroll-snap-align: start; }
  .studio-menu::after { position: sticky; bottom: 0; display: block; height: 28px; margin: 0 -4px; background: linear-gradient(to bottom, transparent, var(--menu-fade, var(--surface))); pointer-events: none; content: ""; }
  .studio-menu .menu-entry, .studio-menu .menu-disclosure { min-height: 34px; }
  .studio-menu .menu-book-row { min-height: 30px; }
  .studio-menu .menu-book-filter-input { min-height: 30px; }
  .studio-main { min-width: 0; max-width: 60rem; }
  .studio-sidebar-avatar-slot { display: block; }
  .studio-phone-bar { display: none; }
  /* Collapsed to a 64px rail: icons with their tooltips (title); the state is remembered. */
  .estudio-columnas[data-sidebar="closed"] .studio-sidebar { width: 64px; padding-inline: 7px; }
  .estudio-columnas[data-sidebar="closed"] .studio-sidebar-top { justify-content: center; }
  .estudio-columnas[data-sidebar="closed"] .studio-sidebar-toggle .ic { transform: rotate(180deg); }
  .estudio-columnas[data-sidebar="closed"] :is(.menu-heading, .menu-label, .menu-number, .menu-badge, .menu-count, .menu-caret, .menu-book-list, .menu-account-copy) { display: none; }
  .estudio-columnas[data-sidebar="closed"] .menu-divider { height: 1px; margin: 6px 10px; overflow: hidden; border-top: 1px solid var(--line); color: transparent; }
  .estudio-columnas[data-sidebar="closed"] :is(.menu-entry, .menu-disclosure, .menu-footer-link) { justify-content: center; padding-inline: 0; }
  .estudio-columnas[data-sidebar="closed"] .menu-entry[aria-current="page"]::before { inset-block: 8px; }
  .estudio-columnas[data-sidebar="closed"] .menu-account { justify-content: center; padding-inline: 0; }
  .estudio-columnas[data-sidebar="closed"] .menu-balance { align-items: center; padding-inline: 0; }
  .estudio-columnas[data-sidebar="closed"] :is(.menu-balance-amount, .menu-balance-topup) { display: none; }
  .estudio-columnas[data-sidebar="closed"] .menu-balance-short { display: inline-flex; min-height: 32px; align-items: center; color: var(--ink); font-size: .74rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .studio-sidebar { width: 244px; }
  .menu-book-rows.is-scrollable { max-height: 174px; }
}
@media (max-width: 899px) {
  .studio-sidebar { display: none; }
  .studio-main { display: block; min-width: 0; }
  .estudio-avatar-slot { display: contents; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-sidebar, .menu-caret, .studio-sidebar-toggle .ic { transition: none !important; }
}

/* The avatar opens «Mi cuenta». */
.estudio-avatar { padding: 0; cursor: pointer; }

/* Buttons: the gold one is THE next step; everything else is quieter. */
.estudio .btn-primario, .estudio .btn-secundario, .estudio .btn-tenue, .estudio .btn-enlace { min-height: 44px; }
.estudio .btn-primario { background: var(--studio-gold); border-color: var(--studio-gold); color: var(--studio-on-gold); font-weight: 600; }
.estudio .btn-primario:hover { background: var(--studio-gold); filter: brightness(1.08); }
.estudio .btn-primario:disabled { opacity: .6; cursor: default; }
.btn-enlace { font: inherit; background: none; border: 0; padding: .5rem 0; color: var(--muted);
              text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.btn-enlace:hover { color: var(--ink); }

/* Welcome, with no book yet. */
.studio-welcome { max-width: 34rem; }
.studio-welcome h1 { font-family: Fraunces, Georgia, serif; font-size: clamp(1.6rem, 5vw, 2.2rem); margin: 0 0 1rem; }
.welcome-steps { margin: 0 0 1rem; padding-left: 1.25rem; display: grid; gap: .4rem; }
.welcome-steps small { color: var(--dim); margin-left: .35rem; }
.studio-welcome .btn-primario { width: 100%; max-width: 22rem; }
.studio-welcome .btn-enlace { display: block; margin-top: .5rem; }

/* «Mis libros», with several books: one card per book. */
.book-cards { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; }
.book-card { border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; background: var(--surface);
             display: grid; gap: .35rem; cursor: pointer; }
.book-card:hover { border-color: var(--line-2); }
.book-card-title { font-family: Fraunces, Georgia, serif; font-size: 1.15rem; margin: 0; }
.book-card-next { margin: 0; color: var(--muted); font-size: .92rem; }
.book-card .btn-primario, .book-card .btn-secundario { justify-self: start; margin-top: .35rem; }

/* The book page (SPEC-037): the band on top (cover, title, pen name and
   language, the six steps), then «Te toca a ti», the quiet links, the space
   of the book (one block per kind of material) and its history. */
.book-band { margin: 0 0 1.25rem; padding: 1.25rem 1.4rem 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); color: var(--ink); }
.book-band .btn-enlace { color: var(--muted); }
.book-band-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 1rem; align-items: start; }
.book-band-copy { min-width: 0; }
.book-eyebrow { margin: 0 0 .4rem; color: var(--gold); font-size: .64rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.book-eyebrow .state-text[data-state="attention"] { color: var(--gold); }
.book-eyebrow .state-text[data-state="progress"], .book-eyebrow .state-text[data-state="idle"] { color: var(--dim); }
.book-head { display: flex; align-items: flex-start; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
/* SPEC-070 RF-D3: a long title wraps beside its pencil, never pushing it to a line of its own. */
.book-head h1 { font-family: Fraunces, Georgia, serif; font-size: clamp(1.5rem, 5vw, 2.1rem); margin: 0; min-width: 0; overflow-wrap: anywhere;
                flex: 0 1 auto; max-width: calc(100% - 2.75rem); }
.book-head .book-sub { flex-basis: 100%; }
.book-head .libro-renombrar { width: 34px; height: 34px; opacity: .8; margin-top: .2rem; }
.book-head .libro-renombrar .ic { width: 15px; height: 15px; margin: 0; }
.book-sub { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .9rem; }
.book-sub:empty { display: none; }
.book-sub p { margin: 0; }
.book-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem; margin-top: .6rem; }
.book-meta:empty { display: none; }
.book-meta-item { display: inline-flex; align-items: baseline; gap: .5rem; font-size: .8rem; color: var(--ink); }
.book-meta-item > span:first-child { color: var(--dim); font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.book-meta-item .btn-enlace { min-height: 0; padding: 0; font-size: .78rem; }

/* The cover thumbnail: the chosen one when there is one, a dashed placeholder otherwise. */
.book-cover { width: 72px; }
.cover-art { position: relative; display: flex; width: 100%; aspect-ratio: 2 / 3; align-items: flex-end; justify-content: center; overflow: hidden;
             border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--dim); box-shadow: var(--sh-card); }
.cover-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-art.is-placeholder { border-style: dashed; border-color: var(--line-2); box-shadow: none; align-items: center; }
.cover-art.is-placeholder span { font-size: .6rem; text-align: center; padding: 0 4px; }

.step-line { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; }
.step-line button { width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: .3rem;
                    padding: .25rem 0; border: 0; background: none; color: var(--dim); font: inherit; font-size: .7rem; cursor: pointer; }
.step-line button::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); }
.step-line [data-state="done"] button { color: var(--muted); }
.step-line [data-state="done"] button::before { background: var(--gold); border-color: var(--gold); opacity: .7; }
.step-line [data-state="here"] button { color: var(--gold); font-weight: 600; }
.step-line [data-state="here"] button::before { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(205,169,78,.22); }
.step-line button[aria-current="step"] { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 600px) { .step-line button { font-size: .8rem; } }
/* SPEC-070 RF-D3: on a phone the last step («Descargar», the longest word) gets a wider column and
   the line uses the band's full width, so «Revisar» and «Descargar» never touch. */
@media (max-width: 599px) { .step-line { grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 1.3fr); margin-left: -10px; margin-right: -10px; } }

.estudio .next-card { border: 1px solid var(--gold); border-radius: .9rem; padding: 1.1rem 1.1rem 1.25rem; background: var(--surface); }
.next-card[data-turn="avl"] { border-color: var(--line-2); }
.next-turn { margin: 0 0 .35rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.next-card[data-turn="avl"] .next-turn { color: var(--muted); }
.next-card h2 { font-family: Fraunces, Georgia, serif; font-size: 1.35rem; margin: 0 0 .35rem; }
.next-card p { margin: 0 0 .5rem; }
.next-card .btn-primario { width: 100%; margin-top: .5rem; }
@media (min-width: 600px) { .next-card .btn-primario { width: auto; } }

/* The quiet links under the card; «Descargar todo» only when something was delivered. */
.book-links { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.4rem; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.book-links .btn-enlace { min-height: 36px; font-size: .88rem; }
.book-links .book-download-all { margin: 0 0 0 auto; }
.book-links .book-download-all[hidden] { display: none !important; }

.book-section { margin-top: 1.5rem; }
.book-section h2 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; font-weight: 600; }
.pending-list, .files-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.pending-list .btn-enlace { color: var(--ink); text-decoration: none; }
.pending-list .btn-enlace::before { content: "▸ "; color: var(--gold); }
.files-list li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.book-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-top: 1.75rem; }

/* The book's space (js/espacio.js): one block per kind of material, accumulated over time. */
.book-space { margin-top: 1.75rem; }
.space-title { margin: 0 0 .75rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.space-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.space-block { display: flex; min-width: 0; flex-direction: column; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); scroll-margin-top: 20px; }
.space-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .25rem; }
.space-head .ic { color: var(--gold); }
.space-head h3 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.05rem; font-weight: 500; }
.space-list { flex: 1; margin: 0; padding: 0; list-style: none; }
.space-row { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.space-row.is-empty .space-row-name { font-style: italic; color: var(--dim); }
.space-row.is-stack { flex-direction: column; align-items: stretch; }
.space-row-name { min-width: 0; overflow-wrap: anywhere; font-size: .82rem; }
.space-row-meta { margin-left: .4rem; color: var(--dim); font-size: .7rem; }
.space-row-meta::before { content: "· "; }
.space-row .btn-enlace, .space-row .btn-secundario { min-height: 36px; font-size: .8rem; }
.space-row .btn-secundario { margin-top: 0; padding: .35rem .7rem; }
.space-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.space-cover { display: flex; align-items: center; gap: .6rem; }
.space-cover .cover-art { width: 36px; box-shadow: none; }
.space-history { margin: 1.5rem 0 0; padding: 0; list-style: none; }
.space-history li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); font-size: .82rem; }
.space-history-date { color: var(--dim); font-variant-numeric: tabular-nums; }
.space-history-empty { margin: 0; padding: .6rem 0; border-top: 1px solid var(--line); color: var(--dim); font-size: .82rem; }
@media (max-width: 640px) { .space-grid { grid-template-columns: 1fr; } .space-history li { grid-template-columns: 92px minmax(0, 1fr); } }
/* SPEC-056: the services a book the author brought usually wants (menu and space), never the only ones. */
.space-block.is-natural { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.space-natural { margin-left: auto; padding: .1rem .5rem; border: 1px solid var(--gold); border-radius: 20px; color: var(--gold); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
/* Owner, 2026-11-10: in the menu every entry is grey except the one on screen, so a recommended service carries
   no gold icon or dot there (its hint stays in the entry's title and aria-label; the space cards show «Recomendado»). */
/* SPEC-056: the panel of a book the author brought (js/ficha-libro.js): its files and its sheet. */
.own-book { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); }
.own-book h2 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.15rem; font-weight: 500; }
.own-lede { margin: .25rem 0 .5rem; color: var(--muted); font-size: .85rem; }
.own-files { margin: 0; padding: 0; list-style: none; }
.own-file { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.own-file-copy { display: flex; min-width: 0; flex-direction: column; gap: .1rem; font-size: .85rem; }
.own-file-name { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.own-file .btn-enlace { min-height: 44px; font-size: .82rem; }
.own-file-progress { width: 100%; height: .4rem; accent-color: var(--gold); }
.own-file-status { width: 100%; font-size: .8rem; color: var(--muted); }
.own-file-status[data-kind="error"] { color: #f0a0a0; }
:root[data-theme="light"] .own-file-status[data-kind="error"] { color: #a32020; }
.own-sheet { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.own-sheet h3 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.05rem; font-weight: 500; }
.own-sheet-lede, .own-sheet-hint { margin: .2rem 0 0; color: var(--muted); font-size: .8rem; }
.own-sheet-form { display: flex; flex-direction: column; gap: .75rem; }
.own-sheet-field { display: flex; flex-direction: column; gap: .3rem; }
.own-sheet-field label { font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.own-sheet-input { width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--line-2, var(--line)); border-radius: .5rem;
                   background: transparent; color: inherit; font: inherit; }
textarea.own-sheet-input { min-height: 7rem; resize: vertical; }
.own-sheet-input option { color: initial; }
.own-sheet-error { margin: 0; color: #f0a0a0; font-size: .9rem; }
:root[data-theme="light"] .own-sheet-error { color: #a32020; }
.own-sheet-error[hidden] { display: none !important; }
.own-sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.own-sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.own-sheet-values { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: .35rem 1rem; margin: .6rem 0 0; font-size: .85rem; }
.own-sheet-values dt { color: var(--muted); }
.own-sheet-values dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
@media (max-width: 640px) { .own-sheet-values { grid-template-columns: 1fr; } .own-sheet-values dd { margin-bottom: .4rem; } }

.step-panel { margin-top: .5rem; }
.step-panel > h2 { font-family: Fraunces, Georgia, serif; font-size: 1.3rem; margin: 0 0 .5rem; }
.step-back { display: inline-block; margin-top: 1.5rem; }
.step-note { color: var(--muted); }

/* «Probar gratis un capítulo» (js/promociones.js) in its own quiet view. */
.free-panel h1 { font-family: Fraunces, Georgia, serif; font-size: clamp(1.4rem, 4vw, 1.9rem); margin: .25rem 0 .25rem; }

/* The service host (js/servicios.js) and its placeholder until it lands. */
.service-placeholder { max-width: 34rem; color: var(--muted); }
.service-placeholder h1 { font-family: Fraunces, Georgia, serif; font-size: 1.6rem; margin: 0 0 .5rem; color: var(--ink); }

/* The other tabs: what the module mounts, or a short placeholder. */
.tab-placeholder { max-width: 34rem; }
.tab-placeholder h1 { font-family: Fraunces, Georgia, serif; font-size: 1.6rem; margin: 0 0 .5rem; }

/* The engine's closed catalogue rides in a <template> (tools/comprueba_catalogo.py); never shown. */
template { display: none !important; }

/* ── El riel del libro ────────────────────────────────────────────────────
   Dice en que punto esta la obra. Viaja en el HTML con los cuatro pasos ya
   escritos: solo se le marca cual es el actual. */
.riel { list-style: none; display: flex; align-items: center; flex-wrap: wrap;
        gap: .35rem .5rem; margin: 0 0 1.2rem; padding: 0;
        font-size: .72rem; letter-spacing: .04em; color: var(--dim); }
.riel li { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.riel li::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
                   background: var(--line-2); flex: 0 0 auto; }
.riel li + li { margin-left: .35rem; }
.riel li[data-estado="hecho"]::before { background: var(--gold); opacity: .6; }
.riel li[data-estado="aqui"] { color: var(--gold); }
.riel li[data-estado="aqui"]::before { background: var(--gold);
                                       box-shadow: 0 0 0 3px rgba(205,169,78,.18); }

/* ── La tienda, dentro del estudio ────────────────────────────────────────
   Mismo marco, misma tipografia, mismo oro. Comprar es parte del recorrido. */
.tienda-cabecera h2 { font-family: Fraunces, Georgia, serif; font-size: 1.45rem; margin: 0 0 .25rem; }
.estudio-apunte { color: var(--muted); margin: 0 0 1.25rem; font-size: .92rem; }
.tienda-largos { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.largo { font: inherit; font-size: .8rem; padding: .4rem .75rem; border-radius: 999px;
         border: 1px solid var(--line); background: none; color: var(--muted);
         cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.largo:hover { color: var(--ink); border-color: var(--line-2); }
.largo--activo { color: var(--gold); border-color: var(--gold); background: rgba(205,169,78,.10); }

.planes { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.plan { position: relative; display: flex; flex-direction: column; gap: .2rem;
        border: 1px solid var(--line); border-radius: .7rem; padding: 1rem;
        background: var(--surface); }
.plan--destaca { border-color: var(--gold); background: rgba(205,169,78,.07); }
.plan--elegido { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.plan-cinta { position: absolute; top: -.6rem; right: .9rem; font-size: .6rem;
              letter-spacing: .1em; text-transform: uppercase; color: var(--on-gold);
              background: var(--gold); border-radius: 999px; padding: .15rem .5rem; }
.plan-tag { font-size: .62rem; letter-spacing: .11em; text-transform: uppercase; color: var(--dim); }
.plan-nombre { font-family: Fraunces, Georgia, serif; font-size: 1.15rem; margin: 0; }
.plan-precio { font-family: Fraunces, Georgia, serif; font-size: 1.3rem; color: var(--gold);
               margin: .1rem 0 .35rem; font-variant-numeric: tabular-nums; }
.plan-desc { margin: 0 0 .9rem; font-size: .82rem; color: var(--muted); line-height: 1.5; }
.plan-elegir { margin-top: auto; font: inherit; font-size: .85rem; cursor: pointer;
               padding: .5rem .75rem; border-radius: .5rem; border: 1px solid var(--line-2);
               background: none; color: inherit; transition: background .15s, border-color .15s; }
.plan-elegir:hover { background: var(--surface-2); border-color: var(--gold); }
.plan--destaca .plan-elegir { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }

/* El esqueleto de la tienda: nunca un rectangulo vacio mientras viaja el JSON. */
.plan--hueso { gap: .5rem; }
.hueso { display: block; background: rgba(128,128,128,.14); border-radius: .3rem; }
.hueso--titulo { height: 1.2rem; width: 60%; }
.hueso--precio { height: 1.1rem; width: 35%; }
.hueso--linea { height: .7rem; width: 100%; }
.hueso--linea.corta { width: 70%; }

/* The work */
.estudio-obra-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.estudio-obra h2, .estudio-detalle h2 { font-family: Fraunces, Georgia, serif; font-size: 1.25rem; margin: 0; }
.libro { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
         padding: .75rem .9rem; border-radius: .6rem; border: 1px solid rgba(128,128,128,.28);
         background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.libro:hover { border-color: rgba(128,128,128,.55); }
.libro--activo { border-color: currentColor; background: rgba(128,128,128,.10); }
.libro-titulo { font-weight: 500; }

.estado { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .5rem;
          border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; opacity: .85; }
.estado--processing, .encargo--sent .estado { color: #e0b878; }
.estado--available, .estado--published, .encargo--done .estado { color: #8fd1a8; }
.encargo--failed .estado { color: #f0a0a0; }

.estudio-vacio { opacity: .55; font-size: .9rem; margin: .5rem 0 0; }

/* ── Renombrar un borrador (RF7) ─────────────────────────────────────────
   Un lápiz discreto, nunca `window.prompt`: el título se convierte en un
   campo en el mismo sitio donde ya estaba. */
.libro-renombrar { flex: 0 0 auto; width: 1.6rem; height: 1.6rem; padding: 0;
                    display: inline-flex; align-items: center; justify-content: center;
                    font-size: .8rem; line-height: 1; cursor: pointer; color: inherit;
                    background: none; border: 1px solid var(--line); border-radius: .4rem;
                    opacity: .6; transition: opacity .15s, border-color .15s; }
.libro-renombrar:hover { opacity: 1; border-color: var(--gold); }
.libro-renombrar[hidden] { display: none; }

.renombrar-fila { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.renombrar-campo { font: inherit; font-size: .9rem; padding: .35rem .55rem;
                    border-radius: .4rem; border: 1px solid var(--line-2);
                    background: var(--surface); color: inherit; min-width: 10rem; }
.renombrar-guardar, .renombrar-cancelar { font-size: .78rem; padding: .35rem .6rem; }

/* The book at hand */
.detalle-cabecera { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.detalle-datos { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.25rem; margin: 0 0 2rem; font-size: .92rem; }
.detalle-datos dt { opacity: .6; }
.detalle-datos dd { margin: 0; }

.bloque { padding-top: 1.75rem; border-top: 1px solid rgba(128,128,128,.22); margin-top: 1.75rem; }
.bloque h3 { font-family: Fraunces, Georgia, serif; font-size: 1.05rem; margin: 0 0 .25rem; }
.bloque-nota { margin: 0 0 1rem; font-size: .85rem; opacity: .6; }

.turnos { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.turno { padding: .75rem .9rem; border-radius: .6rem; background: rgba(128,128,128,.10); }
.turno--editorial { background: rgba(128,128,128,.18); }
.turno-quien { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; opacity: .55; margin-bottom: .35rem; }
.turno p { margin: 0; }

.decir { display: flex; gap: .75rem; align-items: flex-end; }
.decir textarea { flex: 1; resize: vertical; padding: .7rem .85rem; border-radius: .6rem;
                  border: 1px solid rgba(128,128,128,.35); background: transparent; color: inherit; font: inherit; }

.canon, .encargos, .entregas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.canon li, .encargo, .entregas li { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
                                    padding: .6rem .8rem; border-radius: .5rem; border: 1px solid rgba(128,128,128,.22); }
.canon-tipo { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.canon code { font-size: .8rem; opacity: .8; overflow-x: auto; }
.encargo { justify-content: space-between; }
.encargo-error { flex-basis: 100%; margin: .35rem 0 0; font-size: .85rem; color: #f0a0a0; }
.entrega-peso { margin-left: auto; opacity: .6; font-size: .85rem; }

.detalle-pie { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(128,128,128,.22); }

.btn-primario, .btn-secundario, .btn-peligro {
  font: inherit; cursor: pointer; padding: .55rem 1rem; border-radius: .5rem; border: 1px solid currentColor; background: transparent; color: inherit;
}
.btn-primario { background: rgba(128,128,128,.18); font-weight: 500; }
.btn-primario:hover { background: rgba(128,128,128,.28); }
.btn-secundario { margin-top: 1rem; opacity: .85; }
.btn-peligro { color: #f0a0a0; }
.btn-primario:hover, .btn-secundario:hover, .btn-peligro:hover { opacity: 1; filter: brightness(1.1); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Starting a book. The engine needs a genre from a closed catalogue and one of
   three lengths, so this asks for exactly that and nothing else. */
/* Fondo y tinta de los tokens del SITIO, nunca del sistema.
   Aquí decía `background: canvas`, que es un color del sistema operativo: en un
   Mac con el modo claro puesto resolvía a BLANCO, mientras el texto heredaba el
   casi-blanco del tema oscuro que el sitio fuerza. Resultado: el diálogo entero
   ilegible -- título, etiquetas y el botón «Crear» invisibles. El tema del sitio
   lo manda `data-theme`, así que el diálogo tiene que vestirse de ahí. */
.nuevo-libro { border: 1px solid var(--line, rgba(128,128,128,.35)); border-radius: .8rem; padding: 0;
               background: var(--surface, #121823); color: var(--ink, #ece9e1);
               max-width: 30rem; width: calc(100% - 2rem); }
.nuevo-libro::backdrop { background: rgba(0,0,0,.6); }
.nuevo-libro form { display: flex; flex-direction: column; gap: .5rem; padding: 1.75rem; }
.nuevo-libro h2 { font-family: Fraunces, Georgia, serif; margin: 0; font-size: 1.3rem; }
.nuevo-libro label { font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; opacity: .6; margin-top: .75rem; }
.nuevo-libro input, .nuevo-libro select {
  font: inherit; padding: .6rem .75rem; border-radius: .5rem; color: inherit;
  border: 1px solid rgba(128,128,128,.35); background: transparent; width: 100%;
}
.nuevo-libro select option { color: initial; }
.nuevo-libro menu { display: flex; gap: .75rem; justify-content: flex-end; margin: 1.5rem 0 0; padding: 0; }
.nuevo-libro-error { margin: .75rem 0 0; color: #f0a0a0; font-size: .9rem; }
.nuevo-libro-error[hidden] { display: none !important; }
/* SPEC-056: «¿Cómo llega tu libro?» and the own book's fields. The dialog scrolls on a phone. */
.nuevo-libro { max-height: calc(100vh - 2rem); overflow-y: auto; }
.nl-question { margin: .5rem 0 0; font-weight: 600; }
.nl-origin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.nl-origin-choice { display: flex; min-height: 44px; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .7rem .8rem;
                    border: 1px solid var(--line, rgba(128,128,128,.35)); border-radius: .5rem; background: transparent; color: inherit;
                    font: inherit; text-align: left; cursor: pointer; }
.nl-origin-choice small { color: var(--muted, inherit); font-size: .8rem; line-height: 1.35; }
.nl-origin-choice[aria-checked="true"] { border-color: var(--gold, #cda94e); box-shadow: inset 3px 0 0 var(--gold, #cda94e); }
.nl-own { display: flex; flex-direction: column; gap: .5rem; }
.nl-own[hidden] { display: none !important; }
.nuevo-libro label.nl-check { display: flex; align-items: center; gap: .5rem; text-transform: none; letter-spacing: 0; opacity: 1; font-size: .9rem; }
.nuevo-libro .nl-check input { width: auto; }
.nuevo-libro input[type="file"] { padding: .45rem; font-size: .85rem; }
.nl-progress { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; font-size: .85rem; }
.nl-progress progress { width: 100%; height: .5rem; accent-color: var(--gold, #cda94e); }
.nl-progress[hidden] { display: none !important; }
@media (max-width: 480px) { .nl-origin { grid-template-columns: 1fr; } .nuevo-libro form { padding: 1.25rem 1rem; } }

/* ── The interview ────────────────────────────────────────────────────────
   The map sits behind the conversation, dimmed, and the conversation floats
   over it. Everything here is built so that the eye goes to the words and the
   map is only felt. */

.entrevista { position: relative; isolation: isolate; overflow: hidden;
              border-radius: .9rem; padding: 1.75rem 1.5rem 1.5rem;
              border: 1px solid rgba(190,160,90,.22); }
.entrevista::before { /* a warm pool of light under the conversation */
  content: ''; position: absolute; inset: -40% -20% auto -20%; height: 90%;
  background: radial-gradient(ellipse at 50% 0%, rgba(190,160,90,.13), transparent 62%);
  pointer-events: none; z-index: -2;
}
.entrevista-mapa { position: absolute; inset: 0; z-index: -1; opacity: 0;
                   transition: opacity 1.6s ease; pointer-events: none; }
.entrevista-mapa[data-listo] { opacity: .42; }           /* it fades in, never pops */
.entrevista-mapa[data-explorando] { opacity: 1; z-index: 1; pointer-events: auto; }
.entrevista-frente { position: relative; z-index: 2; }

.entrevista-cabecera { display: flex; gap: 1.5rem; align-items: flex-start;
                       justify-content: space-between; flex-wrap: wrap; }
.entrevista-cabecera h3 { margin-bottom: .25rem; }

/* The three modes, as one object rather than three buttons. */
.modos { display: inline-flex; border: 1px solid rgba(190,160,90,.35);
         border-radius: 999px; padding: .2rem; background: rgba(0,0,0,.18); }
.modos button { font: inherit; font-size: .8rem; letter-spacing: .02em;
                padding: .4rem .9rem; border: 0; border-radius: 999px;
                background: transparent; color: inherit; cursor: pointer;
                opacity: .62; transition: background .25s ease, opacity .25s ease; }
.modos button:hover { opacity: .9; }
.modos button[aria-checked="true"] { background: rgba(190,160,90,.22); opacity: 1; font-weight: 500; }
.modo-explica { margin: .6rem 0 1.25rem; font-size: .85rem; opacity: .55; max-width: 60ch; }

.entrevista-controles { display: flex; align-items: center; gap: 1rem;
                        flex-wrap: wrap; margin: 1.25rem 0; }

/* The one control that matters on this screen. */
.hablar { display: inline-flex; align-items: center; gap: .7rem;
          font: inherit; font-size: .95rem; padding: .7rem 1.4rem .7rem 1.1rem;
          border-radius: 999px; cursor: pointer; color: inherit;
          border: 1px solid rgba(190,160,90,.55); background: rgba(190,160,90,.10);
          transition: background .25s ease, border-color .25s ease, transform .12s ease; }
.hablar:hover { background: rgba(190,160,90,.18); border-color: rgba(190,160,90,.8); }
.hablar:active { transform: scale(.985); }
.hablar-icono { width: .7rem; height: .7rem; border-radius: 50%;
                background: #c9a961; box-shadow: 0 0 0 0 rgba(201,169,97,.55); }

/* Listening: a slow pulse, like something paying attention. */
.hablar[data-estado="escuchando"] .hablar-icono { animation: latido 2.4s ease-out infinite; }
@keyframes latido {
  0%   { box-shadow: 0 0 0 0 rgba(201,169,97,.5); }
  70%  { box-shadow: 0 0 0 .75rem rgba(201,169,97,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,169,97,0); }
}
/* Speaking: steady and lit, not pulsing — it is the one talking now. */
.hablar[data-estado="hablando"] .hablar-icono { background: #e8d5a3; box-shadow: 0 0 .9rem rgba(232,213,163,.75); }
.hablar[data-estado="conectando"] .hablar-icono { animation: latido 1s ease-out infinite; }
.hablar[data-activo] { background: rgba(190,160,90,.2); border-color: rgba(190,160,90,.85); }

.entrevista-estado { margin: 0; font-size: .85rem; opacity: .6; min-height: 1.2em; }
.btn-tenue { font: inherit; font-size: .82rem; background: none; border: 0;
             color: inherit; opacity: .55; cursor: pointer; text-decoration: underline;
             text-underline-offset: .25em; padding: 0; }
.btn-tenue:hover { opacity: .85; }

/* Turns, over the map: legible without a box that hides what is behind. */
.entrevista .turnos { max-height: 22rem; overflow-y: auto; padding-right: .5rem; }
.entrevista .turno { background: rgba(12,14,20,.55); backdrop-filter: blur(6px); }
.entrevista .turno--editorial { background: rgba(190,160,90,.12); }
.entrevista .turno { animation: llega .45s ease both; }
@keyframes llega { from { opacity: 0; transform: translateY(.4rem); } }

@media (prefers-reduced-motion: reduce) {
  .hablar-icono, .entrevista .turno { animation: none !important; }
  .entrevista-mapa { transition: none; }
}

/* Who you are and how to stop being them. Both were missing: the studio
   showed a name that could be anyone's and offered no way out. */
.estudio-sesion { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.estudio-sesion .estudio-quien { font-size: .9rem; }

/* El avatar junto al correo (parte A de RF6): redondo, 32px, iniciales hasta
   que llega la foto. Sin imágenes propias -- lo que no tiene foto muestra
   letras, nunca un hueco vacío. */
.estudio-avatar { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
                   overflow: hidden; display: inline-flex; align-items: center;
                   justify-content: center; background: var(--surface-2);
                   border: 1px solid var(--line-2); color: var(--gold);
                   font-size: .72rem; font-weight: 600; letter-spacing: .02em;
                   text-transform: uppercase; }
.estudio-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }


/* Skeletons for the first visit: the shape of what will appear, so the eye
   already knows where to look (~30% faster perceived than a spinner). */
body.cargando #sinLibros { display: none !important; }
body.cargando .lista-libros:empty::before, body.cargando .lista-libros:empty::after {
  content: ''; display: block; height: 2.9rem; border-radius: .6rem; margin-bottom: .5rem;
  background: linear-gradient(90deg, rgba(128,128,128,.10) 25%, rgba(128,128,128,.22) 50%, rgba(128,128,128,.10) 75%);
  background-size: 200% 100%; animation: respira 1.4s ease-in-out infinite; }
body.cargando .lista-libros:empty::after { opacity: .6; animation-delay: .2s; }
@keyframes respira { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.estudio-frescura { margin: 0; font-size: .78rem; opacity: .5; letter-spacing: .02em; }
@media (prefers-reduced-motion: reduce) { body.cargando .lista-libros:empty::before, body.cargando .lista-libros:empty::after { animation: none; } }

/* ── Tu manuscrito ───────────────────────────────────────────────────────
   Recibir el texto que el autor ya tiene. Se acepta cualquier formato, así
   que la zona no promete una lista de extensiones que luego habría que
   mantener: promete que lo que traiga, entra. */
.material-suelta { display: block; border: 1px dashed currentColor; border-radius: .6rem;
  padding: 1.4rem 1rem; text-align: center; cursor: pointer; opacity: .55;
  transition: opacity .15s ease, border-color .15s ease, background .15s ease; }
.material-suelta:hover, .material-suelta:focus-within { opacity: .9; }
.material-suelta[data-encima="1"] { opacity: 1; background: rgba(190,160,90,.08); }
.material-invita b { font-weight: 600; }

.material-lista { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.material-lista li { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap;
  padding: .6rem .8rem; border: 1px solid currentColor; border-radius: .5rem; opacity: .85; }
.material-nombre { font-weight: 600; }
.material-datos { font-size: .82rem; opacity: .65; margin-left: auto; }
.material-crudo { font-size: .78rem; opacity: .6; font-style: italic; }
.material-quitar { margin-left: .5rem; flex: 0 0 auto; }

/* Un aviso sin texto no debe dejar un hueco en la pagina. */
.estudio-aviso:empty { display: none; }

/* La nota del plan solo aparece cuando la tienda eligio uno. */
.nl-plan:empty { display: none; }

/* ── Tu libro, vacío (RF3) ────────────────────────────────────────────────
   Antes era una línea gris. Ahora explica los tres pasos del camino, dibuja
   el libro en CSS (sin imágenes) y ofrece un único botón, el que corresponde
   al momento del autor. */
.libro-vacio-host[hidden] { display: none; }
.libro-vacio { display: flex; flex-direction: column; gap: 1.5rem; max-width: 30rem;
               padding: 1.75rem 0; }

.libro-vacio-arte { width: 4.4rem; height: 5.4rem; position: relative; flex: 0 0 auto; }
.libro-vacio-lomo { position: absolute; left: 0; top: 0; bottom: 0; width: .85rem;
                    background: var(--gold); opacity: .85; border-radius: .3rem 0 0 .3rem; }
.libro-vacio-paginas { position: absolute; left: .65rem; right: 0; top: 0; bottom: 0;
                       background: var(--surface-2); border: 1px solid var(--line-2);
                       border-radius: 0 .3rem .3rem 0;
                       background-image: repeating-linear-gradient(to right,
                         transparent 0 .3rem, var(--line) .3rem .34rem); }

.libro-vacio-riel { list-style: none; margin: 0; padding: 0; counter-reset: paso;
                    display: flex; flex-direction: column; gap: .75rem; }
.libro-vacio-riel li { display: flex; align-items: flex-start; gap: .75rem; }
.libro-vacio-riel li::before { counter-increment: paso; content: counter(paso);
                               flex: 0 0 auto; width: 1.5rem; height: 1.5rem; margin-top: .05rem;
                               border-radius: 50%; border: 1px solid var(--gold); color: var(--gold);
                               font-size: .72rem; display: flex; align-items: center; justify-content: center; }
.libro-vacio-riel p { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--muted); }
.libro-vacio-riel b { font-family: Fraunces, Georgia, serif; color: var(--ink); font-weight: 500; }

.libro-vacio-apoyo { margin: 0; font-size: .85rem; color: var(--dim); }
.libro-vacio-apoyo:empty { display: none; }
.libro-vacio-accion[hidden] { display: none; }

/* ── Tu libro: leer y editar por capítulo ────────────────────────────────
   Recibir el borrador no es el final del recorrido. Se lee y se edita por
   capítulo: la columna de números a la izquierda de la hoja, la hoja como
   una hoja de verdad, y el historial debajo cuando se pide. */
.libro-cuerpo { display: grid; grid-template-columns: 118px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .libro-cuerpo { grid-template-columns: 1fr; } }

.capitulos { display: flex; flex-direction: column; gap: .3rem; }
.capitulos .etiqueta { font-size: .62rem; letter-spacing: .11em; text-transform: uppercase;
                       color: var(--dim); margin-bottom: .25rem; }
.cap { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
       font: inherit; font-size: .85rem; font-variant-numeric: tabular-nums;
       padding: .45rem .6rem; border-radius: .45rem; border: 1px solid var(--line);
       background: none; color: inherit; cursor: pointer; text-align: left;
       transition: border-color .15s, background .15s; }
.cap:hover { border-color: var(--line-2); }
.cap--activo { border-color: var(--gold); background: rgba(205,169,78,.10); }
.cap em { font-style: normal; font-size: .6rem; letter-spacing: .07em;
          text-transform: uppercase; color: var(--gold); }

.hoja-cabecera { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.hoja-cabecera h2 { font-family: Fraunces, Georgia, serif; font-size: 1.3rem; margin: 0; }
.autoria { font-size: .72rem; letter-spacing: .04em; color: var(--dim); cursor: pointer; }
.autoria:hover { color: var(--gold); }

/* La hoja se lee como una hoja: medida de lectura, no de pantalla. */
.hoja { max-width: 68ch; min-height: 18rem; padding: 1.5rem 1.6rem;
        border: 1px solid var(--line); border-radius: .6rem; background: var(--surface);
        font-family: Fraunces, Georgia, serif; font-size: 1.02rem; line-height: 1.75; }
.hoja:focus { outline: none; border-color: var(--gold); }
.hoja p { margin: 0 0 1rem; }
.hoja p:last-child { margin-bottom: 0; }
/* Las ediciones del autor, en oro; lo quitado, tachado y tenue. */
.hoja ins { text-decoration: none; color: var(--gold); background: rgba(205,169,78,.12);
            border-radius: .15rem; padding: 0 .1em; }
.hoja del { color: var(--dim); text-decoration: line-through; opacity: .75; }

.hoja-acciones { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.hoja-acciones .btn-secundario { margin-top: 0; }

.guardado { display: flex; align-items: center; gap: .4rem; font-size: .78rem;
            color: var(--dim); margin: .75rem 0 0; }
.guardado[data-estado="ok"] { color: #8fd1a8; }
.guardado[data-estado="error"] { color: #f0a0a0; }

.historial { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.historial h3 { font-family: Fraunces, Georgia, serif; font-size: 1.05rem; margin: 0 0 .25rem; }
.versiones { list-style: none; margin: 1rem 0 0; padding: 0; display: flex;
             flex-direction: column; gap: .5rem; }
.version { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
           font-size: .85rem; padding: .6rem .75rem; border-radius: .5rem;
           border: 1px solid var(--line); }
.version--actual { border-color: var(--gold); background: rgba(205,169,78,.08); }
.version span { color: var(--muted); }
.version .btn-tenue { margin-left: auto; }

/* ── El carrito, visible arriba (bloque E) ───────────────────────────────
   Mismo dorado y mismas esquinas que el resto del estudio -- nada de
   pildoras. El contador vive pegado al icono, nunca como una burbuja aparte. */
.carrito-boton { position: relative; display: inline-flex; align-items: center;
                 justify-content: center; width: 2.2rem; height: 2.2rem; padding: 0;
                 border: 1px solid var(--line); border-radius: .5rem; background: none;
                 color: inherit; cursor: pointer; transition: border-color .15s, color .15s; }
.carrito-boton:hover { border-color: var(--gold); color: var(--gold); }
.carrito-icono { width: 1.1rem; height: 1.1rem; }
.carrito-cuenta { position: absolute; top: -.4rem; right: -.4rem; min-width: 1.1rem;
                  height: 1.1rem; padding: 0 .25rem; border-radius: .4rem; background: var(--gold);
                  color: var(--on-gold); font-size: .65rem; line-height: 1.1rem; text-align: center;
                  font-variant-numeric: tabular-nums; }
.carrito-cuenta:empty, .carrito-cuenta[hidden] { display: none; }

.carrito-dialogo { border: 1px solid var(--line, rgba(128,128,128,.35)); border-radius: .8rem;
                   padding: 0; background: var(--surface, #121823); color: var(--ink, #ece9e1);
                   max-width: 32rem; width: calc(100% - 2rem); }
.carrito-dialogo::backdrop { background: rgba(0,0,0,.6); }
.carrito-dialogo header { display: flex; align-items: baseline; justify-content: space-between;
                           gap: 1rem; padding: 1.5rem 1.5rem 0; }
.carrito-dialogo h2 { font-family: Fraunces, Georgia, serif; margin: 0; font-size: 1.25rem; }
.carrito-dialogo > div { padding: 1rem 1.5rem 1.75rem; }

.carrito-lineas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.carrito-linea { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center;
                 gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.carrito-linea-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.carrito-linea-nombre { font-weight: 500; }
.carrito-linea-variante { font-size: .78rem; opacity: .6; }
.carrito-linea-subtotal { font-variant-numeric: tabular-nums; white-space: nowrap; }
.carrito-cantidad { display: inline-flex; align-items: center; gap: .3rem; }
.carrito-cantidad-input, .tienda-cantidad input {
  width: 2.6rem; text-align: center; font: inherit; padding: .25rem .2rem;
  border: 1px solid var(--line); border-radius: .4rem; background: transparent; color: inherit;
}
.cantidad-paso { width: 1.6rem; height: 1.6rem; padding: 0; border-radius: .4rem;
                 border: 1px solid var(--line); background: none; color: inherit;
                 cursor: pointer; font: inherit; line-height: 1; }
.cantidad-paso:hover { border-color: var(--gold); color: var(--gold); }
.carrito-quitar { white-space: nowrap; }
.carrito-total { display: flex; align-items: baseline; justify-content: space-between;
                 margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-2); font-size: 1.05rem; }
.carrito-total strong { font-family: Fraunces, Georgia, serif; color: var(--gold); }
.carrito-nota { margin: .6rem 0 0; font-size: .82rem; opacity: .65; }

/* ── La tienda: grupos y cantidad (bloque E) ─────────────────────────────── */
.tienda-grupo { margin-top: 1.75rem; }
.tienda-grupo-titulo { font-family: Fraunces, Georgia, serif; font-size: 1.1rem; margin: 0 0 .75rem; }
.tienda-cantidad { display: inline-flex; align-items: center; gap: .3rem; margin: .5rem 0 .6rem; }
.plan-variantes { font: inherit; font-size: .85rem; padding: .4rem .55rem; border-radius: .5rem;
                  border: 1px solid var(--line); background: transparent; color: inherit;
                  margin: .25rem 0; max-width: 100%; }
.plan-elegir[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Promociones y Estudio Editorial: hosts; el detalle vive en
   css/promociones.css y css/estudio-editorial.css, cargados aparte. ────── */
.estudio-promociones, .estudio-editorial { min-width: 0; }

/* ── La entrevista: bloqueada hasta la compra (bloque B) ─────────────────
   Mientras `.bloqueada` esté puesta, todo lo demás dentro del panel queda
   fuera de pantalla -- así nunca hay un fotograma con las ocho puertas y el
   aviso de bloqueo a la vez (CA18). */
#entrevistaPanel.bloqueada > :not(#entrevistaBloqueo) { display: none !important; }
.entrevista-bloqueo { max-width: 34rem; margin: 3rem auto; padding: 1.5rem;
                       border: 1px solid var(--line); border-radius: .7rem;
                       background: var(--surface); text-align: center; }
.entrevista-bloqueo-texto { margin: 0 0 1rem; font-size: 1.02rem; }

/* ── La entrevista, dentro del panel ─────────────────────────────────────
   Su hoja llega acotada bajo #entrevistaPanel (tools/scope_css.py), pero trae
   una medida pensada para cuando era una pagina suelta: `.fase` reservaba
   72px para la barra fija del sitio. Aqui esa reserva ya la hace el panel, y
   sin esto quedaban 136px de vacio negro encima de la primera pregunta. */
/* `.estudio` in front: css/entrevista-panel.css loads after this sheet with the same weight. */
.estudio #entrevistaPanel .fase { padding-top: 0; padding-left: 0; padding-right: 0; }
#entrevistaPanel { min-width: 0; }

/* ── La barra, como en Inicio ─────────────────────────────────────────────
   `.no-hero` se queda por la paleta (sin vídeo detrás, la tinta pálida del
   héroe no sirve), pero el fondo sigue la portada: transparente arriba y
   translúcido con desenfoque en cuanto se baja (`.scrolled`, site-nav.js). */
.site-nav.no-hero:not(.scrolled) { background: transparent; backdrop-filter: none; border-bottom-color: transparent; }

/* ── SPEC-002: servicios, solicitudes y compras ─────────────────────────
   Una sola forma de pedir cualquier servicio: la lista de cada card del
   Estudio Editorial, las cards de la Tienda y el diálogo «Solicitar». */
.menu-seccion--hija .menu-texto { font-size: .9em; }
.servicio-solicitar { margin-top: auto; white-space: nowrap; }
.plan .servicio-solicitar { margin-top: .75rem; }
.plan--destaca .servicio-solicitar { background: var(--gold); color: var(--on-gold); }
.plan-precios { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; margin: .4rem 0 .2rem;
                font-size: .85rem; }
.plan-precios dt { color: var(--muted); }
.plan-precios dd { margin: 0; font-family: Fraunces, Georgia, serif; color: var(--gold);
                   font-variant-numeric: tabular-nums; }

.servicios-lista { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.servicio-fila { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .5rem 1rem;
                 border: 1px solid var(--line); border-radius: .7rem; padding: .85rem 1rem; background: var(--surface); }
.servicio-texto { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.servicio-nombre { font-weight: 500; }
.servicio-detalle { font-size: .8rem; color: var(--muted); line-height: 1.45; }
.servicio-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; text-align: right; }
.servicio-precio { font-family: Fraunces, Georgia, serif; color: var(--gold); font-variant-numeric: tabular-nums; }
.servicio-entrega { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ee-panel { display: inline-block; margin-top: .5rem; }
/* SPEC-032 RF9.2: services not sold yet. The badge copies .pv-soon of the
   public pages; the request button stays visible but cannot be pressed. */
.servicio-soon { display: inline-block; align-self: flex-start; padding: .2rem .65rem; border: 1px solid currentColor;
                   border-radius: 999px; color: var(--gold); font-size: .62rem; font-style: normal; font-weight: 600;
                   letter-spacing: .14em; text-transform: uppercase; line-height: 1.4; vertical-align: middle; }
.cl-pillar-front .servicio-soon, .cl-pillar-back .servicio-soon { margin: .35rem 0; }
.taller h2 .servicio-soon { font-family: Inter, system-ui, sans-serif; margin-left: .35rem; }
.servicio-solicitar[disabled], .servicio-solicitar[aria-disabled="true"] { cursor: not-allowed; opacity: .45; filter: none; }
.servicio-solicitar[disabled]:hover { background: rgba(128,128,128,.18); filter: none; }
.servicio-fila--soon .servicio-nombre { opacity: .8; }
@media (max-width: 640px) {
  .servicio-fila { grid-template-columns: 1fr; }
  .servicio-meta { align-items: flex-start; text-align: left; }
}

.solicitud-dialogo { border: 1px solid var(--line, rgba(128,128,128,.35)); border-radius: .8rem; padding: 0;
                     background: var(--surface, #121823); color: var(--ink, #ece9e1);
                     max-width: 34rem; width: calc(100% - 2rem); max-height: calc(100vh - 2rem); }
.solicitud-dialogo::backdrop { background: rgba(0,0,0,.6); }
/* SPEC-070 RF-A1: the dialog hangs from <body>, outside .estudio, so it brings its own place and
   buttons: centred with a margin, the studio's gold «Enviar pedido», the quiet «Cancelar». */
.solicitud-dialogo { position: fixed; inset: 0; margin: auto; height: fit-content; overflow: auto;
                     box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.solicitud-dialogo .btn-primario { min-height: 44px; padding: .6rem 1.25rem; border-radius: .6rem; font-weight: 600;
                                   background: var(--studio-gold); border: 1px solid var(--studio-gold); color: var(--studio-on-gold); }
.solicitud-dialogo .btn-primario:hover { filter: brightness(1.08); }
.solicitud-dialogo .btn-primario:disabled { opacity: .6; cursor: default; }
.solicitud-dialogo .btn-tenue { min-height: 44px; font-size: .9rem; }
.solicitud-dialogo .solicitud-acciones { align-items: center; }
.solicitud-dialogo input[type="radio"], .solicitud-dialogo input[type="checkbox"] { accent-color: var(--gold, #cda94e); }
/* SPEC-070 RF-A2: what the author already chose on the service screen, read back before sending. */
.solicitud-resumen { margin: .6rem 0 .2rem; padding: .75rem 1rem; border: 1px solid var(--line-2, rgba(128,128,128,.3));
                     border-radius: .6rem; display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; }
.solicitud-resumen dt { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); align-self: center; }
.solicitud-resumen dd { margin: 0; font-weight: 500; }
@media (max-width: 420px) { .solicitud-resumen { grid-template-columns: 1fr; gap: .1rem; } .solicitud-resumen dd { margin-bottom: .45rem; } }
/* SPEC-070 RF-A1: the voice samples play from the studio's own button, the same row for every voice. */
.voice-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.voice-row .solicitud-opcion { flex: 1 1 14rem; }
.voice-play { flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .35rem .8rem;
              border-radius: 999px; border: 1px solid var(--line-2, rgba(128,128,128,.35)); background: transparent; color: inherit;
              font: inherit; font-size: .82rem; cursor: pointer; }
.voice-play:hover, .voice-play[aria-pressed="true"] { border-color: var(--gold, #cda94e); color: var(--gold, #cda94e); }
.voice-play-icon { width: 0; height: 0; border-style: solid; border-width: .38rem 0 .38rem .62rem;
                   border-color: transparent transparent transparent currentColor; }
.voice-play[aria-pressed="true"] .voice-play-icon { width: .62rem; height: .76rem; border: 0;
                   border-left: .2rem solid currentColor; border-right: .2rem solid currentColor; }
.solicitud-form { display: flex; flex-direction: column; gap: .35rem; padding: 1.5rem 1.75rem; }
.solicitud-form h2 { font-family: Fraunces, Georgia, serif; margin: 0 0 .25rem; font-size: 1.3rem; }
.solicitud-campo { display: flex; flex-direction: column; gap: .35rem; margin-top: .6rem; }
.solicitud-etiqueta { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; opacity: .65; }
.solicitud-form input[type="text"], .solicitud-form select, .solicitud-form textarea {
  font: inherit; padding: .55rem .75rem; border-radius: .5rem; color: inherit; width: 100%;
  border: 1px solid rgba(128,128,128,.35); background: transparent; }
.solicitud-form input[type="text"][hidden] { display: none; }
.solicitud-form select option { color: initial; }
.solicitud-opciones { display: flex; flex-wrap: wrap; gap: .4rem; }
.solicitud-opcion { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
                    border: 1px solid var(--line-2); border-radius: .5rem; padding: .4rem .65rem; font-size: .88rem; }
.solicitud-opcion:has(input:checked) { border-color: var(--gold); background: rgba(205,169,78,.08); }
.solicitud-opcion small { color: var(--muted); font-size: .75rem; }
.solicitud-precio { margin: .8rem 0 0; font-family: Fraunces, Georgia, serif; font-size: 1.15rem; color: var(--gold); }
.solicitud-ayuda { margin: .2rem 0 0; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.solicitud-error { margin: .5rem 0 0; color: #f0a0a0; font-size: .9rem; }
.solicitud-error[hidden] { display: none !important; }
.solicitud-acciones { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.1rem; }

.estudio-solicitudes, .estudio-compras { max-width: 52rem; }
.estudio-solicitudes h2, .estudio-compras h2 { font-family: Fraunces, Georgia, serif; margin: 0 0 1rem; }
.estudio-compras h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 1.6rem 0 .6rem; }
.solicitudes-lista, .compras-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.solicitud-item { border: 1px solid var(--line); border-radius: .7rem; padding: .85rem 1rem; background: var(--surface); }
.solicitud-cabeza { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.solicitud-nombre { font-weight: 500; }
.solicitud-estado { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
                    border: 1px solid var(--line-2); border-radius: 999px; padding: .15rem .55rem; color: var(--muted); }
.solicitud-estado--delivered { border-color: var(--gold); color: var(--gold); }
.solicitud-estado--in_progress, .solicitud-estado--paid { color: var(--ink); }
.solicitud-estado--cancelled { opacity: .6; }
.solicitud-meta { margin: .35rem 0 0; font-size: .82rem; color: var(--muted); }
.solicitud-nota { margin: .35rem 0 0; font-size: .85rem; }
.solicitud-descarga { margin: .5rem .5rem 0 0; }
/* SPEC-033: «Pagar ahora» opens Lemon Squeezy's payment page; it waits disabled while it opens. */
.solicitud-pagar { margin: .6rem .5rem 0 0; border-color: var(--gold); color: var(--gold); }
.solicitud-pagar:disabled { cursor: progress; opacity: .65; filter: none; }
.compras-item { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line);
                padding: .45rem 0; font-size: .9rem; }

/* ── SPEC-007 ─────────────────────────────────────────────────────────────
   RF1: «Empezar un libro» in «Tus obras» (menu and main area) and in the
   interview while there is no book. RF5/RF6: the assisted-payment line and
   «Cancelar solicitud» in «Mis solicitudes». RF3: the Commercial genre note. */
.new-book-from-list { align-self: flex-start; margin: 0 0 .2rem 1.7rem; font-size: .8rem; }
.menu-grupo[data-seccion="obra"]:not(.menu-grupo--abierto) .new-book-from-list { display: none; }
.estudio-columnas.plegada .new-book-from-list { display: none; }
.estudio-columnas > .studio-no-books { max-width: 34rem; margin: 2rem 0; padding: 1.5rem; border: 1px solid var(--line);
                      border-radius: .7rem; background: var(--surface); }
.studio-no-books h2 { font-family: Fraunces, Georgia, serif; margin: 0 0 .5rem; }
.studio-no-books .estudio-apunte { margin: 0 0 1rem; }
#entrevistaPanel .interview-no-book { max-width: 34rem; margin: 0 0 1.5rem; padding: 1rem 1.25rem;
                                         border: 1px solid var(--gold); border-radius: .7rem; background: var(--surface); }
#entrevistaPanel .interview-no-book[hidden] { display: none !important; }
#entrevistaPanel .interview-no-book p { margin: 0 0 .75rem; }
.request-no-book .request-start-book { margin-left: .25rem; }
.request-assisted { margin: .35rem 0 0; font-size: .85rem; color: var(--gold); }
.request-cancel { margin: .6rem .5rem 0 0; }
.request-cancel:disabled { cursor: progress; opacity: .65; }
.request-genre-note[hidden] { display: none !important; }

/* ── SPEC-009 ─────────────────────────────────────────────────────────────
   The author's decisions (js/author-decisions.js): the language notice and the
   translation box of the book dialog, the language list, the narrator's voices,
   the answers in «Mis solicitudes» and «Ver mi brief» in the book sheet. */
.decision-language { border: 1px solid var(--gold); border-radius: .6rem; padding: .7rem .85rem; margin-top: .4rem; }
.decision-language-notice { margin: 0 0 .5rem; font-size: .9rem; line-height: 1.45; }
.decision-translate-more { margin-top: .5rem; }
.decision-translate-more[hidden], .decision-form[hidden], .decision-pen[hidden], .decision-brief[hidden],
.decision-author[hidden] { display: none !important; }
.decision-languages { max-height: 11rem; overflow-y: auto; padding: .1rem; }
.decision-voices { display: flex; flex-direction: column; gap: .45rem; }
.decision-voice { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.decision-voice audio { height: 2rem; max-width: 100%; }
.decision-voice audio[hidden] { display: none; }
.decision-voice-soon { color: var(--muted); font-size: .75rem; }
.decision-block { margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.decision-block > button { margin: 0 .5rem .3rem 0; }
.decision-form { display: flex; flex-direction: column; gap: .45rem; margin-top: .4rem; }
.decision-form textarea { font: inherit; padding: .55rem .75rem; border-radius: .5rem; color: inherit; width: 100%;
                          border: 1px solid rgba(128,128,128,.35); background: transparent; }
.decision-form > button { align-self: flex-start; }
.decision-count { color: var(--muted); font-size: .75rem; align-self: flex-end; }
.decision-done { color: var(--gold); }
.book-decisions { margin: .4rem 0 1rem; display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; }
.decision-author { margin: 0; font-size: .9rem; }
.decision-brief { white-space: pre-wrap; max-width: 46rem; border: 1px solid var(--line); border-radius: .6rem;
                  padding: .8rem 1rem; background: var(--surface); font-size: .9rem; line-height: 1.5; }

/* SPEC-064 · the menu says which area is open. The current entry (aria-current="page") is gold on a
   gold-tinted row with its gold bar; the others are a dimmer grey that comes up on hover. Both pass
   AA: on the dark menu (dark theme, and the mixed theme's dark sidebar and sheets) #8a8f99 is 6:1
   and the gold #cda94e 7:1; on the light menu #5c5f66 is 5.9:1 and #7d6114 4.7:1. The open book
   keeps its own marker in «Mis libros». */
.studio-sidebar, .studio-sheet { --menu-idle: #8a8f99; --menu-on: #cda94e; --menu-on-bg: rgba(205, 169, 78, .14); }
:root[data-theme="light"]:not([data-mode="mixed"]) :is(.studio-sidebar, .studio-sheet) {
  --menu-idle: #5c5f66; --menu-on: #7d6114; --menu-on-bg: rgba(154, 122, 28, .12);
}
.menu-entry, .menu-footer-link, .menu-book-row { color: var(--menu-idle, var(--muted)); }
.menu-entry .menu-icon, .menu-entry .menu-number, .menu-footer-link .ic { color: currentColor; }
.menu-entry:hover, .menu-footer-link:hover, .menu-book-row:hover { color: var(--ink); }
.menu-entry[aria-current="page"],
.menu-entry[aria-current="page"]:hover { background: var(--menu-on-bg, var(--surface-2)); color: var(--menu-on, var(--gold)); font-weight: 600; }
.menu-entry[aria-current="page"]::before { background: var(--menu-on, var(--gold)); }
.menu-entry[aria-current="page"] .menu-icon,
.menu-entry[aria-current="page"] .menu-number { color: var(--menu-on, var(--gold)); }
.menu-book-row[aria-current="page"] { color: var(--ink); }
.menu-account-copy strong { color: var(--menu-idle, var(--ink)); }
.menu-account-copy:hover strong { color: var(--ink); }
.menu-account-copy[aria-current="page"] { background: var(--menu-on-bg, var(--surface-2)); }
.menu-account-copy[aria-current="page"] strong { color: var(--menu-on, var(--gold)); font-weight: 600; }

/* ── The book writing assistant (its own page of the site, in a frame) ─────── */
.studio-main:has(> #tabAssistant:not([hidden])) { max-width: none; }
.studio-assistant { padding: 0; }
.assistant-frame { display: block; width: 100%; height: calc(100vh - 9.5rem); min-height: 34rem; border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 12px; background: transparent; }
@media (max-width: 899px) { .assistant-frame { height: calc(100vh - 11rem); min-height: 30rem; border-radius: 8px; } }
