:root {
  --bg: #121316; --bg2: #1b1d22; --bg3: #262930; --line: #2f333b;
  --fg: #eceef2; --mute: #9aa0ab; --accent: #7c9cff; --accent2: #5a7cf0;
  --live: #ff4d5e; --up: #36c59a; --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--mute); }
.small { font-size: 12px; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 12px 32px;
  background: linear-gradient(#121316 70%, rgba(18,19,22,.85)); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #0d1020; font-size: 12px; }
nav { display: flex; gap: 4px; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--mute); font-weight: 500; }
nav a:hover { color: var(--fg); background: var(--bg3); }
nav a.active { color: var(--fg); background: var(--bg3); box-shadow: inset 0 -2px 0 var(--accent); }
.search { flex: 1; max-width: 360px; margin-left: auto; }
.search input { width: 100%; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg2); color: var(--fg); outline: none; }
.search input:focus { border-color: var(--accent); }
.sync { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

.btn { border: 0; padding: 8px 16px; border-radius: 6px; background: var(--accent); color: #0d1020; font-weight: 600; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { background: #95b0ff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--bg3); color: var(--fg); }
.btn.ghost:hover { background: #333740; }
.btn.danger { color: #ff8a95; }

.banner { margin: 16px 32px 0; padding: 10px 14px; border-radius: var(--radius); background: #1f2a44; border: 1px solid #2e4070; }
.banner.err { background: #3a1d22; border-color: #6b2d37; }

main { padding: 8px 0 60px; }
.vh { padding: 0 32px; margin: 24px 0 16px; font-size: 26px; }
.vh2 { padding: 0; margin: 32px 0 12px; font-size: 18px; }
main > p, .chans, .actions, main > .small { padding: 0 32px; }
main > .vh2 { padding: 0 32px; }

/* hero */
.hero { position: relative; margin: 20px 32px 8px; height: 340px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 80% 30%, hsl(var(--h) 45% 30%), hsl(var(--h) 40% 10%)); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,11,14,.95) 0%, rgba(10,11,14,.6) 45%, transparent 80%); }
.hero-txt { position: absolute; z-index: 1; left: 40px; bottom: 36px; max-width: 560px; }
.hero h1 { font-size: 30px; line-height: 1.15; margin: 6px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.5px; font-size: 12px; color: var(--accent); font-weight: 700; }
.play { display: inline-block; margin-top: 16px; padding: 10px 22px; font-size: 15px; }

/* rows */
.row { margin-top: 26px; }
.row h2 { margin: 0 32px 10px; font-size: 18px; display: flex; align-items: baseline; gap: 8px; }
.row h2 .muted { font-size: 13px; font-weight: 500; }
.more { margin-left: auto; font-size: 13px; color: var(--accent); font-weight: 500; }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: 260px; gap: 14px; overflow-x: auto; padding: 4px 32px 12px; scroll-snap-type: x proximity; scroll-padding-inline: 32px; scrollbar-width: thin; scrollbar-color: #3a3e47 transparent; }
.scroller > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 14px; padding: 0 32px; }
.grid.posters { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* cards */
.card { display: block; min-width: 0; }
.thumb { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg3); transition: transform .15s, box-shadow .15s; }
.card:hover .thumb, .poster:hover .pimg { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent), 0 10px 24px rgba(0,0,0,.5); }
.thumb img, .pimg > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; }
.ph span { font-size: 42px; font-weight: 800; opacity: .35; }
.badge { position: absolute; right: 6px; bottom: 8px; background: rgba(0,0,0,.8); padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge.live { background: var(--live); color: #fff; }
.badge.up { background: var(--up); color: #062118; }
.new { position: absolute; left: 6px; top: 6px; background: var(--accent); color: #0d1020; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; letter-spacing: .5px; }
.check { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--up); color: #062118; font-weight: 800; font-size: 12px; }
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.2); }
.bar i { display: block; height: 100%; background: var(--accent); }
.mark { position: absolute; right: 6px; top: 6px; border: 0; border-radius: 50%; width: 28px; height: 28px; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; font-size: 13px; }
.card:hover .mark { opacity: 1; }
.mark:hover { background: var(--accent); color: #0d1020; }
.title { margin-top: 8px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { color: var(--mute); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* show posters */
.scroller:has(.poster) { grid-auto-columns: 210px; }
.poster { display: block; min-width: 0; }
.pimg { position: relative; aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; background: var(--bg3); transition: transform .15s, box-shadow .15s; }
.pimg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.9)); }
.pname { position: absolute; z-index: 1; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; line-height: 1.2; }
.av { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; }
.av.big { width: 64px; height: 64px; }
.count { position: absolute; z-index: 1; right: 8px; top: 8px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--accent); color: #0d1020; font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.count.done { background: var(--up); color: #062118; }
.poster .sub { margin-top: 6px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.7); display: grid; place-items: start center; overflow-y: auto; padding: 48px 16px; }
.modal-card { position: relative; width: min(900px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.close { position: absolute; right: 14px; top: 14px; border: 0; background: var(--bg3); color: var(--fg); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.mhead { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-right: 40px; }
.mhead h1 { margin: 0; font-size: 24px; }
.mhead select { margin-left: auto; }
.eps { display: flex; flex-direction: column; gap: 4px; }
.ep { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: var(--radius); }
.ep:hover { background: var(--bg3); }
.ep.is-watched .title { color: var(--mute); }
.thumb.sm { width: 180px; flex: none; }
.epi { flex: 1; min-width: 0; }
.epi .title { margin-top: 0; }
.epn { display: inline-block; min-width: 26px; margin-right: 8px; padding: 0 6px; border-radius: 4px; background: var(--bg3); color: var(--mute); font-size: 12px; text-align: center; }
.mark.inline { position: static; opacity: 1; width: auto; height: auto; border-radius: 6px; padding: 6px 10px; background: var(--bg3); font-size: 12px; white-space: nowrap; }
.ep.is-watched .mark.inline { color: var(--up); }

/* channels */
.chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; margin-top: 16px; }
.chan { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); }
.ph-av { display: grid; place-items: center; font-weight: 700; }
.cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select { background: var(--bg3); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

.empty { margin: 80px auto; max-width: 520px; text-align: center; color: var(--mute); padding: 0 24px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .search { order: 5; max-width: none; flex-basis: 100%; }
  .hero { margin: 16px; height: 260px; }
  .row h2, .vh { margin-left: 16px; margin-right: 16px; padding: 0; }
  .scroller, .grid { padding-left: 16px; padding-right: 16px; }
}

.prefs { padding: 0 32px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.prefs label { display: flex; align-items: center; gap: 10px; color: var(--mute); }
.prefs .chk input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- genres ---------- */
.scroller:has(.gtile) { grid-auto-columns: 240px; }
.gtiles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gtile { position: relative; display: block; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; padding: 16px;
  background: linear-gradient(135deg, hsl(var(--gh) 55% 32%), hsl(calc(var(--gh) + 40) 50% 14%)); transition: transform .15s, box-shadow .15s; }
.gtile:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px hsl(var(--gh) 70% 65%), 0 10px 24px rgba(0,0,0,.5); }
.gthumbs { position: absolute; right: -18px; bottom: -10px; width: 62%; height: 80%; }
.gthumbs img { position: absolute; width: 78%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.gthumbs img:nth-child(1) { right: 0; bottom: 0; transform: rotate(6deg); z-index: 3; }
.gthumbs img:nth-child(2) { right: 14%; bottom: 18%; transform: rotate(-4deg); z-index: 2; opacity: .85; }
.gthumbs img:nth-child(3) { right: 28%; bottom: 36%; transform: rotate(3deg); z-index: 1; opacity: .6; }
.gname { position: relative; z-index: 4; font-size: 20px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.6); max-width: 70%; line-height: 1.15; }
.gcount { position: relative; z-index: 4; margin-top: 4px; font-size: 12.5px; color: rgba(255,255,255,.8); text-shadow: 0 1px 4px rgba(0,0,0,.6); max-width: 65%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 32px 18px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--bg3); color: var(--mute); font-size: 13px; font-weight: 500; border: 1px solid transparent; }
.chip:hover { color: var(--fg); border-color: var(--line); }
.chip.on { color: #0d1020; background: var(--accent); }
.chip.on[style] { background: hsl(var(--gh) 70% 70%); }
.ghead { margin: 20px 32px 16px; padding: 28px 28px 24px; border-radius: 12px; background: linear-gradient(120deg, hsl(var(--gh) 55% 28%), hsl(calc(var(--gh) + 40) 45% 12%) 70%); }
.ghead h1 { margin: 6px 0 0; font-size: 34px; }
.ghead .back { color: rgba(255,255,255,.75); font-size: 13px; }
.glink { color: var(--accent); }
.chan select[data-genre] { max-width: 150px; }
.mhead select[data-genre] { margin-left: auto; }
.mhead select[data-genre] + select { margin-left: 0; }
@media (max-width: 900px) { .chips { padding: 0 16px 14px; } .ghead { margin: 16px; } }

.btn.google { background: #fff; color: #1f1f1f; display: inline-flex; align-items: center; gap: 8px; }
.btn.google:hover { background: #e8eaed; }
.btn.google::before { content: ""; width: 16px; height: 16px; flex: none; background: conic-gradient(from -45deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); border-radius: 50%; -webkit-mask: radial-gradient(circle, transparent 3.5px, #000 4px); mask: radial-gradient(circle, transparent 3.5px, #000 4px); }
.foot { padding: 24px 32px 40px; color: var(--mute); font-size: 12px; text-align: center; }
.foot a { color: var(--mute); text-decoration: underline; }
@media (max-width: 900px) {
  nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  nav::-webkit-scrollbar { display: none; }
  nav a { white-space: nowrap; }
  .sync { margin-left: auto; }
}

/* ---------- preferences (onboarding) ---------- */
body.onboarding .top nav, body.onboarding .top .search { visibility: hidden; }
.welcome { max-width: 1100px; margin: 0 auto; padding: 40px 32px 120px; }
.welcome h1 { font-size: 36px; margin: 0 0 8px; }
.welcome > p { max-width: 640px; margin: 0 0 28px; font-size: 15px; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.ptile { position: relative; aspect-ratio: 16/9; border: 0; border-radius: 12px; padding: 14px; cursor: pointer; text-align: left; display: flex; align-items: flex-end;
  color: #fff; font: inherit; background: linear-gradient(135deg, hsl(var(--gh) 50% 30%), hsl(calc(var(--gh) + 40) 45% 13%));
  box-shadow: inset 0 0 0 2px transparent; transition: transform .12s, box-shadow .12s, filter .12s; filter: saturate(.75) brightness(.85); }
.ptile:hover { transform: translateY(-2px); filter: none; }
.ptile.on { filter: none; box-shadow: inset 0 0 0 3px hsl(var(--gh) 75% 68%), 0 8px 24px rgba(0,0,0,.45); }
.pname { font-size: 17px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.pcheck { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: rgba(0,0,0,.35); color: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.ptile.on .pcheck { background: hsl(var(--gh) 75% 68%); color: #0d1020; box-shadow: none; }
.pregion { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; color: var(--mute); flex-wrap: wrap; }
.pbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 32px;
  background: linear-gradient(transparent, rgba(18,19,22,.95) 30%); }
.pbar .btn { padding: 12px 22px; font-size: 15px; }
.pad { padding: 0 32px; }
@media (max-width: 600px) {
  .welcome { padding: 24px 16px 120px; }
  .welcome h1 { font-size: 28px; }
  .ptiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pbar { padding: 12px 16px; }
  .pbar .btn { flex: 1; }
}

/* ---------- favorites ---------- */
.fav { position: absolute; top: 6px; right: 40px; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(0,0,0,.75); color: #fff; opacity: 0; transition: opacity .15s, transform .1s; }
.fav svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.card:hover .fav, .scard:hover .fav, .poster:hover .fav, .fav.on, .fav:focus-visible { opacity: 1; }
.fav:hover { transform: scale(1.1); }
.fav.on { color: #ff6b81; }
.fav.on svg { fill: currentColor; }
.fav.onposter { right: auto; left: 8px; top: 8px; z-index: 2; }

.badge.kind { left: 6px; right: auto; bottom: 8px; background: rgba(124,156,255,.92); color: #0d1020; font-size: 10.5px; letter-spacing: .6px; font-weight: 800; }
.favwide { display: inline-flex; align-items: center; gap: 8px; }
.favwide svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.favwide.on { color: #ff6b81; }
.favwide.on svg { fill: currentColor; }
.favadd { display: flex; gap: 10px; padding: 0 32px; max-width: 720px; }
.favadd input { flex: 1; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg2); color: var(--fg); font: inherit; outline: none; }
.favadd input:focus { border-color: var(--accent); }
.favmsg { padding: 8px 32px 0; min-height: 22px; font-size: 13px; color: var(--mute); }
.favmsg.err { color: #ff8a95; }
.favmsg.ok { color: var(--up); }

/* ---------- Shorts ---------- */
.scroller:has(.scard) { grid-auto-columns: 168px; }
.scard { display: block; min-width: 0; }
.sthumb { position: relative; aspect-ratio: 9/16; border-radius: 10px; overflow: hidden; background: var(--bg3); transition: transform .15s, box-shadow .15s; }
.scard:hover .sthumb { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent), 0 10px 24px rgba(0,0,0,.5); }
.sthumb img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); }
.sthumb .ph span { font-size: 36px; }
@media (hover: none) { .fav { opacity: 1; background: rgba(0,0,0,.55); } }

/* ---------- ⋯ menu, removing, undo ---------- */
.more { position: absolute; top: 6px; right: 6px; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(0,0,0,.75); color: #fff; opacity: 0; transition: opacity .15s; }
.more svg { width: 16px; height: 16px; fill: currentColor; }
.more:hover { background: var(--accent); color: #0d1020; }
.card:hover .more, .scard:hover .more, .poster:hover .more, .more:focus-visible { opacity: 1; }
.thumb .fav:not(:has(~ .more)) { right: 6px; }
.more.onposter { top: 8px; right: 8px; }
.poster .count { top: auto; bottom: 46px; }
.menu { position: fixed; z-index: 300; min-width: 230px; max-width: 320px; padding: 6px; border-radius: 10px; background: #1f2128; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 13.5px; padding: 9px 12px; border-radius: 6px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--bg3); outline: none; }
.menu button.danger { color: #ff8a95; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 400; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 10px; background: #2a2d36; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast .btn { padding: 6px 14px; color: var(--accent); }
.xbtn { border: 0; background: transparent; color: var(--mute); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; flex: none; font-size: 13px; }
.xbtn:hover { background: #3a1d22; color: #ff8a95; }
.removed { padding: 0 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ritem { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); }
.ritem > div { min-width: 0; }
.rtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ritem .btn { padding: 6px 12px; font-size: 13px; }
.mhead .danger { margin-left: auto; }
.mhead .danger ~ select[data-genre] { margin-left: 0; }
@media (hover: none) { .more { opacity: 1; background: rgba(0,0,0,.55); } }

/* ---------- music ---------- */
.music-head p { margin: 6px 0 0; color: rgba(255,255,255,.75); }
.more-link { margin-left: auto; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.row h2 .more-link + .more { position: static; }
.scroller:has(.tcard) { grid-auto-columns: 190px; }
.tcard, .plcard { display: block; min-width: 0; }
.tthumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg3); transition: transform .15s, box-shadow .15s; }
.tthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard:hover .tthumb, .plcard:hover .plthumb { transform: translateY(-2px); box-shadow: 0 0 0 2px hsl(330 70% 70%), 0 10px 24px rgba(0,0,0,.5); }
.tplay { position: absolute; left: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: hsl(330 75% 68%); color: #1a0d14; font-size: 15px; opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.tcard:hover .tplay { opacity: 1; transform: none; }
.tcard:hover .fav, .tcard:hover .more, .plcard:hover .more { opacity: 1; }
.scroller:has(.plcard) { grid-auto-columns: 250px; }
.plthumb { position: relative; aspect-ratio: 16/9; border-radius: 10px; background: var(--bg3); margin-top: 8px; transition: transform .15s, box-shadow .15s; }
.plthumb > img, .plthumb > .ph { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; }
.plstack { position: absolute; left: 8%; right: 8%; top: -8px; height: 20px; border-radius: 8px 8px 0 0; background: #3a3e4a; }
.plthumb .badge { z-index: 2; }
.plhead { display: flex; gap: 28px; align-items: flex-end; margin: 24px 32px 8px; padding: 24px; border-radius: 14px; background: linear-gradient(120deg, hsl(330 45% 24%), hsl(270 40% 12%) 70%); }
.plart { width: 300px; max-width: 40%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; flex: none; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.plart img, .plart .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.plinfo h1 { margin: 6px 0; font-size: 30px; }
.plinfo .back { color: rgba(255,255,255,.75); font-size: 13px; }
.plbtns { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tracks { padding: 8px 24px 0; display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: 36px 64px 1fr auto 36px; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; }
.trow:hover { background: var(--bg2); }
.tn { color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }
.trthumb { width: 64px; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: var(--bg3); }
.trthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tinfo { min-width: 0; display: flex; flex-direction: column; }
.ttitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdur { color: var(--mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.fav.inrow { position: static; opacity: 0; }
.trow:hover .fav.inrow, .fav.inrow.on { opacity: 1; }
@media (max-width: 700px) {
  .plhead { flex-direction: column; align-items: flex-start; margin: 16px; }
  .plart { width: 100%; max-width: none; }
  .tracks { padding: 8px 8px 0; }
  .trow { grid-template-columns: 26px 56px 1fr 32px; }
  .tdur { display: none; }
}

/* ---------- settings ---------- */
.gear { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; color: var(--mute); flex: none; }
.gear svg { width: 22px; height: 22px; fill: currentColor; }
.gear:hover, .gear.active { color: var(--fg); background: var(--bg3); }
.gear.active { box-shadow: inset 0 -2px 0 var(--accent); }
.layout { list-style: none; margin: 8px 32px 16px; padding: 0; max-width: 760px; display: flex; flex-direction: column; gap: 6px; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); user-select: none; }
.lrow.off .lname { opacity: .5; }
.lrow.dragging { opacity: .5; border-style: dashed; border-color: var(--accent); }
.grip { color: var(--mute); cursor: grab; letter-spacing: -2px; font-size: 14px; padding: 0 2px; }
.lname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lname b { font-weight: 600; }
.lmove { display: flex; gap: 4px; }
.lmove button { width: 32px; height: 32px; border: 0; border-radius: 6px; background: var(--bg3); color: var(--fg); cursor: pointer; font-size: 15px; }
.lmove button:hover:not(:disabled) { background: #333740; }
.lmove button:disabled { opacity: .3; cursor: default; }
.switch { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 11px; background: #3a3e47; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 700px) { .layout { margin: 8px 16px 16px; } .lrow .sub { display: none; } .grip { display: none; } }

/* ---------- search ---------- */
.vh2.sect { padding: 0 32px; margin: 28px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--mute); }
.vh2.sect .muted { font-size: 12px; }
.ytsearch { padding: 6px 32px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ytbtn { background: #ff4d5e; color: #fff; padding: 12px 20px; font-size: 15px; }
.ytbtn:hover { background: #ff6b79; }

/* ---------- profiles ---------- */
.profile-btn { width: 38px; height: 38px; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer; flex: none; display: grid; place-items: center; }
.profile-btn:hover .pav, .profile-btn:focus-visible .pav { box-shadow: 0 0 0 2px var(--accent); }
.pav { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex: none; }
.pav.lg { width: 44px; height: 44px; font-size: 18px; }
.plist { padding: 0 32px; display: flex; flex-direction: column; gap: 8px; max-width: 760px; margin-bottom: 12px; }
.prow { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.prow.on { border-color: var(--accent); }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prow .btn { padding: 6px 12px; font-size: 13px; }
@media (max-width: 700px) { .plist { padding: 0 16px; } .prow { flex-wrap: wrap; } }

/* ---------- sort/filter tools, show bar, channels tools ---------- */
.tools { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 0 32px 16px; color: var(--mute); }
.tools label { display: flex; align-items: center; gap: 8px; }
.tools .chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.playbar:empty { display: none; }
.playbar { padding-bottom: 12px; }
.playbar .more-link { margin: 0; }
.showbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 16px; }
.seg { margin-left: auto; display: inline-flex; background: var(--bg3); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--mute); font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.seg button.on { background: var(--bg2); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.chtools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 0 32px 12px; }
.chsearch { flex: 1; min-width: 200px; max-width: 360px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg2); color: var(--fg); font: inherit; outline: none; }
.chsearch:focus { border-color: var(--accent); }
.bulk { position: sticky; top: 64px; z-index: 15; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 0 32px 12px; padding: 10px 14px; border-radius: 10px; background: #1f2a44; border: 1px solid #2e4070; }
.bulk label { display: flex; align-items: center; gap: 8px; color: var(--mute); }
.chans { padding: 0 32px; }
.chan .cname { display: flex; flex-direction: column; }
.chan .cname .sub { font-size: 12px; white-space: normal; }
.chan .cname .sub a { color: var(--accent); }
.chan.sel { border-color: var(--accent); background: #1d2236; }
.chsel { accent-color: var(--accent); width: 16px; height: 16px; flex: none; cursor: pointer; }
.filebtn { cursor: pointer; }
@media (max-width: 700px) { .tools, .chtools, .chans { padding-left: 16px; padding-right: 16px; } .bulk { margin: 0 16px 12px; } .seg { margin-left: 0; } }
.chans { grid-template-columns: 1fr; max-width: 1100px; gap: 6px; }
.chan { gap: 12px; }
.chan .cname { flex: 1; min-width: 160px; }
.chan .cname b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.chan select { flex: none; }
@media (max-width: 700px) { .chan { flex-wrap: wrap; } .chan .cname { flex-basis: calc(100% - 90px); } }

/* ---------- collections ---------- */
.pdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: hsl(var(--gh) 65% 60%); flex: none; }
.newtile { display: flex; flex-direction: column; gap: 10px; justify-content: center; background: var(--bg2); border: 2px dashed var(--line); }
.newtile:hover { transform: none; box-shadow: none; border-color: var(--accent); }
.newtile .gname { max-width: none; font-size: 17px; text-shadow: none; }
.newtile input { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; }
.newtile .btn { align-self: flex-start; }
.chead .cbtns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.chead .chk { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.85); }
.chead .chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.chead .btn.ghost { background: rgba(0,0,0,.25); }
.chead .btn.ghost .pdot { margin-right: 4px; vertical-align: -1px; }
.cchips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 32px 14px; }
.cchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--bg3); font-size: 13px; }
.cchip button { border: 0; background: transparent; color: var(--mute); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; }
.cchip button:hover { background: #3a1d22; color: #ff8a95; }
.picker { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.pickcard { width: min(420px, 100%); max-height: 85vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.pickcard h3 { margin: 0 0 4px; font-size: 17px; }
.pickcard > p { margin: 0 0 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picklist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.pickrow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.pickrow:hover { background: var(--bg3); }
.pickrow input { accent-color: var(--accent); width: 17px; height: 17px; }
.picknew { display: flex; gap: 8px; }
.picknew input { flex: 1; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; }
.pickfoot { display: flex; justify-content: flex-end; margin-top: 16px; }
.scroller:has(.ctile) { grid-auto-columns: 240px; }
@media (max-width: 700px) { .cchips { padding: 0 16px 14px; } }

/* keep search usable as the menu grows */
.top { gap: 16px; }
nav { min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { white-space: nowrap; }
.search { min-width: 170px; flex: 1 1 220px; }
@media (max-width: 1400px) { nav a { padding: 6px 9px; } .brand { font-size: 17px; } }
@media (max-width: 1180px) { #syncStatus { display: none; } }

/* ---------- sign-in agreement, attribution ---------- */
.consent { color: var(--mute); font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.consent.small { font-size: 12.5px; }
.consent a { color: var(--accent); }
.empty .consent { margin: 18px auto 0; max-width: 520px; }
.consentcard { width: min(480px, 100%); }
.consentcard .pickfoot { gap: 10px; }
.ytattr b { color: var(--fg); }
.foot { line-height: 1.9; }
.consentcard > p.consent { white-space: normal; overflow: visible; }
