/* ---------- tokens ---------- */
/* Dark is the default look; light is chosen in Settings (data-theme="light"). */
:root {
  --chart: #00D8F0;
  --bg: #0B0B0C; --surface: #141416; --sunk: #1C1C1F; --sunk-2: #27272B; --line: #26262B;
  --ink: #F6F6F4; --muted: #A1A1A6; --accent: #00E5FF; --accent-hover: #5CF0FF; --accent-ink: #0B0B0C;
  --accent-text: #5CEFFF; --accent-soft: rgba(0,229,255,.13); --danger: #FF6B5B; --ok: #5FD38A;
  --grad: linear-gradient(135deg, #7DFBFF 0%, #00E5FF 55%, #00B4D8 100%);
  --glow: 0 8px 28px rgba(0,229,255,.35);
  --topbar: rgba(11,11,12,.78);
  --shadow: 0 16px 40px rgba(0,0,0,.6);
  --is-dark: 1;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --side-w: 236px; --top-h: 64px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --chart: #0091A8;
  --bg: #FAFAF8; --surface: #FFFFFF; --sunk: #F1F0EE; --sunk-2: #E7E5E2; --line: #E6E4E0;
  --ink: #0B0B0C; --muted: #5E5E63; --accent: #00C8E0; --accent-hover: #00B4CC; --accent-ink: #0B0B0C;
  --accent-text: #007A8F; --accent-soft: #DDF9FC; --danger: #C21807; --ok: #1F7A3A;
  --glow: 0 8px 24px rgba(0,180,210,.30);
  --topbar: rgba(250,250,248,.82);
  --shadow: 0 16px 36px rgba(0,0,0,.12);
  --is-dark: 0;
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
html { min-height: 100%; }
body { min-height: 100vh; min-height: 100dvh; font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.status { color: var(--muted); padding: 60px 0; text-align: center; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0; display: flex; align-items: center; gap: 12px;
  background: var(--bg); border-bottom: 3px solid var(--accent);
}
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 800 24px/1 var(--display); letter-spacing: -.03em; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--sunk); }
.search { flex: 1 1 auto; max-width: 620px; margin-inline: auto; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line); border-right: 0; background: var(--surface); border-radius: 999px 0 0 999px; padding: 0 18px; }
.search input:focus { outline: none; border-color: var(--accent); }
.search-btn { width: 60px; height: 42px; border: 1px solid var(--line); background: var(--sunk); border-radius: 0 999px 999px 0; cursor: pointer; display: grid; place-items: center; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.menu a:hover, .menu button:hover { background: var(--sunk); }
.menu .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who b { display: block; }

/* ---------- buttons & fields ---------- */
.btn { border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; line-height: 1.3; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-ghost { background: var(--sunk); color: var(--ink); }
.btn-ghost:hover { background: var(--sunk-2); }
.btn-ghost[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.field { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.field { resize: vertical; }
label.lbl { display: grid; gap: 6px; font-weight: 600; font-size: 13.5px; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.err { color: var(--danger); font-size: 14px; margin: 0; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); height: calc(100dvh - var(--top-h) - env(safe-area-inset-top, 0px)); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.side a:hover, .side .navlink:hover { background: var(--sunk); }
.side .navlink { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 10px; font-weight: 500; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.side svg { flex: none; }
.side h4 { margin: 16px 12px 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; width: auto; }
.side .foot { margin-top: auto; padding: 14px 12px 4px; font-size: 12px; color: var(--muted); }
.side .subs a { padding: 6px 12px; }
.side .side-note { margin: 0; padding: 4px 12px 8px; }
.plain { text-decoration: none; }
.side .ls { display: none; }
@media (min-width: 901px) {
  .shell.collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .shell.collapsed .side { padding: 12px 0; overflow-x: hidden; gap: 4px; }
  .shell.collapsed .side a, .shell.collapsed .side .navlink { flex-direction: column; justify-content: center; gap: 5px; font-size: 10px; line-height: 1.2; padding: 14px 2px; text-align: center; width: 100%; min-width: 0; }
  .shell.collapsed .side a span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell.collapsed .side a:has(.ls) .lf { display: none; }
  .shell.collapsed .side a .ls { display: block; }
  .shell.collapsed .side .mh, .shell.collapsed .side h4, .shell.collapsed .side hr, .shell.collapsed .side .subs, .shell.collapsed .side .foot, .shell.collapsed .side .side-note { display: none; }
}
main { padding: 16px 24px 64px; min-width: 0; outline: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: 270px; z-index: 40; background: var(--bg); transform: translateX(-100%); transition: transform .2s; padding-top: calc(16px + env(safe-area-inset-top, 0px)); border-right: 1px solid var(--line); }
  .side.open { transform: none; }
  main { padding: 12px 16px 64px; }
}
@media (min-width: 901px) { body:not(.watch-mode) .scrim { display: none !important; } }
/* Watch page: like YouTube, the menu becomes a slide-out drawer so the video gets the full width */
body.watch-mode .shell, body.watch-mode .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
body.watch-mode .side { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: 270px; z-index: 40; background: var(--bg); transform: translateX(-100%); transition: transform .2s; padding: calc(16px + env(safe-area-inset-top, 0px)) 12px 12px; border-right: 1px solid var(--line); visibility: hidden; transition: transform .2s, visibility .2s; }
body.watch-mode .side.open { transform: none; visibility: visible; box-shadow: var(--shadow); }
body.watch-mode .shell.collapsed .side a, body.watch-mode .shell.collapsed .side .navlink { flex-direction: row; gap: 14px; font-size: inherit; padding: 9px 12px; text-align: left; }
body.watch-mode .shell.collapsed .side h4, body.watch-mode .shell.collapsed .side hr, body.watch-mode .shell.collapsed .side .subs, body.watch-mode .shell.collapsed .side .foot, body.watch-mode .shell.collapsed .side .side-note { display: revert; }
body.watch-mode .shell.collapsed .side .mh { display: flex; }
body.watch-mode .shell.collapsed .side a .lf { display: block; }
body.watch-mode .shell.collapsed .side a .ls { display: none; }
body.watch-mode main { padding: 20px 24px 64px; }
@media (max-width: 600px) { body.watch-mode main { padding: 0 0 64px; } body.watch-mode .watch > div > :not(.player) , body.watch-mode .up-next { margin-inline: 12px; } body.watch-mode .player { border-radius: 0; } }
@media (max-width: 600px) {
  .logo span:last-child { display: none; }
  .search-btn { width: 46px; }
  .top-actions .btn-label { display: none; }
}

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); background: var(--bg); z-index: 5; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--sunk); border-radius: 8px; padding: 7px 14px; cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 14px; }
.chip:hover { background: var(--sunk-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- video grid ---------- */
.page-title { font: 800 clamp(24px, 3vw, 32px)/1.1 var(--display); letter-spacing: -.02em; margin: 8px 0 18px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 16px; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; min-width: 0; }
.thumb { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 12px; overflow: hidden; background: var(--sunk); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, #000 30%, var(--accent)); }
.card:hover .thumb img { transform: scale(1.04); }
.dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.82); color: #fff; font: 500 12px/1 var(--mono); padding: 4px 6px; border-radius: 5px; }
.badge { position: absolute; left: 8px; top: 8px; background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 700; padding: 3px 7px; border-radius: 5px; text-transform: uppercase; letter-spacing: .04em; }
.card-meta { display: flex; gap: 12px; min-width: 0; }
.card-meta > div { min-width: 0; }
.card h3 { margin: 0 0 4px; font: 600 16px/1.35 var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.sub a { text-decoration: none; }
.sub a:hover { color: var(--ink); }
.more { display: flex; justify-content: center; padding: 28px 0; }

/* ---------- avatar ---------- */
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 15px/1 var(--display); color: #fff; overflow: hidden; background: var(--ink); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.h0 { background: #00E5FF; color: #000; }
.avatar.h1 { background: #111; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.avatar.h2 { background: #C24100; color: #fff; }
.avatar.h3 { background: #3D3D3D; color: #fff; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.md { width: 40px; height: 40px; }
.avatar.xl { width: 120px; height: 120px; font-size: 48px; }
@media (max-width: 600px) { .avatar.xl { width: 80px; height: 80px; font-size: 32px; } }
.avatar-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }

/* ---------- watch ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 402px; gap: 24px; max-width: 1754px; margin-inline: auto; align-items: start; }
@media (max-width: 1016px) { .watch { grid-template-columns: minmax(0, 1fr); } }
.player { width: 100%; aspect-ratio: 16 / 9; max-height: calc(100dvh - 150px); min-height: 200px; background: #000; border-radius: 12px; display: block; object-fit: contain; }
@media (max-width: 1016px) { .player { max-height: 70dvh; } }
.watch h1 { font: 700 clamp(19px, 2.2vw, 24px)/1.3 var(--display); margin: 14px 0 12px; overflow-wrap: anywhere; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row .grow { flex: 1 1 auto; min-width: 0; }
.chan-line { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.chan-line b { display: block; }
.desc { background: var(--sunk); border-radius: 12px; padding: 12px 14px; margin-top: 14px; }
.desc .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.desc .text.clamp { max-height: 4.5em; overflow: hidden; }
.linkish { background: none; border: 0; padding: 0; font-weight: 700; cursor: pointer; margin-top: 6px; }
.comments h2 { font: 700 20px/1.2 var(--display); margin: 26px 0 16px; }
.c-form { display: flex; gap: 12px; margin-bottom: 26px; }
.c-form .col { flex: 1; display: grid; gap: 8px; }
.c-form .actions { display: flex; justify-content: flex-end; gap: 8px; }
.c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.c-list li { display: flex; gap: 12px; }
.c-list .body { flex: 1; min-width: 0; }
.c-list p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.c-list .who { font-weight: 700; font-size: 13.5px; text-decoration: none; }
.up-next { min-width: 0; }
@media (max-width: 1016px) {
  .up-next { margin-top: 8px; }
  /* phones/tablets: suggestions right after the video details, comments last (like YouTube) */
  .watch { grid-template-columns: minmax(0, 1fr); }
  .watch { row-gap: 0; }
  .watch > div:first-child { display: contents; }
  .watch .up-next { margin-top: 20px; }
  .watch .up-next { order: 2; }
  .watch .comments { order: 3; }
}
.up-next h2 { font: 700 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.up-next .list { display: grid; gap: 10px; }
.mini { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; text-decoration: none; border-radius: 10px; }
.mini:hover h3 { color: var(--accent-text); }
.mini .dur { font-size: 11px; right: 4px; bottom: 4px; }
.mini .thumb { border-radius: 8px; }
.mini h3 { margin: 0 0 4px; font: 600 14.5px/1.3 var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 480px) { .mini { grid-template-columns: 140px minmax(0, 1fr); } }

/* ---------- channel ---------- */
.banner { height: clamp(90px, 16vw, 200px); border-radius: 16px; background:
  repeating-linear-gradient(-45deg, rgba(0,0,0,.14) 0 14px, transparent 14px 28px), linear-gradient(110deg, #000 0%, #000 38%, var(--accent) 100%); }
.chan-head { display: flex; gap: 24px; align-items: center; padding: 20px 0; flex-wrap: wrap; }
.chan-head h1 { font: 800 clamp(26px, 4vw, 38px)/1.05 var(--display); letter-spacing: -.02em; margin: 0 0 6px; }
.chan-head .grow { flex: 1 1 260px; min-width: 0; }
.bio { color: var(--muted); max-width: 70ch; margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { background: none; border: 0; padding: 10px 16px; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }

/* ---------- forms / pages ---------- */
.narrow { max-width: 440px; margin: 40px auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 16px; }
@media (max-width: 480px) { .panel { padding: 20px; } }
.panel h1 { font: 800 30px/1.05 var(--display); letter-spacing: -.02em; margin: 0; }
.panel .alt { text-align: center; color: var(--muted); margin: 0; }
.panel .alt a { color: var(--accent-text); font-weight: 700; }
.studio { max-width: 1000px; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 820px) { .studio-grid { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }
.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 48px 20px; text-align: center; cursor: pointer; display: grid; gap: 8px; justify-items: center; background: var(--surface); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { font: 700 20px/1.2 var(--display); }
.drop .ring { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.preview { position: sticky; top: calc(var(--top-h) + 16px); display: grid; gap: 12px; }
.preview video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; }
.thumb-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb-pick button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--sunk); aspect-ratio: 16/9; }
.thumb-pick button[aria-pressed="true"] { border-color: var(--accent); }
.thumb-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.progress { height: 8px; background: var(--sunk); border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.settings { max-width: 720px; display: grid; gap: 20px; }
.settings .panel h2 { font: 700 20px/1.2 var(--display); margin: 0; }
.settings .lead { margin: -8px 0 0; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .themes { grid-template-columns: 1fr; } }
.theme-card { border: 2px solid var(--line); border-radius: 14px; padding: 10px; background: var(--surface); cursor: pointer; display: grid; gap: 8px; text-align: left; }
.theme-card[aria-pressed="true"] { border-color: var(--accent); }
.theme-card b { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.theme-card .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); }
.theme-card[aria-pressed="true"] .tick { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--accent); }
.swatch { display: grid; grid-template-rows: 18% 1fr; aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; border: 1px solid rgba(128,128,128,.25); }
.swatch i { display: block; }
.swatch .sbar { display: flex; align-items: center; gap: 5px; padding: 0 8px; border-bottom: 2px solid #00E5FF; }
.swatch .sdot { width: 9px; height: 9px; border-radius: 3px; background: #00E5FF; }
.swatch .sline { height: 5px; border-radius: 3px; width: 40%; }
.swatch .sbody { display: grid; grid-template-columns: 26% 1fr; gap: 6px; padding: 7px; }
.swatch .sside { display: grid; gap: 4px; align-content: start; }
.swatch .sside i { height: 5px; border-radius: 3px; }
.swatch .sside i:first-child { background: #00E5FF !important; }
.swatch .sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; align-content: start; }
.swatch .sgrid i { aspect-ratio: 16 / 9; border-radius: 4px; }
.sw-light { background: #fff; } .sw-light .sline, .sw-light .sside i { background: #000; } .sw-light .sgrid i { background: #E6E6E6; }
.sw-dark { background: #000; } .sw-dark .sline, .sw-dark .sside i { background: #fff; } .sw-dark .sgrid i { background: #262626; }
.sw-system { background: linear-gradient(135deg, #fff 50%, #000 50%); } .sw-system .sline, .sw-system .sside i { background: #888; } .sw-system .sgrid i { background: rgba(136,136,136,.35); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.set-row > div { flex: 1 1 240px; min-width: 0; }
.set-row b { display: block; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; background: var(--line); border: 0; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.av-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- table (studio list) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--sunk); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.t-video { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.t-video .thumb { width: 120px; flex: none; border-radius: 6px; }
.t-video a { font-weight: 600; text-decoration: none; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--sunk); }
.pill.pub { background: var(--accent-soft); color: var(--accent-text); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font: 800 28px/1.1 var(--display); font-variant-numeric: tabular-nums; }

/* ---------- empty ---------- */
.empty { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 40px 0; max-width: 1200px; }
.empty h1 { font: 800 clamp(36px, 5.5vw, 68px)/1 var(--display); letter-spacing: -.035em; margin: 0 0 16px; }
.empty h1 em { font-style: normal; color: var(--accent); }
.empty p { color: var(--muted); max-width: 52ch; font-size: 17px; margin: 0 0 22px; }
.screen { aspect-ratio: 16/10; border-radius: 18px; background: var(--sunk); padding: 16px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 2fr 1fr; gap: 10px; }
.screen div { border-radius: 10px; background: var(--sunk-2); }
.screen div:first-child { grid-column: span 3; background: linear-gradient(110deg, #000 35%, var(--accent)); position: relative; }
.screen div:first-child::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-left: 30px solid #fff; border-top: 18px solid transparent; border-bottom: 18px solid transparent; }
@media (max-width: 760px) { .empty { grid-template-columns: 1fr; padding: 20px 0; } }

/* ---------- modal ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog .panel { border: 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); }
.toast.bad { background: var(--danger); color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- storage / danger zone ---------- */
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:disabled { opacity: .45; }
.storage-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.storage-total b { font: 800 30px/1 var(--display); }
.storage-table { min-width: 0; }
.storage-table td { padding: 8px 12px; }
.clear-form { border-top: 1px solid var(--line); padding-top: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- social sign-in ---------- */
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.social { display: grid; gap: 10px; }
.social-btn { width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 11px 18px; }
.social-btn:hover { background: var(--sunk); }
.social-apple { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.social-apple:hover { background: var(--ink); opacity: .88; }
.social-facebook { background: #1877F2; color: #fff; border-color: #1877F2; }
.social-facebook:hover { background: #166FE5; }
main:focus, main:focus-visible { outline: none; }

/* ---------- hover preview ---------- */
.thumb video.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .25s; pointer-events: none; }
.thumb.previewing video.preview { opacity: 1; }
.thumb.previewing { border-radius: 0; }
.card .thumb { transition: border-radius .2s; }
.thumb.previewing .dur { opacity: 0; }
.pv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.3); opacity: 0; z-index: 2; }
.pv-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.thumb.previewing .pv-bar { opacity: 1; }
.card:hover .thumb.previewing img { transform: none; }
.unmute { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 700; background: var(--accent); color: #000; cursor: pointer; }

/* ---------- recommendations UI ---------- */
.card { position: relative; }
.card-more { position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.72); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.card:hover .card-more, .card-more:focus-visible { opacity: 1; }
@media (hover: none) { .card-more { opacity: .85; } }
.dismissed { border: 1px dashed var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; min-height: 160px; }
.dismissed p { margin: 0; }
.survey { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 55; width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 8px; }
.survey .stars { display: flex; gap: 4px; }
.survey .stars button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--line); cursor: pointer; padding: 2px; }
.survey .stars button.on { color: var(--accent); }
.survey-ends { display: flex; justify-content: space-between; }
.survey-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }

/* ---------- channel analytics ---------- */
.studio-tabs a { text-decoration: none; background: none; border: 0; padding: 10px 16px; font-weight: 700; border-bottom: 3px solid transparent; color: var(--muted); }
.studio-tabs a[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.an-body { display: grid; gap: 20px; }
.an-body[aria-busy="true"] { opacity: .55; transition: opacity .2s; }
.an-body .panel { gap: 12px; }
.an-body .panel h2 { font: 700 18px/1.2 var(--display); margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); cursor: pointer; display: grid; gap: 4px; align-content: start; }
.kpi:hover { border-color: var(--muted); }
.kpi[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi b { font: 800 26px/1.1 var(--display); }
.delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.chart-wrap { position: relative; }
.chart { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11.5px; font-family: var(--body); font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart); fill-opacity: .1; stroke: none; }
.chart .dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; outline: none; }
.chart .hit:focus-visible { stroke: var(--accent); stroke-width: 2; }
.tip { position: absolute; transform: translate(-50%, -100%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 12px; pointer-events: none; display: grid; gap: 2px; text-align: center; white-space: nowrap; }
.tip-v { font: 700 16px/1.2 var(--body); font-variant-numeric: tabular-nums; }
.tip-d { font-size: 12px; color: var(--muted); }
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 56px; gap: 10px; align-items: center; }
.bar-label { font-size: 13.5px; overflow-wrap: anywhere; }
.bar-track { height: 12px; }
.bar-track i { display: block; height: 100%; min-width: 2px; background: var(--chart); border-radius: 0 4px 4px 0; }
.bar-val { text-align: right; font-size: 13.5px; font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mini-stats b { display: block; font: 800 22px/1.15 var(--display); }
.t-video > a:last-child { font-weight: 600; text-decoration: none; }

/* ---------- disk ---------- */
.storage-total b.path, .path { font: 500 13px/1.4 var(--mono); overflow-wrap: anywhere; }
.disk { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 4px 0 12px; }
.disk-bar { height: 10px; }
.disk-bar.low i { background: var(--danger); }
.storage-total .sub b:not(.path) { font: 700 13.5px/1.4 var(--body); }

/* ---------- notifications ---------- */
.bell { position: relative; }
.bell-dot { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #000; font: 700 11px/18px var(--body); text-align: center; border: 2px solid var(--bg); box-sizing: content-box; }
.notif-menu { width: min(420px, calc(100vw - 24px)); padding: 0; gap: 0; max-height: min(560px, calc(100dvh - 90px)); overflow: auto; right: -52px; }
.notif-head { padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.notif-empty { padding: 20px 16px; margin: 0; }
.notif-list { display: grid; padding: 6px; }
.menu .notif { align-items: flex-start; gap: 12px; padding: 10px; }
.notif.unread { background: var(--accent-soft); }
.notif-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; display: grid; gap: 2px; }
.notif-thumb { width: 86px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }

/* ---------- save dialog ---------- */
.dlg { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(0,0,0,.55); }
.dlg-body { padding: 22px; display: grid; gap: 14px; }
.dlg-body h2 { font: 700 20px/1.2 var(--display); margin: 0; }
.dlg-body label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.save-list { display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.dlg-body .check { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.save-list .check:hover { background: var(--sunk); }
.save-list .check input { margin: 0; }
.save-list .check span:first-of-type { flex: 1; overflow-wrap: anywhere; }
.new-pl { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- cards & rating ---------- */
.card-wl { top: 48px; }
.seg { display: inline-flex; }
.seg .btn:first-child { border-radius: 999px 0 0 999px; position: relative; }
.seg .btn:first-child::after { content: ""; position: absolute; right: 0; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.seg .btn:last-child { border-radius: 0 999px 999px 0; }

/* ---------- playlists ---------- */
.page-row { margin-bottom: 18px; }
.page-row .page-title { margin: 0; }
.pl-card h3 { margin: 12px 0 4px; }
.linky { display: inline-block; margin-top: 4px; font-weight: 600; text-decoration: none; }
.linky:hover { color: var(--accent-text); }
.pl-thumb .ph { color: #fff; }
.pl-count { position: absolute; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 6px 10px; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; font-size: 12.5px; font-weight: 600; }
.pl-page { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .pl-page { grid-template-columns: minmax(0, 1fr); } }
.pl-hero { position: sticky; top: calc(var(--top-h) + 16px); display: grid; gap: 12px; padding: 20px; border-radius: 18px; background: linear-gradient(180deg, var(--accent-soft), var(--sunk) 70%); }
@media (max-width: 900px) { .pl-hero { position: static; } }
.pl-hero h1 { font: 800 26px/1.15 var(--display); margin: 0; overflow-wrap: anywhere; }
.pl-desc { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pl-items, .pl-panel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pl-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px; border-radius: 12px; }
.pl-item:hover { background: var(--sunk); }
.pl-n { color: var(--muted); font-size: 13px; text-align: center; }
.pl-tools { display: flex; }
.pl-tools .icon-btn:disabled { opacity: .3; cursor: default; }
.pl-item .mini { grid-template-columns: 160px minmax(0, 1fr); }
@media (max-width: 600px) { .pl-item .mini { grid-template-columns: 120px minmax(0, 1fr); } }
.pl-panel { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.pl-panel header { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 12px 12px 10px 16px; background: var(--sunk); }
.pl-panel h2 { font: 700 17px/1.25 var(--display); margin: 0; text-transform: none; letter-spacing: 0; color: var(--ink); }
.pl-panel .icon-btn[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); }
.pl-panel-list { max-height: 380px; overflow: auto; padding: 6px 0; gap: 0; }
.pl-panel-list .mini { grid-template-columns: 22px 100px minmax(0, 1fr); align-items: center; padding: 5px 10px 5px 4px; border-radius: 0; }
.pl-panel-list .mini h3 { font-size: 13.5px; }
.pl-panel-list li[aria-current="true"] .mini { background: var(--accent-soft); }

/* ---------- comments ---------- */
.c-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 26px 0 16px; }
.c-head h2 { margin: 0; }
.c-sort { display: flex; gap: 6px; }
.c-sort .chip { padding: 5px 12px; font-size: 13px; }
.c-actions { display: flex; align-items: center; gap: 4px; margin-top: 4px; margin-left: -8px; flex-wrap: wrap; }
.c-act { border: 0; background: none; border-radius: 999px; padding: 6px 10px; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.c-act:hover { background: var(--sunk); }
.c-act[aria-pressed="true"] { color: var(--accent-text); }
.c-list .who.creator { background: var(--ink); color: var(--bg); padding: 1px 8px; border-radius: 999px; }
.pin-note { display: flex; align-items: center; gap: 4px; font-size: 12.5px; margin-bottom: 2px; }
.replies-toggle { border: 0; background: none; color: var(--accent-text); font-weight: 700; cursor: pointer; padding: 6px 10px; margin-left: -10px; border-radius: 999px; }
.replies-toggle:hover { background: var(--accent-soft); }
.c-list.replies { margin-top: 8px; gap: 14px; }
.reply-form { margin: 10px 0 6px; }
.c-list li.flash > .body { animation: flash 2.4s ease-out; border-radius: 8px; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .c-list li.flash > .body { animation: none; background: var(--accent-soft); } }

/* ---------- community ---------- */
.community, #postList { display: grid; gap: 16px; max-width: 760px; }
.post-form, .post { gap: 12px; padding: 18px 20px; }
.post-form select { margin-top: 6px; }
.post-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post .mini { grid-template-columns: 200px minmax(0, 1fr); background: var(--sunk); padding: 8px; }
@media (max-width: 600px) { .post .mini { grid-template-columns: 120px minmax(0, 1fr); } }

/* ---------- list rows, search filters, channel home, shelves ---------- */
.page-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lrows { display: grid; gap: 16px; max-width: 1100px; }
.card.lrow { display: grid; grid-template-columns: minmax(200px, 360px) minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.lrow-thumb { position: relative; display: block; }
.lrow .rank { position: absolute; left: -4px; top: -4px; z-index: 4; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--accent); color: #000; font: 800 14px/28px var(--display); text-align: center; }
.lrow-meta { min-width: 0; display: grid; gap: 4px; align-content: start; }
.lrow h3 { font-size: 18px; margin: 0; }
.lrow-ch { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; width: fit-content; }
.lrow-desc { margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
.lrow-tools { display: grid; gap: 2px; }
@media (max-width: 700px) {
  .card.lrow { grid-template-columns: 150px minmax(0, 1fr); gap: 10px; }
  .lrow h3 { font-size: 15px; }
  .lrow-desc, .lrow-ch { display: none; }
  .lrow-tools { grid-column: 2; display: flex; }
}
.view-toggle .btn { padding: 8px 12px; }
.vid-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.vid-bar .chips { flex: 1; padding: 0; position: static; }
.pill-n { background: var(--accent); color: #000; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; margin-bottom: 20px; }
.filters h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.flt { display: block; border: 0; background: none; padding: 5px 0; cursor: pointer; color: var(--muted); font-size: 14px; text-align: left; }
.flt:hover { color: var(--ink); }
.flt[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.ch-result { display: grid; grid-template-columns: minmax(200px, 360px) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 8px 0 20px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.ch-result-av { justify-self: center; }
.ch-result h3 { margin: 0 0 4px; font: 700 20px/1.2 var(--display); }
@media (max-width: 700px) {
  .ch-result { grid-template-columns: 72px minmax(0, 1fr); }
  .ch-result .avatar.xl { width: 72px; height: 72px; font-size: 28px; }
  .ch-result > .btn { grid-column: 2; justify-self: start; }
  .page-row .page-title { flex-basis: 100%; }
}
.card.featured { display: grid; grid-template-columns: minmax(260px, 440px) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 24px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.featured-meta { display: grid; gap: 6px; }
.featured h2 { margin: 0; font: 700 22px/1.25 var(--display); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
@media (max-width: 700px) { .card.featured { grid-template-columns: 1fr; } }
.shelf { padding: 20px 0; border-bottom: 1px solid var(--line); }
.shelf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.shelf-head h2 { margin: 0; font: 700 20px/1.2 var(--display); }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, calc((100% - 48px) / 4)); gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.shelf-row > * { scroll-snap-align: start; }
@media (max-width: 700px) { .shelf-row { grid-auto-columns: 72%; } }

/* ---------- subscribe button with bell ---------- */
.subctl { display: inline-flex; }
.sub-on { gap: 6px; padding-inline: 14px 12px; }
.bell-menu { left: 0; right: auto; min-width: 290px; z-index: 40; }
.bell-menu button { align-items: flex-start; }
.bell-menu button > span { display: grid; gap: 1px; }
.bell-menu button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-text); }
.bell-menu button[aria-checked="true"] .sub { color: var(--accent-text); }
.bell-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
@media (max-width: 600px) { .bell-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; min-width: 0; } }
.chan-head .bell-menu, .ch-result .bell-menu { left: auto; right: 0; }

/* ---------- watch layout with the Havoc player (default + theater) ---------- */
.watch { grid-template-areas: "player aside" "main aside"; grid-template-rows: auto 1fr; row-gap: 0; }
.w-player { grid-area: player; min-width: 0; }
.w-main { grid-area: main; min-width: 0; }
.w-aside { grid-area: aside; }
@media (max-width: 1016px) { .watch { grid-template-areas: "player" "main" "aside"; } }
body.hp-theater .watch { grid-template-areas: "player player" "main aside"; max-width: none; }
body.hp-theater .w-player { margin: -20px -24px 0; background: #000; }
body.hp-theater .w-player .hp { border-radius: 0; max-height: calc(100dvh - 140px); }
body.hp-theater .w-player .hp .hp-video, body.hp-theater .w-player .hp-bottom { border-radius: 0; }
body.hp-theater .w-player .hp-ambient { display: none; }
@media (max-width: 1016px) { body.hp-theater .watch { grid-template-areas: "player" "main" "aside"; } body.hp-theater .w-player { margin: 0; } }
.w-player .hp-holder { margin-bottom: 4px; }
.share-row { display: flex; gap: 8px; }
.share-row .field { flex: 1; min-width: 0; font: 500 13.5px/1.3 var(--mono); }
.dlg-body .share-at { display: flex; align-items: center; gap: 8px; font-weight: 500; }
@media (max-width: 600px) { body.watch-mode .watch > .w-player > .hp-holder { margin-inline: 0; } }
.proc-note { margin: 6px 0 0; }
.proc-tag { display: block; margin-top: 4px; }

/* ---------- reporting & moderation ---------- */
.rep-reasons { border: 0; padding: 0; margin: 0; display: grid; gap: 2px; }
.rep-reasons legend { margin-bottom: 6px; }
.rep-reasons .check { padding: 7px 6px; border-radius: 8px; font-weight: 500; }
.rep-reasons .check:hover { background: var(--sunk); }
.mod-list { display: grid; gap: 14px; max-width: 860px; }
.mod-item { gap: 10px; padding: 18px 20px; }
.mod-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mod-target { display: flex; align-items: center; gap: 12px; font-weight: 600; overflow-wrap: anywhere; }
.mod-target img { width: 140px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex: none; }
.mod-reasons { margin: 0; padding-left: 18px; }
.mod-details { margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--sunk); border-radius: 0 8px 8px 0; font-size: 14px; overflow-wrap: anywhere; }

/* ---------- legal pages, footer, auth extras ---------- */
.legal { max-width: 760px; line-height: 1.65; }
.legal h1 { font: 800 clamp(26px, 3vw, 36px)/1.1 var(--display); margin: 8px 0 6px; }
.legal h2 { font: 700 20px/1.25 var(--display); margin: 28px 0 8px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent-text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.forgot { margin: -6px 0 0; text-align: right; font-size: 13.5px; }
.forgot a, .consent a { color: var(--accent-text); font-weight: 600; }
.consent { margin: 0; text-align: center; }
.side .foot-links a { display: inline; padding: 0; font-size: 12.5px; min-height: 0; border-radius: 0; background: none; }

/* ---------- Havoc Ads ---------- */
.ads-page { display: grid; gap: 22px; max-width: 1200px; }
.ads-page .page-row, .ads-page .page-title { margin-bottom: 0; }
.ads-page h2 { font: 700 20px/1.25 var(--display); margin: 0; }
.ads-sec { display: grid; gap: 12px; }
.kpi.static { cursor: default; }
.kpi.static:hover { border-color: var(--line); }
.note { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--sunk); font-size: 14px; }
.warn-note { background: var(--accent-soft); color: var(--ink); border-left: 3px solid var(--accent); }
.pill.warn { background: var(--accent-soft); color: var(--accent-text); }
.pill.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ads-table { min-width: 860px; }
.ads-table td { vertical-align: top; }
.ads-table td .sub { display: block; }
.ad-cell { display: flex; gap: 12px; align-items: flex-start; min-width: 260px; }
.ad-cell video, .ad-novid { width: 112px; aspect-ratio: 16 / 9; border-radius: 8px; background: #000; object-fit: cover; flex: none; display: block; }
.ad-novid { background: linear-gradient(135deg, var(--sunk-2), var(--sunk)); }
.ad-cell b { display: block; }
.ad-note { margin-top: 6px; font-size: 13px; }
.ad-actions { gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.progress.mini { height: 5px; margin: 6px 0 2px auto; width: 120px; }
.ads-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.ads-two .panel { padding: 22px; gap: 12px; }
.ads-empty { justify-items: start; gap: 8px; padding: 22px; }
.ads-empty p { margin: 0; max-width: 60ch; }
.ads-how ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.ads-funds form { align-items: end; }
.ads-funds form .lbl { flex: 1 1 160px; }
.fund-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.fund-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fund-list li:last-child { border-bottom: 0; }
.fund-list.big li { padding: 12px 0; }
.fund-list .grow { flex: 1 1 200px; min-width: 0; }
.fund-list .grow .sub { display: block; }
details summary { cursor: pointer; padding: 4px 0; }
.cat-pick { position: static; flex-wrap: wrap; padding: 0; overflow: visible; background: none; }
.cat-pick .chip { font-size: 13px; padding: 6px 12px; }
.place-pick { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.place-pick legend { font-weight: 600; font-size: 13.5px; padding: 0; margin-bottom: 4px; }
.place-pick .check { font-weight: 500; }
.studio .lbl > span:first-child { font-weight: 600; font-size: 13.5px; }
.ad-preview .hp { border-radius: 12px; overflow: hidden; }
.ad-preview .hp-ad-video { border-radius: 0; }
.ad-preview .hp-ad-card, .ad-preview .hp-ad-skip { pointer-events: none; }
.ad-preview .hp-ad-skip { bottom: 56px; }
.ad-preview .hp-ad-tag { bottom: 54px; }
.ad-review-in { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ad-review-in video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; }
.ad-review .stack-s { display: grid; gap: 6px; }
.ad-review p { margin: 0; overflow-wrap: anywhere; }
.ad-head-line { font: 700 17px/1.3 var(--display); }
@media (max-width: 700px) { .ad-review-in { grid-template-columns: 1fr; } }
.page-row .grow { flex: 1 1 auto; min-width: 0; }
.ads-table .pill, .ads-table td:nth-child(2) { white-space: nowrap; }

/* Google display ads */
.gad { position: relative; display: grid; gap: 4px; min-width: 0; }
.gad-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gad .adsbygoogle { display: block; min-height: 90px; }
.gad-side { margin-bottom: 16px; }
.gad-side .adsbygoogle { min-height: 250px; }
.gad-feed .adsbygoogle { aspect-ratio: 16 / 9; min-height: 0; }
.mono { font-family: var(--mono, ui-monospace, monospace); font-size: 13px; }
#gSet hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.ads-set { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.mono { font-weight: 400; }
@media (max-width: 480px) { .ads-set { grid-template-columns: 1fr; } }
.key-scope { width: auto; }
.key-copy code { overflow-wrap: anywhere; background: var(--surface); padding: 8px 10px; border-radius: 8px; }


/* ================= Jatain premium look ================= */
body { background: radial-gradient(1200px 500px at 85% -10%, rgba(0,229,255,.09), transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="light"] body { background: radial-gradient(1200px 500px at 85% -10%, rgba(0,200,224,.07), transparent 60%), var(--bg); }
.top { background: var(--topbar); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad); opacity: .9; }
.logo { gap: 10px; font: 800 25px/1 var(--display); letter-spacing: -.04em; }
.logo .mark { width: 40px; height: 40px; display: block; background: none; border-radius: 0; filter: drop-shadow(0 0 10px rgba(0,229,255,.45)); }
.logo .mark img { width: 100%; height: 100%; display: block; }
.logo .mark svg { width: 100%; height: 100%; display: block; }
.logo .wm i { font-style: normal; color: var(--accent); }
.search input { height: 44px; background: var(--sunk); border-color: transparent; padding-left: 20px; transition: border-color .15s, background .15s; }
.search input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-btn { height: 44px; background: var(--sunk-2); border-color: transparent; }
.search-btn:hover { background: var(--grad); color: #0B0B0C; }
.btn { transition: transform .12s, box-shadow .2s, background .2s; }
.btn-primary { background: var(--grad); color: #0B0B0C; }
.btn-primary:hover { background: var(--grad); box-shadow: var(--glow); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.side a, .side .navlink { border-radius: 12px; transition: background .15s, color .15s; }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); position: relative; }
.side a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); }
.side a[aria-current="page"] svg { color: var(--accent); }
.chip { border-radius: 999px; background: var(--sunk); padding: 8px 16px; transition: background .15s, color .15s, box-shadow .2s; }
.chip[aria-pressed="true"] { background: var(--grad); color: #0B0B0C; box-shadow: var(--glow); }
.chips { background: transparent; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.thumb { border-radius: 16px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .25s, transform .25s; }
.card:hover .thumb, .card:focus-visible .thumb { box-shadow: 0 0 0 2px var(--accent), var(--glow); transform: translateY(-3px); }
.card h3 { font-weight: 700; letter-spacing: -.01em; }
.page-title { letter-spacing: -.035em; }
.panel, .kpi, .stat, .menu, dialog { border-color: var(--line); }
.panel { background: linear-gradient(180deg, var(--surface), var(--surface)); border-radius: 20px; }
.menu { background: var(--surface); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-radius: 16px; }
.avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line); }
.hp { border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.hp .hp-video, .hp-bottom { border-radius: inherit; }
.toast { border-radius: 14px; }
::selection { background: rgba(0,229,255,.35); }
* { scrollbar-color: var(--sunk-2) transparent; }
@media (prefers-reduced-motion: reduce) { .btn, .thumb, .chip { transition: none; } .card:hover .thumb { transform: none; } }

.tagline { font: 800 11px/1 var(--display); letter-spacing: .28em; text-transform: uppercase; color: var(--accent-text); }

/* Invites admin */
.wide-panel { max-width: 760px; }
.switch-row { align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 12px; margin: 8px 0 20px; cursor: pointer; }
.switch-row input { margin-top: 4px; accent-color: #00E5FF; width: 18px; height: 18px; }
.inv-form { display: grid; gap: 10px; margin-bottom: 24px; }
.inv-form .row { gap: 12px; flex-wrap: wrap; }
.fund-list .mono { word-break: break-all; }

/* ---------- Light theme: pink Jatain brand ---------- */
:root[data-theme="light"] {
  --chart: #E0206F;
  --bg: #FFFFFF; --surface: #FFFFFF; --sunk: #F5F4F5; --sunk-2: #EAE8EA; --line: #ECE9EC;
  --accent: #FC3487; --accent-hover: #E61F72; --accent-ink: #FFFFFF;
  --accent-text: #C8105E; --accent-soft: #FFE4EF;
  --grad: linear-gradient(135deg, #FF6FAE 0%, #FC3487 55%, #E0186A 100%);
  --glow: 0 8px 24px rgba(252,52,135,.30);
  --topbar: rgba(255,255,255,.85);
}
.logo .mark .logo-light, .tagline .tag-light { display: none; }
:root[data-theme="light"] .logo .mark .logo-dark, :root[data-theme="light"] .tagline .tag-dark { display: none; }
:root[data-theme="light"] .logo .mark .logo-light { display: block; }
:root[data-theme="light"] .tagline .tag-light { display: inline; }
:root[data-theme="light"] .logo .mark { filter: none; }
:root[data-theme="light"] body { background: radial-gradient(1200px 500px at 85% -10%, rgba(252,52,135,.06), transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="light"] ::selection { background: rgba(252,52,135,.25); }
:root[data-theme="light"] .avatar.h0 { background: #FC3487; color: #fff; }
:root[data-theme="light"] .switch-row input { accent-color: #FC3487; }
:root[data-theme="light"] .tagline { color: #0B0B0C; }
:root[data-theme="light"] .btn-primary, :root[data-theme="light"] .chip[aria-pressed="true"], :root[data-theme="light"] .chip.on { color: #FFFFFF; }
.share-row { gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Tidy sidebar footer: two even columns, one-line tagline */
.side .foot { border-top: 1px solid var(--line); margin-left: 12px; margin-right: 12px; padding: 14px 0 6px; }
.side .foot-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 14px; }
.side .foot-links a { font-size: 12.5px; line-height: 1.3; white-space: nowrap; }
.side .foot .tagline { display: block; font-size: 10px; letter-spacing: .14em; white-space: nowrap; margin-bottom: 4px; }
.side .foot .foot-mail { display: block; color: var(--muted); text-decoration: none; font-size: 12.5px; margin: -6px 0 12px; padding: 0; background: none; min-height: 0; } .side .foot .foot-mail:hover { color: var(--ink); text-decoration: underline; }
