/* Console design system - mobile-first. Breakpoints: 640 (sm), 720 (tables), 900 (rail), 1200 (wide). */
:root {
  --bg: #f3f4f1; --surface: #ffffff; --surface-2: #ecede8; --border: #d7dad1;
  --text: #14181a; --muted: #5a6468; --danger: #c0392b; --warn: #8a5a00; --ok: #17794a;
  --danger-bg: #fbe9e6; --warn-bg: #fdf1d6; --ok-bg: #def4e8;
  --radius: 10px; --tap: 44px; --rail: 216px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d0e; --surface: #131618; --surface-2: #1a1e21; --border: #272c30;
    --text: #e8ecee; --muted: #8e989e; --danger: #ff7a6e; --warn: #f2b84b; --ok: #4cd08a;
    --danger-bg: #3a1a17; --warn-bg: #33270d; --ok-bg: #12301f; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d0e; --surface: #131618; --surface-2: #1a1e21; --border: #272c30;
  --text: #e8ecee; --muted: #8e989e; --danger: #ff7a6e; --warn: #f2b84b; --ok: #4cd08a;
  --danger-bg: #3a1a17; --warn-bg: #33270d; --ok-bg: #12301f; --shadow: none; color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; } a { color: var(--accent-text); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── shell: bottom bar on phones, left rail from 900px ─────────────────────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); min-height: 56px; }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.spacer { flex: 1; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent-text); font-weight: 600; }
.nav a:hover { color: var(--text); }
.nav .nav-brand, .nav .nav-sep { display: none; }
.main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1rem 1rem calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .app { flex-direction: row; }
  .nav { position: sticky; top: 0; bottom: auto; height: 100vh; width: var(--rail); flex: none; flex-direction: column; border-top: 0; border-right: 1px solid var(--border); padding: 1rem .75rem; gap: .25rem; }
  .nav .nav-brand { display: flex; padding: .25rem .5rem 1rem; }
  .nav .nav-sep { display: block; flex: 1; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: .75rem; min-height: 42px; padding: 0 .75rem; border-radius: 8px; font-size: .92rem; }
  .nav a[aria-current="page"] { background: var(--surface-2); }
  .main { padding: 1.5rem 1.75rem 2rem; }
  .topbar .logo { display: none; }
}
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }

/* ── controls ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap); padding: 0 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { filter: brightness(.95); border-color: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: var(--tap); min-width: var(--tap); padding: 0 .7rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (min-width: 900px) { .btn { min-height: 38px; } .btn-sm { min-height: 32px; min-width: 0; } }
.input, .select, textarea.input { width: 100%; min-height: var(--tap); padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
textarea.input { min-height: 96px; resize: vertical; }
@media (min-width: 900px) { .input, .select { min-height: 38px; } }
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .75rem; }
.field label, .label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.check { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); }
.check input { width: 20px; height: 20px; accent-color: var(--accent-text); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row > .grow { flex: 1 1 160px; }
.input-money { position: relative; }
.input-money > span { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-money > input { padding-left: 1.5rem; }

/* ── surfaces ─────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.tile .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile .v { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.alert { padding: .65rem .9rem; border-radius: 8px; margin-bottom: 1rem; background: var(--surface-2); border: 1px solid var(--border); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }

/* ── tabs: horizontally scrollable on phones ──────────────────────────────── */
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tabs a, .tabs button { flex: none; min-height: var(--tap); padding: 0 1rem; display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-weight: 600; cursor: pointer; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ── responsive table: real table >= 720px, stacked cards below ──────────── */
.table-wrap { overflow-x: auto; }
.rtable { width: 100%; border-collapse: collapse; }
.rtable th { text-align: left; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: .5rem .75rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rtable td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 719px) {
  .rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; margin-bottom: .75rem; }
  .rtable td { border: 0; padding: .3rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
  .rtable td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; flex: none; }
  .rtable td.actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* ── dialog / toast ───────────────────────────────────────────────────────── */
dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
dialog::backdrop { background: rgba(0,0,0,.55); }
.dlg-head { padding: 1rem 1.25rem .5rem; } .dlg-body { padding: 0 1.25rem 1rem; overflow-y: auto; max-height: 60vh; }
.dlg-foot { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; padding: .75rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.delta-up { color: var(--ok); font-weight: 700; } .delta-down { color: var(--danger); font-weight: 700; }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; text-align: center; margin: .75rem 0; }
.compare .box { background: var(--surface-2); border-radius: 8px; padding: .5rem; }
.compare .box b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 100; max-width: calc(100vw - 24px); }
#toast div { background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; margin-top: .5rem; box-shadow: 0 4px 20px rgba(0,0,0,.3); }
@media (min-width: 900px) { #toast { bottom: 24px; } }

/* ── auth / landing placeholder ───────────────────────────────────────────── */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(400px, 100%); }

/* ── pricing board ────────────────────────────────────────────────────────── */
.tier-name { font-weight: 700; }
.rate-edit { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; }
.rate-edit .input-money { width: 120px; }
.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.col { flex: 0 0 260px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; min-height: 120px; }
.col.drop { outline: 2px dashed var(--accent-text); background: var(--surface-2); }
.col h3 { display: flex; justify-content: space-between; gap: .5rem; font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { min-height: var(--tap); min-width: var(--tap); justify-content: center; padding: 0 .7rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: .85rem; cursor: grab; display: inline-flex; align-items: center; touch-action: manipulation; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.movebar { position: sticky; top: 56px; z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; margin-bottom: .75rem; }
@media (min-width: 900px) { .movebar { top: 0; } }
.spark { width: 100%; height: 90px; }
.spark path { fill: none; stroke: var(--accent-text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pill-list { display: flex; flex-wrap: wrap; gap: .35rem; }

summary { display: list-item; padding: .7rem 0; cursor: pointer; }
@media (min-width: 900px) { .chip { min-height: 34px; min-width: 0; } summary { padding: .3rem 0; } }

[hidden] { display: none !important; }

/* ── video manager ────────────────────────────────────────────────────────── */
.vm { display: block; }
.vm-side { display: none; }
.vm-tree-m { margin-bottom: 1rem; }
.tree { display: flex; flex-direction: column; gap: 2px; margin-top: .5rem; max-height: 60vh; overflow: auto; }
.tnode { display: flex; align-items: center; gap: .5rem; min-height: var(--tap); padding: 0 .5rem 0 calc(.5rem + var(--d, 0) * 1rem); border-radius: 8px; color: var(--text); text-decoration: none; }
.tnode:hover { background: var(--surface-2); }
.tnode.is-current { background: var(--surface-2); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.tnode.drop, .fcard.drop { outline: 2px dashed var(--accent-text); background: var(--surface-2); }
.tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcount { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
@media (min-width: 1100px) {
  .vm { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .vm-side { display: block; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: hidden; }
  .vm-side .tree { max-height: calc(100vh - 8rem); }
  .vm-tree-m { display: none; }
  .tnode { min-height: 34px; }
}
.vm-main { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .75rem; font-size: .9rem; }
.crumbs a:not(.btn) { color: var(--accent-text); }
.sec { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.25rem 0 .5rem; }
.toolbar { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .toolbar { grid-template-columns: 1fr 170px auto; } }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.fcard { display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: var(--text); padding: .75rem 1rem; min-height: var(--tap); }
.fcard + .fcard { margin-top: 0; }
.fcard:hover { border-color: var(--muted); }
.fcard .i { width: 26px; height: 26px; color: var(--accent-text); }
.fname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: .4rem; border: 1px solid var(--border); }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.bulkbar { position: sticky; top: 56px; z-index: 12; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; padding: .5rem .75rem; }
@media (min-width: 900px) { .bulkbar { top: 0; } }
.vtable .thumb { display: block; width: 128px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); flex: none; }
.vtable .thumb img, .vtable .ph { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; color: var(--muted); }
.vtable .vcell { display: flex; align-items: center; gap: .75rem; }
.vtitle { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.vtable tr.is-selected td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media (max-width: 719px) {
  .vtable tr { position: relative; padding-top: .75rem; }
  .vtable td.selcell { position: absolute; top: .35rem; right: .35rem; width: auto; padding: 0; z-index: 1; }
  .vtable td.selcell .check { background: var(--surface); border-radius: 8px; padding: 0 .4rem; min-height: var(--tap) !important; }
  .vtable td.vcell { flex-direction: column; align-items: stretch; text-align: left; }
  .vtable .thumb { width: 100%; }
  .vtable td.actions { justify-content: flex-end; }
}
.menu { position: relative; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; padding: 0 1rem; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; display: flex; flex-direction: column; padding: .35rem; margin: 0 !important; }
.menu-pop .btn { justify-content: flex-start; border: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; }
.empty { text-align: center; padding: 2rem 1rem; }
.picker { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.pick { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); padding-right: .75rem; cursor: pointer; border-bottom: 1px solid var(--border); }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--surface-2); }
.pick.is-disabled { opacity: .45; cursor: not-allowed; }
.pick input { width: 18px; height: 18px; accent-color: var(--accent-text); }
.pick span:first-of-type { flex: 1; }
.plain { list-style: none; padding: 0; margin: 0 0 .75rem; }
.plain li { padding: .15rem 0; }

/* ── upload ───────────────────────────────────────────────────────────────── */
.drop { display: grid; justify-items: center; gap: .25rem; padding: 2rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius); text-align: center; cursor: pointer; min-height: 140px; align-content: center; }
.drop:hover, .drop.drop, .drop:focus-visible { border-color: var(--accent-text); background: var(--surface-2); }
.uplist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.upitem { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .75rem; display: flex; flex-direction: column; gap: .35rem; }
.upitem.is-done { border-color: var(--ok); }
.upitem.is-error { border-color: var(--danger); }
.upname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.err { color: var(--danger); }
.upitem .bar { margin-top: 0; }

/* many nav items on phones: scroll sideways instead of squeezing */
@media (max-width: 899px) { .nav { overflow-x: auto; scrollbar-width: none; } .nav a { flex: 1 0 68px; } }
.sgrid .span-all { grid-column: 1 / -1; }

/* manager table: keep the title column readable */
.vtable td.vcell { min-width: 300px; }
.vtitle { overflow-wrap: break-word; word-break: normal; min-width: 0; flex: 1; }
.vtable .thumb { background: color-mix(in srgb, var(--muted) 18%, var(--surface)); }
@media (max-width: 719px) { .vtable td.vcell { min-width: 0; } }

@media (min-width: 720px) and (max-width: 1499px) {
  .vtable .col-added { display: none; }
  .vtable .thumb { width: 104px; }
  .vtable td.vcell { min-width: 230px; }
}

/* 44px touch targets in the manager (phones) */
.crumbs a:not(.btn) { display: inline-flex; align-items: center; min-height: var(--tap); }
.vtable .check { min-height: var(--tap) !important; min-width: var(--tap); justify-content: center; }
.vtable .check input { margin: 0; }
@media (max-width: 719px) { .vtitle { display: block; padding: .65rem 0; } }
@media (min-width: 900px) { .crumbs a:not(.btn) { min-height: 32px; } .vtable .check { min-height: 36px !important; min-width: 36px; } }

/* compact stats + one-row toolbar on phones (less vertical scrolling) */
.tiles-3 { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.tiles-3 .tile { padding: .5rem .65rem; min-width: 0; }
.tiles-3 .tile .k { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles-3 .tile .v { font-size: 1.2rem; }
.tiles-3 .tile .v.sm { font-size: .95rem; }
.toolbar { grid-template-columns: minmax(0, 1fr) 112px auto; }
@media (min-width: 640px) { .toolbar { grid-template-columns: minmax(0, 1fr) 170px auto; } }
.vm-tree-m { padding: 0 .85rem; }
.vm-tree-m .tree { margin-bottom: .6rem; }

.fgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.fcard { padding: .6rem .8rem; }

/* ── public pages (homepage, Make money) ─────────────────────────────────── */
.pub-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.pub-bar { max-width: 1120px; margin: 0 auto; padding: .5rem 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-height: 56px; }
.pub-links { display: flex; gap: .25rem; margin-left: .5rem; }
.pub-links a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 .75rem; color: var(--muted); text-decoration: none; font-weight: 600; border-radius: 8px; }
.pub-links a:hover, .pub-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.pub-main { min-height: 60vh; }
.pub-wrap { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem; }
.pub h2 { font-size: 1.35rem; margin-bottom: 1rem; }
.eyebrow { color: var(--accent-text); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin: 0 0 .5rem; }
.hl { color: var(--accent-text); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 40rem; }
.lead b { color: var(--text); }
.pub-hero { padding: 2rem 0 1rem; background: radial-gradient(60rem 24rem at 15% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.pub-hero h1 { font-size: clamp(2rem, 7vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 1rem; }
.pub-hero-sm { padding-bottom: .5rem; }
.pub-hero-sm h1 { font-size: clamp(1.7rem, 5.5vw, 2.6rem); line-height: 1.1; letter-spacing: -.02em; }
.pub-actions { margin-top: 1.25rem; }
.btn-lg { min-height: 52px; padding: 0 1.5rem; font-size: 1.05rem; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.sec-head h2 { margin: 0; }
.rate-strip { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.rate-chip { flex: 0 0 min(210px, 70vw); scroll-snap-align: start; display: flex; flex-direction: column; gap: .15rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); }
.rate-chip:hover { border-color: var(--accent-text); }
.rate-big { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rate-big small { font-size: .8rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.rate-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .rate-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .rate-grid { grid-template-columns: repeat(3, 1fr); } }
.rate-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1rem 1.1rem; }
.rate-card h2 { font-size: 1rem; margin: 0 0 .15rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.rate-card-default { border-style: dashed; }
.feat-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feat-grid { grid-template-columns: repeat(3, 1fr); } }
.feat { padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feat .i { width: 28px; height: 28px; color: var(--accent-text); margin-bottom: .5rem; }
.feat h3 { margin-bottom: .25rem; } .feat p { color: var(--muted); margin: 0; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; counter-reset: s; grid-template-columns: 1fr; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: s; display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1rem 1rem 3.4rem; position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.steps li::before { content: counter(s); position: absolute; left: 1rem; top: 1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.steps li span { color: var(--muted); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { font-weight: 600; padding: .85rem 0; }
.faq p { color: var(--muted); margin: 0 0 .85rem; }
.pub-cta { text-align: center; padding: 2.5rem 1rem 3rem; }
.est-out { margin: .5rem 0; font-size: 1.1rem; } .est-out b { font-size: 2rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pub-foot { border-top: 1px solid var(--border); background: var(--surface); }
.pub-foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: 1.25rem 1rem; }
.pub-foot-links { display: flex; gap: .25rem 1rem; flex-wrap: wrap; flex: 1; }
.pub-foot-links a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); text-decoration: none; }
.pub-foot-links a:hover { color: var(--text); }

@media (min-width: 1000px) { .rate-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); overflow: visible; } .rate-chip { flex: none; } }

ul.pill-list { list-style: none; padding: 0; margin: 0; }

/* creator Ads page */
.modecard { display: flex; flex-direction: column; gap: .5rem; cursor: pointer; }
.modecard + .modecard { margin-top: 0; }
.modecard.is-on { border-color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-text); }
.modecard:focus-within { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.modehead { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }

/* two columns only when there is room (used by the fraud page) */
.grid-2w { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .grid-2w { grid-template-columns: minmax(320px, 1fr) 1.2fr; } }
.rtable .badge { white-space: normal; border-radius: 10px; text-align: left; }

/* admin videos: compact list + preview dialog */
.vfilter { margin-bottom: .5rem; }
.vt-compact td { padding-top: .35rem; padding-bottom: .35rem; vertical-align: middle; }
.vt-compact .vcell { display: flex; gap: .65rem; align-items: center; min-width: 240px; }
.vt-compact .thumb { display: block; width: 96px; aspect-ratio: 16 / 9; border-radius: 5px; overflow: hidden; background: color-mix(in srgb, var(--muted) 18%, var(--surface)); flex: none; }
.vt-compact .thumb img, .vt-compact .ph { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; color: var(--muted); }
.vt-compact .vmeta { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.vt-compact .vtitle { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vt-compact .actions { white-space: nowrap; text-align: right; }
.vt-compact .actions .btn + .btn { margin-left: .25rem; }
.vt-compact tr.is-selected td { background: color-mix(in srgb, var(--accent, #4f8cff) 10%, transparent); }
.pvdlg { width: min(960px, 96vw); max-height: 96vh; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.pvdlg::backdrop { background: rgba(0, 0, 0, .7); }
.pv-head, .pv-foot { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; flex-wrap: wrap; }
.pv-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pv-stage { aspect-ratio: 16 / 9; background: #000; max-height: 72vh; width: 100%; margin: 0 auto; }
.pv-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.pv-msg { color: #ddd; padding: 2rem; text-align: center; }
@media (max-width: 720px) {
  .vt-compact .vcell { min-width: 0; }
  .vt-compact .actions { white-space: normal; text-align: left; }
}
@media (min-width: 721px) {
  .vt-compact td { white-space: nowrap; }
  .vt-compact td.vcell { white-space: normal; min-width: 260px; }
  .vt-compact td.actions .btn { padding-inline: .55rem; }
}

/* public collection (playlist) page */
.col-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1rem; }
.col-title { margin: 0; font-size: clamp(1.5rem, 5vw, 2.2rem); letter-spacing: -.02em; overflow-wrap: anywhere; }
.col-subs { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.col-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap); padding: 0 .85rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600; }
.col-chip:hover { border-color: var(--accent); }
.col-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.col-item { display: flex; align-items: center; gap: .75rem; padding: .4rem .5rem; border-radius: 10px; color: inherit; text-decoration: none; min-height: 44px; }
.col-item:hover, .col-item:focus-visible { background: var(--surface-2); }
.col-n { width: 2.2rem; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.col-thumb { position: relative; width: 128px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--muted) 18%, var(--surface)); flex: none; display: grid; place-items: center; color: var(--muted); }
.col-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.col-dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0, 0, 0, .75); color: #fff; font-size: .72rem; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.col-t { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 520px) { .col-n { width: 1.6rem; } .col-thumb { width: 104px; } }

.grid > .card + .card { margin-top: 0; }

/* support tickets */
.nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.titem { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; align-items: center; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; min-height: 56px; }
.titem:hover { border-color: var(--accent); }
.titem.is-unread { border-left: 4px solid var(--accent); }
.titem .tsub { grid-column: 1; overflow-wrap: anywhere; }
.titem .tmeta { grid-column: 1; }
.titem .badge { grid-column: 2; grid-row: 1 / span 2; }
.thread { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; max-width: 720px; }
.msg { padding: .65rem .85rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.msg.is-staff { border-left: 4px solid var(--accent); }
.msg.is-note { background: var(--warn-bg); border-style: dashed; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .25rem; }
.ticket-grid { align-items: start; }
@media (min-width: 900px) { .ticket-grid { grid-template-columns: minmax(0, 1fr) 280px; } }
.nav a { position: relative; }
.nbadge { position: absolute; top: 6px; left: calc(50% + 8px); margin: 0; }
@media (min-width: 900px) { .nbadge { top: 50%; left: auto; right: .75rem; transform: translateY(-50%); } }

.codeblock { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .65rem .85rem; overflow-x: auto; font-family: ui-monospace, monospace; font-size: .8rem; }

/* thumbnail card */
.thumb-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.thumb-big { width: min(100%, 320px); aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: color-mix(in srgb, var(--muted) 18%, var(--surface)); display: grid; place-items: center; color: var(--muted); flex: none; }
.thumb-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-tools { flex: 1 1 260px; min-width: 0; }
.frames { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.frame { display: grid; gap: .25rem; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; color: inherit; cursor: pointer; text-align: center; min-height: 44px; }
.frame:hover, .frame:focus-visible { border-color: var(--accent); }
.frame img { width: 100%; height: auto; border-radius: 6px; display: block; }

/* stats chart: plain HTML/CSS bars (crisp text, responsive, focusable) */
.chart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .5rem; }
.chart .yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 180px; text-align: right; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }
.chart .yaxis span:first-child { transform: translateY(-2px); }
.chart .plot { position: relative; height: 180px; }
.chart .grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border); opacity: .7; pointer-events: none; }
.chart .g0 { top: 0; } .chart .g1 { top: 50%; } .chart .g2 { top: 100%; border-top-style: solid; opacity: 1; }
.chart .bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.chart .bcol { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; border-radius: 4px; outline-offset: 1px; cursor: default; }
.chart .bcol i { display: block; width: 100%; min-height: 0; background: var(--accent-text); border-radius: 4px 4px 0 0; transition: opacity .12s; }
.chart .bcol i[style*="height:0.00%"] { min-height: 0; }
.chart .bcol:hover, .chart .bcol.is-on { background: color-mix(in srgb, var(--accent-text) 12%, transparent); }
.chart .bcol:focus-visible { outline: 2px solid var(--accent-text); }
.chart .xaxis { grid-column: 2; display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); padding-top: .35rem; }
.chart-tip { position: absolute; z-index: 2; pointer-events: none; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .6rem; font-size: .8rem; box-shadow: var(--shadow); white-space: nowrap; }
.chart-tip b { display: block; margin-bottom: .1rem; }

/* ad change log */
.adchg { margin-bottom: .75rem; }
.diff { margin: .5rem 0 0; padding: .6rem .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; font: .78rem/1.5 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .d-add { display: block; background: var(--ok-bg); color: var(--ok); }
.diff .d-del { display: block; background: var(--danger-bg); color: var(--danger); }
.diff .d-gap { display: block; color: var(--muted); font-style: italic; }
.diff .d-same { display: block; }
.diff-add { background: var(--ok-bg); color: var(--ok); padding: 0 .25rem; border-radius: 4px; }
.diff-del { background: var(--danger-bg); color: var(--danger); padding: 0 .25rem; border-radius: 4px; text-decoration: line-through; }

/* error pages (404, 403, ...) */
.err-wrap { text-align: center; padding-top: 3rem; padding-bottom: 4rem; display: grid; justify-items: center; gap: .35rem; }
.err-art { width: min(240px, 60vw); height: auto; margin-bottom: .5rem; }
.err-screen { fill: var(--surface-2); stroke: var(--border); stroke-width: 3; }
.err-play { fill: var(--muted); opacity: .55; }
.err-crack { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.err-stand { fill: var(--border); }
.err-code { margin: 0; font-size: .9rem; font-weight: 700; letter-spacing: .18em; color: var(--muted); }
.err-title { margin: 0; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; }
.err-text { margin: .35rem 0 0; max-width: 32rem; color: var(--muted); }
.err-actions { margin-top: 1.25rem; display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
