/* «Taller de Reels» stylesheet. Light theme only; one frame (.shell), one rhythm (.stack), one primary per screen.
   Cascade layers, in order (a later layer wins over an earlier one whatever the selector):
     base        element defaults (fields, headings, focus ring)
     legacy      the old page rules still in use (trimmed page by page)
     tokens      colours, spacing, radii, shadows, type (the old variable names are kept)
     layout      .shell, .stack, .cluster, page and section heads
     components  top bar, flow bar + step map, cards, buttons, action bar, fields, choices, extras, alerts, live wait,
                 toasts, dialogs, tabs, search, filters, pager, rows, grids, tiles
     patterns    home products, avatars, result, portraits, script lines, list rows
     pages       per-page rules that remain (podcast episode, coverage, flyers…)
     phone       under 720 px: 44 px targets, the nav row, the sticky action bar */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 800; font-display: swap; src: url(fonts/inter-latin-800-normal.woff2) format("woff2"); }

@layer base, legacy, tokens, layout, components, patterns, pages, phone;

/* ============================================================ BASE: element defaults (before legacy, so the old
   page rules keep their specific looks; everything after legacy wins over it). */
@layer base {
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; scroll-padding-bottom: 96px; }
  body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
    font: var(--t-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
  h1 { font: var(--t-h1); letter-spacing: -.02em; overflow-wrap: anywhere; }
  h2 { font: var(--t-h2); letter-spacing: -.01em; }
  h3 { font: var(--t-h3); }
  p { max-width: var(--measure); }
  a { color: var(--accent-text); text-underline-offset: 3px; }
  img, video { display: block; max-width: 100%; }
  button, input, textarea, select { font: inherit; color: inherit; }
  fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
  legend { padding: 0; }
  summary { cursor: pointer; }
  :focus { outline: none; }
  :focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), textarea, select {
    width: 100%; min-height: 48px; padding: 11px 14px; background: var(--field); border: 1px solid var(--field-line);
    border-radius: var(--r-md); font-size: 1rem; line-height: 1.5; color: var(--text);
    transition: border-color .15s, box-shadow .15s; }
  textarea { resize: vertical; min-height: 72px; }
  input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
  input:hover:not(:disabled), textarea:hover:not(:disabled), select:hover:not(:disabled) { border-color: #5f6472; }
  input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px rgba(91, 63, 217, .22); }
  input[type=checkbox], input[type=radio] { accent-color: var(--accent-text); }
  input[type=file] { max-width: 100%; }
  .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ============================================================ LEGACY (old rules; shrinking) */
@layer legacy {
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--text); color: #fff; border-radius: 10px; }
.skip:focus { top: 12px; }
.muted { color: var(--soft); }
.small { font-size: .85rem; }
.center { text-align: center; }
.warn { color: var(--amber); font-size: .9rem; margin-top: 8px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.lede { color: var(--soft); font-size: 1.05rem; margin-top: 10px; }   /* as wide as the boxes below it (owner, 2026-11-18) */

/* Layout */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px 16px 48px; flex: 1; }
.wrap > * + * { margin-top: 24px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--header-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 10px; top: 7px; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.top { flex-wrap: wrap; }
.top-nav { display: flex; order: 3; width: 100%; gap: 16px; margin: 0; padding: 8px 2px 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a.is-here { color: var(--text); }
.top-nav a { color: var(--soft); text-decoration: none; font-weight: 600; font-size: .92rem; }
.top-nav a:hover { color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-right form { margin: 0; }
.chip-tokens { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); text-decoration: none; color: var(--text); }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe08a, #f59e0b 70%); box-shadow: inset 0 0 0 1.5px rgba(146, 64, 14, .45); display: inline-block; }
.coin-lg { width: 30px; height: 30px; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--soft); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger, .danger { color: var(--red); }
.foot { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; padding: 18px 16px 28px; border-top: 1px solid var(--line); color: var(--faint); font-size: .85rem; }
.foot a { color: var(--soft); }
.fake-banner { background: repeating-linear-gradient(45deg, #fff4c2, #fff4c2 12px, #ffefad 12px, #ffefad 24px); color: #713f12; border-bottom: 1px solid var(--amber-line); text-align: center; font-size: .82rem; font-weight: 600; padding: 6px 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, opacity .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad-strong); color: var(--on-accent); box-shadow: 0 4px 14px rgba(103, 65, 217, .25); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(194, 37, 92, .3); }
.btn-ghost { background: var(--card); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--bg-2); border-color: #c4c4cf; }
.btn-sm { min-height: 36px; padding: 0 14px; border-radius: 11px; font-size: .9rem; }
.btn-lg { min-height: 54px; font-size: 1.05rem; padding: 0 26px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.mini-link { background: none; border: 0; color: var(--accent-text); font-size: .82rem; font-weight: 600; cursor: pointer; padding: 0; text-decoration: none; }

/* Cards and forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-soft { background: var(--bg-2); box-shadow: none; }
.card > * + * { margin-top: 12px; }
.form > * + * { margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, .field legend, .field summary { font-weight: 600; font-size: .92rem; }
.field em { font-style: normal; color: var(--faint); font-weight: 400; }
:disabled { cursor: not-allowed; }
fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select { background: var(--bg-2); color: var(--soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--violet); flex: none; }
.auth h1 { font-size: 1.8rem; }
.prose h2 { margin-top: 18px; }
.prose p { color: var(--soft); }

/* Hero */
.hero { display: grid; gap: 28px; padding: 24px 0 8px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 8vw, 3.8rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-phone { display: flex; justify-content: center; }
.phone { width: 220px; aspect-ratio: 9 / 18; border-radius: 34px; padding: 10px; background: #15151c; border: 1px solid #2a2a33; box-shadow: var(--shadow-lg); transform: rotate(4deg); }
.phone-screen { position: relative; height: 100%; border-radius: 26px; overflow: hidden; background: linear-gradient(160deg, #3a2a7a, #a33a72 60%, #f7a26b); }
.ph-chip { position: absolute; top: 14px; left: 14px; font-size: .7rem; font-weight: 800; background: rgba(0, 0, 0, .35); padding: 3px 8px; border-radius: 999px; color: #ff9fbf; }
.ph-line { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 50%; background: rgba(255, 255, 255, .18); }
.ph-line.l1 { top: 22%; width: 70px; height: 70px; }
.ph-line.l2 { top: 42%; width: 130px; height: 120px; border-radius: 60px 60px 10px 10px; }
.ph-cap { position: absolute; left: 12px; right: 12px; bottom: 34px; padding: 8px 10px; border-radius: 10px; background: #f5f5f2; color: #9a9aa0; font-weight: 800; font-size: .85rem; text-align: center; }
.ph-cap b { color: #111; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.phases { display: grid; gap: 14px; }
.badge { align-self: flex-start; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; }
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-soon { background: var(--amber-soft); color: var(--amber); }
/* The state of a short or of a long cut. Every state has its own look, and the ones in progress also carry a
   spinner and mark the whole card, so "Armándose…" cannot be mistaken for "Propuesto" (owner, 2026-11-14). */
.badge-neutral { background: var(--card); color: var(--soft); border: 1px solid var(--line-2); }
.badge-muted { background: transparent; color: var(--faint); border: 1px dashed var(--line-2); }
.badge-soon { border: 1px solid var(--amber-line); }
.badge-working { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; font-size: .8rem; background: var(--accent-text); color: var(--on-accent); }
.badge-working .spinner { width: 12px; height: 12px; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: var(--on-accent); }
.badge-done { background: var(--green); color: var(--on-accent); }
.badge-fail { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }
.short-body > .badge { justify-self: start; }      /* a pill, not a bar across the card */
.welcome h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }

/* Steps */
.step > * + * { margin-top: 20px; }
.dropzone { position: relative; display: grid; place-items: center; min-height: 260px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--bg-2); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; text-align: center; }
.dropzone:hover, .dropzone.is-over { border-color: var(--violet); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; pointer-events: none; }
.dz-empty svg { width: 54px; height: 54px; color: var(--accent-text); margin-bottom: 4px; }
.dropzone-audio { min-height: 150px; }
.dz-file { font-weight: 600; pointer-events: none; padding: 20px; }
.ticks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.ticks li { padding-left: 26px; position: relative; color: var(--soft); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--green-soft); box-shadow: inset 0 0 0 4px #34d399; }
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 20px; }
.empty-photo { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; border: 3px solid transparent; background: var(--grad) border-box; }
.live { display: flex; align-items: center; gap: 14px; }

/* Portraits */
.portrait-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.portrait { display: flex; flex-direction: column; gap: 6px; }
.portrait-pick { position: relative; display: block; border-radius: 16px; overflow: hidden; cursor: pointer; aspect-ratio: 9 / 16; background: var(--card-2); border: 2px solid var(--line); transition: border-color .15s, transform .15s; }
.portrait-pick img { width: 100%; height: 100%; object-fit: cover; }
.portrait-pick input { position: absolute; opacity: 0; }
.pick-mark { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .8); color: transparent; transition: all .15s; }
.pick-mark svg { width: 18px; height: 18px; }
.portrait-pick:has(input:checked) { border-color: var(--pink); transform: scale(.98); }
.portrait-pick:has(input:checked) .pick-mark { background: var(--grad); border-color: transparent; color: #fff; }
.portrait-pick:has(input:focus-visible) { outline: 3px solid var(--pink); outline-offset: 2px; }
.portrait-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--overlay); color: var(--text); font-weight: 600; font-size: .9rem; }
.portrait-skeleton { aspect-ratio: 9 / 16; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--soft); background: linear-gradient(110deg, var(--card) 30%, var(--card-2) 50%, var(--card) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border: 1px solid var(--line); font-size: .9rem; }
.portrait-skeleton.is-failed { animation: none; border-style: dashed; }
@keyframes shimmer { to { background-position: -200% 0; } }
.portrait-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; }
.portrait-note { font-size: .8rem; color: var(--soft); }
.change-form { display: flex; gap: 8px; padding: 8px 6px 4px; }
.more { text-align: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(17, 24, 39, .12); border-top-color: var(--pink); animation: spin .8s linear infinite; flex: none; display: inline-block; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.btn .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Voice */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 14px; border: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 10px; border-radius: 11px; font-weight: 600; color: var(--soft); cursor: pointer; }
.tab.is-on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(16, 24, 40, .12); }
.tab-panel > * + * { margin-top: 14px; }
.guide { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guide li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .85rem; color: var(--soft); }
.guide b { color: var(--text); display: block; }
/* «Grabar ahora»: the quiet place first, the room's noise measured, and amber advice that never blocks (2026-11-18) */
.guide li.guide-key { grid-column: 1 / -1; background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); font-size: .9rem; }
.guide li.guide-key b { font-size: 1rem; color: var(--accent-text); }
.voice-check { display: grid; gap: 10px; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber); font-size: .92rem; font-weight: 600; }
p.voice-check { display: block; }
/* «¿Con qué música?» and «Tus temas» (2026-11-18) */
.music-choice { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.music-choice input[type=file] { max-width: 100%; }
.music-choice .voice-check { overflow-wrap: anywhere; }
.music-choice [hidden] { display: none; }
.music-mine { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }   /* a file input is wide */
.music-list { display: grid; gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.music-track { display: grid; gap: 10px; }
.music-track audio { width: 100%; }
.music-rename { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.music-rename input { flex: 1; min-width: 160px; }
.music-shorts { margin: 10px 0 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.music-shorts summary { cursor: pointer; }
.music-own { margin-top: 10px; }
/* «¿Querés cambiar algo del video?» (2026-11-18) */
.edit-box { display: grid; gap: 12px; }
.edit-asked { margin: 0; padding: 10px 12px; border-left: 4px solid var(--accent-line); background: var(--bg-2); border-radius: 8px; font-style: italic; overflow-wrap: anywhere; }
.edit-plan { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.edit-price { font-weight: 600; }
.edit-photo { display: grid; gap: 8px; }
.edit-current { margin-top: 16px; }
.voice-check[hidden] { display: none; }
.voice-check p { margin: 0; }
.voice-check-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: #e0a100; color: #fff; font-size: .8rem; font-weight: 800; vertical-align: -3px; }
.rec-btn.is-measuring { cursor: wait; animation: none; }
.rec-btn.is-measuring span { background: #e0a100; }
.recorder.is-measuring .meter span { background: #e0a100; transition: width .1s linear; }
.rec-hint { min-height: 2.6em; }
.reading { max-height: 230px; overflow-y: auto; padding: 18px; border-radius: 16px; background: #fbf8ef; border: 1px solid #ece4cd; color: #1d1a2b; font-size: 1.08rem; line-height: 1.7; }
.recorder { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.rec-btn { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 3px solid var(--line-2); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.rec-btn span { width: 46px; height: 46px; border-radius: 50%; background: #ef4444; transition: all .2s; }
.rec-btn.is-recording span { width: 24px; height: 24px; border-radius: 6px; }
.rec-btn.is-recording { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, .2); } }
.rec-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rec-time { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .08s linear; }
.voice-ready { display: grid; gap: 12px; }

/* Video form */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 9px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); font-size: .9rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.chip input:checked + span { background: var(--grad-strong); border-color: transparent; color: var(--on-accent); }
.chip input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.portrait-choice { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.pc-item { flex: none; width: 96px; scroll-snap-align: start; }
.pc-item input { position: absolute; opacity: 0; }
.pc-card { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: .8rem; cursor: pointer; }
.pc-card img, .pc-random .pc-card svg { width: 96px; height: 150px; object-fit: cover; border-radius: 14px; border: 2px solid var(--line); background: var(--bg-2); transition: border-color .15s; }
.pc-random .pc-card svg { padding: 50px 26px; color: var(--soft); }
.pc-item input:checked + .pc-card img, .pc-item input:checked + .pc-card svg { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 92, 168, .25); }
.pc-item input:focus-visible + .pc-card { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 14px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: .93rem; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 46px; height: 26px; flex: none; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--violet); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--pink); outline-offset: 2px; }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-row > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.price-row b { font-size: 1.15rem; }

/* Job */
.back { display: inline-block; margin-top: 14px; color: var(--soft); text-decoration: none; font-size: .9rem; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: var(--card-2); color: var(--soft); }
.status-running, .status-queued { background: var(--accent-soft); color: var(--accent-text); }
.status-awaiting_review { background: var(--amber-soft); color: var(--amber); }
.status-done { background: var(--green-soft); color: var(--green); }
.status-failed { background: var(--red-soft); color: var(--red); }
.job h1 { margin-top: 10px; font-size: clamp(1.4rem, 4.5vw, 2rem); }
.progress-card { display: flex; align-items: center; gap: 20px; }
.ring { --p: 0; width: 96px; height: 96px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--pink) calc(var(--p) * 1%), var(--line-2) 0); position: relative; transition: background .4s; }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--card); }
.ring span { position: relative; font-weight: 800; font-size: 1.25rem; }
.progress-copy { display: grid; gap: 6px; }
.progress-copy b { font-size: 1.1rem; }
.steps-detail summary { cursor: pointer; color: var(--soft); font-weight: 600; padding: 6px 0; }
.steps { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.st { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .92rem; }
.st-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); flex: none; }
.st-done { color: var(--soft); }
.st-done .st-dot { background: #10b981; }
.st-running { color: var(--text); font-weight: 600; }
.st-running .st-dot { background: var(--pink); box-shadow: 0 0 0 4px rgba(255, 92, 168, .25); animation: pulse 1.4s infinite; }
.st-failed { color: var(--red); }
.st-failed .st-dot { background: var(--red); }
.script { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: line; }
.line { padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--bg-2); border-left: 4px solid var(--violet); display: flex; flex-direction: column; gap: 4px; }
.line-a { border-left-color: var(--pink); }
.line em { font-style: normal; font-size: .75rem; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.legend { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot-c { background: var(--violet); } .dot-a { background: var(--pink); }
.sources ul, .notes { margin: 8px 0 0; padding-left: 18px; color: var(--soft); font-size: .88rem; }
.sources summary, .redo summary { cursor: pointer; font-weight: 600; }
/* «Ver el tema completo» under a reel's short name (reelstudio/titles.py, 2026-11-18) */
.topic-full { margin-top: 6px; font-size: .88rem; color: var(--soft); }
.topic-full summary { cursor: pointer; display: inline-block; font-weight: 600; color: var(--accent-text); }
.topic-full p { margin-top: 6px; max-width: none; white-space: pre-line; overflow-wrap: anywhere; }
.redo .form { margin-top: 10px; }
.cancel-form { text-align: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.final { display: grid; gap: 20px; }
.final-side { display: flex; flex-direction: column; gap: 14px; }
.caption-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.caption-head { display: flex; justify-content: space-between; align-items: center; }
.caption-box pre { margin: 8px 0 0; white-space: pre-wrap; font: inherit; color: var(--soft); font-size: .9rem; }

/* Video grid */
.video-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.video-tile { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; height: 100%; }
.video-tile:hover { transform: translateY(-2px); border-color: var(--line-2); }
.tile-media { aspect-ratio: 9 / 12; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-body { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.tile-body .status { align-self: flex-start; }
.tile-kind { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.tile-title { font-weight: 600; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Tokens and admin */
.balance-card { text-align: center; }
.big-balance { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 3rem; font-weight: 800; letter-spacing: -.03em; }
.big-balance small { font-size: 1rem; color: var(--soft); font-weight: 600; }
.price-list, .ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.price-list li, .ledger li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.ledger li div { display: flex; flex-direction: column; }
.delta { font-weight: 800; font-variant-numeric: tabular-nums; }
.delta.plus { color: var(--green); } .delta.minus { color: var(--red); }
.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 1.8rem; }
.price-form { display: grid; gap: 12px; }
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; }
.field-inline input { max-width: 140px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--faint); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.credit-form { display: flex; flex-wrap: wrap; gap: 6px; min-width: 260px; }
.credit-form input[type=number] { max-width: 100px; }
.credit-form input:not([type=number]) { flex: 1; min-width: 120px; }
.table form { margin: 0; }
.message-table select, .message-table input:not([type=checkbox]) { width: 100%; min-width: 120px; }
.message-table .row-off td { color: var(--faint); }
.message-table p { margin: 4px 0 0; }
.message-table td .muted { word-break: break-all; }
.message-table select { min-width: 190px; }
/* the page scrolls to the message box after reading it: keep its heading clear of the sticky bar */
.message-form, .message-review { scroll-margin-top: 84px; }
.link-form .field-row > .field-narrow, .upload-form .field-row > .field-narrow { flex-basis: 220px; }
.upload-form .field-row > * { min-width: 0; }
.upload-form input[type=file] { max-width: 100%; }
@media (max-width: 719px) {
  .link-form .field-row > .field-narrow, .upload-form .field-row > .field-narrow { flex: 1 1 100%; }
  /* on a phone each row of the message table reads as a card: checkbox and file, then what it is and whose,
     then part, size and expiry (columns: 1 pick, 2 role, 3 label, 4 part, 5 file, 6 size, 7 expiry) */
  .message-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .message-table, .message-table tbody { display: block; }
  .message-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .message-table td { display: block; order: 4; padding: 0; border: 0; }
  .message-table td:nth-child(1) { order: 1; }
  .message-table td:nth-child(5) { order: 2; flex: 1 1 0; min-width: 0; }
  .message-table td:nth-child(2), .message-table td:nth-child(3) { order: 3; flex: 1 1 100%; }
  .message-table td[data-label]::before { content: attr(data-label) " "; color: var(--faint); }
  .message-table td[data-empty] { display: none; }
  .message-table select, .message-table input:not([type=checkbox]) { min-width: 0; }
}

/* Toasts */
.toasts { display: grid; gap: 8px; }
.toast { padding: 14px 18px; border-radius: 14px; background: #f4f0ff; border: 1px solid var(--accent-line); border-left: 6px solid var(--violet); box-shadow: var(--shadow-lg); animation: drop .25s ease; font-size: 1.02rem; line-height: 1.45; color: var(--text); font-weight: 500; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

@media (min-width: 720px) {
  .wrap { padding: 24px 28px 64px; }
  .top { padding: 14px 28px; }
  .top { flex-wrap: nowrap; }
  .top-nav { order: 0; width: auto; gap: 18px; margin-left: 18px; padding: 0; overflow: visible; }
  .hero { grid-template-columns: 1.2fr .8fr; padding-top: 48px; }
  .phone { width: 260px; }
  .phases { grid-template-columns: repeat(3, 1fr); }
  .portrait-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .video-grid { grid-template-columns: repeat(4, 1fr); }
  .final { grid-template-columns: 1fr 1fr; align-items: start; }
  }
@media (min-width: 1000px) { .portrait-grid { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Image reels (phase 2) */
.style-choice { display: grid; gap: 10px; }
.style-option { position: relative; cursor: pointer; }
.style-option input { position: absolute; opacity: 0; }
.style-option > span { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 14px; background: var(--bg-2); border: 2px solid var(--line-2); transition: border-color .15s; }
.style-option em { font-style: normal; color: var(--soft); font-size: .88rem; }
.style-option input:checked + span { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 92, 168, .2); }
.style-option input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.style-option input:disabled + span { opacity: .5; cursor: not-allowed; }
.price-list ul { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; }
.price-list li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: .92rem; }
fieldset > legend { padding: 0; margin-bottom: 8px; }
fieldset.lockable > * + * { margin-top: 18px; }
.headline-edit { gap: 6px; }
.headline-edit input.hl { font-weight: 800; text-transform: uppercase; color: #111; }
.headline-edit input.hl.hl-1 { background: #ffc814; border-color: #e6b100; }
.headline-edit input.hl.hl-2 { background: #fff; border-color: var(--line-2); }
.beat-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.beat-line { display: flex; gap: 10px; align-items: flex-start; }
.beat-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); font-weight: 800; font-size: .85rem; margin-top: 4px; }
.beat-card .beat-n { background: var(--amber-soft); color: var(--amber); }
.beat-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.beat-kind { font-size: .76rem; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
.card-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.beat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.beat-tile { display: flex; flex-direction: column; gap: 6px; }
.beat-media { position: relative; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line); }
.beat-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.beat-media .portrait-skeleton { aspect-ratio: auto; height: 100%; border-radius: 0; }
.beat-badge { position: absolute; top: 8px; left: 8px; z-index: 2; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: rgba(0, 0, 0, .65); color: #fff; font-weight: 800; font-size: .85rem; }
.beat-cardpreview { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; background: radial-gradient(90% 70% at 50% 45%, #E6DAC2 0%, #C9B998 100%); color: #221C12; }
.beat-cardpreview small { font-family: "JetBrains Mono", monospace; font-weight: 700; letter-spacing: .1em; }
.beat-cardpreview b { font-size: 1.5rem; line-height: 1.05; }
.beat-text { font-size: .85rem; color: var(--soft); }
.beat-change summary { cursor: pointer; list-style: none; }
.beat-change summary::-webkit-details-marker { display: none; }
@media (min-width: 640px) { .beat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .beat-grid { grid-template-columns: repeat(4, 1fr); } }
/* Image reels: the user's own images and logo */
.own-images em, .field legend em { font-style: normal; color: var(--soft); font-weight: 400; }
.own-thumbs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.own-thumbs:empty { display: none; }
.own-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.own-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.own-thumb .beat-badge { top: 6px; left: 6px; min-width: 24px; height: 24px; font-size: .78rem; }
.own-remove { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 999px; border: 0; background: rgba(0, 0, 0, .7); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.own-remove:hover { background: var(--red); }
.own-after { display: grid; gap: 12px; margin-top: 12px; }
.own-after[hidden], .own-logo[hidden] { display: none; }
.own-logo { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.own-logo img { max-width: 120px; max-height: 80px; object-fit: contain; border-radius: 10px; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 16px 16px; padding: 6px; border: 1px solid var(--line); }
.price-list li.price-total { background: var(--accent-soft); border-color: var(--accent-line); font-weight: 700; }
.own-tag { position: absolute; bottom: 8px; left: 8px; z-index: 2; padding: 3px 10px; border-radius: 999px; background: var(--grad-strong); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .03em; }
.beat-upload { display: grid; gap: 6px; margin-top: 6px; }
.beat-upload input[type=file] { font-size: .8rem; max-width: 100%; }
.beat-upload .check { font-size: .78rem; }
.beat-upload [hidden] { display: none; }

/* Phase 3: cortos de podcast */
.quota { margin: 0 0 18px; display: grid; gap: 8px; }
.quota-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s; }
.show-list { display: grid; gap: 14px; }
.show-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.show-head > div { flex: 1; }
.show-logo { width: 52px; height: 52px; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.show-logo-empty { display: inline-block; }
.show-logo-lg { width: 120px; height: 120px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field-row > * { flex: 1 1 220px; }
.field-row > .field-narrow { flex: 0 1 200px; }
.episode-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.episode-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.episode-list a { display: grid; flex: 1 1 auto; min-width: 0; color: var(--text); text-decoration: none; }
.episode-list form { flex: none; margin: 0; }
.episode-list .link-btn { white-space: nowrap; }
@media (max-width: 559px) {
  .episode-list li { flex-wrap: wrap; row-gap: 6px; }
  .episode-list a { flex-basis: 100%; }
}
.episode-delete { margin: 28px 0 0; padding-top: 12px; border-top: 1px solid var(--line); text-align: right; font-size: .85rem; }
.info-dialog { padding: 0; border: 0; background: transparent; width: min(580px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 32px); overflow: auto; }
.info-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.info-dialog > .modal { max-width: none; }   /* only the window's own card: a question asked inside it keeps its size */
.info-steps { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 16px; }
.info-steps p { margin-top: 4px; }
.info-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.info-head b { margin-right: auto; }
.info-steps pre { max-height: 150px; overflow: auto; white-space: pre-wrap; font-size: .8rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-top: 8px; }
.change-card { margin: 0 0 16px; border: 2px solid var(--accent-line); background: var(--accent-soft); box-shadow: none; }
.change-card h3 { margin-bottom: 6px; }
.change-card form { margin: 10px 0; }
.same-files { margin: 14px 0; }   /* "Hacer otro episodio con estos mismos archivos": a block of its own on the episode page */
.file-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.file { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); display: grid; gap: 6px; }
.file-failed { border-color: var(--red); }
.ok { color: var(--green); }
.upload-form, .link-form { margin-top: 14px; }
.files-live { scroll-margin-top: 140px; }
/* a refused link or message: the reason sits by its form, which the page scrolls to */
#traer { scroll-margin-top: 84px; }
.form-error { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--amber-line); border-radius: var(--radius-sm); background: var(--amber-soft); }
/* a file that has just finished: a soft green wash that fades out while it settles among the ready ones */
.file-arrived { animation: file-arrived 2.6s ease-out; }
@keyframes file-arrived { 0%, 35% { background: var(--green-soft); border-color: var(--green); } 100% { background: var(--card-2); border-color: var(--line); } }
/* "Agregar más archivos": the ways to add files, folded once the episode has some */
.add-more { margin: 4px 0 16px; }
.add-more > summary { list-style: none; display: inline-flex; gap: 8px; }
.add-more > summary::-webkit-details-marker { display: none; }
.add-more > summary::before { content: "+"; font-weight: 700; }
.add-more[open] > summary::before { content: "\2212"; }
.add-more-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.who-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 12px 0 18px; }
.who-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); }
.who-card audio { width: 100%; }
.who-camera img { border-radius: 10px; width: 100%; }
.faces { display: flex; flex-wrap: wrap; gap: 8px; }
.face { display: grid; gap: 4px; width: 110px; }
.face img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; }
.face-empty { display: grid; place-items: center; width: 110px; height: 110px; border-radius: 10px; background: var(--line); }
.short-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 14px; }
.short { padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); }
.short-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.short-summary::-webkit-details-marker { display: none; }
.short-summary:hover .fold-hint { color: var(--accent-text); }
.short-num { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--card); border: 1px solid var(--line-2); font-weight: 800; font-size: .8rem; }
.short-summary .badge { margin-left: auto; }
.fold-hint { font-size: .8rem; font-weight: 700; color: var(--faint); white-space: nowrap; }
.fold-hint::after { content: "Ver detalle \25BE"; }
.short-fold[open] .fold-hint::after { content: "Cerrar \25B4"; }
.short-inner { display: flex; gap: 16px; flex-wrap: wrap; padding: 0 14px 14px; }
.short video { width: 200px; aspect-ratio: 9 / 16; border-radius: 12px; background: #000; }
.short-body { flex: 1 1 300px; display: grid; gap: 8px; align-content: start; }
.short-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.short-asked { flex-basis: 100%; }      /* "Pediste: «…»": the request a proposal answers (short_requests) */
.short-summary .short-head:has(.short-asked) { flex: 1 1 240px; min-width: 0; }   /* its badge stays on the right */
.short-kicker { color: #fff; font-weight: 800; font-size: .72rem; letter-spacing: .06em; padding: 3px 8px; }
.short-title { background: #111; color: #fff; padding: 2px 10px; font-weight: 800; }
.short-dropped { opacity: .55; }
.short-approved { border-color: var(--green); }
.short-rendering, .short-revising { border-color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent-text); }
.short-queued { border-color: var(--amber-line); box-shadow: inset 4px 0 0 var(--amber-line); }
.short-ready { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.short-failed { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); }
.short audio { width: 100%; }
.phrases { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .92rem; }
.phrases .who { font-weight: 800; color: var(--accent-text); }
.kw { padding: 0 6px; border-radius: 4px; font-weight: 800; }
.kw-yellow_box { background: #ffd000; color: #111; }
.kw-red { color: #d32f2f; }

/* Phase 3 part 2: episode plan timeline and long cuts */
.long-card h3 { margin-top: 18px; }
.timeline { position: relative; height: 34px; margin: 14px 0 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tl-program { position: absolute; top: 0; bottom: 0; background: linear-gradient(135deg, rgba(124, 92, 255, .35), rgba(255, 92, 168, .3)); }
.tl-skip { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #d5d5de 0 6px, #ececf1 6px 12px); }
.tl-topic { position: absolute; top: 3px; transform: translateX(-50%); min-width: 20px; height: 20px; padding: 0 4px; border-radius: 6px; background: var(--text); color: #fff; font-size: .72rem; font-weight: 800; line-height: 20px; text-align: center; }
.tl-hook { position: absolute; bottom: 2px; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg); background: #f59e0b; }
.legend-hook { color: var(--amber); }
.plan-ends { display: grid; gap: 8px; margin: 12px 0; }
.plan-ends div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.plan-ends dt { font-size: .8rem; color: var(--soft); }
.plan-ends dd { margin: 2px 0 0; font-size: .92rem; }
.topic-list { display: grid; gap: 10px; padding-left: 22px; margin: 10px 0; }
.topic-list input { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); }
.chapters { white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .9rem; color: var(--soft); }
.plain-list { margin: 6px 0; padding-left: 18px; }
.fix-list { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 8px; }
.fix-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.fix-row input { min-width: 0; }
@media (max-width: 560px) { .fix-row { grid-template-columns: 1fr; } .fix-row > span { display: none; } }
.plan-note { margin: 8px 0; }
.outputs { display: grid; gap: 10px; margin: 8px 0 14px; }
.progress-inline { display: flex; gap: 14px; align-items: center; margin: 12px 0; }
.cut { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; display: grid; gap: 10px; }
.cut video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; }

/* Confirmation dialog (replaces the browser's confirm()) */
.has-modal { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: end center; padding: 16px; background: var(--scrim); backdrop-filter: blur(4px); animation: fade .15s ease; }
.modal-backdrop.is-closing { opacity: 0; transition: opacity .15s; }
.modal { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 18px; box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal p { margin-top: 8px; }
.modal-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 20px; }
.modal-actions .btn { width: 100%; }
.modal-actions [data-modal-cancel] { white-space: nowrap; }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(198, 40, 40, .25); }
/* Destructive questions (data-confirm-danger): a small warning mark beside the title and the text */
.modal-danger { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; }
.modal-mark { grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--red-soft); color: var(--red); }
.modal-mark svg { width: 22px; height: 22px; }
.modal-danger h2, .modal-danger p { grid-column: 2; }
.modal-danger h2 { align-self: center; }
.modal-danger .modal-actions { grid-column: 1 / -1; }
/* Spelling check before saving (data-spellcheck): the words to look at, listed in a wider dialog with three buttons,
   and the save button while the check runs */
.modal-wide { max-width: 580px; }
.modal-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; max-height: 45vh; overflow-y: auto; }
.modal-list li { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid var(--amber-line); font-weight: 600; overflow-wrap: anywhere; }
.modal-list .small { font-weight: 400; }
.btn.is-checking, .mini-link.is-checking { opacity: 1; cursor: progress; }
.btn-ghost.is-checking .spinner, .mini-link.is-checking .spinner { border-color: rgba(17, 24, 39, .12); border-top-color: var(--accent-text); }
.mini-link.is-checking .spinner { margin-right: 6px; vertical-align: -3px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (min-width: 560px) {
  .modal-backdrop { place-items: center; }
  .modal-actions { flex-direction: row; justify-content: flex-end; }
  .modal-actions .btn { width: auto; }
}

/* Portrait picking */
.portrait.is-picked .portrait-pick { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 92, 168, .28); }
.portrait.is-picked .pick-mark { background: var(--grad); border-color: transparent; color: #fff; }
.pick-mark { width: 34px; height: 34px; }
.pick-tag { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px; background: var(--grad-strong); color: #fff; font-size: .75rem; font-weight: 800; opacity: 0; transform: translateY(4px); transition: all .15s; }
.portrait.is-picked .pick-tag { opacity: 1; transform: none; }
.portrait-change { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.portrait-change summary { display: flex; align-items: center; gap: 6px; padding: 9px 10px; cursor: pointer; list-style: none; font-size: .85rem; font-weight: 600; color: var(--accent-text); min-height: 40px; }
.portrait-change summary::-webkit-details-marker { display: none; }
.portrait-change summary svg { width: 16px; height: 16px; }
.portrait-change[open] summary { border-bottom: 1px solid var(--line); }
.portrait-change .change-form { flex-direction: column; padding: 10px; }
.portrait-change textarea { min-height: 54px; font-size: .9rem; padding: 9px 10px; }
.pick-bar { flex-wrap: wrap; }
.pick-count { display: flex; flex-direction: column; min-width: 0; }
.pick-count b { font-size: 1rem; }
.pick-bar .btn { flex: 1 1 180px; }

/* Script writing wait */
.script-wait > * + * { margin-top: 16px; }
.sw-head { display: flex; align-items: center; gap: 16px; }
.sw-head b { font-size: 1.1rem; }
.sw-orb { position: relative; width: 54px; height: 54px; flex: none; }
.sw-orb i { position: absolute; inset: 0; border-radius: 50%; background: var(--grad); opacity: .55; animation: orb 2.4s ease-in-out infinite; }
.sw-orb i:nth-child(2) { animation-delay: .8s; }
.sw-orb i:nth-child(3) { animation-delay: 1.6s; }
@keyframes orb { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.sw-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sw-stage { display: flex; align-items: center; gap: 10px; color: var(--faint); }
.sw-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line-2); flex: none; }
.sw-done { color: var(--soft); }
.sw-done .sw-dot { background: #10b981; }
.sw-running { color: var(--text); font-weight: 600; }
.sw-running .sw-dot { background: var(--pink); box-shadow: 0 0 0 4px rgba(255, 92, 168, .25); animation: pulse 1.4s infinite; }

/* Script review: editable sentences and length */
.length-meter { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.length-meter.is-over { border-color: var(--amber); }
.length-meter.is-over b { color: var(--amber); }
.length-meter.is-over .bar span { background: var(--amber); }
.script-edit .line { gap: 6px; }
.line-kind { font-size: .74rem; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
.script-edit textarea { min-height: 52px; background: var(--card); padding: 10px 12px; }
.redo-new { text-align: center; }

/* Profile ("Describite") */
.profile-box { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: #f7f4ff; border: 1px solid var(--accent-line); }
.profile-foot { display: flex; justify-content: space-between; gap: 10px; }

/* Flyers (phase 4) */
.style-choice-2 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .style-choice-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .flyer-fields { grid-template-columns: repeat(2, 1fr); } .flyer-fields .is-wide { grid-column: 1 / -1; } }
/* the one create screen: images and logos side by side, compact drop areas */
.flyer-create textarea[name=description] { font-size: 1.05rem; min-height: 140px; }
.flyer-uploads { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .flyer-uploads { grid-template-columns: 1fr 1fr; } }
.flyer-upload-block { display: grid; gap: 8px; align-content: start; }
.dropzone-compact { min-height: 104px; }
.dropzone-compact .dz-empty { padding: 14px; }
.flyer-logo-thumbs .own-thumb img { object-fit: contain; padding: 6px; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.flyer-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 1000px) { .flyer-grid { grid-template-columns: repeat(4, 1fr); } }
.flyer-tile { display: flex; flex-direction: column; gap: 8px; }
.flyer-tile.is-chosen .flyer-media { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 92, 168, .28); }
.flyer-media { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line); aspect-ratio: 4 / 5; }
.flyer-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flyer-media .portrait-skeleton { aspect-ratio: auto; height: 100%; border-radius: 0; }
.flyer-media-story { aspect-ratio: 9 / 16; } .flyer-media-square { aspect-ratio: 1 / 1; } .flyer-media-a4 { aspect-ratio: 210 / 297; }
.flyer-edit { display: grid; gap: 18px; }
@media (min-width: 900px) { .flyer-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.flyer-preview { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.flyer-preview img { width: 100%; display: block; }
.flyer-side { display: grid; gap: 14px; }
.flyer-final { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; align-items: start; }
.flyer-final figcaption { padding: 6px 2px 0; }
.flyer-final .flyer-media { overflow: visible; border: 0; background: none; aspect-ratio: auto; }
.flyer-final .flyer-media img { border-radius: 10px; border: 1px solid var(--line); height: auto; }
.flyer-gallery { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .flyer-gallery { grid-template-columns: repeat(4, 1fr); } }

/* Logged-in home: compact product launcher, primary buttons pinned to the bottom of equal-height cards. */
.wrap > .products { margin-top: 18px; }
.products { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: stretch; }
.product-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .2s, transform .2s, box-shadow .2s; }
/* Each product has its own colour (--p, --p-soft, --p-text): the icon's tint and a band on top, so the four cards
   are told apart at a glance. */
.product-card { --p: var(--violet); --p-soft: var(--accent-soft); --p-text: var(--accent-text); }
.product-avatar { --p: #7c5cff; --p-soft: #efeaff; --p-text: #5b3fd9; }
.product-imagenes { --p: #2f80ed; --p-soft: #e7f0fd; --p-text: #1b5fb8; }
.product-flyers { --p: #f2994a; --p-soft: #fdf0e3; --p-text: #a2530e; }
.product-podcast { --p: #14a37f; --p-soft: #e3f6f0; --p-text: #0d7258; }
.product-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: var(--p); opacity: .9; transition: opacity .2s; }
.product-card:hover, .product-card:focus-within { border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.product-card:hover::before, .product-card:focus-within::before { opacity: 1; }
.product-formats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.product-formats li { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--p-soft); color: var(--p-text); }
.product-card.is-soon { opacity: .7; border-style: dashed; }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.product-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; background: var(--p-soft); border: 1px solid color-mix(in srgb, var(--p) 30%, transparent); color: var(--p-text); }
.product-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.product-aside { font-size: .8rem; font-weight: 600; color: var(--soft); text-decoration: none; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); white-space: nowrap; }
.product-aside:hover { color: var(--text); border-color: var(--violet); }
.product-card h3 { font-size: 1.08rem; letter-spacing: -.01em; }
.product-line { color: var(--text); font-size: .92rem; line-height: 1.4; font-weight: 500; }
.product-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 5px; }
.product-points li { position: relative; padding-left: 22px; color: var(--soft); font-size: .84rem; line-height: 1.35; }
.product-points li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--p-soft); color: var(--p-text); font-size: .68rem; font-weight: 800; line-height: 16px; text-align: center; }
.product-foot { margin-top: auto; padding-top: 10px; display: grid; gap: 10px; }
.product-foot .btn { min-height: 44px; padding: 8px 12px; white-space: normal; text-align: center; line-height: 1.2; font-size: .95rem; }
.progress-fill.p-0 { width: 4%; } .progress-fill.p-25 { width: 25%; } .progress-fill.p-50 { width: 50%; } .progress-fill.p-75 { width: 75%; } .progress-fill.p-100 { width: 100%; }
.progress-fill.p-33 { width: 33%; } .progress-fill.p-67 { width: 67%; }
@media (max-width: 719px) {
  .product-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 12px; row-gap: 6px; padding: 14px; }
  .product-top { display: contents; }
  .product-icon { grid-row: 1; grid-column: 1; width: 36px; height: 36px; border-radius: 11px; }
  .product-icon svg { width: 20px; height: 20px; }
  .product-card h3 { grid-row: 1; grid-column: 2; min-width: 0; }
  .product-aside, .product-top .badge { grid-row: 1; grid-column: 3; }
  .product-line, .product-points, .product-foot { grid-column: 1 / -1; }
  .product-foot { padding-top: 6px; }
}
@media (min-width: 720px) {
  .products { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .product-card { padding: 20px 18px 18px; }
}
@media (min-width: 1100px) {
  .page-home .wrap { max-width: 1200px; }
  .products { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .product-card:hover { transform: translateY(-2px); }
}

/* Creation flows: one sticky bar (back, "Paso N de M · step", exit) with a thin progress line, the primary action
   at the bottom right (sticky at the bottom on phones), and one short note when a step cannot be changed now. */
.flowbar { position: sticky; top: 0; z-index: 30; background: var(--header-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.flowbar-row { display: flex; align-items: center; gap: 10px; max-width: 1080px; margin: 0 auto; padding: 10px 12px; }
.fb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; flex: none; }
.fb-btn:hover { background: var(--card-2); }
.fb-btn svg { width: 22px; height: 22px; }
.fb-text { display: none; }
.fb-title { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; color: var(--soft); }
.fb-name { color: var(--text); font-weight: 800; }
/* A flow inside another one («Preparando a Laura», the set-up of an avatar): its name on its own line on a phone,
   before the step on wider screens. */
.fb-flow { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; font-weight: 700; color: var(--accent-text); line-height: 1.25; }
.fb-sep-flow { display: none; }
.in-flow .wrap { padding-top: 8px; }
.flow-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.flow-actions form { margin: 0; }
.flow-actions .btn-primary .spinner { margin-right: 2px; }
.btn-progress, .btn-progress[disabled] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); opacity: 1; box-shadow: none; cursor: progress; }
.btn-progress .spinner { border-color: rgba(91, 63, 217, .2); border-top-color: var(--accent-text); }
.busy-note { margin-bottom: 14px; }
.busy-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--text); font-size: .92rem; font-weight: 600; }
fieldset.lockable { display: contents; border: 0; padding: 0; margin: 0; }
fieldset.lockable[disabled] .dropzone, fieldset.lockable[disabled] .style-option, fieldset.lockable[disabled] .portrait-pick { opacity: .6; cursor: not-allowed; }
@media (min-width: 720px) {
  .flowbar-row { padding: 10px 28px; }
  .fb-text { display: inline; }
  .fb-back { padding: 0 14px 0 8px; }
  .fb-title { font-size: 1rem; }
  .fb-flow { display: inline; font-size: inherit; line-height: inherit; }
  .fb-sep-flow { display: inline; }
}
@media (max-width: 719px) {
  /* The primary action stays reachable with the thumb: sticky at the bottom, full width. */
  .flow-actions { position: sticky; bottom: 0; z-index: 15; margin: 16px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--header-bg); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .card .flow-actions, .form .flow-actions { margin-left: -20px; margin-right: -20px; border-radius: 0 0 var(--radius) var(--radius); }
  .flow-actions > .btn, .flow-actions > form { flex: 1 1 100%; }
  .flow-actions > form .btn, .flow-actions > .btn-primary { width: 100%; }
  .flow-actions > .btn-ghost { order: 2; }
  .in-flow .wrap { padding-bottom: 24px; }
}

/* Flash kinds: a tip never blocks; an error must be fixed to go on. */
.toast-head { display: block; margin-bottom: 6px; font-size: 1.05rem; font-weight: 800; }
.toast-tip { background: #fff8e1; border-color: #f5d27a; border-left-color: #e0a100; }
.toast-error { background: #ffe8e8; border: 2px solid #e57373; border-left: 8px solid #d32f2f; color: #5f1111; }
.toast-error .toast-head { color: #b42318; }

/* Every wait has one live box (templates/_progress.html `live_wait`, reelstudio/waits.py; 2026-11-18): the step, a bar
   that always moves (the fill is striped and slides; without a measured percentage it fills the track), the time since
   it started, the usual time, and an amber note once that time has gone by. */
.live-wait { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.card > .live-wait { margin-top: 12px; }
.live-title { font-size: 1.05rem; }
.live-wait .live-row { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; }
.live-wait .live-label { min-width: 0; overflow-wrap: anywhere; }
.live-wait .live-bar, .progress-copy .live-bar { height: 8px; }
.live-bar > span { background-image: linear-gradient(-45deg, rgba(255, 255, 255, .38) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .38) 50%, rgba(255, 255, 255, .38) 75%, transparent 75%), var(--grad); background-size: 22px 22px, 100% 100%; animation: live-stripes .9s linear infinite; }
p.live-time { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: .88rem; color: var(--text); }
.live-time [data-clock-text] { font-variant-numeric: tabular-nums; }
.live-time [data-clock-text]:not(:empty) + .live-expected:not(:empty)::before { content: "· "; color: var(--faint); }
.live-expected { color: var(--soft); font-weight: 600; }
.live-expected:empty { display: none; }
/* what the step running now does and how long it usually takes (the overlay: owner, 2026-11-18) */
.live-hint { margin: 0; font-size: .88rem; color: var(--soft); }
.live-hint[hidden] { display: none; }
.live-slow { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber); font-weight: 700; font-size: .92rem; }
.live-slow[hidden] { display: none; }
.live-slow-mark { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #e0a100; animation: live-blink 1.4s ease-in-out infinite; }
@keyframes live-blink { 50% { opacity: .25; } }
.progress-copy .live-slow { margin-top: 6px; }
.wait-card .live-wait { margin: 0; }
.upload-progress:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }

/* «Voz»: the clone in the background (reelstudio/voices.py). */
.voice-wait { display: grid; gap: 14px; border: 2px solid var(--accent-line); }
.voice-wait > * + * { margin-top: 0; }
.vw-title { margin: 0; font-size: 1.25rem; }
.vw-degraded { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: #fff4e5; border: 2px solid #f0a35b; color: #7a3d00; font-weight: 700; line-height: 1.45; }
.vw-degraded[hidden] { display: none; }
.vw-degraded-mark { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e07b00; color: #fff; font-weight: 900; }
.voice-just { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--green-soft); border: 2px solid var(--green); color: var(--green); font-weight: 800; font-size: 1.05rem; }

/* Errors are seen at once: a job or a step that failed is a red box, the same look as .toast-error (2026-11-18). */
.card-danger, .card-error { background: #ffe8e8; border: 2px solid #e57373; border-left: 8px solid #d32f2f; color: #5f1111; box-shadow: 0 6px 20px rgba(198, 40, 40, .14); }
.card-danger h2, .card-error-head { display: flex; align-items: center; gap: 10px; color: #b42318; }
.card-error-mark { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #d32f2f; color: #fff; font-weight: 900; font-size: 1rem; }
.card-danger p, .card-error-text { font-size: 1.02rem; line-height: 1.5; font-weight: 500; }
.field-error { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: #ffe8e8; border: 2px solid #e57373; border-left: 6px solid #d32f2f; color: #5f1111; font-weight: 600; font-size: .95rem; line-height: 1.45; }
.field-error[hidden] { display: none; }
.error-text { color: #b42318; font-weight: 700; }

/* «Voces en ElevenLabs» (/admin/voces, reelstudio/voice_slots.py). */
.slots-meter { display: grid; gap: 6px; max-width: 420px; }
.slots-meter .bar { height: 10px; }
.slots-meter.is-full .bar span { background: var(--red); }
.slot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.slot-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); }
.slot-item.is-free { border-color: var(--amber-line); background: var(--amber-soft); }
.slot-info { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.admin-alert { display: grid; gap: 6px; }

@media (prefers-reduced-motion: reduce) { .live-bar > span, .live-slow-mark { animation: none; } }

/* In-app image viewer */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center;
  background: rgba(20, 18, 30, .82); padding: 56px 16px 24px; }
.lightbox.is-open { display: flex; }
.lb-figure { margin: 0; max-width: min(92vw, 1100px); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 10px; background: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.lb-caption { color: #fff; font-size: .9rem; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.95); color: #1c1a26; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; line-height: 1; box-shadow: var(--shadow); }
.lb-close { top: 10px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
body.lb-lock { overflow: hidden; }
a[data-lightbox], .beat-media > a[href] { cursor: zoom-in; }
.lb-figure video { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 10px; background: #000; }


/* Copiar el estilo de un reel: reference box and style sheet */
.reference-box { display: grid; gap: 10px; margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 14px; }
.style-sheet { display: grid; gap: 10px; margin: 14px 0; padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.sheet-palette { display: flex; gap: 6px; margin: 0; }
.sheet-palette span { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); }
.sheet-look { flex-wrap: wrap; }
.sheet-look input[type=color] { width: 64px; height: 40px; padding: 2px; border-radius: 10px; }
.sheet-checks { display: flex; flex-wrap: wrap; gap: 14px; }


/* Waiting block of a job (templates/_wait.html): checklist, usual time, what really happened so far */
.wait-card { display: grid; gap: 14px; }
.wait-card > * + * { margin-top: 0; }
.wait-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wl { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .95rem; }
.wl-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; font-size: .7rem; line-height: 1; }
.wl-done { color: var(--soft); }
.wl-done .wl-dot { border-color: #10b981; background: #10b981; color: #fff; }
.wl-done .wl-dot::before { content: "\2713"; font-weight: 800; }
.wl-running { color: var(--text); font-weight: 600; }
.wl-running .wl-dot { border-color: var(--pink); background: var(--pink); box-shadow: 0 0 0 4px rgba(255, 92, 168, .22); }
.wait-progress { font-weight: 600; font-size: .95rem; color: var(--accent-text); }
.wait-feed { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 4px; font-size: .88rem; color: var(--faint);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.wait-feed li:last-child { color: var(--text); }
.wait-draft { display: grid; gap: 6px; padding: 12px 14px; background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); }
.wait-draft ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .92rem; color: var(--soft); }
.wait-tag { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.wait-voice { display: grid; gap: 6px; font-size: .92rem; font-weight: 600; }
.wait-voice audio { width: 100%; height: 40px; }

/* Image reel: the grid fills as each picture is made; the music of a finished reel */
.beat-count { font-weight: 600; color: var(--accent-text); margin-bottom: 10px; }
.beat-new { animation: fade .5s ease; }
.music-change { display: grid; gap: 8px; padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.music-change textarea { width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--field); resize: vertical; }
.music-done { color: var(--green); font-weight: 600; font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { .wait-bar span { transition: none; } .beat-new { animation: none; } }

/* Live progress of a podcast episode's jobs: under the label a thin bar, then how long it has been going and, once
   the step measures its own progress, about how long is left (counted every second by app.js). The bar is striped
   while there is no measured percentage; with reduced motion the stripes stand still and the words say it all. */
.live-bar { display: block; width: 100%; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.live-bar > span { display: block; height: 100%; min-width: 6px; border-radius: 99px; background: var(--grad); transition: width .6s ease; }
.live-bar.is-unknown > span { width: 100% !important; opacity: .7; background-image: linear-gradient(-45deg, rgba(255, 255, 255, .45) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .45) 50%, rgba(255, 255, 255, .45) 75%, transparent 75%), var(--grad); background-size: 22px 22px, 100% 100%; animation: live-stripes .9s linear infinite; }
@keyframes live-stripes { to { background-position: 22px 0, 0 0; } }
.live-time { font-size: .82rem; font-weight: 600; color: var(--soft); margin: 0; }
.live-time:empty { display: none; }
.progress-card .progress-copy { flex: 1; min-width: 0; }
/* The bar runs the whole width of its box (owner, 2026-11-15: capped at 440 px it ended mid-screen). */
.live-progress { flex-direction: column; align-items: stretch; justify-content: center; gap: 7px; padding: 10px 20px 12px; min-width: min(100%, 320px); max-width: 100%; text-align: left; font-size: 1rem; font-weight: 700; }
.live-progress .live-row { display: flex; align-items: center; gap: 10px; }
.live-progress .live-label { min-width: 0; overflow-wrap: anywhere; }
.live-progress .live-time { color: var(--accent-text); font-weight: 600; opacity: .85; }
.live-kicker { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); opacity: .85; }
.live-actions .live-progress, .flow-actions > .live-progress { flex: 1 1 100%; }
/* Missing footage: red and hard to miss (owner, 2026-11-15). Dark red text keeps it readable on the soft red. */
.footage-warn { display: grid; gap: 6px; margin: 12px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--red-soft); border: 2px solid var(--red); color: #7f1d1d; font-size: .92rem; }
.footage-warn p { margin: 0; }
.footage-alert { gap: 10px; margin: 0 0 16px; padding: 16px 18px; box-shadow: inset 6px 0 0 var(--red), 0 6px 20px rgba(198, 40, 40, .14); font-size: .95rem; }
.footage-alert-head { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; color: var(--red); }
.footage-alert-icon { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; }
.footage-alert-form { margin-top: 4px; padding-top: 10px; border-top: 1px solid #f3b4b4; }
.footage-alert-form .field span { color: #7f1d1d; }
.footage-alert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #a61f1f; border-color: #a61f1f; }
.footage-pointer { margin: 10px 0; color: var(--red); font-weight: 700; font-size: .92rem; }
.who-card video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; }
@media (max-width: 719px) {
  /* Two jobs at work make two tall status boxes: they stay in the page instead of covering the screen. */
  .flow-actions.live-actions { position: static; margin: 16px 0 0; padding: 0; background: none; backdrop-filter: none; border-top: 0; }
}
/* The free coverage check of the files step (reelstudio/podcast_coverage.py): checking (violet, live), all clear
   (green) or problems (the red box above), then a timeline of what each source covers. All rows share one time
   axis and one width: on a phone the name sits above its bar, on a wider screen in a column of fixed width, so the
   bars always line up with each other and with the axis. Parts alternate two close tones and start with a thin
   white edge, so where one part ends and the next begins shows even where they overlap; gaps are striped red. */
.coverage-box { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-2); }
.coverage-box p { margin: 0; }
.coverage-box > .spinner { margin-top: 3px; }
.coverage-copy { flex: 1; min-width: 0; display: grid; gap: 5px; }
.coverage-checking { border-color: var(--accent-line); background: var(--accent-soft); }
.coverage-checking b { color: var(--accent-text); }
.coverage-waiting { color: var(--soft); }
.coverage-failed { border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber); }
.coverage-clear { border: 2px solid var(--green); background: var(--green-soft); color: var(--green); font-size: 1.02rem; box-shadow: inset 6px 0 0 var(--green); }
.coverage-ok-line { margin: 10px 0; color: var(--green); font-weight: 700; font-size: .92rem; }
.coverage { --cov-head: 190px; margin: 0 0 16px; padding: 14px 16px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.coverage-title { font-size: .95rem; margin: 0 0 10px; }
.cov-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cov-row, .cov-axis { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 5px; }
.cov-head { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.cov-note { color: var(--soft); font-size: .8rem; font-weight: 600; }
.cov-track { position: relative; height: 22px; border-radius: 6px; border: 1px solid var(--line-2); overflow: hidden; background-color: var(--card-2); background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(var(--cov-step, 100%) - 1px), rgba(17, 24, 39, .14) calc(var(--cov-step, 100%) - 1px), rgba(17, 24, 39, .14) var(--cov-step, 100%)); }
.cov-part, .cov-gap { position: absolute; top: 0; bottom: 0; }
.cov-part { min-width: 2px; box-shadow: inset 2px 0 0 rgba(255, 255, 255, .9); }
.cov-part:first-child { box-shadow: none; }
.cov-tone-a { background: #7c5cff; }
.cov-tone-b { background: #5a3dd6; }
.cov-tone-ref { background: #334155; box-shadow: none; }
.cov-repeat { background: repeating-linear-gradient(45deg, #b45309 0 4px, #f5d38a 4px 8px); }
.cov-gap { z-index: 1; min-width: 3px; background: repeating-linear-gradient(-45deg, var(--red) 0 5px, #ef6b6b 5px 10px); }
.cov-texts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .8rem; line-height: 1.4; color: var(--soft); }
.cov-texts li { overflow-wrap: anywhere; }
.cov-t-gap { color: var(--red); font-weight: 700; }
.cov-t-off, .cov-t-repeat { color: var(--amber); font-weight: 700; }
.cov-t-off::before, .cov-t-repeat::before { content: "\26A0\FE0E\00A0"; }
.cov-ticks { position: relative; height: 18px; margin-top: 6px; font-size: .74rem; font-weight: 600; color: var(--faint); }
.cov-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.cov-tick-first { transform: none; }
.cov-tick-end { transform: translateX(-100%); }
@media (min-width: 640px) {
  .cov-row, .cov-axis { grid-template-columns: var(--cov-head) minmax(0, 1fr); column-gap: 14px; }
  .cov-head { grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; align-self: start; padding-top: 1px; }
  .cov-track, .cov-texts, .cov-ticks { grid-column: 2; }
}

/* The episode plan (2026-11-15, the owner: "más notorios los campos a escribir", "«Cambialo así» primero y bien
   notorio", "más simple"). The written changes come first in a card of their own; every field that can be written has
   a white background, a strong border, a pencil and "✎ Podés editarlo" over its block; each block saves with its own
   button. Light theme only (the app has no dark mode); text and borders keep 3:1 or more against their background. */
.ask-card { margin: 16px 0 10px; padding: 18px; border: 2px solid var(--violet); border-radius: var(--radius); background: var(--accent-soft); box-shadow: var(--shadow); }
.ask-card > * + * { margin-top: 10px; }
.ask-title { margin: 0; font-size: 1.3rem; }
.ask-lead { margin: 6px 0 0; }
.ask-examples { display: grid; gap: 8px; }
.ask-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ask-group > b { flex: 0 0 92px; font-size: .85rem; color: var(--text); }
.ask-chip { min-height: 34px; padding: 5px 12px; border: 1px solid var(--accent-line); border-radius: 999px; background: #fff; color: var(--accent-text); font-size: .88rem; font-weight: 600; cursor: pointer; text-align: left; }
.ask-chip:hover { border-color: var(--violet); background: #faf8ff; }
.ask-chip:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.edit-tag { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 10px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: .78rem; font-weight: 700; letter-spacing: 0; vertical-align: middle; white-space: nowrap; }
#episodio .editable, #cortos .editable, .client-ask .editable { background-color: #fff; border: 2px solid var(--violet); border-radius: 12px; color: var(--text); padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b3fd9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px top 12px; background-size: 16px 16px; }
#episodio .editable:hover, #cortos .editable:hover, .client-ask .editable:hover { border-color: var(--accent-text); }
#episodio .editable:focus, #cortos .editable:focus, .client-ask .editable:focus { border-color: var(--accent-text); box-shadow: 0 0 0 4px rgba(124, 92, 255, .22); }
#episodio .editable::placeholder, #cortos .editable::placeholder, .client-ask .editable::placeholder { color: #6b7080; }
#episodio .ask-card textarea.editable, #cortos .ask-card textarea.editable, .client-ask textarea.editable { min-height: 96px; font-size: 1rem; }
#episodio .topic-list input.editable { padding: 10px 40px 10px 12px; }
.plan-block { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.plan-block > h3:first-child, .plan-block > .form > h3:first-child { margin-top: 0; }
.save-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.btn-save { min-height: 44px; background: var(--accent-soft); border: 2px solid var(--violet); color: var(--accent-text); }
.btn-save:hover { background: #e4dcff; }
.btn-save:disabled { opacity: .6; cursor: default; }
.produce-form { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
/* What the client asked for ("¿Qué te pidieron?" and "Lo que te pidieron"), how the edition opens and the voices that
   are not part of the show (2026-11-15). */
.client-ask { display: grid; gap: 6px; margin-top: 14px; }
.client-ask .field > span { font-size: 1rem; }
.choice-list { display: grid; gap: 8px; margin-top: 10px; }
.choice { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; }
.choice:has(input:checked) { border-color: var(--violet); background: var(--accent-soft); }
.moment-fields { display: grid; gap: 10px; margin-top: 12px; padding: 14px; border: 1px dashed var(--accent-line); border-radius: 12px; background: #fff; }
.moment-found { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.moment-frame { width: min(320px, 100%); height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #111; }
.moment-found p { flex: 1 1 200px; }
.moment-times .field-narrow { flex: 0 1 120px; min-width: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 0; padding: 0; border: 0; min-width: 0; }
.choice-row legend { flex: 0 0 100%; float: left; width: 100%; padding: 0; margin-bottom: 4px; }
.asked-list { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 8px; }
.asked { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.asked-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 999px; font-weight: 800; font-size: .88rem; white-space: nowrap; }
.asked-done .asked-mark { background: var(--green-soft); color: var(--green); }
.asked-no .asked-mark { background: var(--red-soft); color: var(--red); }
.asked-shorts .asked-mark { background: var(--accent-soft); color: var(--accent-text); }
.asked-changed .asked-mark { background: var(--amber-soft); color: var(--amber); }
.asked-body { display: grid; gap: 2px; min-width: 0; }
.asked-text { overflow-wrap: anywhere; }
.asked-state { font-size: .86rem; color: var(--soft); }
.asked-original { margin-top: 10px; }
.asked-original pre { margin: 8px 0 0; max-height: 260px; overflow: auto; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .86rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.outside-form { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.inline-form { display: inline; }
.ai-fixes { margin: 10px 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.ai-fixes > * + * { margin-top: 8px; }
.ai-fix-fold > summary { cursor: pointer; list-style: none; }
.ai-fix-fold > summary::-webkit-details-marker { display: none; }
.ai-fix-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.ai-fix { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ai-fix-words { font-weight: 700; }
.ai-fix.is-undone .ai-fix-words { text-decoration: line-through; color: var(--soft); }
.proofread-line { margin: 8px 0; }
.proofread-card h3 { margin: 0; }

/* Share links (compartir por link): the owner's window on the episode page and the public download page. */
.share-form { margin: 0; }
.share-what { margin-top: 10px; overflow-wrap: anywhere; }
.share-busy { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--soft); }
.share-link { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.share-link .share-url { flex: 1 1 auto; min-width: 0; padding: 10px 12px; font-size: .92rem; background: var(--bg-2); color: var(--text); }
.share-link .btn { flex: none; min-height: 44px; }
.share-facts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; color: var(--soft); }
.share-facts b { color: var(--text); }
.share-dialog .modal-actions { align-items: center; }
.share-dialog .modal-actions .share-revoke { margin: 0; }
@media (max-width: 559px) {
  .share-link { flex-direction: column; align-items: stretch; }
  .share-link .btn { width: 100%; }
  .share-dialog .modal-actions .share-revoke { text-align: center; }
}
@media (min-width: 560px) { .share-dialog .modal-actions .share-revoke { margin-right: auto; } }
.share-top { display: flex; justify-content: center; padding: 16px; border-bottom: 1px solid var(--line); background: var(--header-bg); }
.share-wrap { max-width: 600px; }
.share-card { padding: 0; overflow: hidden; }
.share-card > * + * { margin-top: 0; }
.share-poster { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.share-poster.is-vertical { aspect-ratio: 9 / 16; width: auto; max-width: 100%; max-height: 56vh; margin: 0 auto; }
.share-body { padding: 20px; display: grid; gap: 12px; }
.share-body .eyebrow { margin: 0; overflow-wrap: anywhere; }
.share-title { font-size: clamp(1.5rem, 5vw, 2.1rem); overflow-wrap: anywhere; }
.share-edition { font-weight: 800; color: var(--accent-text); }
.share-meta { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.share-meta li { flex: 1 1 90px; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.share-until { font-weight: 600; }
.share-missing { padding: 28px 22px; text-align: center; display: grid; gap: 10px; }
.share-files h2 { margin: 0; }
.share-file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; }
.share-file-list p { margin-top: 4px; }
.share-foot { margin-top: 18px; }

/* «Fijar la imagen» (reelstudio.podcast_motion): a camera whose picture moves on its own, warned in amber with the
   fix right inside; once the fix is on, a green mark says so */
.motion-alert { display: grid; gap: 8px; margin: 0 0 16px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 2px solid var(--amber-line); box-shadow: inset 6px 0 0 #d97706, 0 6px 20px rgba(146, 64, 14, .12); font-size: .95rem; }
.motion-alert p { margin: 0; }
.motion-alert-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 1.05rem; color: var(--amber); }
.motion-alert-icon { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #d97706; color: #fff; font-weight: 900; }
.motion-state { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .85rem; font-weight: 700; }
.motion-alert-form { display: grid; gap: 8px; justify-items: start; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--amber-line); }
.motion-alert.is-on { box-shadow: inset 6px 0 0 var(--green), var(--shadow); }

/* «Antes de grabar» (files step) and «Revisión automática» (each finished video), reelstudio/podcast_quality.py:
   2026-11-16, a client found a washed-out camera (HDR) and a picture sliding on a still tripod in a delivered edition.
   The tips are advice, not a problem: violet with the app's left bar, open until the episode has files. The review
   is a quiet box with green marks; with something to look at it turns amber like the motion warning. */
.record-tips { margin: 0 0 16px; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 2px solid var(--accent-line); box-shadow: inset 6px 0 0 var(--violet); font-size: .95rem; }
.record-tips > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; cursor: pointer; list-style: none; }
.record-tips > summary::-webkit-details-marker { display: none; }
.record-tips > summary::after { content: "Ver \25BE"; margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--accent-text); white-space: nowrap; }
.record-tips[open] > summary::after { content: "Cerrar \25B4"; }
.record-tips-icon { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-text); color: #fff; font-weight: 900; }
.record-tips-title { font-size: 1.05rem; color: var(--accent-text); }
.record-tips-sub { color: var(--soft); font-size: .88rem; }
.record-tips-list { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.record-tips-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--accent-line); color: var(--soft); font-size: .88rem; }
.quality-review { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line-2); box-shadow: inset 4px 0 0 var(--green); font-size: .92rem; }
.quality-review.has-warn { background: var(--amber-soft); border-color: var(--amber-line); box-shadow: inset 4px 0 0 #d97706; }
.quality-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.quality-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.quality-list li { display: flex; gap: 8px; align-items: baseline; }
.quality-mark { flex: none; width: 1.1em; font-weight: 800; }
.quality-ok .quality-mark { color: var(--green); }
.quality-warn { color: var(--amber); font-weight: 600; }
.quality-warn a { font-weight: 700; white-space: nowrap; }
.quality-old { margin: 0; }

/* Avatar parity with OMARREELS (2026-11-17): reference photos, angle pick, listening to the voice, segment redo. */
.dz-previews { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 16px; pointer-events: none; }
.dz-previews img { width: 74px; height: 98px; object-fit: cover; border-radius: 10px; border: 2px solid var(--card); box-shadow: var(--shadow); }
.dz-count { width: 100%; text-align: center; }
.ref-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.ref-photos li { display: grid; gap: 4px; }
.ref-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }
.ref-photo-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.ref-photo-foot form { margin: 0; }
.ref-strip { display: flex; justify-content: center; }
.ref-strip .empty-photo + .empty-photo { margin-left: -26px; }
.voice-how { display: grid; gap: 12px; }
.read-instead summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
.read-instead > * + * { margin-top: 10px; }
.angle-option { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.angle-option .badge { vertical-align: middle; }
.angle-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.angle-pick { display: block; cursor: pointer; }
.angle-pick input { position: absolute; opacity: 0; }
.angle-card { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); transition: border-color .15s, box-shadow .15s; }
.angle-pick input:checked + .angle-card { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 92, 168, .2); }
.angle-pick input:focus-visible + .angle-card { outline: 3px solid var(--pink); outline-offset: 2px; }
.angle-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.angle-title { font-size: 1.02rem; }
.angle-score { flex: none; font-weight: 800; font-size: 1.15rem; color: var(--accent-text); }
.angle-score small { font-size: .7rem; color: var(--faint); font-weight: 600; }
.angle-hook { font-size: 1.05rem; font-style: italic; }
.angle-row { font-size: .9rem; color: var(--soft); }
.angle-row em { font-style: normal; font-weight: 700; color: var(--text); margin-right: 4px; }
.listen { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.listen audio { width: 100%; }
.listen-match { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.listen form { margin: 0; }
.segments > * + * { margin-top: 12px; }
.segment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.segment { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.segment-info { display: grid; gap: 2px; flex: 1 1 260px; }
.segment-text { color: var(--soft); font-size: .9rem; font-style: italic; }
.segment form { margin: 0; }
.mini-link.danger { color: var(--red); }
.segments { margin-top: 20px; }
/* «¿Alguna frase se escucha mal?» on a finished image reel (templates/_line_fix.html): the segments' list, with the
   form that corrects a line's text folded under it. */
.line-fix .segment { align-items: flex-start; }
.fix-price { font-size: .92rem; }
.fix-ways { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.fix-edit { margin-top: 6px; }
.fix-edit summary { cursor: pointer; }
.fix-form { display: grid; gap: 8px; margin-top: 8px; }
.fix-form textarea { width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--field); resize: vertical; }
.fix-note-ok p:first-child { color: var(--green); font-weight: 600; }
/* «Grabar todo el reel con la voz nueva», on top of «¿Alguna frase se escucha mal?»: it has to stand out. */
.revoice-card { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 2px solid var(--amber-line); }
.revoice-card p { margin: 0; }
.revoice-card form { margin: 0; }
.more .muted { margin-bottom: 10px; }

/* Public Google Drive links (podcast files step and a reel's material, 2026-11-17): the form stands out, the import
   box says what is happening and what was left out. */
.drive-form { margin: 0 0 18px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 2px solid var(--accent-line); box-shadow: inset 6px 0 0 var(--violet); }
.drive-title { margin: 0 0 6px; font-size: 1.05rem; }
.drive-box { display: grid; gap: 6px; margin: 12px 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--green-soft); border: 1px solid #a7f3d0; }
.drive-box.is-working { background: var(--accent-soft); border-color: var(--accent-line); }
.drive-box.is-failed { background: var(--red-soft); border: 2px solid var(--red); }
.drive-box p { margin: 0; }
.drive-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drive-skipped summary { cursor: pointer; }
.drive-skipped ul { margin: 6px 0 0; }
.hint { margin: 4px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber); }
.role-change { margin-top: 6px; }
.role-change summary { cursor: pointer; list-style: none; }
.role-form { margin-top: 8px; display: grid; gap: 8px; }
.inline-form { display: inline; }

/* «Tu material» of a reel with videos */
.material-card .lede { margin-top: 0; }
.material-how { margin: 0 0 16px; padding: 12px 16px 12px 34px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: 6px; font-size: .92rem; }
.material-title { margin: 18px 0 8px; font-size: 1.02rem; }
.material-videos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.material-video { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); }
.material-video.video-failed { border-color: var(--red); background: var(--red-soft); }
.material-poster { width: 72px; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--card-2); display: grid; place-items: center; }
.material-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.material-info { display: grid; gap: 2px; min-width: 0; }
.material-info b { overflow-wrap: anywhere; }
.material-failed { margin: 10px 0 0; display: grid; gap: 6px; }
.material-add { margin: 16px 0; }
.material-add > summary { list-style: none; cursor: pointer; display: inline-flex; }
.material-add-body { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }   /* no wider than a phone */
.material-add-body input[type=file] { max-width: 100%; min-width: 0; }
.material-upload { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.material-start { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.bites-check { margin: 12px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.dropzone-video { min-height: 120px; margin-top: 10px; }
.own-videos { margin: 6px 0; display: grid; gap: 4px; }
.upload-progress { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; }

/* A video beat on the images review: its tag, its time range and «Cambiar por otra toma» */
.clip-tag { background: #111827; }
/* «Tus fotos y videos en el video» on the review of an avatar video (reelstudio/avatarmaterial.py) */
.own-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 6px 0 12px; }
.beat-media .portrait-skeleton.ai-beat { animation: none; gap: 6px; padding: 12px; text-align: center; font-weight: 700;
  background: repeating-linear-gradient(135deg, var(--card), var(--card) 12px, var(--card-2) 12px, var(--card-2) 24px); }
.own-video { border: 2px dashed var(--accent-line); border-radius: var(--radius-sm); padding: 6px 16px 16px;
  background: var(--bg-2); }
.own-video > legend { font-size: 1.08rem; font-weight: 800; padding: 0 8px; background: var(--card); border-radius: 999px; }
.own-video .dropzone + .dropzone { margin-top: 10px; }
.beat-media img.own-photo { object-fit: contain; background: #1f2230; }   /* the reel shows the whole photo */
.nowrap { white-space: nowrap; }
.own-video .material-how { margin: 0; }
/* The numbered box straight in a form (the price parts of «Reel con imágenes y videos», imagereel_new.html): the
   form's spacing, not the material page's bottom margin. */
.form > * + .material-how { margin: 16px 0 0; }
.profile-box > .field + .field { margin-top: 8px; }   /* two fields in one box (the topic of an image reel) */
.clip-range { margin: 0; }
.moment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 8px 0; max-height: 520px; overflow: auto; }
.moment-option { position: relative; display: grid; gap: 4px; padding: 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.moment-option img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; display: block; }
.moment-option input { position: absolute; top: 10px; left: 10px; z-index: 1; }
.moment-option:has(input:checked) { border-color: var(--violet); box-shadow: 0 0 0 3px var(--accent-soft); }

/* «Mostrar una app o una página web» (reelstudio/sitecapture.py, 2026-11-18): the optional block of the three forms
   stands out with the violet accent of the Drive form, the box of a page being opened says what happens, and what
   came from the page is marked «De la página» (a phone capture is shown whole). */
.site-box { border-color: var(--violet); background: var(--accent-soft); box-shadow: inset 6px 0 0 var(--violet); }
.site-lede { margin: 6px 0 10px; }
.site-box .field + .field { margin-top: 10px; }
.site-form { box-shadow: inset 6px 0 0 var(--violet); }
.site-address { overflow-wrap: anywhere; }
.site-badge { position: absolute; left: 6px; bottom: 6px; z-index: 2; padding: 2px 7px; border-radius: 999px; background: var(--violet); color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.5; }
.site-badge.is-inline { position: static; display: inline-block; justify-self: start; vertical-align: middle; }
/* «Inventamos las pantallas con IA» (reelstudio/sitemock.py, 2026-11-18, «eso sí, que alerte»): the choice «No tengo
   link», its form with the amber warning (shown before anything is made), the offer of a page that could not be
   opened, and the amber «Inventada con IA» tags of the material and the review. The site box shows one part or the
   other without any script. */
.site-mode { margin: 2px 0 12px; }
.site-box [data-site-mock] { display: none; }
.site-box:has([data-site-mode][value="mock"]:checked) [data-site-mock] { display: block; }
.site-box:has([data-site-mode][value="mock"]:checked) [data-site-link] { display: none; }
.mock-box, .mock-offer { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--card); border: 2px solid var(--amber-line); box-shadow: inset 6px 0 0 #d97706; }
.mock-offer { margin-top: 12px; }
.mock-offer-head { display: flex; gap: 8px; align-items: center; font-size: 1.02rem; color: var(--amber); margin-bottom: 6px; }
.ai-star { color: #d97706; font-size: 1.15em; line-height: 1; }
.mock-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.mock-fields input[type=file] { max-width: 100%; min-width: 0; }
.mock-box, .mock-offer, .mock-warning { min-width: 0; overflow-wrap: break-word; }
.mock-fields .field + .field { margin-top: 0; }
.mock-colours { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.mock-colours legend { font-weight: 600; font-size: .93rem; padding: 0; margin-bottom: 4px; }
.mock-colour-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.mock-colour { display: inline-flex; flex: none; align-items: center; gap: 8px; font-size: .9rem; white-space: nowrap; }
.mock-colour-row .mock-colour input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--field); cursor: pointer; }
.mock-warning { padding: 12px 14px; border-radius: var(--radius-sm); background: #fff4d6; border: 2px solid #f0b429; box-shadow: inset 6px 0 0 #d97706; color: #7a3d00; font-weight: 700; font-size: .95rem; }
.mock-warning p { display: flex; gap: 8px; align-items: flex-start; }
.mock-warning-icon { font-size: 1.25em; line-height: 1.15; }
.mock-warning .mock-warning-sample { flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-weight: 400; }
.ai-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: #ffb020; color: #211500; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); font-weight: 800; font-size: .82rem; overflow-wrap: normal; }
.mock-consent { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid var(--amber-line); font-weight: 600; }
.mock-price { margin-top: 12px; font-size: .92rem; color: var(--amber); }
.mock-go { margin-top: 12px; }
.mock-details > summary { list-style: none; display: inline-flex; margin-top: 6px; }
.mock-details > summary::-webkit-details-marker { display: none; }
.mock-details[open] > summary { display: none; }
.mock-form .btn-primary { margin-top: 12px; }
.site-badge.is-mock, .own-tag.mock-own-tag, .mock-tag { background: #ffb020; color: #211500; box-shadow: 0 0 0 1px rgba(122, 61, 0, .25); }
.mock-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; vertical-align: middle; }
.site-status.is-mock { border-color: var(--amber-line); }
.site-status .mock-warning { margin-top: 10px; }
.own-thumb.is-site { border-color: var(--accent-line); }
.own-thumb.is-site img { object-fit: contain; background: #1b1740; }

/* Avatar profiles (2026-11-17): «Tus avatares», «¿Con qué avatar?», the avatar box of the steps and the home row. */
.avatar-grid { list-style: none; margin-left: 0; margin-right: 0; margin-bottom: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .avatar-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .avatar-grid { grid-template-columns: repeat(3, 1fr); } }
.avatar-card { display: grid; grid-template-columns: 76px 1fr; grid-template-rows: 1fr; gap: 12px 14px; align-content: start; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.avatar-card.is-current { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.avatar-photo { width: 76px; height: 100px; border-radius: 14px; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initial { font-size: 1.4rem; font-weight: 800; color: var(--accent-text); }
.avatar-info { display: grid; gap: 6px; min-width: 0; align-content: start; }
.avatar-info .badge { justify-self: start; }
.avatar-name { font-size: 1.1rem; overflow-wrap: anywhere; }
.avatar-desc { font-size: .88rem; color: var(--soft); line-height: 1.4; overflow-wrap: anywhere; }
.avatar-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-chips li { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.avatar-chips .is-ok { background: var(--green-soft); color: var(--green); }
.avatar-chips .is-missing { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber-line); }
.avatar-new { grid-template-columns: 1fr; border-style: dashed; box-shadow: none; background: var(--bg-2); padding: 0; }
.avatar-new-link { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 180px; padding: 20px; text-align: center; color: var(--text); text-decoration: none; border-radius: var(--radius); }
.avatar-new-link:hover { background: var(--accent-soft); }
.avatar-plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--grad-strong); color: var(--on-accent); font-size: 1.6rem; font-weight: 800; line-height: 1; }
.avatar-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.avatar-face { width: 44px; height: 44px; flex: none; border-radius: 50%; overflow: hidden; background: var(--card); display: grid; place-items: center; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--accent-line); }
.avatar-face img { width: 100%; height: 100%; object-fit: cover; }
.avatar-face .avatar-initial { font-size: 1rem; }
.avatar-box-text { display: grid; gap: 1px; min-width: 0; flex: 1 1 200px; line-height: 1.3; }
.avatar-box-text b { overflow-wrap: anywhere; }
.avatar-box-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; margin-left: auto; }

/* «Mis creaciones»: search box, type filters and pages (app.creations_list); a small search next to the home list. */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--soft); font-size: .86rem; font-weight: 600; text-decoration: none; }
.filter-chip span { font-size: .75rem; font-weight: 800; color: var(--faint); }
.filter-chip:hover { border-color: var(--violet); color: var(--text); }
.filter-chip.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.filter-chip.is-on span { color: var(--accent-text); }
.pager { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 18px 0 4px; }
.pager-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.pager-pages a, .pager-pages b { display: inline-grid; place-items: center; min-width: 38px; min-height: 38px; padding: 0 8px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.pager-pages a { color: var(--soft); border: 1px solid var(--line); background: var(--card); }
.pager-pages a:hover { border-color: var(--violet); color: var(--text); }
.pager-pages b { background: var(--grad-strong); color: #fff; }

/* «¿Con qué avatar?»: each card's own «✏️ Editar» and «✕ Archivar» (owner, 2026-11-18: the faint link was hard to read) */
.avatar-tools { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin: 2px 0 0; }   /* the whole card width */
.avatar-tools form { margin: 0; }
.btn-ghost.danger { border-color: #f3b4b4; color: #b42318; }
.btn-ghost.danger:hover { background: #fff0f0; }
/* the avatars' search box (static/avatar_search.js), shown with more than 6 avatars */
.avatar-search { margin: 0 0 14px; }
.avatar-search input[type=search] { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); font: inherit; color: var(--text); }
.avatar-search input[type=search]:focus { outline: 2px solid var(--accent-line); border-color: var(--violet); }
.avatar-grid > li[hidden] { display: none; }
/* cards of a row share its height: the photo and text row takes the extra space, so «Editar · Borrar» and «Usar este
   avatar» sit at the same height on every card, however long its description (owner, 2026-11-18) */
}

/* ============================================================ TOKENS (light theme only; the old names are kept, so
   templates and inline styles still resolve) */
@layer tokens {
  :root {
    color-scheme: light;
    /* surfaces: a cool off-white canvas, white cards, quiet wells */
    --bg: #f7f7fa; --bg-2: #f1f1f6; --card: #ffffff; --card-2: #f6f6f9; --field: #ffffff;
    /* lines: hairline for cards; fields reach 3:1 on white and on the tinted boxes (WCAG 1.4.11) */
    --line: #e6e6ee; --line-2: #d6d6e0; --field-line: #7d8290;
    /* text */
    --text: #1f2328; --soft: #4b5563; --faint: #626875; --placeholder: #6b7080;
    /* brand: violet→pink in the brand, the primary button and progress; violet-700 for links, focus and selection */
    --violet: #7c5cff; --pink: #ff5ca8;
    --accent-text: #5b3fd9; --accent-soft: #f1edff; --accent-line: #d4c9ff;
    --grad: linear-gradient(135deg, var(--violet), var(--pink));
    --grad-strong: linear-gradient(135deg, #6741d9, #c2255c);
    --on-accent: #ffffff;
    /* status: text ≥ 4.5:1 on its soft fill */
    --green: #047857; --green-soft: #ecfdf5; --green-line: #a7e3c9;
    --amber: #92400e; --amber-soft: #fff8e6; --amber-line: #f2cf86; --amber-mark: #d97706;
    --red: #b42318; --red-soft: #fff1f0; --red-line: #f3b0aa; --red-mark: #d32f2f; --red-strong: #e57373;
    --info: var(--accent-text); --info-soft: var(--accent-soft); --info-line: var(--accent-line);
    /* focus: one ring for every control, 2 px violet with a white gap */
    --focus: 0 0 0 2px #fff, 0 0 0 4px #5b3fd9;
    /* spacing: 4/8 */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
    /* radii */
    --r-xs: 6px; --r-sm: 10px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
    /* elevation */
    --shadow-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
    --shadow-2: 0 2px 6px rgba(16, 24, 40, .06), 0 12px 32px rgba(16, 24, 40, .08);
    --shadow-3: 0 8px 24px rgba(16, 24, 40, .12), 0 24px 56px rgba(16, 24, 40, .16);
    /* type: 9 roles */
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --t-display: 800 clamp(1.75rem, 1.2rem + 2.2vw, 2.25rem)/1.15 var(--sans);
    --t-h1: 800 clamp(1.5rem, 1.25rem + 1vw, 1.875rem)/1.2 var(--sans);
    --t-h2: 700 1.25rem/1.4 var(--sans);
    --t-h3: 700 1.0625rem/1.45 var(--sans);
    --t-body: 400 1rem/1.5 var(--sans);
    --t-small: 400 .875rem/1.45 var(--sans);
    --t-label: 600 .9375rem/1.4 var(--sans);
    --t-caption: 600 .8125rem/1.35 var(--sans);
    --t-eyebrow: 700 .75rem/1.3 var(--sans);
    /* layout */
    --gutter: 16px;
    --w-app: 1120px; --w-flow: 880px; --w-auth: 440px; --w-prose: 720px;
    --measure: none;   /* texts run to the edge of their frame, never stop mid-box (owner, 2026-11-18 and 2026-11-19) */
    --bar-h: 64px;
    /* the old names, mapped onto the new scale */
    --header-bg: rgba(255, 255, 255, .94); --overlay: rgba(255, 255, 255, .86); --scrim: rgba(17, 24, 39, .45);
    --radius: var(--r-lg); --radius-sm: var(--r-md);
    --shadow: var(--shadow-1); --shadow-lg: var(--shadow-2);
  }
  @media (min-width: 720px) { :root { --gutter: 24px; } }
  @media (min-width: 1024px) { :root { --gutter: 32px; } }
}

/* ============================================================ LAYOUT: one frame (.shell) for the bar, the content
   and the footer; one rhythm (.stack, gap only) */
@layer layout {
  .shell { width: 100%; max-width: calc(var(--container, var(--w-app)) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
  body.in-flow { --container: var(--w-flow); }
  body.is-auth { --container: var(--w-auth); }
  body.is-prose { --container: var(--w-prose); }
  main.wrap { flex: 1; width: 100%; max-width: none; margin: 0; padding: var(--s-5) 0 var(--s-7); }
  @media (min-width: 720px) { main.wrap { padding: var(--s-6) 0 var(--s-8); } }

  /* the rhythm: sections 24 px apart (32 from 720 px), never margins on children */
  .stack, .step, .job, .avatars-page { display: flex; flex-direction: column; gap: var(--stack, var(--s-5)); min-width: 0; }
  .stack > *, .step > *, .job > *, .avatars-page > * { margin-block: 0; min-width: 0; }
  .stack-sm { --stack: var(--s-3); }
  .stack-md { --stack: var(--s-4); }
  .stack-xs { --stack: var(--s-2); }
  @media (min-width: 720px) { .stack, .step, .job, .avatars-page { gap: var(--stack, var(--s-6)); } }
  .stack > .btn:not(.btn-block), .step > .btn:not(.btn-block), .stack > form:not([class]) { align-self: flex-start; }
  .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster, var(--s-3)); }
  .cluster > * { min-width: 0; margin: 0; }
  .spread { justify-content: space-between; }
  .cluster-end { justify-content: flex-end; }

  /* page header: the question of the step, one lede */
  .page-head, .step-head, .home-head { display: grid; gap: var(--s-2); margin: 0; }
  .page-head > *, .step-head > *, .home-head > * { margin: 0; }
  .page-head .status, .step-head .status { justify-self: start; }
  .page-head .lede, .step-head .lede, .home-head .lede { max-width: none; }
  .page-head .eyebrow, .step-head .eyebrow { margin: 0; }
  .page-head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-4); }
  .section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin: 0; }
  .section-head > h1, .section-head > h2 { margin: 0; }
  .section-head > .btn-text { margin-right: calc(-1 * var(--s-2)); }
  .section-title { margin: 0; font: var(--t-h2); }
  .lede { color: var(--soft); font-size: 1.0625rem; line-height: 1.5; margin: 0; max-width: none; }
  .lede-small { color: var(--soft); max-width: var(--measure); margin: 0; }
  .eyebrow { display: inline-block; font: var(--t-eyebrow); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin: 0; }
  .muted { color: var(--soft); }
  .small { font-size: .875rem; line-height: 1.45; }
  .center { text-align: center; }
  .hint { font: var(--t-small); color: var(--soft); max-width: var(--measure); margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
  .opt { font-weight: 400; color: var(--faint); }

  /* the one place where phone and desktop differ in structure: the primary of a result page */
  @media (max-width: 719px) { .only-desktop { display: none !important; } }
  @media (min-width: 720px) { .only-phone { display: none !important; } }
}

/* ============================================================ COMPONENTS (existing class names keep working; NEW
   marks the few new ones) */
@layer components {
  /* --- skip link and fake-mode banner */
  .skip { position: absolute; left: 12px; top: -80px; z-index: 60; padding: 10px 14px; background: var(--text); color: #fff; border-radius: var(--r-sm); font-weight: 700; }
  .skip:focus { top: 12px; }
  .fake-banner { background: repeating-linear-gradient(45deg, #fff4c2, #fff4c2 6px, #ffefad 6px, #ffefad 12px); color: #713f12;
    border-bottom: 1px solid var(--amber-line); font: var(--t-caption); padding: 6px 0; text-align: left; }

  /* --- top bar (app pages): brand · Inicio · Mis creaciones · Tus avatares · tokens · profile menu */
  .top { position: sticky; top: 0; z-index: 30; display: block; padding: 0; background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
  .top-row { display: flex; align-items: center; gap: var(--s-4); min-height: var(--bar-h); }
  .brand { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; font-weight: 800; letter-spacing: -.02em;
    text-decoration: none; color: var(--text); font-size: 1.0625rem; flex: none; }
  .brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--grad); position: relative; flex: none; }
  .brand-mark::after { content: ""; position: absolute; left: 11px; top: 8px; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
  .top-nav { display: none; order: 0; width: auto; gap: var(--s-1); margin: 0 0 0 var(--s-4); padding: 0; overflow: visible; white-space: nowrap; }
  .top-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-sm);
    color: var(--soft); text-decoration: none; font-weight: 600; font-size: .9375rem; }
  .top-nav a:hover { background: var(--bg-2); color: var(--text); }
  .top-nav a[aria-current="page"] { color: var(--text); background: var(--bg-2); }
  .top-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
  .top-right form { margin: 0; }
  .chip-tokens { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-pill);
    background: var(--card); border: 1px solid var(--line-2); text-decoration: none; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
  .chip-tokens:hover { border-color: #b9b9c8; }
  .coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe08a, #f59e0b 70%); box-shadow: inset 0 0 0 1.5px rgba(146, 64, 14, .45); display: inline-block; flex: none; }
  .coin-lg { width: 30px; height: 30px; }
  .avatar-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft);
    color: var(--accent-text); font-weight: 800; border: 1px solid var(--accent-line); text-decoration: none; list-style: none; cursor: pointer; }
  .avatar-btn:hover { background: #e7e0ff; }
  .menu { position: relative; }
  .menu > summary { list-style: none; }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px; display: grid; padding: 6px;
    border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-3); }
  .menu-panel a, .menu-panel button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-sm);
    color: var(--text); text-decoration: none; font-weight: 600; font-size: .9375rem; background: none; border: 0; cursor: pointer; text-align: left; }
  .menu-panel a:hover, .menu-panel button:hover { background: var(--bg-2); }
  .menu-panel a[aria-current="page"] { color: var(--accent-text); }
  .menu-panel form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
  .menu-who { padding: 8px var(--s-3) 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font: var(--t-small); color: var(--soft); overflow-wrap: anywhere; }
  .menu-who b { display: block; color: var(--text); font-size: .9375rem; }
  @media (min-width: 720px) { .top-nav { display: flex; } }

  /* --- flow bar + step map (every creation flow) */
  .flowbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
  .flowbar-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: var(--s-3); min-height: 56px;
    max-width: none; margin: 0; padding: 0; }
  .fb-btn { display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: var(--r-md);
    color: var(--text); text-decoration: none; font-weight: 600; }
  .fb-btn:hover { background: var(--bg-2); }
  .fb-btn svg { width: 22px; height: 22px; }
  .fb-back { justify-self: start; margin-left: -11px; }
  .fb-exit { justify-self: end; margin-right: -11px; }
  .fb-title { margin: 0; max-width: none; text-align: center; font: var(--t-small); color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fb-flow { display: block; overflow: hidden; text-overflow: ellipsis; font: var(--t-eyebrow); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
  .fb-step { font-weight: 600; }
  .fb-name { color: var(--text); font-weight: 800; }
  .fb-text { display: none; }
  .fb-sep-flow { display: none; }
  .fb-steps { list-style: none; display: grid; grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr)); gap: 6px; padding: 0 0 12px; margin: 0; }
  .fb-steps li { display: grid; gap: 6px; max-width: none; min-width: 0; }
  .fb-steps i { display: block; height: 4px; border-radius: 4px; background: var(--line-2); }
  .fb-steps .is-done i { background: var(--violet); }
  .fb-steps .is-current i { background: var(--grad); }
  .fb-steps span { display: none; font: var(--t-caption); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fb-steps .is-done span { color: var(--soft); }
  .fb-steps .is-current span { color: var(--text); font-weight: 800; }
  @media (min-width: 720px) {
    .flowbar-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 0; }
    .fb-back { display: inline-flex; align-items: center; gap: 4px; width: auto; padding: 0 var(--s-3) 0 6px; margin-left: -8px; }
    .fb-text { display: inline; }
    .fb-title { font-size: 1rem; }
    .fb-flow { display: inline; font: inherit; text-transform: none; letter-spacing: 0; font-weight: 700; }
    .fb-sep-flow { display: inline; }
    .fb-steps span { display: block; }
  }

  /* --- footer */
  .foot { display: block; padding: 0; border-top: 1px solid var(--line); color: var(--faint); font: var(--t-small); background: none; }
  .foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--s-5); padding-block: var(--s-3); }
  .foot a { color: var(--soft); display: inline-flex; align-items: center; min-height: 44px; }

  /* --- cards */
  .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); box-shadow: var(--shadow-1); min-width: 0; color: var(--text); }
  @media (min-width: 720px) { .card { padding: var(--s-5); } }
  .card > * { margin-block: 0; }
  .card > :not(:first-child) { margin-top: var(--s-4); }
  .card.stack > :not(:first-child), .card.empty > :not(:first-child), .form.stack > :not(:first-child) { margin-top: 0; }
  .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
  .card-head h2 { font: var(--t-h2); }
  .card-head p { color: var(--soft); font: var(--t-small); margin-top: 2px; }
  .card-soft { background: var(--card-2); box-shadow: none; }
  .card-tint { background: var(--accent-soft); border-color: var(--accent-line); box-shadow: none; }
  .section-num { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font: var(--t-caption); font-weight: 800; }
  .divider { height: 1px; background: var(--line); border: 0; margin: 0; }

  /* --- buttons: one primary per screen */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 44px; padding: 8px var(--s-5);
    border-radius: var(--r-md); border: 1px solid transparent; font-weight: 700; font-size: 1rem; line-height: 1.25; text-align: center;
    text-decoration: none; cursor: pointer; white-space: normal; -webkit-tap-highlight-color: transparent;
    transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s; }
  .btn:active { transform: translateY(1px); }
  .btn-primary { background: var(--grad-strong); color: var(--on-accent); box-shadow: 0 1px 2px rgba(103, 65, 217, .2), 0 6px 16px rgba(103, 65, 217, .22); }
  .btn-primary:hover { box-shadow: 0 1px 2px rgba(103, 65, 217, .25), 0 10px 24px rgba(194, 37, 92, .28); }
  .btn-ghost { background: var(--card); border-color: var(--line-2); color: var(--text); box-shadow: none; }
  .btn-ghost:hover { background: var(--bg-2); border-color: #b9b9c8; }
  .btn-tonal { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); box-shadow: none; }
  .btn-tonal:hover { background: #e7e0ff; border-color: #bfb0ff; }
  .btn-text, .link-btn, .mini-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s-2); background: none; border: 0;
    border-radius: var(--r-sm); color: var(--accent-text); font-weight: 700; font-size: .9375rem; text-decoration: none; cursor: pointer; box-shadow: none; }
  .btn-text:hover, .link-btn:hover, .mini-link:hover { text-decoration: underline; }
  summary.mini-link, summary.link-btn, summary.btn-text { list-style: none; }
  summary.mini-link::-webkit-details-marker, summary.btn-text::-webkit-details-marker { display: none; }
  .btn-danger { background: var(--red-mark); border-color: var(--red-mark); color: #fff; box-shadow: 0 4px 14px rgba(198, 40, 40, .22); }
  .btn-danger:hover { background: #b71c1c; border-color: #b71c1c; }
  .btn-danger-text, .link-btn.danger, .mini-link.danger, .btn-text.danger { color: var(--red); }
  .btn-danger-text { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-2); background: none; border: 0; font-weight: 700; font-size: .9375rem; cursor: pointer; }
  .btn-danger-text:hover { text-decoration: underline; }
  .btn-ghost.danger { border-color: var(--red-line); color: var(--red); }
  .btn-ghost.danger:hover { background: var(--red-soft); }
  .danger { color: var(--red); }
  .btn-lg { min-height: 52px; padding: 10px var(--s-6); font-size: 1.0625rem; border-radius: 14px; }
  .btn-sm { min-height: 36px; padding: 6px var(--s-3); font-size: .9375rem; border-radius: var(--r-sm); }
  .btn-block { width: 100%; }
  .btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
  .btn .cost { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(17, 12, 40, .22); font-size: .875rem; font-weight: 700; white-space: nowrap; }
  .btn-ghost .cost, .btn-tonal .cost { background: var(--bg-2); color: var(--soft); }
  .btn .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
  .btn-ghost .spinner, .btn-tonal .spinner, .btn-text .spinner { border-color: rgba(91, 63, 217, .2); border-top-color: var(--accent-text); }
  .btn-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .btn > span[aria-hidden] { display: inline-flex; }
  .tool-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: none;
    color: var(--accent-text); font: inherit; font-size: .9375rem; font-weight: 700; text-decoration: none; cursor: pointer; }
  .tool-btn:hover { text-decoration: underline; background: none; }
  .tool-danger { color: var(--red); }
  .btn-save { min-height: 36px; background: var(--card); border: 1px solid var(--line-2); color: var(--text); }
  .btn-save:hover { background: var(--bg-2); }
  .btn-progress, .btn-progress[disabled] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); opacity: 1; box-shadow: none; cursor: progress; }
  .btn-progress .spinner { border-color: rgba(91, 63, 217, .2); border-top-color: var(--accent-text); }
  .row-actions, .save-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin: 0; }

  /* --- the end of every step: one bar, a direct child of the page (sticky on phones; reserved space below) */
  .flow-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s-3); margin: 0; padding: var(--s-2) 0 0;
    position: static; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
  .flow-actions form { margin: 0; }
  .flow-actions .flow-note { margin: 0 auto 0 0; color: var(--soft); font: var(--t-small); max-width: 46ch; }
  .flow-actions > .btn-ghost { order: 0; }
  .card .flow-actions { margin: 0; border-radius: 0; }
  .flow-after { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }

  /* --- forms */
  .form > :not(:first-child) { margin-top: var(--s-4); }
  .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); min-width: 0; margin: 0; }
  .field > span:first-child, .field > legend, .field > summary, .label { font: var(--t-label); color: var(--text); padding: 0; }
  .field em, .field .opt, legend em { font-style: normal; font-weight: 400; color: var(--faint); }
  .field > .hint, .field > .muted.small { margin: 0; }
  .field.has-error input, .field.has-error textarea { border-color: var(--red); border-width: 2px; }
  .field-error, .field > .field-error { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--r-md);
    background: var(--red-soft); border: 2px solid var(--red-strong); border-left-width: 6px; border-left-color: var(--red-mark); color: #5f1111;
    font: var(--t-small); font-size: .9375rem; font-weight: 600; max-width: none; }
  .field-error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--red-mark); color: #fff; font-size: .75rem; font-weight: 900; }
  .field-error[hidden] { display: none; }
  .error-text { color: var(--red); font-weight: 700; }
  .check { display: flex; gap: var(--s-3); align-items: flex-start; min-height: 32px; padding: 4px 0; margin: 0; cursor: pointer; font: var(--t-small); font-size: .9375rem; color: var(--text); max-width: none; }
  .check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent-text); flex: none; }
  .check > span { max-width: var(--measure); }
  :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), textarea, select):not(.editable) { border-color: var(--field-line); }
  :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), textarea, select):not(.editable):focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px rgba(91, 63, 217, .22); }
  input[type=color] { min-height: 44px; min-width: 56px; padding: 3px; border: 1px solid var(--field-line); border-radius: var(--r-sm); background: var(--field); cursor: pointer; }
  fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select { background: var(--bg-2); color: var(--soft); }
  .consent-more { font: var(--t-small); color: var(--soft); }
  .consent-more > summary { display: inline-flex; align-items: center; min-height: 36px; color: var(--accent-text); font-weight: 700; list-style: none; }
  .consent-more > summary::-webkit-details-marker { display: none; }
  .consent-more > p { margin-top: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); }

  /* choice cards (radios that look like cards): one selection look, a violet ring and a round tick */
  .choices { display: grid; gap: var(--s-3); }
  @media (min-width: 720px) { .choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .choice-card { position: relative; display: grid; gap: var(--s-1); align-content: start; padding: var(--s-4) calc(var(--s-4) + 30px) var(--s-4) var(--s-4); border: 1px solid var(--line-2); border-radius: var(--r-lg);
    background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
  .choice-card:hover { border-color: #b9b9c8; }
  .choice-card input { position: absolute; opacity: 0; pointer-events: none; }
  .choice-card:has(input:checked) { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); background: #fcfbff; }
  .choice-card:has(input:focus-visible) { box-shadow: var(--focus); }
  .choice-card .tick { position: absolute; top: var(--s-4); right: var(--s-4); width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; }
  .choice-card:has(input:checked) .tick { border-color: var(--accent-text); background: radial-gradient(circle, var(--accent-text) 0 5px, #fff 6px); }
  .choice-card:has(input[type=checkbox]) .tick { border-radius: 6px; }
  .choice-card:has(input[type=checkbox]:checked) .tick { background: var(--accent-text); }
  .choice-card:has(input[type=checkbox]:checked) .tick::after { content: "✓"; display: grid; place-items: center; height: 100%; color: #fff; font-size: .8rem; font-weight: 900; }
  .choice-card:has(input:disabled) { opacity: .55; cursor: not-allowed; }
  .choice-card b { font-size: 1rem; }
  .choice-card .hint, .choice-card em { font: var(--t-small); font-style: normal; color: var(--soft); }
  /* the old radio-cards keep their markup and take the same look */
  .style-choice { display: grid; gap: var(--s-3); }
  @media (min-width: 720px) { .style-choice-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .style-choice-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .style-option { position: relative; cursor: pointer; display: block; }
  .style-option input { position: absolute; opacity: 0; }
  .style-option > span { position: relative; height: 100%; display: flex; flex-direction: column; gap: 4px; padding: var(--s-4) calc(var(--s-4) + 30px) var(--s-4) var(--s-4); border-radius: var(--r-lg);
    background: var(--card); border: 1px solid var(--line-2); box-shadow: none; transition: border-color .15s, box-shadow .15s; }
  .style-option > span::after { content: ""; position: absolute; top: var(--s-4); right: var(--s-4); width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; }
  .style-option:hover > span { border-color: #b9b9c8; }
  .style-option input:checked + span { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); background: #fcfbff; }
  .style-option input:checked + span::after { border-color: var(--accent-text); background: radial-gradient(circle, var(--accent-text) 0 5px, #fff 6px); }
  .style-option input:focus-visible + span { box-shadow: var(--focus); outline: none; }
  .style-option input:disabled + span { opacity: .5; cursor: not-allowed; }
  .style-option em { font-style: normal; color: var(--soft); font: var(--t-small); }
  .angle-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
  .angle-list > li { max-width: none; }
  .angle-pick { display: block; cursor: pointer; }
  .angle-pick input { position: absolute; opacity: 0; }
  .angle-card { position: relative; display: grid; gap: 6px; padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 34px); border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--card); box-shadow: none; transition: border-color .15s, box-shadow .15s; }
  .angle-card::before { content: ""; position: absolute; top: calc(var(--s-4) + 1px); left: var(--s-4); width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; }
  .angle-pick:hover .angle-card { border-color: #b9b9c8; }
  .angle-pick input:checked + .angle-card { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); background: #fcfbff; }
  .angle-pick input:checked + .angle-card::before { border-color: var(--accent-text); background: radial-gradient(circle, var(--accent-text) 0 5px, #fff 6px); }
  .angle-pick input:focus-visible + .angle-card { box-shadow: var(--focus); outline: none; }
  .choice { padding: var(--s-3) var(--s-4); border: 1px solid var(--line-2); border-radius: var(--r-md); background: #fff; }
  .choice:has(input:checked) { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); background: #fcfbff; }

  /* chips (one choice among a few short ones): the chosen one is solid dark */
  .chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; }
  .chip { display: inline-flex; position: relative; }
  .chip input { position: absolute; opacity: 0; }
  .chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill); background: var(--card);
    border: 1px solid var(--line-2); color: var(--text); font: var(--t-caption); font-size: .9375rem; cursor: pointer; transition: background .15s, border-color .15s; }
  .chip span:hover { border-color: #9a9aab; }
  .chip input:checked + span { background: var(--text); border-color: var(--text); color: #fff; }
  .chip input:focus-visible + span { box-shadow: var(--focus); outline: none; }
  .chip input:disabled + span { opacity: .5; cursor: not-allowed; }

  /* switch */
  .switch { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; font-weight: 400; font-size: 1rem; }
  .switch input { position: absolute; opacity: 0; }
  .switch-ui { width: 44px; height: 26px; flex: none; margin-top: 1px; border-radius: var(--r-pill); background: #8a8f9c; position: relative; transition: background .15s; }
  .switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transition: transform .15s; }
  .switch input:checked + .switch-ui { background: var(--accent-text); }
  .switch input:checked + .switch-ui::after { transform: translateX(18px); }
  .switch input:focus-visible + .switch-ui { box-shadow: var(--focus); outline: none; }
  .switch-text { display: grid; gap: 4px; min-width: 0; }
  .switch-text b { font-weight: 700; }

  /* optional extras, folded (progressive disclosure, one level): NEW .extra (a <details>) */
  .extra { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-1); min-width: 0; }
  .extra > summary { display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: var(--s-3) var(--s-4); cursor: pointer; list-style: none; font-weight: 700; border-radius: var(--r-lg); }
  .extra > summary::-webkit-details-marker { display: none; }
  .extra > summary, .extra > summary .extra-text { color: var(--text); }
  .extra > summary:hover { background: var(--bg); }
  .extra-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r-sm); background: var(--bg-2); color: var(--soft); }
  .extra-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .extra-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
  .extra-text small { font: var(--t-small); color: var(--soft); font-weight: 400; max-width: var(--measure); }
  .extra-count { font: var(--t-caption); color: var(--faint); font-variant-numeric: tabular-nums; }
  .extra > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg) translate(-2px, -2px); flex: none; margin-right: 4px; transition: transform .15s; }
  .extra[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
  .extra[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .extra-body { padding: var(--s-2) var(--s-4) var(--s-4); display: grid; gap: var(--s-4); min-width: 0; }
  .extra-body > * { margin: 0; min-width: 0; }
  @media (min-width: 720px) { .extra-body { padding: var(--s-2) var(--s-5) var(--s-5); } .extra > summary { padding-inline: var(--s-5) var(--s-4); } }
  .extra-plain { box-shadow: none; }
  .optional-label { font: var(--t-label); color: var(--soft); margin: 0; }

  /* dropzone */
  .dropzone { position: relative; display: grid; place-items: center; min-height: 168px; padding: var(--s-5); border: 2px dashed #b9b9c8; border-radius: var(--r-lg);
    background: var(--card-2); text-align: center; cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
  .dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--accent-text); background: var(--accent-soft); }
  .dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
  .dz-empty { display: grid; justify-items: center; gap: 6px; padding: 0; pointer-events: none; }
  .dz-empty svg { width: 40px; height: 40px; color: var(--accent-text); margin: 0; }
  .dz-empty b { font-size: 1rem; }
  .dz-empty .muted, .dz-empty .small { font: var(--t-small); color: var(--soft); }
  .dz-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--accent-text); }
  .dz-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .dropzone-compact, .dropzone-audio { min-height: 112px; padding: var(--s-4); }
  .dropzone-compact .dz-empty { padding: 0; }
  .dropzone-video { margin: 0; }
  .file-pick { display: grid; gap: var(--s-2); }

  /* --- alerts: info (violet), advice (amber), error (red), success (green). One shape, four tones */
  .alert { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s-1) var(--s-3); align-items: start; margin: 0; padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md); border: 1px solid var(--info-line); background: var(--info-soft); color: var(--text); font: var(--t-small); font-size: .9375rem; max-width: none; }
  .alert > * { grid-column: 2; margin: 0; min-width: 0; }
  .alert > .alert-mark { grid-column: 1; grid-row: 1 / span 4; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-text); color: #fff; font-weight: 900; font-size: .8125rem; font-style: normal; }
  .alert > b, .alert > .alert-title { font-weight: 700; font-size: 1rem; }
  .alert p { margin: 0; max-width: var(--measure); }
  .alert ul, .alert ol { margin: 0; padding-left: 1.2em; display: grid; gap: 2px; }
  .alert .cluster, .alert .alert-actions { margin-top: var(--s-2); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; }
  .alert-advice { background: var(--amber-soft); border-color: var(--amber-line); }
  .alert-advice > .alert-mark { background: var(--amber-mark); }
  .alert-advice > b, .alert-advice > .alert-title { color: var(--amber); }
  .alert-error { background: var(--red-soft); border: 2px solid var(--red-strong); border-left: 6px solid var(--red-mark); color: #5f1111; font-size: 1rem; box-shadow: 0 6px 20px rgba(198, 40, 40, .12); }
  .alert-error > .alert-mark { width: 28px; height: 28px; background: var(--red-mark); font-size: 1rem; }
  .alert-error { grid-template-columns: 28px minmax(0, 1fr); }
  .alert-error > b, .alert-error > .alert-title { color: var(--red); font-size: 1.0625rem; font-weight: 800; }
  .alert-success { background: var(--green-soft); border-color: var(--green-line); }
  .alert-success > .alert-mark { background: var(--green); }
  .alert-success > b, .alert-success > .alert-title { color: var(--green); }

  /* the old boxes, mapped onto the four tones (CSS aliases; the templates move to .alert page by page) */
  .setup-note, .busy-note, .talk-prompts, .coverage-checking, .drive-box.is-working, .record-tips {
    margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--info-soft); border: 1px solid var(--info-line); box-shadow: none; color: var(--text); font-size: .9375rem; }
  .busy-note { display: flex; align-items: center; gap: var(--s-3); font-weight: 600; }
  .voice-check, .photo-nudge, .form-error, .motion-alert, .mock-box, .mock-offer, .coverage-failed, .live-slow, .revoice-card, .mock-warning {
    margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--amber-soft); border: 1px solid var(--amber-line); box-shadow: none; color: var(--text); font-size: .9375rem; }
  .voice-check { color: var(--amber); font-weight: 600; }
  .mock-warning { color: #7a3d00; font-weight: 700; border-left: 4px solid var(--amber-mark); }
  .card-danger, .card-error, .footage-warn, .footage-alert, .drive-box.is-failed, .vw-degraded {
    margin: 0; padding: var(--s-4); border-radius: var(--r-md); background: var(--red-soft); border: 2px solid var(--red-strong); border-left: 6px solid var(--red-mark);
    color: #5f1111; box-shadow: 0 6px 20px rgba(198, 40, 40, .12); }
  .card-danger h2, .card-error-head, .footage-alert-head { display: flex; align-items: center; gap: var(--s-3); color: var(--red); font-size: 1.125rem; }
  .card-danger h2::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--red-mark); color: #fff; font-weight: 900; font-size: 1rem; }
  .card-danger p, .card-error-text { font-size: 1rem; line-height: 1.5; font-weight: 500; }
  .voice-just, .coverage-clear, .drive-box {
    margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--green-soft); border: 1px solid var(--green-line); box-shadow: none; color: var(--green); }
  .voice-just { display: flex; align-items: center; gap: var(--s-3); font-weight: 800; font-size: 1.0625rem; }
  .drive-box { color: var(--text); }

  /* --- status pills */
  .status, .badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: var(--r-pill); font: var(--t-caption);
    letter-spacing: 0; text-transform: none; white-space: nowrap; background: var(--bg-2); color: var(--soft); vertical-align: middle; border: 0; }
  .status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
  .status-running, .status-queued { background: var(--accent-soft); color: var(--accent-text); }
  .status-awaiting_review { background: var(--amber-soft); color: var(--amber); }
  .status-done { background: var(--green-soft); color: var(--green); }
  .status-failed { background: var(--red-soft); color: var(--red); }
  .badge-ok { background: var(--green-soft); color: var(--green); }
  .badge-soon { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber-line); }
  .badge-neutral { background: var(--card); color: var(--soft); box-shadow: inset 0 0 0 1px var(--line-2); }
  .badge-muted { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-2); }
  .badge-working { background: var(--accent-text); color: #fff; padding: 0 12px; }
  .badge-working .spinner { width: 12px; height: 12px; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
  .badge-done { background: var(--green); color: #fff; }
  .badge-fail { background: var(--red-soft); color: var(--red); box-shadow: inset 0 0 0 1px var(--red-line); }

  /* --- the avatar a step works on: one line */
  .avatar-box { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
  .avatar-face { width: 48px; height: 48px; flex: none; border-radius: 50%; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; border: 0; box-shadow: none; }
  .avatar-face img { width: 100%; height: 100%; object-fit: cover; }
  .avatar-initial { font-size: 1.1rem; font-weight: 800; color: var(--accent-text); }
  .avatar-box-text { display: grid; gap: 0; min-width: 0; flex: 1 1 auto; line-height: 1.35; }
  .avatar-box-text b { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .avatar-box-text span { font: var(--t-small); color: var(--soft); max-width: var(--measure); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .avatar-box-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--s-2); margin-left: auto; flex: none; }

  /* --- cost summary (NEW .cost-line) */
  .cost-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-4); margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); font: var(--t-small); color: var(--soft); }
  .cost-line b { color: var(--text); font-size: 1rem; font-variant-numeric: tabular-nums; }

  /* --- live wait: one box, one title, one bar (every wait) */
  .live-wait, .script-wait, .wait-card, .voice-wait, .progress-card { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-lg); background: var(--card);
    border: 1px solid var(--accent-line); box-shadow: inset 0 3px 0 var(--violet), var(--shadow-1); color: var(--text); }
  @media (min-width: 720px) { .live-wait, .script-wait, .wait-card, .voice-wait, .progress-card { padding: var(--s-5); } }
  .script-wait > *, .wait-card > *, .voice-wait > *, .progress-card > * { margin: 0; min-width: 0; }
  /* a live box inside one of those is the same box: no second frame */
  :is(.script-wait, .wait-card, .voice-wait, .progress-card, .card, .live-actions) .live-wait { padding: 0; border: 0; box-shadow: none; background: none; border-radius: 0; }
  .live-title, .wait-head b, .vw-title, [data-sw-title] { font-size: 1.0625rem; font-weight: 800; margin: 0; }
  .live-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
  .live-row, .live-wait .live-row { display: flex; align-items: center; gap: var(--s-3); font-weight: 700; font-size: 1rem; }
  .live-label { min-width: 0; overflow-wrap: anywhere; }
  .live-pct { font-variant-numeric: tabular-nums; color: var(--accent-text); }
  .live-bar { display: block; width: 100%; height: 8px; border-radius: 8px; background: var(--bg-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
  .live-bar > span { display: block; height: 100%; min-width: 8px; border-radius: 8px; background: var(--grad); transition: width .6s ease; }
  .live-time, p.live-time { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0; font: var(--t-small); color: var(--soft); font-weight: 400; }
  .live-time [data-clock-text] { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
  .live-expected { color: var(--soft); font-weight: 400; }
  .live-hint { margin: 0; font: var(--t-small); color: var(--soft); }
  .live-slow { display: flex; align-items: center; gap: var(--s-2); color: var(--amber); font-weight: 700; font-size: .9375rem; }
  .live-slow-mark { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--amber-mark); animation: live-blink 1.4s ease-in-out infinite; }
  .live-leave, .wait-leave { margin: 0; padding: var(--s-1) 0 0; border: 0; font: var(--t-small); color: var(--soft); }
  .live-kicker { font: var(--t-eyebrow); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
  .spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(91, 63, 217, .18); border-top-color: var(--accent-text); animation: spin .8s linear infinite; flex: none; display: inline-block; }
  .spinner-sm { width: 16px; height: 16px; border-width: 2px; }
  .ring { --p: 0; width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent-text) calc(var(--p) * 1%), var(--bg-2) 0); position: relative; }
  .ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--card); }
  .ring span { position: relative; font-weight: 800; font-size: 1.05rem; color: var(--accent-text); font-variant-numeric: tabular-nums; }
  .progress-copy { display: grid; gap: var(--s-2); min-width: 0; }
  .progress-copy b { font-size: 1.0625rem; }
  .live-progress { flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; padding: 10px var(--s-5) 12px; min-width: min(100%, 320px); max-width: 100%; text-align: left; font-size: 1rem; }
  .live-progress .live-time { color: var(--accent-text); font-weight: 600; }
  /* the checklist of every wait: sw-stage, st and wl (built by app.js with these exact classes) look the same */
  .checklist, .sw-stages, .wait-list, .steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
  .checklist li, .sw-stage, .st, .wl { display: flex; align-items: center; gap: var(--s-3); color: var(--faint); font: var(--t-small); font-size: .9375rem; max-width: none; }
  .checklist i, .sw-dot, .st-dot, .wl-dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); background: none; box-shadow: none; display: grid; place-items: center;
    font-style: normal; font-size: .7rem; line-height: 1; color: #fff; animation: none; }
  .checklist .is-done, .sw-done, .st-done, .wl-done { color: var(--soft); }
  .checklist .is-done i, .sw-done .sw-dot, .st-done .st-dot, .wl-done .wl-dot { background: var(--green); border-color: var(--green); box-shadow: none; }
  .checklist .is-done i::before, .sw-done .sw-dot::before, .st-done .st-dot::before, .wl-done .wl-dot::before { content: "✓"; font-weight: 800; }
  .checklist .is-running, .sw-running, .st-running, .wl-running { color: var(--text); font-weight: 700; }
  .checklist .is-running i, .sw-running .sw-dot, .st-running .st-dot, .wl-running .wl-dot { border-color: var(--accent-text); border-top-color: transparent; background: none; box-shadow: none; animation: spin .9s linear infinite; }
  .st-failed, .sw-failed, .wl-failed { color: var(--red); }
  .st-failed .st-dot, .sw-failed .sw-dot, .wl-failed .wl-dot { background: var(--red-mark); border-color: var(--red-mark); }
  .st-failed .st-dot::before, .sw-failed .sw-dot::before, .wl-failed .wl-dot::before { content: "!"; font-weight: 900; }
  .steps-detail { margin: 0; }
  .steps-detail > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--soft); font-weight: 600; font-size: .9375rem; list-style: none; }
  .steps-detail > summary::-webkit-details-marker { display: none; }
  .steps-detail > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 4px; }
  .steps-detail[open] > summary::after { transform: rotate(-135deg); }
  .steps-detail > .steps { margin-top: var(--s-2); }
  .wait-feed { list-style: none; margin: 0; padding: var(--s-3) var(--s-4); display: grid; gap: 4px; font: var(--t-small); color: var(--faint); background: var(--card-2);
    border: 1px solid var(--line); border-radius: var(--r-md); overflow-wrap: anywhere; }
  .wait-feed li { max-width: none; }
  .wait-feed li:last-child { color: var(--text); }
  .wait-draft { display: grid; gap: 6px; padding: var(--s-3) var(--s-4); background: var(--card-2); border: 1px dashed var(--line-2); border-radius: var(--r-md); }
  .wait-tag { font: var(--t-eyebrow); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
  .wait-progress { font-weight: 600; font-size: .9375rem; color: var(--accent-text); margin: 0; }

  /* --- toasts (flash messages): in the page, above the H1; at most one per kind */
  .toasts { position: static; display: grid; gap: var(--s-2); width: auto; transform: none; margin: 0; }
  .toast { display: grid; grid-template-columns: 24px minmax(0, 1fr) 36px; gap: var(--s-3); align-items: start; padding: var(--s-3) var(--s-2) var(--s-3) var(--s-4);
    border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line-2); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-2);
    font: var(--t-body); font-size: 1rem; line-height: 1.45; color: var(--text); font-weight: 500; animation: drop .25s ease; }
  .toast > .alert-mark { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: var(--green); color: #fff; font-size: .8rem; font-weight: 900; }
  .toast-body { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
  .toast-body > span { max-width: var(--measure); }
  .toast-more { font: var(--t-small); color: var(--soft); }
  .toast-head { display: block; margin: 0; font-size: 1rem; font-weight: 800; }
  .toast-close { display: grid; place-items: center; width: 36px; height: 36px; margin: -4px 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--faint); font-size: 1.25rem; line-height: 1; cursor: pointer; }
  .toast-close:hover { background: var(--bg-2); color: var(--text); }
  .toast-tip { background: var(--amber-soft); border-color: var(--amber-line); }
  .toast-tip > .alert-mark { background: var(--amber-mark); }
  .toast-tip .toast-head { color: var(--amber); }
  .toast-error { grid-template-columns: 28px minmax(0, 1fr) 36px; padding-block: var(--s-4); background: #ffe8e8; border: 2px solid var(--red-strong); border-left: 8px solid var(--red-mark); color: #5f1111; box-shadow: 0 6px 20px rgba(198, 40, 40, .16); font-size: 1.0625rem; }
  .toast-error > .alert-mark { width: 28px; height: 28px; background: var(--red-mark); font-size: 1rem; }
  .toast-error .toast-head { color: var(--red); font-size: 1.125rem; }
  .toast.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s; }

  /* --- dialogs */
  .has-modal { overflow: hidden; }
  .modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: end center; padding: var(--s-4); background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .15s ease; }
  .modal-backdrop.is-closing { opacity: 0; transition: opacity .15s; }
  .modal { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s-5); box-shadow: var(--shadow-3); animation: rise .18s ease; }
  .modal h2 { font: var(--t-h2); }
  .modal p { margin-top: var(--s-2); }
  .modal-actions { display: flex; flex-direction: column-reverse; gap: var(--s-2); margin-top: var(--s-5); }
  .modal-actions .btn { width: 100%; min-height: 48px; }
  .modal-danger { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: var(--s-3); }
  .modal-mark { grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--red-soft); color: var(--red); }
  .modal-mark svg { width: 22px; height: 22px; }
  .modal-danger h2, .modal-danger p { grid-column: 2; }
  .modal-danger .modal-actions, .modal-danger .modal-list { grid-column: 1 / -1; }
  .modal-wide { max-width: 600px; }
  .modal-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: 6px; max-height: 45vh; overflow-y: auto; }
  .modal-list li { padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--amber-soft); border: 1px solid var(--amber-line); font-weight: 600; overflow-wrap: anywhere; max-width: none; }
  .info-dialog { padding: 0; border: 0; background: transparent; width: min(600px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 32px); overflow: auto; }
  .info-dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .info-dialog > .modal { max-width: none; }
  @media (min-width: 560px) {
    .modal-backdrop { place-items: center; }
    .modal-actions { flex-direction: row; justify-content: flex-end; }
    .modal-actions .btn { width: auto; }
  }

  /* --- empty states */
  .empty { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-7) var(--s-5); text-align: center; }
  .empty > * { margin: 0; }
  .empty-art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent-text); }
  .empty-art svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .empty p { color: var(--soft); max-width: 44ch; }

  /* --- tabs (a segmented control) */
  .tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--bg-2); border-radius: var(--r-md); border: 1px solid var(--line); }
  .tab { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border: 0; background: none; padding: 6px 10px; border-radius: 9px; font-weight: 700; font-size: .9375rem; color: var(--soft); cursor: pointer; text-align: center; }
  .tab:hover { color: var(--text); }
  .tab.is-on { background: var(--card); color: var(--text); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
  .tab-panel > * + * { margin-top: var(--s-4); }

  /* --- search + filters + pager */
  .search-form { display: flex; gap: var(--s-2); align-items: stretch; margin: 0; }
  .search { position: relative; flex: 1 1 auto; min-width: 0; display: block; }
  .search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
  .search input[type=search] { padding-left: 44px; }
  .search-form .btn { flex: none; min-height: 48px; }
  .filter-chips { display: flex; flex-wrap: nowrap; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding: 2px 0; margin: 0; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill); border: 1px solid var(--line-2);
    background: var(--card); color: var(--soft); font-size: .9375rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .filter-chip span { font-size: .8125rem; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
  .filter-chip:hover { border-color: #9a9aab; color: var(--text); }
  .filter-chip[aria-current], .filter-chip.is-on { background: var(--text); border-color: var(--text); color: #fff; }
  .filter-chip[aria-current] span, .filter-chip.is-on span { color: rgba(255, 255, 255, .78); }
  .pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-3); margin: 0; }
  .pager > :first-child { justify-self: start; }
  .pager > :last-child { justify-self: end; }
  .pager-pages { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: var(--s-1); }
  .pager-pages a, .pager-pages b { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 6px; border-radius: var(--r-md); border: 0; text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; background: none; }
  .pager-pages a { color: var(--soft); }
  .pager-pages a:hover { background: var(--bg-2); color: var(--text); }
  .pager-pages b { background: var(--text); color: #fff; }
  .pager-count { display: none; font: var(--t-small); color: var(--soft); font-variant-numeric: tabular-nums; }
  @media (max-width: 479px) { .pager-pages { display: none; } .pager-count { display: block; } }

  /* --- list rows (NEW .row-list): hairlines between rows, never boxed rows */
  .row-list { list-style: none; margin: 0; padding: 0; display: grid; }
  .row-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding: var(--s-3) 0; margin: 0;
    border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; max-width: none; }
  .row-list > li:first-child { border-top: 0; padding-top: 0; }
  .row-list > li:last-child { padding-bottom: 0; }
  .row-main { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
  .row-main > span, .row-main > small { font: var(--t-small); color: var(--soft); }
  .row-main q, .row-quote { font: var(--t-small); font-style: italic; color: var(--soft); quotes: "«" "»"; max-width: var(--measure); }
  .row-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
  .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

  /* --- media grids (2 / 3 / 4 columns) */
  .media-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(var(--cols-sm, 2), minmax(0, 1fr)); }
  @media (min-width: 720px) { .media-grid { gap: var(--s-4); grid-template-columns: repeat(var(--cols-md, 3), minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .media-grid { grid-template-columns: repeat(var(--cols-lg, 4), minmax(0, 1fr)); } }
  .media-grid > li { max-width: none; min-width: 0; }
  .cols-3 { --cols-lg: 3; }
  .cols-2 { --cols-md: 2; --cols-lg: 2; }
  .cols-1 { --cols-sm: 1; }
  /* creation tile: 4:5 media for every kind, title clamped to 2 lines, the status over the media */
  .video-tile { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); transform: none; transition: border-color .15s, box-shadow .15s; }
  .video-tile:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: none; }
  .tile-media { position: relative; aspect-ratio: 4 / 5; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; border: 0; border-radius: 0; margin: 0; }
  .tile-media img { width: 100%; height: 100%; object-fit: cover; }
  .tile-media .status { position: absolute; top: var(--s-2); left: var(--s-2); max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; background: rgba(255, 255, 255, .95); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
  .tile-media .status-running, .tile-media .status-queued { color: var(--accent-text); }
  .tile-media .status-done { color: var(--green); }
  .tile-media .status-failed { color: var(--red); }
  .tile-media .status-awaiting_review { color: var(--amber); }
  .tile-art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent-text); }
  .tile-art svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tile-art-pct { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
  .tile-body { display: grid; gap: 4px; padding: var(--s-3); align-content: start; }
  .tile-kind { font: var(--t-eyebrow); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
  .tile-title { font-weight: 600; font-size: .9375rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(2 * 1.35em); overflow-wrap: anywhere; }
  .tile-meta { font: var(--t-small); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* --- copy box and the result of a creation */
  .copy-box, .caption-box { display: grid; gap: var(--s-2); margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); }
  .copy-box pre, .caption-box pre { margin: 0; white-space: pre-wrap; font: var(--t-small); color: var(--soft); overflow-wrap: anywhere; max-width: var(--measure); }
  .caption-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
  .caption-head b { font-size: .9375rem; }
}

/* ============================================================ PATTERNS (the page shapes that repeat) */
@layer patterns {
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
  @keyframes fade { from { opacity: 0; } }
  @keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
  @keyframes live-blink { 50% { opacity: .25; } }
  @keyframes shimmer { to { background-position: -200% 0; } }
  @keyframes live-stripes { to { background-position: 22px 0, 0 0; } }

  /* --- home: the product launcher. Body grows, the foot (formats + button) is pinned: every card in a row ends level */
  body.page-home { background: radial-gradient(900px 340px at 8% -6%, rgba(124, 92, 255, .10), transparent 70%),
    radial-gradient(700px 300px at 92% -10%, rgba(255, 92, 168, .08), transparent 70%), var(--bg); background-repeat: no-repeat; }
  .home-hello { font: var(--t-display); letter-spacing: -.025em; }
  .products { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); align-items: stretch; margin: 0; }
  @media (min-width: 720px) { .products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .product-card { --p: var(--violet); --p-soft: var(--accent-soft); --p-text: var(--accent-text);
    position: relative; display: flex; flex-direction: column; align-items: stretch; gap: var(--s-3); min-width: 0; padding: var(--s-5); border-radius: var(--r-lg);
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); transform: none; transition: box-shadow .2s, border-color .2s; }
  .product-card::before { content: none; }
  .product-card:hover, .product-card:focus-within { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: none; }
  .product-avatar { --p: #7c5cff; --p-soft: #efeaff; --p-text: #5b3fd9; }
  .product-imagenes { --p: #2f80ed; --p-soft: #e7f0fd; --p-text: #1b5fb8; }
  .product-flyers { --p: #f2994a; --p-soft: #fdf0e3; --p-text: #a2530e; }
  .product-podcast { --p: #14a37f; --p-soft: #e3f6f0; --p-text: #0d7258; }
  .product-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin: 0; }
  .product-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: var(--r-md); background: var(--p-soft); border: 0; color: var(--p-text); }
  .product-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .product-aside { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-2); margin-right: calc(-1 * var(--s-2)); border: 0; border-radius: var(--r-sm); background: none;
    font: var(--t-small); font-weight: 700; color: var(--p-text); text-decoration: none; white-space: nowrap; }
  .product-aside:hover { color: var(--text); text-decoration: underline; border: 0; }
  .product-card h2, .product-card h3 { font: var(--t-h3); font-size: 1.125rem; letter-spacing: -.01em; margin: 0; }
  .product-line { color: var(--text); font: var(--t-small); font-size: .9375rem; line-height: 1.45; margin: 0; }
  .product-body { display: grid; gap: var(--s-3); align-content: start; flex: 1; }
  .product-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .product-points li { position: relative; padding-left: 24px; color: var(--soft); font: var(--t-small); line-height: 1.4; max-width: none; }
  .product-points li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--p-soft); color: var(--p-text); font-size: .68rem; font-weight: 800; line-height: 16px; text-align: center; }
  .product-foot { display: grid; gap: var(--s-3); margin: 0; padding: 0; }
  .product-foot .btn { min-height: 48px; padding-inline: var(--s-3); }
  .product-formats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
  .product-formats li { font: var(--t-caption); padding: 3px 10px; border-radius: var(--r-pill); background: var(--p-soft); color: var(--p-text); max-width: none; }
  .product-card .btn-tonal { background: var(--p-soft); border-color: var(--line-2); border-color: color-mix(in srgb, var(--p) 35%, transparent); color: var(--p-text); }
  .product-card .btn-tonal:hover { background: var(--p-soft); border-color: var(--p); }
  .product-card.is-soon { opacity: .75; border-style: dashed; }
  .mini-avatar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); min-width: 0; }
  .mini-avatar .avatar-face { width: 36px; height: 36px; }
  .mini-avatar .who { display: grid; min-width: 0; flex: 1; line-height: 1.3; font: var(--t-small); color: var(--soft); }
  .mini-avatar .who b, .mini-avatar .who a { color: var(--text); font-weight: 700; font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
  .mini-avatar .who a:hover { text-decoration: underline; }
  .mini-avatar > a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-1); font: var(--t-small); font-weight: 700; color: var(--p-text); flex: none; }
  .setup-progress { display: grid; gap: 6px; font: var(--t-small); color: var(--soft); text-decoration: none; padding: var(--s-2) 0; min-height: 44px; }
  .setup-progress b { color: var(--text); font-weight: 600; }
  .setup-progress .progress-go { color: var(--accent-text); font-weight: 700; white-space: nowrap; }
  .setup-progress:hover .progress-go { text-decoration: underline; }
  .setup-progress .live-bar { height: 6px; }
  .progress-fill.p-0 { width: 4%; } .progress-fill.p-25 { width: 25%; } .progress-fill.p-50 { width: 50%; } .progress-fill.p-75 { width: 75%; } .progress-fill.p-100 { width: 100%; }

  /* --- landing */
  .hero { display: grid; gap: var(--s-6); padding: var(--s-5) 0 0; align-items: center; }
  .hero h1 { font: 800 clamp(2.1rem, 1.4rem + 3.4vw, 3.4rem)/1.08 var(--sans); letter-spacing: -.03em; }
  .hero-copy { display: grid; gap: var(--s-4); }
  .hero-copy > * { margin: 0; }
  .hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-2) 0 0; }
  .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .landing-steps { margin: 0; color: var(--soft); }
  @media (min-width: 720px) { .hero { grid-template-columns: 1.2fr .8fr; padding-top: var(--s-6); } }

  /* --- avatars: «Tus avatares» and «¿Con qué avatar?». Same card everywhere: photo + text, then the main action, then
     «Editar · Borrar». Rows end level: the text part takes the extra height. */
  .avatar-search { margin: 0; display: grid; gap: var(--s-2); }
  .avatar-search input[type=search] { border-color: var(--field-line); }
  .avatar-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 640px) { .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 980px) { .avatar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .avatar-grid > li { max-width: none; }
  .avatar-grid > li[hidden] { display: none; }
  .avatar-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: 1fr auto auto; gap: var(--s-3) var(--s-4); align-content: stretch;
    padding: var(--s-4); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
  .avatar-card.is-current { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-1); }
  .avatar-photo { width: 76px; height: 100px; border-radius: var(--r-md); overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; }
  .avatar-photo img { width: 100%; height: 100%; object-fit: cover; }
  .avatar-info { display: grid; gap: 6px; min-width: 0; align-content: start; }
  .avatar-info > * { margin: 0; }
  .avatar-info .badge { justify-self: start; }
  .avatar-name { font: var(--t-h3); font-size: 1.125rem; overflow-wrap: anywhere; }
  .avatar-desc { font: var(--t-small); color: var(--soft); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .avatar-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
  .avatar-chips li { font: var(--t-caption); padding: 2px 9px; border-radius: var(--r-pill); max-width: none; }
  .avatar-chips .is-ok { background: var(--green-soft); color: var(--green); }
  .avatar-chips .is-missing { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber-line); }
  .avatar-main { grid-column: 1 / -1; grid-row: 2; display: grid; gap: var(--s-2); margin: 0; }
  .avatar-main form { margin: 0; }
  .avatar-main .btn { width: 100%; }
  .avatar-main .hint { text-align: center; }
  .avatar-tools { grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-2); margin: 0 calc(-1 * var(--s-2)) calc(-1 * var(--s-2)); }
  .avatar-tools form { margin: 0; }
  .avatar-actions { grid-column: 1 / -1; display: grid; gap: var(--s-2); margin: 0; }
  .avatar-new { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; padding: 0; border: 2px dashed var(--line-2); box-shadow: none; background: transparent; }
  .avatar-new-link { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 200px; height: 100%; padding: var(--s-5); text-align: center; color: var(--text); text-decoration: none; border-radius: var(--r-lg); }
  .avatar-new-link:hover { background: var(--accent-soft); }
  .avatar-plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 1.6rem; font-weight: 800; line-height: 1; border: 1px solid var(--accent-line); }

  /* --- the result of a creation (video, reel, flyer): player + one action column */
  .result { display: grid; gap: var(--s-5); align-items: start; }
  @media (min-width: 720px) { .result { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: var(--s-6); } }
  .result-side { display: grid; gap: var(--s-4); align-content: start; }
  .player { position: relative; width: 100%; border-radius: var(--r-xl); overflow: hidden; background: #0f0f14; box-shadow: var(--shadow-2); }
  .player video { width: 100%; aspect-ratio: 9 / 16; object-fit: contain; background: #000; border-radius: 0; box-shadow: none; max-width: none; }
  .player-wide video { aspect-ratio: 16 / 9; }
  @media (max-width: 719px) { .player video { max-height: 78vh; } }
  .final { display: grid; gap: var(--s-5); align-items: start; }
  @media (min-width: 720px) { .final { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: var(--s-6); } }
  .final-player { display: block; }
  .final-player video { width: 100%; max-width: none; aspect-ratio: 9 / 16; border-radius: var(--r-xl); background: #000; box-shadow: var(--shadow-2); }
  .final-side { display: grid; gap: var(--s-4); align-content: start; }
  .final-side > * { margin: 0; }

  /* --- a picker of small portraits (radio thumbnails) */
  .thumb-pick, .portrait-choice { display: flex; gap: var(--s-3); overflow-x: auto; padding: 4px 4px var(--s-2); margin: 0 -4px; scrollbar-width: thin; scroll-snap-type: x proximity; }
  .thumb-pick label, .pc-item { position: relative; flex: none; display: grid; gap: 6px; width: 88px; cursor: pointer; font: var(--t-caption); color: var(--soft); text-align: center; scroll-snap-align: start; }
  .thumb-pick input, .pc-item input { position: absolute; opacity: 0; }
  .pc-card { display: grid; gap: 6px; justify-items: center; font: var(--t-caption); color: var(--soft); cursor: pointer; }
  .pc-card b { font-weight: 600; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .thumb-pick .thumb, .pc-card img, .pc-random .pc-card svg { display: grid; place-items: center; width: 88px; height: auto; aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; object-fit: cover;
    background: var(--card-2); border: 1px solid var(--line-2); color: var(--soft); box-shadow: none; padding: 0; }
  .pc-random .pc-card svg { padding: 28px 22px; }
  .thumb-pick .thumb img { width: 100%; height: 100%; object-fit: cover; }
  .thumb-pick input:checked + .thumb, .pc-item input:checked + .pc-card img, .pc-item input:checked + .pc-card svg { border-color: var(--accent-text); box-shadow: 0 0 0 2px var(--accent-text); }
  .thumb-pick input:focus-visible + .thumb, .pc-item input:focus-visible + .pc-card { box-shadow: var(--focus); outline: none; border-radius: var(--r-md); }
  .thumb-pick input:checked ~ span, .pc-item input:checked + .pc-card b { color: var(--text); font-weight: 800; }

  /* --- media grids that keep their own class (hooks) and take the 2/3/4 grid */
  .video-grid, .creations-grid, .portrait-grid, .beat-grid, .flyer-grid, .flyer-gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3);
    grid-template-columns: repeat(var(--cols-sm, 2), minmax(0, 1fr)); }
  @media (min-width: 720px) { .video-grid, .creations-grid, .portrait-grid, .beat-grid, .flyer-grid, .flyer-gallery { gap: var(--s-4); grid-template-columns: repeat(var(--cols-md, 3), minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .video-grid, .creations-grid, .portrait-grid, .beat-grid, .flyer-grid, .flyer-gallery { grid-template-columns: repeat(var(--cols-lg, 4), minmax(0, 1fr)); } }
  :is(.video-grid, .creations-grid, .portrait-grid, .beat-grid, .flyer-grid, .flyer-gallery) > li { max-width: none; min-width: 0; }
  .flyer-grid { --cols-md: 2; }
  .own-thumbs, .ref-photos { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .own-thumbs:empty { display: none; }
  .ref-photos li, .own-thumbs li { max-width: none; display: grid; gap: 4px; }
  .ref-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-md); }
  .ref-photo-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; font: var(--t-small); }
  .ref-photo-foot form { margin: 0; }

  /* portraits: tiles with the pick on the media and one row of text actions under it */
  .portrait { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
  .portrait-pick { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; cursor: pointer; aspect-ratio: 9 / 16; background: var(--card-2); border: 1px solid var(--line); transform: none; transition: box-shadow .15s; }
  .portrait-pick:has(input:checked), .portrait.is-picked .portrait-pick { border-color: var(--accent-text); box-shadow: 0 0 0 2px var(--accent-text); transform: none; }
  .portrait-pick:has(input:focus-visible) { box-shadow: var(--focus); outline: none; }
  .pick-mark { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .9); color: transparent; }
  .portrait-pick:has(input:checked) .pick-mark, .portrait.is-picked .pick-mark { background: var(--accent-text); border-color: #fff; color: #fff; }
  .pick-tag { background: var(--accent-text); }
  .portrait-skeleton { border-radius: var(--r-md); }
  .portrait-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); font: var(--t-small); font-weight: 600; min-width: 0; }
  .portrait-foot > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portrait-change { border: 0; border-radius: 0; background: none; }
  .portrait-change summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s-2); margin-left: calc(-1 * var(--s-2)); border: 0; color: var(--accent-text); font-size: .875rem; font-weight: 700; list-style: none; }
  .portrait-change[open] summary { border: 0; }
  .portrait-change .change-form { display: grid; gap: var(--s-2); padding: var(--s-2) 0 0; }
  .sticky-actions, .pick-bar { position: sticky; bottom: var(--s-3); z-index: 10; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-radius: var(--r-lg); background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--line-2); box-shadow: var(--shadow-3); margin: 0; }
  .pick-count { display: grid; min-width: 0; }
  .pick-count b { font-size: 1rem; }

  /* --- the script of a reel: one numbered textarea per sentence, with its kind and a 4 px colour edge */
  .script { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); }
  .script > li { max-width: none; }
  .line { display: grid; gap: 6px; padding: var(--s-2) var(--s-3) var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); border-left: 4px solid var(--violet); }
  .line-a { border-left-color: var(--pink); }
  .line-kind, .beat-kind { font: var(--t-eyebrow); letter-spacing: .05em; text-transform: uppercase; color: var(--soft); }
  .script-edit textarea { min-height: 56px; background: var(--card); padding: 10px 12px; }
  .legend { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; white-space: nowrap; }
  .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
  .length-meter { display: grid; gap: 6px; margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); }
  .bar { display: block; height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
  .bar > span { display: block; height: 100%; background: var(--grad); border-radius: 8px; transition: width .4s; }
  .notes { margin: 0; padding-left: 1.2em; color: var(--soft); font: var(--t-small); display: grid; gap: 4px; }
  .notes li, .plain-list li, .tip-list li { max-width: var(--measure); }
  .plain-list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
  .sources > summary, .redo > summary { font-weight: 600; }
  .topic-full { margin: 0; font: var(--t-small); color: var(--soft); }
  .topic-full > summary { display: inline-flex; align-items: center; min-height: 36px; color: var(--accent-text); font-weight: 700; list-style: none; }
  .topic-full > summary::-webkit-details-marker { display: none; }
  .topic-full p { margin-top: 4px; max-width: var(--measure); white-space: pre-line; overflow-wrap: anywhere; }
  .cancel-form { margin: 0; text-align: left; }

  /* --- read-only lines, beats, own material */
  .beat-tile { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
  .beat-media { position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--card-2); border: 1px solid var(--line); }
  .beat-text { font: var(--t-small); color: var(--soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .beat-change > summary { list-style: none; }
  .beat-change > summary::-webkit-details-marker { display: none; }
  .beat-actions { display: flex; flex-wrap: wrap; gap: 0 var(--s-2); margin: 0 calc(-1 * var(--s-2)); }
  .own-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0; }

  /* --- list rows that keep their class (hooks) and take the hairline look */
  .segment-list, .ledger, .price-list, .episode-list, .slot-list, .asked-list, .material-videos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
  .segment, .ledger > li, .price-list > li, .episode-list > li, .slot-item, .material-video {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding: var(--s-3) 0; margin: 0;
    border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; max-width: none; }
  :is(.segment-list, .ledger, .price-list, .episode-list, .slot-list, .material-videos) > li:first-child { border-top: 0; padding-top: 0; }
  :is(.segment-list, .ledger, .price-list, .episode-list, .slot-list, .material-videos) > li:last-child { padding-bottom: 0; }
  .segment-info { display: grid; gap: 2px; flex: 1 1 260px; min-width: 0; }
  .segment-text { color: var(--soft); font: var(--t-small); font-style: italic; margin: 0; }
  .segment form { margin: 0; }
  .price-list > li > b, .ledger .delta { white-space: nowrap; font-variant-numeric: tabular-nums; }
  .ledger li div { display: grid; gap: 2px; min-width: 0; }
  .delta { font-weight: 800; }
  .delta.plus { color: var(--green); } .delta.minus { color: var(--red); }
  .material-video { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; }
  .material-video.video-failed { background: var(--red-soft); border-radius: var(--r-md); padding: var(--s-3); }

  /* --- tables live in a scroller inside their card */
  .table-wrap { overflow-x: auto; margin-inline: calc(-1 * var(--s-4)); padding-inline: var(--s-4); }
  @media (min-width: 720px) { .table-wrap { margin-inline: calc(-1 * var(--s-5)); padding-inline: var(--s-5); } }
  .table { width: 100%; border-collapse: collapse; font: var(--t-small); }
  .table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
  .table th { color: var(--faint); font: var(--t-eyebrow); text-transform: uppercase; letter-spacing: .05em; }

  /* --- lightbox */
  .lightbox button { box-shadow: var(--shadow-2); }
}

/* ============================================================ PAGES (the per-page rules that remain) */
@layer pages {
  /* --- account pages */
  .balance-card { display: grid; justify-items: center; gap: var(--s-2); text-align: center; }
  .balance-card > * { margin: 0; }
  .big-balance { display: flex; align-items: center; justify-content: center; gap: var(--s-3); font-size: 2.75rem; font-weight: 800; letter-spacing: -.03em; }
  .big-balance small { font-size: 1rem; color: var(--soft); font-weight: 600; }
  .music-track > audio { flex: 1 1 100%; width: 100%; height: 40px; }
  .music-track-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
  .music-rename { display: flex; flex-wrap: nowrap; gap: var(--s-2); align-items: center; flex: 1 1 280px; margin: 0; }
  .music-rename input { flex: 1; min-width: 0; }
  .prose > h2:not(:first-child) { margin-top: var(--s-6); }
  .prose p { color: var(--soft); }
  .auth h1 { font: var(--t-h1); }
  .auth + .center { margin: 0; }
  .auth + .center a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

  /* --- the forms of a step: the pieces that live inside a card or a folded extra */
  .avatar-box-label { font: var(--t-caption); color: var(--faint); }
  .drop-pair { display: grid; gap: var(--s-3); }
  @media (min-width: 720px) { .drop-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .consent { display: grid; gap: var(--s-1); padding-top: var(--s-3); border-top: 1px solid var(--line); }
  .consent > * { margin: 0; }
  .consent-title { font: var(--t-label); }
  .extra-body .own-video, .extra-body .site-box, .extra-body .profile-box { display: grid; gap: var(--s-4); margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .extra-body .own-video > *, .extra-body .site-box > *, .extra-body .profile-box > * { margin: 0; }
  .site-box [data-site-mock] { display: none; }
  .site-box:has([data-site-mode][value="mock"]:checked) [data-site-mock] { display: grid; gap: var(--s-3); }
  .site-box:has([data-site-mode][value="mock"]:checked) [data-site-link] { display: none; }
  .mock-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); margin: 0; }
  .mock-fields > * { margin: 0; }
  .mock-offer-head { display: flex; gap: var(--s-2); align-items: center; color: var(--amber); margin: 0; }
  .material-how { margin: 0; padding: var(--s-3) var(--s-4) var(--s-3) calc(var(--s-4) + 18px); border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line);
    display: grid; gap: 6px; font: var(--t-small); color: var(--text); }
  .material-how li { max-width: var(--measure); }
  .profile-foot { display: flex; justify-content: space-between; gap: var(--s-3); }
  .own-videos:empty { display: none; }
  .optional-label + .extra { margin-top: calc(-1 * var(--s-1)); }
  .setup-line { color: var(--soft); }
  .angle-option .switch-text .badge { margin-left: 6px; }

  /* --- avatar video: ideas, listening, the script */
  .angle-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
  .angle-title { font-size: 1.0625rem; }
  .angle-score { flex: none; font-weight: 800; font-size: 1.125rem; color: var(--accent-text); font-variant-numeric: tabular-nums; }
  .angle-score small { font-size: .75rem; color: var(--faint); font-weight: 600; }
  .angle-hook { font-size: 1.0625rem; font-style: italic; max-width: var(--measure); }
  .angle-row { font: var(--t-small); color: var(--soft); max-width: var(--measure); }
  .angle-row em { font-style: normal; font-weight: 700; color: var(--text); margin-right: 4px; }
  .angle-scores { font: var(--t-small); color: var(--faint); }
  .angle-warn { font: var(--t-small); font-weight: 600; color: var(--amber); }
  .listen-match { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0; }
  .listen-card audio, .wait-voice audio { width: 100%; }
  .edit-asked { margin: 0; padding: var(--s-3) var(--s-4); border-left: 4px solid var(--accent-line); background: var(--card); border-radius: var(--r-sm); font-style: italic; overflow-wrap: anywhere; }
  .edit-plan { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
  .edit-price { font-weight: 600; margin: 0; }
  .edit-photo > summary { display: inline-flex; }
  .edit-photo[open] > summary { margin-bottom: var(--s-2); }
  .music-legend { font: var(--t-h2); margin-bottom: var(--s-3); }
  .music-mine > * { margin: 0; }
  .field-short input { max-width: 160px; }
  .redo-new { margin: 0; }
  .script-form { display: flex; flex-direction: column; gap: var(--s-5); }
  @media (min-width: 720px) { .script-form { gap: var(--s-6); } }
  .form.script-form > * { margin: 0; }
  .cost-line { max-width: none; }
  @media (max-width: 719px) { .avatar-box-label { display: none; } .avatar-box .btn-sm { padding-inline: var(--s-3); } }

  /* --- avatar set-up: photos, portraits, voice */
  .ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
  .ticks li { position: relative; padding-left: 28px; color: var(--soft); max-width: var(--measure); }
  .ticks li::before { content: "✓"; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-soft); color: var(--green);
    font-size: .7rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: none; }
  .ref-photos { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .ref-photo-foot .btn { padding-inline: 4px; }
  .ref-photo-foot .muted { white-space: nowrap; }
  .ref-strip { display: flex; justify-content: center; }
  .ref-strip .empty-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--card); box-shadow: var(--shadow-1); }
  .ref-strip .empty-photo + .empty-photo { margin-left: -22px; }
  .more { gap: var(--s-2) var(--s-4); }
  .more .hint { flex: 1 1 260px; }
  .portrait-note { font: var(--t-small); color: var(--soft); margin: 0; }
  .guide { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  @media (min-width: 720px) { .guide { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .guide li { max-width: none; padding: var(--s-3); border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); font: var(--t-small); color: var(--soft); }
  .guide b { color: var(--text); display: block; }
  .guide li.guide-key { grid-column: 1 / -1; background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); font-size: .9375rem; }
  .guide li.guide-key b { font-size: 1rem; color: var(--accent-text); }
  .recorder { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-lg); background: var(--card-2); border: 1px solid var(--line); }
  .rec-info { flex: 1; display: grid; gap: 4px; min-width: 0; }
  .rec-time { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
  .reading { max-height: 230px; overflow-y: auto; padding: var(--s-4); border-radius: var(--r-md); background: #fbf8ef; border: 1px solid #ece4cd; color: #1d1a2b; font-size: 1.0625rem; line-height: 1.7; }
  .voice-ready audio { width: 100%; }
  .voice-form .tab-panel > * + * { margin-top: 0; }
  .extra-body > .voice-form { margin: 0; }

  /* --- flyers */
  .flyer-uploads { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 640px) { .flyer-uploads { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .flyer-upload-block { display: grid; gap: var(--s-2); align-content: start; min-width: 0; }
  .flyer-upload-block > * { margin: 0; }
  .flyer-tile { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
  .flyer-tile > * { margin: 0; }
  .flyer-tile form { margin: 0; }
  .flyer-tile.is-chosen .flyer-media { border-color: var(--accent-text); box-shadow: 0 0 0 2px var(--accent-text); }
  .flyer-media { position: relative; margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--card-2); border: 1px solid var(--line); }
  .flyer-caption { font: var(--t-small); font-weight: 700; color: var(--text); }
  .chosen-mark { color: var(--accent-text); }
  .flyer-big { margin: 0; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-2); background: var(--card-2); }
  .flyer-big img { width: 100%; height: auto; display: block; }
  .flyer-result { align-items: start; }
  @media (min-width: 720px) { .flyer-result { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); } }
  .flyer-final figure { margin: 0; display: grid; gap: 6px; }
  .flyer-final .flyer-media { overflow: visible; border: 0; background: none; aspect-ratio: auto; }
  .flyer-final .flyer-media img { border-radius: var(--r-md); border: 1px solid var(--line); height: auto; }
  .flyer-edit { display: grid; gap: var(--s-5); }
  @media (min-width: 900px) { .flyer-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .flyer-preview { position: sticky; top: 140px; } }
  .flyer-preview { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
  .flyer-side { display: grid; gap: var(--s-4); }
  .flyer-side .redo { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-2) var(--s-4); }
  .flyer-side .redo > summary { display: flex; align-items: center; min-height: 44px; font-weight: 700; }
  .flyer-side .redo[open] > summary { margin-bottom: var(--s-2); }
  /* --- image reel: beats, headline, cards */
  .headline-edit { display: grid; gap: 6px; }
  .beat-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
  .beat-lines > li { max-width: none; }
  .beat-line { display: flex; gap: var(--s-3); align-items: flex-start; }
  .beat-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-weight: 800; font-size: .8125rem; margin-top: 2px; }
  .beat-body { flex: 1; display: grid; gap: 6px; min-width: 0; }
  .card-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
  @media (max-width: 559px) { .card-fields { grid-template-columns: minmax(0, 1fr); } }
  .beat-count { font-weight: 700; color: var(--accent-text); margin: 0; }
  .music-change { display: grid; gap: var(--s-3); padding: 0; background: none; border: 0; border-radius: 0; }
  .music-change > * { margin: 0; }
  .music-own > summary { display: inline-flex; }
  .music-done { color: var(--green); font-weight: 600; margin: 0; }
  .reference-box { margin: 0; padding: var(--s-4); border: 1px dashed var(--line-2); border-radius: var(--r-md); background: var(--card-2); }
  .card-legend { font: var(--t-h2); margin-bottom: var(--s-3); }
  .own-logo { display: flex; align-items: center; gap: var(--s-3); }
  .own-logo img { max-width: 120px; max-height: 80px; object-fit: contain; border-radius: var(--r-sm); background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 16px 16px; padding: 6px; border: 1px solid var(--line); }

  /* --- podcast */
  .show-list { display: grid; gap: var(--s-4); }
  .show-head { display: flex; align-items: center; gap: var(--s-3); margin: 0; }
  .show-name { flex: 1; min-width: 0; display: grid; gap: 2px; }
  .show-name > * { margin: 0; }
  .show-logo { width: 52px; height: 52px; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
  .show-logo-lg { width: 96px; height: 96px; }
  .new-episode { background: var(--card-2); }
  .field-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
  .field-row > * { flex: 1 1 200px; min-width: 0; }
  .field-row > .field-narrow { flex: 0 1 140px; }
  .cast-list { display: grid; gap: var(--s-2); }
  .cast-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  @media (min-width: 560px) { .cast-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
  .logo-pick { display: flex; align-items: center; gap: var(--s-4); }
  .logo-pick .dropzone { flex: 1; min-width: 0; }
  .field-color input[type=color] { width: 88px; }
  .quota { display: grid; gap: var(--s-2); margin: 0; }
  .quota > * { margin: 0; }
  .quota-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
  .episode-list a { display: grid; gap: 2px; flex: 1 1 240px; min-width: 0; color: var(--text); text-decoration: none; }
  .episode-list a:hover b { text-decoration: underline; }
  .episode-list form { margin: 0; }
  .ask-card { margin: 0; padding: var(--s-4) var(--s-5); border: 1px solid var(--accent-line); border-radius: var(--r-lg); background: var(--accent-soft); box-shadow: none; }
  .ask-title { font: var(--t-h2); margin: 0; }
  .plan-block { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
  #episodio .editable, #cortos .editable, .client-ask .editable { border-radius: var(--r-md); }
  .short { border-radius: var(--r-md); background: var(--card); }
  .who-grid { margin: 0; }
  .who-card { align-content: start; }
  .record-tips > summary::after { content: none; }
  .record-tips > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-3); min-height: 44px; }
  .record-tips-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-text); color: #fff; font-weight: 900; font-size: .8rem; }
  .record-tips-title { color: var(--accent-text); }
  .record-tips-sub { color: var(--soft); font: var(--t-small); }
  .record-tips-list { margin: var(--s-2) 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
  .record-tips-foot { margin-top: var(--s-2); color: var(--soft); font: var(--t-small); }
  .episode-delete { margin: 0; padding-top: var(--s-3); border-top: 1px solid var(--line); text-align: right; }
  /* --- share page */
  .share-card { padding: 0; overflow: hidden; }
  .share-card > :not(:first-child) { margin-top: 0; }
  .share-body { padding: var(--s-5); display: grid; gap: var(--s-3); }
  .share-body > * { margin: 0; }
  .share-title { font: var(--t-h1); overflow-wrap: anywhere; }
  .share-meta { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
  .share-meta li { display: grid; gap: 2px; padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-2); max-width: none; }
  .share-file-list .info-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); width: 100%; }
  .share-file-list > li { display: grid; }
  .share-foot { margin: 0 auto; }
  /* --- admin */
  .admin-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
  .stat { display: grid; gap: 4px; }
  .stat b { font-size: 1.75rem; }
  .price-form { display: grid; gap: var(--s-3); }
  @media (min-width: 720px) { .price-form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); } .price-form > .btn, .price-form > button { grid-column: 1 / -1; justify-self: start; } }
  .field-inline { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s-3); }
  .field-inline input { max-width: 110px; text-align: right; }
  .slot-item { flex-wrap: wrap; }

  /* --- reading measure for the texts that sit straight in wide boxes (about 70 characters a line) */
  .toast-body > span, .row-main > span, .dz-empty > span, .field > span.hint, .field > small, .switch-text > .hint,
  .alert > b, .alert li, .angle-title, .record-tips-list li, .fix-ways li, .plain-list li, .notes li, .check > span,
  .save-row > span, .live-leave, .setup-line, .pick-help { max-width: var(--measure); }
  .field > small { display: block; }
  .guide li.guide-key { padding-right: max(var(--s-3), calc(100% - 31rem)); }
  .share-foot { margin: 0; text-align: left; }
  .hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-6); }
  .hero-copy { flex: 1 1 460px; min-width: 0; }
  .hero-phone { flex: 0 1 300px; display: flex; justify-content: center; }
  .hero-cta { margin: 0; }
  .live-kicker { opacity: 1; }
  @media (max-width: 559px) { .field-row { display: grid; grid-template-columns: minmax(0, 1fr); } }
  /* a page that shows its live wait does not repeat it as a progress button in the action bar */
  .wait-card ~ .flow-actions:has(> .btn-progress:only-child) { display: none; }

  /* text buttons that stand alone at the start of a row: their ink on the content edge */
  .cancel-form > .btn-danger-text, .cancel-form > .btn-text, .redo-new > .btn-text { margin-left: calc(-1 * var(--s-2)); }

  /* the voice's amber advice boxes (recording noise, saturation): the app.js hooks keep their markup */
  .voice-check { display: grid; gap: var(--s-2); }
  p.voice-check { display: block; }
  .voice-check-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: var(--s-2); border-radius: 50%; background: var(--amber-mark); color: #fff; font-size: .8rem; font-weight: 800; vertical-align: -3px; }

  .card.progress-card > :not(:first-child) { margin-top: 0; }
}

/* ============================================================ PHONES (last, so it wins): every control at least 44 px,
   the nav on its own row, the action bar sticky at the bottom with its own space */
@layer phone {
  @media (max-width: 719px) {
    .top-row { flex-wrap: wrap; row-gap: 0; min-height: 56px; gap: var(--s-3); }
    .top-nav { display: flex; order: 3; width: 100%; margin: 0; gap: var(--s-5); }
    .top-nav a { min-height: 44px; min-width: 44px; justify-content: center; padding: 0; border-radius: 0; background: none !important; }
    .top-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent-text); color: var(--text); }
    .chip-tokens { min-height: 44px; }
    .avatar-btn { width: 44px; height: 44px; }

    /* the action bar: sticky at the bottom, full bleed, the primary on top; it sits after the content, so at the end of
       the page it covers nothing, and a focused field is kept above it (html scroll-padding-bottom) */
    .flow-actions { position: sticky; bottom: 0; z-index: 20; margin: 0 calc(-1 * var(--gutter)); padding: var(--s-3) var(--gutter) calc(var(--s-3) + env(safe-area-inset-bottom));
      background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
      flex-direction: column-reverse; align-items: stretch; gap: var(--s-2); box-shadow: 0 -6px 16px rgba(16, 24, 40, .06); }
    .flow-actions > .btn, .flow-actions > form, .flow-actions > form .btn, .flow-actions > .live-progress { width: 100%; flex: none; }
    .flow-actions .flow-note { margin: 0; text-align: center; max-width: none; }
    .card .flow-actions, .extra-body .flow-actions { margin-inline: calc(-1 * var(--s-4)); padding-inline: var(--s-4); }
    .flow-actions.live-actions, .flow-actions.is-static { position: static; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

    /* 44 px targets */
    .btn, .btn-sm, .btn-text, .link-btn, .mini-link, .tool-btn, .btn-danger-text, .btn-save, .tab, .chip span, .filter-chip, .ask-chip { min-height: 44px; }
    summary, .topic-full > summary, .consent-more > summary, .portrait-change summary, .steps-detail > summary { min-height: 44px; }
    .check { min-height: 44px; padding-block: 10px; }
    .toast { grid-template-columns: 24px minmax(0, 1fr) 44px; }
    .toast-error { grid-template-columns: 28px minmax(0, 1fr) 44px; }
    .toast-close { width: 44px; height: 44px; }
    .search-form .btn { padding-inline: var(--s-4); }
    .filter-chips { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
    .sticky-actions, .pick-bar { bottom: 0; border-radius: 0; border: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(16, 24, 40, .06); }
    .pick-bar .btn { flex: 1 1 100%; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  }
}

/* ============================================================ INSTALL THE APP («📲 Instalá la app»: templates/_install_card.html,
   _instalar.html, static/instalar.js). Same layer as the other components; appended here so it stays in one place. */
@layer components {
  /* the logo, the same as the header's .brand-mark and the app icons (static/icons), at any size */
  .install-logo { --size: 48px; position: relative; flex: none; width: var(--size); height: var(--size); border-radius: calc(var(--size) * .2857);
    background: var(--grad); box-shadow: 0 4px 12px rgba(124, 92, 255, .25); }
  .install-logo::after { content: ""; position: absolute; inset: 0; background: #fff; border-radius: inherit;
    clip-path: polygon(39.2857% 28.5714%, 71.4286% 50%, 39.2857% 71.4286%); }

  /* the "get the app" card on the entry pages: the logo, one line, the button under them */
  .install-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s-3) var(--s-4); margin: 0;
    padding: var(--s-4); border-radius: var(--r-lg); background: linear-gradient(135deg, #f7f4ff, #fff4fa); border: 1px solid var(--accent-line); }
  .install-copy { display: grid; gap: 2px; min-width: 0; }
  .install-title { margin: 0; font: var(--t-h3); color: var(--text); }
  .install-line { margin: 0; font: var(--t-small); color: var(--soft); }
  .install-btn { grid-column: 1 / -1; width: 100%; min-height: 48px; background: var(--card); }
  .install-btn:hover { background: var(--accent-soft); }

  /* the how-to and «¡Listo!» dialogs: the app's dialog, with the logo by the title and numbered steps */
  .install-head { display: flex; align-items: center; gap: var(--s-3); }
  .install-head h2 { margin: 0; min-width: 0; }
  .install-head .install-logo { --size: 44px; }
  .install-dialog .modal > p, .install-dialog [data-instalar-steps] > p { margin-top: var(--s-3); color: var(--soft); }
  .install-steps { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-3); counter-reset: paso; }
  .install-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: var(--s-3); counter-increment: paso; max-width: none; }
  .install-steps li::before { content: counter(paso); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-text); font-weight: 800; }
  .install-steps li > span { padding-top: 4px; }
  .install-glyph { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -.25em; color: var(--accent-text); }

  /* the iPhone banner: fixed at the bottom, above the home indicator; hidden while a field is being typed in */
  .install-banner { position: fixed; z-index: 50; left: max(var(--s-3), env(safe-area-inset-left)); right: max(var(--s-3), env(safe-area-inset-right));
    bottom: calc(var(--s-3) + env(safe-area-inset-bottom)); max-width: 520px; margin-inline: auto;
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) var(--s-4);
    background: var(--card); border: 1px solid var(--accent-line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: rise .2s ease; }
  .install-banner.is-away { display: none; }
  .install-banner .install-logo { --size: 40px; }
  .install-banner-copy { display: grid; gap: 2px; min-width: 0; font: var(--t-small); color: var(--soft); }
  .install-banner-copy b { color: var(--text); font-size: .9375rem; }
  .install-banner-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: var(--s-2); }
  .install-banner-actions .btn { min-height: 44px; }
  html.has-install-banner body { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
}

/* ============================================================ ON THE DEVICE (mobile QA 2026-11-19 with Safari's engine
   as an iPhone and Chrome as a Pixel): no zoom when a field is focused, the screen Safari really shows, the notch and
   the home indicator, one look for selects and search boxes in every browser. Each block goes in its own layer. */
@layer base {
  /* the smallest visible screen: 100vh on iPhone is the screen without Safari's bars, so short pages scrolled */
  body { min-height: 100svh; }
  /* selects and search boxes: our field look, not the one each phone draws (the arrow is ours) */
  select { -webkit-appearance: none; appearance: none; padding-right: 44px; text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 18px 18px; }
  select[multiple] { padding-right: 14px; background-image: none; }
  input[type=search] { -webkit-appearance: none; appearance: none; }
  input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
  @supports (-webkit-touch-callout: none) { button { -webkit-appearance: none; } }   /* iPhone and iPad only */
}
@layer layout {
  /* the notch in landscape (the page uses viewport-fit=cover): the frame keeps the content clear of it */
  .shell { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
}
@layer components {
  /* fields people type in: 16 px at least, or iPhone zooms the whole page in when one is focused */
  .portrait-change textarea, .share-link .share-url { font-size: 1rem; }
  /* windows: inside the screen Safari leaves visible, clear of the notch and the home indicator, scrolling inside */
  .info-dialog { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .modal-backdrop { overflow-y: auto; overscroll-behavior: contain;
    padding: max(var(--s-4), env(safe-area-inset-top)) max(var(--s-4), env(safe-area-inset-right)) max(var(--s-4), env(safe-area-inset-bottom)) max(var(--s-4), env(safe-area-inset-left)); }
  .lightbox { padding: calc(56px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .lb-figure img, .lb-figure video { max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
@layer phone {
  @media (max-width: 719px) {
    /* the bars at the bottom are solid: the blur behind them is not drawn the same in every browser, and the note
       under the button has to read clean */
    .flow-actions, .sticky-actions, .pick-bar { background: var(--card); }
    .sticky-actions, .pick-bar { padding-bottom: calc(var(--s-3) + env(safe-area-inset-bottom)); }
    /* the avatar's name on the home card is a link: 44 px to tap, the same space on screen */
    .mini-avatar .who a { padding-block: 11px; margin-block: -11px; }
  }
  /* signed out on a narrow phone: the brand and one action keep the bar on one row (templates/base.html) */
  @media (max-width: 439px) { .top-right .hide-narrow { display: none; } }
}

/* ============================================================ UPLOADS (static/app.js «Uploads happen in the browser»):
   the light strip while a file is on its way, the red box when an upload is cut */
@layer components {
  .upload-stay { position: fixed; z-index: 60; top: calc(var(--s-2) + env(safe-area-inset-top));
    left: max(var(--s-3), env(safe-area-inset-left)); right: max(var(--s-3), env(safe-area-inset-right)); max-width: 560px; margin-inline: auto;
    display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
    background: var(--accent-soft); border: 1px solid var(--accent-line); box-shadow: var(--shadow-2);
    color: var(--accent-text); font: var(--t-small); font-weight: 600; }
  .upload-stay .spinner { margin-top: 1px; }
  .upload-cut > div { display: grid; gap: var(--s-1); justify-items: start; min-width: 0; }
  .upload-cut b { color: var(--red); }
  .upload-cut .btn { margin-top: var(--s-2); }
}

/* «Cortos de tu video» (reelstudio/clips.py, 2026-11-19): its card, its report and its downloads. New classes only,
   unlayered on purpose; the five-card home grid applies only when there are five cards (3 + 2 on wide screens). */
.product-cortos { --p: #e0457b; --p-soft: #fde8ef; --p-text: #b02a5b; }
@media (min-width: 720px) { .products:has(> .product-card:nth-child(5):last-child) > .product-card:nth-child(5) { grid-column: 1 / -1; } }
@media (min-width: 1024px) {
  .products:has(> .product-card:nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .products:has(> .product-card:nth-child(5):last-child) > .product-card { grid-column: span 2; }
  .products:has(> .product-card:nth-child(5):last-child) > .product-card:nth-child(n+4) { grid-column: span 3; }
}
.clip-drop { min-height: 150px; }
.clip-formats .chip span { flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.2; padding-block: 6px; }
.clip-formats .chip small { font-weight: 400; font-size: .75rem; opacity: .85; }
.clip-logo { width: 48px; height: 48px; object-fit: contain; vertical-align: middle; border-radius: 10px; background: #fff; border: 1px solid var(--line, #e3e3ea); }
.clip-file { display: grid; gap: 6px; }
.clip-report-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.clip-finding { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 14px; border: 1px solid #d9d4fb; background: #f6f4ff; }
.clip-finding p { margin: 2px 0 0; }
.clip-finding-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #6d4ee8; color: #fff; font-weight: 900; font-size: .85rem; font-style: normal; }
.clip-finding-advice { border-color: #f1d18a; background: #fff8e6; }
.clip-finding-advice .clip-finding-mark { background: #c77d00; }
.clip-finding-error { border: 2px solid #e57373; border-left-width: 6px; background: #ffe8e8; color: #5f1111; }
.clip-finding-error .clip-finding-mark { background: #d32f2f; }
.clip-finding-title { display: block; font-size: 1rem; }
.clip-finding-label { font-weight: 700; }
.clip-ready-item { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 14px; }
.clip-ready-item video { width: 220px; max-width: 100%; border-radius: 12px; background: #000; }
.clip-ready-item .short-body { flex: 1 1 260px; min-width: 0; }
.clip-downloads { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================ LANDING (templates/landing.html, 2026-11-19): the public
   page, signed out. New lp-* classes only, in the pages layer; it borrows the product colours (.product-avatar…),
   .product-icon and .product-formats of the home cards. The drawing in the hero is CSS, never a person. */
@layer pages {
  .lp { display: grid; gap: var(--s-7); min-width: 0; }
  @media (min-width: 720px) { .lp { gap: 72px; } }
  .lp-section { display: grid; gap: var(--s-5); min-width: 0; }
  .lp-head { display: grid; gap: var(--s-2); }
  .lp-head > * { margin: 0; }
  .lp-head h2, .lp-end h2 { font: 800 clamp(1.375rem, 1.1rem + 1vw, 1.875rem)/1.2 var(--sans); letter-spacing: -.02em; }
  .lp-head p { color: var(--soft); font-size: 1.0625rem; }

  /* --- hero: the words on the left, the drawing on the right (no drawing on phones: the buttons come first) */
  .lp-hero { display: grid; gap: var(--s-6); align-items: center; min-width: 0; padding-top: var(--s-2); }
  @media (min-width: 720px) { .lp-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); padding-top: var(--s-5); } }
  .lp-hero-copy { display: grid; gap: var(--s-4); justify-items: start; min-width: 0; }
  .lp-hero-copy > * { margin: 0; }
  .lp-hero h1 { font: 800 clamp(2.125rem, 1rem + 3vw, 3.25rem)/1.08 var(--sans); letter-spacing: -.035em; overflow-wrap: normal; }
  .lp-hero .grad { background: var(--grad-strong); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .lp-hero .lede { font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.5; color: var(--soft); text-wrap: pretty; }
  .lp-hero .install-card { width: 100%; }
  .lp-gift { display: inline-flex; align-items: center; gap: var(--s-2); margin: 0; padding: 6px 14px 6px 8px; border-radius: var(--r-pill);
    background: var(--amber-soft); border: 1px solid var(--amber-line); color: #7a3a0c; font: var(--t-small); font-weight: 600; }
  .lp-gift b { font-weight: 800; }
  .lp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); width: 100%; margin: 0; }
  @media (max-width: 479px) { .lp-hero .lp-cta .btn, .lp-end .lp-cta .btn-primary { flex: 1 1 100%; } }
  .lp-end .btn-text { min-height: 44px; }

  /* the drawing: a flyer, a reel on a phone, a podcast and the four formats, sized by its own width (cqw) */
  .lp-art { display: none; }
  @media (min-width: 720px) {
    .lp-art { display: block; position: relative; width: 100%; max-width: 460px; aspect-ratio: 1 / 1; justify-self: center; container-type: inline-size; }
  }
  .lp-art > * { position: absolute; display: block; }
  .lp-art-glow { inset: 6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(124, 92, 255, .16), rgba(255, 92, 168, .08) 60%, transparent); }
  .lp-sheet { left: 5%; top: 16%; width: 40%; aspect-ratio: 1 / 1.414; display: grid; align-content: start; gap: 3cqw; padding: 3.4cqw;
    background: #fff; border: 1px solid var(--line); border-radius: 2.6cqw; box-shadow: var(--shadow-2); transform: rotate(-7deg); }
  .lp-sheet > * { display: block; border-radius: 1.2cqw; }
  .lp-sheet-band { height: 20cqw; background: linear-gradient(150deg, #f2994a, #f9c98f); }
  .lp-sheet-line { height: 2.4cqw; width: 92%; background: #e9e2da; }
  .lp-sheet-line.is-short { width: 70%; }
  .lp-sheet-line.is-shorter { width: 48%; }
  .lp-sheet-pill { width: 46%; height: 5.6cqw; margin-top: 1cqw; border-radius: 9cqw; background: #fdf0e3; border: .5cqw solid #f2994a; }
  .lp-phone { right: 8%; top: 2%; width: 40%; aspect-ratio: 9 / 18.5; padding: 1.8cqw; border-radius: 6.4cqw; background: #16151d; box-shadow: var(--shadow-3); transform: rotate(5deg); }
  .lp-screen { position: relative; display: block; height: 100%; overflow: hidden; border-radius: 4.8cqw; background: linear-gradient(165deg, #5b3fd9, #a33a9c 55%, #f08a7a); }
  .lp-screen > * { position: absolute; display: block; }
  .lp-rec { top: 4.5cqw; left: 3.4cqw; padding: .6cqw 1.8cqw; border-radius: 9cqw; background: rgba(0, 0, 0, .3); color: #ffb3cf; font: 800 2.3cqw/1.3 var(--sans); }
  .lp-head-shape { top: 24%; left: 50%; width: 15cqw; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .26); transform: translateX(-50%); }
  .lp-body-shape { top: 45%; left: 50%; width: 27cqw; height: 22%; border-radius: 50% 50% 10% 10% / 70% 70% 10% 10%; background: rgba(255, 255, 255, .2); transform: translateX(-50%); }
  .lp-cap { left: 3.4cqw; right: 3.4cqw; bottom: 9cqw; padding: 1.8cqw 2cqw; border-radius: 2cqw; background: #fbfbf8; color: #8e8e96; text-align: center; font: 800 3cqw/1.2 var(--sans); }
  .lp-cap b { color: #111; }
  .lp-pod { left: 0; top: 68%; display: flex; align-items: center; gap: 2.6cqw; padding: 2.4cqw 3.2cqw 2.4cqw 2.4cqw;
    background: #fff; border: 1px solid var(--line); border-radius: 3.4cqw; box-shadow: var(--shadow-2); }
  .lp-pod-icon { display: grid; place-items: center; width: 9cqw; height: 9cqw; border-radius: 2.4cqw; background: #e3f6f0; color: #0d7258; }
  .lp-pod-icon svg { width: 5cqw; height: 5cqw; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .lp-wave { display: flex; align-items: center; gap: 1.1cqw; height: 9cqw; }
  .lp-wave i { display: block; width: 1.3cqw; border-radius: 1cqw; background: #14a37f; }
  .lp-wave i:nth-child(1), .lp-wave i:nth-child(9) { height: 28%; }
  .lp-wave i:nth-child(2), .lp-wave i:nth-child(6) { height: 62%; }
  .lp-wave i:nth-child(3), .lp-wave i:nth-child(7) { height: 100%; }
  .lp-wave i:nth-child(4), .lp-wave i:nth-child(8) { height: 46%; }
  .lp-wave i:nth-child(5) { height: 78%; }
  .lp-ratios { right: 0; bottom: 3%; display: flex; align-items: flex-end; gap: 2.4cqw; padding: 2.6cqw 3cqw;
    background: #fff; border: 1px solid var(--line); border-radius: 3.4cqw; box-shadow: var(--shadow-2); }
  .lp-ratio { display: grid; justify-items: center; gap: 1cqw; color: #b02a5b; font: 700 2.4cqw/1 var(--sans); }
  .lp-ratio i { display: block; height: 8cqw; border: .55cqw solid #e0457b; border-radius: 1cqw; background: #fde8ef; }
  .lp-ratio.r-916 i { width: 4.5cqw; }
  .lp-ratio.r-11 i { width: 8cqw; }
  .lp-ratio.r-45 i { width: 6.4cqw; }
  .lp-ratio.r-169 i { width: 14.2cqw; height: 8cqw; }

  /* --- the products: equal cards (3 + 3 with the start card; 2 per row on tablets). From 720 px each row shares its
     tracks (subgrid), so the line, «Vos ponés», «Te llevás» and the formats start at the same height across a row. */
  .lp-products { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); margin: 0; }
  @media (min-width: 720px) { .lp-products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .lp-products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .lp-card { position: relative; display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; margin: 0; padding: var(--s-5);
    border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
  .lp-card > * { margin: 0; min-width: 0; }
  .lp-card-top { display: flex; align-items: center; gap: var(--s-3); }
  .lp-card-top .badge { margin-left: auto; }
  .lp-card h3 { font: var(--t-h3); font-size: 1.125rem; letter-spacing: -.01em; margin: 0; }
  .lp-card .product-icon { grid-row: auto; grid-column: auto; width: 44px; height: 44px; border-radius: var(--r-md); }
  .lp-card .product-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .lp-line { font: var(--t-body); font-weight: 600; color: var(--text); }
  .lp-io { font: var(--t-small); font-size: .9375rem; line-height: 1.5; color: var(--soft); text-wrap: pretty; }
  .lp-io-label { display: block; margin-bottom: 2px; font: var(--t-eyebrow); letter-spacing: .07em; text-transform: uppercase; color: var(--p-text); }
  .lp-card .product-formats { margin-top: auto; padding-top: var(--s-1); }
  .lp-card.is-soon { opacity: .75; border-style: dashed; }
  @supports (grid-template-rows: subgrid) {
    @media (min-width: 720px) {
      .lp-card:not(.lp-start) { display: grid; grid-row: span 5; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); row-gap: var(--s-3); }
      .lp-card:not(.lp-start) .product-formats { align-self: end; margin-top: 0; }
      .lp-start { grid-row: span 5; }
    }
  }
  /* the sixth card: where to start, the only primary button of the section */
  .lp-start { --p: var(--violet); --p-soft: #ffffff; --p-text: var(--accent-text);
    background: linear-gradient(150deg, #f6f2ff, #fff3f9); border-color: var(--accent-line); box-shadow: none; }
  .lp-start .btn { margin-top: auto; min-height: 48px; }
  .lp-start-logo { --size: 44px; }
  .lp-start-icons { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .lp-start-icons .product-icon { width: 40px; height: 40px; background: var(--p-soft); color: var(--p-text); }
  .lp-start-icons .product-icon svg { width: 20px; height: 20px; }

  /* --- how it works: three numbered steps */
  .lp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); counter-reset: lp-step; }
  @media (min-width: 1024px) { .lp-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .lp-steps li { counter-increment: lp-step; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-content: start; gap: var(--s-1) var(--s-3);
    min-width: 0; max-width: none; margin: 0; padding: var(--s-5); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
  .lp-steps li::before { content: counter(lp-step); grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: var(--grad-strong); color: #fff; font: 800 1.125rem/1 var(--sans); }
  .lp-steps h3 { font: var(--t-h3); margin: 0; padding-top: 8px; }
  .lp-steps p { grid-column: 2; margin: 0; color: var(--soft); font: var(--t-small); font-size: .9375rem; line-height: 1.5; }

  /* --- what every product brings: eight short points in one card */
  .lp-perks { list-style: none; margin: 0; padding: var(--s-4); display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr);
    border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
  @media (min-width: 480px) { .lp-perks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .lp-perks { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: var(--s-5); gap: var(--s-4) var(--s-5); } }
  .lp-perks li { display: flex; align-items: center; gap: var(--s-3); min-width: 0; max-width: none; margin: 0; font: var(--t-label); color: var(--text); }
  .lp-perk-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-text); }
  .lp-perk-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  /* --- FAQ: one card, one row per question, the chevron turns when it opens */
  .lp-faq { display: grid; margin: 0; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); overflow: hidden; }
  .lp-faq details { margin: 0; }
  .lp-faq details + details { border-top: 1px solid var(--line); }
  .lp-faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 56px; padding: var(--s-3) var(--s-5);
    font: var(--t-label); font-size: 1.0625rem; color: var(--text); list-style: none; border-radius: 0; }
  .lp-faq summary::-webkit-details-marker { display: none; }
  .lp-faq summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text);
    transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
  .lp-faq details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
  .lp-faq summary:hover { background: var(--card-2); }
  .lp-faq summary:focus-visible { border-radius: 0; box-shadow: inset 0 0 0 2px var(--accent-text); }
  .lp-faq details > p { margin: 0; padding: 0 var(--s-5) var(--s-5); color: var(--soft); }
  @media (max-width: 719px) {
    .lp-faq summary { padding-inline: var(--s-4); font-size: 1rem; }
    .lp-faq details > p { padding: 0 var(--s-4) var(--s-4); }
  }

  /* --- the closing band: one more way in, at the end of a long page */
  .lp-end { display: grid; gap: var(--s-4); align-items: center; min-width: 0; margin: 0; padding: var(--s-5);
    border-radius: var(--r-xl); background: linear-gradient(135deg, #f4f0ff, #fff0f7); border: 1px solid var(--accent-line); }
  .lp-end-copy { display: grid; gap: var(--s-2); min-width: 0; }
  .lp-end-copy > * { margin: 0; }
  .lp-end-copy p { color: var(--soft); font-size: 1.0625rem; }
  @media (min-width: 720px) { .lp-end { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-5); padding: var(--s-6); } .lp-end .lp-cta { width: auto; } }
}

/* «Comprar tokens», always in sight: next to the balance in the header, and on the home (owner, 2026-11-19) */
@layer components {
  .btn-buy-tokens { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 0 var(--s-3);
    border-radius: var(--r-pill); background: var(--grad-strong); color: var(--on-accent); font-weight: 800; text-decoration: none; white-space: nowrap;
    box-shadow: 0 6px 16px -8px rgba(124, 58, 237, .6); }
  .btn-buy-tokens > span[aria-hidden] { font-size: 1.15rem; line-height: 1; }
  .btn-buy-tokens:hover { filter: brightness(1.05); }
  .btn-buy-tokens:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
  .home-head-buy { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3) var(--s-5); }
  .home-head-text { display: grid; gap: var(--s-1); min-width: 0; }
  .home-buy { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
    border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--accent-line); box-shadow: var(--shadow); }
  .home-buy-balance { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; color: var(--text); white-space: nowrap; }
  .home-buy-btn { white-space: nowrap; }
}
@layer phone {
  @media (max-width: 560px) {
    .btn-buy-tokens { min-height: 44px; min-width: 44px; padding: 0; }
    .btn-buy-tokens .buy-label { display: none; }
    .home-buy { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); border-radius: 16px; padding: var(--s-3); }
    .home-buy-balance { justify-content: center; }
    .home-buy-btn { width: 100%; justify-content: center; }
  }
}

/* Pre-beta QA fixes (2026-11-20) */
@layer pages {
  /* «¿Con qué música?»: a refusal shows inside the card, big and red, where the page lands (reelstudio/music_form.py) */
  .music-choice .music-error { font-size: 1.0625rem; line-height: 1.45; scroll-margin-top: 96px; scroll-margin-bottom: 140px; }
  .music-choice .music-error:focus { outline: none; }
  /* «Comprá más tokens» inside «Te faltan tokens»: a real target, 44 px tall (it was 151x20) */
  .alert .buy-more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
  /* the terms of /registro: their link on its own line, over the checkbox (a tap on the checkbox's row ticks it) */
  .terms-read { margin: 0; }
  .login-forgot { margin: 0; text-align: center; }
  /* «Todavía no se pueden comprar tokens»: the page says it plainly */
  .pay-closed > * { margin: 0; }
}
@layer phone {
  /* a text or ghost button next to a big primary on one row: the same height (it was 36 or 44 px next to 52) */
  @media (min-width: 720px) {
    .flow-actions:has(.btn-lg) .btn, .lp-cta:has(.btn-lg) .btn { min-height: 52px; }
  }
}
