/* ytmgr — dark media-app theme. Tokens first; every color in the app comes from here. */
:root {
    --bg: #0E1014;
    --side: #13161C;
    --panel: #161920;
    --panel-2: #1B1F27;
    --field: #0F1217;
    --raised: #1F2430;
    --line: #232834;
    --line-2: #2B3140;
    --line-3: #3A4152;
    --text: #E8EAEF;
    --text-2: #C9CED8;
    --muted: #9AA1AE;
    --nav: #AEB4C0;
    --accent: #FF6B3D;
    --accent-ink: #1A0D07;
    --accent-bg: #21160F;
    --link: #8FB0FF;
    --link-hover: #B9CEFF;
    --ok: #6EE7A0;   --ok-dot: #4ADE80;  --ok-bg: #16301F;  --ok-line: #23402E;  --ok-panel: #111A15;
    --info: #9DB8FF; --info-bar: #7AA2FF; --info-bg: #1C2A47;
    --warn: #F5CF7A; --warn-dot: #F5B841; --warn-bg: #3A2E14; --warn-panel: #1F1810; --warn-line: #5A3A1A; --warn-text: #E9D4A9;
    --err: #FF9A9A;  --err-dot: #FF7A7A; --err-bg: #3A1D22;  --err-line: #4A2A30;
    --neutral-bg: #222733;
    --radius: 14px;
    --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-head: "Space Grotesk", Inter, system-ui, sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
h1, h2, h3, .h { font-family: var(--font-head); letter-spacing: -0.01em; }
h1 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.2; }
h1:focus { outline: none; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
p { margin: 0; }
code { background: var(--neutral-bg); padding: 0 .3em; border-radius: 4px; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.ok { color: var(--ok); }
.error { color: var(--err); }
.warn { color: var(--warn); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; }
.row-flex { display: flex; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Shell */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
    flex: 1 1 220px; max-width: 248px; background: var(--side); border-right: 1px solid var(--line);
    padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 20px; color: var(--text); font-family: var(--font-head); font-size: 19px; font-weight: 700; }
.brand:hover { color: var(--text); }
.nav { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 44px; border-radius: 8px; color: var(--nav); font-weight: 500; }
.nav:hover { background: #1A1E26; color: var(--text); }
.nav.active { background: var(--raised); color: #fff; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-2); background: #262B36; border-radius: 999px; padding: 0 8px; }
.nav .count.alert { background: var(--err-bg); color: var(--err); }
.side-foot { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.side-foot button { all: unset; cursor: pointer; color: var(--nav); }
.side-foot button:hover { color: var(--text); }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 64px; display: flex; flex-direction: column; gap: 26px; }
.main.narrow > * { max-width: 1040px; }

@media (max-width: 860px) {
    .side { max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
    .brand { padding: 0 8px 0 4px; }
    .nav { height: 40px; }
    .nav .count { display: none; }
    .side-foot { display: none; }
    .main { padding: 20px 16px 48px; }
}

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head .sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.back { font-size: 13px; color: var(--nav); }
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section { display: flex; flex-direction: column; gap: 14px; }

/* Surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 18px; }
.card.list { overflow: hidden; }
.banner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--warn-line); background: var(--warn-panel); color: var(--warn-text); }
.banner strong { color: #F8D48A; }
.banner.err { border-color: var(--err-line); background: #1E1215; color: #EBC3C3; }
.banner.err strong { color: var(--err); }
.banner .text { flex: 1 1 360px; display: flex; flex-direction: column; gap: 2px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* Buttons and inputs */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
    border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
    font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--line-3); color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #FF7F57; color: var(--accent-ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--nav); }
.btn.danger { background: transparent; color: var(--err); border-color: var(--err-line); }
.btn.icon { width: 36px; height: 36px; padding: 0; }
.btn.sm.icon { width: 32px; height: 32px; }
.link-btn { all: unset; cursor: pointer; color: var(--link); }
.link-btn:hover { color: var(--link-hover); }

.input, select.input, textarea.input {
    height: 40px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--field); color: var(--text);
    font: inherit; padding: 0 12px; max-width: 100%;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input.w-sm { width: 76px; }
.input.lg { height: 44px; padding: 0 14px; width: 100%; }
.mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace; font-size: 12px; line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.search { position: relative; flex: 1 1 280px; max-width: 380px; }
.search svg { position: absolute; left: 13px; top: 12px; color: #7E8696; }
.search .input { width: 100%; padding-left: 38px; }

.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip:hover { border-color: var(--line-3); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.bad { color: var(--err); border-color: var(--err-line); }
.chip.bad.on { background: var(--err); border-color: var(--err); color: var(--bg); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.neutral { background: var(--neutral-bg); color: var(--text-2); }
.pill.manual { background: #3A2417; color: #FFB08F; }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot.ok { background: var(--ok-dot); } .dot.warn { background: var(--warn-dot); } .dot.err { background: var(--err-dot); } .dot.off { background: #5B6272; }

/* Toggle switch: a real checkbox */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; font-weight: 500; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: #323848; position: relative; flex-shrink: 0; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 19px; background: var(--accent-ink); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; align-self: flex-start; flex-wrap: wrap; }
.seg button { height: 36px; padding: 0 14px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--text); color: var(--bg); }

.radio { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; flex-wrap: wrap; }
.radio input { appearance: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #4A5163; margin: 0; cursor: pointer; flex-shrink: 0; }
.radio input:checked { border: 6px solid var(--accent); }

.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.opt { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #13161C; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.opt.on { border-color: var(--accent); background: var(--accent-bg); }
.opt small { font-size: 12px; color: var(--muted); }

.time-chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 12px; border-radius: 8px; background: var(--neutral-bg); font-weight: 600; font-size: 13px; }
.time-chip button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.time-chip button:hover { color: var(--text); background: #2C3240; }

/* Media */
.thumb { border-radius: 10px; position: relative; overflow: hidden; aspect-ratio: 16 / 9; flex-shrink: 0; background: #252A35; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .dur { position: absolute; right: 5px; bottom: 5px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 11px; font-weight: 600; padding: 0 5px; border-radius: 4px; }
.thumb .tag { position: absolute; left: 6px; top: 6px; }
.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; color: var(--bg); flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.bar { height: 6px; border-radius: 99px; background: #262B36; overflow: hidden; }
.bar > div { height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }
.bar.info > div { background: var(--info-bar); }

/* Grids and lists */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.grid-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 16px; }
.split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.split > .wide { flex: 999 1 520px; min-width: 0; }
.split > .aside { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.lrow { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid #20242E; }
.lrow:first-child { border-top: 0; }
.lrow .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lrow .actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 640px) {
    .lrow { flex-wrap: wrap; }
    .lrow .meta { flex-basis: calc(100% - 150px); }
    .lrow .actions { margin-left: auto; }
}
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-num { font-family: var(--font-head); font-size: 20px; font-weight: 600; line-height: 1.2; }
.summary { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; padding: 16px 18px; }
.summary .item { display: flex; flex-direction: column; }
.summary .item span { font-size: 12px; color: var(--muted); }

.channel-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; color: inherit; }
.channel-card:hover { border-color: var(--line-3); color: inherit; }
.channel-card.paused { opacity: .62; }

.tabs { display: flex; flex-wrap: wrap; gap: 24px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 4px; color: var(--nav); font-weight: 500; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.on { color: #fff; border-bottom-color: var(--accent); }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; }
.subtab { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 8px; color: var(--nav); font-weight: 500; border: 0; background: none; font: inherit; cursor: pointer; }
.subtab.on { background: var(--raised); color: #fff; }

/* Settings sections */
.settings { max-width: 980px; }
.set { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 24px; padding: 24px; border-top: 1px solid #20242E; }
.set:first-child { border-top: 0; }
.set > div:first-child p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ctl { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ctl.tight { gap: 4px; }
@media (max-width: 760px) { .set { grid-template-columns: 1fr; gap: 12px; padding: 18px; } }
.savebar {
    position: sticky; bottom: 16px; z-index: 5; max-width: 980px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px; border-radius: 12px; background: var(--raised); border: 1px solid #343B4B; box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}

/* Dialog */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 8, .72); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.dialog { width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); display: flex; flex-direction: column; }
.dialog.wide { max-width: 980px; }
.dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.dialog > header h2 { font-size: 22px; }
.dialog > .body { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 22px; }
.dialog > footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.preview { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); }
.checks { border-radius: 12px; border: 1px solid var(--ok-line); background: var(--ok-panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.checks.bad { border-color: var(--err-line); background: #1E1215; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.check svg { flex-shrink: 0; margin-top: 2px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 13px; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 8px 16px; border-top: 1px solid #20242E; font-size: 13px; overflow-wrap: anywhere; }
.log li:first-child { border-top: 0; }
.log li.warning { color: var(--warn); }
.log li.error { color: var(--err); }
.log .time { color: var(--muted); font-size: 12px; margin-right: 8px; }

.auth-card { max-width: 380px; margin: 12vh auto; padding: 28px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.validation-message { color: var(--err); font-size: 12px; }

#blazor-error-ui {
    background: var(--warn-panel); color: var(--text); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Player (wwwroot/player.js) */
.yp { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; outline: none; user-select: none; }
.yp:fullscreen { border-radius: 0; aspect-ratio: auto; }
.yp-video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.yp.yp-cover .yp-video { object-fit: cover; }
.yp.yp-audio .yp-video { object-fit: contain; }
.yp-big {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%;
    border: 0; background: rgba(255, 107, 61, .92); color: var(--accent-ink); cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.yp-big[hidden] { display: none; }
.yp-big:hover { background: var(--accent); }
.yp-toast {
    position: absolute; left: 50%; top: 16px; transform: translate(-50%, -8px); background: rgba(14, 16, 20, .85); color: var(--text);
    padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.yp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.yp-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; background: rgba(14, 16, 20, .92); color: var(--text-2); }
.yp-error[hidden] { display: none; }
.yp-error strong { color: var(--text); }
.yp-bar {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0)); transition: opacity .25s; opacity: 0;
}
.yp.yp-show .yp-bar, .yp.yp-paused .yp-bar, .yp:focus-within .yp-bar:hover { opacity: 1; }
.yp:not(.yp-show):not(.yp-paused) { cursor: none; }
.yp-seek { position: relative; height: 16px; cursor: pointer; touch-action: none; }
.yp-seek::before, .yp-buf, .yp-played { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 4px; border-radius: 2px; transform-origin: 0 50%; transition: height .12s, top .12s; }
.yp-seek::before { background: rgba(255, 255, 255, .22); }
.yp-buf { background: rgba(255, 255, 255, .38); transform: scaleX(0); }
.yp-played { background: var(--accent); transform: scaleX(0); }
.yp-seek:hover::before, .yp-seek:hover .yp-buf, .yp-seek:hover .yp-played { height: 6px; top: 5px; }
.yp-knob { position: absolute; top: 8px; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .12s; }
.yp-seek:hover .yp-knob { transform: scale(1); }
.yp-tip { position: absolute; bottom: 20px; transform: translateX(-50%); background: rgba(14, 16, 20, .9); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 4px; opacity: 0; pointer-events: none; white-space: nowrap; }
.yp-seek:hover .yp-tip { opacity: 1; }
.yp-row { display: flex; align-items: center; gap: 4px; color: #fff; }
.yp-btn { width: 40px; height: 40px; border: 0; background: transparent; color: #fff; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600; font-size: 13px; }
.yp-btn:hover { background: rgba(255, 255, 255, .14); }
.yp-rate { width: auto; padding: 0 10px; }
.yp-volgrp { display: inline-flex; align-items: center; }
.yp-vol { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: #fff; }
.yp-volgrp:hover .yp-vol, .yp-vol:focus { width: 80px; opacity: 1; margin-right: 6px; }
.yp-time { font-size: 13px; font-variant-numeric: tabular-nums; color: #eee; margin-left: 6px; white-space: nowrap; }
.yp-gap { flex: 1; }
.yp.yp-wait .yp-video { filter: brightness(.8); }
@media (max-width: 560px) { .yp-btn[data-a="back"], .yp-btn[data-a="fwd"], .yp-btn[data-a="fit"] { display: none; } }

/* YouTube-style feed */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px 18px; }
.vcard { display: flex; flex-direction: column; gap: 10px; color: inherit; min-width: 0; }
.vcard:hover { color: inherit; }
.vcard .thumb { width: 100%; border-radius: 12px; }
.vcard:hover .thumb img { transform: scale(1.03); }
.vcard .thumb img { transition: transform .25s; }
.vcard .info { display: flex; gap: 12px; align-items: flex-start; }
.vcard .title { font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .sub { font-size: 13px; color: var(--muted); line-height: 1.45; }
.vcard .sub a { color: inherit; }
.vcard .sub a:hover { color: var(--text); }
.vcard.watched .thumb img { opacity: .55; }
.thumb .watch { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .25); }
.thumb .watch > i { display: block; height: 100%; background: var(--accent); }
.thumb .seen { position: absolute; left: 6px; top: 6px; }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 18px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.feed-chips { position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 8px 0; margin: -8px 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.feed-chips .chip { flex-shrink: 0; }
.chip .avatar { margin-left: -8px; }
.home-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.status-strip { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.status-strip a { color: var(--text-2); }
.status-strip a:hover { color: var(--text); }

/* Watch page */
.watch { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.watch .primary { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.watch .secondary { flex: 1 1 340px; min-width: 0; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.watch h1 { font-size: 22px; line-height: 1.3; }
.watch .desc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.watch .desc.clamped { max-height: 7.5em; overflow: hidden; position: relative; }
.mini { display: flex; gap: 10px; color: inherit; align-items: flex-start; }
.mini:hover { color: inherit; }
.mini:hover .title { color: #fff; }
.mini .thumb { width: 168px; border-radius: 8px; }
.mini .title { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini .sub { font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .watch .secondary { max-width: none; } }
.line { display: block; line-height: 2.6; }
.line .input { display: inline-block; vertical-align: middle; margin: 0 4px; }
.radio .input { margin: 0 4px; }

/* Virtualized lists: no overflow on the container (it would become the scroll box), fixed-height rows */
.card.vlist { overflow: visible; }
.vrow { height: 93px; box-sizing: border-box; }
.vrow .meta .ellipsis { display: block; }
@media (max-width: 640px) { .vrow { height: auto; min-height: 93px; } }

/* Card menu (⋮ / right-click) */
.vcard { position: relative; }
.vcard .more { flex-shrink: 0; margin: -6px -8px 0 0; opacity: 0; transition: opacity .15s; }
.vcard:hover .more, .vcard .more:focus-visible, .vcard .more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .vcard .more { opacity: 1; } }
.menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.menu {
    position: absolute; right: 0; top: calc(100% - 40px); z-index: 41; min-width: 240px; padding: 6px;
    background: var(--raised); border: 1px solid #343B4B; border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    display: flex; flex-direction: column;
}
.menu button, .menu a {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
    background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.menu button:hover, .menu a:hover, .menu button:focus-visible, .menu a:focus-visible { background: #2A3040; color: var(--text); text-decoration: none; }
.menu .sep { height: 1px; background: var(--line-2); margin: 4px 6px; }

/* Playlists */
.pcard { display: flex; flex-direction: column; gap: 10px; color: inherit; }
.pcard:hover { color: inherit; }
.pcard .stackthumb { position: relative; }
.pcard .stackthumb::before { content: ""; position: absolute; left: 6%; right: 6%; top: -6px; height: 12px; border-radius: 10px 10px 0 0; background: #2A3040; }
.pcard .count { position: absolute; right: 0; top: 0; bottom: 0; width: 38%; background: rgba(14, 16, 20, .82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 600; border-radius: 0 12px 12px 0; }
.pl-row.now { background: #1E2533; }
.pl-row .pos { width: 26px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.flip { transform: rotate(180deg); }
.btn.disabled { opacity: .5; pointer-events: none; }

/* Multi-user: curator picker, read-only settings, users list */
.picker { flex-shrink: 0; }
.picker-menu { width: 280px; max-height: 60vh; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.picker-menu .check, .settings .check { align-items: center; cursor: pointer; }
.picker-menu .check .muted, .settings .check .muted { margin-left: auto; }
.picker-menu button.link-btn { width: auto; padding: 0; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] { opacity: .7; }
.user-row .actions { flex-wrap: wrap; justify-content: flex-end; }
