/* Señora S · Frambuesa cálida · CSS propio, sin dependencias.
   Integración: conserva los IDs y añade las clases del mockup al HTML PHP.
   .on, .encima, .guia, .ya, .ok y .bad conservan su contrato visual. */

:root {
  color-scheme: light;
  --bg: #FBF7F4;
  --surface: #FFFFFF;
  --surface-soft: #F5EEEB;
  --text: #292126;
  --muted: #6D5D65;
  --line: #E8DCD7;
  --control: #9B858E;
  --brand: #B51457;
  --brand-hover: #981147;
  --brand-active: #7B0C39;
  --brand-ink: #FFFFFF;
  --brand-soft: #FBE5ED;
  --brand-soft-hover: #F6D4E1;
  --focus: #8D1748;
  --success: #206344;
  --success-bg: #EAF5EF;
  --warning: #765000;
  --warning-bg: #FFF1C7;
  --danger: #AC2437;
  --danger-bg: #FDECEF;
  --info: #355B77;
  --info-bg: #EAF3FA;
  --disabled-bg: #EEE7E4;
  --disabled-ink: #6D5D65;
  --scrim: rgb(27 16 23 / 62%);
  --shadow: 0 6px 24px rgb(53 27 38 / 5%);
  --shadow-modal: 0 24px 80px rgb(27 16 23 / 24%);

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2rem;
  --leading: 1.5;
  --leading-title: 1.25;
  --weight-normal: 400;
  --weight-medium: 600;
  --weight-bold: 700;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-round: 999px;
  --sidebar: 240px;
  --content: 1280px;
  --tap: 48px;
  --nav-height: 72px;
  --ease: 160ms ease;
}

/* La misma paleta oscura se activa automáticamente o con data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #191418;
    --surface: #241D23;
    --surface-soft: #30262D;
    --text: #FFF6F8;
    --muted: #CDBAC3;
    --line: #453540;
    --control: #A18B96;
    --brand: #FF8AB6;
    --brand-hover: #FFA5C7;
    --brand-active: #EC78A5;
    --brand-ink: #30101E;
    --brand-soft: #452333;
    --brand-soft-hover: #563043;
    --focus: #FFD1E2;
    --success: #7ED9A6;
    --success-bg: #153C2A;
    --warning: #FFD982;
    --warning-bg: #3D3015;
    --danger: #FF9CAB;
    --danger-bg: #46212B;
    --info: #A6CFEF;
    --info-bg: #1C3446;
    --disabled-bg: #382E34;
    --disabled-ink: #B7A5AE;
    --scrim: rgb(8 4 7 / 76%);
    --shadow: 0 6px 24px rgb(0 0 0 / 12%);
    --shadow-modal: 0 24px 80px rgb(0 0 0 / 40%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191418;
  --surface: #241D23;
  --surface-soft: #30262D;
  --text: #FFF6F8;
  --muted: #CDBAC3;
  --line: #453540;
  --control: #A18B96;
  --brand: #FF8AB6;
  --brand-hover: #FFA5C7;
  --brand-active: #EC78A5;
  --brand-ink: #30101E;
  --brand-soft: #452333;
  --brand-soft-hover: #563043;
  --focus: #FFD1E2;
  --success: #7ED9A6;
  --success-bg: #153C2A;
  --warning: #FFD982;
  --warning-bg: #3D3015;
  --danger: #FF9CAB;
  --danger-bg: #46212B;
  --info: #A6CFEF;
  --info-bg: #1C3446;
  --disabled-bg: #382E34;
  --disabled-ink: #B7A5AE;
  --scrim: rgb(8 4 7 / 76%);
  --shadow: 0 6px 24px rgb(0 0 0 / 12%);
  --shadow-modal: 0 24px 80px rgb(0 0 0 / 40%);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-padding-block: 24px 120px; }
body { margin: 0; font-family: var(--font); font-size: var(--text-base); line-height: var(--leading); color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button, summary, select { cursor: pointer; }
button { appearance: none; }
a { color: var(--brand); text-underline-offset: 3px; }
button, a, input, select, summary { transition: background-color var(--ease), border-color var(--ease), color var(--ease); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--text-2xl); line-height: var(--leading-title); letter-spacing: -0.035em; font-weight: var(--weight-bold); }
h2 { font-size: var(--text-xl); line-height: 1.4; font-weight: var(--weight-bold); letter-spacing: -0.02em; }
h3 { font-size: var(--text-base); line-height: var(--leading); font-weight: var(--weight-bold); }
svg { flex: 0 0 auto; }
audio { width: 100%; min-height: 54px; }
::selection { color: var(--brand-ink); background: var(--brand); }

/* .sr-only: contenido accesible que se oculta visualmente. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* .skip: enlace de teclado para saltar al contenido. */
.skip { position: fixed; z-index: 100; inset: 8px auto auto 8px; transform: translateY(-160%); padding: 12px 16px; border-radius: 8px; color: var(--brand-ink); background: var(--brand); }
.skip:focus { transform: none; }
/* .icon: SVG local de 20 × 20 px con trazo heredado. */
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* .icon-box: contenedor de 44 px para iconografía de apoyo. */
.icon-box { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); color: var(--brand); background: var(--brand-soft); }
/* .muted: texto secundario con contraste AA. */
.muted { color: var(--muted); }
/* .small: texto auxiliar de 14 px / 21 px. */
.small { font-size: var(--text-sm); line-height: 1.5; }
/* .eyebrow: rótulo breve de 12 px, peso 700. */
.eyebrow { color: var(--muted); font-size: var(--text-xs); line-height: 1.5; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
/* .stack: disposición vertical con separación de 16 px. */
.stack { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
/* .row: disposición horizontal que permite varias líneas. */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); min-width: 0; }
/* .between: reparte una fila entre ambos extremos. */
.between { justify-content: space-between; }

/* .sidebar: navegación fija de 240 px, visible desde 900 px. */
.sidebar { display: none; }
/* .brand: identificador de Señora S con marca y nombre. */
.brand { display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--text); font-size: 22px; font-weight: 750; text-decoration: none; letter-spacing: -0.04em; }
/* .brand-mark: monograma S, sin fuente ni imagen externa. */
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: var(--brand-ink); background: var(--brand); font-size: 28px; font-weight: 750; font-style: italic; }
/* .nav-group: grupo vertical de secciones del menú lateral. */
.nav-group { display: grid; gap: 4px; }
/* .nav-title: título de agrupación del menú lateral. */
.nav-title { margin: 20px 12px 8px; color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
/* .nav-link: destino de navegación con objetivo mínimo de 48 px. */
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px; border: 1px solid transparent; border-radius: var(--r-md); color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-link.on, .nav-link[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
/* .on: estado activo aplicado por el JavaScript existente. */
.bottom-link.on, .bottom-link[aria-current="page"] { color: var(--brand); }
/* .sidebar-foot: cuenta y ayuda al pie del menú lateral. */
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
/* .main: contenido adaptable con espacio para la navegación. */
.main { width: 100%; max-width: calc(var(--content) + 64px); margin-inline: auto; padding: 24px 16px calc(var(--nav-height) + 28px + env(safe-area-inset-bottom)); }
/* .page-head: título y descripción de pantalla. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { margin-top: 6px; }
/* .mobile-brand: marca compacta en el encabezado móvil. */
.mobile-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: 14px; font-weight: 600; }
.mobile-brand .brand-mark { width: 28px; height: 28px; border-radius: 9px; font-size: 19px; }
/* .bottom-nav: navegación móvil fija, con área segura del iPhone. */
.bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 20; inset: auto 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); min-height: var(--nav-height); background: var(--surface); border-top: 1px solid var(--line); }
/* .bottom-link: pestaña móvil con icono y texto visibles. */
.bottom-link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 56px; padding: 4px 2px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 600; text-decoration: none; }
.bottom-link.on::before { content: ""; position: absolute; inset: 0 calc(50% - 16px) auto; height: 3px; border-radius: 99px; background: var(--brand); }

/* .card: superficie con borde, 16 px de radio y 20 px de relleno. */
.card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
/* .card-head: título y dato auxiliar de una tarjeta. */
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
/* .project: contexto del video, siempre antes de las acciones. */
.project { display: grid; gap: 16px; padding: 20px; margin-bottom: 20px; }
/* .project-field: selector de proyecto con etiqueta visible. */
.project-field { display: grid; gap: 8px; min-width: 0; }
/* .project-meta: categoría y estado del proyecto. */
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* .field: etiqueta, control y ayuda de un campo de formulario. */
.field { display: grid; gap: 8px; min-width: 0; }
.field label, .project-field label { font-size: 14px; font-weight: 600; }
/* .input: control nativo de 48 px con borde perceptible. */
.input { width: 100%; min-width: 0; min-height: var(--tap); padding: 12px; border: 1px solid var(--control); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: 16px; line-height: 24px; }
select.input { padding-right: 32px; }
.input[aria-invalid="true"] { border: 2px solid var(--danger); }
.input:disabled { color: var(--disabled-ink); background: var(--disabled-bg); cursor: not-allowed; }
/* .password: campo de clave con botón para mostrarla. */
.password { display: flex; align-items: center; gap: 8px; }
.password .input { flex: 1; }
/* .field-error: explicación de error asociada al campo. */
.field-error { color: var(--danger); font-size: 14px; }
.field-error:empty { display: none; }

/* .btn: botón secundario de 48 px; también sirve para enlaces. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); min-width: var(--tap); max-width: 100%; padding: 12px 16px; border: 1px solid var(--control); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-weight: 600; font-size: 16px; line-height: 22px; text-align: center; text-decoration: none; cursor: pointer; }
/* .btn-primary: acción principal en frambuesa. */
.btn-primary { color: var(--brand-ink); background: var(--brand); border-color: var(--brand); }
/* .btn-quiet: acción auxiliar sin borde visible. */
.btn-quiet { background: transparent; border-color: transparent; color: var(--brand); }
/* .btn-danger: acción de salida o cancelación, con texto explícito. */
.btn-danger { color: var(--danger); border-color: var(--control); }
/* .btn-wide: botón que ocupa todo el ancho disponible. */
.btn-wide { width: 100%; }
/* .icon-btn: botón de icono de 48 × 48 px, con nombre accesible. */
.icon-btn { display: inline-grid; place-items: center; width: 48px; min-height: 48px; flex-shrink: 0; padding: 0; border: 1px solid var(--control); border-radius: var(--r-md); color: var(--text); background: var(--surface); cursor: pointer; }
button:disabled, .btn[aria-disabled="true"] { opacity: 1; color: var(--disabled-ink); background: var(--disabled-bg); border-color: var(--line); cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 900ms linear infinite; }
.btn-primary:active:not(:disabled) { background: var(--brand-active); border-color: var(--brand-active); }

/* .video-grid: acciones, descargas y recibidos en orden semántico. */
.video-grid { display: grid; gap: 20px; align-items: start; }
/* .work: grupo de acciones del video seleccionado. */
.work { display: grid; gap: 20px; min-width: 0; }
/* .clip-disclosure: subir clips adicionales sin alejar las descargas en móvil. */
.clip-disclosure { padding: 0; overflow: hidden; }
.clip-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; padding: 20px; list-style: none; }
.clip-disclosure > summary::-webkit-details-marker { display: none; }
.clip-disclosure > summary > strong { font-size: 18px; letter-spacing: -0.02em; }
.clip-disclosure[open] > summary .chevron { transform: rotate(90deg); }
.clip-disclosure > summary:focus-visible { outline-offset: -4px; border-radius: var(--r-lg); }
/* .clips-body: área del selector de clips dentro del desplegable. */
.clips-body { padding: 0 20px 20px; }
/* .next-step: tarjeta de la siguiente acción con acento suave. */
.next-step { position: relative; overflow: hidden; padding: 24px 20px; border-color: var(--line); }
.next-step .eyebrow { color: var(--brand); }
.next-step h2 { margin-top: 8px; font-size: 26px; line-height: 1.3; letter-spacing: -0.035em; }
.next-step > p { margin-top: 8px; max-width: 45ch; }
.next-step .row { margin-top: 20px; }
/* .step-symbol: ilustración SVG discreta que acompaña la acción. */
.step-symbol { display: none; }
/* .upload-audio: alternativa para subir una voz ya grabada. */
.upload-audio { margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--line); }
.upload-audio > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; color: var(--muted); font-size: 14px; font-weight: 600; list-style: none; }
.upload-audio > summary::-webkit-details-marker { display: none; }
.upload-audio[open] > summary .chevron { transform: rotate(90deg); }
/* .chevron: indicador de expansión, siempre acompañado de texto. */
.chevron { width: 18px; height: 18px; transition: transform var(--ease); }
/* .dropzone: etiqueta clicable para seleccionar o arrastrar archivos. */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 156px; padding: 20px 16px; border: 1px dashed var(--control); border-radius: var(--r-md); background: var(--surface); text-align: center; cursor: pointer; }
.dropzone strong { font-size: 16px; line-height: 24px; font-weight: 650; }
.dropzone .icon { width: 28px; height: 28px; color: var(--brand); }
.dropzone small { max-width: 32ch; color: var(--muted); font-size: 14px; }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
/* .encima: estado de arrastre añadido por el JavaScript existente. */
.dropzone.encima, #zClips.encima, #zVoz.encima { background: var(--brand-soft); border: 2px solid var(--brand); }
.dropzone[aria-invalid="true"] { border: 2px solid var(--danger); background: var(--danger-bg); }
.dropzone[aria-disabled="true"] { color: var(--disabled-ink); background: var(--disabled-bg); cursor: not-allowed; }
.dropzone[aria-busy="true"] { border-style: solid; }
/* .dropzone-compact: selector de audio de 96 px de alto. */
.dropzone-compact { min-height: 96px; padding: 16px; margin-block: 8px 12px; }
/* .selected: resumen de archivos elegidos, aún pendientes de subir. */
.selected { margin-block: 12px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.selected:empty { display: none; }
/* .desktop-copy y .mobile-copy: instrucciones específicas del dispositivo. */
.desktop-copy { display: none; }
.mobile-copy { display: inline; }
/* .upload-hint: instrucción corta del selector de archivos en iPhone. */
.upload-hint { margin-top: 12px; font-size: 14px; color: var(--muted); }
/* .downloads: ubicación constante para videos terminados. */
.downloads { min-width: 0; }
/* .empty: estado vacío con una explicación y sin acción ficticia. */
.empty { display: grid; justify-items: start; gap: 12px; padding-block: 4px; }
.empty p { color: var(--muted); font-size: 14px; }
/* .result: versión terminada con miniatura y datos. */
.result { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 16px; align-items: center; }
/* .poster: miniatura SVG local, 64 × 88 px. */
.poster { display: grid; place-items: center; overflow: hidden; width: 64px; height: 88px; border-radius: var(--r-sm); color: #432A19; background: #E9C9A8; }
.poster svg { width: 64px; height: 88px; }
.result .chip { margin-top: 8px; }
.downloads > .btn { margin-top: 20px; }
/* .file-disclosure: lista de recibidos plegable, sin duplicar archivos. */
.file-disclosure { padding: 0; overflow: hidden; }
.file-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 80px; padding: 20px; list-style: none; }
.file-disclosure > summary::-webkit-details-marker { display: none; }
.file-disclosure > summary strong { display: block; font-size: 16px; }
.file-disclosure > summary .small { display: block; margin-top: 4px; color: var(--muted); }
.file-disclosure[open] > summary .chevron { transform: rotate(90deg); }
.file-disclosure > summary:focus-visible { outline-offset: -4px; border-radius: var(--r-lg); }
/* .files-body: contenido interior de la lista plegable. */
.files-body { padding: 0 20px 20px; }
/* .file-list: lista semántica de archivos sin viñetas. */
.file-list { padding: 0; margin: 0; list-style: none; }
/* .file-row: fila de archivo de 60 px en celular y 48 px en compu. */
.file-row { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 60px; padding-block: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.file-row > .icon { width: 18px; height: 18px; color: var(--muted); }
/* .file-name: nombre completo que puede partirse sin desbordar. */
.file-name { min-width: 0; overflow-wrap: anywhere; }
/* .file-size: tamaño alineado con cifras tabulares. */
.file-size { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* .voice-status: confirmación independiente del audio recibido. */
.voice-status { display: flex; align-items: center; gap: 8px; padding-block: 16px; border-top: 1px solid var(--line); font-size: 14px; }
/* .chip: etiqueta informativa, no interactiva. */
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 4px 9px; border-radius: var(--r-sm); color: var(--muted); background: var(--surface-soft); font-size: 12px; line-height: 18px; font-weight: 600; }
.chip .icon { width: 14px; height: 14px; }
/* .chip-success: etiqueta de proceso terminado. */
.chip-success { color: var(--success); background: var(--success-bg); }
/* .chip-warning: etiqueta de pendiente o mensaje obligatorio. */
.chip-warning { color: var(--warning); background: var(--warning-bg); }
/* .chip-brand: etiqueta de campaña o proyecto seleccionado. */
.chip-brand { color: var(--brand); background: var(--brand-soft); }
/* .message: aviso de estado, vacío no ocupa espacio. */
.message, #msg, #estado { display: flex; align-items: start; gap: 10px; padding: 12px 16px; margin-top: 16px; border: 1px solid var(--control); border-radius: var(--r-md); color: var(--info); background: var(--info-bg); font-size: 14px; }
.message:empty, #msg:empty, #estado:empty { display: none; }
/* .ok y .bad: éxito y error que añade el JavaScript existente. */
.message.ok, #msg.ok { color: var(--success); background: var(--success-bg); border-color: var(--success); }
.message.bad, #msg.bad { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
/* .notice: aviso persistente con texto e icono, sin depender del color. */
.notice { display: flex; align-items: start; gap: 10px; padding: 12px 16px; border: 1px solid var(--control); border-radius: var(--r-md); color: var(--warning); background: var(--warning-bg); font-size: 14px; }
/* .tabs: pestañas locales con navegación por enlaces o botones. */
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-soft); }
/* .tab: pestaña local de 48 px, activa con .on o aria-selected. */
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px; border: 1px solid transparent; border-radius: var(--r-sm); color: var(--muted); background: transparent; font-weight: 600; text-decoration: none; }
.tab.on, .tab[aria-selected="true"] { color: var(--brand); background: var(--surface); border-color: var(--control); }
.tab:disabled { color: var(--disabled-ink); cursor: not-allowed; }

/* .overlay: ventana modal, se abre mediante style.display = "grid". */
.overlay { display: none; position: fixed; z-index: 60; inset: 0; place-items: center; padding: 16px; overflow-y: auto; background: var(--scrim); }
/* .modal: ventana de progreso de 480 px como máximo. */
.modal { width: min(100%, 480px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border: 1px solid var(--control); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-modal); }
.modal h2 { font-size: 24px; line-height: 30px; }
/* .progress-number: porcentaje de subida, 40 px con cifras tabulares. */
.progress-number { font-size: 40px; line-height: 1.2; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
/* .progress-track: pista de progreso con semántica en su contenedor. */
.progress-track { height: 10px; margin-block: 16px; overflow: hidden; border-radius: var(--r-round); background: var(--surface-soft); border: 1px solid var(--control); }
/* .progress-fill: barra cuyo ancho actualiza el JS existente. */
.progress-fill { display: block; width: 0; height: 100%; background: var(--brand); border-radius: inherit; transition: width 160ms linear; }
/* .spinner: indicador giratorio decorativo acompañado de texto. */
.spinner { display: inline-block; width: 24px; height: 24px; border: 2px solid var(--control); border-right-color: var(--brand); border-radius: 50%; animation: spin 900ms linear infinite; }
/* .upload-detail: datos de archivo, MB y estimación de tiempo. */
.upload-detail { display: grid; gap: 8px; margin-block: 16px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
/* .more-list: destinos del panel Más, todos de al menos 48 px. */
.more-list { display: grid; gap: 4px; margin-top: 16px; }
.more-list .nav-link { font-size: 16px; }
@media (max-width: 899px) {
  #mas.overlay { align-items: end; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* .account: ancho de lectura y formulario limitado a 640 px. */
.account { display: grid; gap: 20px; max-width: 640px; }
/* .profile: identidad de la cuenta antes del formulario. */
.profile { display: flex; align-items: center; gap: 16px; }
.profile .brand-mark { width: 52px; height: 52px; border-radius: 16px; }
.account .card > h2 { margin-bottom: 8px; }
.account form { display: grid; gap: 20px; margin-top: 24px; }

/* .focus-mode: documento de grabación siempre oscuro. */
.focus-mode {
  color-scheme: dark;
  --bg: #171218;
  --surface: #211B23;
  --surface-soft: #302635;
  --text: #F8EFF6;
  --muted: #C9BBC7;
  --line: #46384A;
  --control: #A18DA4;
  --brand: #FF8AB6;
  --brand-hover: #FFA5C7;
  --brand-active: #EC78A5;
  --brand-ink: #30101E;
  --brand-soft: #452333;
  --brand-soft-hover: #563043;
  --focus: #FFD1E2;
  --success: #7ED9A6;
  --success-bg: #153C2A;
  --warning: #FFD98A;
  --warning-bg: #3D3015;
  --danger: #FF9CAB;
  --danger-bg: #46212B;
  --info: #A6CFEF;
  --info-bg: #1C3446;
  --disabled-bg: #382F3A;
  --disabled-ink: #B8A7B7;
  --spoken: #FFD98A;
  --record: #FF3B30;
  --record-hover: #FF574E;
  --record-ink: #240705;
  background: var(--bg);
  color: var(--text);
}
/* .focus: estudio de voz sin menú lateral ni pestañas inferiores. */
.focus { display: flex; flex-direction: column; width: min(100%, 1120px); min-height: 100dvh; margin: 0 auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
/* .focus-head: salida visible y nombre del video en modo enfoque. */
.focus-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.focus-head h1 { font-size: 18px; line-height: 24px; letter-spacing: -0.02em; }
.focus-head .small { display: block; max-width: 56ch; margin-top: 4px; }
.focus-head .btn { flex-shrink: 0; }
/* .record-state: texto y señal de estado de la grabación. */
.record-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
/* .record-dot: señal roja fija, acompañada por texto. */
.record-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--record); }
/* .phrase-head: número de frase y etiqueta de marca. */
.phrase-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-block: 24px 16px; }
/* .phrase-track: avance entre frases; no representa tiempo de audio. */
.phrase-track { display: flex; gap: 5px; }
.phrase-track span { flex: 1; height: 3px; border-radius: 8px; background: var(--line); }
.phrase-track span[data-done="true"] { background: var(--brand); }
/* .exact: instrucción obligatoria de marca en miel sobre oscuro. */
.exact { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: #FFD98A; color: #422A02; font-size: 14px; line-height: 20px; font-weight: 700; }
.exact .icon { width: 16px; height: 16px; }
/* .reader: teleprompter con altura estable, sin estrechar el texto. */
.reader { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 20px; padding-block: 28px; }
/* .phrase: texto grande de 32 px móvil / 48 px escritorio. */
.phrase { max-width: 28ch; margin-inline: auto; font-size: 32px; line-height: 1.4; font-weight: 600; letter-spacing: -0.025em; text-align: left; overflow-wrap: break-word; }
/* .guia y .ya: guía de ritmo y palabras pintadas por el JS existente. */
.guia { color: var(--text); }
.guia span { transition: color var(--ease); }
.guia .ya, #frase .ya { color: var(--spoken); }
/* .rhythm: estado de ritmo con texto y señal además del color. */
.rhythm { min-height: 24px; color: var(--muted); font-size: 14px; text-align: center; }
.rhythm.ok, #ritmo.ok { color: var(--success); }
.rhythm.bad, #ritmo.bad { color: var(--warning); }
/* .next-phrase: anticipo discreto de la siguiente frase. */
.next-phrase { max-width: 64ch; margin-inline: auto; color: var(--muted); font-size: 14px; text-align: center; }
/* .recorder-controls: controles cercanos al pulgar, con fondo sólido. */
.recorder-controls { position: sticky; bottom: 0; display: grid; justify-items: center; gap: 16px; margin-top: auto; padding-top: 16px; padding-bottom: 8px; background: var(--bg); border-top: 1px solid var(--line); }
/* .phrase-actions: anterior, repetir frase y siguiente, siempre en ese orden. */
.phrase-actions { display: grid; grid-template-columns: 1fr 1.45fr 1fr; gap: 8px; width: min(100%, 560px); }
.phrase-actions .btn { padding-inline: 8px; font-size: 14px; min-height: 52px; }
.phrase-actions .icon { width: 16px; height: 16px; }
/* .mic-row: medidor de entrada con etiqueta explícita. */
.mic-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px; }
/* .meter: pista de nivel de micrófono de 112 × 8 px. */
.meter { width: 112px; height: 8px; overflow: hidden; border: 1px solid var(--control); border-radius: 99px; background: var(--surface); }
/* .meter-fill: nivel que el JavaScript actualiza mediante ancho. */
.meter-fill { display: block; height: 100%; width: 0; background: var(--success); }
/* .record-btn: Grabar/Detener, rojo convencional de 64 px de alto. */
.record-btn { width: min(100%, 320px); min-height: 64px; border-radius: var(--r-round); background: var(--record); border: 1px solid var(--record); color: var(--record-ink); font-size: 20px; line-height: 28px; font-weight: 700; }
.record-btn .icon { width: 24px; height: 24px; }
.record-btn[aria-pressed="true"] { background: var(--record); color: var(--record-ink); }
/* .shortcuts: recordatorio de atajos exclusivo de escritorio. */
.shortcuts { display: none; color: var(--muted); font-size: 12px; text-align: center; }
kbd { padding: 2px 5px; border: 1px solid var(--control); border-radius: 4px; font: inherit; }
/* .review: panel posterior a grabar, abierto con style.display. */
.review { display: none; width: min(100%, 640px); margin: 24px auto; padding: 20px; border: 1px solid var(--control); border-radius: var(--r-lg); background: var(--surface); }
.review audio { margin-block: 16px; }
.review .row { margin-top: 16px; }

@media (hover: hover) {
  .btn:hover:not(:disabled):not([aria-disabled="true"]), .icon-btn:hover:not(:disabled) { background: var(--surface-soft); }
  .btn-primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
  .btn-quiet:hover:not(:disabled) { background: var(--brand-soft); }
  .nav-link:hover:not(.on), .bottom-link:hover:not(.on) { color: var(--text); background: var(--surface-soft); }
  .dropzone:hover:not([aria-disabled="true"]) { border-color: var(--brand); background: var(--brand-soft); }
  .dropzone.encima:hover { border-width: 2px; }
  .file-disclosure > summary:hover, .upload-audio > summary:hover { color: var(--brand); }
  .clip-disclosure > summary:hover { color: var(--brand); }
  .input:hover:not(:disabled) { border-color: var(--brand); }
  .tab:hover:not(:disabled) { color: var(--text); background: var(--surface); }
  .record-btn:hover:not(:disabled) { background: var(--record-hover); border-color: var(--record-hover); }
}

@media (max-width: 359px) {
  .card, .project { padding: 16px; }
  .next-step h2 { font-size: 24px; }
  .phrase-actions { gap: 4px; }
  .phrase-actions .btn { font-size: 12px; gap: 4px; }
  .phrase-actions .icon { width: 12px; height: 12px; }
}
@media (min-width: 600px) {
  .main { padding-inline: 24px; }
  .project { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  .card { padding: 24px; }
  .file-disclosure { padding: 0; }
  .clip-disclosure { padding: 0; }
  .clip-disclosure > summary { padding: 20px 24px; }
  .clips-body { padding: 0 24px 24px; }
  .file-disclosure > summary { padding: 20px 24px; }
  .files-body { padding-inline: 24px; }
  .next-step { padding: 28px 24px; }
  .step-symbol { display: grid; place-items: center; position: absolute; top: 24px; right: 24px; width: 48px; height: 48px; border-radius: 16px; color: var(--brand); background: var(--brand-soft); }
  .next-step h2 { padding-right: 60px; }
  .focus { padding: 24px 32px; }
  .phrase { font-size: 40px; line-height: 1.35; }
}
@media (min-width: 900px) {
  h1 { font-size: var(--text-3xl); }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar); padding: 28px 16px 20px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
  .sidebar .brand { margin: 0 8px 32px; }
  .main { width: calc(100% - var(--sidebar)); margin-left: var(--sidebar); margin-right: 0; padding: 32px 24px 48px; }
  .mobile-brand, .bottom-nav, .mobile-copy { display: none; }
  .desktop-copy { display: inline; }
  .page-head { margin-bottom: 28px; }
  .project { margin-bottom: 24px; }
  .file-list { max-height: 336px; overflow-y: auto; scrollbar-gutter: stable; }
  .file-row { min-height: 48px; }
  .shortcuts { display: block; }
  .focus { padding: 32px 48px; }
  .phrase { font-size: 48px; line-height: 1.35; }
  .reader { min-height: 280px; }
  .focus-head h1 { font-size: 20px; line-height: 28px; }
  .modal { padding: 32px; }
}
@media (min-width: 1200px) {
  .main { padding-inline: 32px; }
  .video-grid { grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); grid-template-areas: "work downloads" "work files"; gap: 24px; }
  .work { grid-area: work; gap: 24px; }
  .downloads { grid-area: downloads; }
  .file-disclosure { grid-area: files; }
  .next-step h2 { font-size: 28px; line-height: 36px; }
}
@media (min-width: 1600px) {
  .main { margin-left: calc(var(--sidebar) + (100% - var(--sidebar) - var(--content) - 64px) / 2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Agregados del panel real (no venían en el mockup) ===================== */
/* Tomas de voz grabadas (grabadora por tomas: cada toma se sube sola) */
.tomas-caja { width: min(100%, 640px); margin: 24px auto 0; }
.tomas-caja h2 { font-size: 18px; line-height: 24px; margin-bottom: 8px; }
.toma { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; align-items: center; padding-block: 12px; border-top: 1px solid var(--line); }
.toma b { font-size: 16px; }
.toma .est { font-size: 14px; color: var(--muted); }
.toma audio { grid-column: 1 / -1; width: 100%; height: 40px; }
#num .ya-grabada { margin-left: 8px; color: var(--success); font-weight: 700; }
/* Formulario «Nuevo video» dentro de la tarjeta del proyecto */
.nuevo > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; color: var(--brand); font-weight: 600; list-style: none; cursor: pointer; }
.nuevo > summary::-webkit-details-marker { display: none; }
.nuevo form { display: grid; gap: 12px; margin-top: 8px; }
/* Versiones anteriores de un video terminado */
.versiones > summary { min-height: 48px; display: flex; align-items: center; color: var(--muted); font-size: 14px; cursor: pointer; }
/* Entrar */
.entrar { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.entrar .card { width: 100%; max-width: 400px; display: grid; gap: 16px; }

/* Opción con casilla o círculo: el texto SIEMPRE junto a su control (no brinca de renglón aunque sea largo) */
.opcion { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 10px; font-weight: 500; line-height: 1.4; cursor: pointer; }
.opcion input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); }
.opcion span { flex: 1 1 auto; min-width: 0; }
