@font-face { font-family: "Orbitron"; src: url(fonts/Orbitron.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url(fonts/Rajdhani-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url(fonts/Rajdhani-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url(fonts/Rajdhani-700.woff2) format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/JetBrainsMono.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

/* ZofaxClipping brand: circuit-board dark theme, orange -> electric blue (from the logo). Dark only. */
:root {
  color-scheme: dark;
  --bg: #020306;
  --card: #080b12;
  --card-2: #0e131d;
  --line: #1a2232;
  --text: #eef3ff;
  --muted: #8592ab;
  --orange: #ff8a1f;
  --blue: #2f8cff;
  --cyan: #38c8ff;
  --accent: #ff8a1f;
  --accent-ink: #050505;
  --grad: linear-gradient(120deg, #ff9a2e 0%, #ff7a1a 35%, #6a6dff 70%, #2f8cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 138, 31, .55), rgba(47, 140, 255, .55));
  --glow-o: 0 0 18px rgba(255, 138, 31, .35);
  --glow-b: 0 0 18px rgba(47, 140, 255, .35);
  --danger: #ff5d6c;
  --warn: #ffb547;
  --good: #2ee6a0;
  /* chart / platform identity (validated categorical slots 1-3, dark steps) */
  --s1: #338ced;
  --s2: #e76624;
  --s3: #00a888;
  --radius: 14px;
  --tabbar-h: 64px;
  --font-ui: "Rajdhani", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Orbitron", "Rajdhani", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 500 16px/1.4 var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -.01em; margin: 0; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, .code { font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.code { background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; display: block; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.content { flex: 1; min-width: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 19px; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
main { max-width: 1100px; margin: 0 auto; padding: 4px 16px 24px; }
.page { display: flex; flex-direction: column; gap: 14px; }
.desktop-only { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar .nav-link { flex-direction: column; justify-content: center; gap: 3px; font-size: 11px; padding: 6px 0; color: var(--muted); position: relative; border-radius: 0; }
.tabbar .nav-link.active { color: var(--text); }
.tabbar .nav-link.active .icon { stroke: var(--accent); }
.tabbar .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); }

.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); background: var(--card-2); }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-badge { background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 6px; min-width: 18px; text-align: center; }
.nav-link .nav-badge { margin-left: auto; }

@media (min-width: 900px) {
  .sidebar { display: flex; flex-direction: column; gap: 4px; width: 230px; flex: none; padding: 18px 12px; border-right: 1px solid var(--line);
    position: sticky; top: 0; height: 100vh; background: var(--card); }
  .sidebar .brand { padding: 4px 10px 18px; }
  .tabbar, .mobile-only { display: none !important; }
  .desktop-only { display: block; }
  .content { padding-bottom: 24px; }
  .topbar { padding: 18px 28px 10px; }
  .topbar h1 { font-size: 24px; }
  main { padding: 4px 28px 28px; }
}

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.two-col { display: grid; gap: 14px; }
.grid-2, .grid-3 { display: grid; gap: 12px; }
@media (min-width: 700px) { .two-col, .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 16px; }
.nowrap { white-space: nowrap; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ellipsis-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.error { color: var(--danger); font-size: 14px; }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger) !important; }
.hint { color: var(--muted); font-size: 12.5px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- controls ---------- */
button, .button {
  font: inherit; font-weight: 650; border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer;
  color: var(--text); background: var(--card-2); text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:active, .button:active { transform: scale(.98); }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ghost { background: transparent; border: 1px solid var(--line); }
.sm { padding: 7px 10px; font-size: 13px; border-radius: 10px; }
.primary { background: var(--accent); color: var(--accent-ink); font-size: 16px; padding: 13px; width: 100%; }
.primary-sm { background: var(--accent); color: var(--accent-ink); }
.danger { background: var(--danger); color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; }
.icon-btn { background: transparent; color: var(--muted); padding: 6px 10px; }
.input {
  width: 100%; min-width: 0; font: inherit; color: var(--text); background: var(--card-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; }
select.input { appearance: auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field-label b { color: var(--text); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--card-2); padding: 4px; border-radius: 12px; max-width: 100%; overflow-x: auto; }
.seg button { background: transparent; padding: 8px 12px; font-size: 14px; color: var(--muted); white-space: nowrap; border-radius: 9px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / .2); }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: .2s; flex: none; }
.knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .knob { left: 21px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill { font-size: 12px; padding: 6px 11px; border-radius: 99px; font-weight: 700; white-space: nowrap; }
.pill-on { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill-off { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--card-2); border: 1px solid var(--line); padding: 5px 10px 5px 5px; border-radius: 99px; font-size: 13px; gap: 6px; }
.chip .avatar { width: 22px; height: 22px; font-size: 11px; }
.chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card-2)); }
.chip.on::before { content: "✓"; color: var(--accent); margin-left: 4px; }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--card-2); }
.avatar-fallback { display: inline-grid; place-items: center; font-weight: 800; color: var(--muted); }

/* platform identity: color follows the platform everywhere (chart, badges) */
.pbadge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--text); white-space: nowrap; }
.pbadge::before, .pdot { content: ""; width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.p-youtube::before, .pdot.p-youtube { background: var(--s1); }
.p-tiktok::before, .pdot.p-tiktok { background: var(--s2); }
.p-instagram::before, .pdot.p-instagram { background: var(--s3); }
.p-twitch::before, .pdot.p-twitch { background: #9887ef; }
.pdot { width: 10px; height: 10px; }

/* ---------- home ---------- */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.banner.warn { background: color-mix(in srgb, var(--warn) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.banner.danger { background: color-mix(in srgb, var(--danger) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.tile.accent { border-color: var(--accent); }
.tile-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-sub { font-size: 12px; color: var(--good); font-weight: 600; }
.progress { height: 6px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checklist a { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.checklist li:first-child a { border-top: 0; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.checklist .done .check { background: var(--good); border-color: var(--good); color: #fff; }
.checklist .done b { color: var(--muted); font-weight: 600; text-decoration: line-through; }
.check-body { flex: 1; display: flex; flex-direction: column; }
.check-body small { color: var(--muted); font-size: 12.5px; }
.chev { color: var(--muted); font-size: 22px; line-height: 1; }
.work { display: flex; flex-direction: column; gap: 6px; }
.work-top { display: flex; justify-content: space-between; gap: 10px; }
.quick { flex-direction: row; align-items: center; justify-content: space-between; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.card.list { gap: 0; }
.list-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thumb-sm { width: 40px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--card-2); flex: none; display: block; }
.thumb-wide { width: 80px; height: 45px; border-radius: 8px; object-fit: cover; flex: none; }
.thumb-tall { width: 72px; aspect-ratio: 9/16; border-radius: 10px; object-fit: cover; background: var(--card-2); }
.post-stats { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.post-list .row { flex: none; }
.log { display: flex; gap: 10px; align-items: flex-start; }
.log .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-top: 7px; flex: none; }
.log-error .dot { background: var(--danger); }
.log-warn .dot { background: var(--warn); }
.rank { width: 20px; text-align: center; color: var(--muted); font-weight: 800; flex: none; }
.more-row { padding: 12px 0; }
.more-list .icon { color: var(--muted); }
.empty-state { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--muted); }
.empty-state h3 { color: var(--text); font-size: 18px; }
.empty-state p { max-width: 420px; }

/* ---------- review ---------- */
.review-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .review-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.review { flex-direction: row; padding: 12px; align-items: flex-start; }
.review video { width: 132px; aspect-ratio: 9/16; border-radius: 12px; background: #000; flex: none; object-fit: cover; }
.review-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.review.compact { align-items: center; }
@media (max-width: 480px) {
  .review { flex-direction: column; }
  .review video { width: 100%; max-height: 70vh; }
}
details summary { cursor: pointer; }

/* ---------- sources ---------- */
.source-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .source-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.source.disabled { opacity: .6; }
.source-head { display: flex; gap: 12px; align-items: center; }
.source-head .avatar { width: 44px; height: 44px; }
.source-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card-2); border-radius: 12px; padding: 10px; text-align: center; }
.source-stats > div { display: flex; flex-direction: column; }
.last-video { background: var(--card-2); border-radius: 10px; padding: 8px 10px; }
.source .row { flex-wrap: wrap; }

/* ---------- accounts ---------- */
.account-row { display: flex; flex-direction: column; gap: 8px; }
.grow-row { align-items: flex-start; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- clip page ---------- */
.mini-clips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .mini-clips { grid-template-columns: repeat(4, 1fr); } }
.mini-clip { display: flex; flex-direction: column; gap: 6px; background: var(--card-2); border-radius: 12px; padding: 8px; }
.mini-clip video { width: 100%; aspect-ratio: 9/16; border-radius: 8px; background: #000; object-fit: cover; }
.mini-clip .row > * { padding: 7px 6px; font-size: 13px; }

/* ---------- stats & chart ---------- */
.chart { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.chart-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-key { width: 10px; height: 10px; border-radius: 3px; }
.chart-plot { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-svg .axis { stroke: var(--line); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; }
.chart-svg .hit { fill: transparent; }
.chart-svg .bar-group { outline: none; cursor: default; }
.chart-svg .bar-group.hover .hit, .chart-svg .bar-group:focus-visible .hit { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.bar.s1, .legend-key.s1 { fill: var(--s1); background: var(--s1); }
.bar.s2, .legend-key.s2 { fill: var(--s2); background: var(--s2); }
.bar.s3, .legend-key.s3 { fill: var(--s3); background: var(--s3); }
.chart-tip {
  position: absolute; top: 0; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgb(0 0 0 / .25); min-width: 150px; z-index: 2;
}
.tip-date { color: var(--muted); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-key { width: 12px; height: 2px; border-radius: 1px; }
.tip-key.s1 { background: var(--s1); } .tip-key.s2 { background: var(--s2); } .tip-key.s3 { background: var(--s3); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.data-table th:not(:first-child), .data-table td:not(:first-child) { text-align: right; }
.data-table tr:last-child td { border-bottom: 0; }

/* ---------- settings ---------- */
.save-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 10px 10px 14px; box-shadow: 0 8px 24px rgb(0 0 0 / .3);
}
.save-bar-btn { width: auto; font-size: 14px; padding: 10px 16px; }
@media (min-width: 900px) { .save-bar { bottom: 16px; } }

/* ---------- dialogs & toast ---------- */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); width: min(94vw, 520px); max-height: 88vh; padding: 20px; overflow-y: auto; }
dialog::backdrop { background: rgb(0 0 0 / .6); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px; font-weight: 600; z-index: 50;
  max-width: calc(100vw - 32px); text-align: center;
}
@media (min-width: 900px) { .toast { bottom: 24px; } }
.error-card { border-color: var(--danger); }

/* =====================================================================
   Circuit theme layer
   ===================================================================== */
body { background: var(--bg); }
/* faint circuit traces: orange from the top-left, blue from the bottom-right */
body::before, body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-size: 220px 220px;
}
body::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='%23ff8a1f' stroke-width='1.3'%3E%3Cpath d='M0 40h60l20 20h50M130 60l30-30h60M20 220v-50l25-25v-45M180 220v-40l-20-20h-40M220 120h-40l-15 15v40M80 0v20l15 15'/%3E%3Ccircle cx='134' cy='60' r='4'/%3E%3Ccircle cx='45' cy='96' r='4'/%3E%3Ccircle cx='116' cy='160' r='4'/%3E%3Ccircle cx='165' cy='179' r='4'/%3E%3Ccircle cx='98' cy='38' r='3'/%3E%3C/svg%3E");
  opacity: .22;
  -webkit-mask-image: radial-gradient(circle at 0% 0%, #000 0%, transparent 55%);
  mask-image: radial-gradient(circle at 0% 0%, #000 0%, transparent 55%);
}
body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='%232f8cff' stroke-width='1.3'%3E%3Cpath d='M0 40h60l20 20h50M130 60l30-30h60M20 220v-50l25-25v-45M180 220v-40l-20-20h-40M220 120h-40l-15 15v40M80 0v20l15 15'/%3E%3Ccircle cx='134' cy='60' r='4'/%3E%3Ccircle cx='45' cy='96' r='4'/%3E%3Ccircle cx='116' cy='160' r='4'/%3E%3Ccircle cx='165' cy='179' r='4'/%3E%3Ccircle cx='98' cy='38' r='3'/%3E%3C/svg%3E");
  background-position: 110px 110px;
  opacity: .24;
  -webkit-mask-image: radial-gradient(circle at 100% 100%, #000 0%, transparent 60%);
  mask-image: radial-gradient(circle at 100% 100%, #000 0%, transparent 60%);
}
.shell, .tabbar, dialog, .toast { position: relative; z-index: 1; }
.tabbar { position: fixed; }
.toast { position: fixed; }

/* type */
h1, h2, .brand span, .tile-value, .empty-state h3, dialog h2 { font-family: var(--font-display); }
h1 { font-weight: 800; letter-spacing: .02em; }
h2 { font-size: 13.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.brand span { font-weight: 800; font-size: 17px; letter-spacing: .03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar h1 { font-size: 20px; text-transform: uppercase; letter-spacing: .1em; }
.small, .hint, .muted.small, .field-label, .tile-label, .data-table th, .pill, .tip-date, .chart-svg .tick, code, .code { font-family: var(--font-mono); }
.small { font-size: 12.5px; }
.field-label, .tile-label, .data-table th { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.hint { font-size: 11.5px; }
.chart-svg .tick { font-size: 10px; }

/* circuit node before section titles */
.card h2::before, .card-head h2::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--orange);
  box-shadow: var(--glow-o); display: inline-block; margin-right: 10px; flex: none; vertical-align: middle;
}
.card-head h2 .pdot { display: none; }
.card-head h2.p-youtube::before { border-color: var(--s1); }

/* surfaces: gradient hairline border + glow */
.card, .tile, dialog, .save-bar {
  background: linear-gradient(180deg, rgba(14, 19, 29, .92), rgba(8, 11, 18, .96)) padding-box, var(--grad-soft) border-box;
  border: 1px solid transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 10px 30px rgba(0, 0, 0, .55);
}
.card { border-radius: var(--radius); }
.sidebar {
  background: linear-gradient(180deg, rgba(8, 11, 18, .97), rgba(4, 6, 10, .97));
  border-right: 1px solid transparent;
  border-image: linear-gradient(180deg, rgba(255, 138, 31, .6), rgba(47, 140, 255, .6)) 1;
}
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid rgba(47, 140, 255, .12); }
.tabbar { background: rgba(4, 6, 10, .92); border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(255, 138, 31, .7), rgba(47, 140, 255, .7)) 1; }

/* logo-style corner brackets on tiles */
.tile {
  position: relative; border-radius: 12px;
  background:
    linear-gradient(var(--orange), var(--orange)) top 7px left 7px / 14px 2px no-repeat,
    linear-gradient(var(--orange), var(--orange)) top 7px left 7px / 2px 14px no-repeat,
    linear-gradient(var(--blue), var(--blue)) bottom 7px right 7px / 14px 2px no-repeat,
    linear-gradient(var(--blue), var(--blue)) bottom 7px right 7px / 2px 14px no-repeat,
    linear-gradient(180deg, rgba(14, 19, 29, .92), rgba(8, 11, 18, .96)) padding-box,
    var(--grad-soft) border-box;
  padding: 16px 16px 14px;
}
.tile-value { display: inline-block; align-self: flex-start; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; font-size: 26px; }
.tile.accent { box-shadow: var(--glow-o), 0 10px 30px rgba(0, 0, 0, .55); }
.tile:hover { box-shadow: var(--glow-b), 0 10px 30px rgba(0, 0, 0, .55); }

/* navigation */
.nav-link { font-family: var(--font-ui); font-weight: 600; font-size: 16px; letter-spacing: .02em; border-radius: 10px; position: relative; }
.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(255, 138, 31, .16), rgba(47, 140, 255, .06));
  box-shadow: inset 0 0 0 1px rgba(255, 138, 31, .25);
}
.sidebar .nav-link.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: var(--grad); box-shadow: var(--glow-o);
}
.nav-link.active .icon { stroke: var(--orange); filter: drop-shadow(0 0 6px rgba(255, 138, 31, .7)); }
.tabbar .nav-link { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.tabbar .nav-link.active::after {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--grad); box-shadow: var(--glow-o);
}
.nav-badge { background: var(--grad); color: #050505; font-family: var(--font-mono); box-shadow: var(--glow-o); }
.brand img { box-shadow: 0 0 14px rgba(255, 138, 31, .35), 0 0 14px rgba(47, 140, 255, .25); }

/* buttons & inputs */
button, .button { font-family: var(--font-ui); font-weight: 700; letter-spacing: .03em; border-radius: 10px; }
.primary, .primary-sm {
  background: var(--grad); color: #050505; text-transform: uppercase; letter-spacing: .08em;
  box-shadow: 0 0 20px rgba(255, 138, 31, .28), 0 0 20px rgba(47, 140, 255, .18);
}
.primary { font-family: var(--font-display); font-size: 14px; font-weight: 800; }
.primary:hover, .primary-sm:hover { filter: brightness(1.08); box-shadow: 0 0 26px rgba(255, 138, 31, .45), 0 0 26px rgba(47, 140, 255, .3); }
.ghost { border: 1px solid rgba(47, 140, 255, .35); background: rgba(47, 140, 255, .05); }
.ghost:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(56, 200, 255, .25); }
.link { color: var(--cyan); }
.input { background: rgba(2, 4, 8, .7); border: 1px solid #1d2840; border-radius: 10px; font-family: var(--font-ui); font-weight: 500; font-size: 16px; }
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 138, 31, .15), var(--glow-o); }
.seg { background: rgba(2, 4, 8, .7); border: 1px solid #1d2840; border-radius: 10px; }
.seg button { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-radius: 7px; }
.seg button.on { background: linear-gradient(135deg, rgba(255, 138, 31, .22), rgba(47, 140, 255, .22)); color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 31, .45); }
.switch input:checked + .track { background: var(--grad); box-shadow: var(--glow-o); }
.track { background: #1d2840; }
input[type=range] { accent-color: var(--orange); }
.chip { background: rgba(2, 4, 8, .7); border-color: #1d2840; font-family: var(--font-ui); font-weight: 600; }
.chip.on { border-color: var(--orange); background: rgba(255, 138, 31, .12); box-shadow: var(--glow-o); }
.chip.on::before { color: var(--orange); }

/* status */
.pill { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; border: 1px solid currentColor; }
.pill-on { background: rgba(46, 230, 160, .08); color: var(--good); box-shadow: 0 0 12px rgba(46, 230, 160, .25); }
.pill-off { background: rgba(255, 181, 71, .08); }
.pill-on { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 2px rgba(46, 230, 160, .1); } }
@media (prefers-reduced-motion: reduce) { .pill-on { animation: none; } }
.progress { background: #101827; height: 5px; }
.progress-fill { background: var(--grad); box-shadow: 0 0 10px rgba(255, 138, 31, .6); }
.check { border-color: #2a3650; }
.checklist .done .check { background: var(--grad); border-color: transparent; color: #050505; }
.checklist a { border-top-color: #141c2b; }
.banner { border-radius: 12px; font-family: var(--font-ui); }
.list > li { border-top-color: #141c2b; }
.log .dot { background: var(--blue); box-shadow: var(--glow-b); }
.log-error .dot { background: var(--danger); box-shadow: 0 0 10px rgba(255, 93, 108, .6); }
.log-warn .dot { background: var(--warn); }

/* media frames */
.review video, .mini-clip video, .thumb-sm, .thumb-tall {
  border: 1px solid rgba(47, 140, 255, .35); box-shadow: 0 0 14px rgba(47, 140, 255, .15);
}
.source-stats, .last-video { background: rgba(2, 4, 8, .7); border: 1px solid #1a2438; }
.source-stats b { font-family: var(--font-display); font-size: 15px; }
.post-stats b { font-family: var(--font-display); font-size: 15px; }
.rank { font-family: var(--font-display); color: var(--orange); }
.avatar { box-shadow: 0 0 0 1px rgba(47, 140, 255, .4); }

/* chart */
.chart-svg .grid { stroke: #1a2438; }
.chart-svg .axis { stroke: #2a3650; }
.chart-tip { background: rgba(6, 9, 15, .96); border: 1px solid rgba(47, 140, 255, .45); box-shadow: var(--glow-b); font-family: var(--font-ui); }
.data-table td { border-bottom-color: #141c2b; font-family: var(--font-ui); font-weight: 600; }
.data-table th { border-bottom-color: #1d2840; }

/* dialogs, toast, loading */
dialog { border-radius: 16px; }
dialog::backdrop { background: rgba(0, 0, 0, .75); backdrop-filter: blur(3px); }
.toast { background: var(--grad); color: #050505; font-family: var(--font-ui); font-weight: 700; box-shadow: var(--glow-o); }
.loading { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .2em; font-size: 12px; }
.empty-state h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .1em; }
::selection { background: rgba(255, 138, 31, .35); }
* { scrollbar-color: #2a3650 transparent; }
