/* ═══════════════════════════════════════════════════════════════════
   AIRDATE — dark cinematic TV-guide aesthetic
   Fraunces (display serif) + Instrument Sans (UI)
   ═══════════════════════════════════════════════════════════════════ */

/* royal-white light theme — the default */
:root {
  --bg: #f6f1e7;
  --bg-raise: #fdfaf3;
  --bg-raise-2: #efe7d6;
  --line: #d8ccb2;
  --line-soft: #e7ddc9;
  --ink: #2b2416;
  --ink-dim: #75694f;
  --ink-faint: #a2957a;
  --amber: #b9821c;
  --amber-soft: rgba(185, 130, 28, .13);
  --green: #3f8b3f;
  --orange: #bf6a1e;
  --red: #c03d3d;
  --fade: 246, 241, 231;   /* rgb triplet for veils/fades */
  --grain: .028;
  --font-display: "Fraunces", Georgia, serif;
  --font-fancy: "Cinzel Decorative", "Fraunces", Georgia, serif;
  --font-ui: "Instrument Sans", system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 18px 45px -18px rgba(96, 74, 34, .35);
}

/* cinematic dark theme — opt-in via the ⋯ menu */
html[data-theme="dark"] {
  --bg: #0e0c09;
  --bg-raise: #171410;
  --bg-raise-2: #1f1b15;
  --line: #2b261e;
  --line-soft: #221e17;
  --ink: #ece5d8;
  --ink-dim: #9b917f;
  --ink-faint: #6b6355;
  --amber: #f2a33c;
  --amber-soft: rgba(242, 163, 60, .14);
  --green: #7ec97e;
  --orange: #e8833a;
  --red: #e05252;
  --fade: 14, 12, 9;
  --grain: .05;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
html.no-anim *, html.no-anim *::before, html.no-anim *::after { transition: none !important; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 70% -10%, rgba(242, 163, 60, .06), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(126, 201, 126, .04), transparent 60%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}

/* subtle film grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

::selection { background: var(--amber); color: #14100a; }

/* ── top bar ─────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 28px;
  background: rgba(var(--fade), .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.brand:hover .brand-name { color: var(--amber); }

/* fixed gold-on-dark tile — identical in light and dark themes */
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: #201d18;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(230,171,69,.28), 0 6px 18px -7px rgba(0,0,0,.55);
}
.brand-mark svg { width: 30px; height: 30px; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-fancy); font-size: 18px; font-weight: 700; letter-spacing: .04em; }
.brand-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .22em; color: var(--ink-faint); }

.tabs { display: flex; gap: 4px; margin-inline: auto; }

.tab {
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 500;
  color: var(--ink-dim);
  background: none; border: none; cursor: pointer;
  padding: 9px 15px; border-radius: 8px;
  transition: color .15s, background .15s;
  display: flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--ink); background: var(--bg-raise); }
.tab.active { color: var(--amber); background: var(--amber-soft); }

.pill {
  font-size: 10.5px; font-weight: 700;
  background: var(--amber); color: #171106;
  border-radius: 99px; padding: 1px 7px;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── topbar live search ──────────────────────────────────────────── */

.tb-search { position: relative; }
.tb-search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); pointer-events: none;
}
#tb-search-input {
  width: 230px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-ui); font-size: 13px;
  padding: 8px 12px 8px 32px;
  outline: none;
  transition: border-color .15s, width .2s;
}
#tb-search-input:focus { border-color: var(--amber); width: 300px; }
#tb-search-input::placeholder { color: var(--ink-faint); }

.tb-search-drop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 400px; max-height: 440px; overflow-y: auto;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 120;
}
.tb-search-drop .sr-row { padding: 7px 8px; border-radius: 9px; }
.tb-search-drop .sr-row.hl { background: var(--bg-raise-2); }
.tb-search-drop .sr-poster { width: 38px; height: 53px; }
.tb-search-drop .drop-note { padding: 12px 14px; color: var(--ink-dim); font-size: 12.5px; }

/* ── buttons ─────────────────────────────────────────────────────── */

.btn {
  font-family: var(--font-ui); font-size: 13px; font-weight: 550;
  border-radius: 8px; border: 1px solid transparent;
  padding: 8px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .15s;
  text-decoration: none; color: inherit;
}
.btn-primary { background: var(--amber); color: #171106; font-weight: 650; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-dim); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-faint); }
.btn-icon { padding: 8px 11px; }
.btn.busy { opacity: .55; pointer-events: none; }
.btn.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── layout ──────────────────────────────────────────────────────── */

#main { max-width: 1320px; margin: 0 auto; padding: 26px 28px 80px; }

.view { display: none; animation: rise .35s cubic-bezier(.2,.7,.2,1); }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.page-title {
  font-family: var(--font-fancy);
  font-size: 33px; font-weight: 700; letter-spacing: .02em;
  margin-bottom: 6px;
}
.page-title em { font-style: normal; color: var(--amber); font-weight: 400; }
.page-sub { color: var(--ink-dim); margin-bottom: 26px; }

/* ── calendar ────────────────────────────────────────────────────── */

.cal-head {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 18px;
}
.cal-nav { display: flex; gap: 6px; }
.cal-title {
  font-family: var(--font-fancy);
  font-size: 32px; font-weight: 700; letter-spacing: .02em;
  margin-inline: auto;
}
.cal-title em { font-style: normal; color: var(--amber); font-weight: 400; }

.toggle { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 13px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--amber); width: 15px; height: 15px; cursor: pointer; }

.cal-grid-head {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  margin-bottom: 6px;
}
.cal-grid-head div {
  text-align: center; font-size: 11px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .18em;
  color: var(--ink-faint); padding: 4px;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.cal-cell {
  min-height: 118px;
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s;
}
.cal-cell:hover { border-color: var(--line); }
.cal-cell.other { opacity: .45; background: transparent; }
.cal-cell.today { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber), 0 0 24px -8px rgba(242,163,60,.35); }

.cal-date { font-size: 12px; font-weight: 600; color: var(--ink-faint); margin-bottom: 2px; }
.cal-cell.today .cal-date { color: var(--amber); }

.ep-chip {
  display: flex; align-items: flex-start; gap: 6px;
  background: var(--bg-raise-2);
  border-left: 3px solid var(--ink-faint);
  border-radius: 5px;
  padding: 4px 6px 4px 7px;
  font-size: 11.5px; line-height: 1.3;
  cursor: pointer;
  transition: filter .12s, opacity .12s;
}
.ep-chip:hover { filter: brightness(1.25); }
.ep-chip .ep-show { font-weight: 650; display: block; }
.ep-chip .ep-meta { color: var(--ink-dim); font-size: 10.5px; display: block; }
.ep-chip .ep-check {
  margin-left: auto; flex-shrink: 0;
  width: 15px; height: 15px; border-radius: 4px;
  border: 1.5px solid var(--ink-faint);
  display: grid; place-items: center;
  font-size: 10px; color: transparent;
  transition: all .12s;
  margin-top: 1px;
}
.ep-chip.aired { border-left-color: var(--amber); }
.ep-chip.premiere { border-left-color: var(--green); }
.ep-chip.finale { border-left-color: var(--orange); }
.ep-chip.showfinale { border-left-color: var(--red); }
.ep-chip.watched { opacity: .42; }
.ep-chip.watched .ep-check { background: var(--amber); border-color: var(--amber); color: #171106; }
.ep-chip.future { cursor: default; }
.ep-chip.future .ep-check { visibility: hidden; }

.legend {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin-top: 16px; font-size: 12px; color: var(--ink-dim);
}
.legend span { display: flex; align-items: center; gap: 7px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-premiere { background: var(--green); }
.lg-finale { background: var(--orange); }
.lg-showfinale { background: var(--red); }
.lg-unwatched { background: var(--amber); }
.lg-watched { background: var(--ink-faint); }

/* ── upcoming ────────────────────────────────────────────────────── */

.up-day { margin-bottom: 26px; }
.up-day-label {
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px;
}
.up-day-label .rel { font-family: var(--font-ui); font-size: 12px; color: var(--amber); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }

.up-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px 16px 10px 10px;
  margin-bottom: 6px;
  transition: border-color .15s, transform .15s;
}
.up-row:hover { border-color: var(--line); transform: translateX(3px); }
.up-poster { width: 42px; height: 58px; object-fit: cover; border-radius: 6px; background: var(--bg-raise-2); }
.up-info { flex: 1; min-width: 0; }
.up-show { font-weight: 650; font-size: 14.5px; }
.up-ep { color: var(--ink-dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  padding: 3px 8px; border-radius: 99px;
}
.up-tag.premiere { background: rgba(126,201,126,.15); color: var(--green); }
.up-tag.finale { background: rgba(232,131,58,.15); color: var(--orange); }
.up-tag.showfinale { background: rgba(224,82,82,.15); color: var(--red); }
.up-when { color: var(--ink-faint); font-size: 12px; white-space: nowrap; }

/* ── to watch ────────────────────────────────────────────────────── */

.tw-show {
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.tw-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px 12px 12px;
  cursor: pointer; user-select: none;
}
.tw-head:hover { background: var(--bg-raise-2); }
.tw-poster { width: 40px; height: 55px; object-fit: cover; border-radius: 6px; background: var(--bg-raise-2); }
.tw-title { font-weight: 650; font-size: 15px; flex: 1; }
.tw-title small { display: block; color: var(--ink-dim); font-weight: 400; font-size: 12px; }
.tw-count {
  font-family: var(--font-display); font-style: italic;
  font-size: 20px; color: var(--amber);
}
.tw-eps { border-top: 1px solid var(--line-soft); padding: 6px 14px 12px; display: none; }
.tw-show.open .tw-eps { display: block; }
.tw-ep {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 4px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.tw-ep:last-child { border-bottom: none; }
.tw-ep .code { color: var(--amber); font-weight: 650; width: 62px; flex-shrink: 0; }
.tw-ep .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-ep .dt { color: var(--ink-faint); font-size: 12px; white-space: nowrap; }
.tw-actions { display: flex; gap: 8px; padding: 10px 14px 0; }

.check-btn {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--ink-faint); background: none;
  cursor: pointer; color: transparent; font-size: 12px;
  display: grid; place-items: center; flex-shrink: 0;
  transition: all .12s;
}
.check-btn:hover { border-color: var(--amber); color: var(--amber); }
.check-btn.on { background: var(--amber); border-color: var(--amber); color: #171106; }

/* ── my shows ────────────────────────────────────────────────────── */

.shows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.show-card {
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s;
  position: relative;
}
.show-card:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: var(--shadow); }
.show-card { cursor: pointer; }

.show-poster-wrap { position: relative; aspect-ratio: 2/1.75; background: var(--bg-raise-2); }
.show-poster { object-position: center 22%; }
.show-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.show-poster-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(var(--fade), .92) 0%, transparent 38%);
}
.show-unwatched {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: var(--amber); color: #171106;
  font-weight: 750; font-size: 12px;
  border-radius: 99px; padding: 3px 9px;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,.6);
}
.show-status {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
  padding: 3px 8px; border-radius: 99px;
  background: rgba(var(--fade), .75); backdrop-filter: blur(4px);
}
.show-status.running { color: var(--green); }
.show-status.ended { color: var(--red); }
.show-status.tbd { color: var(--ink-dim); }

.show-card-body { padding: 12px 14px 14px; position: relative; margin-top: -34px; z-index: 2; }
.show-name { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; line-height: 1.15; margin-bottom: 3px; }
.show-meta { font-size: 11.5px; color: var(--ink-dim); margin-bottom: 10px; }

.progress { height: 4px; background: var(--bg-raise-2); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; height: 100%; background: var(--amber); border-radius: 99px; transition: width .4s; }
.show-progress-label { font-size: 11px; color: var(--ink-faint); display: flex; justify-content: space-between; }

.show-next { font-size: 11.5px; color: var(--green); margin-top: 8px; }
.show-card-actions {
  position: absolute; bottom: 10px; right: 8px;
  display: flex; gap: 2px;
  opacity: 0; transition: opacity .15s;
}
.show-card:hover .show-card-actions { opacity: 1; }
.card-act {
  background: none; border: none; color: var(--ink-faint);
  cursor: pointer; font-size: 14px; padding: 4px 7px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.show-remove:hover { color: var(--red); background: rgba(224,82,82,.1); }
.show-archive:hover { color: var(--amber); background: var(--amber-soft); }
.show-card.archived { opacity: .55; filter: saturate(.4); }
.show-card.archived:hover { opacity: .85; }
.section-h {
  font-family: var(--font-fancy);
  font-size: 17px; font-weight: 700; letter-spacing: .06em;
  color: var(--ink-dim);
  margin-top: 18px; padding-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
}
.section-h .count { color: var(--amber); margin-left: 6px; }

/* ── stats ───────────────────────────────────────────────────────── */

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px; margin-bottom: 30px;
}
.stat-card {
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 22px 22px 18px;
}
.stat-value {
  font-family: var(--font-display); font-style: italic;
  font-size: 44px; font-weight: 550; color: var(--amber);
  line-height: 1;
}
.stat-label { margin-top: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-dim); }

.stats-extra h3 { font-family: var(--font-display); font-size: 20px; margin: 22px 0 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.bar-row .lbl { width: 180px; flex-shrink: 0; text-align: right; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar { flex: 1; height: 18px; background: var(--bg-raise); border-radius: 5px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a5a1d, var(--amber)); border-radius: 5px; }
.bar-row .val { width: 50px; color: var(--ink-faint); font-size: 12px; }

/* ── modals ──────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(var(--fade), .68);
  backdrop-filter: blur(6px);
  display: grid; place-items: start center;
  padding: 8vh 20px 20px;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.modal-backdrop[hidden] { display: none; }

.modal {
  width: 640px; max-width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
  max-height: 82vh;
  display: flex; flex-direction: column;
  animation: rise .25s cubic-bezier(.2,.7,.2,1);
}
.modal-narrow { width: 480px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; }

.search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-ui); font-size: 15px;
  padding: 13px 16px;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--amber); }
.search-input::placeholder { color: var(--ink-faint); }

.search-results { overflow-y: auto; margin-top: 12px; }
.sr-row {
  display: flex; gap: 14px; align-items: center;
  padding: 10px; border-radius: 10px;
  cursor: pointer; transition: background .12s;
}
.sr-row:hover { background: var(--bg-raise-2); }
.sr-poster { width: 46px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--bg-raise-2); flex-shrink: 0; }
.sr-info { flex: 1; min-width: 0; }
.sr-name { font-weight: 650; font-size: 14.5px; }
.sr-meta { color: var(--ink-dim); font-size: 12px; }
.sr-add { flex-shrink: 0; }
.sr-added { color: var(--green); font-size: 12px; font-weight: 650; flex-shrink: 0; }

.menu-list { display: flex; flex-direction: column; gap: 10px; }
.menu-item {
  display: block; text-align: left;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px;
  cursor: pointer; color: var(--ink);
  font-family: var(--font-ui); font-size: 13px;
  text-decoration: none;
  transition: border-color .15s;
}
.menu-item:hover { border-color: var(--amber); }
.menu-item strong { display: block; font-size: 14px; margin-bottom: 3px; }
.menu-item span { color: var(--ink-dim); font-size: 12px; line-height: 1.4; display: block; }
.menu-row { display: flex; align-items: center; justify-content: space-between; }
.menu-row input { accent-color: var(--amber); width: 17px; height: 17px; }
.menu-note { border-style: dashed; cursor: default; color: var(--ink-dim); font-size: 12px; }
.menu-note:hover { border-color: var(--line); }

/* ── show detail page ────────────────────────────────────────────── */

.clickable { cursor: pointer; }
.clickable:hover { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }

.sd-hero {
  display: flex; gap: 26px; align-items: flex-start;
  margin: 18px 0 26px;
}
.sd-poster {
  position: relative; flex-shrink: 0;
  width: 210px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line-soft);
  display: block;
}
.sd-poster img { width: 100%; display: block; transition: transform .25s, filter .25s; }
.sd-poster:hover img { transform: scale(1.04); filter: brightness(.6); }
.sd-poster-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--amber); font-weight: 700; font-size: 15px;
  opacity: 0; transition: opacity .2s;
  background: rgba(var(--fade), .45);
}
.sd-poster:hover .sd-poster-hint { opacity: 1; }

.sd-head { flex: 1; min-width: 0; }
.sd-title { font-family: var(--font-fancy); font-size: 30px; font-weight: 700; letter-spacing: .02em; margin-bottom: 10px; }
.sd-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--ink-dim); font-size: 13.5px; margin-bottom: 12px; }
.sd-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.sd-genres span {
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em;
  background: var(--bg-raise); border: 1px solid var(--line-soft);
  padding: 3px 10px; border-radius: 99px; color: var(--ink-dim);
}
.sd-progress-row { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 18px; max-width: 560px; }
.sd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-danger:hover { color: var(--red); border-color: var(--red); }

.sd-seasons {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 22px;
}
.sd-seasons-label { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); margin-right: 8px; }
.sd-season-tab {
  font-family: var(--font-ui); font-size: 14px; font-weight: 650;
  background: none; border: 1px solid transparent; color: var(--ink-dim);
  padding: 5px 12px; border-radius: 7px; cursor: pointer;
  transition: all .12s;
}
.sd-season-tab:hover { color: var(--ink); background: var(--bg-raise-2); }
.sd-season-tab.active { color: var(--amber); background: var(--amber-soft); }

.sd-season-bar { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.sd-season-bar h2 { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.sd-bulk { font-size: 12.5px; color: var(--ink-faint); }
.sd-bulk a { color: var(--amber); cursor: pointer; }
.sd-bulk a:hover { text-decoration: underline; text-underline-offset: 3px; }

.sd-eps { display: flex; flex-direction: column; gap: 6px; }
.sd-ep {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 11px 16px;
  transition: border-color .15s;
}
.sd-ep:hover { border-color: var(--line); }
.sd-ep.watched { opacity: .55; }
.sd-ep.future { opacity: .65; }
.sd-ep-code { font-weight: 700; color: var(--amber); width: 46px; flex-shrink: 0; font-size: 13px; }
.sd-ep-main { flex: 1; min-width: 0; }
.sd-ep-name { font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-ep-sum { color: var(--ink-dim); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.sd-ep-date { color: var(--ink-faint); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.check-spacer { width: 22px; flex-shrink: 0; }

@media (max-width: 700px) {
  .sd-hero { flex-direction: column; }
  .sd-poster { width: 150px; }
  .sd-title { font-size: 28px; }
  .sd-ep-sum { display: none; }
  .sd-ep-date { display: none; }
}

/* ── auth modal ──────────────────────────────────────────────────── */

.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 9px; border-radius: 8px;
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-dim);
  cursor: pointer; transition: all .15s;
}
.auth-tab.active { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }

.auth-pane { display: flex; flex-direction: column; gap: 12px; }
.af-label { font-size: 12.5px; font-weight: 600; color: var(--ink-dim); display: flex; flex-direction: column; gap: 5px; }
.af-label small { font-weight: 400; color: var(--ink-faint); }
.af-input {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-family: var(--font-ui); font-size: 14px;
  padding: 10px 12px; outline: none; transition: border-color .15s;
}
.af-input:focus { border-color: var(--amber); }
.auth-submit { justify-content: center; padding: 11px; font-size: 14px; margin-top: 4px; }
.auth-error {
  background: rgba(224, 82, 82, .1); border: 1px solid var(--red);
  color: var(--red); border-radius: 8px; padding: 9px 12px; font-size: 12.5px;
}
.auth-note { margin-top: 16px; font-size: 11.5px; color: var(--ink-faint); line-height: 1.5; }

/* ── toast ───────────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  background: var(--bg-raise-2);
  border: 1px solid var(--amber);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 99px;
  font-size: 13.5px; font-weight: 550;
  box-shadow: var(--shadow);
  animation: toast-in .3s cubic-bezier(.2,.7,.2,1);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }

.empty {
  text-align: center; padding: 70px 20px; color: var(--ink-dim);
}
.empty .big { font-family: var(--font-display); font-style: italic; font-size: 26px; color: var(--ink); margin-bottom: 8px; }

/* ── responsive ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  #tb-search-input, #tb-search-input:focus { width: 150px; }
  .tb-search-drop { width: min(400px, 86vw); }
  #main { padding: 18px 14px 60px; }
  .cal-cell { min-height: 84px; padding: 5px; }
  .cal-title { font-size: 26px; }
  .ep-chip .ep-meta { display: none; }
  .brand-sub { display: none; }
}
