/* MiCartelera 4 · Sistema de diseño "Dark Premium"
   Tokens → base → layout → componentes → vistas. Todo color, radio, sombra y espacio sale de :root. */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geist-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geist-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0B0D12;
  --surface: #151922;
  --card: #1B202B;
  --card-hover: #212736;
  --elevated: #20263300;
  --border: #2A303C;
  --border-soft: #20252F;
  --text: #F1F3F5;
  --text-2: #9299A6;
  --text-3: #6B7280;
  --accent: #7C83FF;
  --accent-hover: #959BFF;
  --accent-text: #B5B9FF;
  --accent-soft: rgba(124, 131, 255, 0.14);
  --accent-ring: rgba(124, 131, 255, 0.5);
  --on-accent: #0B0D12;
  --success: #3DBE8B;
  --success-soft: rgba(61, 190, 139, 0.14);
  --warning: #F0A040;
  --warning-soft: rgba(240, 160, 64, 0.14);
  --danger: #EF5B5B;
  --danger-soft: rgba(239, 91, 91, 0.14);
  --star: #F5C451;
  --overlay: rgba(5, 6, 10, 0.72);
  --glass: rgba(11, 13, 18, 0.72);
  --hero-fade: linear-gradient(180deg, rgba(11, 13, 18, 0) 0%, rgba(11, 13, 18, 0.55) 45%, #0B0D12 100%);
  --hero-side: linear-gradient(90deg, rgba(11, 13, 18, 0.92) 0%, rgba(11, 13, 18, 0.55) 55%, rgba(11, 13, 18, 0.1) 100%);
  --skeleton: #1F2430;
  --skeleton-shine: #272D3A;

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.875rem;
  --fs-lg: 1rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.625rem;
  --fs-3xl: 2.25rem;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.7);

  --sidebar-w: 236px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 56px;
  --tabbar-h: 62px;
  --content-max: 1480px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 140ms;
  --t-theme: 0.3s;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #F4F5F7;
  --surface: #FAFAFB;
  --card: #FDFDFE;
  --card-hover: #F3F4F7;
  --border: #E1E4EA;
  --border-soft: #ECEEF2;
  --text: #11141B;
  --text-2: #586070;
  --text-3: #858C99;
  --accent: #5B62EE;
  --accent-hover: #4A51DF;
  --accent-text: #4148C9;
  --accent-soft: rgba(91, 98, 238, 0.1);
  --accent-ring: rgba(91, 98, 238, 0.4);
  --on-accent: #FDFDFE;
  --success: #1E9A6A;
  --success-soft: rgba(30, 154, 106, 0.12);
  --warning: #C77812;
  --warning-soft: rgba(199, 120, 18, 0.12);
  --danger: #D64545;
  --danger-soft: rgba(214, 69, 69, 0.1);
  --star: #D99A0B;
  --overlay: rgba(17, 20, 27, 0.4);
  --glass: rgba(244, 245, 247, 0.78);
  --hero-fade: linear-gradient(180deg, rgba(244, 245, 247, 0) 0%, rgba(244, 245, 247, 0.5) 45%, #F4F5F7 100%);
  --hero-side: linear-gradient(90deg, rgba(10, 12, 18, 0.88) 0%, rgba(10, 12, 18, 0.5) 55%, rgba(10, 12, 18, 0.05) 100%);
  --skeleton: #E7E9EE;
  --skeleton-shine: #F1F2F5;
  --shadow-sm: 0 1px 2px rgba(17, 20, 27, 0.06);
  --shadow-md: 0 10px 30px -14px rgba(17, 20, 27, 0.18);
  --shadow-lg: 0 30px 80px -24px rgba(17, 20, 27, 0.28);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: 'ss01', 'tnum' 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t-theme) ease, color var(--t-theme) ease;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: var(--r-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-weight: 600; transition: top var(--t-fast); }
.skip-link:focus { top: 12px; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; align-items: center; gap: var(--s2); }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.icon { flex: none; }

/* Scrollbars discretas */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ---------- 3. Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns 0.22s var(--ease); }
.app.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s3) var(--s3) var(--s4);
  background: var(--surface); border-right: 1px solid var(--border-soft);
  transition: background-color var(--t-theme) ease, border-color var(--t-theme) ease;
  overflow-y: auto; overflow-x: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; margin-bottom: var(--s3); font-weight: 650; letter-spacing: -0.01em; font-size: 15px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--accent) 0%, #A78BFA 100%); color: #fff; box-shadow: 0 6px 16px -6px var(--accent-ring); }
.brand-name small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding: var(--s4) 10px var(--s1); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; transition: background-color var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item[aria-current='page'] { background: var(--accent-soft); color: var(--text); }
.nav-item[aria-current='page'] .icon { color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s1); padding-top: var(--s3); border-top: 1px solid var(--border-soft); }
.app.is-collapsed .brand-name, .app.is-collapsed .nav-text, .app.is-collapsed .nav-label, .app.is-collapsed .nav-item .count, .app.is-collapsed .kbd-hint { display: none; }
.app.is-collapsed .nav-item { justify-content: center; padding: 0; }
.app.is-collapsed .brand { justify-content: center; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s6); background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; min-width: 0; }
.topbar-title .crumb { color: var(--text-3); font-weight: 500; }
.search-trigger {
  margin-left: auto; display: flex; align-items: center; gap: 10px; width: min(420px, 40vw); height: 36px; padding: 0 10px 0 12px;
  border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--border); color: var(--text-3); cursor: pointer;
  transition: border-color var(--t-fast), background-color var(--t-theme);
}
.search-trigger:hover { border-color: var(--text-3); }
.search-trigger span.grow { text-align: left; }
.kbd { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); font-size: 11px; font-family: var(--font); color: var(--text-2); }
#main:focus { outline: none; }
.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--s6) var(--s6) var(--s12); }
.page-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--s4); margin-bottom: var(--s5); }
.page-head h1 { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }

.tabbar { display: none; }
.mobile-only, .topbar-settings { display: none !important; }
.card-head:has(+ .rail-wrap) .link, .section-head:has(+ .rail-wrap) > :last-child:not(.grow) { margin-right: 76px; }

/* ---------- 4. Componentes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--card); color: var(--text); font-weight: 550; font-size: var(--fs-md); cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--card-hover); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
label.btn:focus-within { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 6px 18px -8px var(--accent-ring); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--card); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.btn.success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: var(--fs-lg); }
.icon-btn { width: 36px; padding: 0; flex: none; }
.icon-btn.sm { width: 30px; }
.btn .spin, .spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip.exclude[aria-pressed='mixed'] { background: var(--danger-soft); border-color: var(--danger); color: var(--text); text-decoration: line-through; text-decoration-color: var(--danger); }
.chip img { width: 18px; height: 18px; border-radius: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-soft); }
.segmented button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-weight: 550; font-size: var(--fs-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background-color var(--t-fast), color var(--t-fast); }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed='true'] { background: var(--card-hover); color: var(--text); box-shadow: var(--shadow-sm); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--card-hover); color: var(--text-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.solid { background: var(--glass); color: var(--text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border); }

.card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--r-lg); transition: background-color var(--t-theme), border-color var(--t-theme); }
.card.pad { padding: var(--s5); }
.card-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); }
.card-head h2, .card-head h3 { font-size: var(--fs-lg); font-weight: 620; letter-spacing: -0.01em; }
.card-head .icon { color: var(--text-3); }
.card-head .link { margin-left: auto; color: var(--text-2); font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 2px 4px; }
.card-head .link:hover { color: var(--text); }

.section { margin-top: var(--s8); }
.section-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.section-head h2 { font-size: var(--fs-xl); font-weight: 630; letter-spacing: -0.02em; }
.section-head .grow + * { margin-left: auto; }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-theme);
}
.textarea { height: auto; min-height: 140px; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); }
.field small { color: var(--text-3); }
input[type='range'] { width: 100%; accent-color: var(--accent); }
input[type='color'] { width: 44px; height: 38px; padding: 3px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 20px; background: var(--border); position: relative; flex: none; transition: background-color var(--t-fast); }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform var(--t-fast) var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--on-accent); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

/* Póster */
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: var(--s5) var(--s4); }
.poster-grid.dense { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: var(--s4) var(--s3); }
.poster { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; border-radius: var(--r-md); }
.poster-img {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--skeleton); border: 1px solid var(--border-soft);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
.poster-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s var(--ease); }
.poster-img .fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--text-3); font-size: var(--fs-sm); font-weight: 550; }
/* Sin transform en .poster-img: crearía un contexto de apilamiento y el enlace taparía el botón rápido. */
.poster:hover .poster-img { box-shadow: var(--shadow-md); border-color: var(--text-3); }
.poster:hover .poster-img img { transform: scale(1.045); }
.poster-link { position: absolute; inset: 0; z-index: 1; border-radius: var(--r-md); }
.poster-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 4px; z-index: 2; pointer-events: none; }
.poster-top .logos { display: flex; gap: 3px; }
.poster-top .logos img { width: 22px; height: 22px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.poster-quick { position: absolute; right: 8px; bottom: 8px; z-index: 3; opacity: 0; transform: translateY(4px); transition: opacity var(--t-fast), transform var(--t-fast); }
.poster:hover .poster-quick, .poster:focus-within .poster-quick { opacity: 1; transform: none; }
.poster-quick .btn { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.poster-state { position: absolute; left: 8px; bottom: 8px; z-index: 2; pointer-events: none; }
.poster-title { font-weight: 560; font-size: var(--fs-md); line-height: 1.3; }
.poster-meta { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-sm); margin-top: 2px; }
.poster-meta .score { display: inline-flex; align-items: center; gap: 3px; color: var(--text); font-weight: 560; }
.poster-meta .score .icon { color: var(--star); }
.poster.is-dimmed .poster-img { opacity: 0.45; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: var(--s4); overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 10px; margin: -4px -2px 0; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail.wide { grid-auto-columns: 280px; }
.rail-wrap { position: relative; }
.rail-nav { position: absolute; top: -48px; right: 0; display: flex; gap: 4px; }

.score-ring { --v: 70; position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring-color, var(--success)) calc(var(--v) * 1%), var(--border) 0); flex: none; }
.score-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.score-ring span { position: relative; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.score-ring small { position: absolute; bottom: -18px; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

.stars { display: inline-flex; gap: 2px; }
.stars button { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--text-3); display: grid; place-items: center; border-radius: 6px; }
.stars button.on { color: var(--star); }
.stars button:hover { background: var(--card-hover); }

.skeleton { position: relative; overflow: hidden; background: var(--skeleton); border-radius: var(--r-sm); }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; border-radius: 6px; }

.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3); text-align: center; padding: var(--s10) var(--s6); border: 1px dashed var(--border); border-radius: var(--r-lg); color: var(--text-2); }
.state .state-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--card-hover); color: var(--text-2); }
.state.error .state-icon { background: var(--danger-soft); color: var(--danger); }
.state h3 { color: var(--text); font-size: var(--fs-lg); font-weight: 600; }
.state p { max-width: 46ch; }
.state.compact { padding: var(--s6) var(--s4); }
.card .state { border: 0; padding-left: 0; padding-right: 0; }
.card > .state { height: 100%; }

.dialog {
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 24px)); max-height: min(86dvh, 820px);
}
.dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop 0.18s var(--ease); display: flex; flex-direction: column; }
.dialog.wide { width: min(880px, calc(100vw - 24px)); }
.dialog-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border-soft); }
.dialog-head h2 { font-size: var(--fs-lg); font-weight: 620; }
.dialog-head .btn { margin-left: auto; }
.dialog-body { padding: var(--s5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--s4); }
.dialog-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s4) var(--s5); border-top: 1px solid var(--border-soft); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } }

.menu { position: absolute; z-index: 40; min-width: 210px; padding: 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop 0.14s var(--ease); }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; color: var(--text); font-size: var(--fs-md); }
.menu button:hover, .menu button:focus-visible { background: var(--card-hover); outline: none; }
.menu button[aria-checked='true'] { color: var(--accent-text); }
.menu hr { border: 0; border-top: 1px solid var(--border-soft); margin: 4px 2px; }
.menu-anchor { position: relative; display: inline-flex; }

.toaster { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop 0.2s var(--ease); font-weight: 500; }
.toast .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast .btn { margin-left: auto; }

.progress { height: 6px; border-radius: 6px; background: var(--border); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #A78BFA); transition: width 0.4s var(--ease); }
.logo-sm { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.logo-md { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.divider { height: 1px; background: var(--border-soft); margin: var(--s4) 0; }
.tag { font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }

/* Paleta de comandos (estilo Raycast) */
.palette { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding-top: 11vh; background: var(--overlay); backdrop-filter: blur(4px); animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.palette-box { width: min(660px, calc(100vw - 24px)); max-height: 72dvh; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.16s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--border-soft); color: var(--text-3); }
.palette-input input { flex: 1; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--text); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; color: var(--text); }
.palette-item[aria-selected='true'] { background: var(--accent-soft); }
.palette-item img, .palette-item .ph { width: 30px; height: 44px; border-radius: 5px; object-fit: cover; flex: none; background: var(--skeleton); }
.palette-item .ph.round, .palette-item img.round { width: 36px; height: 36px; border-radius: 50%; }
.palette-item .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--card-hover); color: var(--text-2); flex: none; }
.palette-item small { color: var(--text-3); }
.palette-item .hint { margin-left: auto; color: var(--text-3); font-size: 12px; }
.palette-foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--border-soft); color: var(--text-3); font-size: 12px; }

/* ---------- 5. Vistas ---------- */
/* Inicio · Bento */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); grid-auto-flow: row dense; }
.tile { grid-column: span 6; min-width: 0; }
.tile.w12 { grid-column: span 12; }
.tile.w8 { grid-column: span 8; }
.tile.w7 { grid-column: span 7; }
.tile.w5 { grid-column: span 5; }
.tile.w4 { grid-column: span 4; }
.tile.h2 { grid-row: span 2; }
.tile.card { padding: var(--s5); display: flex; flex-direction: column; }
.greeting { margin-bottom: var(--s5); }
.greeting h1 { font-size: var(--fs-3xl); font-weight: 680; letter-spacing: -0.035em; line-height: 1.1; }
.greeting p { color: var(--text-2); margin-top: 6px; font-size: var(--fs-lg); }

.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); min-height: 360px; display: flex; border: 1px solid var(--border-soft); background: var(--card); }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: var(--hero-side); }
.hero-body { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s3); padding: var(--s6); max-width: 560px; color: #F4F5F8; }
.hero-body h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
.hero-body p { color: rgba(244, 245, 248, 0.78); }
.hero-body .badge { background: rgba(255, 255, 255, 0.12); color: #F4F5F8; }
.hero-body .btn:not(.primary) { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.18); color: #F4F5F8; }
.hero-list { position: relative; z-index: 1; margin-left: auto; width: 270px; padding: var(--s4); display: flex; flex-direction: column; gap: 4px; background: rgba(8, 10, 14, 0.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-left: 1px solid rgba(255, 255, 255, 0.06); color: #F4F5F8; overflow-y: auto; }
.hero-list h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(244, 245, 248, 0.6); margin-bottom: 4px; padding: 0 6px; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 9px; min-height: 52px; transition: background-color var(--t-fast); }
.mini-item:hover { background: rgba(255, 255, 255, 0.08); }
.mini-item img, .mini-item .ph { width: 32px; height: 48px; border-radius: 5px; object-fit: cover; flex: none; background: rgba(255, 255, 255, 0.08); }
.mini-item .t { font-weight: 560; font-size: var(--fs-md); line-height: 1.25; }
.mini-item small { display: block; font-size: 12px; opacity: 0.7; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 10px; min-height: 56px; transition: background-color var(--t-fast); }
.list-row:hover { background: var(--card-hover); }
.list-row img, .list-row .ph { width: 36px; height: 54px; border-radius: 6px; object-fit: cover; background: var(--skeleton); flex: none; }
.list-row .rank { width: 22px; text-align: center; font-weight: 700; font-size: 17px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.list-row .t { font-weight: 560; }
.list-row small { display: block; color: var(--text-2); font-size: 12.5px; }
.list-row .end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--surface); min-height: 86px; transition: border-color var(--t-fast), background-color var(--t-fast); }
.week-day:hover { border-color: var(--text-3); }
.week-day .wd { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 600; }
.week-day .dn { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.week-day .n { font-size: 11.5px; color: var(--text-2); }
.week-day.is-today { border-color: var(--accent); background: var(--accent-soft); }
.week-day .bar { width: 70%; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.week-day .bar i { display: block; height: 100%; background: var(--accent); }

/* Calendario */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s4); }
.toolbar .spacer { flex: 1; }
.date-nav { display: inline-flex; align-items: center; gap: 4px; }
.date-nav .label { min-width: 190px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s3); align-items: start; }
.cal-col { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.cal-col-head { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 2; display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-soft); }
.cal-col-head .dn { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-col-head .wd { font-size: 12px; color: var(--text-2); text-transform: capitalize; }
.cal-col-head .n { margin-left: auto; font-size: 11px; color: var(--text-3); }
.cal-col.is-today .cal-col-head { border-color: var(--accent); background: var(--accent-soft); }
.cal-col.is-past { opacity: 0.72; }
.cal-card { position: relative; display: flex; gap: 10px; padding: 8px 26px 8px 8px; border-radius: 11px; background: var(--card); border: 1px solid var(--border-soft); transition: border-color var(--t-fast), transform var(--t-fast), background-color var(--t-theme); min-height: 72px; }
.cal-card:hover { border-color: var(--border); transform: translateY(-1px); }
.cal-card img, .cal-card .ph { width: 40px; height: 60px; border-radius: 6px; object-fit: cover; flex: none; background: var(--skeleton); }
.cal-card .t { font-weight: 580; font-size: 13px; line-height: 1.25; }
.cal-card .k { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.cal-card .k .badge { height: 19px; font-size: 10.5px; padding: 0 6px; }
.cal-card .logos { position: absolute; right: 6px; top: 8px; display: flex; flex-direction: column; gap: 3px; }
.cal-card .logos img { width: 16px; height: 16px; border-radius: 4px; }
.cal-card.followed { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.cal-card .fol { position: absolute; bottom: 6px; right: 6px; color: var(--accent); }
.cal-empty { padding: 14px 10px; border-radius: 10px; border: 1px dashed var(--border-soft); color: var(--text-3); font-size: 12px; text-align: center; }
.agenda { display: flex; flex-direction: column; gap: var(--s6); }
.agenda-day h3 { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-lg); font-weight: 620; margin-bottom: var(--s3); text-transform: capitalize; }
.agenda-day h3 small { color: var(--text-3); font-weight: 500; font-size: var(--fs-sm); text-transform: none; }
.agenda-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s3); }
.day-feature { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s4); }
.feature-card { position: relative; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--border-soft); background: var(--card); display: flex; flex-direction: column; transition: transform 0.2s var(--ease), border-color 0.2s; }
.feature-card:hover { transform: translateY(-2px); border-color: var(--border); }
.feature-card .bd { position: relative; aspect-ratio: 16 / 8; background: var(--skeleton); }
.feature-card .bd img { width: 100%; height: 100%; object-fit: cover; }
.feature-card .bd .badge { position: absolute; left: 10px; top: 10px; }
.feature-card .bd .logos { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; }
.feature-card .bd .logos img { width: 26px; height: 26px; border-radius: 7px; }
.feature-card .body { padding: var(--s4); display: flex; flex-direction: column; gap: 6px; }
.feature-card .body h3 { font-size: var(--fs-lg); font-weight: 620; }

/* Explorar */
.filters { display: grid; gap: var(--s4); padding: var(--s5); margin-bottom: var(--s5); }
.filters .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s4); }
.filter-group > .tag { display: block; margin-bottom: 8px; }
.result-meta { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--s3); }

/* Ficha */
.detail-hero { position: relative; margin: calc(var(--s6) * -1) calc(var(--s6) * -1) 0; min-height: 420px; display: flex; align-items: flex-end; overflow: hidden; }
.detail-hero .bg { position: absolute; inset: 0; }
.detail-hero .bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.detail-hero .bg::after { content: ''; position: absolute; inset: 0; background: var(--hero-fade); }
.detail-hero .inner { position: relative; z-index: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--s12) var(--s6) var(--s6); display: flex; gap: var(--s6); align-items: flex-end; }
.detail-poster { width: 210px; flex: none; aspect-ratio: 2 / 3; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); background: var(--skeleton); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; padding-bottom: 4px; }
.detail-info h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 720; letter-spacing: -0.035em; line-height: 1.05; }
.detail-info .orig { color: var(--text-2); font-size: var(--fs-md); }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); }
.meta-line .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.ratings { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5); margin: 4px 0 14px; }
.ext-rating { display: flex; flex-direction: column; gap: 1px; }
.ext-rating b { font-size: 17px; font-weight: 680; font-variant-numeric: tabular-nums; }
.ext-rating span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.action-bar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s6); margin-top: var(--s6); align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: var(--s6); min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: var(--s4); position: sticky; top: calc(var(--topbar-h) + 16px); }
.overview { font-size: 15.5px; line-height: 1.65; color: var(--text); max-width: 72ch; }
.tagline { color: var(--text-2); font-style: italic; margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s4); }
.fact span { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.fact b { font-weight: 560; }
.where-row { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 10px; min-height: 48px; }
.where-row.mine { background: var(--accent-soft); }
.where-row .grow small { display: block; color: var(--text-3); font-size: 12px; }
.where-row a.btn { flex: none; }
.cast-card { display: flex; flex-direction: column; gap: 6px; }
.cast-card .ph, .cast-card img { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: var(--skeleton); border: 1px solid var(--border-soft); }
.cast-card .t { font-weight: 560; font-size: 13px; text-align: center; line-height: 1.25; }
.cast-card small { color: var(--text-2); font-size: 12px; text-align: center; display: block; }
.rail.cast { grid-auto-columns: 112px; }
.trailer { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #000; border: 1px solid var(--border-soft); }
.trailer iframe { width: 100%; height: 100%; border: 0; }
.trailer button { position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; background: transparent; color: #fff; display: grid; place-items: center; }
.trailer button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.trailer button .play { position: relative; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.3); transition: transform var(--t-fast); }
.trailer button:hover .play { transform: scale(1.06); }
.masonry { columns: 2 320px; column-gap: var(--s4); }
.masonry > * { break-inside: avoid; margin-bottom: var(--s4); }
.review { padding: var(--s4); }
.review p { white-space: pre-line; color: var(--text); line-height: 1.6; }
.review .who { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.review .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 650; font-size: 13px; }
.season-bar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s3); }
.episode { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 10px; border-radius: 11px; border: 1px solid var(--border-soft); background: var(--card); }
.episode + .episode { margin-top: 6px; }
.episode .num { font-weight: 650; color: var(--text-3); font-variant-numeric: tabular-nums; text-align: center; }
.episode .t { font-weight: 570; }
.episode small { color: var(--text-2); }
.episode.watched { opacity: 0.66; }
.episode.future .num { color: var(--warning); }
.check-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text-3); transition: all var(--t-fast); }
.check-btn:hover { border-color: var(--success); color: var(--success); }
.check-btn.on { background: var(--success); border-color: var(--success); color: #fff; }
.check-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Persona */
.person-head { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s6); align-items: start; margin-bottom: var(--s6); }
.person-head .photo { aspect-ratio: 2 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--skeleton); border: 1px solid var(--border-soft); }
.person-head .photo img { width: 100%; height: 100%; object-fit: cover; }
.bio { color: var(--text); line-height: 1.65; max-width: 80ch; white-space: pre-line; }

/* Cines */
.cinema-tabs { margin-bottom: var(--s4); }
.film-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--s4); padding: var(--s4); }
.film-row .p { aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--skeleton); border: 1px solid var(--border-soft); }
.film-row .p img { width: 100%; height: 100%; object-fit: cover; }
.film-row h3 { font-size: var(--fs-lg); font-weight: 630; letter-spacing: -0.01em; }
.film-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: var(--s4); }
.cin-line { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.cin-line .name { display: flex; align-items: center; gap: 6px; min-width: 132px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); padding-top: 5px; }
.times { display: flex; flex-wrap: wrap; gap: 6px; }
.time { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast); }
a.time:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.time.past { opacity: 0.38; text-decoration: line-through; }
.time.soon { border-color: var(--success); color: var(--success); }
.cinema-manage .list-row .dot { width: 12px; height: 12px; }

/* Siguiendo / biblioteca */
.follow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s4); }
.follow-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--s4); padding: var(--s4); }
.follow-card .p { aspect-ratio: 2 / 3; border-radius: 9px; overflow: hidden; background: var(--skeleton); }
.follow-card .p img { width: 100%; height: 100%; object-fit: cover; }
.follow-card h3 { font-size: var(--fs-lg); font-weight: 620; line-height: 1.25; }
.follow-card .next { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.stat { padding: var(--s4); }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-2); font-size: var(--fs-sm); }
.import-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 8px; border-radius: 10px; border: 1px solid var(--border-soft); }
.import-row img, .import-row .ph { width: 44px; height: 66px; border-radius: 6px; object-fit: cover; background: var(--skeleton); }
.import-row.off { opacity: 0.45; }
.code { font-family: var(--mono); font-size: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--border-soft); overflow-x: auto; white-space: pre; color: var(--text-2); }

/* Ajustes */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; }
.settings-section { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.settings-section + .settings-section { margin-top: var(--s5); }
.provider-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s2); }
.provider-pick button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 11px; border: 1px solid var(--border-soft); background: var(--surface); cursor: pointer; text-align: left; transition: border-color var(--t-fast), background-color var(--t-fast); }
.provider-pick button:hover { border-color: var(--text-3); }
.provider-pick button[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.provider-pick button .icon:last-child { margin-left: auto; color: var(--accent); }
.widget-row { display: flex; align-items: center; gap: var(--s2); padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--surface); }
.widget-row + .widget-row { margin-top: 6px; }
.health { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.health .dot.ok { background: var(--success); }
.health .dot.ko { background: var(--danger); }
.health .dot.off { background: var(--text-3); }
.setup { max-width: 760px; margin: var(--s8) auto; }
.setup ol { padding-left: 1.2em; display: flex; flex-direction: column; gap: 10px; line-height: 1.6; }
.attribution { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; color: var(--text-3); font-size: 12px; margin-top: var(--s10); padding-top: var(--s4); border-top: 1px solid var(--border-soft); }

/* ---------- 6. Responsive ---------- */
@media (max-width: 1280px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .tile.w8, .tile.w7 { grid-column: span 12; }
  .tile.w5, .tile.w4 { grid-column: span 6; }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .app .brand-name, .app .nav-text, .app .nav-label, .app .nav-item .count, .app .kbd-hint { display: none; }
  .app .nav-item { justify-content: center; padding: 0; }
  .app .brand { justify-content: center; padding: 0; }
  .collapse-btn { display: none !important; }
  .cal-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 860px) {
  :root { --fs-md: 0.9375rem; }
  .app, .app.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 var(--s4); gap: var(--s2); }
  .search-trigger { width: auto; flex: 1; }
  .topbar-title { display: none; }
  .search-trigger .kbd { display: none; }
  .content { padding: var(--s4) var(--s4) calc(var(--tabbar-h) + var(--s8) + env(safe-area-inset-bottom)); }
  .mobile-only { display: grid !important; }
  .topbar-settings { display: inline-flex !important; }
  .rail-nav { display: none; }
  .card-head:has(+ .rail-wrap) .link, .section-head:has(+ .rail-wrap) > :last-child:not(.grow) { margin-right: 0; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-top: 1px solid var(--border-soft);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--text-3); min-height: 44px; }
  .tabbar a[aria-current='page'] { color: var(--accent); }
  .toaster { left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .tile, .tile.w12, .tile.w8, .tile.w7, .tile.w5, .tile.w4 { grid-column: 1 / -1; grid-row: auto; }
  .greeting h1 { font-size: 28px; }
  .hero { min-height: 0; flex-direction: column; }
  .hero-body { padding: var(--s5); min-height: 280px; }
  .hero-body h2 { font-size: 24px; }
  .hero-list { width: auto; margin: 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.06); max-height: none; }
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .date-nav .label { min-width: 0; }
  .detail-hero { margin: calc(var(--s4) * -1) calc(var(--s4) * -1) 0; min-height: 0; }
  .detail-hero .inner { flex-direction: column; align-items: flex-start; padding: 120px var(--s4) var(--s4); gap: var(--s4); }
  .detail-poster { width: 120px; }
  .person-head { grid-template-columns: 110px minmax(0, 1fr); gap: var(--s4); }
  .film-list, .follow-grid, .agenda-grid, .day-feature { grid-template-columns: minmax(0, 1fr); }
  .film-row { grid-template-columns: 72px minmax(0, 1fr); }
  .cin-line { flex-direction: column; gap: 6px; }
  .cin-line .name { min-width: 0; padding-top: 0; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--s4) var(--s3); }
  .rail { grid-auto-columns: 124px; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .poster-quick { opacity: 1; transform: none; }
  .masonry { columns: 1; }
}
@media (max-width: 420px) {
  .week-strip { gap: 3px; }
  .week-day { padding: 8px 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
