/* Tuskar dashboard (layer 6), the demo cut (docs/research/2026-10-28-tuskar-demo-story). The PM prototype's styles
   (docs/pm/Control Tower/tuskar-control-tower.html), kept to what the agent view uses.
   Dark by default; light when the system asks for it (REQ-UI-009), or when the viewer
   picks one with the appearance chips, which set data-ui on <html>. Charts are SVG
   coloured through these same properties, so a change of appearance needs no redraw. */

/* The prototype's faces, served from fonts/ rather than Google Fonts, so the console makes no
   third-party request and works offline. Latin subsets; Archivo and IBM Plex Sans are variable
   (one file, every weight). SIL Open Font License 1.1: fonts/OFL*.txt. */
@font-face{font-family:"Archivo"; font-style:normal; font-weight:500 700; font-display:swap; src:url(fonts/archivo.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Sans"; font-style:normal; font-weight:400 600; font-display:swap; src:url(fonts/ibm-plex-sans.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono"; font-style:normal; font-weight:400; font-display:swap; src:url(fonts/ibm-plex-mono-400.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono"; font-style:normal; font-weight:500; font-display:swap; src:url(fonts/ibm-plex-mono-500.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono"; font-style:normal; font-weight:600; font-display:swap; src:url(fonts/ibm-plex-mono-600.woff2) format("woff2")}

:root{
  color-scheme: dark;
  --ground:#0e1116;
  --surface:#161a21;
  --surface-2:#1d222b;
  --surface-3:#242a35;
  --line:#262c37;
  --line-2:#333a47;
  --ink:#e8ecf2;
  --ink-2:#97a1b0;
  --ink-3:#616c7d;
  --accent:#35c2c8;
  --accent-2:#1c6e72;
  --accent-hi:#4ad4da;
  --accent-wash:rgba(53,194,200,0.10);
  --on-accent:#04191a;
  --good:#0ca30c;
  --warn:#fab219;
  --serious:#ec835a;
  --crit:#d03b3b;
  --good-t:#4fd44f;
  --warn-t:#fab219;
  --ser-t:#ec835a;
  --crit-t:#ef6a6a;
  --good-bg:rgba(12,163,12,0.13);  --good-bd:rgba(12,163,12,0.30);
  --warn-bg:rgba(250,178,25,0.12); --warn-bd:rgba(250,178,25,0.28);
  --ser-bg:rgba(236,131,90,0.12);  --ser-bd:rgba(236,131,90,0.28);
  --crit-bg:rgba(208,59,59,0.14);  --crit-bd:rgba(208,59,59,0.34);
  --ac-bg:rgba(53,194,200,0.10);   --ac-bd:rgba(53,194,200,0.30);
  --wash:rgba(255,255,255,0.028);
  --wash-2:rgba(255,255,255,0.014);
  --top-bg:rgba(14,17,22,0.93);
  --tip-bg:#05070a;
  --tip-ink:#e8ecf2;
  --scrim-bg:rgba(6,8,11,0.60);
  --tile-crit-bd:rgba(208,59,59,0.42);
  --trade-bg:rgba(236,131,90,0.055); --trade-bd:rgba(236,131,90,0.28);
  --s1:#3987e5;
  --s2:#d95926;
  --s3:#199e70;
  --s4:#9085e9;
  --s5:#d55181;
  /* System fonts: no third-party request from an operator console, nothing to wait for offline. */
  --sans:"IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display:"Archivo", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r:6px;
}

@media (prefers-color-scheme: light){
  :root:not([data-ui="dark"]){
  color-scheme: light;
  --ground:#f1f3f6;
  --surface:#ffffff;
  --surface-2:#f7f9fb;
  --surface-3:#e9edf2;
  --line:#e2e6ec;
  --line-2:#c8cfd8;
  --ink:#131820;
  --ink-2:#525d6c;
  --ink-3:#79838f;
  --accent:#0e8b91;
  --accent-2:#0e8b91;
  --accent-hi:#0b767b;
  --accent-wash:rgba(14,139,145,0.09);
  --on-accent:#ffffff;
  --good:#0ca30c;
  --warn:#f0a505;
  --serious:#e06a34;
  --crit:#d03b3b;
  --good-t:#067806;
  --warn-t:#8a5e00;
  --ser-t:#a8481a;
  --crit-t:#bd2626;
  --good-bg:rgba(12,163,12,0.10);  --good-bd:rgba(12,163,12,0.32);
  --warn-bg:rgba(250,178,25,0.18); --warn-bd:rgba(200,140,10,0.42);
  --ser-bg:rgba(236,131,90,0.14);  --ser-bd:rgba(196,96,55,0.36);
  --crit-bg:rgba(208,59,59,0.09);  --crit-bd:rgba(208,59,59,0.30);
  --ac-bg:rgba(14,139,145,0.10);   --ac-bd:rgba(14,139,145,0.32);
  --wash:rgba(19,24,32,0.030);
  --wash-2:rgba(19,24,32,0.018);
  --top-bg:rgba(241,243,246,0.93);
  --tip-bg:#ffffff;
  --tip-ink:#131820;
  --scrim-bg:rgba(19,24,32,0.40);
  --tile-crit-bd:rgba(208,59,59,0.34);
  --trade-bg:rgba(236,131,90,0.10); --trade-bd:rgba(196,96,55,0.32);
  --s1:#2a78d6;
  --s2:#eb6834;
  --s3:#199e70;
  --s4:#4a3aa7;
  --s5:#d55181;
}
}
:root[data-ui="light"]{
  color-scheme: light;
  --ground:#f1f3f6;
  --surface:#ffffff;
  --surface-2:#f7f9fb;
  --surface-3:#e9edf2;
  --line:#e2e6ec;
  --line-2:#c8cfd8;
  --ink:#131820;
  --ink-2:#525d6c;
  --ink-3:#79838f;
  --accent:#0e8b91;
  --accent-2:#0e8b91;
  --accent-hi:#0b767b;
  --accent-wash:rgba(14,139,145,0.09);
  --on-accent:#ffffff;
  --good:#0ca30c;
  --warn:#f0a505;
  --serious:#e06a34;
  --crit:#d03b3b;
  --good-t:#067806;
  --warn-t:#8a5e00;
  --ser-t:#a8481a;
  --crit-t:#bd2626;
  --good-bg:rgba(12,163,12,0.10);  --good-bd:rgba(12,163,12,0.32);
  --warn-bg:rgba(250,178,25,0.18); --warn-bd:rgba(200,140,10,0.42);
  --ser-bg:rgba(236,131,90,0.14);  --ser-bd:rgba(196,96,55,0.36);
  --crit-bg:rgba(208,59,59,0.09);  --crit-bd:rgba(208,59,59,0.30);
  --ac-bg:rgba(14,139,145,0.10);   --ac-bd:rgba(14,139,145,0.32);
  --wash:rgba(19,24,32,0.030);
  --wash-2:rgba(19,24,32,0.018);
  --top-bg:rgba(241,243,246,0.93);
  --tip-bg:#ffffff;
  --tip-ink:#131820;
  --scrim-bg:rgba(19,24,32,0.40);
  --tile-crit-bd:rgba(208,59,59,0.34);
  --trade-bg:rgba(236,131,90,0.10); --trade-bd:rgba(196,96,55,0.32);
  --s1:#2a78d6;
  --s2:#eb6834;
  --s3:#199e70;
  --s4:#4a3aa7;
  --s5:#d55181;
}

*{box-sizing:border-box}
body{
  margin:0; background:var(--ground); color:var(--ink);
  font-family:var(--sans); font-size:14px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
button{font-family:inherit; font-size:inherit; color:inherit; background:none; border:0; cursor:pointer}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:3px}
h1,h2,h3,h4{margin:0; font-family:var(--display); font-weight:600; letter-spacing:-0.01em; text-wrap:balance}
.eyebrow{
  font-family:var(--display); font-size:10.5px; font-weight:600; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--ink-3);
}
.sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}

/* ---------- shell ---------- */
.app{display:grid; grid-template-columns:220px minmax(0,1fr); min-height:100vh}
.side{
  border-right:1px solid var(--line); background:var(--surface);
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
}
.brand{display:flex; align-items:center; padding:20px 20px 18px}
/* Two logos: white ink for the dark theme (the default), the coloured one for light. */
.brand-logo{display:block; width:100%; max-width:172px; height:auto}
.brand-logo.on-light{display:none}
:root[data-ui="light"] .brand-logo.on-dark{display:none}
:root[data-ui="light"] .brand-logo.on-light{display:block}
@media (prefers-color-scheme: light){
  :root:not([data-ui="dark"]) .brand-logo.on-dark{display:none}
  :root:not([data-ui="dark"]) .brand-logo.on-light{display:block}
}
.nav{display:flex; flex-direction:column; gap:2px; padding:4px 12px}
.nav button{
  display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  padding:9px 10px; border-radius:var(--r); color:var(--ink-2); font-weight:500;
}
.nav button:hover{background:var(--surface-2); color:var(--ink)}
.nav button[aria-current="true"]{background:var(--accent-wash); color:var(--ink)}
.nav .ic{width:16px; display:grid; place-items:center; color:var(--ink-3)}
.nav button[aria-current="true"] .ic{color:var(--accent)}
.nav .n{margin-left:auto; min-width:2ch; text-align:right; font-size:12px; color:var(--ink-3); font-variant-numeric:tabular-nums}
.side-foot{margin-top:auto; border-top:1px solid var(--line); padding:14px 18px 18px}
.log-btn{
  display:flex; width:100%; gap:8px; align-items:center; padding:9px 11px;
  border:1px solid var(--line); border-radius:var(--r); color:var(--ink-2); font-size:13px;
}
.log-btn:hover{border-color:var(--line-2); color:var(--ink)}
.log-btn .n{margin-left:auto; color:var(--ink-3); font-variant-numeric:tabular-nums}
.who-line{font-size:12px; color:var(--ink-3); margin-top:12px; line-height:1.45}
.who-line b{color:var(--ink-2); font-weight:500}

.main{display:flex; flex-direction:column; min-width:0}
.top{
  position:sticky; top:0; z-index:20; background:var(--top-bg);
  backdrop-filter:blur(8px); border-bottom:1px solid var(--line); padding:20px 32px 18px;
}
.top-row{display:flex; align-items:center; gap:20px; flex-wrap:wrap}
.top h1{font-size:22px}
.top .sub{color:var(--ink-2); font-size:13px; margin-top:4px}
.asat{color:var(--ink-3); margin-left:6px}
.asat:not(:empty)::before{content:"·"; margin-right:8px}
.filters{display:flex; gap:8px; align-items:center; margin-left:auto}
.sel select{
  font:inherit; font-size:13px; color:var(--ink); background:var(--surface);
  border:1px solid var(--line-2); border-radius:var(--r); padding:7px 30px 7px 11px; cursor:pointer;
  appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,var(--ink-3) 50%),linear-gradient(135deg,var(--ink-3) 50%,transparent 50%);
  background-position:calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size:5px 5px; background-repeat:no-repeat;
}
.sel select:hover{border-color:var(--ink-3)}
.mode{width:34px; height:34px; display:grid; place-items:center; border:1px solid var(--line-2);
  border-radius:var(--r); color:var(--ink-2); background:var(--surface)}
.mode:hover{color:var(--ink); border-color:var(--ink-3)}
.mode svg{width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round}

.stage{display:grid; grid-template-columns:minmax(0,1fr) 340px; align-items:start}
.canvas{padding:28px 32px 64px; min-width:0; display:flex; flex-direction:column; gap:24px}
.rail{
  border-left:1px solid var(--line); background:var(--surface); position:sticky; top:85px;
  max-height:calc(100vh - 85px); min-height:calc(100vh - 85px); overflow:auto;
  padding:24px 20px 40px; display:flex; flex-direction:column; gap:12px;
}

/* ---------- primitives ---------- */
.panel{background:var(--surface); border:1px solid var(--line); border-radius:10px}
.panel-h{padding:18px 20px 0; display:flex; align-items:baseline; gap:12px; flex-wrap:wrap}
.panel-h h3{font-size:15px}
.panel-h .note{margin-left:auto; font-size:12px; color:var(--ink-3)}
.panel-b{padding:14px 20px 20px}
/* The agent list's filters and sort (change 2): one wrapping row, usable at phone width. */
.list-bar{display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:14px 20px 0}
.list-bar .q{
  font:inherit; font-size:13px; color:var(--ink); background:var(--surface); flex:1 1 14em; min-width:0;
  border:1px solid var(--line-2); border-radius:var(--r); padding:7px 11px;
}
.list-bar .q:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
.list-bar .sel{flex:0 1 auto; min-width:0}
.list-bar .sel select{max-width:100%}
.list-count{font-size:12px; color:var(--ink-3); font-variant-numeric:tabular-nums}
.panel-b.flush{padding:12px 0 4px}
.grid{display:grid; gap:16px}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g3.tight{gap:10px}

/* tiles */
.tile{background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:18px 20px 18px}
.tile .k{font-size:13px; color:var(--ink-2); font-weight:500}
.tile .v{font-family:var(--display); font-size:34px; font-weight:600; letter-spacing:-0.02em;
  margin-top:8px; line-height:1; font-variant-numeric:tabular-nums}
.tile .v .of{font-size:18px; color:var(--ink-3); font-weight:500; letter-spacing:0}
.tile .v .nd{font-family:var(--sans); font-size:14px; letter-spacing:0}
.tile .m{font-size:12.5px; color:var(--ink-3); margin-top:8px}
.tile.crit{border-color:var(--tile-crit-bd)}
.tile.crit .v{color:var(--crit-t)}
.tile.warn .v{color:var(--warn-t)}
.tile.good .v{color:var(--good-t)}
.g3.tight .tile{padding:13px 14px}
.g3.tight .tile .k{font-size:12px}
.g3.tight .tile .v{font-size:24px; margin-top:6px}

/* status */
.pill{
  display:inline-flex; align-items:center; gap:6px; padding:2px 9px 2px 8px; border-radius:100px;
  font-size:12px; font-weight:500; white-space:nowrap; border:1px solid transparent;
}
.pill::before{content:""; width:6px; height:6px; border-radius:50%; background:currentColor; flex:none}
.pill.ok{color:var(--good-t); background:var(--good-bg); border-color:var(--good-bd)}
.pill.wa{color:var(--warn-t); background:var(--warn-bg); border-color:var(--warn-bd)}
.pill.cr{color:var(--crit-t); background:var(--crit-bg); border-color:var(--crit-bd)}
.pill.nu{color:var(--ink-2); background:var(--surface-2); border-color:var(--line)}
.pill.ac{color:var(--accent); background:var(--ac-bg); border-color:var(--ac-bd)}
.pill.hd{color:var(--ink-2); background:transparent; border-style:dashed; border-color:var(--line-2)}
.state{display:flex; flex-direction:column; gap:4px; align-items:flex-start}
.state .sec{white-space:nowrap}
.tag{
  display:inline-block; padding:1px 7px; border-radius:4px; font-size:11.5px; font-weight:500;
  background:var(--surface-3); color:var(--ink-2); white-space:nowrap;
}
/* DR-15: controls enforced at the gateway, not only requested of the agent. */
.tag.gw{background:var(--ac-bg); color:var(--accent-hi); box-shadow:inset 0 0 0 1px var(--ac-bd)}
.plat{display:inline-block; padding:0 6px; border:1px solid var(--line-2); border-radius:4px;
  color:var(--ink-2); font-size:11px; line-height:17px; white-space:nowrap; font-weight:500}
.sec{color:var(--ink-3); font-size:12px}
.nd{color:var(--ink-3); font-style:italic; font-size:12px; white-space:nowrap}
.fig{font-variant-numeric:tabular-nums; font-weight:500}

/* tables */
.tw{overflow-x:auto}
table{width:100%; border-collapse:collapse; font-size:13px}
th{
  text-align:left; font-size:12px; color:var(--ink-3); font-weight:500; padding:0 14px 10px;
  border-bottom:1px solid var(--line); white-space:nowrap;
}
th.r,td.r{text-align:right}
td{padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle}
tbody tr:last-child td{border-bottom:0}
tr.click{cursor:pointer}
tr.click:hover td{background:var(--surface-2)}
td.num{font-variant-numeric:tabular-nums; font-weight:500}

/* ---------- the agent table ---------- */
table.fleet{min-width:740px}
table.fleet th:first-child, table.fleet td:first-child{padding-left:20px}
table.fleet th:last-child, table.fleet td:last-child{padding-right:20px}
table.fleet td.ag{min-width:220px}
table.fleet td.ag .nm{font-size:14px; font-weight:600; line-height:1.3}
table.fleet td.ag .sec{margin-top:5px; display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px}
table.fleet tr.sub td{background:var(--wash-2)}
table.fleet tr.sub td.ag{padding-left:44px; position:relative}
table.fleet tr.sub td.ag::before{content:""; position:absolute; left:28px; top:0; bottom:50%; width:10px;
  border-left:1px solid var(--line-2); border-bottom:1px solid var(--line-2); border-bottom-left-radius:4px}
table.fleet tr.sub td.ag .nm{font-size:13px; font-weight:500; color:var(--ink-2)}
td.hop-none{color:var(--ink-3); font-size:12px; font-style:italic}
.auto{display:flex; align-items:center; gap:10px; min-width:150px}
.auto .fig{width:38px; text-align:right}
.auto .bar{flex:1; max-width:110px; height:6px; border-radius:3px; background:var(--surface-3); overflow:hidden}
.auto .bar i{display:block; height:100%; border-radius:3px; background:var(--s3)}
.flag{display:inline-flex; align-items:center; gap:6px; font-size:12px; margin-top:6px; font-weight:500}
.flag i{width:6px; height:6px; border-radius:50%; background:currentColor}
.flag.cr{color:var(--crit-t)}
.flag.wa{color:var(--warn-t)}
.orch-x{display:flex; width:fit-content; align-items:center; gap:6px; margin-top:8px; padding:3px 9px;
  border-radius:5px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2);
  font-size:12px; font-weight:500}
.orch-x:hover{border-color:var(--accent); color:var(--accent)}
.orch-x svg{width:9px; height:9px; fill:none; stroke:currentColor; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round}

/* ---------- needs attention ---------- */
.rail-h{display:flex; align-items:center; gap:8px; padding:0 2px 4px}
.rail-h h2{font-size:15px}
.rail-h .n{margin-left:auto; min-width:22px; padding:1px 7px; border-radius:100px; text-align:center;
  font-size:12px; font-weight:600; background:var(--surface-3); color:var(--ink-2)}
.calm{border:1px dashed var(--line-2); border-radius:10px; padding:18px; color:var(--ink-2); font-size:13px}
.calm b{color:var(--good-t); font-weight:600}
.rec{
  border:1px solid var(--line); border-radius:10px; background:var(--surface);
  padding:14px 15px; display:flex; flex-direction:column; gap:8px;
}
.rec-top{display:flex; align-items:center; gap:8px}
.rec-top .dot{width:8px; height:8px; border-radius:50%}
.rec.cr .dot{background:var(--crit)}
.rec.wa .dot{background:var(--warn)}
.rec-top .sc{font-size:12px; color:var(--ink-3)}
.rec h4{font-size:14px; line-height:1.4; font-family:var(--sans); font-weight:400; color:var(--ink-2)}
.rec h4 span{color:var(--ink); font-weight:600}
.rec .ev{margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:3px}
.rec .ev li{font-size:12.5px; color:var(--ink-3)}
.rec-act{display:flex; gap:7px; align-items:center; margin-top:4px}
.btn{
  padding:7px 13px; border-radius:var(--r); font-size:13px; font-weight:500; white-space:nowrap;
  background:var(--accent); color:var(--on-accent); border:1px solid var(--accent);
}
.btn:hover{background:var(--accent-hi); border-color:var(--accent-hi)}
.btn.ghost{background:none; color:var(--ink-2); border-color:var(--line-2)}
.btn.ghost:hover{color:var(--ink); border-color:var(--ink-3)}
.btn.sm{padding:5px 10px; font-size:12.5px}
.btn[disabled]{opacity:0.5; cursor:default}

/* ---------- sheet ---------- */
.scrim{
  position:fixed; inset:0; background:var(--scrim-bg);
  z-index:60; opacity:0; pointer-events:none; transition:opacity .18s;
}
.scrim.on{opacity:1; pointer-events:auto}
.sheet{
  position:fixed; top:0; right:0; bottom:0; width:min(540px,94vw); z-index:70;
  background:var(--surface); border-left:1px solid var(--line-2); overflow:auto;
  transform:translateX(102%); transition:transform .22s cubic-bezier(.3,.8,.3,1);
  overscroll-behavior:contain;
}
.sheet.on{transform:none; box-shadow:-20px 0 50px rgba(0,0,0,0.32)}
/* While a sheet is open the page behind it holds still: one scroll bar, the sheet's own. */
html.sheet-open{overflow:hidden}
.sheet-h{
  position:sticky; top:0; background:var(--surface); border-bottom:1px solid var(--line);
  padding:20px 24px 16px; display:flex; gap:14px; align-items:flex-start; z-index:2;
}
.sheet-h h2{font-size:19px; line-height:1.3}
.sheet-h .eyebrow{margin-bottom:6px; display:flex; align-items:center; gap:8px; text-transform:none;
  letter-spacing:0; font-family:var(--sans); font-size:12.5px; font-weight:400; color:var(--ink-3)}
.x{
  margin-left:auto; width:30px; height:30px; border-radius:var(--r); display:grid; place-items:center;
  color:var(--ink-3); border:1px solid var(--line); flex:none;
}
.x:hover{color:var(--ink); border-color:var(--line-2)}
.sheet-b{padding:20px 24px 40px; display:flex; flex-direction:column; gap:22px}
.blk{display:flex; flex-direction:column; gap:10px}
.blk-h h3{font-size:14px}
.lede{margin:0; font-size:13px; color:var(--ink-2); line-height:1.5}
.lede .tag{margin-right:4px}
.diag{
  border:1px solid var(--line); border-radius:10px; padding:13px 15px; background:var(--surface-2);
  display:flex; flex-direction:column; gap:8px;
}
.diag .q{font-size:12px; color:var(--ink-3)}
.diag .a{font-size:13px; font-weight:500}
.diag .state{flex-direction:row; flex-wrap:wrap; align-items:center; gap:6px}
.diag.fl{background:var(--crit-bg); border-color:var(--crit-bd)}
.diag.fl .q{color:var(--crit-t); font-weight:600}
.diag.fl .a{font-weight:500; line-height:1.6}
.runs{margin:0; padding:0; list-style:none; border:1px solid var(--line); border-radius:10px; overflow:hidden}
.runs li{display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:6px 12px; padding:9px 14px;
  border-bottom:1px solid var(--line)}
.runs li:last-child{border-bottom:0}
.runs .ro{display:flex; flex-direction:column; align-items:flex-start; gap:4px; flex:0 1 auto; min-width:0}
.runs .why{font-size:12.5px; color:var(--ink-2)}
.runs .rm{display:flex; align-items:center; gap:12px; font-size:12px; margin-left:auto; min-width:0;
  color:var(--ink-3); white-space:nowrap; font-variant-numeric:tabular-nums}
.runs .case{color:var(--ink-2); font-weight:500; max-width:140px; overflow:hidden; text-overflow:ellipsis}
.sheet h2:focus{outline:none}
.reasons{display:flex; flex-direction:column; gap:9px}
.rs{display:grid; grid-template-columns:minmax(0,1.4fr) minmax(60px,1fr) 32px; gap:12px; align-items:center; font-size:13px}
.rs .rl{color:var(--ink-2)}
.rs .rb{height:6px; border-radius:3px; background:var(--surface-3); overflow:hidden}
.rs .rb i{display:block; height:100%; border-radius:3px; background:var(--s2)}
.rs .rb i.rule{background:var(--s1)}
.rs .rn{text-align:right; font-variant-numeric:tabular-nums; font-weight:500}
.mv{
  display:flex; gap:11px; padding:11px 13px; border:1px solid var(--line); border-radius:8px;
  background:var(--surface-2); align-items:flex-start;
}
.mv .mt{font-size:13px; font-weight:500}
.mv .md{font-size:12px; color:var(--ink-3); margin-top:2px}
.imp-tbl{display:flex; flex-direction:column; gap:1px; border:1px solid var(--line); border-radius:8px; overflow:hidden}
.chg{display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; gap:10px; align-items:center;
  padding:10px 13px; background:var(--surface-2); font-size:13px}
.chg .a{color:var(--ink-3); text-decoration:line-through}
.chg .ar{color:var(--ink-3)}
.chg .b{font-weight:600}
.trade{
  border:1px solid var(--trade-bd); background:var(--trade-bg);
  border-radius:8px; padding:12px 14px;
}
.trade ul{margin:0; padding-left:16px; display:flex; flex-direction:column; gap:6px}
.trade li{font-size:12.5px; color:var(--ink-2)}
.plain{margin:0; padding-left:16px; display:flex; flex-direction:column; gap:6px}
.plain li{font-size:13px; color:var(--ink-2)}
.plain .handoff-ends{margin-top:6px; gap:4px}
.handoff-ends label{display:inline-flex; gap:6px; align-items:center; cursor:pointer}
.proj{margin-top:4px}
.proj summary{cursor:pointer; color:var(--ink-2)}
.proj ul{margin:4px 0 0}
.sheet-f{
  position:sticky; bottom:0; background:var(--surface); border-top:1px solid var(--line);
  padding:14px 24px; display:flex; gap:10px; align-items:center;
}
.sheet-f .grow{margin-right:auto}
.field{display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--ink-2)}
.field input{
  font:inherit; color:var(--ink); background:var(--surface-2); border:1px solid var(--line-2);
  border-radius:var(--r); padding:7px 10px; font-size:13px;
}
.field input:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
/* The role script's two lines (connections contract §8): copyable, never wrapped mid-command. */
textarea.mono{
  width:100%; font-family:var(--mono); font-size:12px; color:var(--ink); background:var(--surface-2);
  border:1px solid var(--line-2); border-radius:var(--r); padding:8px 10px; resize:vertical;
  white-space:pre; overflow-x:auto;
}
textarea.mono:focus-visible{outline:2px solid var(--accent); outline-offset:1px}

/* The agent's control bar: the stop/start decision first and loudest. */
.sheet-f.ctlbar{flex-wrap:wrap; background:var(--surface-2)}
/* Two equal buttons, then the daily spend limit across the full width under them. */
.ctlbar .act{flex:1 1 0; justify-content:center}
.ctlbar .ig{flex:1 1 100%; margin-left:0}
.ctlbar .ig input{flex:1; width:auto}
.act{display:inline-flex; align-items:center; gap:8px; padding:9px 15px; border-radius:var(--r);
  font:inherit; font-size:13.5px; font-weight:600; cursor:pointer; border:1px solid transparent;
  transition:background .12s, border-color .12s, color .12s}
.act svg{width:11px; height:11px; fill:currentColor}
.act-stop{background:var(--crit); border-color:var(--crit); color:#fff}
.act-stop:hover{background:var(--crit-t); border-color:var(--crit-t)}
.act-go{background:var(--good); border-color:var(--good); color:#fff}
.act-go:hover{filter:brightness(1.1)}
.act-soft{background:var(--surface); border-color:var(--line-2); color:var(--ink)}
.act-soft:hover{border-color:var(--accent); color:var(--accent)}
.act-soft.on{background:var(--accent-wash); border-color:var(--accent); color:var(--accent)}
.ig{display:inline-flex; align-items:stretch; border:1px solid var(--line-2); border-radius:var(--r);
  background:var(--surface); overflow:hidden; font-size:13px; margin-left:auto}
.ig:focus-within{border-color:var(--accent)}
.ig-l{display:flex; align-items:center; padding:0 10px; color:var(--ink-2); background:var(--surface-3);
  border-right:1px solid var(--line-2); font-size:12.5px; cursor:default; user-select:none}
.ig input{font:inherit; font-size:13px; color:var(--ink); background:none; border:0; width:64px;
  padding:8px 8px; outline:none; font-variant-numeric:tabular-nums}
.ig-u{display:flex; align-items:center; padding-right:9px; color:var(--ink-3); font-size:12px;
  cursor:default; user-select:none}
.ig-b{font:inherit; font-size:12.5px; font-weight:600; border:0; border-left:1px solid var(--line-2);
  background:none; color:var(--accent); padding:0 12px; cursor:pointer}
.ig-b:hover{background:var(--accent-wash)}
.ig-x{font:inherit; border:0; border-left:1px solid var(--line-2); background:none; color:var(--ink-3);
  padding:0 9px; cursor:pointer}
.ig-x:hover{color:var(--crit-t)}

/* misc */
.toast{
  position:fixed; left:50%; bottom:26px; transform:translate(-50%,14px); z-index:95;
  background:var(--surface-3); border:1px solid var(--line-2); border-radius:8px; max-width:min(560px,92vw);
  padding:12px 16px; font-size:13px; opacity:0; pointer-events:none; transition:all .2s;
  box-shadow:0 12px 34px rgba(0,0,0,0.4);
}
.toast.on{opacity:1; transform:translate(-50%,0)}
.empty{padding:28px; text-align:center; color:var(--ink-3); font-size:13px}
.errbox{
  background:var(--surface); border:1px solid var(--crit-bd); border-radius:10px; padding:22px 24px;
  display:flex; flex-direction:column; gap:8px; max-width:640px;
}
.errbox h2{font-size:16px; color:var(--crit-t)}
.errbox p{margin:0; color:var(--ink-2)}

@media (max-width:1240px){
  .stage{grid-template-columns:minmax(0,1fr)}
  .rail{border-left:0; border-top:1px solid var(--line); position:static; max-height:none; min-height:0; padding:22px 32px 50px}
}
@media (max-width:820px){
  /* minmax(0, …): a plain 1fr grew to the widest child's min-content and pushed the page sideways. */
  .app{grid-template-columns:minmax(0,1fr); grid-template-rows:auto 1fr}
  .side{position:static; height:auto; flex-direction:row; align-items:center; border-right:0; border-bottom:1px solid var(--line); flex-wrap:wrap}
  /* The menu scrolls on its own row: it was ~630px wide and pushed the whole page sideways. */
  .nav{flex-direction:row; padding:0 10px 4px 0; flex:1 1 100%; min-width:0; overflow-x:auto; scrollbar-width:thin}
  .nav button{flex:0 0 auto; width:auto}
  .side{align-content:flex-start}
  .brand{padding:10px 14px}
  .brand-logo{width:120px}
  .side-foot{display:none}
  .canvas,.rail,.top{padding-left:16px; padding-right:16px}
  .g3{grid-template-columns:minmax(0,1fr)}
  .filters{margin-left:0}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important; animation:none!important}}
/* REQ-ENF-006: the gateway's cost beside the agent's own */
/* Two by two in the sheet: four across left the Agreement pill wider than its tile (18 Nov feedback). */
.gwc{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; margin-top:4px}
.gwc > div{display:flex; flex-direction:column; gap:3px; padding:8px 10px; border:1px solid var(--line);
  border-radius:8px; background:var(--surface); align-items:flex-start}
.gwc b{font-size:14px; font-weight:600; font-variant-numeric:tabular-nums}

/* ---------- organisational policy (org-policy §9): rules, departments, sources ---------- */
[hidden]{display:none!important}
.nav .pend{margin-left:auto; padding:0 7px; border-radius:100px; font-size:11px; font-weight:600;
  line-height:18px; color:var(--warn-t); background:var(--warn-bg); border:1px solid var(--warn-bd); white-space:nowrap}
/* Only a shown pill: a hidden one still matches `+`, which pulled the count left (18 Nov feedback). */
.nav .pend:not([hidden]) + .n{margin-left:6px}
.stage.solo{grid-template-columns:minmax(0,1fr)}
.stage.solo .rail{display:none}
.rail-sub{margin-top:14px}

/* rule cards */
.rules{display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px}
.rule{border:1px solid var(--line); border-radius:10px; background:var(--surface-2);
  padding:15px 16px 14px; display:flex; flex-direction:column; gap:11px}
.rule:hover{border-color:var(--line-2)}
.rule-top{display:flex; align-items:center; gap:8px; justify-content:space-between}
.rule h4{font-size:15px; line-height:1.35}
.scope{display:inline-flex; align-items:center; gap:7px; padding:2px 9px 2px 8px; border-radius:100px;
  font-size:12px; font-weight:500; white-space:nowrap; color:var(--ink); background:var(--surface);
  border:1px solid var(--line-2)}
.scope i{width:7px; height:7px; border-radius:2px; background:var(--accent)}
.scope.k-department i{background:var(--s1)}
.scope.k-risk_tier i{background:var(--s2)}
.scope.k-process i{background:var(--s4)}
.scope.k-installation i{background:var(--s3)}
.ctl{display:grid; grid-template-columns:auto minmax(0,1fr); gap:5px 14px; font-size:13px}
.ctl .ck{color:var(--ink-3); white-space:nowrap}
.ctl .cv{color:var(--ink); font-weight:500}
.rule-foot{display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap;
  border-top:1px solid var(--line); padding-top:10px; font-size:12px}
.reach{color:var(--ink-2)}
.reach b{font-family:var(--display); font-size:15px; color:var(--ink); font-variant-numeric:tabular-nums}
.rule-act{display:flex; gap:7px}
.btn.danger:hover{color:var(--crit-t); border-color:var(--crit-bd)}
.btn.danger-solid{background:var(--crit); border-color:var(--crit); color:#fff}
.btn.danger-solid:hover{background:var(--crit-t); border-color:var(--crit-t)}

/* the second-approver setting */
.setting{display:flex; gap:14px; align-items:flex-start; border:1px solid var(--line); border-radius:10px;
  padding:14px 15px; background:var(--surface-2)}
.setting .st{font-size:13.5px; font-weight:600; margin-bottom:3px}
.switch{flex:none; position:relative; width:38px; height:22px; border-radius:100px; margin-top:2px;
  background:var(--surface-3); border:1px solid var(--line-2); transition:background .15s, border-color .15s}
.switch i{position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%;
  background:var(--ink-2); transition:transform .15s, background .15s}
.switch[aria-checked="true"]{background:var(--accent); border-color:var(--accent)}
.switch[aria-checked="true"] i{transform:translateX(16px); background:var(--on-accent)}

/* forms in the sheet */
.fgrp{display:flex; flex-direction:column; gap:10px; padding-bottom:18px; border-bottom:1px solid var(--line)}
.fgrp:last-child{border-bottom:0; padding-bottom:0}
.fl{font-family:var(--display); font-size:13px; font-weight:600; color:var(--ink)}
.fl .sec{font-family:var(--sans); font-weight:400; margin-left:6px}
.frow{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px}
.frow.f3{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.4fr)}
.field select{
  font:inherit; color:var(--ink); background:var(--surface-2); border:1px solid var(--line-2);
  border-radius:var(--r); padding:7px 10px; font-size:13px; cursor:pointer;
}
.field select:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
.field .hint{font-size:11.5px; color:var(--ink-3)}
.field .ig.wide{margin-left:0; background:var(--surface-2)}
.field .ig.wide input{flex:1; width:auto; min-width:0; padding:7px 10px; border:0; background:none}
.field .ig.wide input.cur{flex:none; width:52px; border-left:1px solid var(--line-2); text-transform:uppercase;
  color:var(--ink-2)}
.chk{display:flex; align-items:center; gap:9px; font-size:13px; color:var(--ink); cursor:pointer}
.chk input{width:15px; height:15px; accent-color:var(--accent); margin:0}
.days{display:flex; flex-wrap:wrap; gap:6px}
.day{position:relative; cursor:pointer}
.day input{position:absolute; opacity:0; pointer-events:none}
.day span{display:inline-block; min-width:44px; text-align:center; padding:5px 8px; border-radius:var(--r);
  border:1px solid var(--line-2); background:var(--surface-2); color:var(--ink-2); font-size:12.5px; font-weight:500}
.day input:checked + span{background:var(--accent-wash); border-color:var(--accent); color:var(--accent)}
.day input:focus-visible + span{outline:2px solid var(--accent); outline-offset:2px}
.sheet-f .grow-l{margin-right:auto}

/* the policy in force, with where each value came from (§3.4) */
.pol{display:flex; flex-direction:column; border:1px solid var(--line); border-radius:8px; overflow:hidden}
.pol-row{display:grid; grid-template-columns:96px minmax(0,1fr) auto; gap:12px; align-items:center;
  padding:10px 13px; background:var(--surface-2); border-bottom:1px solid var(--line); font-size:13px}
.pol-row:last-child{border-bottom:0}
.pol-row .pk{color:var(--ink-3)}
.pol-row .pv{font-weight:500; display:flex; flex-direction:column; gap:2px}
.pol-row .pv .sec{font-weight:400}
.pol-row .ps{display:flex; flex-direction:column; align-items:flex-end; gap:4px}
.src{display:inline-block; padding:1px 8px; border-radius:4px; font-size:11.5px; font-weight:500; white-space:nowrap}
.src.rule{background:var(--ac-bg); color:var(--accent-hi); box-shadow:inset 0 0 0 1px var(--ac-bd)}
.src.own{background:var(--surface-3); color:var(--ink-2)}
.place{display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end}
.place .field{flex:1; min-width:150px}
/* Retire and the retired list, department rename/delete (18 Nov demo feedback). */
.retire-row{display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; justify-content:space-between}
.retire-row .sec{flex:1 1 260px; min-width:0}
td.nowrap{white-space:nowrap}
td.nowrap .btn + .btn{margin-left:6px}
details.retired > summary{cursor:pointer; list-style:none}
details.retired > summary::-webkit-details-marker{display:none}
details.retired > summary h3::before{content:"▸"; display:inline-block; width:1.1em; color:var(--ink-3); transition:transform .15s}
details.retired[open] > summary h3::before{transform:rotate(90deg)}
details.retired:not([open]) > summary{border-bottom:0}
/* Long names in chips and cards wrap rather than run past their card. */
.src, .tag, .plat, .scope{max-width:100%; white-space:normal; overflow-wrap:anywhere}
.rule h4, .pick b, table.fleet td.ag .nm{overflow-wrap:anywhere}
.tag.tier-high{background:var(--crit-bg); color:var(--crit-t)}
.tag.tier-medium{background:var(--warn-bg); color:var(--warn-t)}
.tag.tier-low{background:var(--good-bg); color:var(--good-t)}

/* the rule preview: each agent it reaches, and what changes for it */
.reach-ag{display:flex; flex-direction:column; gap:6px}
.reach-ag + .reach-ag{margin-top:6px}
.reach-ag .mt{font-size:13px; font-weight:600}
.blk-h h3 .sec{font-family:var(--sans); font-weight:400}
.diag.pend-d{background:var(--warn-bg); border-color:var(--warn-bd)}
.diag.pend-d .q{color:var(--warn-t); font-weight:600}
.panel.attn{border-color:var(--warn-bd)}
.panel-h .btn{margin-left:12px}
@media (max-width:820px){
  .frow,.frow.f3{grid-template-columns:minmax(0,1fr)}
  .pol-row{grid-template-columns:minmax(0,1fr)}
  .pol-row .ps{align-items:flex-start}
}

/* Trial workspace (connections contract §10, §11): the sample banner and tag, signing in, People. */
.banner{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:18px 32px 0;
  padding:9px 14px; border-radius:8px; font-size:13px; color:var(--ink);
  background:var(--warn-bg); border:1px solid var(--warn-bd);
}
.banner[hidden]{display:none}
.banner .btn{margin-left:auto}
.banner.quiet{background:none; border-color:var(--line); color:var(--ink-3); font-size:12px; padding:6px 14px}
/* Onboarding levels (change 1): a ladder, from grey (we only know of it) to green (a halt holds). */
.tag.lv{white-space:nowrap; cursor:help}
.tag.lv-declared{background:var(--surface-2); color:var(--ink-3); box-shadow:inset 0 0 0 1px var(--line)}
.tag.lv-observed{background:var(--surface-2); color:var(--ink-2); box-shadow:inset 0 0 0 1px var(--line-2)}
.tag.lv-cooperative{background:var(--ac-bg); color:var(--accent-hi); box-shadow:inset 0 0 0 1px var(--ac-bd)}
.tag.lv-enforced{background:var(--good-bg); color:var(--good-t); box-shadow:inset 0 0 0 1px var(--good-bd)}
.fleet th.sort button{all:unset; display:inline-flex; gap:4px; align-items:center; cursor:pointer;
  font:inherit; color:inherit; border-radius:3px}
.fleet th.sort button:hover{color:var(--ink)}
.fleet th.sort button:focus-visible{outline:2px solid var(--accent); outline-offset:-2px}
.fleet th.sort .arr{font-size:10px; color:var(--ink-3)}
.tag.sample{background:var(--warn-bg); color:var(--warn-t); box-shadow:inset 0 0 0 1px var(--warn-bd)}
.link-btn{background:none; border:0; padding:0; margin-left:4px; font:inherit; color:var(--accent); cursor:pointer}
.link-btn:hover{color:var(--accent-hi); text-decoration:underline}
.link-btn:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.field .as{font-size:13px; color:var(--ink); font-weight:500; padding:6px 0}
.signin{
  background:var(--surface); border:1px solid var(--line-2); border-radius:10px; padding:24px 26px;
  display:flex; flex-direction:column; gap:10px; max-width:560px;
}
.signin h2{font-size:17px; font-family:var(--display)}
.signin p{margin:0; color:var(--ink-2); line-height:1.5}
.signin .bad{color:var(--crit-t)}
.signin .good{color:var(--good-t)}
/* Tenancy W4a: email me a link, choosing a workspace, the header's picker */
.signin-email{display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap}
.signin-email input{min-width:220px}
/* Tenancy W4b2: start a trial, under the sign-in */
.signin.trial{margin-top:24px; padding-top:20px; border-top:1px solid var(--line)}
.signin-trial{display:flex; flex-direction:column; gap:10px; align-items:stretch; max-width:360px}
.signin-trial .btn{align-self:flex-start}
.ws-choices{display:flex; flex-direction:column; gap:8px; align-items:stretch}
.ws-choices .btn{justify-content:flex-start; text-align:left}
.ws-pick{display:flex; flex-direction:column; gap:4px; margin:4px 0}
.ws-pick select{font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line-2); border-radius:6px; padding:3px 6px; width:100%; max-width:100%; min-width:0}
@media (max-width:720px){ .banner{margin:12px 16px 0} }

/* Connections (connections contract §13) */
.bad{color:var(--crit-t)}
.picks{display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; margin-top:12px}
.pick{display:flex; flex-direction:column; gap:4px; text-align:left; padding:12px 14px; border:1px solid var(--line);
  border-radius:10px; background:var(--surface); color:var(--ink); font:inherit; cursor:pointer}
.pick span{font-size:12px; color:var(--ink-3)}
.pick:hover{border-color:var(--ac-bd)}
.pick:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
.pick.off{cursor:default; opacity:.55}
/* The connect form's two ways (Tuskar reads it / Run it yourself, contract §12e): the chosen one. */
.pick.on{border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent)}
.picks.two{grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); margin:0 0 6px}
/* A docker command: copyable, wrapped (one line, any shell). */
textarea.mono.wrap{white-space:pre-wrap; word-break:break-all}
.prose h3{font-size:14px; margin:18px 0 6px}
.prose h3:first-child{margin-top:0}
.prose p{margin:0 0 8px; font-size:13px; color:var(--ink-2); line-height:1.55; max-width:72ch}
.handoff{min-height:100vh; display:flex; align-items:flex-start; justify-content:center; padding:48px 16px; background:var(--ground)}
.handoff .signin{width:100%; max-width:560px}
.handoff .field{margin-top:4px}
.row-acts{display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; max-width:260px; margin-left:auto}
/* A connection's Manage menu: a popover in the top layer, so the table's scroll box can't clip it. */
.menu-btn{display:inline-flex; align-items:center}
/* The chevron is a rotated square's two sides; lifted 2px so the V, not the square, is centred. */
.menu-btn::after{content:""; width:6px; height:6px; margin-left:8px; border:solid currentColor;
  border-width:0 1.5px 1.5px 0; transform:translateY(-2px) rotate(45deg)}
.menu-pop{position:fixed; inset:auto; margin:0; min-width:180px; padding:4px; background:var(--surface);
  border:1px solid var(--line-2); border-radius:var(--r); box-shadow:0 8px 24px rgb(0 0 0 / .14)}
.menu-pop:popover-open{display:flex; flex-direction:column}
.menu-pop button{font:inherit; font-size:13px; text-align:left; background:none; border:0; border-radius:4px;
  padding:7px 10px; color:var(--ink); cursor:pointer}
.menu-pop button:hover, .menu-pop button:focus-visible{background:var(--surface-3); outline:none}
.menu-pop button.danger{color:var(--crit-t)}
.menu-pop button.danger:not(:first-child){border-top:1px solid var(--line); border-radius:0 0 4px 4px;
  margin-top:4px; padding-top:9px}
p.hint{font-size:11.5px; color:var(--ink-3); margin:0}
table.fleet.conns{min-width:0; width:100%}
table.fleet.conns td:last-child{width:240px}
.dest{font-size:13px; color:var(--ink); background:var(--warn-bg); border:1px solid var(--warn-bd); border-radius:8px; padding:8px 10px; margin:0}
/* Charts under the tiles and in the agent sheet: runs per day, why work comes back */
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (max-width:980px){ .g2{grid-template-columns:minmax(0,1fr)} }
.chart{display:block; overflow:visible}
/* A backstop: the panel's charts are drawn at its width (dockChartWidth), never stretched tall. */
.dock .chart{max-height:200px}
.chart .f-s1{fill:var(--s1)} .chart .f-s2{fill:var(--s2)} .chart .f-s3{fill:var(--s3)}
.chart .f-crit{fill:var(--crit)} .chart .f-track{fill:var(--surface-3); opacity:.55}
.chart .t-lbl{fill:var(--ink-2)} .chart .t-val{fill:var(--ink); font-family:var(--mono)}
.chart .t-dim{fill:var(--ink-3); font-family:var(--mono)}
.chart .l-grid{stroke:var(--line); stroke-width:1}
.chart .hit{fill:transparent; cursor:default}
.chart .hit:hover{fill:var(--wash)}
.lg{display:flex; gap:14px; flex-wrap:wrap; font-size:11px; color:var(--ink-2); padding-top:8px}
.lg span{display:flex; align-items:center; gap:6px}
.lg i{width:9px; height:9px; border-radius:2px; display:block}
.lg .sw-s1{background:var(--s1)} .lg .sw-s2{background:var(--s2)} .lg .sw-s3{background:var(--s3)}
.lg .sw-crit{background:var(--crit)}
.legend-note{font-size:11px; color:var(--ink-3); padding-top:6px}
.chart-tip{position:fixed; z-index:60; pointer-events:none; max-width:320px; padding:7px 10px;
  border-radius:6px; font-size:12px; line-height:1.4; background:var(--tip-bg); color:var(--tip-ink);
  border:1px solid var(--line); box-shadow:0 6px 18px rgba(0,0,0,.18)}
.chart .f-dim{fill:var(--ink-3); opacity:.7}
.chart .f-s4{fill:var(--s4)} .chart .f-s5{fill:var(--s5)}
.lg .sw-s4{background:var(--s4)} .lg .sw-s5{background:var(--s5)} .lg .sw-dim{background:var(--ink-3); opacity:.7}
/* Spend by model: two small switches in the panel head, wrapping under the title on a phone */
.seg-row{margin-left:auto; display:flex; gap:8px; flex-wrap:wrap}
.seg{display:inline-flex; border:1px solid var(--line-2); border-radius:var(--r); overflow:hidden}
.seg-b{font:inherit; font-size:12px; padding:4px 10px; background:none; color:var(--ink-2); border:0; cursor:pointer}
.seg-b + .seg-b{border-left:1px solid var(--line-2)}
.seg-b:hover{color:var(--ink)}
.seg-b.on{background:var(--surface-2); color:var(--ink); font-weight:600}
.seg-b:focus-visible{outline:2px solid var(--accent); outline-offset:-2px}

/* a connection's lookup (connections contract §18): value → department, fits the sheet */
table.lookup td{padding:10px 8px}
table.lookup th{padding:0 8px 8px}
table.lookup td:last-child{width:55%}
table.lookup select{
  font:inherit; color:var(--ink); background:var(--surface-2); border:1px solid var(--line-2);
  border-radius:var(--r); padding:6px 8px; font-size:13px; cursor:pointer; width:100%; min-width:0;
}
table.lookup select:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
table.lookup select:disabled{cursor:not-allowed; color:var(--ink-3)}

/* About this agent (the agent register, 19 Nov feedback): label beside value, stacked on a phone. */
.kv{display:grid; gap:6px; margin:0}
.kv-r{display:grid; grid-template-columns:150px minmax(0,1fr); gap:10px; font-size:13px}
.kv-r dt{color:var(--ink-3); margin:0}
.kv-r dd{margin:0; min-width:0; overflow-wrap:anywhere}
@media (max-width:560px){ .kv-r{grid-template-columns:minmax(0,1fr); gap:2px} }
fieldset.field{border:0; padding:0; margin:0; min-width:0; display:flex; flex-direction:column; gap:6px}
fieldset.field legend{padding:0; margin-bottom:4px}

/* ---------- the agent panel: docked under the list (change 5, 26 Nov feedback) ---------- */
/* One line for the name, platform, department, level and status; the buttons on its right. */
.sheet-h.ph{flex-wrap:wrap; padding:14px 20px 0; row-gap:8px; align-items:center}
.ph-t{flex:1 1 22em; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px}
.ph-t h2{font-size:18px; margin-right:4px; overflow-wrap:anywhere}
.ph-d{font-size:12.5px; color:var(--ink-3)}
.ph-t .state{display:contents}
.ph-a{flex:0 0 auto; display:flex; gap:8px; flex-wrap:wrap; margin-left:auto}
.ph-a .act{flex:0 1 auto}
/* The tabs scroll sideways on a narrow screen; the buttons above them stay in view. */
.tabs{flex:1 1 100%; display:flex; gap:2px; overflow-x:auto; scrollbar-width:thin; margin:0 -4px}
.tabs [role="tab"]{flex:0 0 auto; font:inherit; font-size:13.5px; padding:8px 14px 9px; background:none; border:0;
  border-bottom:2px solid transparent; color:var(--ink-3); cursor:pointer; white-space:nowrap}
.tabs [role="tab"]:hover{color:var(--ink)}
.tabs [role="tab"][aria-selected="true"]{color:var(--ink); border-bottom-color:var(--accent); font-weight:600}
.tabs [role="tab"]:focus-visible{outline:2px solid var(--accent); outline-offset:-2px}
.ownbar{display:flex; gap:10px; flex-wrap:wrap; align-items:stretch}
.ownbar .ig{margin-left:0}
/* The list keeps its own scroll while an agent is docked below it; the row shows which. */
.panel.docked .tw{max-height:min(42vh,420px); overflow:auto}
.panel.docked thead th{position:sticky; top:0; background:var(--surface); z-index:1}
table.fleet tr.sel td{background:var(--ac-bg)}
table.fleet tr.sel td.ag{box-shadow:inset 3px 0 0 var(--accent)}
.dock .sheet-h{position:static; border-radius:10px 10px 0 0}
.dock .sheet-b{padding:16px 20px 20px; gap:18px}
.panel-h .seg{margin-left:8px}
.panel-h .note + .seg{margin-left:12px}
.panel-h h3 + .seg, .panel-h .list-count + .seg{margin-left:auto}
.seg-n{color:var(--ink-3); font-weight:400; margin-left:2px}

/* On a computer the Agents screen fits the window: the page holds still, the list scrolls in
   the space above the panel and the panel scrolls below it (26 Nov feedback). */
@media (min-width:821px) and (min-height:560px){
  html.fit .app{height:100vh; min-height:0}
  html.fit .main{min-height:0; overflow:hidden}
  html.fit .stage{flex:1 1 auto; min-height:0; display:flex; align-items:stretch}
  html.fit .canvas{flex:1 1 auto; min-height:0; overflow:hidden; padding-top:20px; padding-bottom:20px; gap:16px}
  html.fit .canvas > .panel{display:flex; flex-direction:column; min-height:0}
  html.fit .canvas > .panel > .panel-b{flex:1 1 auto; min-height:0; display:flex; flex-direction:column}
  html.fit .canvas > .panel .tw{flex:1 1 auto; min-height:0; overflow:auto; max-height:none}
  html.fit .canvas > .panel thead th{position:sticky; top:0; background:var(--surface); z-index:1}
  /* The list as tall as its rows, up to about half; the panel takes the rest. */
  html.fit .canvas > .panel.docked{flex:0 1 auto; max-height:46%; min-height:170px}
  html.fit .canvas > .panel:not(.docked):not(.dock){flex:0 1 auto}
  html.fit .dock{flex:1 1 0; min-height:220px}
  html.fit .dock .sheet-b{flex:1 1 auto; min-height:0; overflow:auto}
  /* Bug 38698: a screen-reader label (.sr, absolute) inside a scroll box was placed against the
     page, not the box, so it escaped the box's clip and gave the page its own scroll bar. */
  html.fit .canvas .tw, html.fit .dock .sheet-b{position:relative}

  /* The divider (US-048-004): the list as tall as app.js's --list-h (its kept share of the
     height, inside both minimums), the panel the rest. The divider takes the gap's place. */
  html.fit .canvas:has(> .split){gap:0}
  html.fit .canvas:has(> .split) > .panel.docked{flex:0 0 var(--list-h, 60%); max-height:none; min-height:0}
  html.fit .canvas:has(> .split) > .dock{min-height:0}
  html.fit .split{display:block; flex:0 0 16px; position:relative; cursor:row-resize; touch-action:none; outline:0}
  html.fit .split::before{content:""; position:absolute; left:50%; top:6px; width:44px; height:4px;
    margin-left:-22px; border-radius:2px; background:var(--line-2); transition:background .12s}
  html.fit .split:hover::before, html.splitting .split::before{background:var(--ink-3)}
  html.fit .split:focus-visible{box-shadow:inset 0 0 0 2px var(--accent); border-radius:6px}
  html.fit .split:focus-visible::before{background:var(--accent)}
  html.splitting, html.splitting *{cursor:row-resize!important; user-select:none}
  /* A soft fade at the list's bottom edge while more rows are below. */
  html.fit .panel.docked .tw.more{mask-image:linear-gradient(to bottom, black calc(100% - 28px), transparent)}

  /* Too short for both minimums: the page scrolls, the list at its least and the panel whole. */
  html.fit.tight .app{height:auto; min-height:100vh}
  html.fit.tight .main, html.fit.tight .canvas{overflow:visible}
  html.fit.tight .canvas{gap:16px}
  html.fit.tight .split{display:none}
  html.fit.tight .canvas > .dock{flex:none}
  html.fit.tight .dock .sheet-b{overflow:visible}
}
/* No divider on a phone, or where the screen doesn't fit the window. */
.split{display:none}
