:root {
  --navy: #13233A;
  --navy-2: #1D3150;
  --navy-3: #2A426A;
  --orange: #F08321;
  --red: #C23B22;
  --amber: #B7800F;
  --green: #2E7D5B;
  --paper: #F4F6F9;
  --surface: #FFFFFF;
  --line: #DCE2EA;
  --line-2: #EBEFF4;
  --ink: #13233A;
  --muted: #5B6B82;
  --faint: #8794A8;
  --focus: #2F6FDB;
  --r-s: 4px;
  --r-m: 8px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.45;
  -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy-3); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num, table, .mono { font-variant-numeric: tabular-nums; }
.boot { padding: 48px; color: var(--muted); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--navy); color: #E8EDF4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.brand svg { width: 26px; height: 26px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: #9FB0C8; letter-spacing: 0; }
.switcher { margin: 4px 14px 14px; }
.switcher label { display: block; font-size: 12px; color: #9FB0C8; margin: 0 0 4px 6px; }
.switcher select { width: 100%; background: var(--navy-2); border: 1px solid var(--navy-3); color: #fff; border-radius: var(--r-s);
  padding: 8px 10px; }
.nav { display: flex; flex-direction: column; padding: 4px 8px; gap: 1px; }
.nav a { color: #C9D4E3; text-decoration: none; padding: 8px 12px; border-radius: var(--r-s); display: flex; justify-content: space-between; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.on { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.nav .count { background: var(--orange); color: var(--navy); border-radius: 10px; font-size: 12px; font-weight: 700; padding: 0 7px; }
.nav-head { font-size: 12px; color: #8EA0BB; padding: 18px 20px 6px; }
.rail .me { margin-top: auto; padding: 14px 20px 18px; border-top: 1px solid var(--navy-2); font-size: 13px; color: #B9C6D8; }
.rail .me b { display: block; color: #fff; font-weight: 600; }
.rail .me button { background: none; border: 0; color: #9FB0C8; padding: 0; margin-top: 6px; cursor: pointer; text-decoration: underline; }
main { padding: 28px 36px 64px; max-width: 1320px; width: 100%; }

/* ---------- headings ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h1 { font-size: 26px; line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; font-weight: 650; }
.sub { color: var(--muted); margin: 6px 0 0; }
section { margin-top: 30px; }
section > .lede { color: var(--muted); margin: -6px 0 14px; max-width: 70ch; }

/* ---------- health line ---------- */
.health { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.health span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.ok { background: var(--green); } .dot.bad { background: var(--red); } .dot.warn { background: var(--amber); }

/* ---------- 24h strip (the signature element) ---------- */
.strip { background: var(--navy); color: #fff; border-radius: var(--r-m); padding: 18px 20px 12px; position: relative; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.strip-head h2 { color: #fff; margin: 0; }
.strip-head .tally { font-size: 13.5px; color: #B9C6D8; }
.strip-head .tally b { color: #fff; font-weight: 600; }
.strip svg { display: block; width: 100%; height: 132px; margin-top: 10px; }
.strip .axis { fill: #8EA0BB; font-size: 11px; }
.strip .bar { fill: #4A6590; }
.strip .bar.now { fill: #7D9AC6; }
.strip .mark { cursor: pointer; }
.strip .legend { display: flex; gap: 16px; font-size: 12.5px; color: #B9C6D8; margin-top: 6px; flex-wrap: wrap; }
.strip .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---------- severity ---------- */
.sev { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.sev::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--faint); }
.sev.CRITICAL { color: var(--red); } .sev.CRITICAL::before { background: var(--red); }
.sev.HIGH { color: #B85F10; } .sev.HIGH::before { background: var(--orange); }
.sev.MEDIUM { color: var(--amber); } .sev.MEDIUM::before { background: #E2B23B; }
.sev.INFO { color: var(--muted); }
.totals { display: flex; gap: 28px; flex-wrap: wrap; margin: 14px 0 0; }
.totals div { font-size: 13px; color: var(--muted); }
.totals b { display: block; font-size: 24px; color: var(--ink); font-weight: 650; line-height: 1.1; }
.totals .hot b { color: var(--red); }

/* ---------- attention list ---------- */
.attn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.attn-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line-2);
  align-items: start; }
.attn-row:first-child { border-top: 0; }
.attn-row .t { font-weight: 600; }
.attn-row .d { color: var(--muted); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.attn-row time { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.attn-empty { padding: 22px 18px; color: var(--muted); }
.attn-empty b { color: var(--green); }

/* ---------- two-column ---------- */
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; }
.chart svg { width: 100%; height: 200px; display: block; }
.chart .axis { fill: var(--faint); font-size: 11px; }
.chart .grid { stroke: var(--line-2); }
.chart-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.chart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.countries { list-style: none; margin: 0; padding: 0; }
.countries li { display: grid; grid-template-columns: 34px 1fr 54px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.countries .cc { font-weight: 600; }
.countries .track { background: var(--line-2); height: 8px; border-radius: 4px; overflow: hidden; }
.countries .fill { background: var(--navy-3); height: 100%; }
.countries li.out .cc { color: #B85F10; }
.countries li.out .fill { background: var(--orange); }
.countries .n { text-align: right; color: var(--muted); }

/* ---------- tables ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 11px; cursor: pointer; border-left: 1px solid var(--line); font-size: 13.5px; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
input[type=text], input[type=search], input[type=date], input[type=password], input[type=number], select, textarea {
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 10px; background: var(--surface); min-height: 36px; }
textarea { width: 100%; min-height: 64px; resize: vertical; }
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  overflow: hidden; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); background: #F8FAFC; padding: 9px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
.tbl tr.row { cursor: pointer; }
.tbl tr.row:hover td { background: #FAFBFD; }
.tbl tr.open td { background: #F6F8FB; }
.tbl .detail td { background: #F6F8FB; border-top: 0; padding: 4px 12px 16px; }
.tbl .muted { color: var(--muted); }
.tbl .wrap { overflow-wrap: anywhere; }
.status { font-size: 12.5px; padding: 1px 8px; border-radius: 10px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.status.open { background: #FFF1E3; color: #9A4D07; }
.status.reviewed { background: #E6F2EC; color: var(--green); }
.status.false_positive { background: #EEF1F5; color: var(--muted); }
.status.escalated { background: #FBE7E3; color: var(--red); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 14px; font-size: 13.5px; margin: 6px 0 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.review { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--line-2); font-size: 12.5px; margin: 1px 4px 1px 0; }
.chip.warn { background: #FFF1E3; color: #9A4D07; }
.chip.tag { background: #E8EEF8; color: var(--navy-3); }
.more { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 26px; max-width: 880px; }
.fieldset { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; }
.fieldset h2 { margin-bottom: 4px; }
.fieldset .help { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; max-width: 68ch; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 13.5px; }
.field small { color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 5px 6px; background: var(--surface); min-height: 38px; }
.chips .c { background: #E8EEF8; color: var(--navy); border-radius: 12px; padding: 2px 4px 2px 10px; font-size: 13.5px; display: inline-flex; gap: 4px; align-items: center; }
.chips .c button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; }
.chips input { border: 0; outline: 0; flex: 1; min-width: 160px; min-height: 26px; padding: 2px 4px; }
.chips.locked { background: #F8FAFC; }
.pairs { display: grid; gap: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 8px; align-items: start; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 7px 14px; cursor: pointer; font-weight: 600;
  font-size: 14px; min-height: 36px; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { color: var(--red); }
.btn.link { border: 0; background: none; padding: 4px 6px; color: var(--navy-3); text-decoration: underline; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--paper);
  padding: 12px 0; border-top: 1px solid var(--line); }
.note { background: #FFF8EE; border: 1px solid #F4D3AE; border-radius: var(--r-m); padding: 12px 14px; font-size: 14px; color: #6B3E0B; }
.note.info { background: #EEF3FA; border-color: #CFDBEC; color: var(--navy-2); }
.err { color: var(--red); font-size: 13.5px; }
.secret { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.secret:first-of-type { border-top: 0; }
.secret .state { font-size: 13px; color: var(--muted); }
.copy { display: flex; gap: 8px; } .copy input { flex: 1; }
.radio { display: flex; gap: 16px; flex-wrap: wrap; }
.radio label { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.signin .left { background: var(--navy); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: center; }
.signin .left h1 { font-size: 40px; max-width: 14ch; }
.signin .left p { color: #B9C6D8; max-width: 46ch; font-size: 16px; }
.signin .right { padding: 64px; display: flex; flex-direction: column; justify-content: center; gap: 16px; max-width: 520px; }
.signin .ms { display: inline-flex; gap: 10px; align-items: center; }

#toast { position: fixed; bottom: 22px; right: 22px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--r-s);
  font-size: 14px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; max-width: 420px; }
#toast.show { opacity: 1; transform: none; }
#toast.bad { background: var(--red); }

@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  main, .rail { min-width: 0; }
  .toolbar { flex-wrap: wrap; }
  .toolbar > * { max-width: 100%; }
  .copy { min-width: 0; }
  .copy input { min-width: 0; }
  .rail { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-head { display: none; }
  .rail .me { border-top: 0; padding-top: 0; }
  main { padding: 20px 16px 48px; }
  .cols, .row2, .signin { grid-template-columns: 1fr; }
  .attn-row { grid-template-columns: 1fr; gap: 4px; }
  .pair { grid-template-columns: 1fr; }
  .tbl { display: block; overflow-x: auto; }
  .signin .left, .signin .right { padding: 32px 20px; }
}

/* ---- found in place, setup steps, AI */
.inplace-panel { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.inplace-panel.hot { border-color: #EDB7AB; box-shadow: inset 4px 0 0 var(--red); }
.inplace-panel h2 { margin: 0 0 4px; }
.mini { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
ul.tight { margin: 6px 0; padding-left: 18px; }
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 980px; }
.step .body { min-width: 0; }
table.perm td { overflow-wrap: anywhere; }
.step { display: grid; grid-template-columns: 38px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 18px 20px; }
.step .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--paper); border: 1px solid var(--line); color: var(--navy-3); }
.step.done .num { background: var(--green); border-color: var(--green); color: #fff; }
.step h2 { margin: 4px 0 8px; }
.opts { display: grid; gap: 10px; margin: 10px 0 14px; }
.opt { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; background: #FBFCFD; }
.opt.on { border-color: #9FB4D3; background: #F3F7FC; }
.opt-head { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.opt-head input { margin-top: 4px; }
.opt-head small { display: block; color: var(--muted); font-size: 12.5px; }
.opt p { margin: 6px 0 8px 26px; color: var(--muted); font-size: 14px; }
table.perm { margin-left: 26px; border-collapse: collapse; font-size: 13px; width: calc(100% - 26px); }
table.perm td { border-top: 1px solid var(--line-2); padding: 5px 8px 5px 0; vertical-align: top; }
table.perm td:first-child { color: var(--muted); white-space: nowrap; width: 1%; }
table.perm td.mono { white-space: nowrap; width: 1%; }
pre.code { background: var(--navy); color: #E8EDF4; padding: 12px 14px; border-radius: var(--r-s); overflow-x: auto;
  font-size: 12.5px; line-height: 1.5; white-space: pre; margin: 6px 0 0; }
ul.checks { list-style: none; padding: 0; margin: 12px 0 0; }
ul.checks li { padding: 8px 0; border-top: 1px solid var(--line-2); }
ul.checks li.ok b { color: var(--green); }
ul.checks li.bad b { color: var(--red); }
ul.checks .fix { margin-top: 4px; font-size: 13.5px; color: #6B3E0B; }
ol.flow { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 4px 0 12px; counter-reset: f; }
ol.flow li { counter-increment: f; font-size: 12.5px; color: var(--muted); background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 3px 10px; }
ol.flow li::before { content: counter(f) ". "; }
ol.flow li.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.aibox { border-left: 3px solid var(--line); padding: 4px 0 4px 14px; margin: 10px 0; }
dd.ai p { margin: 0 0 6px; }
dd.ai ul { margin: 0 0 6px; padding-left: 18px; }
.explain { margin-top: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.explain small { color: var(--muted); max-width: 70ch; }
@media (max-width: 720px) {
  .inplace-panel { flex-direction: column; align-items: flex-start; }
  .step { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  table.perm { margin-left: 0; width: 100%; }
  table.perm td.mono, table.perm td:first-child { white-space: normal; }
  .opt p { margin-left: 0; }
}

/* ---- alert channels */
.dest { padding: 10px 12px; border-radius: var(--r-s); background: #EEF6F1; border: 1px solid #CDE4D6; margin: 8px 0 14px; font-size: 14px; }
.dest.none { background: #FBEDEA; border-color: #EDB7AB; color: var(--red); }
.chan { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 12px; }
.chan h3 { margin: 0 0 8px; font-size: 15px; }
.chan h3 small { font-weight: 500; color: var(--green); margin-left: 6px; font-size: 12px; }
.chan .btn + .btn { margin-left: 8px; }
code.mono { background: var(--paper); padding: 1px 6px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.tbl td.who { white-space: nowrap; font-size: 13.5px; }
.field > .btn.link, .fieldset > .btn.link { justify-self: start; }
[hidden] { display: none !important; }
.row2 { align-items: start; }
.fieldset .actions { background: none; }

/* self sign-up */
.note.pending { margin-bottom: 18px; }
.note.pending a { color: inherit; font-weight: 600; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; margin-top: 10px; }
label.check input { margin-top: 3px; flex: none; }
.signin .right .field { display: block; margin-bottom: 12px; }
.signin .right .field input { width: 100%; }
