/* Bliink · Lab demo. Control-room look: near-black, off-white, three greys, one signal accent.
   Tiers are told apart by label, glyph and line style, never by colour:
   On-site AI = solid / filled square, Advanced AI = dashed / dashed square, Your team = outlined / ring.
   Spacing scale 4/8/12/16/24/32/48. Type scale 11/12/13/14/16/20/28/44. 1px rules, 2px corners, no shadows. */
:root {
  color-scheme: dark;
  --bg: #0a0b0c;
  --bg-2: #0f1012;
  --bg-3: #15171a;
  --line: #222428;
  --line-2: #33363b;
  --g1: #9a9c97;   /* secondary text */
  --g2: #6c6e6a;   /* tertiary text */
  --g3: #3d3f42;   /* faint marks */
  --text: #ecebe5;
  --accent: #d4ff3a;
  --accent-ink: #0a0b0c;
  --side-w: 248px;
  --top-h: 60px;
  --r: 2px;
  --ctl-h: 36px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (max-width: 1023.98px), (pointer: coarse) { :root { --ctl-h: 44px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:has(dialog[open]), html.nav-open { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--text); text-decoration-color: var(--g2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--g2); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
svg.g { width: 10px; height: 10px; flex: none; display: inline-block; }
.label { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--g2); }

/* ---------- Shell ---------- */
.side { position: fixed; top: var(--lab-bar-h, 0px); left: 0; bottom: 0; width: var(--side-w); z-index: 30; display: flex; flex-direction: column; gap: 24px; padding: 20px 16px 16px; background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r); flex: none; }
.logo svg { width: 16px; height: 16px; }
.logo .blink { fill: var(--accent); }
.wordmark { display: block; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
/* The second i is upside down: a real i mirrored around the middle of the x-height, so the stem stays put and
   the dot drops below the baseline, lined up with the stem. The dot is painted in the accent (the "blink").
   0.62em = baseline (0.89em) minus half the x-height (0.27em), measured for Geist at this line height. */
.flip-i { display: inline-block; transform: scaleY(-1); transform-origin: 50% .62em;
  background: linear-gradient(to bottom, var(--accent) 0, var(--accent) .33em, currentColor .33em);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand small { display: block; color: var(--g2); font: 400 11px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.side .side-close { display: none; }
.ws-pick { display: flex; flex-direction: column; gap: 6px; }
.ws-pick select { width: 100%; }
.nav { display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; }
.nav-group .label { padding: 0 8px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; color: var(--g1); text-decoration: none; font-size: 13.5px; border-radius: var(--r); }
.nav a:hover { color: var(--text); background: var(--bg-3); }
.nav a[aria-current="page"] { color: var(--text); background: var(--bg-3); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 2px; background: var(--accent); }
.nav .count { margin-left: auto; font: 500 11.5px/1 var(--mono); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r); padding: 3px 6px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-note { color: var(--g2); font-size: 12px; line-height: 1.5; }
.status-line { display: flex; gap: 8px; align-items: baseline; font: 400 12px/1.45 var(--mono); color: var(--g1); }
.status-line b { color: var(--text); font-weight: 500; }

.live-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; flex: none; display: inline-block; }
.live-dot.off { background: var(--g3); }
@media (prefers-reduced-motion: no-preference) { .live-dot.pulse { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .25; } }

.main { margin-left: var(--side-w); min-width: 0; min-height: calc(100vh - var(--lab-bar-h, 0px)); display: flex; flex-direction: column; }
.top { position: sticky; top: var(--lab-bar-h, 0px); z-index: 20; min-height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 10px 40px; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .menu-btn { display: none; }
.top-title { min-width: 0; flex: 1; }
.top-title h1 { font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.top-title p { color: var(--g2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; flex: none; align-items: center; }
.page { width: 100%; max-width: 1480px; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 32px; flex: 1; }
.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: 1480px; padding: 16px 40px; color: var(--g2); font-size: 12px; }
.scrim { display: none; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ctl-h); padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 500; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color .12s, background-color .12s; }
.btn:hover { border-color: var(--g1); background: var(--bg-3); }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.primary:hover { background: #fff; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { border-color: var(--line-2); }
.btn.block { width: 100%; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; border-color: var(--line-2); }
.icon-btn { padding: 0; width: var(--ctl-h); }
input[type="search"], input[type="text"], select, textarea { min-height: var(--ctl-h); padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 13px; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9c97' stroke-width='1.6'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; cursor: pointer; }
select option { background: var(--bg-2); color: var(--text); }
textarea { width: 100%; padding: 12px; line-height: 1.6; resize: vertical; min-height: 132px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g1); }
::placeholder { color: var(--g2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: transparent; color: var(--g1); font: 500 12px/1 var(--mono); letter-spacing: .02em; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--g1); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
@media (max-width: 1023.98px), (pointer: coarse) { .chip { min-height: 44px; } .btn.sm { min-height: 44px; } }

/* switch */
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2); transition: border-color .12s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: var(--g2); border-radius: 1px; transition: transform .12s, background-color .12s; }
.switch input:checked + span { border-color: var(--text); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--text); }
.switch input:focus-visible + span { outline: 1px solid var(--accent); outline-offset: 2px; }

/* Outside AI kill switch */
.kill { display: inline-flex; align-items: center; gap: 10px; min-height: var(--ctl-h); padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent; color: var(--text); font: 500 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.kill:hover { border-color: var(--g1); }
.kill .k-state { padding: 3px 6px; border: 1px solid var(--line-2); border-radius: 1px; color: var(--g1); }
.kill[aria-checked="false"] { border-color: var(--accent); }
.kill[aria-checked="false"] .k-state { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#sideKill { display: none; }
@media (max-width: 759.98px) { #sideKill { display: block; } }
.kill.big { width: 100%; justify-content: space-between; min-height: 48px; font-size: 13px; padding: 0 14px; }

/* ---------- Panels ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 56px; }
.panel-h h2 { font-size: 14px; font-weight: 600; }
.panel-h p { color: var(--g2); font-size: 12.5px; }
.panel-b { padding: 20px; }
.grid { display: grid; gap: 24px; }
.g-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.g-2e { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }

/* KPI strip: one bordered row, cells split by rules */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); }
.kpi { padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .k-v { font: 500 28px/1 var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-s { color: var(--g2); font-size: 12.5px; }
.kpi.hero .k-v { color: var(--accent); font-size: 44px; }
.kpi.hero .k-v small { font-size: 20px; }

/* tier chips: label + glyph + line style, no hue */
.tier { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 1px; font: 500 11px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; color: var(--text); }
.tier.t-local { background: var(--text); color: var(--bg); border: 1px solid var(--text); }
.tier.t-ext { border: 1px dashed var(--g1); }
.tier.t-person { border: 1px solid var(--g1); }
.tier em { font-style: normal; color: var(--g2); }
.tier.t-local em { color: #4a4c48; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 1px; color: var(--g1); font: 500 11px/1.3 var(--mono); letter-spacing: .02em; white-space: nowrap; }
.tag.strong { color: var(--text); border-color: var(--g1); }
.tag.acc { color: var(--accent); border-color: var(--accent); }
.stay { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1.2 var(--mono); letter-spacing: .02em; white-space: nowrap; color: var(--g1); }
.stay.no { color: var(--text); }
.stay svg { width: 13px; height: 13px; }

/* segmented share bars: solid / dashed / outlined */
.seg { display: flex; height: 14px; gap: 2px; }
.seg span { display: block; height: 100%; min-width: 0; }
.seg .s-local { background: var(--text); }
.seg .s-ext { border: 1px dashed var(--g1); }
.seg .s-person { border: 1px solid var(--g1); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font: 400 12px/1.4 var(--mono); color: var(--g1); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 14px; height: 10px; }
.sw.s-local { background: var(--text); }
.sw.s-ext { border: 1px dashed var(--g1); }
.sw.s-person { border: 1px solid var(--g1); }

/* network map */
.netmap { width: 100%; height: auto; display: block; }
.netmap text { font-family: var(--mono); }
.netmap .zone { fill: none; stroke: var(--line-2); stroke-dasharray: 2 4; }
.netmap .zone-l { fill: var(--g2); font-size: 10.5px; letter-spacing: .1em; }
.netmap .node rect { fill: var(--bg); stroke: var(--line-2); }
.netmap .node.n-gate rect { stroke: var(--g1); }
.netmap .node .t { font-family: var(--sans); font-size: 13px; font-weight: 600; fill: var(--text); }
.netmap .node .s { font-size: 10.5px; fill: var(--g2); }
.netmap .node .gl { fill: var(--text); stroke: none; }
.netmap .node .gl-ext { fill: none; stroke: var(--text); stroke-dasharray: 2 1.5; }
.netmap .node .gl-person { fill: none; stroke: var(--text); stroke-width: 1.2; }
.netmap .fl { fill: none; stroke: var(--text); stroke-width: 1.5; }
.netmap .fl-ext { stroke-dasharray: 6 5; stroke: var(--g1); }
.netmap .fl-person { stroke-dasharray: 1 4; stroke-linecap: round; stroke-width: 2; }
.netmap .fl-ext.is-off { stroke: var(--g3); }
.netmap .cut { stroke: var(--accent); stroke-width: 1.5; }
.netmap .cut-l { fill: var(--accent); font-size: 10.5px; letter-spacing: .08em; }
.netmap .n { font-size: 12px; fill: var(--text); }
.netmap .n-m { font-size: 10.5px; fill: var(--g2); }
@media (prefers-reduced-motion: no-preference) { .netmap .pk { animation: pk 1.2s linear infinite; } }
@keyframes pk { to { stroke-dashoffset: -22; } }

/* row lists */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 20px; border: 0; border-top: 1px solid var(--line); text-align: left; background: none; width: 100%; cursor: pointer; color: inherit; font: inherit; min-height: 52px; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--bg-2); }
.row .r-time { color: var(--g2); font: 400 12px/1 var(--mono); font-variant-numeric: tabular-nums; }
.row .r-main { min-width: 0; }
.row .r-main b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-main small { color: var(--g2); font: 400 11.5px/1.4 var(--mono); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.empty { padding: 40px 20px; text-align: center; color: var(--g2); }
.empty b { display: block; color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 4px; }

/* live stream */
.stream .row { grid-template-columns: 72px 84px minmax(0, 1fr) auto 44px; }
.stream .r-id { color: var(--g2); font: 400 12px/1 var(--mono); }
.stream .r-conf { color: var(--g1); font: 400 12px/1 var(--mono); text-align: right; }
.stream .row.tick-in { box-shadow: inset 2px 0 0 var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .stream .row.tick-in { animation: tickin .5s ease-out, tickmark 3s ease-out forwards; }
}
@keyframes tickin { from { opacity: 0; transform: translateY(-6px); } }
@keyframes tickmark { 0%, 70% { box-shadow: inset 2px 0 0 var(--accent); } 100% { box-shadow: inset 2px 0 0 transparent; } }
.live-ctl { display: inline-flex; align-items: center; gap: 8px; font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--accent); border-radius: var(--r); font-size: 13px; }
.notice b { font-weight: 600; }
.notice .live-dot { margin-top: 6px; }
.notice.plain { border-color: var(--line-2); }

/* ---------- Route ---------- */
.samples { display: flex; flex-direction: column; }
.sample { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; text-align: left; color: inherit; font: inherit; min-height: 48px; }
.sample:first-child { border-top: 0; }
.sample:hover { background: var(--bg-2); }
.sample[aria-pressed="true"] { background: var(--bg-3); box-shadow: inset 2px 0 0 var(--text); }
.sample b { display: block; font-size: 13px; font-weight: 500; }
.sample small { display: block; color: var(--g2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.samples-wrap { border: 1px solid var(--line); border-radius: var(--r); }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.note { font-size: 12px; color: var(--g2); }
.pipeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; opacity: .25; transition: opacity .25s; }
.step.on { opacity: 1; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--line-2); }
.step .s-ic { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--g1); background: var(--bg); }
.step .s-ic svg { width: 14px; height: 14px; }
.step.local .s-ic { background: var(--text); border-color: var(--text); color: var(--bg); }
.step.ext .s-ic { border-style: dashed; border-color: var(--g1); color: var(--text); }
.step.person .s-ic { border-radius: 50%; border-color: var(--g1); color: var(--text); }
.step.stop .s-ic { border-color: var(--accent); color: var(--accent); }
.step h3 { font-size: 13.5px; font-weight: 600; padding-top: 4px; }
.step p { color: var(--g1); font-size: 13px; margin-top: 2px; }
.step .s-extra { margin-top: 8px; }
.verdict { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r); }
.verdict.local { border-color: var(--text); }
.verdict.ext { border-style: dashed; border-color: var(--g1); }
.verdict b { display: block; font-size: 14px; font-weight: 600; }
.verdict p { font-size: 13px; color: var(--g1); margin-top: 2px; }
.verdict svg.i { margin-top: 2px; }
.answer { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); font-size: 13.5px; white-space: pre-wrap; }
.answer-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.det { display: flex; flex-wrap: wrap; gap: 6px; }
.confbar { display: flex; align-items: center; gap: 10px; }
.confbar .cb { position: relative; flex: 1; min-width: 72px; max-width: 200px; height: 6px; background: var(--bg-3); border: 1px solid var(--line); }
.confbar .cb i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text); }
.confbar .cb i.lo { background: var(--g2); }
.confbar .cb em { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--g1); }
.confbar b { font: 500 12.5px/1 var(--mono); font-variant-numeric: tabular-nums; }

/* redaction */
.textbox { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.textbox.leaves { border-style: dashed; border-color: var(--g1); background: transparent; }
.textbox-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
mark.pii, mark.ctl { background: transparent; color: var(--text); border-bottom: 1px solid var(--g1); padding: 0 1px; }
mark.ctl { border-bottom-style: dashed; }
.redact { white-space: nowrap; background: var(--text); color: var(--bg); border-radius: 1px; padding: 1px 5px; font: 500 10.5px/1.4 var(--mono); letter-spacing: .04em; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* approvals */
.approvals { display: flex; flex-direction: column; gap: 16px; }
.appr { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.appr-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.appr-h h3 { font-size: 15px; font-weight: 600; }
.appr-h p { color: var(--g2); font: 400 12px/1.5 var(--mono); margin-top: 2px; }
.why { padding: 10px 12px; border-left: 2px solid var(--g1); background: var(--bg-2); font-size: 13px; color: var(--g1); }
.why b { color: var(--text); font-weight: 600; }
.appr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.appr textarea { min-height: 64px; }
.inline-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar input[type="search"] { flex: 1 1 220px; min-width: 0; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font: 500 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--g2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tbl th button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl td .num { white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.tbl .confbar { min-width: 130px; }
.tbl tbody tr[data-open], .tbl tbody tr[data-simrec] { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-2); }
.tbl .t-req { max-width: 340px; }
.tbl .t-req b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl .t-req small { display: block; color: var(--g2); font: 400 11.5px/1.4 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 20px; color: var(--g2); font: 400 12px/1.4 var(--mono); flex-wrap: wrap; }
.delta { font-family: var(--mono); }
.delta.up::before { content: "+"; }

/* rules */
.rules { display: flex; flex-direction: column; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.rule:first-child { border-top: 0; }
.rule h3 { font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rule p { color: var(--g1); font-size: 12.5px; margin-top: 3px; }
.rule .r-meta { color: var(--g2); font: 400 11.5px/1.4 var(--mono); margin-top: 6px; }
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
input[type="range"] { flex: 1 1 180px; max-width: 300px; accent-color: var(--text); min-height: 32px; background: transparent; }
.slider-row output { font: 500 14px/1 var(--mono); min-width: 40px; }
.impact { margin-top: 8px; font-size: 12.5px; color: var(--g1); }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 72px; gap: 12px; align-items: center; font-size: 12.5px; }
.bar-row .bt { height: 10px; position: relative; }
.bar-row .bt i { display: block; height: 100%; }
.bar-row .bt i.s-local { background: var(--text); }
.bar-row .bt i.s-ext { border: 1px dashed var(--g1); }
.bar-row .bt i.s-person { border: 1px solid var(--g1); }
.bar-row .bv { text-align: right; font: 500 12px/1 var(--mono); }
.axis { display: grid; grid-template-columns: 110px minmax(0, 1fr) 72px; gap: 12px; font: 400 10.5px/1 var(--mono); color: var(--g2); margin-top: 6px; }
.axis div { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 4px; }
ul.changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.changes li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }

/* tiers page */
.tier-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.tier-card .tc-h { display: flex; align-items: center; gap: 12px; }
.tier-card .tc-ic { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r); }
.tier-card .tc-ic svg.g { width: 14px; height: 14px; }
.tier-card.local .tc-ic { border-color: var(--text); }
.tier-card.ext .tc-ic { border-style: dashed; border-color: var(--g1); }
.tier-card.person .tc-ic { border-radius: 50%; border-color: var(--g1); }
.tier-card h3 { font-size: 15px; font-weight: 600; }
.tier-card .tc-h p { color: var(--g2); font: 400 11.5px/1.4 var(--mono); }
dl.kv { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; font-size: 13px; }
dl.kv dt { color: var(--g2); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.people { display: flex; flex-direction: column; gap: 10px; }
.person-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.av { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--g1); display: grid; place-items: center; font: 500 10.5px/1 var(--mono); flex: none; }

/* ---------- Report (watch mode, auditor) ---------- */
.report { border: 1px solid var(--line); border-radius: var(--r); }
.rep-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 28px 32px; border-bottom: 1px solid var(--line); align-items: end; }
.rep-head h2 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-top: 8px; max-width: 26ch; }
.rep-head p { color: var(--g1); margin-top: 8px; max-width: 64ch; }
.rep-meta { display: grid; grid-template-columns: max-content max-content; gap: 6px 16px; font: 400 12px/1.4 var(--mono); color: var(--g1); }
.rep-meta dt { color: var(--g2); }
.rep-meta dd { margin: 0; color: var(--text); }
.rep-sec { padding: 28px 32px; border-top: 1px solid var(--line); }
.rep-sec:first-of-type { border-top: 0; }
.rep-sec > h3 { display: flex; gap: 12px; align-items: baseline; font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.rep-sec > h3 .num { color: var(--g2); font-size: 12px; font-weight: 400; }
.big-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.big-stats > div { padding: 18px 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.big-stats > div:first-child { border-left: 0; }
.big-stats .v { font: 500 28px/1 var(--mono); letter-spacing: -.02em; }
.big-stats .v.acc { color: var(--accent); }
.big-stats .s { font-size: 12.5px; color: var(--g1); }
.findings { margin: 0; padding: 0; list-style: none; counter-reset: f; display: flex; flex-direction: column; }
.findings li { counter-increment: f; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.findings li:first-child { border-top: 0; padding-top: 0; }
.findings li::before { content: counter(f, decimal-leading-zero); font: 400 12px/1.6 var(--mono); color: var(--g2); }
.daychart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: end; height: 160px; border-bottom: 1px solid var(--line-2); }
.daychart .col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.daychart .col i { display: block; }
.daychart .col i.s-local { background: var(--text); }
.daychart .col i.s-ext { border: 1px dashed var(--g1); }
.daychart .col i.s-person { border: 1px solid var(--g1); }
.daylabels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-top: 8px; font: 400 11px/1.3 var(--mono); color: var(--g2); text-align: center; }
.daylabels b { display: block; color: var(--text); font-weight: 500; }
.ctl-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 1px; font: 500 11px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.ctl-status.s-ev { background: var(--text); color: var(--bg); }
.ctl-status.s-pa { border: 1px solid var(--g1); }
.ctl-status.s-gap { border: 1px dashed var(--g1); color: var(--g1); }
.ctl-rec { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ctl-rec button { all: unset; cursor: pointer; font: 400 11.5px/1 var(--mono); color: var(--g1); border: 1px solid var(--line-2); padding: 5px 7px; border-radius: 1px; }
.ctl-rec button:hover { color: var(--text); border-color: var(--g1); }
.ctl-rec button:focus-visible { outline: 1px solid var(--accent); }
.disclaimer { padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--g1); font-size: 12.5px; }
.disclaimer b { color: var(--text); font-weight: 600; }

/* simulator */
.compare-tbl td:first-child { white-space: nowrap; }
.arrow { color: var(--g2); font-family: var(--mono); padding: 0 4px; }
.sim-bars { display: flex; flex-direction: column; gap: 14px; }
.sim-bars .sb { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; }
.sim-bars .label { padding: 0; }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(600px, 100vw); max-width: 100vw; height: 100%; max-height: 100%; padding: 0; border: 0; border-left: 1px solid var(--line-2); background: var(--bg); color: var(--text); overflow: hidden; }
.drawer[open] { display: flex; flex-direction: column; animation: slidein .18s ease-out; }
.drawer::backdrop { background: rgba(0, 0, 0, .6); }
@keyframes slidein { from { transform: translateX(16px); opacity: .5; } }
.dr-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.dr-h h2 { font-size: 16px; font-weight: 600; }
.dr-h p { color: var(--g2); font: 400 12px/1.5 var(--mono); margin-top: 2px; }
.dr-b { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.dr-sec > .label { display: block; margin-bottom: 10px; }
.dr-f { display: flex; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.tl li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
.tl li > span:first-child { color: var(--g2); font: 400 12px/1.6 var(--mono); }

/* toast */
#toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-3); color: var(--text); font-size: 13px; line-height: 1.45; display: none; gap: 10px; align-items: flex-start; }
#toast.show { display: flex; }
#toast .live-dot { margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1279.98px) {
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side { grid-template-columns: minmax(0, 1fr); }
  .stream .row { grid-template-columns: 56px minmax(0, 1fr) auto 40px; }
  .stream .r-id { display: none; }
}
@media (max-width: 1023.98px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; z-index: 40; width: min(300px, 86vw); }
  html.nav-open .side { transform: none; }
  html.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .6); }
  .nav a[aria-current="page"]::before { display: none; }
  .side .side-close { display: inline-flex; }
  .main { margin-left: 0; }
  .top { padding: 10px 24px; }
  .top .menu-btn { display: inline-flex; }
  .page { padding: 24px 24px 40px; gap: 24px; }
  .foot-in { padding: 16px 24px; }
  .g-2, .g-2e { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .big-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big-stats > div:nth-child(3) { border-left: 0; }
  .big-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rep-head { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 759.98px) {
  .top { padding: 8px 16px; gap: 8px; }
  .top .kill { display: none; }
  .top-actions .btn .lbl { display: none; }
  .top-actions .btn { padding: 0; width: var(--ctl-h); }
  .page { padding: 16px 16px 32px; gap: 20px; }
  .foot-in { padding: 14px 16px; }
  .g-3 { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 16px; }
  .kpi .k-v { font-size: 22px; }
  .kpi.hero .k-v { font-size: 32px; }
  .panel-h, .panel-b { padding-left: 16px; padding-right: 16px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; gap: 12px; }
  .row .r-time { display: none; }
  .stream .row { grid-template-columns: minmax(0, 1fr) auto; }
  .stream .r-conf { display: none; }
  .compare { grid-template-columns: minmax(0, 1fr); }
  .toolbar { padding: 12px 16px; }
  .toolbar select { flex: 1 1 140px; }
  .rule { padding: 14px 16px; }
  .bar-row, .axis { grid-template-columns: 84px minmax(0, 1fr) 56px; gap: 8px; }
  .rep-head, .rep-sec { padding: 20px 16px; }
  .rep-head h2 { font-size: 22px; }
  .big-stats .v { font-size: 22px; }
  .big-stats > div { padding: 14px; }
  .daychart, .daylabels { gap: 6px; }
  /* tables become cards */
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
  .tbl.cards td { padding: 0; border: 0; }
  .tbl.cards td.t-req, .tbl.cards td.t-full { grid-column: 1 / -1; max-width: none; }
  .tbl.cards td.t-hide { display: none; }
  .tbl-foot { padding: 12px 16px; }
  #toast { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .dr-h, .dr-b, .dr-f { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 1700px) {
  .page, .foot-in { max-width: 1640px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.k3 .kpi { border-top: 0; border-left: 1px solid var(--line); padding: 14px 16px; }
.kpis.k3 .kpi:first-child { border-left: 0; }

/* ---------- v3: simpler pages ---------- */
.nav { gap: 2px; }
.nav-sep { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.top { gap: 12px; }
h1.top-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-h h2 { font-size: 14px; font-weight: 600; }
.panel-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi .k-v a { text-decoration: none; border-bottom: 1px solid var(--g2); }
.kpi .k-v a:hover { border-color: var(--text); }
.g-live { grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); align-items: start; }

/* shared search + filters */
.filters { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, minmax(0, 150px)); gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.filters input, .filters select { width: 100%; min-width: 0; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--g2); font-size: 12px; }
.empty span { display: block; margin-bottom: 14px; }

/* collapsibles */
details.more { border-top: 1px solid var(--line); }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 44px; font: 500 11.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--g1); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; width: 14px; color: var(--g2); font-size: 14px; }
details.more[open] > summary::before { content: "−"; }
details.more > summary:hover { color: var(--text); }
details.more > summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.more-b { padding: 4px 0 16px; }
.page > details.more { border: 1px solid var(--line); border-radius: var(--r); padding: 0 20px; }
.ctl details.more, .panel-b details.more, .appr details.more, .dr-b details.more { border-top: 0; }
.ctl details.more > summary { min-height: 32px; }
.rep-sec details.more:first-child { border-top: 0; }

/* network diagram v3 */
.netmap .nd rect { fill: var(--bg); stroke: var(--line-2); }
.netmap .nd.gate rect { stroke: var(--g1); }
.netmap .nd.is-off rect { stroke-dasharray: 3 3; }
.netmap .nd.is-off text { fill: var(--g2); }
.netmap .nd .t { font-family: var(--sans); font-size: 14px; font-weight: 600; fill: var(--text); }
.netmap .nd .s { font-size: 11px; fill: var(--g2); }
.netmap .nd .c { font-size: 15px; font-weight: 500; fill: var(--text); }
.netmap .nd .gl { fill: var(--text); }
.netmap .nd .gl-ext { fill: none; stroke: var(--text); stroke-dasharray: 2 1.5; }
.netmap .nd .gl-person { fill: none; stroke: var(--text); stroke-width: 1.3; }
.netmap .zone-l { font-size: 10px; }

/* route */
.sample { grid-template-columns: minmax(0, 1fr) auto; }
.compose-foot { justify-content: flex-end; }

/* approvals */
.why { border-left-width: 1px; color: var(--g1); }
.appr-actions { align-items: center; }
.appr-as { margin-left: auto; min-width: 0; max-width: 220px; }

/* auditor */
.ctl-list { display: flex; flex-direction: column; }
.ctl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px 20px; border-top: 1px solid var(--line); }
.ctl:first-child { border-top: 0; }
.ctl-main b { display: block; font-weight: 500; }
.ctl-main small { display: block; color: var(--g2); font: 400 11.5px/1.5 var(--mono); margin-top: 2px; }
.ctl .ctl-rec { margin-top: 4px; }
p.disclaimer { margin: 0; }

/* rules */
.rule { padding: 14px 20px; }
.rule h3 { font-size: 13.5px; font-weight: 500; }
.rule-th { grid-template-columns: minmax(0, 1fr); }
.rule-th .slider-row { margin-top: 8px; }
.rules-act { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.sim-row { grid-template-columns: minmax(0, 1fr) auto; }
.sim-move { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.changes { padding-bottom: 4px; }

/* report */
.rep-head { align-items: center; }
.rep-head h2 { max-width: 30ch; }
.rep-sec > h3 { font-size: 14px; }

@media (max-width: 1279.98px) {
  .g-live { grid-template-columns: minmax(0, 1fr); }
  .g-live > .panel:last-child { max-width: 560px; }
}
@media (max-width: 759.98px) {
  .top .kill { display: inline-flex; padding: 0 8px; gap: 6px; font-size: 11px; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 16px; }
  .filters input { grid-column: 1 / -1; }
  .filters select { font-size: 12.5px; padding: 0 22px 0 8px; background-position: right 4px center; }
  .list-foot { padding: 12px 16px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis .kpi { border-top: 0; border-left: 1px solid var(--line); padding: 14px 12px; }
  .kpis .kpi:first-child { border-left: 0; }
  .kpis .kpi .k-v { font-size: 22px; }
  .kpis .kpi.hero .k-v { font-size: 26px; }
  .kpis .label { font-size: 10px; letter-spacing: .06em; }
  .ctl { padding: 14px 16px; gap: 10px; }
  .rule { padding: 14px 16px; }
  .appr-as { margin-left: 0; max-width: none; flex: 1 1 100%; }
  .sim-row { grid-template-columns: minmax(0, 1fr); }
  .sim-move { justify-content: flex-start; }
  .page > details.more { padding: 0 16px; }
}
@media (max-width: 1023.98px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 1px solid var(--line); }
  .kpi:nth-child(n+3) { border-top: 0; }
}
@media (min-width: 1280px) { .g-live > .panel:last-child { position: sticky; top: calc(var(--lab-bar-h, 0px) + var(--top-h) + 24px); } }
.m-wait { display: none; color: var(--text); }
@media (max-width: 759.98px) { .stream .tier em { display: none; } .m-wait { display: inline; } }

/* ---------- coding org ---------- */
.textbox.code, textarea.code { font: 400 12.5px/1.6 var(--mono); }
.textbox.code { white-space: pre-wrap; }
.files-line { margin-top: 10px; font-size: 12px; color: var(--g1); line-height: 1.8; overflow-wrap: anywhere; }
.files-line .label { margin-right: 6px; }
.files-line .mono { color: var(--text); font-size: 11.5px; }
.br { border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.br-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; width: 100%; }
.br-h b { display: block; font-weight: 500; margin-top: 4px; }
.br-st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 1px; font: 500 11px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; border: 1px solid var(--g1); }
.br-st.s-approved { background: var(--text); color: var(--bg); border-color: var(--text); }
.br-st.s-changes-requested { border-style: dashed; color: var(--g1); }
.br-st.s-capturing::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.br-panel { width: 100%; padding: 12px 14px; background: var(--bg-2); border-left: 1px solid var(--g1); font-size: 13px; color: var(--g1); }
.br-panel ul { margin: 8px 0 0; padding-left: 18px; color: var(--text); }
.br-panel li { margin: 2px 0; }
.br details.more { width: 100%; border-top: 1px solid var(--line); }
pre.json { margin: 0; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); font: 400 11.5px/1.55 var(--mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow-y: auto; }
.br-line { display: flex; align-items: center; gap: 10px; }
.filters.has-repo { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filters.has-repo input { grid-column: 1 / -1; }
@media (max-width: 759.98px) {
  .filters.has-repo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .br-h { flex-direction: column; }
}
.panel-h .inline-row { min-width: 0; max-width: 100%; }
#fwSel { max-width: 100%; min-width: 0; text-overflow: ellipsis; }

/* ---------- tools: permissions grid, change alerts ---------- */
.nav .count.acc { border-color: var(--accent); color: var(--accent); }
.panel > details.more { border-top: 0; padding: 0 20px; }
@media (max-width: 759.98px) { .panel > details.more { padding: 0 16px; } }
a.notice { color: var(--text); text-decoration: none; }
a.notice:hover { background: var(--bg-2); }
.perm { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-width: 58px; min-height: 30px; padding: 0 6px; border-radius: 1px; font: 500 10.5px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; background: transparent; color: var(--text); font-style: normal; border: 0; }
.perm.p-allow { background: var(--text); color: var(--bg); border: 1px solid var(--text); }
.perm.p-ask { border: 1px solid var(--g1); }
.perm.p-block { border: 1px dashed var(--g3); color: var(--g2); }
.perm.p-held { border: 1px dashed var(--accent); color: var(--accent); cursor: not-allowed; }
button.perm:hover { outline: 1px solid var(--g1); outline-offset: 1px; }
.perm-legend { display: flex; gap: 14px; flex-wrap: wrap; font: 400 12px/1 var(--mono); color: var(--g1); }
.perm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.perm-legend .perm { width: auto; min-width: 0; min-height: 20px; cursor: default; }
.perm-wrap { overflow-x: auto; }
table.perm-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.perm-grid th, .perm-grid td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.perm-grid .pg-server { font: 500 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--g1); border-left: 1px solid var(--line); padding: 12px 6px 6px; white-space: normal; vertical-align: bottom; }
.perm-grid td { width: 64px; }
.perm-grid .pg-tool { font: 400 11px/1.3 var(--mono); color: var(--g2); }
.perm-grid th.pg-agent { position: sticky; left: 0; z-index: 1; background: var(--bg); text-align: left; padding: 8px 14px 8px 20px; min-width: 170px; border-right: 1px solid var(--line); font-weight: 400; }
.perm-grid thead th.pg-agent { font: 500 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--g2); }
.perm-grid tbody th.pg-agent b { display: block; font-weight: 500; margin-bottom: 4px; }
.perm-grid tbody tr:last-child th, .perm-grid tbody tr:last-child td { border-bottom: 0; }
.alert { border-color: var(--accent); }
.alert h2.mono { font-size: 15px; margin-top: 4px; }
.diff { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); font: 400 12.5px/1.6 var(--mono); }
.diff .label { margin-bottom: 4px; }
.dl { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1px 6px; }
.dl.same { color: var(--g2); }
.dl.del { color: var(--g1); text-decoration: line-through; text-decoration-color: var(--g2); }
.dl.add { color: var(--text); background: var(--bg-3); border-left: 2px solid var(--accent); }
.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.server { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.server b { font-weight: 500; }
.srv-tool { display: flex; flex-direction: column; font-size: 12px; }
.srv-tool .mono { font-size: 11.5px; overflow-wrap: anywhere; }
@media (max-width: 759.98px) {
  .perm-grid th.pg-agent { min-width: 132px; padding-left: 16px; }
  .perm { min-width: 52px; min-height: 36px; }
  .servers { grid-template-columns: minmax(0, 1fr); }
}
