/* Medescripts — la app. Base clara premium (tokens en base.css) + modo cine para heros y pósters.
   ------------------------------------------------------------------------------------------------
   CLASES PÚBLICAS (las usan las vistas de todos los agentes; no renombrar):
   .cine            superficie negro cálido (#0D0B0A) con texto marfil; dentro: .eyebrow-brick, .btn.white, .btn.ghost-light
   .hero            cabecera cinematográfica (grid póster + texto); .hero-bg para la imagen de fondo desenfocada
   .poster          tarjeta 2:3 (radio 18, sombra larga); .poster img, .poster .poster-title, .poster .poster-meta, .poster.add
   .ep-card         tarjeta 9:16 de episodio; .ep-card img, .ep-card .ep-num, .ep-card .ep-title, .ep-card.pending
   .fila            fila horizontal con scroll (snap); .fila-head (título + acción a la derecha)
   .panel           tarjeta clara de trabajo (padding 28, grid con gap); .panel .lead
   .steps / .step   stepper horizontal; .step[aria-current="step"], .step.done
   .stages / .stage estados de carga por etapas (.stage.on, .stage.done); genera app.js → stagesUI()
   .chips / .chip   (base.css) selección múltiple con aria-pressed
   .seg             (base.css) segmentado
   .btn             (base.css) + variantes .blue .ghost .white .lg .sm .block; aquí: .brick, .ghost-light, .danger
   .field / .input  (base.css) formularios; aquí: .inline (campo editable sin borde), .grid2, .grid3, .row-actions, .row-center
   .card            (base.css) superficie blanca; aquí: .card.pad, .card.soft
   .banner          aviso en línea (.warn, .brick, .cine)
   .toast           aviso flotante (lo crea app.js → toast())
   .sheet / .sheet-bg hoja modal (app.js → sheet()); .sheet.wide
   .tabs            pestañas; .tabs button[aria-selected="true"]
   .thumbs / .thumb miniaturas de fotos subidas (.thumb .x borrar, .thumb .bar progreso, .thumb .lbl)
   .char-card       tarjeta de personaje editable; .char-card .avatar-ph (foto o inicial)
   .plan-grid / .plan-card planes; .plan-card.featured, .plan-card.academy
   .kv .meter .acct .stats .stat table.t .tablewrap  (cuenta y admin)
   .script-paper + .beat .line-dlg .line-action .line-screen .sect .copy-block .timeline  (render.js del guion)
   .side .fit .actions-grid .tweaks .checks  (barra lateral del guion)
   .prompter        teleprompter a pantalla completa
   .empty           estado vacío; .empty.cine
   .eyebrow / .eyebrow-brick   antetítulo pequeño en mayúsculas
   .display         tipografía Archivo 800 para títulos de serie
   ------------------------------------------------------------------------------------------------ */

:root {
  --cine: #0D0B0A;
  --cine-2: #1A1512;
  --cine-3: #26201C;
  --cine-ink: #F4EFE6;
  --cine-muted: rgba(244, 239, 230, 0.62);
  --cine-faint: rgba(244, 239, 230, 0.38);
  --cine-line: rgba(255, 255, 255, 0.10);
  --brick: #E8492B;
  --brick-2: #C93A1F;
  --brick-soft: #FDEBE6;
  --display: "Archivo", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --topbar: 60px;
  --shadow-cine: 0 30px 70px -24px rgba(13, 11, 10, 0.75), 0 8px 24px -8px rgba(13, 11, 10, 0.35);
}

body.app { min-height: 100dvh; display: flex; flex-direction: column; }
.display { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; line-height: 0.98; }
.hide { display: none !important; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar); display: flex; align-items: center; gap: 14px;
  padding: 0 max(var(--gutter), env(safe-area-inset-left)) 0 max(var(--gutter), env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
}
.lockup { display: inline-flex; align-items: baseline; gap: 8px; color: var(--ink); text-decoration: none !important; white-space: nowrap; }
.lockup .logo-mark { width: 28px; height: 28px; align-self: center; flex: none; }
.lockup-name { font-weight: 800; letter-spacing: -0.03em; font-size: 19px; }
.lockup-by { font-size: 12.5px; font-weight: 700; color: var(--brick); letter-spacing: -0.005em; }
.lockup-by i { color: var(--faint); font-style: normal; margin-right: 2px; }
.lockup-mini b { color: var(--brick); font-weight: 700; }
.topbar nav { display: flex; gap: 2px; margin-left: 10px; }
.topbar nav a {
  height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px;
  color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none !important;
}
.topbar nav a:hover { background: rgba(0, 0, 0, 0.05); }
.topbar nav a[aria-current="page"] { background: rgba(0, 0, 0, 0.07); color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.quota { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: linear-gradient(135deg, #0a66ff, #8e5cf5); color: #fff; font-weight: 700; font-size: 14px;
}

/* ---------- Barra inferior (móvil) ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topbar { height: 54px; }
  .topbar nav, .topbar .quota { display: none; }
  /* Medeflix aparece siempre: en móvil el lockup se apila (nombre arriba, "by Medeflix" debajo). */
  .lockup { display: grid; grid-template-columns: 28px auto; column-gap: 8px; row-gap: 0; align-items: center; }
  .lockup .logo-mark { grid-row: 1 / span 2; }
  .lockup-name { font-size: 17px; line-height: 1.05; }
  .lockup-by { font-size: 10.5px; line-height: 1.1; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--muted); padding: 4px; text-decoration: none !important; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  main.view { padding-bottom: 96px !important; }
}

/* ---------- Contenido ---------- */
main.view { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px var(--gutter) 56px; min-width: 0; }
main.view:focus { outline: none; }
.view-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head h1 { font-size: clamp(28px, 4vw, 40px); }
.view-head p { color: var(--muted); margin-top: 6px; font-size: 17px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.no-caps { text-transform: none; letter-spacing: 0.02em; }
.eyebrow-brick { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brick); }
.app-foot {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: center;
  padding: 20px var(--gutter) 28px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); text-align: center;
}
.app-foot a { color: var(--muted); }
/* La tabbar fija mide ~72 px (+ safe area): el pie necesita ese hueco debajo para que © y Términos/Privacidad no queden tapados.
   Va después de la regla base de .app-foot (misma especificidad) para que gane. */
@media (max-width: 760px) { .app-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }
.row-actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.row-center { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* Botones extra */
.btn.brick { background: var(--brick); color: #fff; }
.btn.brick:hover { background: var(--brick-2); }
.btn.ghost-light { background: rgba(255, 255, 255, 0.12); color: var(--cine-ink); }
.btn.ghost-light:hover { background: rgba(255, 255, 255, 0.2); }
.btn.danger { background: rgba(229, 72, 77, 0.1); color: var(--bad); }
.btn.danger:hover { background: rgba(229, 72, 77, 0.18); }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card.pad { padding: 24px; }
.card.soft { box-shadow: none; border: 1px solid var(--line); }
.link-quiet { color: var(--muted); font-size: 14px; }
.link-quiet:hover { color: var(--ink); }

/* Campo editable sin borde (biblia, personajes) */
.inline {
  width: 100%; border: 0; border-bottom: 1px dashed transparent; background: transparent; padding: 2px 0; border-radius: 0;
  font: inherit; color: inherit; outline: none; transition: border-color 0.15s, background 0.15s; resize: none; line-height: 1.45;
}
.inline:hover { border-bottom-color: var(--line-2); }
.inline:focus { border-bottom-color: var(--accent); background: rgba(10, 102, 255, 0.04); }
.inline.h { font-weight: 700; font-size: 17px; }
textarea.inline { min-height: 44px; field-sizing: content; }
.cine .inline:hover { border-bottom-color: var(--cine-line); }
.cine .inline:focus { border-bottom-color: var(--cine-ink); background: rgba(255, 255, 255, 0.05); }

/* ---------- Modo cine ---------- */
.cine {
  background: var(--cine); color: var(--cine-ink);
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(232, 73, 43, 0.14), transparent 55%), radial-gradient(90% 80% at 0% 100%, rgba(10, 102, 255, 0.12), transparent 55%);
}
.cine h1, .cine h2, .cine h3 { color: var(--cine-ink); }
.cine .muted { color: var(--cine-muted); }
.cine a:not(.btn) { color: var(--cine-ink); }
.cine .pill { background: rgba(255, 255, 255, 0.1); color: var(--cine-ink); }
.cine .btn.white { background: var(--cine-ink); color: var(--cine); box-shadow: none; }
.cine .btn.white:hover { background: #fff; }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; isolation: isolate;
  padding: clamp(24px, 4vw, 44px);
  display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: clamp(20px, 3.5vw, 44px); align-items: center;
  box-shadow: var(--shadow-cine);
}
.hero-bg { position: absolute; inset: -10%; z-index: -1; opacity: 0.45; filter: blur(42px) saturate(120%); background-size: cover; background-position: center; transform: scale(1.1); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(13, 11, 10, 0.75), rgba(13, 11, 10, 0.35) 60%, rgba(13, 11, 10, 0.6)); pointer-events: none; }
.hero .poster { width: 100%; max-width: 220px; }
.hero-body { display: grid; gap: 14px; min-width: 0; }
.hero-body h1 { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; line-height: 0.98; font-size: clamp(32px, 5.2vw, 64px); overflow-wrap: anywhere; }
.hero-body .tagline { font-size: clamp(17px, 1.6vw, 21px); color: var(--cine-muted); line-height: 1.4; max-width: 60ch; }
.hero-body .logline { font-size: 15.5px; color: var(--cine-muted); line-height: 1.5; max-width: 70ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.hero-chips { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; border-radius: 22px; padding: 22px 18px 24px; }
  .hero .poster { max-width: 150px; margin: 0 auto; }
  .hero-body { text-align: center; justify-items: center; }
  .hero-actions, .hero-chips { justify-content: center; }
  .hero-actions .btn { flex: 1 1 140px; }
}

/* Póster 2:3 */
.poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: 18px; overflow: hidden; display: block; color: var(--cine-ink); text-decoration: none !important;
  background: var(--cine-2);
  background-image: radial-gradient(90% 70% at 20% 0%, rgba(232, 73, 43, 0.35), transparent 60%), radial-gradient(80% 60% at 100% 100%, rgba(10, 102, 255, 0.35), transparent 60%), linear-gradient(160deg, #2a221d, #0D0B0A);
  box-shadow: 0 24px 50px -20px rgba(13, 11, 10, 0.7), 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  flex: none;
}
a.poster:hover, button.poster:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 36px 70px -24px rgba(13, 11, 10, 0.8), 0 4px 12px rgba(0, 0, 0, 0.14); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 11, 10, 0) 35%, rgba(13, 11, 10, 0.88)); pointer-events: none; }
.poster .poster-title {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1;
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; font-size: clamp(17px, 2vw, 22px);
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.poster .poster-meta { position: absolute; left: 14px; right: 14px; top: 12px; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; font-size: 11.5px; font-weight: 600; }
.poster .poster-meta span { background: rgba(13, 11, 10, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 4px 8px; border-radius: 999px; }
.poster .poster-meta .ready { background: rgba(31, 164, 91, 0.75); }
.poster .poster-tag { position: absolute; left: 14px; bottom: calc(14px + 2.3em * 1.5); z-index: 1; font-size: 12px; color: var(--cine-muted); font-weight: 600; }
/* Póster CSS que genera render.js → posterHTML(): --hue por nombre, grano, brillo, nombre en Archivo y "by Medeflix". */
.poster { --hue: 20; }
.poster.is-css {
  background-image: radial-gradient(90% 70% at 20% 0%, hsl(var(--hue) 70% 46% / 0.6), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, hsl(calc(var(--hue) + 50) 70% 42% / 0.5), transparent 60%),
    linear-gradient(160deg, #2a221d, #0D0B0A);
}
.poster-grain { position: absolute; inset: 0; opacity: 0.22; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E"); }
.poster-glow { position: absolute; left: -20%; right: -20%; bottom: -25%; height: 65%; pointer-events: none; filter: blur(22px);
  background: radial-gradient(closest-side, hsl(var(--hue) 85% 58% / 0.55), transparent); }
.poster-name {
  position: absolute; left: 14px; right: 14px; bottom: 34px; z-index: 1;
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; font-size: clamp(18px, 2.2vw, 24px);
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; color: var(--cine-ink);
}
.poster-name.is-long { font-size: clamp(15px, 1.8vw, 19px); }
.poster-name.is-wide { font-size: clamp(15px, 1.9vw, 20px); letter-spacing: -0.04em; }
.poster-by { position: absolute; left: 14px; bottom: 12px; z-index: 1; font-size: 10.5px; font-weight: 700; color: var(--brick); letter-spacing: 0.01em; }
.poster-sm { width: 132px; } .poster-md { width: 184px; } .poster-lg { width: 240px; }
.poster-sm .poster-name { font-size: 15px; bottom: 28px; } .poster-sm .poster-by { font-size: 9.5px; bottom: 10px; }
.poster-lg .poster-name { font-size: clamp(22px, 2.6vw, 30px); }
.poster-wrap .poster, .hero .poster { width: 100%; }
.poster .poster-tag { bottom: auto; top: 12px; left: 14px; z-index: 1; font-size: 11.5px; font-weight: 700; color: var(--cine-muted); background: rgba(13, 11, 10, 0.5); padding: 4px 8px; border-radius: 999px; }

.poster.add { background: #fff; color: var(--ink); border: 1.5px dashed var(--line-2); box-shadow: none; display: grid; place-items: center; text-align: center; padding: 16px; font-weight: 600; font-size: 14.5px; gap: 8px; }
.poster.add::after { display: none; }
.poster.add:hover { border-color: var(--accent); color: var(--accent); transform: none; box-shadow: none; }
.poster.add .plus { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 26px; font-weight: 300; line-height: 1; }
.poster-wrap { width: 184px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; flex: none; scroll-snap-align: start; }
.poster-wrap > * { min-width: 0; max-width: 100%; }
.poster-wrap .poster-link, .hero .poster-link { display: block; width: 100%; min-width: 0; text-decoration: none !important; }
.hero .poster-link { max-width: 220px; }
.poster-link .poster { width: 100%; height: auto; }
.poster-wrap .under { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; padding: 0 2px; }
.poster-wrap .under b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .poster-wrap { width: 148px; } }

/* Tarjeta de episodio 9:16 */
.ep-card {
  position: relative; aspect-ratio: 9 / 16; width: 164px; border-radius: 16px; overflow: hidden; flex: none; scroll-snap-align: start;
  display: block; color: var(--cine-ink); text-decoration: none !important;
  background: linear-gradient(165deg, #2b2320 0%, #0D0B0A 70%);
  box-shadow: 0 18px 40px -18px rgba(13, 11, 10, 0.6);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.ep-card:hover { transform: translateY(-3px); box-shadow: 0 28px 50px -20px rgba(13, 11, 10, 0.7); }
.ep-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 11, 10, 0.1), rgba(13, 11, 10, 0) 30%, rgba(13, 11, 10, 0.9)); pointer-events: none; }
.ep-card .ep-num { position: absolute; top: 12px; left: 12px; z-index: 1; font: 700 12px/1 var(--mono); background: rgba(13, 11, 10, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 6px 8px; border-radius: 8px; letter-spacing: 0.02em; }
.ep-card .ep-title { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; display: grid; gap: 4px; }
.ep-card .ep-title b { font-family: var(--display); font-weight: 800; letter-spacing: -0.025em; line-height: 1.02; font-size: 17px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ep-card .ep-title small { color: var(--cine-muted); font-size: 11.5px; font-weight: 600; }
.ep-card.pending .ep-num { background: rgba(255, 159, 10, 0.75); }
.ep-card .ep-glyph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 72px; color: rgba(244, 239, 230, 0.07); letter-spacing: -0.05em; }
@media (max-width: 640px) { .ep-card { width: 138px; } }

/* Filas horizontales */
.fila-sec { margin-top: 34px; }
.fila-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fila-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.fila-head a, .fila-head button.link-btn { font-size: 14px; font-weight: 600; }
.fila {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: visible; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  padding: 6px var(--gutter) 22px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none;
}
.fila::-webkit-scrollbar { display: none; }
.fila > * { flex: none; }

/* Tarjeta Academia (modo cine, rojo ladrillo) */
.academy-card {
  border-radius: 24px; padding: clamp(22px, 3vw, 34px); display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; overflow: hidden; position: relative;
  background-image: radial-gradient(90% 120% at 100% 0%, rgba(232, 73, 43, 0.42), transparent 60%), radial-gradient(70% 80% at 0% 100%, rgba(232, 73, 43, 0.12), transparent 60%);
  box-shadow: var(--shadow-cine);
}
.academy-card h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; font-size: clamp(24px, 3vw, 34px); line-height: 1; }
.academy-card p { color: var(--cine-muted); margin-top: 8px; max-width: 56ch; font-size: 15.5px; }
.academy-card .mods { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.academy-card .mods span { font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, 0.08); padding: 5px 10px; border-radius: 999px; color: var(--cine-ink); }
@media (max-width: 640px) { .academy-card { grid-template-columns: 1fr; } .academy-card .btn { width: 100%; } }

/* Tarjeta de acceso secundario (Guion rápido) */
.quiet-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 16px 20px; border-radius: 18px; border: 1px solid var(--line); background: #fff; flex-wrap: wrap; }
.quiet-card b { font-size: 15px; }
.quiet-card p { color: var(--muted); font-size: 14px; }

/* ---------- Estados ---------- */
.empty { text-align: center; padding: 64px 20px; color: var(--muted); border-radius: 28px; }
.empty h2 { color: var(--ink); font-size: clamp(26px, 3.6vw, 40px); margin-bottom: 10px; letter-spacing: -0.03em; }
.empty p { max-width: 54ch; margin: 0 auto; font-size: 16.5px; line-height: 1.5; }
.empty .btn { margin-top: 22px; }
.empty.cine { padding: clamp(48px, 8vw, 96px) 20px; box-shadow: var(--shadow-cine); }
.empty.cine h2 { color: var(--cine-ink); font-family: var(--display); font-weight: 800; font-size: clamp(32px, 5vw, 60px); line-height: 0.98; margin: 14px auto 16px; max-width: 18ch; }
.empty.cine p { color: var(--cine-muted); }
.empty.cine .row-center .btn { margin-top: 0; }
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: 16px; background: var(--accent-soft); color: var(--ink); margin-bottom: 20px; flex-wrap: wrap; font-size: 15px; }
.banner.warn { background: var(--hook-soft); }
.banner.brick { background: var(--brick-soft); }
.banner.cine { color: var(--cine-ink); }
.skeleton { display: grid; gap: 12px; }
.skeleton i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #ececf0 0%, #f7f7f9 50%, #ececf0 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skeleton i.tall { height: 220px; border-radius: 22px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Etapas de carga */
.stages { display: grid; gap: 6px; padding: 8px 0; }
.stages-title { font-weight: 700; font-size: 17px; margin-bottom: 8px; letter-spacing: -0.015em; }
.stages ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stage { display: flex; gap: 12px; align-items: center; color: var(--faint); font-size: 15px; font-weight: 500; transition: color 0.3s; }
.stage i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; transition: all 0.3s; }
.stage.on { color: var(--ink); font-weight: 600; }
.stage.on i { border-color: var(--accent); border-right-color: transparent; animation: spin 0.9s linear infinite; }
.stage.done { color: var(--muted); }
.stage.done i { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.cine .stage { color: var(--cine-faint); }
.cine .stage.on { color: var(--cine-ink); }
.cine .stage.done { color: var(--cine-muted); }
.cine .stage i { border-color: var(--cine-line); }
.cine .stage.on i { border-color: var(--cine-ink); border-right-color: transparent; }
.working { display: grid; gap: 18px; justify-items: center; text-align: center; padding: 28px 12px; }
.working .stages { text-align: left; }
.working .tip { color: var(--muted); font-size: 14.5px; max-width: 46ch; min-height: 44px; transition: opacity 0.4s; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite var(--ease); }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100dvh - var(--topbar) - 120px); display: grid; place-items: center; padding: 16px 0; }
.auth { width: 100%; max-width: 440px; padding: 36px 28px 30px; }
@media (max-width: 480px) { .auth { padding: 28px 20px 24px; } }
.auth .lockup-mini { display: block; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 14px; letter-spacing: -0.01em; }
.auth h1 { font-size: 30px; text-align: center; letter-spacing: -0.03em; }
.auth .sub { text-align: center; color: var(--muted); margin: 8px 0 26px; }
.auth form { display: grid; gap: 14px; }
.auth .alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.form-error { color: var(--bad); font-size: 14px; min-height: 20px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* ---------- Planes ---------- */
.plans-head { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.plans-head h1 { font-size: clamp(30px, 4.5vw, 48px); letter-spacing: -0.035em; }
.plans-head p { color: var(--muted); font-size: 17.5px; margin-top: 10px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; align-items: stretch; }
.plan-card { padding: 28px 26px; position: relative; display: grid; gap: 14px; align-content: start; }
.plan-card .badge { position: absolute; top: 18px; right: 18px; }
.plan-card h2 { font-size: 22px; letter-spacing: -0.02em; }
.plan-card .who { color: var(--muted); font-size: 14.5px; margin-top: -8px; min-height: 2.8em; }
.plan-card .price { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; }
.plan-card .price b { font-size: 46px; letter-spacing: -0.045em; line-height: 1; }
.plan-card .price span { color: var(--muted); font-size: 14px; }
.plan-card .ticks { margin: 6px 0 10px; }
.plan-card.featured { box-shadow: 0 0 0 2px var(--accent), var(--shadow-l); }
.plan-card.current { box-shadow: 0 0 0 2px var(--ok), var(--shadow); }
.plan-card.academy { background-image: radial-gradient(100% 120% at 100% 0%, rgba(232, 73, 43, 0.45), transparent 60%); }
.plan-card.academy .price b, .plan-card.academy h2 { color: var(--cine-ink); }
.plan-card.academy .price span, .plan-card.academy .who, .plan-card.academy .ticks li { color: var(--cine-muted); }
.plan-card.academy .ticks li::before { background-color: rgba(255, 255, 255, 0.12); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.6' fill='none' stroke='%23F4EFE6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.plan-card .cta { margin-top: auto; }
.ticks { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 11px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.ticks li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.6' fill='none' stroke='%231fa45b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.ticks li.off { color: var(--faint); }
.ticks li.off::before { background: rgba(0, 0, 0, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6.5 10h7' stroke='%23a1a1a6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.plans-foot { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 22px; max-width: 70ch; margin-left: auto; margin-right: auto; line-height: 1.55; }

/* ---------- Asistente (nueva serie, guion rápido) ---------- */
.wizard { display: grid; gap: 18px; }
.steps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.steps::-webkit-scrollbar { display: none; }
.step {
  display: inline-flex; align-items: center; gap: 9px; border: 0; background: none; padding: 8px 14px 8px 8px; border-radius: 999px; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; flex: none; transition: all 0.2s var(--ease);
}
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.06); font-size: 12.5px; font-weight: 700; }
.step[aria-current="step"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.step[aria-current="step"] .n { background: var(--ink); color: #fff; }
.step.done .n { background: var(--ok); color: #fff; }
.step:disabled { cursor: default; opacity: 0.7; }
@media (max-width: 640px) { .step span.lbl { display: none; } .step[aria-current="step"] span.lbl, .step.done span.lbl { display: inline; } .step { padding-right: 10px; } }
.panel { padding: 28px; display: grid; gap: 22px; }
.panel h2 { font-size: 24px; letter-spacing: -0.025em; }
.panel .lead { color: var(--muted); margin-top: -14px; font-size: 15.5px; }
.panel h3 { font-size: 16px; letter-spacing: -0.01em; }
.panel .sub-sec { display: grid; gap: 12px; }
@media (max-width: 640px) { .panel { padding: 20px 16px; border-radius: 18px; } .panel h2 { font-size: 22px; } }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.brand-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.brand-pick button {
  text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 14px; padding: 14px; cursor: pointer;
  display: grid; gap: 2px; transition: all 0.15s; min-width: 0;
}
.brand-pick button b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-pick button span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-pick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 102, 255, 0.15); }
.brand-pick .new { border-style: dashed; color: var(--accent); font-weight: 600; place-items: center; min-height: 64px; }

.formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.formats button {
  text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 16px; padding: 16px; cursor: pointer;
  display: grid; gap: 6px; transition: all 0.15s var(--ease); min-width: 0;
}
.formats button:hover { border-color: var(--ink-2); }
.formats button b { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.formats button span { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.formats button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.formats .emoji { font-size: 20px; }

.dur-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dur-custom { width: 110px; }
.dur-hint { font-size: 13.5px; color: var(--muted); }
.mic-wrap { position: relative; }
.mic { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.06); cursor: pointer; display: grid; place-items: center; }
.mic.on { background: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0.15); } }
.idea-sparks { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-sparks button { border: 1px dashed var(--line-2); background: none; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); text-align: left; }
.idea-sparks button:hover { border-color: var(--accent); color: var(--accent); }
.summary { display: flex; flex-wrap: wrap; gap: 8px; }

/* Fotos subidas */
.upload-zone { display: grid; gap: 12px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--bg-2); }
.upload-zone.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone .uz-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.upload-zone .uz-head b { font-size: 15px; }
.upload-zone .uz-head p { font-size: 13.5px; color: var(--muted); }
.upload-zone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #e9e9ee; box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(13, 11, 10, 0.65); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.thumb .x:hover { background: var(--bad); }
.thumb .lbl { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: 11.5px; font-weight: 600; color: #fff; background: linear-gradient(180deg, transparent, rgba(13, 11, 10, 0.8)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.4); }
.thumb .bar i { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.thumb.uploading img { filter: grayscale(0.4) brightness(0.8); }
.thumb.err { outline: 2px solid var(--bad); }

/* Personajes */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.char-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 10px; background: #fff; box-shadow: var(--shadow); min-width: 0; }
.char-card .char-head { display: flex; gap: 12px; align-items: center; }
.char-card .avatar-ph { width: 52px; height: 52px; border-radius: 14px; flex: none; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #2b2320, #0D0B0A); color: var(--cine-ink); font-family: var(--display); font-weight: 800; font-size: 22px; }
.char-card .avatar-ph img { width: 100%; height: 100%; object-fit: cover; }
.char-card .char-head > div { min-width: 0; flex: 1; display: grid; gap: 2px; }
.char-card .k { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: -4px; }
.char-card .role { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.char-card select.input { padding: 8px 12px; font-size: 14px; }
.engine-box { padding: 18px 20px; border-radius: 18px; background: var(--cine); color: var(--cine-ink); display: grid; gap: 6px; background-image: radial-gradient(100% 120% at 100% 0%, rgba(10, 102, 255, 0.25), transparent 60%); }
.engine-box .k { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cine-muted); }
.engine-box textarea.inline { font-size: 17px; line-height: 1.45; font-weight: 500; }

/* Biblia */
.bible { display: grid; gap: 18px; }
.bible .sec { display: grid; gap: 8px; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.bible .sec .k { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bible ul.editlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bible ul.editlist li { display: flex; gap: 8px; align-items: flex-start; }
.bible ul.editlist li::before { content: "•"; color: var(--faint); margin-top: 2px; }
.season-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.season-ep { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 6px; background: #fff; min-width: 0; }
.season-ep .num { font: 700 12px/1 var(--mono); color: var(--muted); }
.season-ep .guest { font-size: 13px; color: var(--muted); }
.season-ep .guest b { color: var(--ink-2); font-weight: 600; }
.name-ideas { display: grid; gap: 8px; }
.name-ideas button { text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 14px; padding: 12px 16px; cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.name-ideas button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 20px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.cine .tabs { border-bottom-color: var(--cine-line); }
.cine .tabs button { color: var(--cine-muted); }
.cine .tabs button[aria-selected="true"] { color: var(--cine-ink); border-bottom-color: var(--cine-ink); }

/* ---------- Vista del guion (render.js) ---------- */
.script-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .script-layout { grid-template-columns: 1fr; } }
.script-paper { padding: 40px 44px 48px; min-width: 0; }
@media (max-width: 640px) { .script-paper { padding: 26px 18px 32px; border-radius: 0; margin: 0 calc(-1 * var(--gutter)); box-shadow: none; } }
.script-paper .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.script-paper h1 { font-size: clamp(28px, 4vw, 38px); overflow-wrap: anywhere; }
.logline { font-size: 18px; color: var(--ink-2); margin-top: 10px; line-height: 1.45; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; margin: 22px 0 6px; font-size: 14.5px; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dt { margin-top: 8px; } }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; }
.timeline { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 26px 0 4px; }
.timeline i { display: block; background: #d9dbe1; }
.timeline i.h { background: var(--hook); }
.timeline i.s { background: var(--sell); }
.timeline i.e { background: var(--accent); }
.timeline-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.timeline-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--c); }
.beat { margin-top: 30px; }
.beat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tc { font: 600 12.5px/1 var(--mono); color: var(--muted); background: rgba(0, 0, 0, 0.05); padding: 6px 8px; border-radius: 7px; }
.beat-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.beat.is-hook .beat-label { color: #b45f00; }
.beat.is-hook .tc { background: var(--hook-soft); color: #b45f00; }
.beat.is-sell .beat-label { color: var(--sell); }
.beat.is-sell .tc { background: var(--sell-soft); color: var(--sell); }
.line-action { color: var(--muted); font-style: italic; margin: 8px 0; font-size: 15.5px; }
.line-screen { display: inline-block; margin: 6px 0; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 15px; background: #1d1d1f; color: #fff; letter-spacing: -0.01em; }
.line-dlg { display: grid; grid-template-columns: 128px 1fr; gap: 14px; margin: 10px 0; }
@media (max-width: 640px) { .line-dlg { grid-template-columns: 1fr; gap: 2px; } }
.line-dlg .who { font-size: 12.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding-top: 3px; color: var(--c, var(--ink-2)); }
.line-dlg .who small { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: 12px; font-style: italic; }
.line-dlg .say { font-size: 17.5px; line-height: 1.55; color: var(--ink); }
.line-note { color: var(--muted); font-size: 15px; margin: 8px 0; }
.sect { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.sect h3 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.sect ul, .sect ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.sect p { white-space: pre-wrap; }
.copy-block { background: var(--bg); border-radius: 14px; padding: 16px 18px; white-space: pre-wrap; font-size: 15.5px; position: relative; overflow-wrap: anywhere; }

.side { position: sticky; top: calc(var(--topbar) + 20px); display: grid; gap: 14px; }
@media (max-width: 1000px) { .side { position: static; } }
.side .card { padding: 20px; }
.side h4 { font-size: 15px; margin-bottom: 12px; }
.fit { display: grid; gap: 10px; }
.fit-bar { height: 10px; border-radius: 5px; background: rgba(0, 0, 0, 0.06); position: relative; overflow: hidden; }
.fit-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--ok); }
.fit-bar.over i { background: var(--warn); }
.fit-row { display: flex; justify-content: space-between; font-size: 14px; gap: 10px; align-items: center; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions-grid .btn { height: 40px; font-size: 14px; padding: 0 12px; }
.tweaks { display: flex; flex-wrap: wrap; gap: 6px; }
.tweaks button { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; }
.tweaks button:hover { border-color: var(--accent); color: var(--accent); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks li i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; font-style: normal; font-size: 11px; display: grid; place-items: center; margin-top: 1px; }
.checks li.off i { background: #d1d1d6; }

/* Lista de guiones rápidos */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lib-item { padding: 18px; display: grid; gap: 8px; cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s; text-decoration: none !important; color: inherit; min-width: 0; }
.lib-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-l); }
.lib-item h3 { font-size: 17px; overflow-wrap: anywhere; }
.lib-item p { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-item .meta { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Hoja modal y aviso ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(13, 11, 10, 0.4); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade 0.2s both; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 620px; max-height: calc(100dvh - 32px); overflow: auto; padding: 28px; animation: rise 0.35s var(--ease) both; }
.sheet.wide { max-width: 920px; }
.sheet h2 { font-size: 24px; margin-bottom: 18px; letter-spacing: -0.025em; }
.sheet form { display: grid; gap: 14px; }
@media (max-width: 480px) { .sheet { padding: 22px 18px; } .sheet-bg { padding: 10px; align-items: end; } }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90;
  background: var(--cine); color: var(--cine-ink); padding: 12px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 500;
  box-shadow: var(--shadow-l); animation: rise 0.3s var(--ease) both; max-width: calc(100vw - 32px); text-align: center;
}
@media (max-width: 760px) { .toast { bottom: calc(92px + env(safe-area-inset-bottom)); } }

/* ---------- Teleprompter ---------- */
.prompter { position: fixed; inset: 0; z-index: 80; background: #000; color: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.prompter header, .prompter footer { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; }
.prompter .scroll { overflow: hidden; position: relative; }
.prompter .text { padding: 45vh 8vw; font-size: clamp(30px, 5vw, 56px); line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
.prompter .text .who { color: #ffb340; font-size: 0.5em; letter-spacing: 0.1em; text-transform: uppercase; display: block; margin-top: 1.2em; }
.prompter .text .act { color: #8e8e93; font-style: italic; font-size: 0.55em; display: block; margin-top: 0.8em; }
.prompter .guide { position: absolute; left: 0; right: 0; top: 40%; height: 2px; background: rgba(255, 179, 64, 0.5); pointer-events: none; }
.prompter.mirror .text { transform: scaleX(-1); }
.prompter .btn.ghost { background: rgba(255, 255, 255, 0.12); color: #fff; }
.prompter .clock { font: 600 15px var(--mono); color: #8e8e93; }

/* ---------- Cuenta y admin ---------- */
.acct { display: grid; gap: 16px; max-width: 760px; }
.acct .card { padding: 24px; display: grid; gap: 14px; }
.acct h2 { font-size: 20px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; flex-wrap: wrap; }
.kv span { color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.07); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s var(--ease); }
.meter.brick i { background: var(--brick); }
.ref-box { display: flex; gap: 8px; }
.ref-box .input { font-family: var(--mono); font-size: 14px; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 18px; }
.stat b { display: block; font-size: 30px; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 13px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.tablewrap { overflow-x: auto; padding: 8px 16px; -webkit-overflow-scrolling: touch; }

/* Nada se sale en 360 px */
img, video { max-width: 100%; }
.panel, .card, .hero, .empty { min-width: 0; }
pre, code { overflow-wrap: anywhere; white-space: pre-wrap; }

/* Aviso fijo dentro de una pestaña (p. ej. imágenes pausadas): se queda hasta que la vista se vuelve a pintar. */
.notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; font-size: 14px; line-height: 1.45; }
.cine .notice { background: rgba(244, 239, 230, 0.08); border-color: rgba(244, 239, 230, 0.2); color: var(--cine-ink); }
