:root {
  color-scheme: light;
  --primary: #1f5fae; --primary-ink: #ffffff; --primary-soft: #e7eef8;
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8f9fb; --surface-3: #eef1f5;
  --border: #e1e5eb; --border-strong: #cbd2db;
  --text: #16191d; --text-2: #4c5563; --text-3: #7a8391;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.07);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.18);
  --ok: #0f8a4a; --ok-bg: #e5f5ec; --warn: #9a6400; --warn-bg: #fdf2dc; --serious: #b54708; --serious-bg: #fdebdd; --crit: #c0262d; --crit-bg: #fde7e7; --info: #1f5fae; --info-bg: #e7eef8; --muted-bg: #eef0f3;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948; --s-other: #8a8986;
  --grid: #e8ebef; --radius: 10px; --radius-sm: 7px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --primary-soft: #1b2a3f; --bg: #111316; --surface: #1a1c20; --surface-2: #1f2226; --surface-3: #272a30; --border: #2e3238; --border-strong: #3d424a;
    --text: #f2f4f7; --text-2: #b8bfca; --text-3: #8b939f; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
    --ok: #4ccf86; --ok-bg: #17301f; --warn: #f0b93a; --warn-bg: #33290f; --serious: #f59a5b; --serious-bg: #3a2414; --crit: #ff7b7b; --crit-bg: #3c1a1b; --info: #78a9ea; --info-bg: #1b2a3f; --muted-bg: #272a30;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --grid: #2a2e34;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary-soft: #1b2a3f; --bg: #111316; --surface: #1a1c20; --surface-2: #1f2226; --surface-3: #272a30; --border: #2e3238; --border-strong: #3d424a;
  --text: #f2f4f7; --text-2: #b8bfca; --text-3: #8b939f; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
  --ok: #4ccf86; --ok-bg: #17301f; --warn: #f0b93a; --warn-bg: #33290f; --serious: #f59a5b; --serious-bg: #3a2414; --crit: #ff7b7b; --crit-bg: #3c1a1b; --info: #78a9ea; --info-bg: #1b2a3f; --muted-bg: #272a30;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --grid: #2a2e34;
}
* { box-sizing: border-box; }
svg.ic { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; font-weight: 650; } h2 { font-size: 16px; font-weight: 650; } h3 { font-size: 14px; font-weight: 650; }
.muted { color: var(--text-3); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: linear-gradient(150deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #000)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h1 { font-size: 30px; margin-top: 18px; font-weight: 700; }
.login-side p { opacity: .85; max-width: 440px; font-size: 15px; }
.login-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; opacity: .92; }
.login-side li::before { content: "✓"; display: inline-block; width: 22px; font-weight: 700; }
.login-brand { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 16px; }
.login-brand img { max-height: 44px; max-width: 160px; background: rgba(255,255,255,.95); border-radius: 8px; padding: 4px 8px; }
.login-form { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 22px; margin-bottom: 4px; }
.login-card form { margin-top: 24px; display: grid; gap: 14px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-side { padding: 28px 20px; } .login-side ul, .login-side .foot { display: none; } }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid var(--border); min-height: 64px; }
.brand img { max-height: 36px; max-width: 120px; object-fit: contain; }
.brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; color: #fff; flex: none; }
.brand b { display: block; font-size: 14px; line-height: 1.2; }
.brand span { font-size: 11.5px; color: var(--text-3); }
.nav { padding: 10px 8px; flex: 1; }
.nav .sec { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a .ic { width: 18px; height: 18px; flex: none; }
.nav a .count { margin-left: auto; background: var(--crit); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 650; }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .title { font-size: 17px; font-weight: 650; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.content { padding: 20px 24px 40px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.page-head p { margin: 4px 0 0; color: var(--text-3); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 12px; }
.user-chip small { display: block; color: var(--text-3); font-size: 11px; line-height: 1.1; }
.dropdown { position: absolute; right: 16px; top: 58px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; z-index: 50; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-3); text-decoration: none; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; } .content { padding: 16px 16px 40px; }
  .user-chip .who { display: none; }
}

/* ---------- Komponen ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h h2, .card-h h3 { flex: 1; }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g3 { grid-template-columns: 1fr 1fr; } .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g2, .g3 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 16px; align-content: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; }
.kpi .l .ic { width: 15px; height: 15px; }
.kpi .l { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi .d.up { color: var(--crit); } .kpi .d.down { color: var(--ok); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, var(--border)); }
.btn.danger:hover { background: var(--crit-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
.btn .ic { width: 16px; height: 16px; }
.btn-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.btn-group button { border: 0; background: var(--surface); height: 34px; padding: 0 12px; font: inherit; cursor: pointer; color: var(--text-2); border-right: 1px solid var(--border); }
.btn-group button:last-child { border-right: 0; }
.btn-group button.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

label.f { display: grid; gap: 5px; font-size: 13px; font-weight: 550; color: var(--text-2); }
label.f .hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 11px; height: 36px; width: 100%; min-width: 0; }
textarea { padding: 8px 11px; height: auto; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 1px; border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); padding: 0; }
input[type=color] { padding: 2px; width: 56px; }
input[type=file] { padding: 5px; height: auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters > * { width: auto; }
.filters select, .filters input { width: auto; min-width: 140px; }
.filters input[type=search] { min-width: 200px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0; }
legend { font-size: 12.5px; font-weight: 650; color: var(--text-2); padding: 0 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }

table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t th { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.t tbody tr:hover { background: var(--surface-2); }
.t tr.click { cursor: pointer; }
.t td.r, .t th.r { text-align: right; }
.t .actions { white-space: nowrap; text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; font-size: 14px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; height: 22px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--muted-bg); color: var(--text-2); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sev-rendah { background: var(--info-bg); color: var(--info); }
.sev-sedang { background: var(--warn-bg); color: var(--warn); }
.sev-tinggi { background: var(--serious-bg); color: var(--serious); }
.sev-kritis { background: var(--crit-bg); color: var(--crit); }
.st-baru { background: var(--crit-bg); color: var(--crit); }
.st-ditinjau { background: var(--warn-bg); color: var(--warn); }
.st-selesai { background: var(--ok-bg); color: var(--ok); }
.st-false_positive, .st-valid { background: var(--muted-bg); color: var(--text-2); }
.on-online { background: var(--ok-bg); color: var(--ok); } .on-offline, .on-error { background: var(--crit-bg); color: var(--crit); } .on-unknown { background: var(--muted-bg); color: var(--text-3); }
.cat-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); margin: 1px 2px 1px 0; }

/* ---------- Modal / toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10,14,20,.5); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.lg { max-width: 860px; } .modal.xl { max-width: 1200px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-h h2 { flex: 1; }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); max-width: 380px; font-size: 13.5px; animation: fade .15s; }
.toast.err { background: var(--crit); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
.alert { padding: 10px 14px; border-radius: 9px; font-size: 13.5px; background: var(--info-bg); color: var(--info); }
.alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.err { background: var(--crit-bg); color: var(--crit); } .alert.ok { background: var(--ok-bg); color: var(--ok); }
.keybox { font-family: var(--mono); background: var(--surface-3); border: 1px dashed var(--border-strong); padding: 10px 12px; border-radius: 8px; word-break: break-all; user-select: all; }
pre.code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 12px; border-radius: 8px; overflow-x: auto; white-space: pre; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Live view ---------- */
.live-grid { display: grid; gap: 8px; }
.live-grid.c1 { grid-template-columns: 1fr; } .live-grid.c2 { grid-template-columns: repeat(2, 1fr); } .live-grid.c3 { grid-template-columns: repeat(3, 1fr); } .live-grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .live-grid.c3, .live-grid.c4 { grid-template-columns: repeat(2, 1fr); } }
.tile { position: relative; background: #000; border-radius: 9px; overflow: hidden; aspect-ratio: 16 / 9; cursor: pointer; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile .cap { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 6px; align-items: center; padding: 6px 8px; background: linear-gradient(rgba(0,0,0,.65), transparent); color: #fff; font-size: 12.5px; font-weight: 600; }
.tile .cap .live { width: 7px; height: 7px; border-radius: 50%; background: #f04438; box-shadow: 0 0 0 3px rgba(240,68,56,.3); }
.tile .cap .mode { margin-left: auto; font-size: 10.5px; opacity: .75; font-weight: 500; }
.tile .state { position: absolute; inset: 0; display: grid; place-items: center; color: #cfd4dc; font-size: 13px; text-align: center; padding: 16px; pointer-events: none; }
.tile.empty-slot { background: var(--surface-3); cursor: default; display: grid; place-items: center; color: var(--text-3); font-size: 12.5px; }
.viewer { position: fixed; inset: 0; background: #000; z-index: 150; display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #fff; background: #111; flex-wrap: wrap; }
.viewer-bar .t { font-weight: 650; flex: 1; min-width: 0; }
.viewer-bar .btn { background: #262a31; border-color: #3a3f47; color: #fff; }
.viewer-bar .btn:hover { background: #333842; }
.viewer-stage { flex: 1; overflow: hidden; position: relative; cursor: grab; touch-action: none; }
.viewer-stage.drag { cursor: grabbing; }
.viewer-stage .media { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.zoom-ind { position: absolute; right: 14px; bottom: 14px; background: rgba(0,0,0,.6); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; }

/* ---------- Event detail ---------- */
.evidence { background: #000; border-radius: 9px; overflow: hidden; position: relative; }
.evidence img, .evidence video { width: 100%; display: block; max-height: 520px; object-fit: contain; background: #000; }
.meta-list { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; }
.meta-list dt { color: var(--text-3); } .meta-list dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; font-size: 13.5px; }
.timeline li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); margin-top: 5px; }
.thumb { width: 64px; height: 40px; object-fit: cover; border-radius: 5px; background: #000; display: block; }

/* ---------- Playback timeline ---------- */
.day-line { position: relative; height: 44px; background: var(--surface-3); border-radius: 8px; margin: 8px 0 24px; cursor: pointer; }
.day-line .tick { position: absolute; bottom: -18px; font-size: 10.5px; color: var(--text-3); transform: translateX(-50%); }
.day-line .mk { position: absolute; top: 6px; width: 4px; height: 32px; border-radius: 2px; transform: translateX(-2px); }
.day-line .cursor { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); }

/* ---------- Zone editor ---------- */
.zone-wrap { position: relative; background: #000; border-radius: 9px; overflow: hidden; aspect-ratio: 16/9; }
.zone-wrap img { width: 100%; height: 100%; object-fit: fill; display: block; }
.zone-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.zone-item { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.zone-item.sel { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Brand upload ---------- */
.brand-prev { width: 100%; height: 120px; border: 1px dashed var(--border-strong); border-radius: 10px; display: grid; place-items: center; background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 0 0/16px 16px; }
.brand-prev img { max-width: 80%; max-height: 90px; object-fit: contain; }
.brand-prev.fav img { width: 48px; height: 48px; }

/* ---------- Charts ---------- */
.viz { position: relative; width: 100%; }
.viz svg { display: block; width: 100%; overflow: visible; }
.viz .axis text { fill: var(--text-3); font-size: 11px; }
.viz .gridline { stroke: var(--grid); stroke-width: 1; }
.viz .baseline { stroke: var(--border-strong); stroke-width: 1; }
.viz .hit { fill: transparent; }
.viz .hit:hover + .bar-hl, .viz .bar-hl { pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; }
.viz-tooltip { position: fixed; pointer-events: none; z-index: 300; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; display: none; min-width: 140px; }
.viz-tooltip .tt-h { font-weight: 650; margin-bottom: 4px; }
.viz-tooltip .tt-r { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.viz-tooltip .tt-r b { font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 44px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.hbar .track { height: 10px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; }
.hbar .n { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.recent { display: grid; gap: 0; }
.recent a { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.recent a:hover { background: var(--surface-2); text-decoration: none; }
.recent a:last-child { border-bottom: 0; }
.noimg { width: 64px; height: 40px; border-radius: 5px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
