/* ═══════════════════════════════════════════════════════════════════════════
   JellyRequest · Sistema de diseño (ver /opt/jellyrequest/DESIGN.md)
   Tokens + componentes compartidos. CSS plano, sin build.
   Tema oscuro por defecto; tema claro opcional con <html data-theme="light">.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens ──────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  /* Superficies (elevación por luminosidad, no por sombra) */
  --c-bg:        #0B0D17;
  --c-surface-1: #141827;   /* tarjetas, barras */
  --c-surface-2: #1C2133;   /* inputs, elementos elevados */
  --c-surface-3: #262C42;   /* hover / pressed */
  --c-scrim:     rgba(4, 6, 12, 0.72);
  --c-topbar:    rgba(11, 13, 23, 0.84);

  /* Texto */
  --c-text:       #F2F4FA;  /* 16.0:1 sobre surface-1 */
  --c-text-muted: #A3ABC4;  /*  7.7:1 sobre surface-1 */
  --c-on-brand:   #FFFFFF;

  /* Bordes */
  --c-border:        #2E3552;  /* divisores decorativos */
  --c-border-strong: #646F9A;  /* límite de controles ≥3:1 */

  /* Marca: azul → violeta (familia Jellyfin sin copiar sus valores) */
  --c-brand:      #2563EB;     /* blanco encima 5.2:1 */
  --c-brand-2:    #7C3AED;     /* blanco encima 5.7:1 */
  --c-brand-text: #7CB4FF;     /* enlaces/acento como texto */
  --g-brand: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-2) 100%);
  --c-focus:      #60A5FA;

  /* Semánticos (texto claro sobre tinte al 16 %) */
  --c-pending:    #FBBF24;
  --c-success:    #4ADE80;
  --c-danger:     #FCA5A5;
  --c-info:       #93C5FD;
  --c-series:     #C4B5FD;
  --c-danger-solid:  #DC2626;  /* botón destructivo, blanco 4.8:1 */
  --c-success-solid: #047857;  /* botón éxito, blanco 5.5:1 */
  --tint: 16%;

  /* Tipografía — "Modern Dark Cinema (Inter System)" */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 12px;  --fs-sm: 13px;  --fs-md: 14px;  --fs-base: 16px;
  --fs-lg: 18px;  --fs-xl: 22px;  --fs-2xl: 28px; --fs-3xl: 34px;
  --lh-tight: 1.2; --lh-base: 1.5;

  /* Espaciado 4 pt */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Radios */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  --r-poster: 10px;

  /* Sombras (sutiles en oscuro) */
  --sh-1: 0 1px 2px rgba(0,0,0,.35);
  --sh-2: 0 8px 24px rgba(0,0,0,.40);
  --sh-3: 0 20px 48px rgba(0,0,0,.55);
  --sh-brand: 0 6px 20px rgba(37,99,235,.35);
  --ring: 0 0 0 3px rgba(96,165,250,.45);

  /* Movimiento */
  --dur-1: 120ms;  /* press */
  --dur-2: 200ms;  /* hover / estado */
  --dur-3: 320ms;  /* entrada */
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-in:  cubic-bezier(.4,0,1,1);

  /* Layout */
  --tap: 44px;
  --topbar-h: 58px;
  --tabbar-h: 60px;
  --content-w: 1080px;
  --z-sticky: 100; --z-fab: 150; --z-overlay: 200; --z-toast: 300; --z-top: 500;

  /* Alias heredados (las plantillas antiguas usan estos nombres) */
  --bg: var(--c-bg); --surface: var(--c-surface-2); --card: var(--c-surface-1);
  --border: var(--c-border); --accent: var(--c-brand-text); --accent2: var(--c-series);
  --gradient: var(--g-brand); --text: var(--c-text); --muted: var(--c-text-muted);
  --green: var(--c-success); --red: var(--c-danger); --yellow: var(--c-pending);
  --radius: var(--r-md); --shadow: var(--sh-1); --shadow-lg: var(--sh-2);
}

:root[data-theme="light"] {
  color-scheme: light;
  --c-bg:        #F4F6FB;
  --c-surface-1: #FFFFFF;
  --c-surface-2: #EEF1F8;
  --c-surface-3: #E3E8F2;
  --c-scrim:     rgba(15, 20, 35, 0.55);
  --c-topbar:    rgba(255, 255, 255, 0.86);
  --c-text:       #111827;
  --c-text-muted: #4B5470;
  --c-border:        #CDD4E3;
  --c-border-strong: #7C8599;
  --c-brand-text: #1D4ED8;
  --c-focus:      #2563EB;
  --c-pending:    #92400E;
  --c-success:    #166534;
  --c-danger:     #B91C1C;
  --c-info:       #1E40AF;
  --c-series:     #6D28D9;
  --tint: 12%;
  --sh-1: 0 1px 2px rgba(17,24,39,.06);
  --sh-2: 0 8px 24px rgba(17,24,39,.10);
  --sh-3: 0 20px 48px rgba(17,24,39,.18);
  --ring: 0 0 0 3px rgba(37,99,235,.35);
}

/* ── 2. Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html { background: var(--c-bg); }
body {
  background: var(--c-bg); color: var(--c-text);
  font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh-base);
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--c-brand-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, [role="button"], label, summary, select { touch-action: manipulation; }
button:not(:disabled), [role="button"], summary, select, label[for] { cursor: pointer; }
h1, h2, h3, h4 { line-height: var(--lh-tight); font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
::selection { background: rgba(96,165,250,.35); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; border-radius: var(--r-xs); }

[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: var(--sp-4); top: calc(var(--sp-2) + env(safe-area-inset-top));
  z-index: var(--z-top); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: var(--c-surface-2); color: var(--c-text); font-weight: 600;
  transform: translateY(-200%); transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

/* Icono SVG (sprite /static/icons.svg) */
.ico { width: 20px; height: 20px; flex-shrink: 0; fill: currentColor; display: inline-block; vertical-align: middle; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }
.ico-xl { width: 32px; height: 32px; }

.text-muted { color: var(--c-text-muted); font-size: var(--fs-sm); }
.mt-8  { margin-top: var(--sp-2); }
.mt-16 { margin-top: var(--sp-4); }
.tabular { font-variant-numeric: tabular-nums; }

/* ── 3. Layout: topbar, main, tabbar ────────────────────────────────────── */
nav.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: var(--sp-4);
  padding-left: max(var(--sp-4), env(safe-area-inset-left));
  padding-right: max(var(--sp-4), env(safe-area-inset-right));
  padding-top: env(safe-area-inset-top);
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  background: var(--c-topbar);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--c-border);
}
.topbar-logo {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--tap); text-decoration: none; color: var(--c-text);
  font-weight: 800; font-size: var(--fs-lg); letter-spacing: -0.02em;
}
.topbar-logo img { width: 28px; height: 28px; border-radius: 8px; }
.topbar-logo span { color: var(--c-text-muted); font-weight: 600; }
.topbar-nav { display: flex; align-items: center; gap: var(--sp-1); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.topbar-user { font-size: var(--fs-sm); color: var(--c-text-muted); font-weight: 500; }
.navlink {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--tap); min-width: var(--tap); justify-content: center;
  padding: 0 var(--sp-3); border-radius: var(--r-md);
  color: var(--c-text-muted); text-decoration: none; font-size: var(--fs-md); font-weight: 600;
  background: transparent; border: none;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.navlink:hover { color: var(--c-text); background: var(--c-surface-2); }
.navlink[aria-current="page"] { color: var(--c-text); background: var(--c-surface-2); }
.navlink[aria-current="page"] .ico { color: var(--c-brand-text); }

main {
  max-width: var(--content-w); margin: 0 auto;
  padding: var(--sp-6) max(var(--sp-4), env(safe-area-inset-right)) calc(var(--sp-12) + env(safe-area-inset-bottom)) max(var(--sp-4), env(safe-area-inset-left));
}
body.no-topbar main { padding-top: max(var(--sp-6), env(safe-area-inset-top)); }

.tabbar { display: none; }

.hide-mobile { }
@media (max-width: 720px) {
  .hide-mobile { display: none !important; }
  .btn-lbl { display: none; }
  .topbar-nav { display: none; }
  nav.topbar { gap: var(--sp-2); }
  .topbar-logo { font-size: 17px; }

  body.has-tabbar main { padding-bottom: calc(var(--tabbar-h) + var(--sp-8) + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
    padding: 0 max(var(--sp-2), env(safe-area-inset-right)) env(safe-area-inset-bottom) max(var(--sp-2), env(safe-area-inset-left));
    background: var(--c-topbar);
    -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
    border-top: 1px solid var(--c-border);
  }
  .tabbar a {
    flex: 1; min-height: var(--tabbar-h); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    color: var(--c-text-muted); text-decoration: none; font-size: var(--fs-xs); font-weight: 600;
    transition: color var(--dur-2) var(--ease-out);
  }
  .tabbar a .ico { width: 24px; height: 24px; transition: transform var(--dur-1) var(--ease-out); }
  .tabbar a:active .ico { transform: scale(.9); }
  .tabbar a[aria-current="page"] { color: var(--c-text); }
  .tabbar a[aria-current="page"] .ico { color: var(--c-brand-text); }
}
@media (min-width: 721px) { .show-mobile { display: none !important; } }

/* Cabecera de página */
.page-head { display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.page-head h1 { font-size: var(--fs-2xl); font-weight: 800; }
.page-head .page-sub { color: var(--c-text-muted); font-size: var(--fs-md); }
.page-head .page-actions { margin-left: auto; display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.section { margin-bottom: var(--sp-10); }
.section-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.section-head h2 { font-size: var(--fs-lg); font-weight: 700; }
.section-head .count {
  font-size: var(--fs-xs); font-weight: 700; color: var(--c-text-muted);
  background: var(--c-surface-2); border-radius: var(--r-pill); padding: 2px var(--sp-2);
}
.section-head .section-link { margin-left: auto; font-size: var(--fs-sm); font-weight: 600; color: var(--c-brand-text); text-decoration: none; min-height: var(--tap); display: inline-flex; align-items: center; }

/* ── 4. Botones ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-4); border-radius: var(--r-md);
  font-size: var(--fs-md); font-weight: 600; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out),
              color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out), opacity var(--dur-2);
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--c-brand); color: var(--c-on-brand); box-shadow: var(--sh-brand); }
.btn-primary:hover:not(:disabled) { background: #1D4ED8; }
.btn-brand { background: var(--g-brand); color: var(--c-on-brand); box-shadow: var(--sh-brand); }
.btn-secondary, .btn-ghost { background: var(--c-surface-2); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover:not(:disabled), .btn-ghost:hover:not(:disabled) { background: var(--c-surface-3); }
.btn-plain { background: transparent; color: var(--c-text-muted); }
.btn-plain:hover:not(:disabled) { color: var(--c-text); background: var(--c-surface-2); }
.btn-danger { background: var(--c-danger-solid); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B91C1C; }
.btn-success { background: var(--c-success-solid); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: var(--fs-base); padding: 0 var(--sp-6); border-radius: var(--r-lg); }
.btn-sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }  /* solo en escritorio/tablas densas; área real ampliada con ::after */
.btn-sm { position: relative; }
.btn-sm::after { content: ""; position: absolute; inset: -4px; }
.btn-icon { width: var(--tap); padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: jr-spin .7s linear infinite;
}
@keyframes jr-spin { to { transform: rotate(360deg); } }

/* ── 5. Tarjetas y superficies ──────────────────────────────────────────── */
.card {
  background: var(--c-surface-1); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--sh-1);
}
.card-pad-lg { padding: var(--sp-6); }
.card h3 { font-size: var(--fs-base); font-weight: 700; margin-bottom: var(--sp-3); }
.divider { border: none; border-top: 1px solid var(--c-border); margin: var(--sp-5) 0; }

/* ── 6. Póster ──────────────────────────────────────────────────────────── */
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--sp-5) var(--sp-3); }
@media (max-width: 420px) { .poster-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4) var(--sp-2); } }
.poster-row {
  display: flex; gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x proximity;
  padding: var(--sp-1) var(--sp-4) var(--sp-3); margin: 0 calc(-1 * var(--sp-4));
  scroll-padding-left: var(--sp-4); -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.poster-row::-webkit-scrollbar { display: none; }
.poster-row > .poster-card { flex: 0 0 auto; width: 124px; scroll-snap-align: start; }

.poster-card {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-2);
  text-decoration: none; color: inherit; text-align: left;
  background: none; border: none; padding: 0; width: 100%; min-width: 0;
}
.poster-card .poster-hit { position: absolute; inset: 0; z-index: 2; border-radius: var(--r-poster); }
.poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-poster); overflow: hidden;
  background: var(--c-surface-2); box-shadow: var(--sh-1);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.poster::after { /* borde interior sutil para pósters oscuros sobre fondo oscuro */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.poster img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-3) var(--ease-out); }
.poster img.loaded, .poster img[data-loaded] { opacity: 1; }
.poster-ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  color: var(--c-text-muted); background: linear-gradient(160deg, var(--c-surface-3), var(--c-surface-1));
  padding: var(--sp-2); text-align: center; font-size: var(--fs-xs); font-weight: 600;
}
.poster-ph .ico { width: 32px; height: 32px; opacity: .7; }
@media (hover: hover) {
  .poster-card:hover .poster { transform: translateY(-3px); box-shadow: var(--sh-2); }
}
.poster-card:active .poster { transform: scale(.97); }
.poster-card:focus-within .poster { box-shadow: 0 0 0 2px var(--c-focus); }
.poster-top { position: absolute; top: var(--sp-2); left: var(--sp-2); right: var(--sp-2); display: flex; gap: var(--sp-1); flex-wrap: wrap; z-index: 2; }
.poster-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: var(--sp-6) var(--sp-2) var(--sp-2);
  background: linear-gradient(to top, rgba(5,7,14,.92), rgba(5,7,14,0));
  display: flex; align-items: center; gap: var(--sp-1); color: #fff; font-size: var(--fs-xs); font-weight: 600;
}
.poster-title {
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; color: var(--c-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.poster-meta { font-size: var(--fs-xs); color: var(--c-text-muted); display: flex; gap: var(--sp-1); align-items: center; flex-wrap: wrap; }
.poster-card.is-dim .poster img { filter: brightness(.55) saturate(.8); }

/* Sello sobre póster (p. ej. "En Jellyfin") */
.poster-stamp {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: var(--sp-1); white-space: nowrap;
  padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill);
  background: rgba(4,120,87,.92); color: #fff; font-size: var(--fs-xs); font-weight: 700;
  box-shadow: var(--sh-2);
}

/* ── 7. Badges de estado / tipo ─────────────────────────────────────────── */
.badge {
  --b: var(--c-text-muted);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 3px var(--sp-2); border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.3;
  color: var(--b); background: color-mix(in srgb, var(--b) var(--tint), transparent);
}
.badge .ico { width: 14px; height: 14px; }
.badge-pending    { --b: var(--c-pending); }
.badge-downloaded, .badge-success { --b: var(--c-success); }
.badge-rejected, .badge-danger    { --b: var(--c-danger); }
.badge-movie, .badge-info, .badge-jellyfin { --b: var(--c-info); }
.badge-series     { --b: var(--c-series); }
.badge-neutral    { --b: var(--c-text-muted); }
/* Badge sólido sobre imagen (pósters, hero): siempre legible */
.badge-solid { color: #fff; background: rgba(8,10,20,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.badge-solid.badge-pending    { color: #FDE68A; }
.badge-solid.badge-downloaded { color: #86EFAC; }
.badge-solid.badge-rejected   { color: #FECACA; }
.badge-solid.badge-series     { color: #DDD6FE; }
.badge-solid.badge-movie      { color: #BFDBFE; }
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .badge { background: rgba(148,163,184,.14); }
}

/* ── 8. Chips de filtro ─────────────────────────────────────────────────── */
.chip-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.chip-row.is-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-row.is-scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1); flex-shrink: 0;
  min-height: 40px; padding: 0 var(--sp-4); border-radius: var(--r-pill);
  background: var(--c-surface-2); color: var(--c-text-muted); border: 1px solid var(--c-border);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; cursor: pointer; position: relative;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.chip::after { content: ""; position: absolute; inset: -2px 0; } /* hit area ≥44 px */
.chip:hover { color: var(--c-text); border-color: var(--c-border-strong); }
.chip.active, .chip[aria-pressed="true"], .chip[aria-selected="true"] {
  background: var(--c-text); color: var(--c-bg); border-color: var(--c-text);
}

/* ── 9. Formularios ─────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
label, .label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--c-text-muted); margin-bottom: 6px; }
.field > label { margin-bottom: 0; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="search"], textarea, select {
  width: 100%; min-height: var(--tap);
  background: var(--c-surface-2); color: var(--c-text);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-md);
  padding: 10px 14px; font-size: var(--fs-base); /* 16 px: iOS no hace zoom al enfocar */
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-text-muted) 50%), linear-gradient(135deg, var(--c-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--c-brand); flex-shrink: 0; }
textarea { min-height: 88px; resize: vertical; line-height: var(--lh-base); }
input::placeholder, textarea::placeholder { color: var(--c-text-muted); opacity: .75; }
input:focus-visible, textarea:focus-visible, select:focus-visible,
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--c-focus); box-shadow: var(--ring); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--c-danger); }
.field-hint  { font-size: var(--fs-xs); color: var(--c-text-muted); }
.field-error, .form-error {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: var(--fs-sm); color: var(--c-danger); font-weight: 500;
}
.field-error[hidden], .form-error[hidden] { display: none; }
.check-row { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); font-size: var(--fs-md); color: var(--c-text); margin: 0; }

/* Barra de búsqueda */
.searchbar {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--c-surface-2); border: 1px solid var(--c-border-strong); border-radius: var(--r-lg);
  padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-4);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.searchbar:focus-within { border-color: var(--c-focus); box-shadow: var(--ring); }
.searchbar > .ico { color: var(--c-text-muted); }
.searchbar input { flex: 1; min-width: 0; border: none !important; background: transparent !important; box-shadow: none !important; padding: 8px 4px; }
.searchbar .btn { flex-shrink: 0; }

/* Interruptor (switch) accesible sobre checkbox */
.switch { position: relative; display: inline-flex; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--c-surface-3); border: 1px solid var(--c-border-strong); transition: background var(--dur-2) var(--ease-out); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-text); transition: transform var(--dur-2) var(--ease-out); }
.switch input:checked + .track { background: var(--c-brand); border-color: var(--c-brand); }
.switch input:checked + .track::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* Segmentado (pestañas) */
.segmented { display: flex; gap: var(--sp-1); background: var(--c-surface-1); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: var(--sp-1); }
.segmented > button {
  flex: 1; min-height: 40px; border: none; background: transparent; border-radius: var(--r-md);
  color: var(--c-text-muted); font-size: var(--fs-sm); font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.segmented > button[aria-selected="true"], .segmented > button.active { background: var(--c-surface-3); color: var(--c-text); }

/* ── 10. Modales (hoja inferior en móvil) ───────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: var(--z-overlay);
  background: var(--c-scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: var(--sp-4);
}
.modal-overlay.open { display: flex; animation: jr-fade var(--dur-2) var(--ease-out); }
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  background: var(--c-surface-1); border: 1px solid var(--c-border); border-radius: var(--r-xl);
  padding: var(--sp-6); box-shadow: var(--sh-3); overscroll-behavior: contain;
}
.modal-overlay.open .modal { animation: jr-rise var(--dur-3) var(--ease-out); }
.modal h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-4); padding-right: var(--sp-10); }
.modal-close {
  position: absolute; top: var(--sp-2); right: var(--sp-2);
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--c-text-muted); font-size: 20px; line-height: 1;
}
.modal-close:hover { background: var(--c-surface-2); color: var(--c-text); }
.modal-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-5); flex-wrap: wrap; }
@media (max-width: 600px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: none;
    padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
    max-height: calc(92dvh - env(safe-area-inset-top));
  }
  .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--c-border-strong); margin: calc(-1 * var(--sp-3)) auto var(--sp-4); }
  .modal-actions .btn { flex: 1; }
}
@keyframes jr-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes jr-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ── 11. Toast ──────────────────────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px); z-index: var(--z-toast);
  display: flex; align-items: center; gap: var(--sp-2);
  max-width: min(92vw, 440px); width: max-content;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: #F2F4FA; color: #0B0D17; font-size: var(--fs-md); font-weight: 500; line-height: 1.35;
  box-shadow: var(--sh-3); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-in), transform var(--dur-2) var(--ease-in);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); transition-timing-function: var(--ease-out); }
#toast .ico { width: 18px; height: 18px; }
#toast.toast-ok .ico    { color: #047857; }
#toast.toast-error      { background: #7F1D1D; color: #fff; }
#toast.toast-error .ico { color: #FECACA; }
/* Con FAB de chat (sesión iniciada) el toast sube por encima del botón */
body.has-topbar #toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
@media (max-width: 720px) { body.has-tabbar #toast { bottom: calc(var(--tabbar-h) + 88px + env(safe-area-inset-bottom)); } }

/* ── 12. Skeletons ──────────────────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-surface-3) 37%, var(--c-surface-2) 63%);
  background-size: 400% 100%; animation: jr-shimmer 1.4s ease infinite; border-radius: var(--r-sm);
}
.skel-poster { aspect-ratio: 2/3; border-radius: var(--r-poster); }
.skel-line { height: 12px; margin-top: var(--sp-2); }
.skel-line.w-60 { width: 60%; } .skel-line.w-40 { width: 40%; }
.skel-row { height: 72px; border-radius: var(--r-lg); margin-bottom: var(--sp-2); }
@keyframes jr-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── 13. Estados vacío / error ──────────────────────────────────────────── */
.state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4); color: var(--c-text-muted);
}
.state-icon {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--c-surface-2); color: var(--c-text-muted); margin-bottom: var(--sp-1);
}
.state-icon .ico { width: 28px; height: 28px; }
.state-title { color: var(--c-text); font-weight: 700; font-size: var(--fs-base); }
.state-text { font-size: var(--fs-md); max-width: 36ch; }
.state .btn { margin-top: var(--sp-2); }
.state.is-error .state-icon { color: var(--c-danger); background: color-mix(in srgb, var(--c-danger) var(--tint), transparent); }
.state.is-compact { padding: var(--sp-5) var(--sp-3); }
.empty { color: var(--c-text-muted); font-size: var(--fs-md); padding: var(--sp-4); text-align: center; }

/* ── 14. Tablas (admin): tarjetas apiladas en móvil ─────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.req-table, .table { width: 100%; border-collapse: collapse; }
.req-table th, .req-table td, .table th, .table td {
  padding: var(--sp-3); text-align: left; border-bottom: 1px solid var(--c-border);
  font-size: var(--fs-md); vertical-align: middle;
}
.req-table th, .table th { color: var(--c-text-muted); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.req-table tr:last-child td, .table tr:last-child td { border-bottom: none; }
.req-table tbody tr, .table tbody tr { transition: background var(--dur-2); }
@media (hover: hover) { .req-table tbody tr:hover, .table tbody tr:hover { background: color-mix(in srgb, var(--c-surface-2) 60%, transparent); } }
.poster-thumb { width: 40px; height: 60px; object-fit: cover; border-radius: var(--r-xs); background: var(--c-surface-2); display: inline-block; vertical-align: middle; }
@media (max-width: 720px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r-lg);
    padding: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3);
  }
  .table-stack tr:last-child { margin-bottom: 0; }
  .table-stack td {
    border-bottom: 1px solid var(--c-border); padding: var(--sp-2) 0; min-height: var(--tap);
    display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); text-align: right;
  }
  .table-stack td:last-child { border-bottom: none; }
  .table-stack td::before {
    content: attr(data-label); font-size: var(--fs-sm);
    color: var(--c-text-muted); font-weight: 500; flex-shrink: 0; text-align: left;
  }
  .table-stack td[data-label=""]::before, .table-stack td:not([data-label])::before { display: none; }
  .table-stack td.td-primary { font-size: var(--fs-base); font-weight: 700; justify-content: flex-start; text-align: left; }
  .table-stack td.td-primary::before { display: none; }
}

/* Barra de progreso */
.progress { height: 6px; border-radius: var(--r-pill); background: var(--c-surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--g-brand); transition: width .5s var(--ease-out); }

/* ── 15. Chat ───────────────────────────────────────────────────────────── */
.bubble {
  padding: var(--sp-2) var(--sp-3); border-radius: 18px 18px 18px 6px; max-width: 100%;
  background: var(--c-surface-2); color: var(--c-text); border: 1px solid var(--c-border);
  font-size: var(--fs-base); line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap;
}
.bubble-own { background: var(--c-brand); color: #fff; border-color: transparent; border-radius: 18px 18px 6px 18px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--g-brand); color: #fff; font-size: var(--fs-sm); font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── 16. FAB de chat ────────────────────────────────────────────────────── */
.chat-fab {
  position: fixed; z-index: var(--z-fab);
  bottom: calc(var(--sp-5) + env(safe-area-inset-bottom));
  right: calc(var(--sp-5) + env(safe-area-inset-right));
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--g-brand); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37,99,235,.45);
  text-decoration: none; transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.chat-fab .ico { width: 26px; height: 26px; }
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab:active { transform: scale(.95); }
.chat-fab.pulse { animation: chatPulse 1.6s ease-out infinite; }
@keyframes chatPulse {
  0%   { box-shadow: 0 8px 24px rgba(37,99,235,.45), 0 0 0 0 rgba(124,58,237,.55); }
  70%  { box-shadow: 0 8px 24px rgba(37,99,235,.45), 0 0 0 14px rgba(124,58,237,0); }
  100% { box-shadow: 0 8px 24px rgba(37,99,235,.45), 0 0 0 0 rgba(124,58,237,0); }
}
.chat-fab-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--c-danger-solid); color: #fff; border: 2px solid var(--c-bg);
  border-radius: 12px; font-size: var(--fs-xs); font-weight: 700;
  display: none; align-items: center; justify-content: center; line-height: 1;
}
.chat-fab-badge.show { display: flex; }
@media (max-width: 720px) {
  body.has-tabbar .chat-fab { bottom: calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom)); right: calc(var(--sp-4) + env(safe-area-inset-right)); }
}

/* ── 17. Movimiento reducido ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .skel { animation: none; }
}

/* ═══ Fase 2 · Identidad ═══════════════════════════════════════════════════ */

/* ── 18. Transición entre páginas (View Transitions, sin JS) ────────────── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 140ms var(--ease-in) both jr-vt-out; }
  ::view-transition-new(root) { animation: 220ms var(--ease-out) both jr-vt-in; }
  nav.topbar { view-transition-name: jr-topbar; }
  .tabbar    { view-transition-name: jr-tabbar; }
}
@keyframes jr-vt-out { to { opacity: 0; } }
@keyframes jr-vt-in  { from { opacity: 0; transform: translateY(6px); } }

/* ── 19. Titulares de pantalla ──────────────────────────────────────────── */
.display {
  font-size: clamp(28px, 7vw, var(--fs-3xl)); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
}
.lede { color: var(--c-text-muted); font-size: var(--fs-base); margin-top: var(--sp-2); max-width: 60ch; }

/* ── 20. Entrada de cine (solicitud propia) ─────────────────────────────── */
.ticket {
  --notch: 9px; --perf: 62%;
  position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 0 var(--sp-3);
  background: var(--c-surface-1); border: 1px solid var(--c-border); border-radius: var(--r-md);
  padding: var(--sp-3); min-height: 132px;
}
.ticket::before, .ticket::after { /* muescas de la perforación */
  content: ""; position: absolute; top: var(--perf); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2);
  border-radius: 50%; background: var(--c-bg); border: 1px solid var(--c-border); transform: translateY(-50%);
}
.ticket::before { left: calc(-1 * var(--notch) - 1px); clip-path: inset(0 0 0 50%); }
.ticket::after  { right: calc(-1 * var(--notch) - 1px); clip-path: inset(0 50% 0 0); }
.ticket .poster { grid-row: 1 / span 2; align-self: start; width: 72px; }
.ticket-body { min-width: 0; padding-top: 2px; }
.ticket-title { font-weight: 700; font-size: var(--fs-base); line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-sub { color: var(--c-text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.ticket-note { color: var(--c-text-muted); font-size: var(--fs-sm); margin-top: var(--sp-1); font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-foot {
  grid-column: 2; align-self: end; display: flex; align-items: center; gap: var(--sp-2);
  border-top: 2px dashed var(--c-border); padding-top: var(--sp-2); margin-top: var(--sp-2);
}
.ticket-foot .when { color: var(--c-text-muted); font-size: var(--fs-xs); margin-left: auto; white-space: nowrap; }
.ticket-foot .btn-icon { margin: -6px -6px -6px 0; }
.ticket.is-new { animation: jr-ticket-in 900ms var(--ease-out); }
@keyframes jr-ticket-in {
  0% { box-shadow: 0 0 0 0 rgba(96,165,250,0); transform: translateY(-6px); opacity: 0; }
  30% { box-shadow: 0 0 0 3px rgba(96,165,250,.6); transform: none; opacity: 1; }
  100% { box-shadow: 0 0 0 0 rgba(96,165,250,0); }
}
.ticket-list { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ticket-row { display: flex; gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: var(--sp-1) var(--sp-4) var(--sp-3); margin: 0 calc(-1 * var(--sp-4)); scroll-padding-left: var(--sp-4); }
.ticket-row::-webkit-scrollbar { display: none; }
.ticket-row > .ticket { flex: 0 0 min(300px, 82vw); scroll-snap-align: start; }
.ticket-row .ticket::before, .ticket-list .ticket::before { background: var(--c-bg); }

/* ── 21. Like ───────────────────────────────────────────────────────────── */
.like-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); min-width: var(--tap); padding: 0 var(--sp-3); border-radius: var(--r-pill);
  background: var(--c-surface-2); border: 1px solid var(--c-border); color: var(--c-text-muted);
  font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums;
  transition: color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out), border-color var(--dur-2);
}
.like-btn:hover { color: var(--c-text); border-color: var(--c-border-strong); }
.like-btn[aria-pressed="true"] { color: #FDA4AF; background: rgba(244,63,94,.14); border-color: rgba(244,63,94,.35); }
:root[data-theme="light"] .like-btn[aria-pressed="true"] { color: #BE123C; background: rgba(244,63,94,.10); }
.like-btn .ico { width: 18px; height: 18px; }
.like-btn.pop .ico { animation: jr-pop 380ms var(--ease-out); }
@keyframes jr-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
/* Like compacto sobre póster */
.poster .like-btn { position: absolute; right: var(--sp-1); bottom: var(--sp-1); z-index: 3; min-height: 36px; padding: 0 10px;
  background: rgba(8,10,20,.78); border-color: transparent; color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.poster .like-btn::after { content: ""; position: absolute; inset: -4px; }
.poster .like-btn[aria-pressed="true"] { color: #FDA4AF; }

/* ── 22. Hero "recién llegado" ──────────────────────────────────────────── */
.hero { position: relative; width: 100%; border-radius: var(--r-xl); overflow: hidden; background: var(--c-surface-2);
  aspect-ratio: 16 / 10; max-height: 440px; min-height: 220px; box-shadow: var(--sh-2); }
.hero-slides { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-slides::-webkit-scrollbar { display: none; }
.hero-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-3) var(--ease-out); }
.hero-slide img.loaded { opacity: 1; }
.hero-slide::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(8,10,20,.95) 0%, rgba(8,10,20,.55) 45%, rgba(8,10,20,0) 75%); }
.hero-copy { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: var(--sp-5); color: #fff; max-width: 640px; }
.hero-kicker { font-size: var(--fs-sm); font-weight: 600; color: rgba(255,255,255,.8); display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-1); }
.hero-title { font-size: clamp(24px, 6.4vw, 40px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-overview { font-size: var(--fs-md); color: rgba(255,255,255,.82); margin-top: var(--sp-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 52ch; }
.hero-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); align-items: center; }
.btn-light { background: #fff; color: #0B0D17; }
.btn-light:hover:not(:disabled) { background: #E5E7EB; }
.hero-ctrl { position: absolute; top: var(--sp-3); right: var(--sp-3); z-index: 2; display: flex; gap: var(--sp-1); align-items: center;
  background: rgba(8,10,20,.6); border-radius: var(--r-pill); padding: 2px 2px 2px var(--sp-3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero-ctrl .hero-count { color: #fff; font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-ctrl button { width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.hero-ctrl button::after { content: ""; position: absolute; inset: -4px; }
.hero-ctrl button:hover { background: rgba(255,255,255,.14); }
@media (min-width: 721px) { .hero { aspect-ratio: 21 / 9; } }

/* Atajos (fila discreta de enlaces) */
.shortcuts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.shortcut { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 var(--sp-4);
  border-radius: var(--r-pill); background: var(--c-surface-1); border: 1px solid var(--c-border); color: var(--c-text);
  text-decoration: none; font-size: var(--fs-md); font-weight: 600; transition: background var(--dur-2), border-color var(--dur-2); }
.shortcut:hover { background: var(--c-surface-2); border-color: var(--c-border-strong); }
.shortcut .ico { color: var(--c-brand-text); }

/* Aviso en línea (caducidad, info) */
.notice { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  --n: var(--c-info); color: var(--c-text); background: color-mix(in srgb, var(--n) 12%, transparent); border: 1px solid color-mix(in srgb, var(--n) 30%, transparent); font-size: var(--fs-md); }
.notice > .ico { color: var(--n); margin-top: 1px; }
.notice.is-warn { --n: var(--c-pending); } .notice.is-danger { --n: var(--c-danger); } .notice.is-ok { --n: var(--c-success); }
.notice strong { font-weight: 700; }

@media (prefers-reduced-motion: reduce) { .ticket.is-new, .like-btn.pop .ico { animation: none; } }
.poster.img-error img { display: none; }

.meta-line { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.meta-line > span { display: inline-flex; align-items: center; gap: 6px; }
section[id], [id].section { scroll-margin-top: calc(var(--topbar-h) + var(--sp-4) + env(safe-area-inset-top)); }

/* ═══ Fase 3 · Auditoría (web-design-guidelines) ═══════════════════════════ */
/* Que la topbar sticky, la tab bar y el FAB no tapen el elemento enfocado */
html { scroll-padding-top: calc(var(--topbar-h) + env(safe-area-inset-top) + var(--sp-2)); scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (max-width: 720px) { html { scroll-padding-bottom: calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom)); } }
/* <select> nativo: colores explícitos (modo oscuro de Windows) */
select option { background-color: var(--c-surface-1); color: var(--c-text); }
/* Estados hover que faltaban */
.segmented > button:hover { color: var(--c-text); background: var(--c-surface-2); }
.segmented > button[aria-selected="true"]:hover, .segmented > button.active:hover { background: var(--c-surface-3); }
/* Casilla con área táctil compartida (≥44 px) */
.check-hit { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); margin: -10px; cursor: pointer; }
