/* Security Watch — Scigrow 2026-11 house style (see brand-assets/scigrow/BRAND.md). Figtree only; never monospace. */
@font-face { font-family: Figtree; font-weight: 400; src: url('/static/brand/Figtree-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Figtree; font-weight: 500; src: url('/static/brand/Figtree-Medium.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Figtree; font-weight: 600; src: url('/static/brand/Figtree-SemiBold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Figtree; font-weight: 700; src: url('/static/brand/Figtree-Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Figtree; font-weight: 800; src: url('/static/brand/Figtree-ExtraBold.ttf') format('truetype'); font-display: swap; }

:root {
  --graphite: #455862; --graphite-fill: #455862; --crimson: #C8102E; --ink: #1F2024; --muted: #8A8A8A;
  --hairline: #E6E6E8; --callout: #F6F5F5; --canvas: #FAFAFA; --surface: #FFFFFF; --ok: #2F7D4F; --amber: #C77800;
  --sidebar: #F3F3F4; --selected: rgba(69, 88, 98, .10); --hover: rgba(69, 88, 98, .06); --input: #FFFFFF;
  --shadow: 0 1px 2px rgba(31, 32, 36, .04);
  --font: Figtree, "Helvetica Neue", Inter, Arial, sans-serif;
}
[data-theme="dark"] {
  --graphite: #B4C2CA; --crimson: #E8405A; --ink: #E8E9EB; --muted: #9BA1A8; --hairline: #343A40; --callout: #282C31;
  --canvas: #15171A; --surface: #1E2125; --ok: #55B880; --amber: #E9A23B; --sidebar: #1A1D21;
  --selected: rgba(180, 194, 202, .14); --hover: rgba(180, 194, 202, .07); --input: #15171A; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --graphite: #B4C2CA; --crimson: #E8405A; --ink: #E8E9EB; --muted: #9BA1A8; --hairline: #343A40; --callout: #282C31;
    --canvas: #15171A; --surface: #1E2125; --ok: #55B880; --amber: #E9A23B; --sidebar: #1A1D21;
    --selected: rgba(180, 194, 202, .14); --hover: rgba(180, 194, 202, .07); --input: #15171A; --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
a { color: var(--graphite); text-decoration: none; }
a:hover { color: var(--crimson); }
button, input, select { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; }
.num { font-variant-numeric: tabular-nums; }
.sel { user-select: text; }
.hidden { display: none !important; }

/* ---- layout ---- */
.app { display: grid; grid-template-columns: 290px 1fr; grid-template-rows: 100vh; height: 100vh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--hairline); display: flex; flex-direction: column; min-height: 0; }
.sidebar-top { display: flex; align-items: center; gap: 8px; padding: 18px 16px 10px; }
.sidebar-top img { width: 18px; height: 18px; }
.sidebar-top span { font-weight: 700; font-size: 12px; letter-spacing: .12em; color: var(--graphite); }
.nav { overflow: auto; flex: 1; padding: 0 8px 8px; }
.nav-section { margin-top: 10px; }
.nav-section h4 { margin: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--muted); text-transform: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--ink); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.active { background: var(--selected); }
.nav a .spacer { flex: 1; }
.nav a.report { align-items: flex-start; }
.nav a.report .dot { margin-top: 6px; }
.nav a.report .body { min-width: 0; flex: 1; }
.nav a.report .t { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; }
.nav a.report .s { font-size: 11.5px; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot.sm { width: 7px; height: 7px; }
.pill { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--crimson); color: #fff; font-weight: 700; font-size: 10.5px; text-align: center; line-height: 16px; }
.pill.amber { background: var(--amber); }
.sidebar-bottom { border-top: 1px solid var(--hairline); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.user { display: flex; align-items: center; gap: 8px; }
.user img, .user .avatar { width: 26px; height: 26px; border-radius: 50%; color: var(--graphite); }
.user .meta { flex: 1; min-width: 0; }
.user .n { font-weight: 600; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user .e { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.band { background: var(--graphite-fill); color: #fff; border-top: 4px solid var(--crimson); padding: 12px 24px; display: flex; align-items: center; gap: 18px; }
.band img { height: 22px; }
.band .sep { width: 1px; height: 28px; background: rgba(255,255,255,.25); }
.band h1 { margin: 0; font-size: 17px; font-weight: 700; }
.band .sub { font-size: 12px; opacity: .75; }
.band .conf { margin-left: auto; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; font-weight: 500; }
.content { flex: 1; overflow: auto; min-height: 0; }
.pad { padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 14px; align-items: stretch; }
.row > * { flex: 1; min-width: 0; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.two { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }

/* ---- primitives ---- */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 6px; padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card.rule { border-top: 3px solid var(--crimson); }
.card.pad0 { padding: 0; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--crimson); }
.eyebrow.g { color: var(--graphite); } .eyebrow.ok { color: var(--ok); } .eyebrow.amber { color: var(--amber); } .eyebrow.muted { color: var(--muted); }
.label { font-size: 11px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.title { font-size: 22px; font-weight: 700; color: var(--graphite); margin: 2px 0 0; line-height: 1.2; }
.title.sm { font-size: 18px; } .title.xs { font-size: 15px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .xs { font-size: 11.5px; }
.ink { color: var(--ink); } .g { color: var(--graphite); } .c { color: var(--crimson); } .okc { color: var(--ok); } .am { color: var(--amber); }
.b { font-weight: 600; }
.callout { display: flex; background: var(--callout); border-left: 3px solid var(--crimson); border-radius: 4px; padding: 10px 14px; gap: 10px; }
.callout.ok { border-left-color: var(--ok); } .callout.g { border-left-color: var(--graphite); } .callout.amber { border-left-color: var(--amber); }
.callout > div { flex: 1; min-width: 0; }
.kpi .v { font-size: 28px; font-weight: 700; color: var(--graphite); line-height: 1.1; margin: 6px 0 4px; }
.kpi .v.c { color: var(--crimson); } .kpi .v.okc { color: var(--ok); } .kpi .v.am { color: var(--amber); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.badge.s0 { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge.s1 { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.badge.s2 { color: var(--crimson); background: color-mix(in srgb, var(--crimson) 10%, transparent); }
.s0 .dot, .dot.s0 { background: var(--ok); } .s1 .dot, .dot.s1 { background: var(--amber); } .s2 .dot, .dot.s2 { background: var(--crimson); }
.tag { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; background: var(--graphite-fill); }
.tag.block { background: #C8102E; } .tag.count { background: #C77800; } .tag.allow { background: #2F7D4F; }
.numbox { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 22px; border-radius: 4px; background: var(--graphite-fill); color: #fff; font-weight: 700; font-size: 13px; }
.numbox.c { background: #C8102E; } .numbox.am { background: #C77800; }
.hr { height: 1px; background: var(--hairline); margin: 4px 0; }
code, .code { font-family: inherit; font-weight: 500; background: var(--callout); color: var(--graphite); padding: 0 4px; border-radius: 3px; }
pre { font-family: inherit; white-space: pre-wrap; word-break: break-word; margin: 0; font-size: 12.5px; }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn.primary:hover { filter: brightness(.95); background: var(--crimson); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.link { border: none; background: none; color: var(--graphite); padding: 2px 4px; }
.btn.link:hover { color: var(--crimson); background: none; }
.btn.icon { padding: 5px; border: none; background: none; color: var(--muted); }
.btn.icon:hover { color: var(--ink); background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input { padding: 6px 9px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--input); font-size: 12.5px; min-width: 0; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--graphite) 35%, transparent); outline-offset: 0; border-color: var(--graphite); }
.seg { display: inline-flex; border: 1px solid var(--hairline); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { border: none; background: none; padding: 6px 12px; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--hairline); }
.seg button.on { background: var(--selected); color: var(--ink); font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 999px; background: var(--hairline); position: relative; margin: 0; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--crimson); } .switch input:checked::after { left: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--hairline); }
.toolbar .grow { flex: 1; }
.toolbar .status { font-size: 12px; color: var(--muted); }
.spin { width: 14px; height: 14px; border: 2px solid var(--hairline); border-top-color: var(--crimson); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--graphite); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tbl td { padding: 6px 10px; border-bottom: 1px solid var(--hairline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; vertical-align: top; }
.tbl td:first-child { font-weight: 600; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.on { background: var(--selected); }
.tblwrap { overflow: auto; max-height: calc(100vh - 230px); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; flex: 1; }
.split .side { border-left: 1px solid var(--hairline); overflow: auto; padding: 16px; background: var(--canvas); display: flex; flex-direction: column; gap: 14px; }
.split .tblwrap { max-height: calc(100vh - 175px); }
.kv { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.kv .v { font-size: 12.5px; word-break: break-all; white-space: pre-wrap; }
.toplist { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 2px 0; }
.toplist span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toplist span:last-child { font-weight: 600; color: var(--graphite); }

/* ---- report content ---- */
.bul { display: flex; gap: 10px; align-items: flex-start; padding: 3px 0; }
.bul .bar { width: 2px; align-self: stretch; background: var(--hairline); border-radius: 1px; flex: none; }
.bul.rec .bar { background: var(--crimson); }
.bul .bd { width: 5px; height: 5px; border-radius: 50%; background: var(--graphite); margin-top: 7px; flex: none; }
.bul.rec .bd { background: var(--crimson); }
.md p { margin: 0 0 8px; }
.md h1, .md h2, .md h3, .md h4 { color: var(--graphite); margin: 18px 0 6px; line-height: 1.2; }
.md h1 { font-size: 26px; font-weight: 800; } .md h1::before { content: ""; display: block; width: 48px; height: 3px; background: var(--crimson); margin-bottom: 8px; }
.md h2 { font-size: 20px; } .md h3 { font-size: 15px; } .md h4 { font-size: 13.5px; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 22px; } .md li { margin: 3px 0; } .md li::marker { color: var(--crimson); }
.md table { border-collapse: collapse; width: 100%; margin: 6px 0 12px; font-size: 12.5px; }
.md th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--muted); border-bottom: 2px solid var(--graphite); padding: 6px 8px; }
.md td { padding: 6px 8px; border-bottom: 1px solid var(--hairline); vertical-align: top; } .md td:first-child { font-weight: 600; }
.md pre { background: var(--callout); padding: 12px; border-radius: 4px; font-size: 12px; margin: 6px 0 10px; }
.md hr { border: none; border-top: 1px solid var(--hairline); margin: 14px 0; }
.timeline { display: flex; gap: 4px; flex-wrap: wrap; }
.timeline a { width: 14px; height: 26px; border-radius: 2px; display: block; }
.chart { width: 100%; height: 120px; display: block; }
.chart text { font-family: var(--font); font-size: 10px; fill: var(--muted); }
.chart line { stroke: var(--hairline); }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend i.round { border-radius: 50%; width: 8px; height: 8px; }
.empty { display: flex; flex-direction: column; gap: 8px; }
.rowline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rowline .grow { flex: 1; }
.livrow { font-size: 12px; padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.livrow:hover { white-space: normal; word-break: break-all; }
.chev { transition: transform .15s; } .open .chev { transform: rotate(180deg); }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--graphite-fill); color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: 420px; z-index: 50; border-left: 3px solid var(--crimson); }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr; } .row { flex-wrap: wrap; } .row > * { flex-basis: 45%; } .split { grid-template-columns: 1fr; } .split .side { border-left: none; border-top: 1px solid var(--hairline); } }
@media (max-width: 800px) { .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .sidebar { max-height: 40vh; } }
