/* acd-agent-ui GUI v2 (D100): dark only (D100 note 5), in the style of the
   hunterx landing page (Thu, 2026-10-26): near-black surface, hairline
   borders, soft blue accent, rounded cards, a flowing border on what needs
   a person. Plain CSS, no inline styles, nothing fetched from outside (CSP
   self only): DM Sans and JetBrains Mono are vendored under /static/fonts.
   Severity uses colour plus a text label; actions use a word plus a shape. */
:root {
  --bg: #0a0b0d; --panel: #111216; --panel-2: #0c0d10; --raise: #16171c;
  --line: #ffffff14; --line-strong: #ffffff24; --tint: #ffffff08;
  --ink: #f4f6fb; --muted: #8b919c; --idle: #5b606b; --accent: #8fb0ff;
  --sev-critical: #f07a7a; --sev-high: #f0a35e; --sev-medium: #e9cf6c; --sev-low: #8fb0ff;
  --ok: #6fd3a6; --warn: #e9b45c; --bad: #f07a7a; --regress: #b39cf5;
  --sans: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r: 12px; --r-sm: 8px;
}
/* vendored fonts (OFL, static/fonts/SOURCES.txt), Latin subset */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("/static/fonts/DMSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("/static/fonts/JetBrainsMono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@property --flow-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
       background: radial-gradient(1200px 500px at 70% -10%, #8fb0ff12, transparent 60%) var(--bg) fixed; }
a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 22px; font-weight: 500; letter-spacing: -.01em; margin: 0 0 4px; }
h2 { font: 500 10.5px/1.4 var(--mono); margin: 0 0 12px; color: var(--muted); text-transform: uppercase;
     letter-spacing: .1em; }
h3 { font-size: 15px; font-weight: 500; margin: 12px 0 6px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.mono, pre, .uri { font-family: var(--mono); font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; }

/* shell: rail + status strip */
.app { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
.rail { background: #0c0d10cc; border-right: 1px solid var(--line); padding: 18px 10px;
        display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh;
        backdrop-filter: blur(8px); }
.rail .brand { font-weight: 600; padding: 0 10px 18px; letter-spacing: .02em; }
.rail .brand small { display: block; color: var(--muted); font: 400 10.5px var(--mono);
                     letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
.rail a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px;
          color: #f4f6fbbf; border-radius: var(--r-sm); border: 1px solid transparent;
          transition: background .25s var(--ease), border-color .25s var(--ease); }
.rail a:hover { background: var(--tint); color: var(--ink); }
.rail a.on { background: var(--tint); border-color: var(--line); color: var(--ink); }
.count { background: #f07a7a26; color: var(--bad); border: 1px solid #f07a7a66; border-radius: 999px;
         padding: 0 7px; font: 600 11px/18px var(--mono); }
.logout { margin-top: auto; padding: 14px 10px 0; display: flex; flex-direction: column; gap: 8px;
          border-top: 1px solid var(--line); }
.who { color: var(--muted); font: 11px var(--mono); overflow-wrap: anywhere; }
.main { min-width: 0; }
.strip { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; padding: 11px 24px;
         background: #0a0b0dcc; border-bottom: 1px solid var(--line); font-size: 13px;
         position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.strip b { font-weight: 500; }
.lbl { color: var(--muted); margin-right: 6px; text-transform: uppercase; font: 10.5px var(--mono);
       letter-spacing: .1em; }
.strip .right { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px;
       vertical-align: 1px; }
.d-ok { background: var(--ok); box-shadow: 0 0 0 3px #6fd3a61f; animation: pulse-dot 1.8s ease-in-out infinite; }
.d-warn { background: var(--warn); box-shadow: 0 0 0 3px #e9b45c1f; }
.d-bad { background: var(--bad); box-shadow: 0 0 0 3px #f07a7a1f; }
.d-off { background: var(--idle); }
@keyframes pulse-dot { 50% { opacity: .45; } }
main { padding: 24px; max-width: 1500px; }
main.bare { margin: 0 auto; }

/* tiles and cards */
.tiles { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.tile, .card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
               padding: 16px 18px; min-width: 0; position: relative;
               transition: border-color .3s var(--ease), background .3s var(--ease); }
.tile:hover, .card:hover { border-color: var(--line-strong); }
.card { margin: 0 0 14px; }
.tile p { margin: 6px 0; }
.big { font-size: 32px; font-weight: 400; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
       line-height: 1.15; }
.big-s { font-size: 18px; font-weight: 500; margin: 2px 0 10px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.barrow { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 2.5rem; gap: 10px; align-items: center; }
.barrow > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barsvg { width: 100%; height: 6px; display: block; border-radius: 3px; background: var(--tint); }
.bar-fill { fill: var(--accent); }
.spark { width: 100%; height: 36px; display: block; margin-top: 12px; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.costbar { width: 100%; height: 12px; display: block; margin: 8px 0; }
.cost-track { fill: var(--tint); } .cost-fill { fill: var(--ok); } .cost-warn { fill: var(--warn); }
.perbucket { width: 100%; height: 78px; display: block; margin-top: 12px; }
.axis { font: 10px var(--mono); fill: var(--muted); }
.sevrow, .agentrow { margin: 6px 0; }
.svcrow { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* flowing border: what waits for a person (open approvals, block requests) */
@keyframes flow-spin { to { --flow-a: 360deg; } }
.hot::before, .card-req::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--flow-a), transparent 0deg, transparent 290deg, #f07a7a00 300deg,
              #f07a7abf 342deg, #ffffffe6 350deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: flow-spin 9s linear infinite; }

/* severity chips, action shapes, chips */
.sev { display: inline-block; min-width: 70px; text-align: center; border-radius: 999px; padding: 0 8px;
       font: 600 10.5px/19px var(--mono); letter-spacing: .08em; border: 1px solid; }
.s-critical { color: var(--sev-critical); background: #f07a7a1f; border-color: #f07a7a59; }
.s-high { color: var(--sev-high); background: #f0a35e1f; border-color: #f0a35e59; }
.s-medium { color: var(--sev-medium); background: #e9cf6c1a; border-color: #e9cf6c52; }
.s-low { color: var(--sev-low); background: #8fb0ff1a; border-color: #8fb0ff52; }
.s-note { color: var(--muted); background: var(--tint); border-color: var(--line); }
.s-none { color: var(--muted); background: var(--tint); border-color: var(--line); }
.act { white-space: nowrap; }
.act::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px;
               border: 1.5px solid var(--idle); vertical-align: 1px; }
.a-send::before { transform: rotate(45deg); border-color: var(--accent); }
.a-req::before { border-color: var(--bad); }
.a-block::before { background: var(--bad); border-color: var(--bad); }
.a-log::before { border-radius: 50%; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid; border-radius: 999px;
        padding: 0 9px; font-size: 11px; line-height: 19px; white-space: nowrap; }
.chip.c-ok { background: #6fd3a614; border-color: #6fd3a64d; }
.chip.c-warn { background: #e9b45c14; border-color: #e9b45c4d; }
.chip.c-bad { background: #f07a7a14; border-color: #f07a7a4d; }
.chip.c-muted { background: var(--tint); border-color: var(--line); }
.c-ok { color: var(--ok); } .c-warn { color: var(--warn); } .c-bad { color: var(--bad); }
.c-muted { color: var(--muted); }

/* tables */
.scroll { overflow-x: auto; }
.grid { border-collapse: collapse; width: 100%; }
.grid th, .grid td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line);
                     vertical-align: top; }
.grid th { color: var(--muted); font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.grid tbody tr, .grid tr { transition: background .2s var(--ease); }
.grid tr:hover td { background: #ffffff05; }
.grid.compact td { padding: 6px 8px; }
#wall-rows td { white-space: nowrap; }
#wall-rows td.clip { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; }
table.kv th, table.kvt th { width: 13rem; }
div.kv { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 6px 14px; margin: 10px 0; }
div.kv > span:nth-child(odd) { color: var(--muted); }
.uri { min-width: 16rem; max-width: 36rem; overflow-wrap: anywhere; }
pre { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 14rem; overflow: auto;
      background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
pre.tall { max-height: 24rem; }
td pre { background: transparent; border: 0; padding: 0; margin: 0; }
.decoded { color: var(--muted); overflow-wrap: anywhere; }
.dlabel { display: inline-block; font: 500 10.5px var(--mono); text-transform: uppercase;
          letter-spacing: .08em; color: var(--accent); margin: 10px 6px 0 0; }

/* tabs, filters, forms */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.tab { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: #f4f6fbbf;
       background: var(--tint); font-size: 13px; }
.tab.on { border-color: var(--line-strong); color: var(--ink); background: #ffffff10; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 0 0 16px; }
.filters label, .stack label { display: flex; flex-direction: column; gap: 4px; color: var(--muted);
                                font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.decide { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 10px; }
.decide label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 20rem; color: var(--muted); font-size: 12px; }
input, select, textarea, button { font: inherit; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 7px 10px;
  transition: border-color .2s var(--ease), background .2s var(--ease); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
button { cursor: pointer; background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 500; }
button:hover { background: #a9c2ff; }
button.danger { background: var(--bad); border-color: var(--bad); }
button.danger:hover { background: #f49494; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); font-weight: 400; }
button.ghost:hover { background: var(--tint); }
.msg { padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); }
.msg-ok { border-color: #6fd3a666; color: var(--ok); }
.msg-bad { border-color: #f07a7a66; color: var(--bad); }
.narrow { max-width: 420px; margin: 12vh auto; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

/* approvals and incident report */
.card-req { border-color: #f07a7a40; }
.card-req h2 { color: var(--bad); }
.status { font-weight: 500; margin: 4px 0; }
.links { display: flex; gap: 18px; margin: 12px 0 0; }
.summary { margin: 0; max-width: 72rem; line-height: 1.7; font-size: 15px; }
.typecard { border-left: 2px solid var(--accent); padding-left: 14px; margin-bottom: 14px; }

/* D114 incident assistant: answers are model text, shown escaped; CSS keeps line breaks */
.ask { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-width: 72rem; }
.ask-label { color: var(--muted); font-size: 12px; }
.ask textarea { width: 100%; box-sizing: border-box; }
.ask-row { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.ask-busy { color: var(--muted); font-size: 12px; }
.ask-answers:empty, .ask-note:has(+ .ask-answers:empty) { display: none; }
.ask-note { margin: 8px 0 4px; color: var(--warn); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.ask-item { border-left: 2px solid var(--line-strong); padding: 4px 0 4px 14px; margin: 12px 0; max-width: 72rem; }
.ask-head { margin: 0; font-size: 12px; }
.ask-q, .ask-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-q { color: var(--muted); margin: 2px 0 8px; }
.ask-text { line-height: 1.6; }
.ask-src { margin: 4px 0; padding-left: 18px; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.typecard p { margin: 4px 0; }
.maps { display: flex; flex-wrap: wrap; gap: 6px; }
.map { font: 11.5px var(--mono); padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px;
       background: var(--tint); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 12px; padding: 7px 0;
               border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.timeline .t { font: 11.5px var(--mono); color: var(--muted); }
.ev-decision span:last-child { font-weight: 500; }
.ev-tool span:last-child { color: var(--muted); }
.keytype { font-weight: 500; }
.small { font-size: 12px; }
.evidence, .intel { border-bottom: 1px solid var(--line); padding: 8px 0 12px; }
.evidence p, .intel p { margin: 4px 0; }
details.analyst { background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--r);
                  padding: 12px 18px; margin: 0 0 14px; }
details.analyst summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.decision-fold { border-top: 1px solid var(--line); margin-top: 12px; }
.help dt { font-weight: 500; margin-top: 14px; }
.help dd { margin: 4px 0 0; color: var(--muted); max-width: 72rem; }
.help dd .act, .help dd .chip { color: var(--ink); margin-right: 4px; }

/* decision page (analyst view) */
.headline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge { display: inline-block; margin-right: 4px; padding: 0 8px; border-radius: 999px; font-size: 11px;
         border: 1px solid currentColor; }
.b-agent { color: var(--ok); } .b-fallback { color: var(--warn); } .b-review { color: var(--bad); }
.b-prefilter { color: var(--muted); border-style: dashed; } .b-legacy { color: var(--muted); }
.tag { font-size: 12px; color: var(--bad); }
th[title], .badge[title] { cursor: help; }
svg.wf { max-width: 100%; height: auto; }
.wf-label, .wf-value { font: 11.5px var(--mono); fill: var(--ink); }
.wf-pos { fill: var(--ok); } .wf-neg { fill: var(--bad); } .wf-total { fill: var(--accent); }

/* print views (reports and incident report): plain colours on paper */
@media print {
  body { background: #fff; color: #000; }
  .tile, .card, details.analyst { background: #fff; border-color: #999; break-inside: avoid; }
  pre { background: #fff; border-color: #999; color: #000; }
  a { color: #000; } .muted, h2 { color: #333; }
  .hot::before, .card-req::before { display: none; }
}
body.print details.analyst { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1100px) {
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; padding: 8px; position: static; height: auto; }
  .rail .brand { width: 100%; padding: 4px 8px 8px; }
  .logout { margin: 0 0 0 auto; padding: 4px 8px; flex-direction: row; align-items: center; border-top: 0; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  main { padding: 14px 16px; }
  .strip { padding: 8px 16px; position: static; }
  .strip .right { margin-left: 0; }
  div.kv { grid-template-columns: 1fr; }
  table.kv th, table.kvt th { width: auto; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}
