:root {
  /* Dark: soft slate, easy on the eyes. Text is off-white, never pure white. */
  --bg: #15181e; --surface: #1d2129; --surface2: #262b35; --border: #313845; --text: #e4e8ee; --muted: #9aa4b2;
  --accent: #8fa8ff; --accent-ink: #10162e; --good: #62d3a0; --warn: #f0b765; --bad: #f08585;
  --radius: 12px; --shadow: 0 8px 28px rgba(0,0,0,.30);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
/* AMOLED: true black background so pixels switch off; cards are barely lifted, borders do the separating. */
:root[data-theme="amoled"] {
  --bg: #000000; --surface: #0b0c0f; --surface2: #15171c; --border: #23262e; --text: #e9ecf1; --muted: #98a1ae;
  --accent: #8fa8ff; --accent-ink: #000000; --shadow: none;
}
:root[data-theme="light"] {
  --bg: #f4f5f8; --surface: #ffffff; --surface2: #eceef3; --border: #d9dde5; --text: #1b2028; --muted: #5d6877;
  --accent: #3b57d6; --accent-ink: #fff; --good: #1b8657; --warn: #a56608; --bad: #c43a3a; --shadow: 0 6px 20px rgba(25,35,60,.10);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f4f5f8; --surface: #ffffff; --surface2: #eceef3; --border: #d9dde5; --text: #1b2028; --muted: #5d6877;
    --accent: #3b57d6; --accent-ink: #fff; --good: #1b8657; --warn: #a56608; --bad: #c43a3a; --shadow: 0 6px 20px rgba(25,35,60,.10);
    color-scheme: light;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { margin-left: auto; }
.hidden { display: none !important; }

#shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
#side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
#side .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; padding: 4px 10px 18px; }
#side a.brand { color: var(--text); padding: 4px 10px 18px; }
#side a.brand:hover { background: none; }
#side .brand svg { width: 26px; height: 26px; color: var(--accent); }
#side a, #tabs a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
#side a svg, #tabs a svg { width: 20px; height: 20px; flex: none; }
#side a:hover { background: var(--surface); color: var(--text); }
#side a.on, #tabs a.on { color: var(--text); background: var(--surface2); }
#side .sp { flex: 1; }
#side .syncline { padding: 8px 12px; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.dot.off { background: var(--warn); } .dot.busy { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

#view { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1180px; width: 100%; outline: none; }
#tabs { display: none; }
.boot { color: var(--muted); padding: 40px 0; text-align: center; }

.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.sec { margin: 30px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.sec .more { margin-left: auto; font-size: .85rem; color: var(--muted); }
.sec .more:hover { color: var(--text); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); font-weight: 550; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--border); background: var(--surface2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

input[type=text], input[type=search], input[type=email], input[type=date], select, textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
label.f { display: block; font-size: .8rem; color: var(--muted); margin: 14px 0 6px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .85rem; color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.tag { padding: 2px 9px; border-radius: 999px; background: var(--surface2); font-size: .78rem; color: var(--muted); }
.badge { padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; background: var(--surface2); color: var(--muted); }
.badge.good { color: var(--good); } .badge.warn { color: var(--warn); } .badge.acc { color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.pc { display: block; position: relative; min-width: 0; }
.pc .poster { aspect-ratio: 2/3; border-radius: 10px; background: var(--surface2); overflow: hidden; position: relative; border: 1px solid var(--border); }
.pc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc .ph { display: grid; place-items: center; height: 100%; padding: 10px; text-align: center; color: var(--muted); font-size: .85rem; }
.pc .t { margin-top: 8px; font-weight: 550; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .s { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .stat { position: absolute; top: 7px; left: 7px; }
.pc .score { position: absolute; top: 7px; right: 7px; background: rgba(11,13,16,.78); color: #fff; backdrop-filter: blur(6px); border-radius: 6px; font-size: .75rem; padding: 1px 7px; font-weight: 600; }
.pc .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.45); }
.pc .bar i { display: block; height: 100%; background: var(--accent); }
.pc .quick { position: absolute; right: 7px; bottom: 11px; }
.pc:hover .poster { border-color: var(--muted); }

.row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row .mini { width: 46px; flex: none; }
.row .mini .poster { border-radius: 6px; }
.row .grow { min-width: 0; flex: 1; }
.row .grow .t { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hero { position: relative; margin: -28px calc(-1 * clamp(16px, 3vw, 40px)) 0; padding: 28px clamp(16px, 3vw, 40px) 0; overflow: hidden; }
.hero .bd { position: absolute; inset: 0; background-size: cover; background-position: center 20%; opacity: .28; filter: blur(2px); }
.hero .bd::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 20%, var(--bg)); }
.hero .in { position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 28px; padding-top: 10px; }
.hero .poster { aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface2); }
.hero .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .88rem; margin: 8px 0 14px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 13px; color: var(--muted); font-weight: 550; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.rate { display: flex; gap: 5px; flex-wrap: wrap; }
.rate button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 600; }
.rate button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; margin-top: 26px; }
.eps .ep { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.eps .ep.future { opacity: .5; }
.eps .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); background: none; display: grid; place-items: center; flex: none; color: transparent; padding: 0; }
.eps .ck svg { width: 14px; height: 14px; }
.eps .ep.done .ck { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.eps .ep .n { color: var(--muted); width: 32px; flex: none; font-variant-numeric: tabular-nums; }
.eps .ep .nm { flex: 1; min-width: 0; }
.eps .ep .nm div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prov { display: flex; flex-wrap: wrap; gap: 8px; }
.prov span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border-radius: 8px; padding: 4px 9px 4px 4px; font-size: .82rem; }
.prov img { width: 20px; height: 20px; border-radius: 5px; }
.imdb { background: #f5c518; color: #111; font-weight: 700; padding: 1px 7px; border-radius: 5px; font-size: .78rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-card b { display: block; font-size: 1.7rem; letter-spacing: -.02em; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: .7rem; color: var(--muted); }
.bars i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.hbar { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: .88rem; }
.hbar .l { width: 110px; flex: none; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .b { flex: 1; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.hbar .b i { display: block; height: 100%; background: var(--accent); }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.blur { filter: blur(7px); transition: filter .15s; cursor: pointer; user-select: none; }
.blur.show { filter: none; user-select: auto; }
.log h3 { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.log ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.log li { margin: 3px 0; } .log li b { color: var(--text); font-weight: 600; }
.foot { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--accent); }
.foot a.ver { font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface2); color: var(--text); }

#toasts { position: fixed; left: 50%; bottom: calc(76px + var(--safe-b)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); padding: 22px; width: min(92vw, 440px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h2 { margin-bottom: 8px; } dialog .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 820px) {
  #shell { grid-template-columns: minmax(0, 1fr); }
  #side { display: none; }
  #view { padding-top: 18px; padding-bottom: calc(96px + var(--safe-b)); }
  #tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + var(--safe-b)); justify-content: space-around; z-index: 20; }
  #tabs a { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 10px; min-width: 58px; align-items: center; }
  .hero { margin-top: -18px; padding-top: 18px; }
  .hero .in { grid-template-columns: 110px 1fr; gap: 14px; }
  .hero h1 { font-size: 1.25rem; }
  .cols { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
  .rail { grid-auto-columns: 112px; }
  #toasts { bottom: calc(84px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.hero .in > div, .cols > div, .grow { min-width: 0; }
.seg { max-width: 100%; }
input[type=date] { min-width: 0; }

/* ------------------------- public site (before sign-in) ------------------------- */
body.public #shell { display: block; }
body.public #side, body.public #tabs { display: none; }
body.public #view { max-width: 980px; margin: 0 auto; }
.pub-top { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; }
.pub-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.pub-brand svg { width: 26px; height: 26px; color: var(--accent); }
.pub-nav { margin-left: auto; display: flex; gap: 4px; }
.pub-nav a { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 550; }
.pub-nav a:hover { color: var(--text); }
.pub-nav a.on { background: var(--surface2); color: var(--text); }
.pub-note { color: var(--warn); text-align: center; margin: 0 0 10px; }
.lp-hero { text-align: center; padding: clamp(36px, 9vw, 96px) 0 clamp(28px, 6vw, 56px); }
.lp-hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -.03em; }
.lede { color: var(--muted); max-width: 520px; margin: 14px auto 24px; font-size: 1.05rem; }
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 40px; }
.pub-card { max-width: 440px; margin: clamp(20px, 7vw, 64px) auto; padding: 26px; }
.pub-card h1 { margin-bottom: 8px; }
.btn.block { display: flex; width: 100%; padding: 11px 14px; margin-top: 12px; }
.lnk { color: var(--accent); }
.keyin { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; font-size: 1.05rem; text-transform: uppercase; }
.err { color: var(--bad); min-height: 1.2em; margin: 8px 0 0; }
.banner { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; margin-bottom: 16px; font-size: .9rem; }
.banner a { color: var(--accent); font-weight: 600; }
.keyform { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.keyform select { width: auto; }
.keycode { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.02rem; letter-spacing: .06em; user-select: all; }
.keycode.dim { color: var(--muted); text-decoration: none; }
.keyrow .grow, .row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .keyform { grid-template-columns: 1fr 1fr; } .keyform input { grid-column: 1 / -1; } .keyrow { flex-wrap: wrap; } }

/* theme toggle + theme-specific images */
.theme-btn { width: 30px; height: 30px; margin-left: auto; color: var(--muted); }
.theme-btn:hover { color: var(--text); }
.pub-nav .theme-btn { margin-left: 8px; align-self: center; }
.theme-btn svg { width: 16px; height: 16px; }
.only-light { display: none; }
:root[data-theme="light"] .only-light { display: inline-block; }
:root[data-theme="light"] .only-dark { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .only-light { display: inline-block; } :root:not([data-theme]) .only-dark { display: none; } }
.shotwrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
img.shot.only-dark, img.shot.only-light { width: 100%; height: auto; }
:root:not([data-theme="light"]) img.shot.only-dark { display: block; }
:root[data-theme="light"] img.shot.only-light { display: block; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) img.shot.only-light { display: block; } :root:not([data-theme]) img.shot.only-dark { display: none; } }
.shots { margin: 8px 0 40px; }
.shotgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.shotfig { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shotfig figcaption { display: flex; flex-direction: column; gap: 2px; }
.shotfig.mobile { grid-column: 1 / -1; max-width: 220px; margin: 0 auto; }
@media (max-width: 720px) { .shotgrid { grid-template-columns: 1fr; } }
.prose { max-width: 680px; } .prose h2 { margin: 22px 0 6px; } .prose p, .prose li { color: var(--muted); } .prose ul { padding-left: 20px; } .prose b { color: var(--text); }

input[type=date] { min-width: 0; max-width: 100%; }

/* in-page sign-in */
.linkbtn{background:none;border:0;padding:0;font:inherit;cursor:pointer;color:var(--accent)}
.codein{text-align:center;font-size:28px;letter-spacing:.35em;font-variant-numeric:tabular-nums}
#auth-email{width:100%}
.keyform .kf-email{grid-column:1/-1}
.keyform{grid-template-columns:1fr auto auto auto!important}
@media (max-width:560px){.keyform{grid-template-columns:1fr 1fr!important}.keyform input,.keyform select:first-of-type{grid-column:1/-1}}

/* mobile top bar with the logo (home link) */
#mtop { display: none; }
@media (max-width: 820px) {
  #mtop { display: block; position: sticky; top: 0; z-index: 15; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
  #mtop a { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
  #mtop svg { width: 22px; height: 22px; color: var(--accent); }
  #view { padding-top: 14px; }
  .hero { margin-top: -14px; padding-top: 14px; }
}
body.public #mtop { display: none; }
.chk { display: flex; gap: 8px; align-items: center; margin-top: 12px; cursor: pointer; }
.chk input { width: auto; }
@media (max-width: 820px) { #shell { align-content: start; } }
input.dmy{font-variant-numeric:tabular-nums}

/* Hidden bot trap on the request-access form: real people never see or reach it. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
