/* hoube.ai Mission Control — console stylesheet.
   The quiet navy look: cool blue-grey neutrals, one navy accent (light blue
   in Night), Geist for text and Geist Mono for figures. Surfaces are flat and
   split by 1px hairlines; only floating layers get a shadow. Light is the
   default; Night follows the system unless the visitor picks one
   (html[data-theme]). */

:root {
  --bg: #F5F6F9; --surface: #FFFFFF; --surface-2: #F9FAFC; --field: #FAFBFC;
  --sidebar: #EEF0F5; --sidebar-hover: #E5E8F0; --sidebar-active: #E5E8F0; --chip: #EEF0F5;
  --text: #0E1325; --text-2: #4A5470; --text-3: #646D8A;
  --line: #E1E4EC; --line-soft: #ECEEF3; --line-hover: #CDD2DE; --line-strong: #B5BCCD;
  --primary: #16244A; --primary-hover: #1F3160; --on-primary: #FFFFFF; --em: #3A5E9C; --focus: #3A5E9C;
  --series: #C3CFE4; --series-on: #4972B5; --track: #E7EAF1; --switch-off: #848CA3;
  --critical: #A3423B; --critical-bg: rgba(163, 66, 59, .07); --on-critical: #FFFFFF;
  --serious: #8F6420; --serious-bg: rgba(143, 100, 32, .08);
  --good: #3D6B52; --good-bg: rgba(61, 107, 82, .08);
  --tip-bg: #0E1325; --tip-text: #F5F6F9;
  --shadow: 0 8px 24px -12px rgba(14, 19, 37, .18);
  --shadow-pop: 0 20px 48px -24px rgba(0, 0, 0, .45);
  --shadow-dialog: 0 24px 64px -24px rgba(0, 0, 0, .45);
  --scrim: rgba(5, 7, 15, .55);

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05070F; --surface: #0A1024; --surface-2: #0D1430; --field: #070B19;
    --sidebar: #070B19; --sidebar-hover: #121A33; --sidebar-active: #121A33; --chip: #121A33;
    --text: #EEF1F8; --text-2: #BCC3D4; --text-3: #8790A8;
    --line: #1A2138; --line-soft: #11172B; --line-hover: rgba(238, 241, 248, .13); --line-strong: #323C5A;
    --primary: #8FB0E8; --primary-hover: #A5C0EE; --on-primary: #05070F; --em: #8FB0E8; --focus: #8FB0E8;
    --series: #26386A; --series-on: #8FB0E8; --track: #141B30; --switch-off: #5A6587;
    --critical: #E08A82; --critical-bg: rgba(224, 138, 130, .10); --on-critical: #05070F;
    --serious: #D6AE6E; --serious-bg: rgba(214, 174, 110, .10);
    --good: #8CC2A4; --good-bg: rgba(140, 194, 164, .09);
    --tip-bg: #EEF1F8; --tip-text: #05070F;
    --shadow: 0 12px 32px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #05070F; --surface: #0A1024; --surface-2: #0D1430; --field: #070B19;
  --sidebar: #070B19; --sidebar-hover: #121A33; --sidebar-active: #121A33; --chip: #121A33;
  --text: #EEF1F8; --text-2: #BCC3D4; --text-3: #8790A8;
  --line: #1A2138; --line-soft: #11172B; --line-hover: rgba(238, 241, 248, .13); --line-strong: #323C5A;
  --primary: #8FB0E8; --primary-hover: #A5C0EE; --on-primary: #05070F; --em: #8FB0E8; --focus: #8FB0E8;
  --series: #26386A; --series-on: #8FB0E8; --track: #141B30; --switch-off: #5A6587;
  --critical: #E08A82; --critical-bg: rgba(224, 138, 130, .10); --on-critical: #05070F;
  --serious: #D6AE6E; --serious-bg: rgba(214, 174, 110, .10);
  --good: #8CC2A4; --good-bg: rgba(140, 194, 164, .09);
  --tip-bg: #EEF1F8; --tip-text: #05070F;
  --shadow: 0 12px 32px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--em); }
a:hover { color: var(--text); }
code, .mono { font: 400 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon { flex-shrink: 0; }
.wm { font: 600 16px/1 var(--sans); letter-spacing: -.01em; color: var(--text); }

/* ── shell ──────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  background: var(--sidebar); border-right: 1px solid var(--line); padding: 20px 12px 16px; overflow-y: auto;
}
.brand { display: flex; flex-direction: column; gap: 4px; padding: 2px 10px 16px; text-decoration: none; }
.brand-sub { font-size: 12.5px; color: var(--text-3); }
/* The nav scrolls on its own so the brand and account stay put in short windows (and hoube's Mission Control window). */
.nav { display: flex; flex-direction: column; gap: 18px; flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-heading { font-size: 12.5px; color: var(--text-3); padding: 0 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; transition: background-color .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--sidebar-active); color: var(--text); font-weight: 500; }
.sidebar-foot { position: relative; border-top: 1px solid var(--line); padding-top: 10px; }
.embedded .sidebar-foot { display: none; } /* in hoube's Mission Control window, whose account menu has these (core.js) */
.account {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background-color .12s ease;
}
.account:hover, .account[aria-expanded="true"] { background: var(--sidebar-hover); }
.account > .icon { color: var(--text-2); margin-left: auto; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--primary); color: var(--on-primary); font: 600 13px/1 var(--sans);
}
.who-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.who-name { font: 500 13px/1.2 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { font-size: 11px; line-height: 1.2; color: var(--text-2); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0;
  background: transparent; color: var(--text-2); cursor: pointer; transition: background-color .12s ease, color .12s ease;
}
.icon-btn:hover { background: var(--sidebar-hover); color: var(--text); }

/* ── menus ──────────────────────────────────────────────────────── */
.menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% - 4px); z-index: 5; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
}
.menu form { margin: 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 8px; border: 0; border-radius: 8px;
  background: transparent; font: 400 13px/1 var(--sans); color: var(--text); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--sidebar-hover); color: var(--text); }
.menu-item .icon { color: var(--text-3); }
.menu-item:hover .icon { color: var(--text-2); }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 0 4px 0 8px; font-size: 13px; }
.menu-sep { height: 1px; margin: 3px 4px; background: var(--line); }
.segmented.compact { padding: 2px; border: 0; background: var(--chip); border-radius: 8px; }
.segmented.compact button { display: inline-grid; place-items: center; min-height: 28px; padding: 0 8px; color: var(--text-2); }
.segmented.compact button:hover { background: transparent; color: var(--text); }
.segmented.compact button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }

.content { min-width: 0; }
.topbar { display: none; }
.main { max-width: 1120px; margin: 0 auto; padding: 32px 40px 72px; outline: none; }
.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 40px; background: var(--serious-bg);
  border-bottom: 1px solid var(--line); color: var(--text); font-size: 13.5px;
}
.banner .icon { color: var(--serious); margin-top: 2px; }
.banner strong { font-weight: 600; }
.scrim { display: none; }

/* ── page header ────────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.eyebrow { font-size: 13px; color: var(--text-3); }
h1 { font: 600 24px/1.25 var(--sans); letter-spacing: -.015em; margin: 4px 0 6px; text-wrap: balance; }
.lede { margin: 0; max-width: 64ch; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stamp { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ── buttons & inputs ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; font: 500 13px/1 var(--sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { background: var(--sidebar-hover); color: var(--text); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--critical); }
.btn.danger.solid { background: var(--critical); border-color: var(--critical); color: var(--on-critical); }
.btn.danger.solid:hover { opacity: .9; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sidebar-hover); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.row-actions select, .toolbar select { width: auto; }
.limit-card .row-actions { margin-top: 6px; }
.confirm { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.confirm > span { font-size: 13px; color: var(--critical); }

.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.segmented button {
  font: 500 12.5px/1 var(--sans); color: var(--text-2); background: transparent; border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.segmented button:hover { color: var(--text); background: var(--surface-2); }
.segmented button[aria-checked="true"] { background: var(--sidebar-hover); color: var(--text); }

.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; }
.field small { color: var(--text-3); font-size: 12.5px; }
.field-error { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--critical); }
.field-error .icon { margin-top: 1px; }
input[type="text"], input[type="number"], input[type="search"], input[type="email"], input[type="password"], select, textarea {
  font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; min-height: 38px; width: 100%; min-width: 0; transition: border-color .12s ease;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: -1px; }
[aria-invalid="true"] { border-color: var(--critical) !important; }
textarea { font: 400 12.5px/1.5 var(--mono); min-height: 110px; resize: vertical; }
.search { position: relative; min-width: 220px; flex: 1; max-width: 340px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; cursor: pointer; }
.switch {
  position: relative; width: 40px; height: 24px; flex-shrink: 0; appearance: none; -webkit-appearance: none; margin: 0;
  border-radius: 999px; background: var(--switch-off); cursor: pointer; transition: background-color .15s ease;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; transition: transform .15s ease, background-color .15s ease; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(16px); background: var(--surface); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* ── cards & stats ──────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.card-title { margin-bottom: 14px; }
.section-title { font: 600 17px/1.3 var(--sans); margin: 8px 0 14px; }
.section-title ~ .section-title { margin-top: 28px; }
.card-head .card-title { margin-bottom: 0; }
.card h2 { font: 600 15px/1.3 var(--sans); margin: 0; }
.card h3 { font: 600 14px/1.3 var(--sans); margin: 18px 0 8px; }
.hint { color: var(--text-3); font-size: 13px; margin: 2px 0 0; max-width: 76ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid2 > .card { margin-bottom: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.stat.critical .stat-label::before, .stat.serious .stat-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.stat.critical .stat-label::before { background: var(--critical); }
.stat.serious .stat-label::before { background: var(--serious); }
.stat-value { font: 500 24px/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.015em; }
.stat-sub { font-size: 12.5px; color: var(--text-3); }
.stat .delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ── tables ─────────────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th {
  text-align: left; font: 500 12.5px/1.4 var(--sans); color: var(--text-3);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
th .sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th .sort:hover { color: var(--text); }
th .sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
th[aria-sort="ascending"] .sort::after { content: "↑"; }
th[aria-sort="descending"] .sort::after { content: "↓"; }
td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.num { font: 400 13px/1.6 var(--mono); }
.title { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.meta { color: var(--text-3); font-size: 12.5px; }
.strong { font-weight: 500; }

/* ── pills, status, notices ─────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font: 400 12.5px/1.4 var(--sans);
  padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
}
.pill.strong { border-color: var(--text-3); color: var(--text); }
.pill.quiet { color: var(--text-3); }
.pill.count { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.status { display: inline-flex; align-items: center; gap: 6px; font: 400 13px/1.3 var(--sans); color: var(--text-2); white-space: nowrap; }
.status.critical .icon { color: var(--critical); }
.status.serious .icon { color: var(--serious); }
.status.good .icon { color: var(--good); }
.status.neutral .icon { color: var(--text-3); }
.notice {
  display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  margin: 0 0 16px; background: var(--surface-2); font-size: 13.5px;
}
.notice > .icon { margin-top: 2px; }
.notice strong { font-weight: 600; }
.notice.warn { border-color: transparent; background: var(--serious-bg); }
.notice.warn > .icon { color: var(--serious); }
.notice.bad { border-color: transparent; color: var(--critical); background: var(--critical-bg); }
.notice.ok > .icon { color: var(--good); }
.empty { color: var(--text-3); padding: 18px 0 8px; }
.empty p { margin: 0 0 10px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-3); padding: 24px 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--text-3); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stale { opacity: .55; transition: opacity .2s; pointer-events: none; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 4px 0 18px; background: var(--surface-2); }
.panel h3 { margin-top: 0; }
pre.block { white-space: pre-wrap; font: 400 12.5px/1.5 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; max-height: 420px; overflow: auto; margin: 12px 0 0; }
ol.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
ol.steps li::marker { font-family: var(--mono); color: var(--text-3); }
.dot-ok, .dot-off, .dot-unk { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-ok { background: var(--good); } .dot-off { background: var(--serious); } .dot-unk { background: var(--switch-off); }

/* ── charts ─────────────────────────────────────────────────────── */
.chart { position: relative; width: 100%; margin: 4px 0 4px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .baseline { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .bar { fill: var(--series); transition: fill .12s ease; }
.chart .bar.on { fill: var(--series-on); }
.chart .hit { fill: transparent; outline: none; cursor: default; }
.chart .hit:focus-visible { fill: var(--chip); }
.y-labels span, .x-labels span {
  position: absolute; font: 400 11.5px/1 var(--mono); color: var(--text-3); white-space: nowrap; pointer-events: none;
}
.y-labels span { left: 0; transform: translateY(-50%); }
.x-labels span { bottom: 4px; transform: translateX(-50%); }
.tip {
  position: absolute; z-index: 2; pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
  background: var(--tip-bg); color: var(--tip-text); border-radius: 6px; padding: 7px 10px; display: flex; flex-direction: column; gap: 3px;
  font: 400 12px/1.2 var(--mono); white-space: nowrap; box-shadow: var(--shadow);
}
.tip strong { font: 500 13px/1.1 var(--sans); }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; margin-bottom: 10px; }
.chart-total { font: 500 20px/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ranking-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13.5px; }
.ranking-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-value { font: 400 12.5px/1.5 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.ranking-track { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.ranking-bar { height: 100%; background: var(--series-on); border-radius: 2px; }

.meter { position: relative; height: 6px; border-radius: 3px; background: var(--track); min-width: 120px; }
.meter-fill { height: 100%; border-radius: 3px; background: var(--series-on); max-width: 100%; }
.meter.serious .meter-fill { background: var(--serious); }
.meter.critical .meter-fill { background: var(--critical); }
.meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-3); border-radius: 1px; box-shadow: 0 0 0 1px var(--surface); }
.meter-cell { display: grid; gap: 6px; min-width: 160px; }
.meter-cell .meta { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }

/* ── limits & roles ─────────────────────────────────────────────── */
.limit-card { display: flex; flex-direction: column; gap: 10px; }
.limit-value { font: 500 28px/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.015em; }
.limit-value small { font: 400 14px/1 var(--sans); letter-spacing: 0; color: var(--text-2); margin-left: 6px; }
.limit-facts { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--text-2); }
.limit-facts li { display: flex; gap: 8px; align-items: center; }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.role { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }
.role h3 { margin: 0 0 6px; }
.role ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; display: grid; gap: 4px; }
.ext-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 4px 0 16px; }
.ext { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.ext-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ext-name { font: 600 15px/1.3 var(--sans); }
.ext p { margin: 0; color: var(--text-2); font-size: 13.5px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; display: flex; gap: 8px; align-items: center;
  background: var(--tip-bg); color: var(--tip-text); padding: 10px 14px; border-radius: 8px; font-size: 13.5px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
.toast.bad { background: var(--critical); color: var(--on-critical); }

/* ── narrow screens ─────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); height: auto;
    transform: translateX(-102%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: var(--shadow);
  }
  .nav-open .sidebar { transform: none; visibility: visible; transition: transform .2s ease; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(5, 7, 15, .4); }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 10; padding: 6px 12px;
    background: var(--sidebar); border-bottom: 1px solid var(--line);
  }
  .menu-btn { width: 44px; height: 44px; }
  .main { padding: 24px 16px 56px; }
  .banner { padding: 10px 16px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .tablewrap { margin: 0 -16px; padding: 0 16px; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; }
  .page-actions, .toolbar-right { width: 100%; }
  .toolbar select { flex: 1; }
  .menu-item { min-height: 44px; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Privacy receipt */
.receipt { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 4px 0 12px; font: 400 14px/1.4 var(--sans); }
.receipt dt { color: var(--text-3); }
.receipt dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.receipt-items { margin: 0; padding-left: 18px; }
@media (max-width: 560px) { .receipt { grid-template-columns: 1fr; gap: 2px; } .receipt dd { margin-bottom: 8px; } }

/* Shadow AI */
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font: 400 14px/1.4 var(--sans); color: var(--text); cursor: pointer; }
.steps { margin: 4px 0 10px; padding-left: 20px; font: 400 14px/1.55 var(--sans); color: var(--text-2); }
.steps li { margin: 4px 0; }
pre.mono { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line, #DDE1EA); border-radius: 8px; overflow-x: auto; font-size: 13px; }

/* Detector alerts: the masked request excerpt, click to expand. */
.excerpt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
