:root {
  --bg: #0d0d12;
  --bg2: #15151c;
  --bg3: #1e1e28;
  --line: #2a2a36;
  --fg: #f2f2f5;
  --fg2: #b4b4c2;
  --fg3: #7c7c8c;
  --accent: #f2b705;
  --accent2: #d94a2b;
  --ok: #3ccf8e;
  --err: #ff5d5d;
  --radius: 10px;
  --gutter: clamp(16px, 4vw, 56px);
  --poster: clamp(120px, 14vw, 200px);
  --thumb: clamp(220px, 24vw, 340px);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); min-height: 100%; }
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: 6px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.3em; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg3); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn:hover { background: #2a2a38; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #17130a; border-color: transparent; }
.btn.primary:hover { background: #ffc81f; }
.btn.danger { color: var(--err); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: .4em .8em; font-size: .9em; }
.btn svg { width: 1.2em; height: 1.2em; fill: currentColor; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer;
}
.icon-btn svg { width: 26px; height: 26px; fill: currentColor; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
input[type=text], input[type=password], input[type=search], input:not([type]), select {
  width: 100%; padding: .75em .9em; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; color: var(--fg);
}
input:focus-visible, select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,183,5,.25); }
label { display: block; font-size: .9em; color: var(--fg2); margin: 1em 0 .4em; }
.field-row { display: flex; gap: .75em; flex-wrap: wrap; align-items: end; }
.field-row > * { flex: 1 1 180px; }
.err { color: var(--err); min-height: 1.4em; margin: .6em 0 0; font-size: .95em; }
.muted { color: var(--fg3); }
.small { font-size: .88em; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.5em;
  padding: .8em var(--gutter); background: linear-gradient(var(--bg) 30%, rgba(13,13,18,.0));
  transition: background .2s;
}
.topbar.solid { background: rgba(13,13,18,.96); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: .5em; font-weight: 800; font-size: 1.35em; letter-spacing: -.02em; }
.brand img { width: 32px; height: 32px; }
.brand .word b { color: var(--accent); font-weight: inherit; }
.nav { display: flex; gap: .3em; flex: 1; }
.nav a { padding: .45em .8em; border-radius: 6px; color: var(--fg2); font-weight: 600; }
.nav a.active, .nav a:hover { color: var(--fg); }
.nav a.active { background: rgba(255,255,255,.08); }
.topbar .right { display: flex; gap: .4em; align-items: center; }
@media (max-width: 640px) {
  .topbar { gap: .6em; flex-wrap: wrap; }
  .brand span.word { display: none; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; min-height: min(70vh, 640px); display: flex; align-items: flex-end;
  margin-top: -72px; padding: 120px var(--gutter) 3em; overflow: hidden;
}
.hero .bg { position: absolute; inset: 0; z-index: -1; }
.hero .bg img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero .bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(13,13,18,.6) 45%, rgba(13,13,18,0) 75%),
              linear-gradient(0deg, var(--bg) 0%, rgba(13,13,18,0) 45%);
}
.hero .info { max-width: 640px; }
.hero h1 { font-size: clamp(2em, 5vw, 3.6em); margin: 0 0 .2em; line-height: 1.05; letter-spacing: -.02em; }
.hero .meta { color: var(--fg2); margin-bottom: .8em; display: flex; gap: .8em; flex-wrap: wrap; align-items: center; }
.hero p.overview { color: var(--fg2); line-height: 1.5; max-height: 4.5em; overflow: hidden; }
.hero .actions { display: flex; gap: .8em; margin-top: 1.2em; flex-wrap: wrap; }
.badge { border: 1px solid var(--fg3); border-radius: 4px; padding: 0 .4em; font-size: .8em; font-weight: 700; color: var(--fg2); }

/* ---------- rows ---------- */
main { padding-bottom: 4em; }
.row { margin: 1.6em 0; }
.row h2 { margin: 0 var(--gutter) .6em; font-size: 1.25em; display: flex; align-items: baseline; gap: .8em; }
.row h2 a { font-size: .7em; color: var(--fg3); font-weight: 600; }
.row h2 a:hover, .row h2 a:focus-visible { color: var(--accent); }
.scroller {
  display: flex; gap: 12px; overflow-x: auto; padding: 8px var(--gutter) 14px; scroll-padding: 0 var(--gutter);
  scrollbar-width: none; scroll-behavior: smooth;
}
.scroller::-webkit-scrollbar { display: none; }

/* ---------- cards ---------- */
.card { position: relative; flex: 0 0 auto; width: var(--poster); border-radius: var(--radius); cursor: pointer; transition: transform .15s; }
.card .art {
  position: relative; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(145deg, #23232f, #15151c);
}
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card .art .ph {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 1em; text-align: center;
  font-weight: 700; color: var(--fg2); font-size: .95em;
}
.card .title { margin-top: .5em; font-size: .9em; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { font-size: .8em; color: var(--fg3); }
.card:hover, .card:focus-visible { transform: scale(1.04); }
.card:focus-visible { box-shadow: none; }
.card:focus-visible .art { box-shadow: var(--focus); }
.card.wide { width: var(--thumb); }
.card.wide .art { aspect-ratio: 16/9; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.progress > i { display: block; height: 100%; background: var(--accent); }
.watched-dot {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #17130a; display: grid; place-items: center; font-size: 14px; font-weight: 900;
}
.count-dot {
  position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: rgba(0,0,0,.75); color: var(--fg); display: grid; place-items: center; font-size: 12px; font-weight: 800;
}

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--poster), 1fr)); gap: 22px 14px;
  padding: 0 var(--gutter);
}
.grid .card { width: auto; }
.page-head { padding: 1em var(--gutter) 1.2em; display: flex; gap: 1em; align-items: center; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.8em; flex: 1 1 auto; }
.filters { display: flex; gap: .6em; flex-wrap: wrap; }
.filters input { width: 220px; }
.filters select { width: auto; }
.empty { padding: 3em var(--gutter); color: var(--fg3); text-align: center; }

/* ---------- detail ---------- */
.detail { position: relative; isolation: isolate; padding: 0 var(--gutter); margin-top: -72px; padding-top: 110px; min-height: 60vh; }
.detail .bg { position: absolute; inset: 0 0 auto 0; height: 80vh; z-index: -1; overflow: hidden; }
.detail .bg img { width: 100%; height: 100%; object-fit: cover; opacity: .35; filter: blur(2px); transform: scale(1.03); }
.detail .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 5%, rgba(13,13,18,.5) 60%, rgba(13,13,18,.3)); }
.detail .top { display: flex; gap: 2.2em; align-items: flex-start; }
.detail .poster { width: clamp(150px, 22vw, 280px); flex: none; border-radius: var(--radius); overflow: hidden; aspect-ratio: 2/3; background: var(--bg3); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.detail .poster img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-size: clamp(1.8em, 4vw, 3em); margin: .2em 0 .3em; line-height: 1.1; }
.detail .meta { display: flex; gap: .8em; flex-wrap: wrap; align-items: center; color: var(--fg2); }
.detail .overview { max-width: 760px; line-height: 1.6; color: var(--fg2); }
.detail .actions { display: flex; gap: .8em; flex-wrap: wrap; margin: 1.4em 0; }
.detail .tech { color: var(--fg3); font-size: .9em; }
@media (max-width: 640px) {
  .detail .top { flex-direction: column; gap: 1em; }
  .detail .poster { width: 140px; }
}
.seasons { display: flex; gap: .5em; flex-wrap: wrap; margin: 1.5em 0 1em; }
.seasons .btn.active { background: var(--fg); color: var(--bg); }
.episodes { display: flex; flex-direction: column; gap: 10px; max-width: 1100px; }
.episode {
  display: flex; gap: 1em; padding: 10px; border-radius: var(--radius); background: var(--bg2); cursor: pointer; align-items: center;
  border: 1px solid transparent;
}
.episode:hover { background: var(--bg3); }
.episode:focus-visible { box-shadow: var(--focus); }
.episode .art { position: relative; width: clamp(130px, 18vw, 220px); aspect-ratio: 16/9; flex: none; border-radius: 6px; overflow: hidden; background: var(--bg3); }
.episode .art img { width: 100%; height: 100%; object-fit: cover; }
.episode .txt { flex: 1; min-width: 0; }
.episode .txt b { display: block; margin-bottom: .2em; }
.episode .txt p { margin: .3em 0 0; color: var(--fg3); font-size: .9em; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode .side { color: var(--fg3); font-size: .9em; flex: none; }

/* ---------- auth pages ---------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at top, #1c1a12 0%, var(--bg) 60%); }
.panel { width: 100%; max-width: 400px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 2em; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.panel.wide { max-width: 560px; }
.panel .brand { justify-content: center; font-size: 1.8em; margin-bottom: 1.2em; }
.panel .brand img { width: 44px; height: 44px; }
.panel h2 { margin: 0 0 .5em; font-size: 1.2em; }
.panel .btn { width: 100%; margin-top: 1.4em; }
.panel .alt { text-align: center; margin-top: 1.2em; font-size: .9em; }
.panel .alt a, .panel .alt button { color: var(--fg2); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tvcode { font-size: clamp(2.4em, 9vw, 4em); font-weight: 800; letter-spacing: .12em; text-align: center; margin: .4em 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.qr { display: flex; justify-content: center; margin: 1em 0; }
.qr img { background: #fff; padding: 10px; border-radius: 10px; width: 220px; height: 220px; }
.secret { font-family: ui-monospace, Consolas, monospace; word-break: break-all; text-align: center; color: var(--fg2); font-size: .9em; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: .4em 1em; font-family: ui-monospace, Consolas, monospace; background: var(--bg); padding: 1em; border-radius: 8px; margin: 1em 0; }

/* ---------- settings pages ---------- */
.page { padding: 1em var(--gutter) 4em; max-width: 1100px; margin-inline: auto; box-sizing: border-box; }
.page.narrow { max-width: 860px; }
.narrow-box { max-width: 480px; margin-inline: auto; }
.page h1 { margin: .3em 0 1em; }
.box { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 1.4em; margin-bottom: 1.4em; }
.box h2 { margin: 0 0 .6em; font-size: 1.15em; }
.box .btn { margin-top: 1em; }
table { width: 100%; border-collapse: collapse; font-size: .93em; }
th, td { text-align: left; padding: .65em .5em; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--fg3); font-weight: 600; }
td .btn { margin: 0 .3em 0 0; }
.table-wrap { overflow-x: auto; }
.stats { display: flex; gap: 1em; flex-wrap: wrap; }
.stat { background: var(--bg); border-radius: 10px; padding: .8em 1.2em; min-width: 120px; }
.stat b { display: block; font-size: 1.6em; }
.stat span { color: var(--fg3); font-size: .85em; }
.tag { display: inline-block; padding: .1em .5em; border-radius: 4px; background: var(--bg3); font-size: .8em; color: var(--fg2); }
.tag.ok { background: rgba(60,207,142,.15); color: var(--ok); }
.tag.warn { background: rgba(255,93,93,.15); color: var(--err); }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; background: #000; z-index: 100; overflow: hidden; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.player .subs {
  position: absolute; left: 5%; right: 5%; bottom: 9%; text-align: center; pointer-events: none;
  font-size: clamp(18px, 3.2vw, 42px); line-height: 1.3; font-weight: 600; transition: bottom .2s;
}
.player .subs span {
  display: inline; background: rgba(0,0,0,.6); padding: .05em .3em; border-radius: 4px; white-space: pre-line;
  text-shadow: 0 1px 3px #000; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.player.ui .subs { bottom: 22%; }
.player .overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; transition: opacity .25s; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,0) 22%, rgba(0,0,0,0) 62%, rgba(0,0,0,.85));
}
.player.ui .overlay { opacity: 1; pointer-events: auto; }
.player.ui { cursor: default; }
.player:not(.ui) { cursor: none; }
.player .ptop { display: flex; align-items: center; gap: 1em; padding: 18px var(--gutter); }
.player .ptop .t { font-size: 1.2em; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .ptop .t small { display: block; font-weight: 400; color: var(--fg2); font-size: .8em; }
.player .pbottom { padding: 0 var(--gutter) 22px; }
.player .seek { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; margin-bottom: 6px; touch-action: none; }
.player .seek .rail { position: relative; width: 100%; height: 5px; background: rgba(255,255,255,.25); border-radius: 3px; }
.player .seek:hover .rail, .player .seek:focus-visible .rail { height: 8px; }
.player .seek .buf { position: absolute; top: 0; bottom: 0; background: rgba(255,255,255,.35); border-radius: 3px; }
.player .seek .pos { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent); border-radius: 3px; }
.player .seek .knob { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--accent); }
.player .seek .tip { position: absolute; bottom: 24px; transform: translateX(-50%); background: rgba(0,0,0,.8); padding: 2px 8px; border-radius: 4px; font-size: .85em; pointer-events: none; }
.player .seek:focus-visible { box-shadow: none; }
.player .seek:focus-visible .knob { box-shadow: var(--focus); }
.player .ctrls { display: flex; align-items: center; gap: .4em; }
.player .ctrls .time { font-variant-numeric: tabular-nums; color: var(--fg2); margin: 0 .6em; font-size: .95em; }
.player .ctrls .spacer { flex: 1; }
.player .center-ind {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); pointer-events: none;
  width: 72px; height: 72px; border-radius: 50%; border: 5px solid rgba(255,255,255,.2); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
.player .menu {
  position: absolute; right: var(--gutter); bottom: 90px; background: rgba(20,20,28,.97); border: 1px solid var(--line);
  border-radius: 12px; padding: .6em; min-width: 260px; max-height: 60vh; overflow: auto; z-index: 3;
}
.player .menu h4 { margin: .5em .6em .3em; color: var(--fg3); font-size: .8em; text-transform: uppercase; letter-spacing: .08em; }
.player .menu button { display: block; width: 100%; text-align: left; padding: .6em .8em; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.player .menu button:hover, .player .menu button:focus-visible { background: rgba(255,255,255,.1); box-shadow: none; }
.player .menu button.sel::before { content: "✓ "; color: var(--accent); }
.player .menu button:not(.sel)::before { content: ""; display: inline-block; width: 1.1em; }
.player .nextup {
  position: absolute; right: var(--gutter); bottom: 120px; background: rgba(20,20,28,.95); border: 1px solid var(--line);
  border-radius: 12px; padding: 1em 1.2em; max-width: 360px; z-index: 2;
}
.player .nextup .btn { margin-top: .7em; }
.player .casting {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--fg2); font-size: 1.2em;
}
.player .perr { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); text-align: center; max-width: 520px; padding: 1em; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--line);
  padding: .8em 1.3em; border-radius: 10px; z-index: 200; box-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: calc(100vw - 32px);
}
#toast.error { border-color: var(--err); }

/* ---------- TV / 10-foot mode ---------- */
html.tv { font-size: 22px; --poster: 230px; --thumb: 400px; --gutter: 64px; }
html.tv .card:focus-visible, html.tv .card:focus { transform: scale(1.08); }
html.tv .card:focus .art { box-shadow: var(--focus); }
html.tv :focus { box-shadow: var(--focus); border-radius: 6px; }
html.tv .card:focus { box-shadow: none; }
html.tv .scroller { padding-top: 14px; padding-bottom: 20px; }
html.tv .icon-btn { width: 60px; height: 60px; }
html.tv .icon-btn svg { width: 34px; height: 34px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- bridge (external streaming services) ---------- */
.bridge-head { display: flex; align-items: center; gap: .7em; flex-wrap: wrap; margin: .3em 0 1.2em; }
.bridge-head h1 { margin: 0; flex: 0 1 auto; }
.bridge-head .btn { margin-left: auto; }
.bridge-logo { width: 2.2em; height: 2.2em; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 1.1em; }
.box.bad { border-color: var(--err); }
.checks { margin: .4em 0 0; padding-left: 1.1em; line-height: 1.7; }
.actions { display: flex; flex-wrap: wrap; gap: .6em; margin-top: .6em; }
.actions .btn { margin-top: 0; }
.wizard { max-width: 560px; }
.wizard-form { display: flex; flex-direction: column; gap: .5em; }
.wizard-form label { margin-top: .4em; color: var(--fg2); font-size: .9em; }
.wizard-form .btn.primary { align-self: flex-start; margin-top: .8em; }
.profiles { display: flex; flex-wrap: wrap; gap: 1em; margin-top: .6em; }
.profile-btn { display: flex; flex-direction: column; align-items: center; gap: .4em; background: none; border: 0; cursor: pointer;
  color: var(--fg); padding: .4em; border-radius: 10px; }
.profile-btn img { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: var(--bg3); }
.profile-btn:hover, .profile-btn:focus-visible { background: var(--bg3); }
.bridge-tools { display: flex; flex-wrap: wrap; gap: .8em; align-items: center; margin-bottom: 1.2em; }
.bridge-tools .filters { display: flex; gap: .4em; flex: 1 1 280px; }
.bridge-tools input { flex: 1 1 auto; min-width: 0; }
.bridge .grid { padding: 0; }
.bridge .card .art.wide { aspect-ratio: 16 / 9; }
.remote { margin: 1em 0; }
.remote-screen { width: 100%; max-height: 70vh; object-fit: contain; background: #000; border-radius: 8px; cursor: crosshair; display: block; }
.remote-screen:focus-visible { box-shadow: var(--focus); }
.remote .filters { display: flex; gap: .4em; flex-wrap: wrap; margin-top: .6em; }
.remote .filters input { flex: 1 1 200px; }
.bridge-player { background: #000; border-radius: 10px; overflow: hidden; }
.bridge-player video { width: 100%; max-height: 75vh; display: block; background: #000; }
.bridge-player:fullscreen video { max-height: none; height: calc(100vh - 90px); }
.bridge-controls { padding: .6em .8em; background: var(--bg2); }
.bridge-info { font-weight: 600; margin-bottom: .4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-ctl { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
.row-ctl input[type=range] { flex: 1 1 160px; accent-color: var(--accent); }
.row-ctl .time { font-variant-numeric: tabular-nums; color: var(--fg2); font-size: .9em; }
.bridge-player > .muted { padding: 0 .8em .6em; margin: 0; background: var(--bg2); }
.perm-toggles { display: flex; gap: .8em; margin-top: .3em; flex-wrap: wrap; }
pre.log { max-height: 320px; overflow: auto; background: #000; padding: .8em; border-radius: 8px; font-size: .78em; white-space: pre-wrap; }
@media (max-width: 600px) {
  .bridge-head .btn { margin-left: 0; }
  .row-ctl input[type=range] { flex-basis: 100%; order: 10; }
}
.bridge-player { position: relative; }
.tap-start { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 2; }
.bridge-player > .err { padding: .4em .8em; margin: 0; background: var(--bg2); }

/* bridge: home rows, results, title details */
.bridge .row h2 { margin-left: 0; margin-right: 0; }
.bridge .scroller { padding-left: 0; padding-right: 0; scroll-padding: 0; }
.bridge .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.bridge .card .sub { margin-top: .1em; }
.bridge-nav { display: flex; align-items: center; gap: .8em; margin: .4em 0 .8em; }
.bridge-nav h2 { margin: 0; font-size: 1.2em; }
.bridge-detail { display: flex; gap: 1.6em; align-items: flex-start; margin-bottom: 1em; }
.bridge-detail .art { width: clamp(180px, 34vw, 380px); flex: none; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg3); }
.bridge-detail .art img { width: 100%; height: 100%; object-fit: cover; }
.bridge-detail h1 { margin: 0 0 .3em; font-size: clamp(1.4em, 3vw, 2.2em); line-height: 1.15; }
.bridge-detail .meta { display: flex; gap: .8em; flex-wrap: wrap; color: var(--fg2); }
.bridge-detail .actions { margin: 1em 0; }
.bridge-detail .overview { line-height: 1.55; color: var(--fg2); max-width: 760px; }
@media (max-width: 640px) { .bridge-detail { flex-direction: column; } .bridge-detail .art { width: 100%; } }

/* recorder (VHS mode) */
.btn.rec svg, .icon-btn.rec-btn svg { fill: var(--err); }
.icon-btn.rec-btn.on { background: var(--err); border-radius: 50%; }
.icon-btn.rec-btn.on svg { fill: #fff; animation: recblink 1.2s steps(2) infinite; }
@keyframes recblink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .icon-btn.rec-btn.on svg { animation: none; } }
.segwrap { margin-top: .5em; }
.segbar { position: relative; height: 10px; border-radius: 5px; background: var(--bg3); overflow: hidden; }
.segbar.seekable { cursor: pointer; }
.segbar b { position: absolute; top: 0; bottom: 0; }
.segbar b.cov { background: #c9962a; }
.segbar b.enc { background: var(--ok); }
.segbar i.cur { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg); }
.seglabel { margin-top: .3em; }
.rec-slot { max-width: 620px; }
.rec-slot .btn { margin-top: .5em; }
.rec-warn { margin: .4em 0 0; color: var(--accent); }
.ep-rec { display: inline-flex; gap: .2em; margin-left: .5em; vertical-align: middle; }
.icon-btn.small svg { width: 18px; height: 18px; }
.rec-row { padding: .8em 0; border-top: 1px solid var(--line); }
.rec-row:first-of-type { border-top: 0; }
.rec-row .actions { display: flex; gap: .5em; flex-wrap: wrap; align-items: center; margin-top: .5em; }
.rec-row select { max-width: 100%; }
.rec-title { overflow-wrap: anywhere; }
dialog.rec-dialog { background: var(--bg2); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius);
  width: min(460px, calc(100vw - 32px)); padding: 1.2em; }
dialog.rec-dialog::backdrop { background: rgba(0,0,0,.6); }
dialog.rec-dialog h2 { margin-top: 0; }
dialog.rec-dialog label { display: flex; flex-direction: column; gap: .3em; margin: .7em 0; }
dialog.rec-dialog input, dialog.rec-dialog select { width: 100%; }
dialog.rec-dialog .actions { display: flex; justify-content: flex-end; gap: .5em; flex-wrap: wrap; }
@media (max-width: 600px) {
  .episode .side { display: flex; flex-direction: column; align-items: flex-end; gap: .3em; }
  .ep-rec { margin-left: 0; }
  .ep-rec .icon-btn { width: 34px; height: 34px; }
}

/* position slider: own track, with the captured part of the title painted on it (--ba..--bb) */
input[type=range].seek { -webkit-appearance: none; appearance: none; flex: 1 1 160px; height: 22px; background: transparent; --ba: 0%; --bb: 0%; }
input[type=range].seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--bg3) var(--ba), rgba(255,255,255,.32) var(--ba), rgba(255,255,255,.32) var(--bb), var(--bg3) var(--bb)); }
input[type=range].seek::-moz-range-track { height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--bg3) var(--ba), rgba(255,255,255,.32) var(--ba), rgba(255,255,255,.32) var(--bb), var(--bg3) var(--bb)); }
input[type=range].seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: var(--accent); border: 0; }
input[type=range].seek::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 0; }
input[type=range].seek:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 11px; }
