:root {
  --bg: #0b0e14;
  --panel: #141924;
  --panel-2: #1b2230;
  --line: #262f40;
  --text: #e6eaf2;
  --muted: #8b95a7;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --ok: #2fbf71;
  --warn: #ffb020;
  --danger: #ff5c72;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
h3 { font-size: 16px; margin: 0 0 6px; }
.mt0 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
pre { background: #0d1017; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
pre code { background: none; padding: 0; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 56px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { color: var(--text); font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.nav a.on { color: var(--text); background: var(--panel-2); }
.topbar-right { display: flex; gap: 8px; }
.pill { color: var(--muted); border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; font-size: 13px; }
.pill:hover, .pill.on { color: var(--text); text-decoration: none; border-color: var(--accent); }

/* Banner */
.banner { padding: 10px 20px; font-size: 13px; text-align: center; }
.banner a { text-decoration: underline; }
.banner-warn { background: rgba(255,176,32,.14); color: #ffd27a; border-bottom: 1px solid rgba(255,176,32,.3); }
.banner-note { background: rgba(79,140,255,.12); color: #bcd3ff; border-bottom: 1px solid rgba(79,140,255,.3); }

/* Layout */
.wrap { max-width: 1200px; margin: 0 auto; padding: 22px 20px 60px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.rangebar { display: flex; align-items: center; gap: 10px; }
.rangebar-label { color: var(--muted); font-size: 13px; }
.ranges { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.ranges a { color: var(--muted); padding: 5px 9px; border-radius: 6px; font-size: 12px; }
.ranges a:hover { color: var(--text); text-decoration: none; }
.ranges a.on { color: #fff; background: var(--accent); }

.lead { color: var(--muted); font-size: 15px; margin: 0 0 18px; max-width: 760px; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head .more { font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi-n { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.kpi-l { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .rank { color: var(--muted); width: 28px; }
.vtitle { max-width: 360px; }
.daysep td { background: var(--panel-2); color: var(--muted); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; padding: 6px 10px; }
.tbl-feed td { border-bottom: 1px solid #1d2433; }
.up { color: var(--ok); } .down { color: var(--danger); }

.tag { display: inline-block; background: var(--panel-2); color: #a9b6cc; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 11px; }
.tag-soft { color: var(--muted); }
.tag-ok { background: rgba(47,191,113,.15); color: #7ee2ac; border-color: rgba(47,191,113,.35); }
.tag-warn { background: rgba(255,176,32,.15); color: #ffd27a; border-color: rgba(255,176,32,.35); }
.tag-note { background: rgba(79,140,255,.15); color: #bcd3ff; border-color: rgba(79,140,255,.35); }

.btn-sm { display: inline-block; background: var(--accent); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; }
.btn-sm:hover { text-decoration: none; background: #3f7bf0; }

/* Video list */
.vidlist { list-style: none; margin: 0; padding: 0; }
.vidlist li { border-bottom: 1px solid var(--line); }
.vidlist li:last-child { border-bottom: none; }
.vidlink { display: block; padding: 9px 4px; }
.vidlink:hover { text-decoration: none; }
.vidtitle { display: block; color: var(--text); }
.vidmeta { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }

/* Filters */
.filters { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filters select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 14px; min-width: 180px; }
.filters .count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* Creator detail */
.creator-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.creator-stats { display: flex; gap: 10px; }
.creator-stats .kpi { min-width: 96px; }
.crumbs { margin: 0 0 14px; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.chart-line { stroke: var(--accent); stroke-width: 2; }
.chart-area { fill: rgba(79,140,255,.14); stroke: none; }
.chart-axis { fill: var(--muted); font-size: 10px; }
.chart-label { fill: var(--text); font-size: 12px; }
.chart-value { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--accent); }
.chart-empty { min-height: 100px; }
.spark path { stroke: var(--accent); stroke-width: 1.5; }

/* Recommendations */
.recs { display: flex; flex-direction: column; gap: 12px; }
.rec { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.rec-n { flex: 0 0 30px; height: 30px; border-radius: 8px; background: var(--accent-2); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.rec-body h3 { margin: 2px 0 6px; }
.rec-body p { margin: 0 0 6px; }
.rec-basis { color: var(--muted); font-size: 12px; }

.howto { line-height: 1.9; }
.howto pre { margin: 6px 0; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 34px 30px; width: 100%; max-width: 360px; text-align: center; }
.login-logo { font-size: 40px; }
.login-card h1 { font-size: 20px; margin: 8px 0 4px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.login-card input { background: #0d1017; border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 11px 13px; font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button { background: var(--accent); color: #fff; border: none; border-radius: 9px; padding: 11px; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-card button:hover { background: #3f7bf0; }
.login-error { background: rgba(255,92,114,.15); color: #ff9aa8; border: 1px solid rgba(255,92,114,.35); border-radius: 8px; padding: 8px; font-size: 13px; }
.login-hint { color: var(--warn); font-size: 12px; margin-top: 14px; }

/* Data screen */
.datamode { font-size: 15px; }
.action-card .card-head h2 { text-transform: none; font-size: 16px; color: var(--text); letter-spacing: 0; }
.dateform { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.dateform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.dateform input[type=date] { background: #0d1017; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; color-scheme: dark; }
.btn { background: var(--accent); color: #fff; border: none; border-radius: 9px; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #3f7bf0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); background: var(--panel-2); }
.job-card { display: none; }
.progress { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin: 8px 0 12px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.progress-bar.running { width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); background-size: 200% 100%; animation: slide 1.2s linear infinite; }
@keyframes slide { from { background-position: 200% 0; } to { background-position: 0 0; } }
.joblog { max-height: 220px; overflow-y: auto; background: #0d1017; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #b7c0d0; white-space: pre-wrap; margin: 0; }

/* Footer */
.foot { max-width: 1080px; margin: 0 auto; padding: 18px 20px 40px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.empty-state { max-width: 600px; margin: 60px auto; text-align: center; }

/* ============================================================
   v2 redesign — charts, avatars, thumbnails, cards
   ============================================================ */
.pad0 { padding: 0 !important; overflow: hidden; }
.pad { padding: 16px 18px; }
.card { box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.stat-strong { font-weight: 800; font-size: 15px; }

/* Charts */
.chart-wrap { position: relative; width: 100%; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.grid { stroke: var(--line); stroke-opacity: .55; }
.axis-y, .axis-x { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-line { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: rgba(79,140,255,.16); stroke: none; }
.hoverband { fill: transparent; cursor: crosshair; }
.cguide { stroke: var(--accent); stroke-opacity: .5; stroke-dasharray: 3 3; }
.cdot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.ctip rect { fill: #0d1017; stroke: var(--line); }
.ctip-v { fill: var(--text); font-size: 12px; font-weight: 700; }
.ctip-d { fill: var(--muted); font-size: 11px; }
.bar-track { fill: var(--panel-2); }
.chart-bar { fill: var(--accent); transition: fill .15s; }
.barrow:hover .chart-bar { fill: var(--accent-2); }
.bar-label { fill: var(--text); font-size: 12px; }
.bar-value { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.spark path { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.spark-dot { fill: var(--accent); }

/* Avatars */
.avatar { border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: none; display: inline-block; vertical-align: middle; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; border-radius: 50%; letter-spacing: .02em; }

/* Thumbnails (16:9) */
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-fallback { display: flex; align-items: center; justify-content: center; }
.thumb-play { color: rgba(255,255,255,.92); font-size: 20px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.thumb.sm { border-radius: 8px; }

/* Video card grid */
.vidgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.vcard { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .12s, border-color .12s; }
.vcard:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); }
.vcard-thumb { position: relative; }
.vcard-thumb .thumb { border-radius: 0; }
.vcard-rank { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.vcard-dur { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.vcard-play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,14,20,.45); color: #fff; font-weight: 700; opacity: 0; transition: opacity .15s; }
.vcard:hover .vcard-play-overlay { opacity: 1; }
.vcard-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.vcard-title { color: var(--text); font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-meta { color: var(--muted); font-size: 12px; }
.vcard-stats { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Creators leaderboard */
.clist { display: flex; flex-direction: column; }
.crow { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--text); }
.crow:last-child { border-bottom: none; }
.crow:hover { background: var(--panel-2); text-decoration: none; }
.crow-rank { width: 22px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.crow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crow-name { font-weight: 600; }
.crow-sub { color: var(--muted); font-size: 12px; }
.crow-spark { width: 120px; flex: none; opacity: .9; }
.crow-metric { display: flex; align-items: baseline; gap: 6px; flex: none; }
.crow-num { font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.crow-lbl { font-size: 10px; color: var(--muted); line-height: 1.05; }

/* Mini lists (overview) */
.minilist { display: flex; flex-direction: column; }
.mini-crow, .mini-vrow { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.mini-crow:last-child, .mini-vrow:last-child { border-bottom: none; }
.mini-crow:hover, .mini-vrow:hover { background: var(--panel-2); text-decoration: none; border-radius: 8px; }
.mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-metric { color: var(--muted); font-size: 13px; white-space: nowrap; }
.mini-metric strong { color: var(--text); }
.mini-thumb { width: 76px; flex: none; }
.mini-thumb.sm { width: 64px; }
.mini-vbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mini-vtitle { color: var(--text); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-watch { color: var(--accent); font-size: 16px; flex: none; }

/* Feed */
.feed { display: flex; flex-direction: column; }
.feedrow { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.feedrow:last-child { border-bottom: none; }
.feedrow:hover { background: var(--panel-2); }
.feed-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feed-title { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-sub { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.feed-creator { display: inline-flex; align-items: center; gap: 5px; }
.daysep { background: var(--panel-2); color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 6px 18px; }
.btn-sm { transition: background .12s; }

/* Creator detail header */
.creator-id { display: flex; align-items: center; gap: 16px; }

/* Responsive */
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .crow-spark { display: none; }
}
@media (max-width: 620px) {
  .creator-stats { width: 100%; }
  .vidgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .vidgrid-lg { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .reachrow-name { flex-basis: 52%; }
  .switchbar { gap: 8px; }
}

/* ===== Prominence + kind toggles ===== */
.switchbar { display: flex; flex-wrap: wrap; gap: 12px; margin: 2px 0 14px; }
.switchgroup { display: flex; align-items: center; gap: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.switch-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }
.switchtab { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); padding: 6px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.switchtab:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.switchtab.on { color: #fff; background: var(--accent); }
.switchtab b { font-weight: 700; font-size: 11px; opacity: .65; font-variant-numeric: tabular-nums; }
.switchtab.on b { opacity: .9; }
.switchtab.tier-big.on { background: linear-gradient(135deg, #ffce7a, #ffb020); color: #241400; }

/* pagehead now stacks the title row over the scope line */
.pagehead { flex-direction: column; align-items: stretch; gap: 8px; }
.pagehead-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.scopeline { margin: 0; font-size: 13px; color: var(--text); }
.scopeline .muted { font-size: 12px; }

/* ===== Reach badges ===== */
.reach { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; letter-spacing: .02em; vertical-align: middle; }
.reach-prime { background: rgba(255,176,32,.18); color: #ffce7a; border: 1px solid rgba(255,176,32,.4); }
.reach-high { background: rgba(47,191,113,.16); color: #7ee2ac; border: 1px solid rgba(47,191,113,.36); }
.reach-med { background: rgba(79,140,255,.16); color: #bcd3ff; border: 1px solid rgba(79,140,255,.36); }
.reach-low { background: rgba(139,149,167,.15); color: #aab4c6; border: 1px solid rgba(139,149,167,.3); }
.reach-deep { background: rgba(139,149,167,.1); color: #8b95a7; border: 1px solid var(--line); }
.reach-na { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

.reach-bg-prime { background: linear-gradient(90deg, #ffb020, #ff7a45); }
.reach-bg-high { background: var(--ok); }
.reach-bg-med { background: var(--accent); }
.reach-bg-low { background: #5a6577; }
.reach-bg-deep { background: #3a4356; }
.reach-bg-na { background: #2a3242; }

.hero-badge { display: inline-block; font-size: 10.5px; font-weight: 700; color: #241400; background: linear-gradient(135deg, #ffce7a, #ffb020); padding: 1px 7px; border-radius: 999px; }
.hero-badge.sm { padding: 0 5px; font-size: 10px; }
.tier-chip { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 1px 6px; border-radius: 5px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tier-chip.big { background: linear-gradient(135deg, #ffce7a, #ffb020); color: #241400; border-color: transparent; }

/* ===== Reach breakdown bars ===== */
.reachbars { display: flex; flex-direction: column; gap: 8px; }
.reachrow { display: flex; align-items: center; gap: 12px; }
.reachrow-name { flex: 0 0 42%; display: flex; align-items: center; gap: 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reachrow-bar { flex: 1; height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.reachrow-fill { display: block; height: 100%; border-radius: 999px; }
.reachrow-val { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== KPI hero variant + unit ===== */
.kpi-hero { border-color: rgba(255,176,32,.4); background: linear-gradient(180deg, rgba(255,176,32,.09), var(--panel)); }
.kpi-hero .kpi-n { color: #ffce7a; }
.kpi-u { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 2px; }

/* ===== Creator leaderboard rate metric ===== */
.crow-metric { flex-direction: column; align-items: flex-end; gap: 1px; min-width: 96px; text-align: right; }
.crow-rate { font-size: 19px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.crow-lbl { font-size: 10px; color: var(--muted); line-height: 1.15; }
.crow-lbl2 { font-size: 10px; color: var(--muted); opacity: .8; }

/* mini-crow reach sub + stacked metric */
.mini-name .mini-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; white-space: normal; }
.mini-metric { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.mini-metric-sub { font-size: 10px; color: var(--muted); }

/* creator detail extras */
.ratebig { font-size: 15px; margin: 8px 0 0; }
.ratebig strong { color: #ffce7a; font-size: 18px; }
.mixline { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }

/* bigger video cards + hero flag + avatar in meta */
.vidgrid-lg { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.vcard-hero { position: absolute; top: 8px; right: 8px; background: linear-gradient(135deg, #ffce7a, #ffb020); color: #241400; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; letter-spacing: .04em; }
.vcard-meta { display: flex; align-items: center; gap: 6px; }

/* empty states */
.empty { padding: 30px 18px; text-align: center; }
.empty p { margin: 4px 0; }

/* live-collection dot in banner */
.banner .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* advanced (collapsed) manual overrides on the Data page */
details.advanced { margin: 6px 0 18px; }
details.advanced > summary { cursor: pointer; font-size: 13px; padding: 8px 2px; list-style: none; }
details.advanced > summary::before { content: '▸ '; }
details.advanced[open] > summary::before { content: '▾ '; }
details.advanced[open] > summary { margin-bottom: 12px; }

/* status page list */
.statuslist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.statuslist li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.statuslist .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin: 0; transform: translateY(-1px); }
.statuslist .dot-ok { background: var(--ok); }

/* ===== Sync (browser import) ===== */
.pill-cta { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.pill-cta:hover { color: #fff; border-color: transparent; filter: brightness(1.08); }
.banner-ok { background: rgba(47,191,113,.15); color: #9be9bf; border-bottom: 1px solid rgba(47,191,113,.35); }
.inbanner { border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--line); }

.syncsteps { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 18px; }
.syncstep { display: flex; gap: 12px; align-items: flex-start; }
.syncstep .stepn { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.bmkwrap { margin: 8px 0 4px; }
.bmk { display: inline-block; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; padding: 9px 16px; border-radius: 10px; cursor: grab; user-select: none; border: 1px solid rgba(255,255,255,.15); }
.bmk:hover { text-decoration: none; filter: brightness(1.06); }
.syncform { display: flex; flex-direction: column; gap: 10px; }
.syncform textarea { width: 100%; background: #0d1017; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.syncform textarea:focus { outline: none; border-color: var(--accent); }
.syncform .btn { align-self: flex-start; background: var(--accent); color: #fff; border: none; padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.syncform .btn:hover { background: #3f7bf0; }

/* ===== Placement chips (one consistent meaning per depth) ===== */
.chip {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1.5px 8px;
  border-radius: 999px; letter-spacing: .02em; vertical-align: middle; white-space: nowrap;
}
.chip-hero { background: linear-gradient(135deg, #ffce7a, #ffb020); color: #241400; }
.chip-top  { background: rgba(79,140,255,.16); color: #bcd3ff; border: 1px solid rgba(79,140,255,.36); }
.chip-deep { background: rgba(139,149,167,.12); color: #97a1b3; border: 1px solid var(--line); }

/* explainer line under a card heading */
.cardhint { color: var(--muted); font-size: 12.5px; margin: 2px 0 12px; line-height: 1.55; }
.cardhint .chip { transform: translateY(-1px); }

/* stat tiles (What to create: title patterns) */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 4px 0 12px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: center; }
.stat-n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* AI advice block on What to create */
.ai-advice { margin-top: 14px; background: rgba(124,92,255,.08); border: 1px solid rgba(124,92,255,.3); border-radius: 10px; padding: 12px 16px; }
.ai-advice h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #c9b8ff; }
.ai-advice ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* ===== Light polish ===== */
.card { box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.card-head { margin-bottom: 12px; }
.reachrow { padding: 3px 0; }
.reachrow-name { flex-basis: 40%; }
.reachrow-val strong { color: var(--text); }
.mini-crow:hover, .mini-vrow:hover, .crow:hover, .feedrow:hover { background: var(--panel-2); }
.mini-crow, .mini-vrow, .feedrow { border-radius: 8px; transition: background .12s ease; }
.crow-metric { text-align: right; }
.crow-rate { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crow-lbl { display: block; font-size: 11px; color: var(--muted); }
.crow-lbl2 { display: block; font-size: 10.5px; color: var(--muted); opacity: .85; max-width: 190px; }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rec { border-left: 3px solid var(--accent); }
.rec:nth-child(even) { border-left-color: var(--accent-2); }

/* ===== Design pass (layout rhythm, empty states, tables) ===== */

/* Cards inside a grid or column get their spacing from the grid gap,
   not their own margin, so columns never double-space or misalign. */
.grid-2 { margin-bottom: 18px; }
.grid-2 > .card, .col > .card { margin-bottom: 0; }
.grid-2.align-start { align-items: start; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Page header rhythm */
h1 { font-size: 24px; letter-spacing: -.01em; }
.pagehead { margin-bottom: 14px; }
.lead { margin-bottom: 20px; }

/* Overview hero KPI reads as the headline number */
.kpi-hero .kpi-n { font-size: 32px; }

/* Lanes table */
.tbl-lanes .lane { white-space: nowrap; }
.tbl .num { white-space: nowrap; }
.share { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.tbl .example { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Footnotes and empty states */
.footnote { color: var(--muted); font-size: 12px; margin: 10px 2px 0; line-height: 1.5; }
.emptynote {
  color: var(--muted); font-size: 13px; line-height: 1.6; margin: 4px 0 2px;
  background: var(--panel-2); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px;
}

/* Tag rows wrap with even spacing */
.tagrow { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 0 0 4px; }
.tagrow .tag { margin: 0; }

/* Stat tiles: 3-up variant */
.statgrid-3 { grid-template-columns: repeat(3, 1fr); }

/* Section label between card groups */
.sectionlabel { margin: 26px 0 12px; }

/* Recommendation cards: two columns on wide screens, tighter chips */
.recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
.rec { margin: 0; padding: 14px 16px; }
.rec-n { flex: 0 0 26px; height: 26px; border-radius: 7px; font-size: 13px; }
.rec-body h3 { font-size: 14.5px; margin: 3px 0 5px; }
.rec-body p { font-size: 13.5px; line-height: 1.55; }
.rec-basis { font-size: 11.5px !important; color: var(--muted); }

@media (max-width: 900px) {
  .recs { grid-template-columns: 1fr; }
  .statgrid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ===== AI cards & idea grid ===== */
.statgrid { grid-template-columns: repeat(2, 1fr); }
.statgrid-3 { grid-template-columns: repeat(3, 1fr); }

.card-ai { border-color: rgba(124,92,255,.35); background: linear-gradient(180deg, rgba(124,92,255,.06), var(--panel)); }
.ai-headline { font-size: 15px; line-height: 1.6; margin: 0 0 10px; }
.ai-bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; line-height: 1.55; }
.ai-bullets li::marker { color: var(--accent-2); }

.idea-head { margin-top: 16px; }
.ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.idea { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.idea-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.idea-concept { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* ===== Control strip: Type, Placement, and Range live in ONE row ===== */
.switchgroup-range { margin-left: auto; }
.switchgroup-range .ranges { background: none; border: none; padding: 0; gap: 3px; }
.switchgroup-range .ranges a { padding: 6px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pagehead-top h1 { margin: 4px 0 0; }
@media (max-width: 900px) {
  .switchgroup-range { margin-left: 0; }
}

/* ===== Unified sticky filter bar ===================================== */
/* One bar holds all three controls + a live readout of the current view.
   It sticks under the topbar so the view can be switched from anywhere. */
.filterbar {
  position: sticky; top: 56px; z-index: 15;
  margin: -22px -20px 18px;              /* bleed to the wrap edges */
  padding: 12px 20px 9px;
  background: rgba(11,14,20,.94);
  box-shadow: 0 10px 24px -14px rgba(0,0,0,.7);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.filterbar-groups { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 26px; }
.fgroup { display: flex; flex-direction: column; gap: 4px; }
.fgroup-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding-left: 2px; }
.fgroup-range { margin-left: auto; }

/* Segmented control: options sit IN a recessed track; the selected one is a
   raised filled thumb. Same look for all three groups. */
.seg {
  display: flex; gap: 2px;
  background: #0d1119; border: 1px solid var(--line);
  border-radius: 10px; padding: 3px;
}
.segtab {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1.2;
  transition: background .1s ease, color .1s ease;
}
.segtab:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.segtab.on { color: #fff; background: var(--accent); box-shadow: 0 2px 8px rgba(79,140,255,.35); }
.segtab.seg-big.on { background: linear-gradient(135deg, #ffce7a, #ffb020); color: #241400; box-shadow: 0 2px 8px rgba(255,176,32,.35); }
.segtab b {
  font-weight: 700; font-size: 10.5px; font-variant-numeric: tabular-nums;
  background: rgba(139,149,167,.16); color: inherit; opacity: .85;
  padding: 1px 6px; border-radius: 999px;
}
.segtab.on b { background: rgba(255,255,255,.22); opacity: 1; }
.segtab.seg-big.on b { background: rgba(36,20,0,.18); }

/* The live readout rides with the bar */
.filterbar .scopeline { margin: 8px 2px 0; font-size: 12.5px; color: var(--text); }
.filterbar .scopeline .muted { font-size: 12px; }

/* Title sits below the bar */
.pagehead { margin: 2px 0 14px; }
.pagehead-top h1 { margin: 0; }

@media (max-width: 900px) {
  .filterbar { position: static; margin: -22px -20px 16px; }
  .fgroup-range { margin-left: 0; }
  .segtab { padding: 6px 9px; font-size: 12.5px; }
}
