/* NepaliMoviesDB.com — Nepali Movie Database. IMDb-style palette: black, #F5C518 yellow, #5799EF blue. */
:root {
  --bg: #000;
  --surface: #1a1a1a;
  --surface-2: #2b2b2b;
  --line: #333;
  --text: #fff;
  --muted: #b3b3b3;
  --accent: #f5c518;        /* IMDb yellow */
  --accent-ink: #000;
  --accent-soft: rgba(245, 197, 24, .14);
  --saffron: #f5c518;       /* rating stars */
  --link: #5799ef;
  --ok: #3fbf7f;
  --danger: #ff6b6b;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --deva: "Noto Sans Devanagari", "Mangal", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* 15px base (IMDb-like density). rem sizes below scale from this. */
html { -webkit-text-size-adjust: 100%; font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: rgba(255,255,255,.25); text-underline-offset: 3px; }
a:hover { color: var(--link); }
p a, dd a, .lede a, .meta a { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1, .sec, .row-head h2 { font-family: var(--display); font-weight: 700; letter-spacing: .005em; line-height: 1.05; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }
.np, [lang="ne"] { font-family: var(--deva); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--saffron); color: #000; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 900px; }
.i, .i-star { width: 1em; height: 1em; display: inline-block; vertical-align: -.12em; }
.i-star { color: var(--saffron); }
main { min-height: 60vh; }

/* ---- buttons, chips, pills ---- */
.btn { display: inline-flex; align-items: center; gap: .4em; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  padding: .55em 1.05em; border-radius: 999px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2; }
.btn { transition: background-color .2s var(--ease), border-color .2s var(--ease), filter .2s var(--ease); }
.btn:hover { filter: brightness(1.1); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.btn-on:hover { color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(255,107,107,.45); color: var(--danger); }
.btn-danger:hover { background: rgba(255,107,107,.12); color: var(--danger); }
.btn-sm { font-size: .85rem; padding: .45em .9em; }
.btn-xs { font-size: .78rem; padding: .3em .7em; }
.btn-block { width: 100%; justify-content: center; padding: .75em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: .3em .85em; font-size: .88rem; text-decoration: none; background: var(--surface); }
.chip:hover { border-color: var(--muted); color: var(--text); }
.pill { font-size: .75rem; padding: .15em .6em; border-radius: 999px; background: var(--surface-2); text-transform: capitalize; }
.pill-hidden, .pill-upcoming { background: var(--accent-soft); color: var(--saffron); }
.pill-published, .pill-released { background: rgba(63,191,127,.14); color: var(--ok); }
.pill-admin { background: var(--accent-soft); color: var(--accent); }
.tag-upcoming { color: var(--saffron); font-weight: 600; }
.rating { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
.rating b { font-size: 1.02em; }
.rating.none { color: var(--muted); font-size: .9rem; }
.rating.mine .i-star { color: var(--link); }

/* ---- header ---- */
.topbar { background: #121212; border-bottom: 1px solid #000; position: sticky; top: 0; z-index: 50; }
.topbar-in { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.logo:hover { color: var(--text); }
.site-logo { height: 36px; width: auto; display: block; }
.footer .site-logo, footer .site-logo { height: 44px; }
.search { flex: 1; display: flex; position: relative; background: #fff; border-radius: 6px; }
.search select { width: auto; flex: none; border: 0; background: #ececec; color: #111; border-radius: 6px 0 0 6px; padding: 0 8px; font-size: .85rem; font-weight: 600; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: #111; padding: 9px 10px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--saffron); }
.search > button { border: 0; background: transparent; color: #333; padding: 0 12px; cursor: pointer; font-size: 1.1rem; }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; z-index: 60; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-decoration: none; }
.suggest a:hover, .suggest a[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.suggest .s-thumb { width: 32px; height: 46px; border-radius: 4px; flex: none; object-fit: cover; display: grid; place-items: center;
  background: hsl(var(--h, 0) 45% 30%); font-size: .7rem; font-weight: 700; }
.suggest .s-thumb.round { width: 38px; height: 38px; border-radius: 50%; }
.suggest small { display: block; color: var(--muted); }
.suggest .s-all { justify-content: center; font-size: .85rem; color: var(--link); border-top: 1px solid var(--line); }
.menu-btn, .tb-link, .usermenu summary { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  background: none; border: 0; border-radius: 4px; color: var(--text); font-weight: 600; font-size: .92rem; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background-color .2s; }
.menu-btn:hover, .tb-link:hover, .usermenu summary:hover, .usermenu[open] summary { background: #252525; color: var(--text); }
.menu-btn .i, .tb-link .i, .tb-user { width: 22px; height: 22px; }
.tb-link[aria-current] { box-shadow: inset 0 -3px 0 var(--accent); }
.topbar-end { display: flex; align-items: center; gap: 4px; margin-left: 4px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #000;
  font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary .caret { color: var(--muted); transition: transform .2s; }
.usermenu[open] summary .caret { transform: rotate(180deg); }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  min-width: 190px; box-shadow: var(--shadow); padding: 6px; display: grid; }
.usermenu-pop a, .usermenu-pop button { text-align: left; padding: 8px 10px; border-radius: 6px; text-decoration: none; background: none; border: 0; cursor: pointer; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--surface-2); color: var(--text); }

.flashes { padding-top: 14px; }
.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 8px; background: rgba(63,191,127,.12); border: 1px solid rgba(63,191,127,.35); }
.flash-error { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.4); }

/* ---- posters & avatars ---- */
.poster { aspect-ratio: 2 / 3; width: 100%; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.poster-ph { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 0;
  background:
    radial-gradient(120% 70% at 85% 0%, hsl(var(--h) 80% 55% / .55), transparent 60%),
    linear-gradient(160deg, hsl(var(--h) 55% 24%), hsl(calc(var(--h) + 40) 50% 9%));
  container-type: inline-size; }
.poster-ph::before { content: ""; position: absolute; inset: 6%; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; }
/* Spacing in cqi (relative to the poster itself) — % padding would follow the parent's width. */
.poster-ph > span { margin-inline: 10cqi; }
.poster-ph > span:last-child { margin-bottom: 14cqi; }
.ph-np { font: 700 15cqi/1.15 var(--deva); color: rgba(255,255,255,.92); margin-bottom: 6cqi; overflow-wrap: anywhere; }
.ph-title { font: 700 8cqi/1.15 var(--display); text-transform: uppercase; letter-spacing: .02em; color: #fff; overflow-wrap: break-word; }
.ph-year { font-size: 7cqi; color: rgba(255,255,255,.7); margin-top: 3cqi; letter-spacing: .2em; }
.poster-xxs { width: 34px; border-radius: 4px; }
/* Thumbnail placeholders: just the नेपाली title, large enough to read. */
.poster-xs.poster-ph .ph-title, .poster-xs.poster-ph .ph-year, .poster-xxs.poster-ph .ph-title, .poster-xxs.poster-ph .ph-year { display: none; }
.poster-xs.poster-ph .ph-np { font-size: 22cqi; margin-bottom: 14cqi; }
.poster-xxs.poster-ph .ph-np { display: none; }
.poster-xs.poster-ph .ph-np:empty { display: none; }
.poster-xs.poster-ph .ph-np:empty + .ph-title { display: block; font-size: 12cqi; letter-spacing: 0; overflow-wrap: break-word; margin-bottom: 14cqi; }
.poster-xs.poster-ph::before { inset: 5%; }
.poster-xs { width: 56px; border-radius: 5px; flex: none; }
.poster-sm { width: 90px; flex: none; }
.poster-md { width: 180px; }
.poster-lg { width: 100%; box-shadow: var(--shadow); }
.avatar { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.avatar-ph { display: grid; place-items: center; font: 700 1.3rem var(--display); color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 55% 38%), hsl(calc(var(--h) + 50) 50% 20%)); container-type: inline-size; }
.avatar-ph { font-size: clamp(.7rem, 30cqi, 3rem); }
.avatar-xs { width: 34px; height: 34px; font-size: .75rem; }
.avatar-sm { width: 56px; height: 56px; flex: none; }
.avatar-xl { width: 180px; height: 180px; flex: none; box-shadow: var(--shadow); font-size: 3.4rem; }

/* ---- TV series ---- */
.tv-tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--muted); color: var(--muted); vertical-align: 1px; white-space: nowrap; }
.episodes { list-style: none; margin: 8px 0 16px; padding: 0; }
.episodes li { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ep-num { margin: 2px 0 0; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.episodes h3 { font: 600 1rem var(--font); margin: 0 0 2px; }
.episodes p { margin: 0 0 4px; max-width: 75ch; }
#episodes .chips { align-items: center; }

/* ---- admin: TMDB poster finder ---- */
.tmdb-current { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.tmdb-current p { margin: 0 0 6px; }
.tmdb-results { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.tmdb-results li { display: flex; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 12px; }
.tmdb-results img, .tmdb-noposter { width: 120px; height: 180px; object-fit: cover; border-radius: 4px; flex: none; background: var(--surface-2); }
.tmdb-noposter { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.tmdb-results p { margin: 4px 0; }
.tmdb-results form { margin-top: 8px; display: grid; gap: 8px; justify-items: start; }

/* ---- admin: bulk TMDB sync ---- */
.sync-progress { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: -8px 0 24px; }
.sync-progress .bar { height: 10px; margin-bottom: 8px; }
.sync-progress .bar i { transition: width .3s; }
.sync-log { max-height: 220px; overflow: auto; margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.sync-log li { margin: 2px 0; }
.sync-log .ok { color: var(--ok); }
.sync-log .err { color: var(--danger); }

/* ---- full-screen menu (IMDb-style) ---- */
.megamenu { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  background: #1f1f1f; color: var(--text); overflow-y: auto; }
.megamenu[open] { animation: mm-in .25s ease-out; }
@keyframes mm-in { from { transform: translateY(-24px); opacity: 0; } }
.megamenu::backdrop { background: #000; }
.megamenu .wrap { max-width: 1000px; padding-top: 28px; padding-bottom: 48px; }
.mm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.mm-close { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: #000; display: grid; place-items: center;
  cursor: pointer; transition: filter .2s; }
.mm-close:hover { filter: brightness(1.1); }
.mm-close .i { width: 22px; height: 22px; }
.mm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 40px; }
.mm-grid h2 { display: flex; align-items: center; gap: 10px; font: 700 1.55rem var(--display); margin: 0 0 10px; }
.mm-ico { width: 26px; height: 26px; color: var(--accent); flex: none; }
.mm-grid ul { list-style: none; margin: 0; padding: 0 0 0 36px; }
.mm-grid a { display: flex; align-items: center; min-height: 36px; text-decoration: none; color: #ddd; }
.mm-grid a:hover { color: var(--text); text-decoration: underline; }
.mm-wide { grid-column: span 2; }
.mm-cols { columns: 2; column-gap: 32px; }

/* ---- advertising spaces (IMDb-style: labelled, centred, size reserved to avoid layout shift) ---- */
.ad { display: flex; flex-direction: column; align-items: center; margin: 0 auto; padding: 12px 16px 16px; }
.ad-top_banner, .ad-bottom_banner { background: #121212; border-bottom: 1px solid #000; }
.ad-bottom_banner { margin-top: 48px; border-top: 1px solid #000; border-bottom: 0; }
.ad-home_billboard { margin: 36px 0; padding-inline: 0; }
.ad-sidebar_mrec { padding: 0 0 18px; }
.ad-label { margin: 0 0 6px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #8a8a8a; }
.ad-box { width: 100%; max-width: calc(var(--w) * 1px); aspect-ratio: var(--w) / var(--h); min-height: 50px; overflow: hidden; }
.ad-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px dashed #3a3a3a; border-radius: 4px; color: #8a8a8a; font-size: .85rem; text-align: center;
  background: repeating-linear-gradient(45deg, #151515 0 12px, #181818 12px 24px); }
.ad-empty a { color: var(--link); font-size: .8rem; }

/* ---- celebs list ---- */
.people-grid { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 24px 18px; }
.people-grid a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; text-decoration: none; position: relative; }
.people-grid .avatar { width: 140px; height: 140px; margin-bottom: 6px; font-size: 2.4rem; transition: filter .2s; }
.people-grid a:hover .avatar { filter: brightness(1.15); }
.people-grid a:hover b { color: var(--link); }
.rank-sm { position: absolute; top: 0; left: calc(50% - 74px); min-width: 28px; height: 28px; border-radius: 14px; padding: 0 6px;
  background: rgba(0,0,0,.75); border: 1px solid var(--line); font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
.chip[aria-current] { background: var(--accent); border-color: var(--accent); color: #000; }

/* ---- home: hero slider (IMDb-style) ---- */
.hs { padding: 18px 0 8px; }
.hs-in { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.hs-stage { position: relative; min-width: 0; }
.hs-track { display: grid; }
.hs-slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s; }
.hs-slide.is-active { opacity: 1; visibility: visible; transition: opacity .5s ease; }
.hs-backdrop { display: block; aspect-ratio: 16 / 9; overflow: hidden; position: relative; background: #111; border-radius: 6px 6px 0 0; }
.hs-backdrop img { width: 100%; height: 100%; object-fit: cover; transition: transform 6s ease; }
.hs-slide.is-active .hs-backdrop img { transform: scale(1.04); }
.hs-backdrop img.hs-blur { filter: blur(28px) saturate(1.3) brightness(.5); transform: scale(1.25); }
.hs-slide.is-active .hs-backdrop img.hs-blur { transform: scale(1.3); }
.hs-backdrop img.hs-key { position: absolute; right: 12%; top: 7%; width: auto; height: 80%; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.08); transform: none; }
.hs-slide.is-active .hs-backdrop img.hs-key { transform: none; }
.hs-backdrop:has(.hs-key)::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(60% 80% at 75% 45%, rgba(245,197,24,.10), transparent 70%); pointer-events: none; }
@media (max-width: 600px) { .hs-backdrop img.hs-key { right: 5%; height: 72%; } }
.hs-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.6) 75%, #000); pointer-events: none; }
.hs-art { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(60% 80% at 75% 20%, hsl(var(--h) 75% 50% / .55), transparent 70%),
    radial-gradient(50% 60% at 15% 90%, hsl(calc(var(--h) + 60) 70% 45% / .35), transparent 70%),
    linear-gradient(135deg, hsl(var(--h) 45% 16%), #050505); }
.hs-art .np { font-size: clamp(3rem, 11vw, 8.5rem); font-weight: 700; color: rgba(255,255,255,.12); white-space: nowrap; letter-spacing: -.01em; }
.hs-bottom { position: relative; display: flex; align-items: flex-end; gap: 18px; margin-top: -132px; padding: 0 18px; }
.hs-poster { position: relative; flex: none; width: 160px; }
.hs-poster .poster { border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.ribbon { position: absolute; top: 0; left: 0; width: 34px; height: 46px; display: grid; place-items: start center; padding-top: 7px;
  background: rgba(31,31,31,.8); color: #fff; border: 0; font: 700 1.2rem/1 var(--font); cursor: pointer; text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); border-radius: 4px 0 0 0; }
.ribbon:hover { background: rgba(60,60,60,.9); color: #fff; }
.ribbon.btn-on { background: var(--accent); color: #000; }
.hs-poster .wl-form { position: absolute; top: 0; left: 0; margin: 0; }
.hs-info { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 6px; min-width: 0; }
.hs-play { flex: none; width: 72px; height: 72px; color: #fff; transition: color .15s, transform .15s; }
.hs-play svg { width: 100%; height: 100%; }
.hs-play:hover { color: var(--accent); }
.hs-text { min-width: 0; }
.hs-eyebrow { margin: 0 0 2px; color: var(--accent); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hs-text h2 { font: 700 clamp(1.6rem, 2.8vw, 2.3rem)/1.05 var(--display); margin: 0 0 4px; }
.hs-text h2 a { text-decoration: none; }
.hs-text h2 .np { font-size: .6em; color: var(--muted); }
.hs-plot { margin: 0 0 6px; color: #d6d6d6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.hs-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .9rem; }
.hs-meta .rating { color: var(--text); }
.hs-navs { position: absolute; top: 0; left: 0; right: 0; aspect-ratio: 16 / 9; pointer-events: none; display: flex; align-items: center; justify-content: space-between; }
.hs-nav { pointer-events: auto; width: 48px; height: 64px; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.7); border-radius: 4px; margin: 0 10px; transition: color .15s, background .15s; }
.hs-nav svg { width: 28px; height: 28px; }
.hs-nav:hover { color: var(--accent); background: rgba(0,0,0,.7); }
.hs-dots { display: none; justify-content: center; gap: 8px; padding: 14px 0 4px; }
/* 24px hit area around an 8px dot (WCAG 2.5.8) */
.hs-dots button { position: relative; width: 24px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer; }
.hs-dots button::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; transform: translate(-50%, -50%);
  border-radius: 4px; background: #666; transition: width .2s, background-color .2s; }
.hs-dots button[aria-current]::before { background: var(--accent); width: 22px; }
.hs-pause { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.5); border-radius: 50%; transition: color .2s, background-color .2s; }
.hs-pause:hover { color: var(--accent); background: rgba(0,0,0,.8); }
.hs-pause .i { width: 18px; height: 18px; }
.hs-pause .when-paused, .hs-pause[aria-pressed="true"] .when-playing { display: none; }
.hs-pause[aria-pressed="true"] .when-paused { display: contents; }

.hs-next { display: flex; flex-direction: column; min-width: 0; padding: 4px 0 0; }
.hs-next h2 { font: 700 1.45rem var(--display); color: var(--accent); margin: 0 0 10px; }
.hs-next ol { list-style: none; margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 16px; flex: 1;
  background: linear-gradient(180deg, #1f1f1f, #000); border-radius: 6px; }
.hs-next li a { display: flex; gap: 14px; text-decoration: none; align-items: flex-start; }
.hs-next .poster-xs { width: 88px; }
.hs-next-text { display: grid; grid-template-columns: 36px 1fr; column-gap: 10px; align-items: center; min-width: 0; }
.hs-next-play { grid-row: span 2; width: 36px; height: 36px; color: #fff; }
.hs-next-play svg { width: 100%; height: 100%; }
.hs-next li a:hover .hs-next-play { color: var(--accent); }
.hs-next-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-next-text small { color: var(--muted); grid-column: 2; }
.hs-browse { margin-top: 12px; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.hs-browse:hover { color: var(--accent); }

.trailer-dialog { width: min(1100px, calc(100% - 24px)); padding: 0; border: 0; background: #000; color: var(--text); border-radius: 8px; overflow: hidden; }
.trailer-dialog::backdrop { background: rgba(0,0,0,.85); }
.trailer-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: #121212; }
.trailer-dialog-frame { aspect-ratio: 16 / 9; }
.trailer-dialog-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 1024px) {
  .mm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-in { grid-template-columns: 1fr; }
  .hs-next { display: none; }
  .hs-dots { display: flex; }
}
@media (max-width: 600px) {
  .mm-grid { grid-template-columns: 1fr; gap: 24px; }
  .mm-wide { grid-column: auto; }
  .megamenu .wrap { padding-top: 16px; }
  .ad-sidebar_mrec { display: none; }
  .hs { padding-top: 0; }
  .hs-in { padding: 0; }
  .hs-backdrop { border-radius: 0; }
  .hs-bottom { margin-top: -64px; padding: 0 12px; gap: 12px; }
  .hs-poster { width: 92px; }
  .ribbon { width: 26px; height: 36px; font-size: 1rem; padding-top: 5px; }
  .hs-play { width: 44px; height: 44px; }
  .hs-info { gap: 10px; }
  .hs-text h2 .np, .hs-eyebrow { display: none; }
  .hs-nav { width: 36px; height: 48px; margin: 0 6px; }
}

/* ---- home ---- */
.meta { color: var(--muted); margin: 0 0 12px; }
.meta a { color: var(--text); text-decoration-color: rgba(255,255,255,.3); }
.lede { font-size: 1.02rem; max-width: 68ch; margin: 0 0 18px; color: #e6e6e6; }

.row { margin: 36px 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; border-left: 4px solid var(--accent); padding-left: 10px; }
.row-head h2 { font-size: 1.75rem; margin: 0; }
.more { font-weight: 600; color: var(--link); text-decoration: none; white-space: nowrap; }
/* Horizontal rows: columns are sized so a whole number of cards fits the row (no half-cut card at the edge).
   --per = cards per screenful; the arrows (app.js) page by exactly one screenful. */
.scroller { --per: 7; --gap: 14px; display: grid; grid-auto-flow: column; gap: var(--gap);
  grid-auto-columns: calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 0 4px; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; min-width: 0; }
.scroller-wrap { position: relative; }
.scroller-btn { position: absolute; top: 35%; z-index: 2; width: 44px; height: 64px; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(18,18,18,.82); border: 1px solid rgba(255,255,255,.55); border-radius: 4px; transition: color .2s, opacity .2s; }
.scroller-btn:hover { color: var(--accent); }
.scroller-btn .i { width: 26px; height: 26px; }
.scroller-btn[data-dir="-1"] { left: -10px; }
.scroller-btn[data-dir="1"] { right: -10px; }
.scroller-btn[hidden] { display: none; }
@media (pointer: coarse) { .scroller-btn { display: none; } }  /* swipe on touch screens */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }

.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  outline: 1px solid transparent; outline-offset: -1px; transition: outline-color .2s, background-color .2s; }
.card:hover, .card:focus-within { outline-color: var(--line); background: var(--surface-2); }
.card { transition: background-color .2s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
.card-link { display: block; overflow: hidden; position: relative; }
.card-link .poster { transition: transform .35s var(--ease), filter .25s var(--ease); }
.card-link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.45)); opacity: 0; transition: opacity .25s var(--ease); pointer-events: none; }
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.55); }
  .card:hover .card-link .poster { transform: scale(1.045); filter: brightness(1.06); }
  .card:hover .card-link::after { opacity: 1; }
  .card:hover h3 a { color: var(--accent); }
}
.card .poster { border-radius: 0; }
.card-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card h3 { font-size: .95rem; font-weight: 600; margin: 0; overflow-wrap: anywhere; line-height: 1.3; transition: color .2s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 a { text-decoration: none; }
.card p { margin: 0; font-size: .82rem; }
.card .rating { font-size: .88rem; }
.card .rating.none { font-size: .8rem; }
.rating.none .i { width: .95em; height: .95em; }
.card .wl-form { margin-top: auto; padding-top: 6px; }
.card .wl-form .btn { width: 100%; justify-content: center; }

.people-row { --per: 9; }
.person-chip { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: .9rem; min-width: 0; }
.person-chip .avatar { width: 100%; max-width: 128px; height: auto; aspect-ratio: 1; }
.person-chip > span { overflow-wrap: anywhere; }
/* cards per screenful by width */
@media (max-width: 1180px) { .scroller { --per: 6; } .people-row { --per: 8; } }
@media (max-width: 980px)  { .scroller { --per: 5; } .people-row { --per: 6; } }
@media (max-width: 780px)  { .scroller { --per: 4; } .people-row { --per: 5; } }
@media (max-width: 600px)  { .scroller { --per: 3; --gap: 10px; } .people-row { --per: 4; } }
@media (max-width: 440px)  { .scroller { --per: 2; } .people-row { --per: 3; } }
.person-chip small { font-weight: 400; }

/* ---- title & person pages ---- */
.title-hero { padding: 28px 0 36px; border-bottom: 1px solid var(--line);
  background: radial-gradient(70% 100% at 100% 0%, hsl(var(--h) 40% 22% / .4), transparent 70%), linear-gradient(180deg, #1f1f1f, var(--bg)); }
.title-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 22px; }
.title-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin: 0; }
.np.big { font-size: 1.1rem; color: var(--muted); margin: 4px 0 6px; }
.cert { border: 1px solid var(--muted); border-radius: 3px; padding: 0 5px; font-size: .85em; }
.score-box { display: flex; gap: 26px; }
.score-box .label, .label { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; color: var(--muted); font-weight: 700; margin: 0 0 4px; }
.score-box .rating { font-size: 1.15rem; }
.your-rating { background: none; border: 0; padding: 0; cursor: pointer; font-size: 1.15rem; color: var(--link); text-decoration: none; display: inline-flex; gap: .3em; align-items: center; }
.your-rating .i-star.mine { color: var(--link); }
.title-body { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.title-poster { display: grid; gap: 12px; align-content: start; }
.title-poster .btn { width: 100%; justify-content: center; }
.trailer { aspect-ratio: 16 / 9; margin-bottom: 18px; border-radius: var(--radius); overflow: hidden; background: #000; }
.trailer iframe { width: 100%; height: 100%; border: 0; }
.crew { margin: 0; border-top: 1px solid var(--line); }
.crew > div { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.crew dt { font-weight: 700; min-width: 100px; }
.crew dd { margin: 0; }
.crew dd a { color: var(--link); text-decoration: none; }
.crew dd a:hover { text-decoration: underline; }

.title-sections { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-top: 32px; }
.sec { font-size: 1.7rem; margin: 0 0 14px; border-left: 4px solid var(--accent); padding-left: 10px; }
.sec .muted, .page-title .muted { font: 500 1rem var(--font); margin-left: 6px; }
.sec-sm { font-size: 1rem; margin: 0 0 12px; }
.col-main > section { margin-bottom: 40px; }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cast { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.cast .avatar { width: 64px; height: 64px; flex: none; font-size: 1.2rem; }
.cast b { display: block; }
.cast small { display: block; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: .85rem; }
.dist li { display: grid; grid-template-columns: 20px 1fr 28px; gap: 8px; align-items: center; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--saffron); border-radius: 4px; }
.trivia { padding-left: 20px; }
.trivia li { margin-bottom: 10px; }

.sortby { font-size: .9rem; color: var(--muted); }
.sortby a { color: var(--text); }
.sortby a[aria-current] { color: var(--saffron); font-weight: 700; text-decoration: none; }
.review { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.review.is-hidden { opacity: .6; border: 1px dashed var(--saffron); }
.review header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.review h3 { margin: 0; font-size: 1.05rem; }
.review-body { margin: 10px 0; max-width: 75ch; }
.review footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.spoiler summary { cursor: pointer; color: var(--saffron); margin: 10px 0; }
.review-form-wrap { margin-bottom: 18px; }
.review-form-wrap > summary { list-style: none; }
.review-form-wrap > summary::-webkit-details-marker { display: none; }
.review-form { margin-top: 14px; background: var(--surface); padding: 18px; border-radius: var(--radius); }
.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }

.person-banner { position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  background: radial-gradient(70% 120% at 85% 0%, hsl(var(--h) 40% 22% / .55), transparent 70%), linear-gradient(180deg, #1f1f1f, var(--bg)); }
.pb-bg { position: absolute; inset: -40px; background-size: cover; background-position: center 25%; filter: blur(28px) brightness(.38) saturate(1.2);
  transform: scale(1.1); }
.person-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, var(--bg)); pointer-events: none; }
.pb-in { position: relative; z-index: 1; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; align-items: end; padding-top: 36px; padding-bottom: 36px; }
.pb-photo { margin: 0; width: 260px; }
/* the 2:3 frame sits on the picture itself, so a licence credit can show underneath */
.pb-photo img, .pb-photo .pb-initials { width: 100%; aspect-ratio: 2 / 3; height: auto; border-radius: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.pb-photo img { display: block; object-fit: cover; object-position: center 20%; background: #1f1f1f; }
.pb-photo .pb-initials { font-size: 5.5rem; }
.pb-text h1 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); margin: 0 0 4px; }
.pb-text .details { margin: 10px 0 14px; }
.pb-bio { max-width: 70ch; margin-bottom: 8px; }
.pb-more summary { cursor: pointer; color: var(--link); font-weight: 600; margin-bottom: 8px; }
.pb-more p { max-width: 70ch; }
.inline-details { display: inline-grid; }
.filmo { background: var(--surface); border-radius: var(--radius); margin-bottom: 12px; }
.filmo summary { padding: 12px 16px; cursor: pointer; font-weight: 700; font-size: 1rem; }
.filmo ul { list-style: none; margin: 0; padding: 0 18px 10px; }
.filmo li { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.filmo li small { display: block; }
.yr { color: var(--muted); font-variant-numeric: tabular-nums; }

/* rating dialog */
.rate-dialog { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 14px; padding: 26px; max-width: 520px; width: calc(100% - 32px); text-align: center; }
.rate-dialog::backdrop { background: rgba(0,0,0,.7); }
.star-input { border: 0; padding: 0; margin: 16px 0 6px; display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { cursor: pointer; font-size: 2rem; color: #4a4a55; line-height: 1; min-width: 28px; min-height: 44px; display: grid; place-items: center; }
.star-input label .i-star { color: inherit; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--link); }
.star-input input:focus-visible + label { outline: 3px solid var(--saffron); border-radius: 4px; }
.score-readout { font: 700 1.8rem var(--display); margin: 0 0 14px; }
.dialog-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- lists, chart, search ---- */
.page-title { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin: 26px 0 14px; }
.result-list { list-style: none; padding: 0; margin: 0 0 28px; }
.result-list li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.result-list p { margin: 3px 0; }
.chart { list-style: none; padding: 0; margin: 0 0 40px; }
.chart li { display: grid; grid-template-columns: 34px 56px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rank { font: 700 1.5rem var(--display); color: var(--muted); text-align: right; }
.chart h2 { font: 600 1.05rem var(--font); margin: 0; }
.chart h2 a { text-decoration: none; }
.chart p { margin: 2px 0 4px; }
.chart-info .rating + .rating { margin-left: 14px; }
.empty { padding: 40px 0; text-align: center; }
.empty .btn { margin-top: 10px; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; text-align: center; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; }
.pager span[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pager .gap { border: 0; min-width: 0; padding-inline: 4px; color: var(--muted); }

/* ---- forms ---- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--surface); padding: 14px; border-radius: var(--radius); margin-bottom: 22px; }
.filters label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
:where(input:not([type=checkbox], [type=radio], [type=file]), select, textarea) {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; color: var(--text); }
.filters select, .filters input { min-width: 150px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--link); outline: none; box-shadow: 0 0 0 3px rgba(143,180,255,.25); }
.form label.check, label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input[type=checkbox] { accent-color: var(--accent); width: 17px; height: 17px; }
.auth { display: grid; place-items: center; padding: 50px 16px; }
.card-form { width: 100%; max-width: 420px; background: var(--surface); padding: 30px; border-radius: 14px; border: 1px solid var(--line); }

/* ---- admin ---- */
/* layout: menu on the left, page on the right; stacks on small screens */
.admin-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 20px; padding-bottom: 20px; }
.admin-side { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px; scrollbar-width: thin; }
.admin-side nav { display: grid; gap: 2px; }
.admin-menu > summary { display: none; }
.side-top, .side-group summary { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 8px;
  font-weight: 700; text-decoration: none; cursor: pointer; color: var(--text); transition: background-color .15s; }
.side-top:hover, .side-group summary:hover { background: var(--surface-2); color: var(--text); }
.side-top .i, .side-group summary .i { width: 18px; height: 18px; color: var(--muted); flex: none; }
.side-top.is-current { background: var(--accent-soft); }
.side-top.is-current .i { color: var(--accent); }
.side-group summary { list-style: none; }
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary span:first-of-type { flex: 1; }
.side-group .side-caret { width: 14px; height: 14px; transition: transform .2s; }
.side-group[open] .side-caret { transform: rotate(180deg); }
.side-group[open] > summary .i:first-child { color: var(--accent); }
.side-group ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 22px; border-left: 1px solid var(--line); margin-left: 20px; display: grid; gap: 1px; }
.side-group li a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 6px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .93rem; transition: background-color .15s, color .15s; }
.side-group li a:hover { background: var(--surface-2); color: var(--text); }
.side-group li a[aria-current] { background: var(--accent-soft); color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.side-site { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; font-weight: 600; color: var(--muted); }
.admin-main { min-width: 0; }
.admin-main > .page-title:first-child, .admin-main > .admin-top:first-child .page-title { margin-top: 0; }
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; gap: 16px; }
  .admin-side { position: static; max-height: none; }
  .admin-menu > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; font-weight: 700; cursor: pointer; list-style: none; }
  .admin-menu > summary::-webkit-details-marker { display: none; }
  .admin-menu > summary .i { width: 18px; height: 18px; }
  .admin-menu > summary small { margin-left: auto; color: var(--accent); font-weight: 600; }
  .admin-menu[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 6px; }
  .admin-menu[open] > summary .side-caret { transform: rotate(180deg); }
}
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { border-color: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font: 700 2.1rem/1.1 var(--display); }
.stat span { color: var(--muted); font-size: .85rem; }
.admin-actions { display: flex; gap: 10px; margin-bottom: 28px; }
.plain { list-style: none; padding: 0; }
.plain li { padding: 4px 0; }
.table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .thumb { width: 46px; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions > * { margin-left: 4px; }
.table td input { min-width: 140px; }
.table-scroll { overflow-x: auto; }
.credits-table td { min-width: 120px; }
.credits-table .num { width: 80px; min-width: 0; }
.admin-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 20px; min-width: 0; }
.admin-form legend { font-weight: 800; padding: 0 6px; }
.admin-form legend.mt { margin-top: 18px; padding: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.cols-2, .cols-3 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.check-grid label { margin: 0; }
.poster-edit { margin-bottom: 14px; display: flex; justify-content: center; }
.form-actions { display: flex; gap: 10px; margin-bottom: 40px; }

/* ---- footer ---- */
.footer { margin-top: 60px; background: #121212; border-top: 1px solid #000; padding: 36px 0; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; align-items: start; }
.footer nav { display: grid; gap: 6px; }
.footer nav a { text-decoration: none; color: var(--muted); }
.footer nav a:hover { color: var(--text); }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .title-sections { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  /* Mobile header like IMDb's app bar: ☰ · logo · watchlist · sign in, search on its own row */
  .topbar-in { flex-wrap: wrap; padding: 6px 0 10px; gap: 4px; }
  .menu-btn { order: -1; padding: 0 8px; }
  .menu-btn-text, .tb-text { display: none; }
  .topbar-end { margin-left: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .title-body { grid-template-columns: 1fr; }
  .title-poster { grid-template-columns: 140px 1fr; align-items: start; }
  .score-box { gap: 18px; flex-wrap: wrap; }
  .pb-in { grid-template-columns: 1fr; gap: 20px; padding-top: 24px; }
  .pb-photo { width: min(220px, 60vw); }
  .avatar-xl { width: 130px; height: 130px; font-size: 2.4rem; }
  .footer-in { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .crew > div { flex-direction: column; gap: 2px; }
  .chart li { grid-template-columns: 26px 48px 1fr; }
  .chart li .wl-form { grid-column: 3; }
  .filters > label, .filters select, .filters input { width: 100%; }
  .cols-3 { grid-template-columns: 1fr 1fr; }
  .star-input label { font-size: 1.45rem; min-width: 28px; }
  .table .actions { white-space: normal; }
}
/* ---- UX: comfortable touch targets on touch screens (44px, WCAG 2.5.5) ---- */
@media (pointer: coarse) {
  .btn, .btn-sm, .btn-xs, .chip, .your-rating, .menu-btn, .usermenu summary, .tb-link, .pager a, .pager span,
  .sortby a, .search > button, .search select, .mm-grid a { min-height: 44px; }
  .menu-btn, .tb-link, .usermenu summary { min-width: 44px; justify-content: center; }
  .btn, .chip, .your-rating { display: inline-flex; align-items: center; }
  .btn-xs { padding-inline: 1em; }
  .sortby a { display: inline-flex; align-items: center; }
  .hs-nav { width: 44px; height: 56px; }
}

/* ---- UX: busy state for submitted forms / async buttons ---- */
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading > * { visibility: hidden; }
.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid currentColor; border-color: var(--muted) var(--muted) var(--muted) transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.btn-ghost).is-loading::after { border-color: #000 #000 #000 transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- UX: helpful empty states ---- */
.empty-state { text-align: center; padding: 48px 16px; background: var(--surface); border-radius: var(--radius); margin: 8px 0 32px; }
.empty-state h2 { font: 700 1.45rem var(--display); margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin: 0 auto 16px; max-width: 48ch; }
.empty-state .chips { justify-content: center; }

@media (prefers-reduced-motion: reduce) { .megamenu[open] { animation: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---- Pro ---- */
:root { --pro: #4fb3ff; --pro-soft: rgba(79,179,255,.13); --pro-line: #1e2c3a; }
.pro-logo { display: inline-flex; align-items: center; gap: 6px; font: 700 1.45rem/1 var(--display); color: var(--text); }
.pro-logo .site-logo { height: 30px; }
.pro-word { color: var(--pro); }
.pro-logo-sm { font-size: 1.05rem; gap: 4px; }
.pro-logo-sm .site-logo { height: 22px; }
.pro-logo-lg { font-size: 2.2rem; gap: 10px; }
.pro-logo-lg .site-logo { height: 52px; }
.tb-pro { padding-inline: 10px; }
.tb-pro .pro-word { font: 700 1.2rem/1 var(--display); }
.tb-pro .i { color: var(--pro); }
.btn-pro { background: var(--pro); color: #001526; }
.btn-pro:hover { color: #001526; }
.pill-pro { background: var(--pro-soft); color: var(--pro); text-transform: none; }
.pill-pending { background: var(--accent-soft); color: var(--accent); }
.pill-rejected { background: rgba(255,107,107,.12); color: var(--danger); }
.pro-nav { background: #0d1620; border-bottom: 1px solid var(--pro-line); }
.pro-nav-in { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pro-nav-in a { padding: 12px; text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; color: #cfe3f5; }
.pro-nav-in a[aria-current] { box-shadow: inset 0 -3px 0 var(--pro); color: var(--text); }
.pro-nav-in a:hover { color: var(--pro); }
.pro-nav-in .pro-nav-home { margin-right: 10px; padding-left: 0; }
.pro-page { padding-top: 24px; padding-bottom: 40px; }
.pro-page .page-title .i { color: var(--pro); }

.pro-hero { background: radial-gradient(900px 400px at 85% 0%, rgba(79,179,255,.22), transparent 60%), linear-gradient(180deg, #0d1620, var(--bg)); border-bottom: 1px solid var(--pro-line); }
.pro-hero-in { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center; padding-block: 56px; }
.pro-hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); }
.pro-hero .lede { font-size: 1.05rem; color: #cfe3f5; max-width: 38em; }
.pro-hero-logo { margin: 0 0 14px; }
.pro-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.pro-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pro-stats li { background: rgba(255,255,255,.04); border: 1px solid var(--pro-line); border-radius: var(--radius); padding: 12px 16px; color: var(--muted); }
.pro-stats b { color: var(--text); font: 700 1.6rem var(--display); margin-right: 6px; }
.pro-features { list-style: none; padding: 0; margin: 0 0 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pro-features li { background: var(--surface); border-radius: var(--radius); padding: 18px; }
.pro-features h3 { font-size: 1.02rem; margin: 10px 0 4px; }
.pro-features p { margin: 0; color: var(--muted); font-size: .92rem; }
.pro-f-ico { width: 28px; height: 28px; color: var(--pro); }
.pro-peek { margin-bottom: 24px; }
.peek-list, .dash-list, .mover-list { list-style: none; padding: 0; margin: 0 0 12px; }
.peek-list li, .dash-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.peek-list a, .dash-list a { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.dash-list small { display: block; }
.dash-list .poster-xs { width: 40px; }
.dash-list .avatar-sm, .peek-list .avatar-sm { width: 44px; height: 44px; }
.mover-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; }
.mini { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 0 4px; }
.dash-head { margin-bottom: 18px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; }
.dash-grid .sec-sm .i { color: var(--pro); }
.pro-tools { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pro-tools a { display: grid; gap: 2px; background: var(--surface); border-radius: var(--radius); padding: 16px; text-decoration: none; height: 100%; }
.pro-tools a:hover { background: var(--surface-2); color: var(--text); }
.pro-tools .i { width: 24px; height: 24px; color: var(--pro); margin-bottom: 6px; }
.pro-tools span { color: var(--muted); font-size: .88rem; }

.meter { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.meter b { font-weight: 800; }
.meter-up { color: var(--ok); font-weight: 700; font-size: .85em; }
.meter-down { color: var(--danger); font-weight: 700; font-size: .85em; }
.meter-new { color: var(--pro); font-size: .75em; text-transform: uppercase; font-weight: 700; letter-spacing: .06em; }
.meter-none { color: var(--muted); font-size: .85rem; }
.meter-move { display: grid; justify-items: end; gap: 2px; }
.pro-locked { display: inline-flex; align-items: center; gap: 4px; color: var(--pro); text-decoration: none; font-weight: 600; }
.pro-locked .i { width: .95em; height: .95em; }
.pro-panel { border: 1px solid var(--pro-line); }
.pro-panel .sec-sm { display: flex; align-items: center; gap: 8px; }
.pro-panel .sec-sm > span:last-child { font-size: .9rem; color: var(--muted); font-family: var(--font); font-weight: 600; }
.pro-teaser { background: var(--pro-soft); border-radius: 8px; padding: 12px 14px; }
.pro-teaser .pro-lock { margin: 0 0 10px; font-size: .92rem; }
.pro-teaser .i { color: var(--pro); }
.pro-strip { border: 1px solid var(--pro-line); border-radius: var(--radius); background: linear-gradient(180deg, #0d1620, var(--surface)); padding: 16px 18px; margin: 24px 0 8px; }
.pro-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pro-strip-meter { color: var(--muted); font-size: .9rem; display: inline-flex; gap: 8px; align-items: baseline; }
.pro-strip-meter .meter b { color: var(--text); font-size: 1.1rem; }
.contacts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 24px; }
.contacts li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 6px 0; }
.contact-rel { color: var(--pro); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding-top: 3px; }
.claim-line { margin: 12px 0 0; color: var(--muted); }
.pb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.verified { color: var(--pro); display: inline-flex; vertical-align: middle; }
.verified .i { width: .7em; height: .7em; }
.chart .verified .i, .admin-form .i { width: 1em; height: 1em; color: var(--pro); }
.stage { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15em .6em; border-radius: 999px; background: var(--surface-2); }
.stage-announced { background: rgba(255,255,255,.08); }
.stage-pre_production { background: var(--accent-soft); color: var(--accent); }
.stage-filming { background: rgba(255,107,107,.15); color: #ff8f8f; }
.stage-post_production { background: var(--pro-soft); color: var(--pro); }
.stage-completed { background: rgba(63,191,127,.14); color: var(--ok); }
.dev-list li { grid-template-columns: 56px 1fr auto; }
.company-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.company-list .panel { margin: 0; }
.company-list h2 { font: 600 1.1rem var(--font); margin: 0; }
.company-list p { margin: 4px 0 0; }
.bo-table .num { text-align: right; white-space: nowrap; }
.bo-table th a { color: inherit; text-decoration: none; }
.bo-table th a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--pro); }
.table-edit td { padding: 4px; }
.table-edit td input, .table-edit td select { min-width: 120px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 20px 0; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; }
.plan h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan ul { padding-left: 1.1em; color: var(--muted); font-size: .92rem; flex: 1; }
.plan-price { margin: 0 0 6px; }
.plan-price b { font: 700 2.2rem var(--display); }
.plan-best { border-color: var(--pro); box-shadow: 0 0 0 1px var(--pro) inset; }
.plan-trial { border-color: rgba(79,179,255,.4); }
.demo-note { background: var(--accent-soft); border: 1px solid rgba(245,197,24,.35); border-radius: 8px; padding: 10px 14px; font-size: .92rem; }
.cancel-pro { margin: 8px 0 16px; }
.auth-pro { background: radial-gradient(700px 360px at 50% 0%, rgba(79,179,255,.16), transparent 70%); }
.auth-pro .card-form { border-color: var(--pro-line); }
.auth-pro-logo { margin: 0 0 14px; }
.claim-who { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; }
.claim blockquote { margin: 8px 0 12px; padding: 8px 14px; border-left: 3px solid var(--pro); background: var(--surface-2); border-radius: 0 8px 8px 0; }
@media (max-width: 820px) {
  .pro-hero-in { grid-template-columns: 1fr; padding-block: 36px; gap: 24px; }
  .pro-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .dev-list li { grid-template-columns: 48px 1fr; }
  .dev-list li > form { grid-column: 2; }
  .contacts li { grid-template-columns: 1fr; gap: 2px; }
  .dash-grid { grid-template-columns: 1fr; }
}

/* ---- payments + settings ---- */
.btn-esewa { background: #60bb46; color: #fff; }
.btn-esewa:hover { color: #fff; }
.pill-pay-complete { background: rgba(63,191,127,.14); color: var(--ok); }
.pill-pay-pending, .pill-pay-ambiguous { background: var(--accent-soft); color: var(--accent); }
.pill-pay-failed, .pill-pay-refunded { background: rgba(255,107,107,.12); color: var(--danger); }
.settings-form fieldset { margin-bottom: 22px; }
.settings-form .hint { color: var(--muted); font-size: .82rem; font-weight: 500; }
.settings-form .switch { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 14px; }
.status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot-on { background: var(--ok); }
.dot-warn { background: var(--accent); }
.test-mail { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.test-mail input { max-width: 300px; }
.settings-form .cols-2 { align-items: end; }

/* ---- type safety on touch screens ---- */
@media (pointer: coarse) {
  input:not([type=checkbox], [type=radio], [type=file]), select, textarea { font-size: 16px; }
}

/* ---- account + footer editor ---- */
.form-aside { margin: -6px 0 14px; text-align: right; }
.table-edit .input-order { width: 70px; min-width: 0; }
.table-edit .center { text-align: center; }

/* ---- text pages (About, Contact, Privacy, Terms) ---- */
.page-doc { padding-bottom: 40px; }
.page-doc-head { border-bottom: 1px solid var(--line); margin-bottom: 22px; padding-bottom: 8px; }
.page-doc-head .page-title { margin-bottom: 4px; }
.prose { max-width: 72ch; color: #e6e6e6; }
.prose h2 { font: 700 1.55rem/1.1 var(--display); margin: 28px 0 10px; color: var(--text); border-left: 4px solid var(--accent); padding-left: 10px; }
.prose h3 { font: 600 1.05rem var(--font); margin: 20px 0 8px; color: var(--text); }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0 0 6px; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--link); }
.prose strong { color: var(--text); }
.contact-form { max-width: 640px; margin-top: 26px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
textarea.mono { font: .9rem/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.message.is-unread { border-left: 4px solid var(--accent); }
.message-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; }
.message-body { background: var(--bg); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; white-space: normal; overflow-wrap: anywhere; }
.footer-credit a { color: var(--muted); text-decoration: underline; }

/* ---- slider: custom slides ---- */
.hs-custom .hs-bottom { padding-left: 24px; }
.hs-cta { margin-top: 10px; }
.hs-next .hs-next-wide { width: 88px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; flex: none; display: block; position: relative; }

/* ---- admin: home slider ---- */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.slides-table .order-btns { white-space: nowrap; }
.slide-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; display: block; }
.slides-table .poster-xs { width: 40px; }
.slide-preview { width: 100%; max-width: 480px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin: 0 0 8px; display: block; }
.slider-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; margin-top: 18px; }
.live-slides { margin: 0 0 10px; padding-left: 1.3em; }
.live-slides li { margin: 4px 0; }

/* licence credit under freely licensed person photos */
.photo-credit { margin-top: 6px; font-size: .72rem; line-height: 1.35; color: var(--muted); max-width: 260px; }
.photo-credit a { color: inherit; }

/* uploaded banner ads fill their reserved box */
.ad-image a, .ad-image img { display: block; width: 100%; height: 100%; }
.ad-image img { object-fit: cover; border-radius: 4px; }
.ad-image a:focus-visible { outline-offset: 3px; }
.ad-mode { display: flex; gap: 22px; margin: 0 0 12px; }
.ad-image-fields { border-left: 3px solid var(--line); padding-left: 14px; margin: 0 0 14px; }
.ad-preview { width: 100%; max-width: 560px; object-fit: cover; border-radius: 6px; display: block; margin: 0 0 8px; background: var(--surface-2); }

/* ---- advertise page ---- */
.ad-formats { max-width: 72ch; margin: 26px 0 0; }
.ad-formats .nowrap, .nowrap { white-space: nowrap; }
.advertise-form .checks { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 4px; margin: 0 0 14px; }
.advertise-form .checks legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.advertise-form .checks .check { margin-bottom: 8px; }

.ad-request-update { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.ad-request-update select { width: auto; }
.ad-request-update input { flex: 1; min-width: 200px; }

.ad-artwork { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.ad-artwork figure { margin: 0; width: 220px; }
.ad-artwork img { width: 100%; max-height: 140px; object-fit: contain; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; display: block; }
.ad-artwork figcaption { font-size: .78rem; margin-top: 4px; overflow-wrap: anywhere; }

/* ---- release calendar (calendar.php) ---- */
.i.flip { transform: scaleX(-1); }
.cal-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.cal-head .page-title { margin-bottom: 4px; }
.cal-month { margin: 0; font-size: 1.15rem; }
.cal-month .np { font-size: .95rem; }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-jump { display: flex; gap: 6px; }
.cal-jump input { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .38em .8em; min-height: 36px; color-scheme: dark; }
.cal-grid { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 6px 0 30px; background: var(--surface); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-row + .cal-row { border-top: 1px solid var(--line); }
.cal-dow div { padding: 8px 10px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.cal-dow div:nth-child(6) { color: var(--accent); }
.cal-cell { min-height: 116px; padding: 6px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cal-cell + .cal-cell { border-left: 1px solid var(--line); }
.cal-cell.is-blank { background: rgba(255,255,255,.015); }
.cal-cell.is-fri { background: rgba(245,197,24,.035); }
.cal-cell.has-rel { background: rgba(245,197,24,.07); }
.cal-day { font-size: .85rem; font-weight: 600; color: var(--muted); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.has-rel .cal-day { color: var(--text); }
.cal-cell.is-today .cal-day { background: var(--accent); color: #000; }
.cal-rel { display: flex; gap: 6px; align-items: center; text-decoration: none; font-size: .8rem; line-height: 1.25; padding: 3px; border-radius: 6px; transition: background-color .2s var(--ease); }
.cal-rel:hover { background: var(--surface-2); color: var(--text); }
.cal-rel .poster-xs { width: 30px; border-radius: 3px; }
.cal-rel > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cal-more { font-size: .78rem; color: var(--link); padding-left: 3px; }
.cal-list-head { margin-top: 8px; }
.cal-daylist { scroll-margin-top: 80px; }
.cal-date { display: flex; align-items: center; gap: 10px; font: 600 1rem var(--font); margin: 18px 0 2px; }
.cal-date-num { font: 700 1.5rem/1 var(--display); min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); }
.cal-date.is-today .cal-date-num { background: var(--accent); color: #000; }
.cal-empty a { color: var(--link); }
@media (max-width: 860px) { .cal-grid { display: none; } }
