:root {
  --bg: #070604;
  --bg-2: #0d0b08;
  --panel: #14110c;
  --panel-2: #1c1811;
  --panel-3: #262118;
  --line: #2f291e;
  --text: #f4eee3;
  --muted: #b6ab98;
  --dim: #7f7666;
  --gold: #f2b53e;
  --gold-2: #e3a72f;
  --gold-deep: #8a6300;
  --on-gold: #231900;
  --danger: #ff6b5a;
  --radius: 14px;
  --rail: 84px;
  --titlebar: 40px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font: 15px/1.4 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 500px at 75% -10%, rgba(255,196,92,.10), transparent 70%),
              radial-gradient(900px 600px at 105% 110%, rgba(214,140,40,.08), transparent 70%); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a3224; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- Title bar ---- */
.titlebar { position: fixed; top: 0; left: 0; right: 0; height: var(--titlebar); display: flex; align-items: center; gap: 12px;
  padding: 0 150px 0 14px; -webkit-app-region: drag; background: #0b0906; border-bottom: 1px solid #17130d; z-index: 30; }
.titlebar-logo { height: 26px; }
/* Mac: the red/yellow/green window buttons are on the left, and there are none on the right. */
html.mac .titlebar { padding: 0 14px 0 84px; }
.titlebar-space { flex: 1; }
.pill { -webkit-app-region: no-drag; display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; cursor: pointer; }
.pill b { color: var(--gold); font-weight: 600; }

/* ---- Layout ---- */
.shell { position: fixed; top: var(--titlebar); left: 0; right: 0; bottom: 0; display: flex; z-index: 1; }
.rail { width: var(--rail); flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0;
  background: #0a0806; border-right: 1px solid #17130d; }
.rail-btn { width: 70px; padding: 9px 0 7px; border: 0; border-radius: 12px; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; }
.rail-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn:hover { background: var(--panel-2); color: var(--text); }
.rail-btn.active { background: rgba(242,181,62,.12); color: var(--gold); }
.rail-space { flex: 1; }
.view { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.page { position: absolute; inset: 0; overflow-y: auto; padding: 26px 32px 40px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.page-head h1 { font-size: 28px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); }
.page-head .grow { flex: 1; }

/* ---- Buttons & inputs ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--panel-3); }
.btn.gold { background: linear-gradient(180deg, #f6c35a, #e3a72f); border-color: #f2b53e; color: var(--on-gold); }
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.input { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: #0f0d09; color: var(--text); }
.input:focus { outline: none; border-color: var(--gold-2); }
.search { position: relative; }
.search .input { padding-left: 38px; }
.search::before { content: ""; position: absolute; left: 13px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%);
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b6ab98' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E"); }
.tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 9px; font-weight: 600; }
.tab.active { background: var(--panel-3); color: var(--gold); }

/* ---- Browse layout: categories | content | detail ---- */
.browse { position: absolute; inset: 0; display: flex; }
.cats { width: 250px; flex: none; display: flex; flex-direction: column; border-right: 1px solid #17130d; background: rgba(10,8,6,.6); }
.cats-head { padding: 18px 16px 10px; }
.cats-head h2 { margin: 0 0 12px; font-size: 22px; }
.cats-list { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.cat { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--muted); padding: 9px 12px; border-radius: 9px; font-size: 14px; }
.cat:hover { background: var(--panel-2); color: var(--text); }
.cat.active { background: rgba(242,181,62,.12); color: var(--gold); font-weight: 600; }
.cat .n { color: var(--dim); font-size: 12px; flex: none; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-head { display: flex; gap: 12px; align-items: center; padding: 16px 20px 12px; }
.content-head .search { flex: 1; max-width: 460px; }
.content-head .count { color: var(--dim); font-size: 13px; }
.scroller { flex: 1; overflow-y: auto; position: relative; }
.vspace { position: relative; }

/* ---- Poster grid ---- */
.card { position: absolute; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1px solid #1f1a12; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.card:hover, .card.active { transform: translateY(-3px); border-color: var(--gold-2); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.card .poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: linear-gradient(160deg, #1f1a12, #0f0c08); }
.card .ph { width: 100%; aspect-ratio: 2/3; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center;
  color: var(--muted); font-weight: 600; background: linear-gradient(160deg, #241e14, #0f0c08); }
.card .meta { padding: 8px 10px 10px; }
.card .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font-size: 12px; color: var(--dim); }
.card .rate { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.72); color: var(--gold); font-size: 12px; font-weight: 700;
  padding: 2px 7px; border-radius: 7px; }
.card .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.15); }
.card .bar i { display: block; height: 100%; background: var(--gold); }
.card .fav { position: absolute; top: 8px; right: 8px; color: var(--gold); font-size: 15px; text-shadow: 0 1px 4px #000; }

/* ---- Channel list ---- */
.row { position: absolute; left: 8px; right: 8px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 10px; cursor: pointer; }
.row:hover { background: var(--panel-2); }
.row.active { background: rgba(242,181,62,.12); }
.row .num { width: 36px; color: var(--dim); font-size: 12px; text-align: right; flex: none; }
.row .logo { width: 54px; height: 34px; object-fit: contain; flex: none; border-radius: 6px; background: #0f0c08; }
.row .logo.empty { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 11px; font-weight: 700; }
.row .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.row.active .name { color: var(--gold); }
.row .star { color: var(--gold); flex: none; }

/* ---- Live preview pane ---- */
.preview { width: 46%; max-width: 760px; min-width: 420px; flex: none; display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px;
  border-left: 1px solid #17130d; overflow-y: auto; }
.screen { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid #1f1a12; }
.screen video { width: 100%; height: 100%; background: #000; }
.screen .msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 20px; }
.screen .msg.err { color: #ffb4a8; }
.epg h3 { margin: 0 0 4px; font-size: 20px; }
.epg .prog { padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid #1f1a12; margin-top: 8px; }
.epg .prog .when { font-size: 12px; color: var(--gold); font-weight: 600; }
.epg .prog .what { font-weight: 600; margin: 2px 0; }
.epg .prog .desc { font-size: 13px; color: var(--muted); }
.epg .prog .pb { height: 4px; background: #2a2418; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.epg .prog .pb i { display: block; height: 100%; background: var(--gold); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Details side panel ---- */
.detail { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 46%); background: rgba(13,11,8,.97); border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px rgba(0,0,0,.55); display: flex; flex-direction: column; z-index: 5; animation: slide .18s ease; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail .hero { position: relative; height: 260px; flex: none; background: #000 center/cover no-repeat; }
.detail .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,11,8,.1), rgba(13,11,8,1)); }
.detail .close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.6); color: var(--text); font-size: 20px; line-height: 1; }
.detail .body { flex: 1; overflow-y: auto; padding: 0 26px 26px; margin-top: -90px; position: relative; z-index: 1; }
.detail .top { display: flex; gap: 18px; align-items: flex-end; }
.detail .top img { width: 120px; border-radius: 10px; border: 1px solid var(--line); flex: none; }
.detail h2 { margin: 0 0 6px; font-size: 26px; line-height: 1.15; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 13px; }
.facts .gold { color: var(--gold); font-weight: 700; }
.detail .plot { color: #ddd4c4; margin: 16px 0; }
.detail .kv { font-size: 13px; color: var(--muted); margin: 4px 0; }
.detail .kv b { color: var(--text); font-weight: 600; }
.detail .actions { margin-top: 18px; }

/* ---- Series page ---- */
.series-hero { position: relative; min-height: 340px; display: flex; align-items: flex-end; padding: 30px 32px; background: #000 center/cover no-repeat; }
.series-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,6,4,.97) 30%, rgba(7,6,4,.5)), linear-gradient(0deg, var(--bg), transparent 50%); }
.series-hero > * { position: relative; z-index: 1; }
.series-hero .info { max-width: 760px; }
.series-hero h1 { font-size: 36px; margin: 6px 0 8px; }
.back { border: 0; background: transparent; color: var(--muted); padding: 0; font-weight: 600; }
.back:hover { color: var(--gold); }
.seasons { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 32px 14px; }
.episodes { padding: 0 32px 40px; display: grid; gap: 10px; }
.ep { display: flex; gap: 16px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid #1f1a12; cursor: pointer; align-items: center; }
.ep:hover { border-color: var(--gold-2); }
.ep .thumb { width: 200px; aspect-ratio: 16/9; flex: none; border-radius: 8px; background: #0f0c08 center/cover no-repeat; position: relative; overflow: hidden; }
.ep .thumb .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.18); }
.ep .thumb .bar i { display: block; height: 100%; background: var(--gold); }
.ep .t { font-weight: 600; }
.ep .s { color: var(--dim); font-size: 12px; margin: 2px 0 4px; }
.ep .d { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Home rows ---- */
.shelf { margin-bottom: 26px; }
.shelf h2 { font-size: 19px; margin: 0 0 12px; }
.strip { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; }
.strip .card { position: relative; width: 150px; flex: none; }
.strip .chan { width: 190px; flex: none; padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid #1f1a12; cursor: pointer; }
.strip .chan:hover { border-color: var(--gold-2); }
.strip .chan img, .strip .chan .logo { width: 100%; height: 70px; object-fit: contain; }
.strip .chan .logo { display: flex; align-items: center; justify-content: center; color: var(--dim); font-weight: 700; }
.strip .chan .name { margin-top: 10px; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-note { color: var(--dim); padding: 20px 0; }
.hello { display: flex; align-items: center; gap: 22px; padding: 22px 26px; border-radius: 16px; margin-bottom: 26px;
  background: linear-gradient(120deg, rgba(242,181,62,.14), rgba(242,181,62,.02)); border: 1px solid rgba(242,181,62,.25); }
.hello img { height: 64px; }
.hello .grow { flex: 1; }
.hello h2 { margin: 0 0 4px; font-size: 22px; }
.hello p { margin: 0; color: var(--muted); }

/* ---- Welcome / playlist form ---- */
.welcome { position: absolute; inset: 0; display: flex; padding: 30px; overflow-y: auto; }
.welcome-card { margin: auto; width: min(560px, 100%); padding: 34px; border-radius: 20px; background: rgba(20,17,12,.92); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.welcome-card .logo { width: 300px; max-width: 80%; margin: 0 auto 10px; }
.welcome-card h1 { text-align: center; font-size: 22px; margin: 6px 0 4px; }
.welcome-card .lead { text-align: center; color: var(--muted); margin: 0 0 22px; }
.form { display: grid; gap: 12px; }
.form label { font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.form .tabs { justify-self: center; margin-bottom: 4px; }
.form .err { color: #ffb4a8; font-size: 13px; min-height: 18px; }
.form .row-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.getlist { margin-top: 22px; padding: 16px 18px; border-radius: 14px; background: rgba(242,181,62,.08); border: 1px dashed rgba(242,181,62,.45);
  display: flex; align-items: center; gap: 14px; }
.getlist .grow { flex: 1; }
.getlist b { color: var(--gold); }
.getlist p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---- Modal ---- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 30px; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 26px 28px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.modal h2 { margin: 0 0 16px; font-size: 22px; }

/* ---- Settings ---- */
.settings { max-width: 860px; }
.section { margin-bottom: 30px; }
.section h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 0 0 10px; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid #1f1a12; margin-bottom: 8px; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .s { color: var(--muted); font-size: 13px; }
.badge { font-size: 11px; font-weight: 700; color: var(--on-gold); background: var(--gold); padding: 2px 8px; border-radius: 99px; margin-left: 8px; }
.toggle { width: 46px; height: 26px; border-radius: 99px; border: 0; background: #3a3224; position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #d9cfbd; transition: left .15s; }
.toggle.on { background: var(--gold-2); }
.toggle.on::after { left: 23px; background: #fff; }

/* ---- Player ---- */
.player { position: fixed; inset: 0; z-index: 50; background: #000; cursor: default; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.player.idle { cursor: none; }
.player .ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; transition: opacity .2s; }
.player.idle .ui { opacity: 0; pointer-events: none; }
.player .top { display: flex; align-items: center; gap: 14px; padding: 18px 24px 40px; background: linear-gradient(180deg, rgba(0,0,0,.8), transparent); }
.player .top .title { font-size: 20px; font-weight: 700; }
.player .top .sub { color: var(--muted); font-size: 14px; }
.player .bottom { padding: 40px 24px 18px; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); }
.player .seek { position: relative; height: 18px; cursor: pointer; display: flex; align-items: center; }
.player .seek .track { position: absolute; left: 0; right: 0; height: 5px; border-radius: 5px; background: rgba(255,255,255,.22); }
.player .seek .buf { position: absolute; left: 0; height: 5px; border-radius: 5px; background: rgba(255,255,255,.35); }
.player .seek .fill { position: absolute; left: 0; height: 5px; border-radius: 5px; background: var(--gold); }
.player .seek .knob { position: absolute; width: 15px; height: 15px; margin-left: -7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(242,181,62,.25); }
.player .seek .tip { position: absolute; bottom: 22px; transform: translateX(-50%); background: rgba(0,0,0,.85); padding: 3px 8px; border-radius: 6px; font-size: 12px; pointer-events: none; }
.player .bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.player .bar .time { color: var(--muted); font-size: 14px; margin: 0 8px; font-variant-numeric: tabular-nums; }
.player .bar .grow { flex: 1; }
.pbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.pbtn:hover { background: rgba(255,255,255,.12); color: var(--gold); }
.pbtn svg { width: 26px; height: 26px; fill: currentColor; }
.pbtn.big svg { width: 32px; height: 32px; }
.pbtn.text { width: auto; padding: 0 14px; border-radius: 22px; font-weight: 600; font-size: 14px; }
.vol { width: 90px; accent-color: var(--gold); }
.player .live-badge { background: #d33; color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 5px; letter-spacing: .06em; }
.player .center-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; text-align: center; padding: 30px; }
.player .center-msg span { background: rgba(0,0,0,.6); padding: 14px 20px; border-radius: 12px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.menu { position: absolute; right: 24px; bottom: 90px; min-width: 240px; max-height: 60vh; overflow-y: auto; background: rgba(16,13,9,.97);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.menu h4 { margin: 6px 10px 6px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 8px; }
.menu button:hover { background: var(--panel-3); }
.menu button.on { color: var(--gold); font-weight: 600; }
.menu button.on::before { content: "✓ "; }

/* ---- Loading & toast ---- */
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 80; background: #1f1a12; border: 1px solid var(--gold-deep);
  padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.6); max-width: 70vw; }
.toast button { margin-left: 12px; }

/* ---- Downloads and recordings ---- */
.rail-btn { position: relative; }
.rail-dot { position: absolute; top: 7px; right: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--bg-2); }
.rail-dot.rec { background: var(--danger); animation: rec-pulse 1.6s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .rail-dot.rec, .item.dl.live .thumb::after { animation: none; } }
.dl-btn.done { color: var(--gold); border-color: rgba(242,181,62,.45); }
.rec-btn .ico { display: inline-flex; }
.rec-btn svg, .rec-prog svg, .pbtn.text.recording svg { fill: var(--danger); }
.rec-btn.recording { border-color: rgba(255,107,90,.55); color: #ffd2cb; }
.epg .prog .what { display: flex; align-items: center; gap: 10px; }
.rec-prog { margin-left: auto; flex: none; padding: 4px 10px; font-size: 12px; }
.rec-prog svg { width: 12px; height: 12px; }
.ep .dl-btn { margin-left: auto; flex: none; }
.seasons { display: flex; align-items: center; }
.form .hint { margin: 0; font-size: 13px; color: var(--dim); }
.dl-folder { color: var(--dim); font-size: 13px; margin: -8px 0 16px; overflow-wrap: anywhere; }
.dl-list { margin-top: 16px; max-width: 1100px; }
.item.dl { align-items: center; }
.item.dl .thumb { width: 54px; height: 78px; flex: none; border-radius: 8px; background: #0f0c08 center/cover no-repeat; position: relative; }
.item.dl .thumb.logo { width: 78px; height: 54px; background-size: contain; background-color: #0f0c08; }
.item.dl.live .thumb::after { content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rec-pulse 1.6s ease-in-out infinite; }
.item.dl .t, .item.dl .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.dl .sub { color: var(--muted); font-size: 13px; }
.item.dl .s { color: var(--dim); margin-top: 2px; }
.item.dl.err .s { color: #ffb4a8; }
.item.dl .pb { height: 4px; background: #2a2418; border-radius: 4px; margin-top: 8px; overflow: hidden; max-width: 520px; }
.item.dl .pb i { display: block; height: 100%; background: var(--gold); transition: width .4s linear; }
.item.dl .actions { flex-wrap: nowrap; flex: none; }

/* ---- Subtitles ---- */
.menu .nudge { display: flex; align-items: center; gap: 6px; padding: 6px 12px 8px; color: var(--muted); font-size: 13px; }
.menu .nudge span { flex: 1; }
.menu .nudge button { display: inline-block; width: auto; padding: 6px 10px; border: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.sub-search { display: grid; grid-template-columns: 1fr 190px auto; gap: 8px; }
.sub-results { margin-top: 14px; display: grid; gap: 6px; }
.sub-row { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid #1f1a12; background: #0f0d09; color: var(--text); }
.sub-row:hover { border-color: var(--gold-2); }
.sub-row.busy { opacity: .5; pointer-events: none; }
.sub-row .n { font-weight: 600; overflow-wrap: anywhere; }
.sub-row .m { color: var(--dim); font-size: 12px; }
.empty-note.err { color: #ffb4a8; }
video::cue { font-family: "Segoe UI", system-ui, sans-serif; background: rgba(0,0,0,.55); }

/* Casting */
.pbtn.on svg { fill: var(--gold, #f2b53e); }
.cast-list { display: flex; flex-direction: column; gap: 8px; min-width: 300px; }
.cast-dev { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid #2a2318; background: #15110b; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cast-dev:hover, .cast-dev:focus-visible { border-color: var(--gold, #f2b53e); outline: none; }
.cast-dev svg { width: 22px; height: 22px; fill: var(--gold, #f2b53e); flex: none; }
.player .center-msg.above { z-index: 50; }   /* the casting panel sits over the controls layer (which lets clicks through around it) */
.casting { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 18px; text-align: center; pointer-events: auto; }
.casting svg { width: 56px; height: 56px; fill: var(--gold, #f2b53e); }
