/* Privat Stream — black theme design system */
:root {
  --bg: #0b0b0b;
  --bg-2: #121212;
  --card: #191919;
  --elev: #202020;
  --line: #2b2b2b;
  --text: #f5f5f5;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #e8e8e8;
  --tg: #229ed9;
  --brand-a: #fa025b;
  --brand-b: #7125fd;
  --brand-grad: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  --danger: #e5484d;
  --ok: #46a758;
  --warn: #d9a441;
  --topbar-h: 52px;
  --side-w: 208px;
  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.fill { fill: currentColor; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.clamp1, .clamp2, .clamp3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; }
.clamp1 { -webkit-line-clamp: 1; line-clamp: 1; }
.clamp2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* ---------- Top bar ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); background: var(--bg); border-bottom: 1px solid var(--line); z-index: 50; display: flex; align-items: center; gap: 12px; padding: 0 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.brand { font-size: 19px; }
.wordmark { font-weight: 800; letter-spacing: -.02em; }
.wm-x { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@supports not (background-clip: text) { .wm-x { color: var(--brand-a); } }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--text); }
.icon-btn:hover { background: var(--elev); }
.search { flex: 1; max-width: 520px; margin: 0 auto; display: flex; }
.search input { flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--line); border-right: 0; border-radius: 999px 0 0 999px; padding: 0 16px; height: 36px; outline: none; }
.search input:focus { border-color: #4a4a4a; }
.search button { width: 52px; border: 1px solid var(--line); background: var(--elev); border-radius: 0 999px 999px 0; display: grid; place-items: center; }
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.only-m { display: none; }
.mtabs { display: none; margin-left: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.mtabs a { padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.mtabs a.on { background: var(--text); color: #0b0b0b; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--elev); font-weight: 600; white-space: nowrap; }
.btn:hover { background: #2a2a2a; }
.btn.primary { background: var(--text); color: #0b0b0b; border-color: var(--text); }
.btn.primary:hover { background: #fff; }
.btn.tg { background: var(--tg); border-color: var(--tg); color: #fff; }
.btn.tg:hover { filter: brightness(1.08); }
.btn.danger { color: #ff8a8e; border-color: #4a2224; background: #1d1213; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--elev); border: 1px solid var(--line); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--text-2); overflow: hidden; }
.avatar.lg { width: 88px; height: 88px; font-size: 32px; }
.avatar.md { width: 40px; height: 40px; }
.avatar.xs { width: 24px; height: 24px; font-size: 11px; }
.usermenu { position: relative; }
.menu { position: absolute; right: 0; top: 42px; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--elev); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .who { padding: 8px 10px; }

/* ---------- Sidebar ---------- */
.sidebar { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--side-w); padding: 10px 8px; border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; z-index: 40; }
.nav a { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--bg-2); color: var(--text); }
.nav a.on { background: var(--elev); color: var(--text); }
.nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 6px; }
.side-foot { padding: 14px 12px; color: var(--text-3); font-size: 12px; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: 264px; background: var(--bg); border-right: 1px solid var(--line); z-index: 80; padding: 10px 8px; overflow-y: auto; }
.drawer .brand { padding: 8px 12px 14px; }

/* ---------- Layout ---------- */
#view { padding-top: var(--topbar-h); margin-left: var(--side-w); min-height: 100vh; }
.page { padding: 18px 22px 60px; max-width: 1600px; margin: 0 auto; }
.page.narrow { max-width: 720px; }
.page.form { max-width: 460px; padding-top: 40px; }
h1.title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
h2.sec { font-size: 18px; font-weight: 700; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; }
.sec-head a.more { color: var(--text-2); font-size: 13px; font-weight: 600; }
.sec-head a.more:hover { color: var(--text); }
.divider { border-top: 1px solid var(--line); margin: 26px 0 20px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; }
.chip:hover { color: var(--text); background: var(--elev); }
.chip.on { background: var(--text); color: #0b0b0b; border-color: var(--text); }
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ---------- Cards ---------- */
.rail-wrap { position: relative; }
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.rail .scard { flex: 0 0 clamp(150px, 15vw, 210px); scroll-snap-align: start; }
.rail-btn { position: absolute; top: 40%; width: 38px; height: 38px; border-radius: 50%; background: rgba(32,32,32,.95); border: 1px solid var(--line); display: grid; place-items: center; z-index: 5; }
.rail-btn.l { left: -10px; } .rail-btn.r { right: -10px; }
.rail-btn:hover { background: #333; }

.scard { display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card); aspect-ratio: 9 / 16; border: 1px solid var(--line); }
.scard img, .scard .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--card); }
.scard .scrim-b { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 10px 10px; background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,0)); }
.scard .t { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.scard .u { color: #cfcfd4; font-size: 12px; margin-top: 3px; }
.scard .v { color: #cfcfd4; font-size: 11.5px; }
.scard:hover { border-color: #444; }
.badge-dur { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.72); border-radius: 4px; padding: 1px 6px; font-size: 11.5px; font-weight: 600; }
.badge-dur.br { top: auto; bottom: 6px; }

.lgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; }
.lcard { display: block; min-width: 0; }
.lcard .th { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.lcard .th img { width: 100%; height: 100%; object-fit: cover; }
.lcard .meta { display: flex; gap: 10px; margin-top: 9px; }
.lcard .t { font-weight: 600; line-height: 1.3; }
.lcard .sub { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.lcard:hover .th { border-color: #444; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ph { display: grid; place-items: center; color: var(--text-3); font-size: 12px; }

.feed-sec { margin-bottom: 8px; }
@media (min-width: 1500px) { .lgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1499px) and (min-width: 1181px) { .lgrid > :nth-child(n+5) { display: none; } }
@media (max-width: 1180px) { .lgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lgrid > :nth-child(n+4) { display: none; } }
.lgrid.all > :nth-child(n) { display: block; }
.lgrid.all { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* ---------- Forms ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--text-3); font-size: 12px; }
.input, .select, .textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; outline: none; }
.input:focus, .select:focus, .textarea:focus { border-color: #5a5a5a; }
.textarea { min-height: 96px; resize: vertical; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .pw-input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 8px; color: var(--text-2);
}
.pw-toggle:hover { color: var(--text); background: var(--elev); }
.pw-toggle svg.i { width: 18px; height: 18px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #a1a1aa 50%), linear-gradient(135deg, #a1a1aa 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.err { color: #ff8a8e; font-size: 13px; margin: 4px 0 10px; }
.ok-msg { color: #7fd18f; font-size: 13px; margin: 4px 0 10px; }
.notice { border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius); padding: 12px 14px; }
.notice.warn { border-color: #4d3f1c; background: #1a160c; }
.notice.bad { border-color: #4a2224; background: #1d1213; }
.notice.good { border-color: #1f3a25; background: #0f1a12; }
.status { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); text-transform: none; }
.status.published, .status.approved, .status.active { color: #7fd18f; border-color: #1f3a25; }
.status.pending_moderation, .status.pending, .status.processing, .status.uploading, .status.open, .status.investigating { color: #e6c36a; border-color: #4d3f1c; }
.status.rejected, .status.removed, .status.suspended, .status.draft_err { color: #ff8a8e; border-color: #4a2224; }
.drop { border: 1.5px dashed #3a3a3a; border-radius: var(--radius); padding: 28px 16px; text-align: center; background: var(--bg-2); cursor: pointer; }
.drop:hover, .drop.over { border-color: #6a6a6a; background: var(--card); }
.progress { height: 6px; background: var(--elev); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--text); transition: width .2s; }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.opt { display: block; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.opt:hover { border-color: #555; background: var(--elev); }
.opt h3 { margin: 10px 0 4px; font-size: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 20px; }
.stat span { color: var(--text-2); font-size: 12px; }

/* ---------- Tables & lists (studio / admin) ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #141414; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.thumb-s { width: 54px; height: 72px; border-radius: 6px; object-fit: cover; background: var(--card); border: 1px solid var(--line); }
.thumb-l { width: 96px; height: 54px; border-radius: 6px; object-fit: cover; background: var(--card); border: 1px solid var(--line); }
.vitem { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.vitem + .vitem { margin-top: 10px; }
.mets { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-2); font-size: 12.5px; }
.mets b { color: var(--text); font-weight: 600; }

/* ---------- Channel page ---------- */
.banner { height: 160px; border-radius: var(--radius); background: var(--card) center / cover; border: 1px solid var(--line); }
.chead { display: flex; gap: 18px; align-items: center; padding: 16px 4px; flex-wrap: wrap; }

/* ---------- Watch page ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) var(--ad-w, 300px); gap: 24px; align-items: start; }
.watch.noad { grid-template-columns: minmax(0, 1fr); }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player video { width: 100%; height: 100%; background: #000; }
.watch h1 { font-size: 20px; line-height: 1.3; margin: 14px 0 10px; }
.wmeta { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.act { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--elev); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.act:hover { background: #2c2c2c; }
.act.on { background: var(--text); color: #0b0b0b; border-color: var(--text); }
.act.on svg.i { fill: currentColor; }
.desc { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 14px; white-space: pre-wrap; word-break: break-word; }
.desc.collapsed { max-height: 4.6em; overflow: hidden; position: relative; }
.ad-slot { position: sticky; top: calc(var(--topbar-h) + 16px); width: var(--ad-w, 300px); min-height: var(--ad-h, 600px); border: 1px dashed #262626; border-radius: var(--radius); display: grid; place-items: start center; color: var(--text-3); font-size: 11px; padding-top: 6px; }
.comments { margin-top: 16px; }
.cm { display: flex; gap: 10px; padding: 10px 0; }
.cm .body { white-space: pre-wrap; word-break: break-word; }
.cm-actions { color: var(--text-3); font-size: 12px; display: flex; gap: 12px; margin-top: 2px; }
.cm-actions button:hover { color: var(--text); }
.composer { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 6px; }
.composer .textarea { min-height: 44px; height: 44px; }

/* ---------- Shorts viewer ---------- */
body.immersive #view { margin-left: var(--side-w); padding-top: var(--topbar-h); }
.sv { position: fixed; top: var(--topbar-h); bottom: 0; left: var(--side-w); right: 0; background: var(--bg); }
.sv-scroll { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.sv-scroll::-webkit-scrollbar { display: none; }
.sv-item { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; justify-content: center; align-items: flex-end; gap: 16px; padding: 12px 0; }
.sv-stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.sv-stage video, .sv-stage .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.sv-stage video.contain { object-fit: contain; }
.sv-tap { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.sv-info { position: absolute; left: 0; right: 56px; bottom: 0; padding: 60px 14px 16px; background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0)); z-index: 3; pointer-events: none; }
.sv-info > * { pointer-events: auto; }
.sv-info .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sv-info .un { font-weight: 700; }
.sv-info .cap { margin-top: 8px; font-size: 13.5px; line-height: 1.35; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.sv-info .cat { display: inline-block; margin-top: 8px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.14); }
.sv-actions { display: flex; flex-direction: column; gap: 14px; align-items: center; padding-bottom: 8px; }
.sv-act { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); font-size: 12px; font-weight: 600; }
.sv-act .ico { width: 46px; height: 46px; border-radius: 50%; background: var(--elev); border: 1px solid var(--line); display: grid; place-items: center; }
.sv-act:hover .ico { background: #2e2e2e; }
.sv-act.on .ico { background: var(--text); color: #0b0b0b; }
.sv-act.on .ico svg.i { fill: currentColor; }
.sv-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; z-index: 5; cursor: pointer; display: flex; align-items: flex-end; }
.sv-progress i { display: block; height: 3px; width: 0; background: var(--text); }
.sv-progress::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.22); }
.sv-progress i { position: relative; }
.sv-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; z-index: 4; pointer-events: none; }
.sv-top > * { pointer-events: auto; }
.sv-pill { height: 34px; min-width: 34px; padding: 0 10px; border-radius: 999px; background: rgba(0,0,0,.55); display: inline-grid; place-items: center; }
.sv-flash { position: absolute; left: 50%; top: 45%; width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 4; pointer-events: none; opacity: 0; }
.sv-flash.show { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: 0; transform: scale(.8); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1); } }
.sv-nav { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 6; }
.sv-nav .icon-btn { background: var(--elev); border: 1px solid var(--line); }
.sv-sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 66%; background: var(--card); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; z-index: 8; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .22s ease; }
.sv-sheet.open { transform: none; }
.sv-sheet header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.sv-sheet .list { flex: 1; overflow-y: auto; padding: 4px 14px; }
.sv-sheet footer { padding: 10px 14px; border-top: 1px solid var(--line); }
.sv-mobile-bar { display: none; }
.sv-empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 20px; }
.sv-sort { appearance: none; background: rgba(0,0,0,.55); border: 0; border-radius: 999px; height: 34px; padding: 0 14px; font-weight: 600; font-size: 13px; }

/* ---------- Misc ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 24px); max-width: 420px; pointer-events: none; }
.toast { background: #fafafa; color: #0b0b0b; padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 28px rgba(0,0,0,.55); pointer-events: auto; }
.toast.bad { background: #ffdadb; color: #4a0d10; }
.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 150; padding: 16px; }
.modal { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.empty { text-align: center; padding: 56px 16px; color: var(--text-2); }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.skel { background: var(--card); border-radius: var(--radius); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on, .tabs button.on { color: var(--text); border-color: var(--text); }
.pager { display: flex; justify-content: center; gap: 10px; margin: 18px 0; }
.sentinel { height: 1px; }
.loading { text-align: center; padding: 20px; color: var(--text-3); }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .watch { grid-template-columns: minmax(0, 1fr); }
  .ad-slot { display: none; }
}
@media (max-width: 1100px) and (min-width: 900px) {
  .page { padding: 16px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 899px) {
  :root { --topbar-h: 48px; --side-w: 0px; }
  .sidebar, .search.desk { display: none; }
  .mtabs { display: flex; }
  .only-m { display: inline-grid; }
  .only-d { display: none !important; }
  .topbar { padding: 0 8px; gap: 6px; }
  .brand { font-size: 17px; }
  #view { margin-left: 0; }
  .page { padding: 12px 12px 48px; }
  .lgrid, .lgrid.all { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .lgrid > :nth-child(n+5) { display: none; }
  .lgrid > :nth-child(n+4) { display: block; }
  .lgrid.all > :nth-child(n) { display: block; }
  .lcard .th { border-radius: 0; margin: 0 -12px; border-left: 0; border-right: 0; }
  .rail .scard { flex-basis: 38vw; }
  .rail-btn { display: none; }
  .sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt-grid { grid-template-columns: minmax(0, 1fr); }
  .watch h1 { font-size: 18px; }
  .player { border-radius: 0; margin: 0 -12px; border-left: 0; border-right: 0; }
  .banner { height: 110px; }

  /* Shorts: use the whole viewport. */
  body.immersive .topbar { display: none; }
  body.immersive #view { padding-top: 0; margin-left: 0; }
  .sv { top: 0; left: 0; right: 0; bottom: 0; height: 100dvh; }
  .sv-item { padding: 0; gap: 0; position: relative; display: block; }
  .sv-stage { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; border: 0; }
  .sv-actions { position: absolute; right: 8px; bottom: 76px; z-index: 6; padding: 0; gap: 12px; }
  .sv-act { text-shadow: 0 1px 3px rgba(0,0,0,.9); }
  .sv-act .ico { background: rgba(0,0,0,.42); border-color: rgba(255,255,255,.12); }
  .sv-info { right: 70px; padding-bottom: 20px; }
  .sv-nav { display: none; }
  .sv-top { top: max(10px, env(safe-area-inset-top)); }
  .sv-sheet { height: 70%; }
  .sv-mobile-bar { display: flex; }
}
/* ---------- Tablet: compact header, but more than one column ---------- */
@media (min-width: 600px) and (max-width: 899px) {
  .page { padding: 16px 18px 48px; }
  .lgrid, .lgrid.all { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .lgrid > :nth-child(n+5) { display: none; }
  .lgrid.all > :nth-child(n) { display: block; }
  .lcard .th { border-radius: var(--radius); margin: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .rail .scard { flex-basis: 22vw; }
  .sgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .opt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player { border-radius: var(--radius); margin: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .banner { height: 150px; }
  /* Shorts stay immersive, but the stage keeps its 9:16 shape and the controls sit beside it. */
  .sv-item { display: flex; justify-content: center; align-items: center; padding: 0; }
  .sv-stage { width: auto; height: 100%; max-width: 100%; aspect-ratio: 9 / 16; border-radius: 0; }
  .sv-actions { position: static; padding: 0 0 0 10px; gap: 14px; }
  .sv-actions .ico { background: var(--elev); border-color: var(--line); }
  .sv-info { right: 14px; }
}

@media (min-width: 900px) {
  .sv-mobile-bar { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Earnings & payments */
.stat small { display: block; margin-top: 2px; font-size: 11px; }
.earn-cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.progress { height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: linear-gradient(90deg, #58c28a, #7aa7ff); border-radius: 999px; min-width: 2px; }
.chart-wrap { width: 100%; }
.chart { width: 100%; height: 200px; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 10px; }
.chart .col:hover rect:last-child, .chart .col:focus rect:last-child { fill: rgba(255,255,255,.07); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--text-2); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.row.between { justify-content: space-between; }

/* Channel header, Subscribe and Telegram pill */
.avatar.xl { width: 96px; height: 96px; font-size: 34px; }
.chead { display: flex; gap: 20px; align-items: flex-start; padding: 16px 4px 12px; }
.cinfo { min-width: 0; flex: 1; }
.cname { overflow-wrap: anywhere; line-height: 1.2; }
.cmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; }
.cbio { margin-top: 8px; max-width: 680px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chactions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.subscribe { height: 38px; padding: 0 20px; background: var(--text); color: #0b0b0b; border-color: var(--text); }
.btn.subscribe.on { background: var(--elev); color: var(--text); border-color: var(--line); }
.btn.tg.pill { height: 30px; padding: 0 12px; font-size: 12px; gap: 6px; }
.btn.tg.pill svg { width: 14px; height: 14px; }
.wchan { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.wlink { min-width: 0; gap: 10px; }
.wname { min-width: 0; }
.cname-sm { font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .chead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .avatar.xl { width: 72px; height: 72px; font-size: 26px; margin-top: -36px; border: 3px solid var(--bg); }
  .chactions { width: 100%; }
}

/* Cropper */
.modal.crop-modal { max-width: 560px; }
.modal.thumb-modal { max-width: 720px; }
.crop-stage { position: relative; margin: 0 auto; background: #000; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage.round { border-radius: 50%; }
.crop-canvas { display: block; width: 100%; }
.crop-safe { position: absolute; border: 1.5px dashed rgba(255,255,255,.8); box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none; display: flex; align-items: flex-start; justify-content: center; }
.crop-safe span { font-size: 10px; background: rgba(0,0,0,.6); padding: 1px 6px; border-radius: 0 0 6px 6px; }
.crop-controls { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.crop-zoom { flex: 1; min-width: 0; accent-color: #fff; height: 28px; }
.crop-previews { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.crop-previews figure { margin: 0; max-width: 100%; }
.crop-prev { display: block; border: 1px solid var(--line); border-radius: 6px; background: #000; max-width: 100%; }

/* Thumbnail picker */
.thumb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; align-items: start; }
.thumb-preview { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.thumb-preview.short { aspect-ratio: 9 / 16; max-width: 190px; }
.thumb-preview.long { aspect-ratio: 16 / 9; }
.thumb-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-preview .ph { height: 100%; display: grid; place-items: center; color: var(--text-3); font-size: 12px; padding: 8px; text-align: center; min-height: 80px; }
.thumb-vwrap { background: #000; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.thumb-vwrap.short { aspect-ratio: 9 / 16; max-height: 360px; margin: 0 auto; }
.thumb-vwrap.long { aspect-ratio: 16 / 9; }
.thumb-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.thumb-seek { flex: 1; min-width: 0; accent-color: #fff; height: 28px; }
.thumb-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 640px) { .thumb-grid { grid-template-columns: minmax(0, 1fr); } .thumb-preview.short { margin: 0 auto; } }

/* Upload steps and preview */
.creator-tabs { margin: 0 0 14px; }
.creator-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.ustep { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.ustep:last-of-type { border-bottom: 0; margin-bottom: 0; }
.ustep-h { font-size: 15px; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ustep-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--elev); border: 1px solid var(--line); font-size: 12px; }
.upload-preview { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 10px; }
.pcard { width: 180px; max-width: 100%; }
.pcard.long { width: 260px; }
.pcard img, .pcard .ph { width: 100%; border-radius: 10px; object-fit: cover; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-3); font-size: 12px; }
.pcard.short img, .pcard.short .ph { aspect-ratio: 9 / 16; }
.pcard.long img, .pcard.long .ph { aspect-ratio: 16 / 9; }
.pcard .pt { font-weight: 600; margin-top: 6px; overflow-wrap: anywhere; }
.pvideo { background: #000; border-radius: 10px; border: 1px solid var(--line); max-width: 100%; }
.pvideo.short { width: 180px; aspect-ratio: 9 / 16; }
.pvideo.long { width: 320px; aspect-ratio: 16 / 9; }
.pvideo.ph { display: grid; place-items: center; color: var(--text-3); font-size: 12px; text-align: center; padding: 8px; }

/* Research */
.research .rresults { display: grid; gap: 12px; margin-top: 14px; }
.rcard .rtitle { font-size: 17px; margin: 4px 0 6px; overflow-wrap: anywhere; line-height: 1.3; }
.rcard .rdesc { color: var(--text-2); overflow-wrap: anywhere; margin-bottom: 10px; }
.ractions { margin-top: 12px; gap: 8px; }
.ractions .btn { flex: 0 1 auto; }
.rurl { overflow-wrap: anywhere; word-break: break-all; font-size: 14px; }
.rnotes { margin: 10px 0 0 18px; display: grid; gap: 4px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .ractions .btn { flex: 1 1 calc(50% - 8px); } .ractions .btn.primary { flex-basis: 100%; } }

@media (max-width: 600px) {
  .sec-head { flex-wrap: wrap; }
  .sec-head .tabs { flex: 1 1 100%; margin-bottom: 0; }
  .sec-head .select { flex: 1 1 auto; }
  .banner:not([style*="background-image"]) { background: linear-gradient(135deg, #181818, #0f0f0f); }
}

.sv-info .who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-info .btn.subscribe { height: 30px; padding: 0 14px; font-size: 13px; }
.sv-info .chactions { gap: 6px; }

/* Shorts: double-tap seek indicators */
.sv-seek { position: absolute; top: 0; bottom: 0; width: 38%; z-index: 3; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.sv-seek.left { left: 0; border-radius: 0 50% 50% 0; background: radial-gradient(closest-side, rgba(255,255,255,.18), transparent); }
.sv-seek.right { right: 0; border-radius: 50% 0 0 50%; background: radial-gradient(closest-side, rgba(255,255,255,.18), transparent); }
.sv-seek span { font-weight: 800; font-size: 15px; padding: 8px 12px; border-radius: 999px; background: rgba(0,0,0,.55); }
.sv-seek.show { animation: seekflash .6s ease-out; }
@keyframes seekflash { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sv-seek.show { animation: none; opacity: 1; transition: opacity .6s; } }

/* Shorts: buffering feedback and sound hint */
.sv-spin { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; z-index: 4; display: grid; place-items: center; pointer-events: none; border-radius: 50%; background: rgba(0,0,0,.45); }
.sv-spin[hidden] { display: none; }
.sv-spin i { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: svspin .8s linear infinite; }
@keyframes svspin { to { transform: rotate(360deg); } }
.sv-progress i.buf { position: absolute; left: 0; bottom: 0; background: rgba(255,255,255,.4); width: 0; transition: width .3s; }
.sv-sound { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 6; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.25); color: #fff; font-weight: 700; font-size: 13px; }
.sv-sound[hidden] { display: none; }
.sv-sound .i { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .sv-spin i { animation-duration: 2s; } }

/* Shorts overlay: one-line title, details slide up when tapped */
.sv-info .cap { margin-top: 6px; }
.sv-info .cap .ttl { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.sv-info .cap .ttl b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sv-info .cap.expandable { cursor: pointer; }
.sv-info .cap .chev { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.16); transition: transform .25s; }
.sv-info .cap .chev .i { width: 14px; height: 14px; }
.sv-info.open .cap .chev { transform: rotate(180deg); }
.sv-info .cap .more { max-height: 0; opacity: 0; overflow: hidden; transform: translateY(12px); transition: max-height .3s ease, opacity .25s ease, transform .3s ease; font-weight: 400; }
.sv-info.open .cap .more { max-height: 42vh; opacity: 1; transform: none; overflow-y: auto; margin-top: 8px; overscroll-behavior: contain; }
.sv-info .cap .more .full { font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; }
.sv-info .cap .more .txt { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.sv-info.open { background: linear-gradient(to top, rgba(0,0,0,.92) 55%, rgba(0,0,0,0)); }
.sv-info .cap .more .cat { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .sv-info .cap .more, .sv-info .cap .chev { transition: none; } }

/* One line everywhere: [avatar @handle] [Subscribe] [Telegram]. The handle shrinks first, the buttons never wrap. */
.btn.subscribe.own { opacity: .5; }
.sv-info .who { flex-wrap: nowrap; gap: 8px; min-width: 0; }
.sv-info .who > a.row { flex: 1 1 auto; min-width: 0; }
.sv-info .who .un { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.sv-info .who .avatar.md { width: 34px; height: 34px; }
.sv-info .chactions { flex: none; flex-wrap: nowrap; gap: 6px; width: auto; }
.sv-info .btn.subscribe, .sv-info .btn.tg.pill { height: 30px; padding: 0 12px; font-size: 12.5px; white-space: nowrap; }
@media (max-width: 360px) {
  .sv-info .who { gap: 6px; }
  .sv-info .who .avatar.md { width: 28px; height: 28px; }
  .sv-info .who .un { font-size: 12.5px; }
  .sv-info .btn.subscribe, .sv-info .btn.tg.pill { height: 28px; padding: 0 9px; font-size: 12px; }
  .sv-info .btn.tg.pill { gap: 4px; }
}

/* creator studio: visibility control */
.vis-select { height: 32px; padding: 0 28px 0 10px; font-size: 13px; width: auto; min-width: 104px; }
.chip.vis { height: 22px; font-size: 11.5px; padding: 0 8px; color: var(--text); }
.chips button.chip { cursor: pointer; }

/* ---------- Phones: two video cards per row, compact text ---------- */
@media (max-width: 599px) {
  .lgrid, .lgrid.all { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 8px; }
  .lgrid > :nth-child(n+5) { display: none; }          /* home: two rows of two */
  .lgrid.all > :nth-child(n) { display: block; }
  .lcard .th { border-radius: 8px; margin: 0; border: 1px solid var(--line); }
  .lcard .meta { margin-top: 6px; gap: 0; }
  .lcard .meta > span { display: none; }               /* no avatar: title, channel and views only */
  .lcard .t { font-size: 12.5px; line-height: 1.25; }
  .lcard .sub { font-size: 11px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lcard .dt { display: none; }                        /* date appears on the watch page */
  .lcard .badge-dur { font-size: 10.5px; padding: 0 4px; bottom: 4px; right: 4px; }
  .lgrid + .divider { margin: 16px 0 10px !important; }
}

/* ---- Video previews (hover on desktop, hold/scroll on touch) ---- */
.pv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 1; border-radius: inherit; }
.pv.on { opacity: 1; }
.pv-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform: scaleX(0); transform-origin: left; background: var(--brand-grad, #ff2d55); z-index: 3; pointer-events: none; }
.badge-dur, .scard .scrim-b { z-index: 2; }
.scard, .lcard .th { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: reduce) { .pv { transition: none; } }
.pv-bar.wait { transform: scaleX(.35) !important; opacity: .75; animation: pvwait 1s ease-in-out infinite alternate; }
@keyframes pvwait { from { margin-left: 0; } to { margin-left: 65%; } }
@media (prefers-reduced-motion: reduce) { .pv-bar.wait { animation: none; } }

/* ---------- Advertisements (admin > Advertisements) ---------- */
.ad-over { position: absolute; inset: 0; z-index: 8; background: transparent; display: block; }   /* the ad video (black behind it) shows through */
.ad-over .ad-spin { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.45); pointer-events: none; }
.ad-over .ad-spin[hidden] { display: none; }
.ad-over .ad-spin i { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: svspin .8s linear infinite; }
.ad-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.ad-tag { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 3px 9px; border-radius: 6px; background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.ad-skip { position: absolute; right: 12px; bottom: 74px; z-index: 2; height: 38px; padding: 0 16px; border-radius: 999px; background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.35); color: #fff; font-weight: 700; font-size: 13.5px; }
.ad-skip:disabled { opacity: .75; }
.ad-skip:not(:disabled) { background: #fff; color: #0b0b0b; }
.ad-cta { position: absolute; left: 12px; right: 12px; bottom: 18px; z-index: 2; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 15px; text-decoration: none; padding: 0 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ad-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.22); z-index: 2; }
.ad-bar { display: block; height: 100%; width: 0; background: #fff; }
.player .ad-skip { bottom: 70px; }
.player .ad-cta { left: auto; right: 12px; width: auto; max-width: 70%; bottom: 14px; height: 38px; font-size: 13.5px; }
.sv-ad .ad-over .ad-spin { pointer-events: none; }
.sv-ad .ad-tag { top: 56px; }
.sv-ad .ad-skip { bottom: 76px; }
.sv-stage > .ad-over { z-index: 8; }
/* Shorts on phones: no dark fade behind the channel / title text (it showed as a one-sided dark patch). */
@media (max-width: 899px) { .sv-info { background: none; text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 10px rgba(0,0,0,.4); } }
.ad-slot.has-ad { border: 0; padding: 0; display: block; min-height: var(--ad-h, 250px); }
@media (max-width: 1100px) { .ad-slot.has-ad { display: none; } }
.ad-banner { margin: 14px 0; display: flex; justify-content: center; overflow: hidden; border-radius: var(--radius); }
/* Pause banner: a 300 x 250 ad in the middle of a paused long video */
.pb-over { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; pointer-events: none; }
.pb-wrap { position: relative; pointer-events: auto; box-shadow: 0 6px 26px rgba(0,0,0,.55); border-radius: 6px; }
.pb-box { transform-origin: 0 0; overflow: hidden; border-radius: 6px; background: #111; }
.pb-tag { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; font-weight: 800; pointer-events: none; }
.pb-close { position: absolute; right: -10px; top: -10px; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #111; border: 0; font-size: 20px; line-height: 26px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.5); cursor: pointer; }
.ad-banner .ad-frame { max-width: 100%; }
.ad-fit { width: 100%; display: flex; justify-content: center; overflow: hidden; }
.ad-fit-box { overflow: hidden; max-width: 100%; }
.ad-banner .ad-fit-box .ad-frame { max-width: none; }
/* Phone banner bar (bottom of every page except Shorts) */
.mbanner { display: none; }
@media (max-width: 899px) {
  .mbanner { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--bg); border-top: 1px solid var(--line); height: calc(var(--mb-h, 100px) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); overflow: hidden; }
  .mbanner .ad-frame { width: 100%; height: var(--mb-h, 100px) !important; }
  body.has-mbanner { padding-bottom: calc(var(--mb-h, 100px) + env(safe-area-inset-bottom, 0px)); }
  body.immersive .mbanner { display: none; }
  body.has-mbanner .toast-wrap { bottom: calc(var(--mb-h, 100px) + 22px); }
}
