:root {
  --bg: #0e1014; --panel: #171a21; --panel2: #1f232c; --line: #2a2f3a;
  --text: #eef1f6; --muted: #98a1b0; --accent: #ffb547; --accent-ink: #231500;
  --ok: #3ecf8e; --danger: #ff6b6b; --radius: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f7; --panel: #fff; --panel2: #eef0f3; --line: #dfe3e8;
    --text: #141821; --muted: #5b6474; --accent: #e89a1c; --accent-ink: #231500;
    --ok: #179c63; --danger: #d64545; color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
img { display: block; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; border-bottom: 1px solid var(--line); }
/* Blur lives on a separate layer: backdrop-filter on .top itself would pin the phone tab bar to the header. */
.top::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.brand { font-weight: 750; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: 999px; color: var(--muted); font-weight: 550; }
.tabs a:hover { color: var(--text); background: var(--panel2); }
.tabs a.on { color: var(--accent-ink); background: var(--accent); }
.tabs .ico { display: none; }
.sync { display: none; font-size: 12px; color: var(--muted); text-decoration: none; white-space: nowrap; }   /* hidden unless saving fails */
.sync.err { display: inline; color: var(--danger); }
.sync.ok::before { content: "● "; color: var(--ok); }
.busy { position: sticky; top: 53px; z-index: 19; text-align: center; font-size: 12px; padding: 4px;
  background: var(--panel2); color: var(--muted); }

main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 100px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 90px; }
h1 { font-size: 26px; margin: 4px 0 4px; letter-spacing: -.02em; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 12px; font-weight: 650; }
.muted, .sub { color: var(--muted); }
.sub { font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.toolbar .sub { flex: 1; min-width: 160px; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--panel2); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }

/* show cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.poster { position: relative; flex: 0 0 auto; width: 92px; aspect-ratio: 2/3; border-radius: 9px; overflow: hidden; background: var(--panel2); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: var(--muted); }
.badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.card .body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.card .title { font-weight: 700; font-size: 16px; text-decoration: none; line-height: 1.25; }
.card .title:hover { text-decoration: underline; }
.card .next { font-size: 14px; overflow-wrap: anywhere; }
.card .btn { align-self: flex-start; margin-top: auto; }
.bar { height: 5px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.code { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); white-space: nowrap; }

.empty { text-align: center; padding: 60px 20px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p { color: var(--muted); max-width: 440px; margin: 8px auto 18px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* show detail */
.hero { display: flex; gap: 20px; align-items: flex-start; }
.hero .poster { width: 150px; }
.hero .meta { flex: 1; min-width: 0; }
.hero .summary { color: var(--muted); max-width: 720px; margin: 10px 0 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.stats { display: flex; gap: 18px; margin: 12px 0; flex-wrap: wrap; }
.stats b { display: block; font-size: 20px; }
.stats span { font-size: 12px; color: var(--muted); }

.season { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.season > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-weight: 700; }
.season > summary::-webkit-details-marker { display: none; }
.season > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.season[open] > summary::before { transform: rotate(90deg); }
.season > summary .grow { flex: 1; }
.older { margin-bottom: 10px; }
.season > summary .mini { width: 80px; }
.eps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ep { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ep:last-child { border-bottom: 0; }
.ep.done .name { color: var(--muted); }
.ep.future { opacity: .6; }
.ep .epbody { flex: 1; min-width: 0; }
.ep .name { font-weight: 600; }
.syn summary { font-size: 12px; color: var(--muted); cursor: pointer; margin-top: 2px; }
.syn p { margin: 6px 0 2px; font-size: 13px; color: var(--muted); }

/* checkbox */
.chk { position: relative; flex: 0 0 auto; width: 26px; height: 26px; margin-top: 1px; cursor: pointer; }
.chk input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chk span { position: absolute; inset: 0; pointer-events: none; border: 2px solid var(--line); border-radius: 8px; background: var(--panel2); transition: all .12s; }
.chk input:checked + span { background: var(--ok); border-color: var(--ok); }
.chk input:checked + span::after { content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.chk input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.wbox { position: relative; display: inline-block; flex: 0 0 auto; width: 15px; height: 15px; border: 2px solid currentColor; border-radius: 5px; box-sizing: border-box; opacity: .75; transition: all .12s; }
.watchbtn.on .wbox { background: var(--accent-ink); border-color: var(--accent-ink); opacity: 1; }
.watchbtn.on .wbox::after { content: ""; position: absolute; left: 3.5px; top: 0; width: 4px; height: 8px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mk-btn { display: inline-flex; align-items: center; gap: 6px; }

/* lists (upcoming / discover / search) */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.row .poster { width: 48px; border-radius: 6px; }
.row .poster .noimg { font-size: 14px; }
.row .info { flex: 1; min-width: 0; }
.row .info .code { display: block; white-space: normal; }   /* "Season 1, Episode 2" on its own line in narrow rows */
.row .info a { text-decoration: none; font-weight: 650; }
.row .info a:hover { text-decoration: underline; }
.row .when { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.dayhead { font-size: 13px; font-weight: 700; margin: 18px 0 8px; color: var(--text); }

.search { display: flex; gap: 8px; margin: 12px 0 18px; }
.search input, .field input { flex: 1; width: 100%; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); outline: none; }
.search input:focus, .field input:focus { border-color: var(--accent); }

/* settings */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 6px; }
.panel p { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 14px;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.35); max-width: calc(100vw - 32px); font-weight: 550; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 800; cursor: pointer; padding: 0; }

@media (max-width: 720px) {
  .top { padding: 10px 16px; justify-content: space-between; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; gap: 0;
    background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabs a { display: flex; flex-direction: column; align-items: center; font-size: 11px; padding: 4px 8px; border-radius: 10px; }
  .tabs a.on { background: none; color: var(--accent); }
  .tabs .ico { display: block; font-size: 18px; line-height: 1.2; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
  .hero .poster { width: 120px; }
  .season > summary .mini { display: none; }
  .ep .btn.xs { white-space: nowrap; }
}

/* accounts */
.acct { text-decoration: none; font-weight: 650; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.acct:empty { display: none; }
.topout { border-radius: 999px; white-space: nowrap; }
.topout[hidden] { display: none; }
.getapp { border-radius: 999px; white-space: nowrap; margin-left: auto; }
.getapp[hidden] { display: none; }
.getapp .lbl-s { display: none; }
.appdlg { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); padding: 22px; max-width: min(420px, calc(100vw - 32px)); }
.appdlg::backdrop { background: rgba(0,0,0,.55); }
.appdlg .appico { width: 56px; height: 56px; border-radius: 13px; }
.appdlg h2 { margin: 12px 0 8px; font-size: 19px; text-transform: none; letter-spacing: 0; color: var(--text); }
.appdlg ol { padding-left: 20px; margin: 0 0 18px; line-height: 1.5; }
.appdlg li { margin-bottom: 6px; }
.appdlg p { margin: 0 0 12px; line-height: 1.5; }
.appdlg .actions { justify-content: flex-end; }
.appdlg .stack p { margin: 0; }
.appdlg .key { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); font-size: .9em; }
.acct.on { padding: 3px 12px 3px 3px; }
.acct .av { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.auth { max-width: 400px; margin: 10px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.auth h1 { margin-bottom: 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel2); border-radius: 11px; padding: 4px; margin: 18px 0; }
.seg a { text-align: center; padding: 8px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--muted); }
.seg a.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.btn.wide { width: 100%; justify-content: center; padding: 11px; }
.btn .g { font-weight: 800; color: #4285f4; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.formerr { color: var(--danger); font-size: 14px; margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }
.nudge { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.nudge a { font-weight: 700; }
@media (max-width: 720px) { .getapp .lbl { display: none; } .getapp .lbl-s { display: inline; } .top .getapp { margin-right: -6px; } .top .getapp:not([hidden]) ~ .acct.on { margin-left: 0; } .acct .nm { display: none; } .acct.on { padding: 3px; margin-left: auto; } .sync { display: none; } .top .topout { margin-left: -6px; } }
@media (max-width: 720px) { .sync.err { display: inline; white-space: normal; flex: 1; text-align: right; } }  /* always show save problems */

/* Google button */
.gsvg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn.gbtn { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn.gbtn:hover { background: #f8f9fa; border-color: #c6c9ce; }

/* landing page (signed-out home) */
body.landing .tabs { display: none; }
body.landing .top { justify-content: space-between; }
body.landing .acct { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
body.landing main { max-width: none; padding: 0 0 40px; }
body.landing .foot { padding-bottom: 28px; }
.lp { --lp-w: 1120px; }
.lp section { padding-left: max(16px, calc((100% - var(--lp-w)) / 2)); padding-right: max(16px, calc((100% - var(--lp-w)) / 2)); }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }

.lp-hero { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 72px; overflow: hidden;
  background: radial-gradient(900px 480px at 85% 10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
              radial-gradient(700px 420px at 0% 100%, color-mix(in srgb, #6c7cff 14%, transparent), transparent 70%); }
.lp-hero h1 { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -.035em; margin: 14px 0 18px; font-weight: 800; }
.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 540px; margin: 0 0 28px; line-height: 1.55; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-signin { color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.lp-signin a { color: var(--text); font-weight: 650; }

/* product mock */
.lp-visual { position: relative; }
.mk-window { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.02); transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); }
.mk-dots { display: flex; gap: 6px; }
.mk-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mk-head { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mk-card { display: flex; gap: 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.mk-poster { position: relative; flex: 0 0 64px; aspect-ratio: 2/3; border-radius: 8px; }
.mk-poster.p1 { background: linear-gradient(160deg, #ff8a5b, #7a1f3d); }
.mk-poster.p2 { background: linear-gradient(160deg, #4fd1c5, #1e3a8a); }
.mk-poster.p3 { background: linear-gradient(160deg, #a78bfa, #1f2937); }
.mk-poster .badge { top: 4px; left: 4px; font-size: 10px; }
.mk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.mk-body b { font-size: 15px; }
.mk-body > span { color: var(--muted); }
.mk-btn { align-self: flex-start; margin-top: 4px; background: var(--accent); color: var(--accent-ink) !important; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 8px; }

.lp-nets { text-align: center; padding-top: 34px; padding-bottom: 34px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); }
.lp-nets p { margin: 0 0 16px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.lp-netlist { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; }
.lp-netlist span { font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--muted); opacity: .85; }

.lp-sec { padding-top: 80px; text-align: center; }
.lp-h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.025em; line-height: 1.15; margin: 10px 0 0; color: var(--text); text-transform: none; font-weight: 800; }
.lp-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; text-align: left; }
.lp-feat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; transition: transform .15s, border-color .15s; }
.lp-feat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.lp-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-size: 20px; font-weight: 800;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.lp-feat h3 { margin: 16px 0 6px; font-size: 17px; }
.lp-feat p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.lp-steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 40px 0 0; padding: 0; text-align: left; }
.lp-steps li { counter-increment: step; position: relative; padding: 24px 24px 24px 76px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.lp-steps li::before { content: counter(step); position: absolute; left: 22px; top: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.lp-steps b { font-size: 16px; }
.lp-steps p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }

.lp-band { margin-top: 80px; text-align: center; padding-top: 64px; padding-bottom: 64px;
  background: radial-gradient(600px 300px at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 75%), var(--panel);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp-band > p:not(.lp-signin) { color: var(--muted); margin: 10px 0 26px; font-size: 16px; }
.lp-band .lp-cta { justify-content: center; }

@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; padding-top: 48px; gap: 40px; }
  .mk-window { transform: none; max-width: 460px; }
  .lp-feats, .lp-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .lp-hero { padding-top: 36px; padding-bottom: 48px; }
  .lp-cta .btn { width: 100%; justify-content: center; }
  .lp-feats, .lp-steps { grid-template-columns: 1fr; }
  .lp-sec { padding-top: 56px; }
  .lp-band { margin-top: 56px; }
  .lp-netlist span { font-size: 15px; }
}
.toast[hidden], .busy[hidden] { display: none; }

/* landing: real show posters */
.mk-poster { overflow: hidden; }
.mk-poster img, .lp-pimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mk-poster .badge { z-index: 1; }
.lp-posters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 40px; text-align: left; }
.lp-pc { display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; min-width: 0; }
.lp-pc b { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-pimg { position: relative; display: block; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); transition: transform .15s; }
.lp-pc:hover .lp-pimg { transform: translateY(-3px); }
.lp-pimg .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--muted); }
@media (max-width: 900px) { .lp-posters { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .lp-posters { grid-template-columns: repeat(3, 1fr); gap: 12px; } }

/* account sharing */
.memrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.memrow > span { min-width: 0; overflow-wrap: anywhere; }
