/* ---- YooToob theme (dark, YouTube-flavored) ------------------------------- */
:root {
  --bg: #0f0f0f;
  --bg-2: #181818;
  --bg-3: #212121;
  --hover: #272727;
  --chip: #272727;
  --chip-hover: #3d3d3d;
  --text: #f1f1f1;
  --text-2: #aaa;
  --text-3: #717171;
  --border: #303030;
  --brand: #f03;
  --blue: #3ea6ff;
  --topbar-h: 56px;
  --sidebar-w: 240px;
  --sidebar-mini-w: 72px;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #4d4d4d; border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Topbar ---------------------------------------------------------------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--bg); z-index: 100; gap: 16px;
}
.tb-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tb-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
#logo { display: flex; align-items: center; padding: 8px; border-radius: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; color: var(--text); flex-shrink: 0;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 24px; height: 24px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px;
  border-radius: 18px; background: var(--chip); font-size: 14px; font-weight: 500;
}
.pill-btn:hover { background: var(--chip-hover); }
.pill-btn svg { width: 20px; height: 20px; }
.avatar-btn {
  width: 32px; height: 32px; border-radius: 50%; background: #5c6bc0; color: #fff;
  font-weight: 600; font-size: 15px; margin-left: 8px;
}

#search-form { display: flex; align-items: center; gap: 12px; flex: 0 1 640px; }
#search-box {
  flex: 1; display: flex; align-items: center; height: 40px; padding: 0 4px 0 16px;
  background: #121212; border: 1px solid var(--border); border-radius: 20px 0 0 20px;
}
#search-box:focus-within { border-color: #1c62b9; }
#search-input {
  flex: 1; background: none; border: 0; outline: 0; color: var(--text);
  font-size: 16px; min-width: 0;
}
#search-input::placeholder { color: var(--text-3); }
#search-btn {
  width: 64px; height: 40px; border-radius: 0 20px 20px 0;
  background: var(--bg-3); border: 1px solid var(--border); border-left: 0;
}
#search-btn:hover { background: var(--chip-hover); }

/* ---- Shell / sidebar -------------------------------------------------------- */
#shell { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }
#sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0;
  width: var(--sidebar-w); overflow-y: auto; overflow-x: hidden;
  padding: 12px; background: var(--bg); z-index: 90;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
}
#sidebar:hover { scrollbar-color: #4d4d4d transparent; }
body.light #sidebar:hover { scrollbar-color: #c1c1c1 transparent; }
#sidebar::-webkit-scrollbar { width: 8px; }
#sidebar::-webkit-scrollbar-thumb { background: transparent; border: none; border-radius: 4px; }
#sidebar:hover::-webkit-scrollbar-thumb { background: #4d4d4d; }
body.light #sidebar:hover::-webkit-scrollbar-thumb { background: #c1c1c1; }
.side-item {
  display: flex; align-items: center; gap: 24px; padding: 0 12px;
  height: 40px; border-radius: 10px; font-size: 14px; white-space: nowrap;
}
.side-item:hover { background: var(--hover); }
.side-item.active { background: var(--hover); font-weight: 500; }
.side-item svg { width: 24px; height: 24px; flex-shrink: 0; }
.side-item img { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.side-sep { border-top: 1px solid var(--border); margin: 12px 0; }
.side-head { padding: 6px 12px; font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.side-head svg { width: 20px; height: 20px; }

body.mini #sidebar { width: var(--sidebar-mini-w); padding: 4px; }
body.mini .side-item {
  flex-direction: column; gap: 6px; height: 64px; justify-content: center;
  font-size: 10px; padding: 0; border-radius: 10px;
}
body.mini .side-item .lbl { display: block; }
body.mini .side-sep, body.mini .side-head,
body.mini .side-item .lbl-full, body.mini .side-subs,
body.mini .side-item.full-only { display: none; }
.side-item .lbl-mini { display: none; }
body:not(.mini) .side-item.mini-only { display: none; }
.side-foot { padding: 16px 12px 8px; font-size: 12px; }
.side-foot a { color: var(--text-2); }
.side-foot a:hover { color: var(--text); text-decoration: underline; }
.side-legal { margin-top: 10px; font-size: 10.5px; line-height: 1.5; color: var(--text-3); }
body.mini .side-foot { display: none; }
body.mini .side-item .lbl-mini { display: block; }
body.mini .side-item .lbl-full { display: none; }

#page { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
body.mini #page { margin-left: var(--sidebar-mini-w); }

#mobile-nav { display: none; }
#m-search-btn, #search-back, #m-acct-btn { display: none; }

/* ---- Chips ------------------------------------------------------------------- */
.chips {
  position: sticky; top: var(--topbar-h); z-index: 50; display: flex; gap: 12px;
  padding: 12px 24px; background: var(--bg); overflow-x: auto; scrollbar-width: none;
  touch-action: pan-x pan-y; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; cursor: grab;
}
.chips.dragging { cursor: grabbing; }
.chips.dragging .chip { pointer-events: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 12px; border-radius: 8px; background: var(--chip);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip:hover { background: var(--chip-hover); }
.chip.active { background: var(--text); color: #0f0f0f; }

/* ---- Video grid & cards ------------------------------------------------------- */
.video-grid {
  display: grid; gap: 16px; row-gap: 40px; padding: 24px;
  grid-template-columns: repeat(3, 1fr);
}
.v-card { display: flex; flex-direction: column; cursor: pointer; min-width: 0; }
.v-thumb { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: var(--bg-3); }
.v-thumb img { width: 100%; height: 100%; object-fit: cover; transition: border-radius .2s; }
.v-card:hover .v-thumb img { border-radius: 0; }
.duration {
  position: absolute; right: 4px; bottom: 4px; padding: 2px 4px; border-radius: 4px;
  background: rgba(0,0,0,.8); font-size: 12px; font-weight: 500;
}
.live-badge { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; border-radius: 4px; background: #c00; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.v-info { display: flex; gap: 12px; margin-top: 12px; }
.v-info > img, .v-info > .avatar-fallback { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.v-meta { min-width: 0; flex: 1; }
.v-title {
  font-size: 16px; font-weight: 500; line-height: 1.4; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.v-sub { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.v-sub a:hover { color: var(--text); }
.verified { display: inline-flex; vertical-align: middle; margin-left: 3px; }
.verified svg { width: 14px; height: 14px; fill: var(--text-2); }

/* Shorts row on home */
.shorts-rail { padding: 0 24px 8px; }
.shorts-rail h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; margin-bottom: 12px; }
.shorts-rail h2 svg { width: 24px; height: 24px; fill: var(--brand); }
.shorts-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.s-card { flex-shrink: 0; width: 180px; cursor: pointer; }
.s-thumb { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 9/16; background: var(--bg-3); }
.s-thumb img { width: 100%; height: 100%; object-fit: cover; }
.s-card .v-title { font-size: 14px; margin-top: 8px; }

/* ---- Watch page ---------------------------------------------------------------- */
.watch { display: flex; gap: 24px; padding: 24px; align-items: flex-start; }
.watch-main { flex: 1; min-width: 0; max-width: 1280px; }
.player { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16/9; }
.player video { width: 100%; height: 100%; }
.graphic-gate {
  position: absolute; inset: 0; z-index: 5; background: rgba(5,5,5,.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 10px;
}
.graphic-gate .gg-mark {
  width: 56px; height: 56px; border: 2px solid #f33; border-radius: 8px; color: #f33;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.graphic-gate h3 { font-size: 18px; }
.graphic-gate p { color: #aaa; font-size: 13px; max-width: 420px; }
.graphic-gate input {
  width: 150px; text-align: center; background: #121212; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 10px; font-size: 16px; letter-spacing: 4px; outline: 0;
}
.badge-graphic {
  position: absolute; top: 8px; right: 8px; background: rgba(190,0,0,.92); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: .5px;
}

/* custom video controls — identical on every platform/source */
.p-ctrls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 0 12px 8px; background: linear-gradient(transparent, rgba(0,0,0,.8));
  opacity: 0; transition: opacity .2s;
}
.p-ctrls.show { opacity: 1; }
.player.hide-ui { cursor: none; }
.p-seek {
  width: 100%; height: 4px; margin: 4px 0 2px; cursor: pointer; outline: 0;
  -webkit-appearance: none; appearance: none; background: rgba(255,255,255,.3); border-radius: 2px;
}
.p-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.p-seek::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
.p-row { display: flex; align-items: center; gap: 2px; }
.p-row .icon-btn { width: 36px; height: 36px; color: #fff; }
.p-row .icon-btn:hover { background: rgba(255,255,255,.12); }
.p-time { color: #fff; font-size: 13px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.p-spacer { flex: 1; }
.badge-unc {
  position: absolute; top: 8px; left: 8px; background: rgba(230,120,0,.95); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: .5px;
}
.watch-title { font-size: 20px; font-weight: 700; margin: 14px 0 10px; }
.watch-meta {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px; color: var(--text-2); font-size: 13px;
}
.watch-meta .wm-handle { color: var(--text); font-weight: 500; text-decoration: none; }
.watch-meta .wm-more { color: var(--text); font-weight: 600; font-size: 13px; background: none; padding: 0; cursor: pointer; }
.desc-box .stats { display: none; }
.watch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.watch-channel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.watch-channel img { width: 40px; height: 40px; border-radius: 50%; }
.wc-name { font-size: 16px; font-weight: 500; display: flex; align-items: center; }
.wc-subs { color: var(--text-2); font-size: 12px; }
.sub-btn {
  height: 36px; padding: 0 16px; border-radius: 18px; background: var(--text);
  color: #0f0f0f; font-weight: 500; font-size: 14px; margin-left: 8px; flex-shrink: 0;
}
.sub-btn.subbed { background: var(--chip); color: var(--text); }
.sub-btn:hover { opacity: .9; }
.watch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.like-pill { display: flex; align-items: center; background: var(--chip); border-radius: 18px; overflow: hidden; height: 36px; }
.like-pill button { display: flex; align-items: center; gap: 6px; padding: 0 14px; height: 100%; font-size: 14px; font-weight: 500; }
.like-pill button:hover { background: var(--chip-hover); }
.like-pill .divider { width: 1px; height: 20px; background: var(--border); }
.action-btn { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--chip); font-size: 14px; font-weight: 500; }
.action-btn:hover { background: var(--chip-hover); }
.action-btn svg, .like-pill svg { width: 20px; height: 20px; }
.like-pill button.on svg { fill: var(--text); }

.desc-box {
  margin-top: 14px; padding: 12px; border-radius: var(--radius);
  background: var(--chip); font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; cursor: pointer;
}
.desc-box .stats { font-weight: 600; margin-bottom: 6px; }
.desc-box.collapsed { display: none; }

/* Comments */
.comments { margin-top: 24px; }
.comments-head { display: flex; align-items: center; gap: 24px; font-size: 16px; font-weight: 700; margin-bottom: 20px; }
.comment-add { display: flex; gap: 12px; margin-bottom: 28px; }
.comment-add img, .comment-add .avatar-fallback { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.comment-add input {
  flex: 1; background: none; border: 0; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 14px; padding: 6px 0; outline: 0;
}
.comment-add input:focus { border-bottom-color: var(--text); }
.comment { display: flex; gap: 12px; margin-bottom: 20px; }
.comment img { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.c-line1 { font-size: 13px; margin-bottom: 2px; }
.c-line1 .author { font-weight: 500; }
.c-line1 .time { color: var(--text-2); margin-left: 6px; }
.c-text { font-size: 14px; line-height: 1.5; }
.c-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; color: var(--text-2); font-size: 12px; }
.c-actions button { display: flex; align-items: center; gap: 4px; color: var(--text-2); }
.c-actions svg { width: 16px; height: 16px; }

/* Up next rail */
.watch-rail { width: 400px; flex-shrink: 0; }
.rail-card { display: flex; gap: 8px; margin-bottom: 10px; cursor: pointer; }
.rail-card .v-thumb { width: 168px; flex-shrink: 0; border-radius: 8px; }
.rail-card .v-thumb img { border-radius: 8px; }
.rail-card .v-title { font-size: 14px; -webkit-line-clamp: 2; }
.rail-card .v-sub { font-size: 12px; margin-top: 4px; }

/* ---- Shorts page ----------------------------------------------------------------- */
.shorts-view { height: calc(100vh - var(--topbar-h)); display: flex; }
.shorts-feed {
  flex: 1; overflow-y: auto; scroll-snap-type: y mandatory;
  scrollbar-width: none; height: 100%;
}
.shorts-feed::-webkit-scrollbar { display: none; }
.short-wrap {
  height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.short-frame {
  position: relative; height: calc(100% - 24px); aspect-ratio: 9/16; max-width: 92vw;
  border-radius: 16px; overflow: hidden; background: #000; flex-shrink: 0;
}
.short-frame video { width: 100%; height: 100%; object-fit: cover; }
.short-overlay {
  position: absolute; inset: auto 0 0 0; padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  display: flex; flex-direction: column; gap: 10px;
}
.short-ch-row { display: flex; align-items: center; gap: 10px; }
.short-ch-row img { width: 32px; height: 32px; border-radius: 50%; }
.short-ch-row .name { font-size: 14px; font-weight: 500; }
.short-ch-row .sub-btn { height: 32px; padding: 0 12px; font-size: 13px; margin-left: 0; }
.short-title { font-size: 14px; line-height: 1.4; }
.short-actions { display: flex; flex-direction: column; gap: 16px; align-self: flex-end; margin-bottom: 8px; }
.sa-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.sa-btn .circ {
  width: 48px; height: 48px; border-radius: 50%; background: var(--chip);
  display: flex; align-items: center; justify-content: center;
}
.sa-btn .circ:hover { background: var(--chip-hover); }
.sa-btn .circ svg { width: 24px; height: 24px; }
.sa-btn.on .circ svg { fill: #fff; }
.sound-toggle {
  position: absolute; top: 12px; left: 12px; width: 40px; height: 40px;
  border-radius: 50%; background: rgba(0,0,0,.5); display: flex;
  align-items: center; justify-content: center; z-index: 5;
}
.sound-toggle svg { width: 20px; height: 20px; }

/* Shorts comments sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; }
.comments-sheet {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: 400px; max-width: 95vw;
  background: var(--bg-2); border-radius: 12px 0 0 12px; z-index: 201;
  display: flex; flex-direction: column;
}
.cs-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--border); }
.cs-body { flex: 1; overflow-y: auto; padding: 16px; }
.cs-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.cs-foot input { flex: 1; height: 36px; border-radius: 18px; border: 1px solid var(--border); background: var(--bg-3); color: var(--text); padding: 0 14px; outline: 0; }

/* ---- Channel page ----------------------------------------------------------------- */
.ch-banner { height: 180px; border-radius: 16px; margin: 0 24px; overflow: hidden; }
.ch-banner img { width: 100%; height: 100%; object-fit: cover; }
.ch-header { display: flex; gap: 24px; padding: 24px; align-items: center; }
.ch-header > img { width: 160px; height: 160px; border-radius: 50%; flex-shrink: 0; }
.ch-name { font-size: 36px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ch-handle { color: var(--text-2); margin: 6px 0; }
.ch-tagline { color: var(--text-2); max-width: 640px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-tabs { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--border); }
.ch-tab { padding: 12px 4px; font-size: 15px; font-weight: 500; color: var(--text-2); border-bottom: 3px solid transparent; }
.ch-tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ---- Results / feed rows ------------------------------------------------------------- */
.results { max-width: 1100px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.result-card { display: flex; gap: 16px; cursor: pointer; }
.result-card .v-thumb { width: 420px; flex-shrink: 0; }
.result-card .v-title { font-size: 18px; }
.result-meta { color: var(--text-2); font-size: 12px; margin: 6px 0; }
.result-ch { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--text-2); font-size: 12px; }
.result-ch img { width: 24px; height: 24px; border-radius: 50%; }
.result-desc { color: var(--text-2); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shorts-grid { display: grid; gap: 12px; padding: 24px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.shorts-grid .s-card { width: auto; }

/* ---- Upload ----------------------------------------------------------------------- */
.upload-page { max-width: 720px; margin: 40px auto; padding: 24px; }
.upload-card { background: var(--bg-2); border-radius: 16px; padding: 24px; }
.upload-card h1 { font-size: 20px; margin-bottom: 20px; }
.drop-zone {
  border: 2px dashed var(--border); border-radius: 12px; padding: 48px 24px;
  text-align: center; color: var(--text-2); cursor: pointer;
}
.drop-zone:hover { border-color: var(--blue); color: var(--text); }
.drop-zone svg { width: 64px; height: 64px; margin: 0 auto 12px; fill: var(--text-3); }
.field { margin-top: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: #121212; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 12px; font-size: 14px; font-family: inherit; outline: 0;
}
.field input:focus, .field textarea:focus { border-color: #1c62b9; }
.field textarea { resize: vertical; min-height: 90px; }
.upload-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---- Misc ------------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 80px 24px; color: var(--text-2); }
.empty-state h2 { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.page-head { padding: 24px 24px 0; font-size: 28px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.page-head svg { width: 32px; height: 32px; }
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #f1f1f1; color: #0f0f0f; padding: 12px 20px; border-radius: 8px;
  font-size: 14px; z-index: 300; opacity: 0; transition: all .25s; pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.notif-menu {
  position: fixed; top: var(--topbar-h); right: 16px; width: 360px; max-height: 480px;
  overflow-y: auto; background: var(--bg-2); border-radius: 12px; z-index: 250;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); padding: 8px 0;
}
.notif { display: flex; gap: 12px; padding: 12px 16px; }
.notif:hover { background: var(--hover); }
.notif img { width: 40px; height: 40px; border-radius: 50%; }
.notif .n-text { font-size: 13px; line-height: 1.4; }
.notif .n-time { color: var(--text-2); font-size: 12px; margin-top: 4px; }

/* ---- Modals, menus, admin, light theme ----------------------------------------- */
body.light {
  --bg: #ffffff; --bg-2: #f9f9f9; --bg-3: #f0f0f0; --hover: #f2f2f2;
  --chip: #f2f2f2; --chip-hover: #e5e5e5; --text: #0f0f0f; --text-2: #606060;
  --text-3: #909090; --border: #e5e5e5;
}
body.light #search-box { background: #fff; }
body.light #topbar, body.light #sidebar { background: var(--bg); }
body.light .chip.active, body.light .sub-btn { background: #0f0f0f; color: #fff; }
body.light .sub-btn.subbed { background: var(--chip); color: var(--text); }
body.light #logo { color: #0f0f0f; }
#logo { color: #fff; }
.logo-name { font-weight: 600; font-size: 15px; margin-left: 8px; letter-spacing: -.5px; }
#logo { display: flex; align-items: center; }
#logo svg text { fill: currentColor; }

.menu-pop {
  position: fixed; top: var(--topbar-h); right: 16px; min-width: 260px;
  background: var(--bg-2); border-radius: 12px; z-index: 250; padding: 8px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.menu-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 10px 16px; font-size: 14px; color: var(--text);
}
.menu-item:hover { background: var(--hover); }
.menu-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.menu-head { display: flex; gap: 12px; padding: 12px 16px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; align-items: center; }
.menu-head .avatar-lg { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex-shrink: 0; }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 400; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: var(--bg-2); border-radius: 16px; padding: 28px; width: 420px;
  max-width: 92vw; max-height: 85vh; overflow-y: auto; z-index: 401;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.modal h2 { font-size: 20px; margin-bottom: 16px; }
.form-err { color: #ff6e6e; font-size: 13px; min-height: 18px; margin-top: 8px; }
.muted-line { color: var(--text-2); font-size: 13px; margin-top: 14px; }
.muted-line a { color: var(--blue); cursor: pointer; }
.field select {
  width: 100%; background: #121212; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 12px; font-size: 14px; font-family: inherit; outline: 0;
}
body.light .field select, body.light .field input, body.light .field textarea { background: #fff; }
select { background: #121212; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 10px; font-family: inherit; outline: 0; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 7px; background: var(--chip);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer; user-select: none;
}
.check-pill input { accent-color: var(--brand); }

.admin-wrap { max-width: 900px; padding: 24px; }
.u-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 10px; }
.u-row:hover { background: var(--hover); }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex-shrink: 0; }
.u-row .grow { flex: 1; min-width: 0; }
.u-actions { display: flex; gap: 8px; align-items: center; }
.admin-badge { background: var(--brand); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 9px; font-weight: 700; letter-spacing: .5px; vertical-align: middle; }
.mini-btn { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--chip); font-size: 13px; font-weight: 500; }
.mini-btn:hover { background: var(--chip-hover); }
.mini-btn.danger { color: #ff6e6e; }
.seed-box { background: var(--bg-2); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.seed-box input[type=number], .seed-box input[type=text] {
  background: #121212; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 8px 10px; outline: 0; font-family: inherit;
}
body.light .seed-box input { background: #fff; }
.batch-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.batch-row input[type=text] { flex: 1; min-width: 180px; }
.cat-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cat-tag { display: inline-flex; align-items: center; gap: 8px; background: var(--chip); padding: 7px 12px; border-radius: 8px; font-size: 14px; }
.cat-tag button { color: var(--text-2); display: flex; align-items: center; }
.cat-tag button:hover { color: var(--text); }
.cat-tag button svg { width: 16px; height: 16px; }

/* ---- Go live ------------------------------------------------------------------- */
.live-wrap { display: flex; gap: 24px; padding: 24px; height: calc(100vh - var(--topbar-h)); }
.live-main { flex: 1; min-width: 0; }
.live-player { position: relative; }
.live-overlay { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; align-items: center; }
.live-overlay > span { background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.live-overlay .live-badge { position: static; background: #c00; }
.live-chat { width: 340px; flex-shrink: 0; background: var(--bg-2); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.live-chat-body { flex: 1; overflow-y: auto; padding: 12px; }
.chat-msg { font-size: 13px; padding: 3px 0; line-height: 1.4; word-wrap: break-word; }
.chat-author { font-weight: 500; margin-right: 7px; }
@media (max-width: 1100px) {
  .live-wrap { flex-direction: column; height: auto; }
  .live-chat { width: 100%; height: 420px; }
}

@media (max-width: 1100px) {
  .watch { flex-direction: column; align-items: stretch; }
  .watch-main { width: 100%; }
  .watch-rail { width: 100%; }
  .result-card .v-thumb { width: 300px; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  /* ---- topbar: just logo, search icon, avatar ---- */
  #upload-btn, #bell-btn, #mic-btn, #avatar-btn { display: none; }
  #m-search-btn { display: flex; }
  body.mob-you #m-acct-btn { display: flex; }
  #search-form { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); background: var(--bg); padding: 8px 4px 8px 0; z-index: 101; display: none; align-items: center; }
  #search-form.mobile-open { display: flex; }
  #search-form.mobile-open #search-back { display: flex; flex-shrink: 0; }
  #search-form.mobile-open #search-box { flex: 1; }

  /* ---- videos fill 100% width ---- */
  .video-grid { grid-template-columns: 1fr; padding: 0; row-gap: 24px; }
  .v-thumb { border-radius: 0; }
  .v-info { padding: 0 12px; }
  .chips { padding: 8px 12px; gap: 8px; }
  .results { padding: 0; }
  .result-card { flex-direction: column; gap: 0; }
  .result-card .v-thumb { width: 100%; }
  .shorts-grid { padding: 0 12px; grid-template-columns: repeat(2, 1fr); }
  .watch { padding: 0; }
  .player { border-radius: 0; }
  .watch-title, .watch-row, .comments { padding: 0 12px; }
  .desc-box { margin: 12px; padding: 0; font-size: 13px; background: none; border-radius: 0; }

  .watch-rail { padding: 0; }
  .rail-card { flex-direction: column; gap: 0; margin-bottom: 20px; }
  .rail-card .v-thumb { width: 100%; border-radius: 0; }
  .rail-card .v-thumb img { border-radius: 0; }
  .rail-card .v-title { padding: 8px 12px 0; }
  .rail-card .v-sub { padding: 0 12px; }
  .live-wrap { padding: 0; }
  .live-chat { border-radius: 0; }
  .live-main > *:not(.player) { padding-left: 12px; padding-right: 12px; }
  .upload-page { margin: 0 auto; max-width: 100%; padding: 12px; }
  .admin-wrap { padding: 12px; }
  .notif-menu { right: 0; left: 0; width: auto; }

  /* ---- centered content ---- */
  .page-head { justify-content: center; font-size: 22px; padding: 16px 12px 0; }
  .shorts-rail { padding: 0 0 8px; }
  .shorts-rail h2 { justify-content: center; }
  .watch-title { font-size: 17px; }
  .watch-meta { padding: 0 12px; }
  .watch-row { flex-direction: row; justify-content: space-between; align-items: center; text-align: left; gap: 12px; }
  .watch-channel img { width: 34px; height: 34px; }
  .watch-channel .wc-name, .watch-channel .wc-subs { display: none; }
  .watch-actions { justify-content: flex-end; }
  .watch-actions .action-btn, .watch-actions .like-btn { font-size: 0; gap: 0; }
  .watch-actions .like-btn span { display: none; }
  .comments-head { justify-content: center; }
  .ch-header { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .ch-header > img { width: 80px; height: 80px; }
  .ch-tagline { max-width: 100%; white-space: normal; }
  .ch-name { font-size: 24px; }
  .ch-tabs { justify-content: center; padding: 0 12px; }
  .upload-card h1 { text-align: center; }
  .upload-actions { justify-content: center; }

  /* ---- bottom nav bar replaces sidebar ---- */
  #sidebar { display: none; }
  #menu-btn { display: none; }
  #page, body.mini #page { margin-left: 0; padding-bottom: 64px; }
  #mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: var(--bg); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mob-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 0 6px; color: var(--text-2); font-size: 10px;
    text-decoration: none; -webkit-tap-highlight-color: transparent;
  }
  .mob-item svg { width: 24px; height: 24px; fill: currentColor; }
  .mob-item.active { color: var(--text); }
}
