/* ───────────────────────────────────────────────────────────────────────────
   Warden — an instrument panel for AI risk.

   Design thesis: this is read for hours by a practitioner, not skimmed once by
   a visitor. So: hairline rules instead of cards-everywhere, one accent colour,
   numbers in tabular mono, micro-labels in letterspaced caps, and no decoration
   that does not encode something true.

   Risk colour (tier, severity) is a separate scale from the accent, and every
   state is carried by shape as well as colour — a colour-blind reviewer must be
   able to read a tier at a glance.

   Typeface is the Windows 11 system family. This app runs offline on client
   premises; a webfont that silently fails to load is worse than a system face
   chosen deliberately.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  /* light */
  --bg:         #f6f8f9;
  --surface:    #ffffff;
  --surface-2:  #eef1f4;
  --surface-3:  #e3e8ec;
  --ink:        #0f171c;
  --ink-2:      #44525d;
  --ink-3:      #78858f;
  --line:       #dce3e8;
  --line-2:     #c5cfd7;

  --accent:      #0f7b8a;
  --accent-ink:  #ffffff;
  --accent-soft: #e0eff1;

  --t0: #8c1033;  --t0-bg: #f7e3e8;
  --t1: #b2451b;  --t1-bg: #fbe8de;
  --t2: #87660a;  --t2-bg: #faf1d8;
  --t3: #0f6149;  --t3-bg: #e0f0ea;

  --good: #0f6149;
  --warn: #87660a;
  --crit: #b2451b;

  --font:    "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --mono:    "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace;

  --radius: 6px;
  --rail: 232px;
  --ease: 120ms cubic-bezier(.2,.6,.3,1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b0f13;
    --surface:   #121a21;
    --surface-2: #19232c;
    --surface-3: #212d38;
    --ink:       #e7eef4;
    --ink-2:     #a2b0bd;
    --ink-3:     #6d7c89;
    --line:      #202d37;
    --line-2:    #2d3d49;

    --accent:      #4ec4d6;
    --accent-ink:  #06222a;
    --accent-soft: #0f2c35;

    --t0: #ff9db2;  --t0-bg: #341420;
    --t1: #f6a883;  --t1-bg: #35190e;
    --t2: #e6c877;  --t2-bg: #2f2609;
    --t3: #86d5b6;  --t3-bg: #0d2b21;

    --good: #86d5b6;
    --warn: #e6c877;
    --crit: #f6a883;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:        #0b0f13;
  --surface:   #121a21;
  --surface-2: #19232c;
  --surface-3: #212d38;
  --ink:       #e7eef4;
  --ink-2:     #a2b0bd;
  --ink-3:     #6d7c89;
  --line:      #202d37;
  --line-2:    #2d3d49;

  --accent:      #4ec4d6;
  --accent-ink:  #06222a;
  --accent-soft: #0f2c35;

  --t0: #ff9db2;  --t0-bg: #341420;
  --t1: #f6a883;  --t1-bg: #35190e;
  --t2: #e6c877;  --t2-bg: #2f2609;
  --t3: #86d5b6;  --t3-bg: #0d2b21;

  --good: #86d5b6;
  --warn: #e6c877;
  --crit: #f6a883;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.014em; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }

kbd {
  font-family: var(--mono); font-size: 10.5px; padding: 1px 5px;
  border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink-3);
  background: var(--surface-2);
}

/* ───────────────────────────────── shell ───────────────────────────────── */

.shell { display: flex; height: 100%; }

.rail {
  width: var(--rail); flex: 0 0 var(--rail);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
}

.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 20px; }
.brand .mark { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto; }
.brand-text { min-width: 0; display: flex; flex-direction: column; }
.brand-text b { font-family: var(--display); font-size: 16px; letter-spacing: -.02em; }
.brand-text span {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.navgroup { display: flex; flex-direction: column; gap: 1px; }

.navbtn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius); text-align: left;
  color: var(--ink-2); transition: background var(--ease), color var(--ease);
}
.navbtn:hover { background: var(--surface-2); color: var(--ink); }
.navbtn[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.navbtn .nk { font-weight: 500; }
.navbtn[aria-current="true"] .nk { font-weight: 600; }

.pip {
  font-family: var(--mono); font-size: 10.5px; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--ink-2); padding: 1px 6px; border-radius: 20px;
}
.navbtn[aria-current="true"] .pip { background: var(--surface); color: var(--accent); }
.hint-key { font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); }

.railfoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }

.ghost {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 9px; color: var(--ink-3); font-size: 12.5px;
  transition: border-color var(--ease), color var(--ease);
}
.ghost:hover { border-color: var(--line-2); color: var(--ink); }

.themerow { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.themebtn {
  flex: 1; padding: 4px 0; font-size: 11px; color: var(--ink-3);
  border-right: 1px solid var(--line); transition: background var(--ease), color var(--ease);
}
.themebtn:last-child { border-right: 0; }
.themebtn:hover { background: var(--surface-2); color: var(--ink); }
.themebtn[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); font-weight: 600; }

.muted-xs { font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 18px 28px 14px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.crumbs h1 { font-size: 19px; }
.crumbs p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.topright { display: flex; align-items: center; gap: 10px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
.spin {
  width: 9px; height: 9px; border: 1.5px solid var(--line-2); border-top-color: var(--accent);
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.databadge {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; background: var(--t2-bg); color: var(--t2);
  border: 1px solid color-mix(in srgb, var(--t2) 30%, transparent);
}

.scroll { overflow-y: auto; padding: 22px 28px 60px; }
.view { max-width: 1320px; }

/* ──────────────────────────────── blocks ──────────────────────────────── */

.eyebrow {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile { background: var(--surface); padding: 15px 16px 14px; min-width: 0; }
.tile .k { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.tile .v {
  font-family: var(--mono); font-size: 25px; font-weight: 600; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin-top: 5px; line-height: 1.1;
}
.tile .n { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; }
.tile.is-crit .v { color: var(--crit); }
.tile.is-warn .v { color: var(--warn); }
.tile.is-good .v { color: var(--good); }

.panel { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel > header { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel > header h2 { font-size: 13.5px; }
.panel > header .sub { font-size: 11.5px; color: var(--ink-3); }
.panel > header .spacer { flex: 1 1 auto; }
.pad { padding: 16px; }

.note {
  font-size: 12.5px; color: var(--ink-2); background: var(--surface-2);
  border-left: 2px solid var(--line-2); padding: 11px 14px; border-radius: 0 var(--radius) var(--radius) 0;
}
.note.warn { border-left-color: var(--warn); }
.note b { color: var(--ink); }
.note code { font-family: var(--mono); font-size: 11.5px; }

/* ───────────────────────── the load line ─────────────────────────────────
   Coverage, drawn honestly. The measured part is a solid bar. The part we
   cannot observe is a hatched band of UNFIXED width — we do not know how big
   it is, so we must not imply a number. Omitting it is what lets 92% read as
   complete, which is the failure mode this whole product exists to avoid.    */

.loadline { padding: 16px; }
.ll-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.ll-head .lab { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.ll-head .val { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.ll-track { position: relative; height: 26px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; display: flex; overflow: hidden; }
.ll-seg { height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.ll-seg.approved { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 36%, transparent); }
.ll-seg.unsanctioned { background: var(--t1-bg); color: var(--t1); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t1) 28%, transparent); }

.ll-waterline { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 2px dashed var(--ink-3); }
.ll-waterline span {
  position: absolute; top: -17px; left: 4px; font-family: var(--mono); font-size: 10px;
  color: var(--ink-3); white-space: nowrap;
}

.ll-unknown { margin-top: 10px; display: flex; gap: 11px; align-items: stretch; }
.ll-hatch {
  flex: 0 0 96px; border: 1px dashed var(--line-2); border-radius: 3px; min-height: 42px;
  background-image: repeating-linear-gradient(135deg, var(--surface-3) 0 5px, transparent 5px 10px);
}
.ll-unknown .txt { font-size: 11.5px; color: var(--ink-2); min-width: 0; }
.ll-unknown .txt b { display: block; color: var(--ink); font-size: 12px; margin-bottom: 2px; }
.ll-missing { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.src-chip {
  font-family: var(--mono); font-size: 10px; padding: 1px 6px; border-radius: 3px;
  background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line);
}
.src-chip.missing { border-style: dashed; color: var(--warn); }

/* ──────────────────────────────── tables ──────────────────────────────── */

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
}
tbody tr { transition: background var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td .nm { font-weight: 600; }
td .sm { font-size: 11px; color: var(--ink-3); }
td .mono { font-family: var(--mono); font-size: 11px; }

/* ────────────────────── tier + confidence, by shape too ────────────────── */

.tier { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; font-weight: 600; white-space: nowrap; }
.tier i { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 1px; }
.tier[data-t="0"] { color: var(--t0); } .tier[data-t="0"] i { background: var(--t0); transform: rotate(45deg); }
.tier[data-t="1"] { color: var(--t1); } .tier[data-t="1"] i { background: var(--t1); }
.tier[data-t="2"] { color: var(--t2); } .tier[data-t="2"] i { background: repeating-linear-gradient(45deg, var(--t2) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--t2); }
.tier[data-t="3"] { color: var(--t3); } .tier[data-t="3"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--t3); }

.conf { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-family: var(--mono); color: var(--ink-2); white-space: nowrap; }
.conf i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.conf[data-c="Confirmed"] i { background: var(--ink-2); }
.conf[data-c="Strong"] i { background: linear-gradient(90deg, var(--ink-2) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.conf[data-c="Indicative"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }

.badge { display: inline-block; font-size: 10.5px; font-weight: 600; font-family: var(--mono); padding: 1.5px 7px; border-radius: 20px; white-space: nowrap; }
.badge.Approved { background: var(--t3-bg); color: var(--t3); }
.badge.Unsanctioned { background: var(--t1-bg); color: var(--t1); }
.badge.Pending { background: var(--t2-bg); color: var(--t2); }
.badge.Blocked { background: var(--t0-bg); color: var(--t0); }

.flags { display: flex; flex-wrap: wrap; gap: 3px; }
.flag {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: var(--t1-bg); color: var(--t1); white-space: nowrap;
}
.flag.mild { background: var(--t2-bg); color: var(--t2); }
.flag.calm { background: var(--surface-2); color: var(--ink-3); }

/* ──────────────────────────────── filters ─────────────────────────────── */

.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chipbtn {
  font-size: 11.5px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 20px;
  color: var(--ink-2); transition: all var(--ease);
}
.chipbtn:hover { border-color: var(--line-2); color: var(--ink); }
.chipbtn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.search {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 5px 10px; font-size: 12.5px; width: 210px; max-width: 100%;
}
.search::placeholder { color: var(--ink-3); }

/* ──────────────────────────────── arbiter ─────────────────────────────── */

.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 14px; }
label.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
label.field .q { font-size: 12.5px; font-weight: 600; }
label.field .why { font-size: 11px; color: var(--ink-3); }
select, input[type="text"] {
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface);
  padding: 6px 9px; font-size: 12.5px; width: 100%;
}
.checks { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; }
.checkrow { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; cursor: pointer; }
.checkrow input { margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--t0); }

.verdict { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.verdict .big { font-family: var(--mono); font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.verdict .txt { min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.verdict .txt b { display: block; font-size: 14px; color: var(--ink); font-family: var(--display); }
.verdict[data-t="0"] { background: var(--t0-bg); border-color: color-mix(in srgb, var(--t0) 34%, transparent); } .verdict[data-t="0"] .big { color: var(--t0); }
.verdict[data-t="1"] { background: var(--t1-bg); border-color: color-mix(in srgb, var(--t1) 34%, transparent); } .verdict[data-t="1"] .big { color: var(--t1); }
.verdict[data-t="2"] { background: var(--t2-bg); border-color: color-mix(in srgb, var(--t2) 34%, transparent); } .verdict[data-t="2"] .big { color: var(--t2); }
.verdict[data-t="3"] { background: var(--t3-bg); border-color: color-mix(in srgb, var(--t3) 34%, transparent); } .verdict[data-t="3"] .big { color: var(--t3); }

.ctl-list { display: flex; flex-direction: column; }
.ctl { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.ctl:last-child { border-bottom: 0; }
.ctl .cid { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent); }
.ctl .ct { font-size: 12.5px; min-width: 0; }
.ctl .cm { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.ctl .ca { font-family: var(--mono); font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.ctl.group { background: var(--surface-2); }
.ctl.group .cid { color: var(--ink-2); }

.empty { padding: 44px 20px; text-align: center; }
.empty h3 { font-size: 14px; margin-bottom: 6px; }
.empty p { font-size: 12.5px; color: var(--ink-3); max-width: 48ch; margin: 0 auto; }

.skeleton { height: 11px; border-radius: 3px; background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ──────────────────────────── command palette ─────────────────────────── */

.palette-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; }
.palette-scrim { position: absolute; inset: 0; background: color-mix(in srgb, #000 42%, transparent); }
.palette {
  position: relative; margin-top: 12vh; width: min(560px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28); overflow: hidden;
}
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 13px 15px; font-size: 14px; background: transparent; }
.palette input:focus-visible { outline: 0; }
.palette-list { list-style: none; margin: 0; padding: 5px; max-height: 44vh; overflow-y: auto; }
.palette-list li { padding: 7px 11px; border-radius: var(--radius); display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; cursor: pointer; }
.palette-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.palette-list .meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.palette-list li[aria-selected="true"] .meta { color: var(--accent); }
.palette-foot { display: flex; gap: 14px; padding: 8px 13px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--ink-3); }
.palette-foot span { display: inline-flex; gap: 4px; align-items: center; }

/* ─────────────────────────────── narrow ───────────────────────────────── */

@media (max-width: 900px) {
  .shell { flex-direction: column; height: auto; }
  .rail { width: auto; flex: none; flex-direction: row; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .navgroup { flex-direction: row; }
  .navbtn { white-space: nowrap; }
  .railfoot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0; }
  .muted-xs, .ghost span { display: none; }
  .scroll { padding: 16px; }
  .topbar { padding: 14px 16px 12px; }
}

/* ─────────────────────── the signed-in identity in the rail ─────────────── */

.whoami {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 10px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.who-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.who-text b { font-size: 11.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.who-text span { font-size: 10px; color: var(--ink-3); }
.who-out { flex: none; font-size: 10.5px; padding: 4px 8px; }

/* ───────────── enforcement, fleet and data ───────────── */

/* Limits are never a hint and never collapsible: everything in one of these is something a
   client would otherwise find out during an incident. */
.panel.limits { border-left: 3px solid var(--warn); }
.panel.limits h3 { margin-bottom: 8px; }
.panel.limits ul { margin: 0; padding-left: 18px; }
.panel.limits li { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 7px; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }

.postures { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.posture {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.posture:hover { border-color: var(--line-2); }
.posture.on { border-color: var(--accent); background: var(--accent-soft); }
.posture input { margin-top: 2px; flex: none; }
.posture div { display: flex; flex-direction: column; gap: 2px; }
.posture b { font-size: 12.5px; }
.posture span { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }

.artifacts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.artifact { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.art-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.art-head b { font-size: 12.5px; }
.artifact p { margin: 0 0 5px; font-size: 11.5px; line-height: 1.55; }
.art-effect { color: var(--ink); }
.art-deploy { color: var(--ink-2); }
.art-caveat { color: var(--ink-3); }
.artifact p b { color: var(--ink-2); font-weight: 600; }

.drift { max-width: 520px; }
.drift-row { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; font-size: 11.5px; line-height: 1.5; }
.drift-row:last-child { margin-bottom: 0; }
.dr-sev { font-weight: 600; }
.dr-sev.crit { color: var(--crit); }
.dr-sev.warn { color: var(--warn); }
.dr-fix { color: var(--ink-3); font-style: italic; }

.blindspot {
  margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line-2);
  font-size: 11.5px; color: var(--ink-3); line-height: 1.55;
}

.row-warn { background: color-mix(in srgb, var(--warn) 7%, transparent); }

.field { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; max-width: 460px; }
.field.narrow { max-width: 180px; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.field > span em { font-weight: 400; font-style: normal; color: var(--ink-3); }
.field > em { font-size: 10.5px; color: var(--ink-3); }
.field input, .field select {
  font: inherit; font-size: 12.5px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 7px 9px;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin: 12px 0; }
.field-row > span { font-size: 11.5px; font-weight: 600; color: var(--ink-2); padding-bottom: 2px; }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.check.big { font-size: 13px; color: var(--ink); margin: 10px 0; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.actions .btn, .actions .ghost {
  font: inherit; font-size: 12.5px; padding: 7px 13px; border-radius: var(--radius); cursor: pointer;
  text-decoration: none; display: inline-block;
}
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; }
.btn:hover { filter: brightness(1.07); }
.ghost.sm { font-size: 11px; padding: 3px 8px; }
.actions button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.warnbox {
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  border-radius: var(--radius); padding: 9px 11px; margin: 12px 0;
  font-size: 11.5px; line-height: 1.55; color: var(--ink-2);
}
.warnbox div + div { margin-top: 5px; }

.muted-sm.bad { color: var(--crit); }

.sample { margin-top: 14px; }
.sample summary { font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.sample pre {
  margin: 8px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); font-family: var(--mono); font-size: 10.5px;
  line-height: 1.5; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

.grid.tight td, .grid.tight th { padding-top: 6px; padding-bottom: 6px; }

.muted-sm { font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }
.muted { font-size: 12.5px; color: var(--ink-3); }

.pill {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2);
}
.pill.ok   { background: var(--t3-bg); color: var(--t3); }
.pill.warn { background: var(--t2-bg); color: var(--t2); }
.pill.crit { background: var(--t0-bg); color: var(--t0); }

.tile.warn .v { color: var(--warn); }
.tile.crit .v { color: var(--crit); }

/* What this installation has bought. In the rail, because an operator who does not know which
   edition they are running finds out by hitting a refusal, which is the worst moment to learn. */
.lic {
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 8px; border-radius: var(--radius); margin-bottom: 6px;
  text-align: center; cursor: default;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lic.ok    { background: var(--surface-2); color: var(--ink-3); }
.lic.trial { background: var(--accent-soft); color: var(--accent); }
.lic.warn  { background: var(--t2-bg); color: var(--t2); }
.lic.none  { background: var(--surface-2); color: var(--ink-3); }

/* ───────────── agents, and what can instruct them ───────────── */

.exposures { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.exposure {
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--radius); padding: 11px 13px;
}
.exposure.sev-critical { border-left-color: var(--crit); }
.exposure.sev-high     { border-left-color: var(--warn); }
.exposure.sev-medium   { border-left-color: var(--line-2); }

.ex-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.ex-head b { font-size: 12.5px; }
.ex-head .mono { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }

.ex-story { margin: 0 0 8px; font-size: 12.5px; line-height: 1.55; color: var(--ink); }

.ex-halves { display: flex; flex-wrap: wrap; gap: 14px; }
.ex-halves > div { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ex-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }

.cred-warn { margin-top: 4px; color: var(--crit); font-weight: 500; }

.src-chip.reach {
  background: var(--t0-bg); color: var(--t0);
  font-family: var(--mono); font-size: 10px;
}
.hop { font-family: var(--mono); font-size: 10.5px; line-height: 1.6; color: var(--ink-2); }

/* ───────────── provenance ───────────── */

.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .twocol { grid-template-columns: 1fr; } }

.export-cmd {
  margin: 8px 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); font-family: var(--mono); font-size: 10.5px;
  line-height: 1.5; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* ───────────── what we hold about one person ───────────── */


.holding { margin: 10px 0 0; display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; }
.holding dt {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3); padding-top: 2px;
}
.holding dd { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }

@media (max-width: 700px) { .holding { grid-template-columns: 1fr; gap: 2px 0; } }

.rights { margin: 0; padding-left: 18px; }
.rights li { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 7px; }

/* ─────────────────────────── grouped navigation ────────────────────────── */
/*
   The rail carries sixteen destinations. Flat, that is a list somebody scans once and gives up
   on. Four quiet headings turn it into something answerable: "where do I set the rules".
*/

.navgroup + .navgroup { margin-top: 16px; }

.navhead {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 6px; padding: 0 9px;
}

.pip.warn { background: var(--warn); color: var(--surface); }
.pip.ok { background: var(--ok); color: var(--surface); }
.navbtn[aria-current="true"] .pip.warn,
.navbtn[aria-current="true"] .pip.ok { background: var(--surface); }
.navbtn[aria-current="true"] .pip.warn { color: var(--warn); }
.navbtn[aria-current="true"] .pip.ok { color: var(--ok); }

/* ──────────────────────────────── tabs ─────────────────────────────────── */

.tabs {
  display: flex; gap: 2px; margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.tab {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 16px 11px; cursor: pointer; text-align: left;
  color: var(--ink-2); transition: color var(--ease), border-color var(--ease);
}
.tab b { font-size: 13px; font-weight: 600; }
.tab span { font-size: 11px; color: var(--ink-3); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab[aria-selected="true"] span { color: var(--ink-2); }

/* ───────────────────────────── sector strip ────────────────────────────── */

.sectorstrip {
  display: grid; grid-template-columns: 1fr auto; gap: 28px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--surface);
  padding: 18px 20px; margin-bottom: 14px;
}

.ss-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px;
}
.ss-name { font-family: var(--display); font-size: 21px; letter-spacing: -.02em; }
.ss-why { margin: 7px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; max-width: 62ch; }
.ss-shaped {
  margin: 9px 0 0; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
}

.ss-change { display: flex; flex-direction: column; gap: 9px; min-width: 250px; }
.ss-change .field { margin: 0; }

@media (max-width: 900px) {
  .sectorstrip { grid-template-columns: 1fr; gap: 16px; }
}

/* ───────────────────────── disclosure sections ─────────────────────────── */

.disclose {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 18px;
}
.disclose > summary {
  cursor: pointer; padding: 12px 16px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); list-style: none;
}
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::before { content: "\25B8  "; color: var(--ink-3); }
.disclose[open] > summary::before { content: "\25BE  "; }
.disclose > summary:hover { color: var(--ink); }
.disclose-body { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.disclose-body h4 {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin: 14px 0 7px;
}
.disclose-body h4:first-child { margin-top: 0; }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─────────────────────────────── guardrails ────────────────────────────── */
/*
   A switch has to say three things: what it does, whether it is on, and whether being on means
   anything yet. The third is the one every product in this category gets wrong — a green toggle
   for a policy file nobody has deployed is a lie told in a reassuring colour.
*/

.gr-summary {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 16px 20px; margin-bottom: 14px;
}

.grs-item { display: flex; align-items: baseline; gap: 8px; }
.grs-item b { font-family: var(--display); font-size: 27px; letter-spacing: -.03em; }
.grs-item span { font-size: 12px; color: var(--ink-2); }
.grs-item.is-good b { color: var(--ok); }
.grs-item.is-warn b { color: var(--warn); }
.grs-item.is-crit b { color: var(--crit); }

.grs-note {
  margin: 0; flex: 1 1 36ch; min-width: 30ch;
  font-size: 12px; color: var(--ink-2); line-height: 1.6;
}

.grlist { display: flex; flex-direction: column; margin-top: 4px; }

.grrow {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 2px; border-top: 1px solid var(--line);
}
.grrow:first-child { border-top: 0; }

/* A real switch rather than a checkbox. The old control was a 16px tick box, which read as a
   form field; these are decisions about whether something is prevented. */
.gr-switch { flex: none; position: relative; width: 38px; height: 22px; cursor: pointer; }
.gr-switch input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.gr-switch span {
  position: absolute; inset: 0; border-radius: 11px;
  background: var(--line-2); transition: background var(--ease);
  pointer-events: none;
}
.gr-switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform var(--ease);
}
.gr-switch input:checked + span { background: var(--accent); }
.gr-switch input:checked + span::after { transform: translateX(16px); }
.gr-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.gr-switch input:disabled { cursor: not-allowed; }
.gr-switch input:disabled + span { opacity: .55; }

.grrow-body { min-width: 0; flex: 1; }
.grrow-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grrow-head b { font-size: 13.5px; font-weight: 600; }
.grrow.off .grrow-head b { color: var(--ink-2); }

.grrow-effect {
  margin: 5px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
  max-width: 74ch;
}

.grrow-limit { margin-top: 7px; }
.grrow-limit > summary {
  cursor: pointer; list-style: none; font-size: 11.5px; color: var(--ink-3);
  font-family: var(--mono);
}
.grrow-limit > summary::-webkit-details-marker { display: none; }
.grrow-limit > summary::before { content: "\25B8  "; }
.grrow-limit[open] > summary::before { content: "\25BE  "; }
.grrow-limit > summary:hover { color: var(--ink-2); }
.grrow-limit p {
  margin: 6px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-2);
  max-width: 74ch; padding-left: 14px;
}

/* ───────────────────────────────── setup ───────────────────────────────── */

.setup-hero {
  display: grid; grid-template-columns: 1fr 300px; gap: 32px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 24px 26px; margin-bottom: 20px;
}
.sh-left h2 { font-family: var(--display); font-size: 25px; letter-spacing: -.025em; margin: 0; }
.sh-head { margin: 8px 0 14px; font-size: 13.5px; color: var(--ink); line-height: 1.6; }
.sh-track {
  height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 7px;
}
.sh-track span { display: block; height: 100%; background: var(--accent); transition: width var(--ease); }
.sh-right { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.sh-right p { margin: 0; }

@media (max-width: 900px) {
  .setup-hero { grid-template-columns: 1fr; gap: 18px; }
}

.steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.step {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 16px 18px;
}
.step.done { border-color: color-mix(in srgb, var(--ok) 36%, var(--line)); }
.step.optional { background: none; }

.step-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2);
}
.step.done .step-n { background: var(--ok); color: var(--surface); }

.step-body { min-width: 0; flex: 1; }
.step-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.step-head b { font-size: 14px; font-weight: 600; }
.step-why { margin: 5px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; max-width: 78ch; }
.step-status {
  margin: 8px 0 0; font-family: var(--mono); font-size: 11.5px; color: var(--warn);
  line-height: 1.55; max-width: 78ch;
}
.step-status.ok { color: var(--ok); }

.step-do { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.step-do input {
  flex: 1 1 240px; max-width: 340px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); padding: 7px 10px; font-size: 13px;
}
.step-body > .btn { margin-top: 12px; }

/* Copyable commands. Shown rather than described, because "run the installer" is not a thing
   anybody can actually run. */
.cmd {
  display: flex; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); padding: 10px 12px; margin-bottom: 5px;
}
.cmd code {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px;
  color: var(--ink); word-break: break-all; line-height: 1.55;
}

.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .twocol { grid-template-columns: 1fr; gap: 16px; } }

.sub-h {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin: 18px 0 8px;
}

/* A tab's contents. All three are in the document and the inactive ones are hidden, because
   the save button reads the escalation fields by id and a field that is absent reads as empty. */
.tabpanel[hidden] { display: none; }

/* ---------------------------- organizations ----------------------------- */
/*
   A portfolio, not a dropdown. One card per client, and the state chosen so the worst thing
   true of an organization is the thing you see first.
*/

.orgbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--surface);
  padding: 18px 20px; margin-bottom: 16px; flex-wrap: wrap;
}

.orglist {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px; margin-bottom: 18px;
}

.orgcard {
  border: 1px solid var(--line); border-top: 3px solid var(--line-2);
  border-radius: var(--radius); background: var(--surface);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 9px;
}
.orgcard.is-good { border-top-color: var(--ok); }
.orgcard.is-warn { border-top-color: var(--warn); }
.orgcard.is-crit { border-top-color: var(--crit); }

.oc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.oc-head b { font-family: var(--display); font-size: 17px; letter-spacing: -.02em; }

.oc-mean { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.55; }

.oc-nums {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 10px; padding: 10px 0; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.oc-nums > div { display: flex; flex-direction: column; gap: 1px; }
.oc-nums b { font-family: var(--display); font-size: 19px; letter-spacing: -.02em; }
.oc-nums span { font-size: 10.5px; color: var(--ink-3); line-height: 1.3; }
.oc-nums > div.bad b { color: var(--crit); }

.oc-foot { display: flex; flex-direction: column; gap: 3px; }
.oc-foot span { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }

.orgcard > .btn { align-self: flex-start; }
