/* Armorock Corporate Brain — Armorock Polymer Concrete
   Brand aligned to armorock.com: crimson, charcoal, and cool light gray.
   Fonts: Oswald (display) · Open Sans (body) · IBM Plex Mono (code)
*/

:root {
  --black:   #F1F1F2;
  --orange:  #BB2034;
  --gray:    #20242A;
  --paper:   #F1F1F2;
  --surface: #FFFFFF;
  --surface2: #E8E9EB;
  --surface3: #D5D7DA;
  --border:  rgba(32, 36, 42, 0.14);
  --border2: rgba(32, 36, 42, 0.25);
  --text:    #20242A;
  --text-dim: #5F6670;
  --text-muted: #8A919A;
  --orange-dim: #941A2B;
  --orange-glow: rgba(187, 32, 52, 0.11);
  --radius:  6px;
  --radius-lg: 10px;
  --rail-bg: #20242A;
  --rail-ink: #F1F1F2;
  --rail-muted: #AEB3B9;
  --strip-bg: rgba(255, 255, 255, 0.94);
  --job-bg: #FFFFFF;
  --dock-bg: #20242A;
  --dock-ink: #F1F1F2;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--paper);
  background-image:
    radial-gradient(rgba(28, 36, 24, 0.035) 0.7px, transparent 0.8px),
    linear-gradient(180deg, #FFFFFF 0%, #F1F1F2 58%, #E8E9EB 100%);
  background-size: 18px 18px, 100% 100%;
  color: var(--text);
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }

/* ── NAV ───────────────────────────────────────────────────────────────────── */
.nav {
  background: rgba(255, 252, 246, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 3px 0 var(--orange), inset 0 -2px 0 var(--gray);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo { height: 34px; width: auto; object-fit: contain; filter: drop-shadow(0 1px 0 rgba(255,255,255,.4)); }
.nav-wordmark {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.nav-link {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}
.nav-link:hover, .nav-link.active {
  color: var(--orange);
  background: var(--orange-glow);
  text-decoration: none;
}
.nav-link.active { color: var(--orange); }
.nav-logout {
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.nav-logout:hover { color: var(--text); border-color: var(--text-muted); text-decoration: none; }

/* dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 150px;
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu { display: flex; flex-direction: column; }
.nav-dropdown-menu .nav-link { display: block; padding: 7px 12px; white-space: nowrap; }

/* ── MAIN ──────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  width: 100%;
}

/* ── FOOTER ────────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: var(--black);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── PAGE HEADER ───────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 36px; }
.page-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}
.page-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 800;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 10px;
}
.page-sub { color: var(--text-dim); font-size: 15px; }

/* ── BADGES ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  vertical-align: middle;
}
.badge-measured  { background: rgba(32,36,42,0.08);  color: #20242A; border: 1px solid rgba(32,36,42,0.28); }
.badge-modeled   { background: rgba(74,144,164,0.12); color: #2d5a68; border: 1px solid rgba(74,144,164,0.35); }
.badge-assumed   { background: rgba(196,111,20,0.12);  color: #8a4e0c; border: 1px solid rgba(196,111,20,0.35); }
.badge-not-captured { background: rgba(92,107,94,0.10); color: #5C6B5E; border: 1px solid rgba(92,107,94,0.30); }
.badge-orange    { background: var(--orange-glow); color: var(--orange); border: 1px solid rgba(196,30,58,0.35); }
.badge-muted     { background: var(--surface3); color: var(--text-muted); border: 1px solid var(--border2); }
.badge-bipa      { background: rgba(32,36,42,0.08); color: #20242A; border: 1px solid rgba(32,36,42,0.24); }
.badge-vawa      { background: rgba(92,107,94,0.12); color: #3A443C; border: 1px solid rgba(92,107,94,0.28); }
.badge-live      { background: rgba(32,36,42,0.08); color: #20242A; border: 1px solid rgba(32,36,42,0.28); }
.badge-unwired   { background: rgba(196,111,20,0.12); color: #8a4e0c; border: 1px solid rgba(196,111,20,0.35); }

/* ── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-orange  { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #d06918; text-decoration: none; }
.btn-secondary { background: var(--surface3); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface2); border-color: var(--orange); color: var(--orange); text-decoration: none; }
.btn-agent { background: var(--orange-glow); color: var(--orange); border: 1px solid rgba(232,119,34,0.3); margin-top: 12px; }
.btn-agent:hover { background: var(--orange); color: #fff; text-decoration: none; }

/* ── KPI GRID ──────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 2px;
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}
.kpi-card::after {
  content: "";
  position: absolute;
  top: 6px; right: 6px;
  width: 10px; height: 10px;
  border-top: 2px solid var(--gray);
  border-right: 2px solid var(--gray);
  opacity: .55;
}
.kpi-card:hover { border-color: var(--gray); box-shadow: 0 10px 24px rgba(28,36,24,.08); }
.kpi-orange { border-left: 3px solid var(--orange); }
.kpi-forest { border-left: 3px solid var(--gray); }
.kpi-gray   { border-left: 3px solid var(--gray); }
.kpi-muted  { border-left: 3px solid var(--border2); }
.kpi-icon {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray);
  flex-shrink: 0;
  min-width: 2.4em;
}
.kpi-value { font-family: 'Archivo', sans-serif; font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 4px; }
.kpi-value.kpi-nc { color: var(--text-muted); font-style: italic; font-size: 16px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.kpi-sub   { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.kpi-provenance { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-source { font-size: 11px; color: var(--text-muted); }

/* ── SECTION ROW ───────────────────────────────────────────────────────────── */
.section-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 28px; }
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; padding: 24px; box-shadow: 0 8px 20px rgba(28,36,24,.05); }
.section-title { font-family: 'Archivo', sans-serif; font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.section-body  { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.7; }
.chain-pills { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.chain-pill { font-family: 'IBM Plex Mono', monospace; font-size: 12px; background: var(--surface3); border: 1px solid var(--border2); padding: 5px 10px; border-radius: 4px; color: var(--orange); }
.billing-paradox-badge { background: rgba(234,179,8,0.1); border: 1px solid rgba(234,179,8,0.3); color: #fbbf24; font-size: 12px; padding: 7px 12px; border-radius: var(--radius); margin-bottom: 14px; }
.retention-stat { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.retention-val  { font-family: 'Archivo', sans-serif; font-size: 32px; font-weight: 700; color: var(--orange); }
.retention-label { font-size: 13px; color: var(--text-dim); }
.nc-text { color: var(--text-muted); font-style: italic; }

/* ── HONESTY BANNER ────────────────────────────────────────────────────────── */
.honesty-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  font-size: 13px;
  color: var(--text-dim);
}
.honesty-icon { font-size: 20px; flex-shrink: 0; }

/* ── LOGIN ─────────────────────────────────────────────────────────────────── */
.login-body {
  background:
    radial-gradient(rgba(255,255,255,.08) 0.8px, transparent 0.9px),
    linear-gradient(165deg, #20242A 0%, #20242A 42%, #BB2034 160%);
  background-size: 18px 18px, auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-wrap { width: 100%; max-width: 440px; padding: 24px; }
.login-card {
  background: var(--paper);
  border: 1px solid rgba(28,36,24,.18);
  border-radius: 2px;
  padding: 40px;
  box-shadow: 0 3px 0 var(--orange), 0 28px 60px rgba(0,0,0,.28);
}
.login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.login-logo  { height: 52px; width: auto; object-fit: contain; }
.login-org   { font-family: 'Archivo', sans-serif; font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.login-product { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 4px; }
.login-error { background: rgba(196,30,58,0.08); border: 1px solid rgba(196,30,58,0.3); color: #9A1730; padding: 10px 14px; border-radius: 2px; font-size: 13px; margin-bottom: 20px; }
.login-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; margin-top: 18px; }
.login-input { width: 100%; background: #FFFCF6; border: 1px solid var(--border2); border-radius: 2px; color: var(--text); font-size: 15px; padding: 10px 14px; outline: none; transition: border-color 0.15s; }
.login-input:focus { border-color: var(--gray); }
.login-btn { width: 100%; background: var(--gray); color: #FFFCF6; border: none; border-radius: 2px; font-family: 'Archivo', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 13px; margin-top: 24px; cursor: pointer; transition: background 0.15s; }
.login-btn:hover { background: var(--orange-dim); }
.login-footer { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 24px; line-height: 1.6; }

/* ── CHAT ──────────────────────────────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; height: calc(100vh - 220px); min-height: 500px; }
.chat-sidebar { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.agent-select-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 4px; }
.agent-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s; }
.agent-btn:hover { border-color: var(--border2); background: var(--surface2); }
.agent-btn-active { border-color: var(--orange) !important; background: var(--orange-glow) !important; }
.agent-icon { font-size: 16px; flex-shrink: 0; }
.agent-btn-name { font-size: 13px; font-weight: 600; color: var(--text); }
.agent-btn-role { font-size: 11px; color: var(--text-muted); }
.chat-note { font-size: 11px; color: var(--text-muted); padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 8px; line-height: 1.6; }
.chat-main { display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.chat-msg { display: flex; gap: 12px; align-items: flex-start; }
.chat-msg-user { flex-direction: row-reverse; }
.chat-msg-user .chat-msg-body { background: var(--orange-glow); border-color: rgba(232,119,34,0.3); }
.chat-msg-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.chat-msg-body { background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; color: var(--text); max-width: 85%; line-height: 1.7; }
.chat-msg-system .chat-msg-body { border-color: rgba(232,119,34,0.2); }
.chat-form { display: flex; gap: 8px; }
.chat-input { flex: 1; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: 'IBM Plex Sans', sans-serif; font-size: 14px; padding: 10px 14px; resize: none; outline: none; transition: border-color 0.15s; }
.chat-input:focus { border-color: var(--orange); }
.chat-send { background: var(--orange); color: #fff; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 600; padding: 0 20px; cursor: pointer; transition: background 0.15s; }
.chat-send:hover:not(:disabled) { background: var(--orange-dim); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-status { font-size: 12px; color: var(--text-muted); min-height: 18px; }
.chat-error { color: #f87171; }

/* ── CORPUS ────────────────────────────────────────────────────────────────── */
.corpus-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.corpus-search { width: 100%; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-size: 14px; padding: 8px 12px; outline: none; margin-bottom: 12px; }
.corpus-search:focus { border-color: var(--orange); }
.corpus-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.corpus-file { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 6px; font-size: 12px; }
.corpus-file-folder { color: var(--text-muted); display: block; }
.corpus-file-name { color: var(--text-dim); font-weight: 600; }
.corpus-file-size { color: var(--text-muted); float: right; }
.corpus-empty { color: var(--text-muted); font-size: 13px; padding: 12px 0; }
.corpus-grounding-title { font-family: 'Archivo', sans-serif; font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.corpus-pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; font-size: 12px; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; max-height: 65vh; overflow-y: auto; line-height: 1.8; }
.corpus-results-title { font-family: 'Archivo', sans-serif; font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.corpus-hit { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.corpus-hit-text { font-size: 14px; color: var(--text); margin-bottom: 8px; line-height: 1.7; }
.corpus-hit-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }
.corpus-no-hits { color: var(--text-muted); font-size: 14px; padding: 16px 0; }

/* ── TELEMETRY ─────────────────────────────────────────────────────────────── */
.tele-banners { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.banner { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; line-height: 1.6; }
.banner-bipa { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25); color: #93c5fd; }
.banner-vawa { background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.25); color: #d8b4fe; }
.banner-coaching { background: rgba(232,119,34,0.08); border: 1px solid rgba(232,119,34,0.25); color: var(--orange); }
.tele-edge-status { margin-bottom: 20px; font-size: 13px; }
.tele-edge-label { color: var(--text-muted); margin-right: 8px; }
.tele-edge-live { color: #4ade80; font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.tele-edge-synthetic { color: #fbbf24; font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.tele-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tele-node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; transition: border-color 0.15s; }
.tele-node-ok      { border-left: 3px solid #4ade80; }
.tele-node-warning { border-left: 3px solid #fbbf24; }
.tele-node-loading { border-left: 3px solid var(--border2); opacity: 0.6; }
.tele-node-label   { font-family: 'Archivo', sans-serif; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.tele-load-bar     { height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; flex: 1; }
.tele-load-fill    { height: 100%; background: var(--orange); border-radius: 3px; transition: width 0.5s; }
.tele-node-load    { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tele-load-pct     { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.tele-node-meta    { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-muted); }
.tele-advisory     { font-size: 11px; color: #fbbf24; margin-top: 6px; }
.tele-synthetic-note { font-size: 10px; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.tele-legend       { display: flex; gap: 20px; margin-bottom: 16px; font-size: 12px; color: var(--text-muted); }
.legend-item       { display: flex; align-items: center; gap: 6px; }
.legend-dot        { width: 10px; height: 10px; border-radius: 50%; }
.legend-ok         { background: #4ade80; }
.legend-warning    { background: #fbbf24; }
.legend-synthetic  { background: var(--border2); }
.tele-disclaimer   { font-size: 12px; color: var(--text-muted); font-style: italic; line-height: 1.7; }

/* ── AGENTS ────────────────────────────────────────────────────────────────── */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 36px; }
.agent-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.agent-card-orch { border-color: rgba(232,119,34,0.4); }
.agent-card-header { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: linear-gradient(135deg, var(--surface2), var(--surface3)); border-bottom: 1px solid var(--border); position: relative; }
.agent-card-icon  { font-size: 24px; flex-shrink: 0; }
.agent-card-name  { font-family: 'Archivo', sans-serif; font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; }
.agent-card-role  { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px; }
.agent-orch-badge { font-size: 10px; background: var(--orange); color: #fff; padding: 3px 8px; border-radius: 3px; position: absolute; top: 14px; right: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.agent-veto-badge { font-size: 10px; background: rgba(168,85,247,0.3); color: #d8b4fe; padding: 3px 8px; border-radius: 3px; position: absolute; top: 14px; right: 14px; }
.agent-claim-badge { font-size: 9px; background: rgba(234,179,8,0.2); color: #fbbf24; padding: 3px 8px; border-radius: 3px; position: absolute; top: 14px; right: 14px; }
.agent-card-tagline { padding: 12px 20px 0; font-size: 13px; font-weight: 600; color: var(--orange); font-style: italic; }
.agent-card-desc { padding: 8px 20px 0; font-size: 13px; color: var(--text-dim); line-height: 1.7; }
.agent-caps-title, .agent-bounds-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; padding: 12px 20px 4px; }
.agent-caps, .agent-bounds { list-style: none; padding: 0 20px; display: flex; flex-direction: column; gap: 4px; }
.agent-caps li, .agent-bounds li { font-size: 12px; color: var(--text-dim); padding-left: 12px; position: relative; }
.agent-caps li::before { content: '→'; color: var(--orange); position: absolute; left: 0; }
.agent-bounds li::before { content: '⚠'; font-size: 10px; position: absolute; left: 0; }
.agent-bounds li { color: #fbbf24; }
.agent-card .btn { margin: 12px 20px 20px; display: block; text-align: center; }

.chains-section { margin-top: 8px; }
.chains-title { font-family: 'Archivo', sans-serif; font-size: 24px; font-weight: 700; margin-bottom: 18px; }
.chains-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.chain-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.chain-label { font-family: 'Archivo', sans-serif; font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.chain-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.chain-step-pill { background: var(--orange-glow); color: var(--orange); border: 1px solid rgba(232,119,34,0.3); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; }
.chain-arrow { color: var(--text-muted); font-size: 14px; }
.chain-trigger { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.chain-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ── MCP ───────────────────────────────────────────────────────────────────── */
.mcp-tools { display: flex; flex-direction: column; gap: 16px; }
.mcp-tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.mcp-tool-live   { border-left: 3px solid #4ade80; }
.mcp-tool-unwired { border-left: 3px solid #fbbf24; }
.mcp-tool-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mcp-tool-name   { font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 600; color: var(--text); }
.mcp-tool-desc   { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; line-height: 1.7; }
.mcp-tool-params-title { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.08em; margin-bottom: 8px; }
.mcp-tool-params { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.mcp-param { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; }
.mcp-param-name { font-family: 'IBM Plex Mono', monospace; color: var(--orange); flex-shrink: 0; }
.mcp-param-type  { color: var(--text-muted); flex-shrink: 0; }
.mcp-param-desc  { color: var(--text-dim); }
.mcp-unwired-reason { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.25); color: #fbbf24; padding: 8px 12px; border-radius: var(--radius); font-size: 12px; margin-bottom: 12px; }
.mcp-try { display: flex; flex-direction: column; gap: 8px; }
.mcp-try-params { display: flex; flex-direction: column; gap: 8px; }
.mcp-param-input { background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: 'IBM Plex Mono', monospace; font-size: 12px; padding: 8px 12px; resize: vertical; outline: none; width: 100%; }
.mcp-param-input:focus { border-color: var(--orange); }
.mcp-result { background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); padding: 14px; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow-y: auto; color: var(--text-dim); }
.mcp-result-ok  { border-color: rgba(34,197,94,0.3); color: #4ade80; }
.mcp-result-err { border-color: rgba(239,68,68,0.3); color: #f87171; }
.mcp-badge-live    { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); padding: 2px 8px; border-radius: 3px; font-size: 11px; font-family: 'IBM Plex Mono', monospace; }
.mcp-badge-unwired { background: rgba(234,179,8,0.15); color: #fbbf24; border: 1px solid rgba(234,179,8,0.3); padding: 2px 8px; border-radius: 3px; font-size: 11px; font-family: 'IBM Plex Mono', monospace; }

/* ── HOUSING ───────────────────────────────────────────────────────────────── */
.nc-banner { background: rgba(107,114,128,0.08); border: 1px solid rgba(107,114,128,0.25); color: #9ca3af; padding: 14px 18px; border-radius: var(--radius); font-size: 13px; margin-bottom: 24px; line-height: 1.7; }
.housing-table-wrap { overflow-x: auto; margin-bottom: 28px; }
.housing-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.housing-table th { background: var(--surface2); border: 1px solid var(--border2); padding: 10px 14px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.housing-table td { border: 1px solid var(--border); padding: 10px 14px; color: var(--text-dim); vertical-align: middle; }
.housing-table tr:hover td { background: var(--surface); }
.prop-id   { font-family: 'IBM Plex Mono', monospace; color: var(--orange); font-size: 12px; }
.prop-occ, .prop-hmis { font-style: italic; color: var(--text-muted) !important; }
.housing-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.housing-kpi  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.housing-kpi-val   { font-family: 'Archivo', sans-serif; font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.housing-kpi-val.nc-text { font-size: 16px; }
.housing-kpi-label { font-size: 12px; color: var(--text-muted); }
.housing-note { font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 16px; line-height: 1.7; }

/* ── CALAIM ────────────────────────────────────────────────────────────────── */
.calaim-paradox-banner { display: flex; gap: 16px; align-items: flex-start; background: rgba(234,179,8,0.06); border: 1px solid rgba(234,179,8,0.3); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 28px; }
.paradox-icon  { font-size: 24px; flex-shrink: 0; }
.paradox-body  { font-size: 14px; color: var(--text-dim); line-height: 1.7; }
.calaim-codes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 28px; }
.calaim-code-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.calaim-code-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.calaim-code   { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 700; color: var(--orange); }
.calaim-modifier { font-family: 'IBM Plex Mono', monospace; font-size: 14px; color: #fbbf24; background: rgba(234,179,8,0.1); padding: 2px 8px; border-radius: 3px; }
.calaim-code-name { font-size: 13px; font-weight: 600; color: var(--text); }
.calaim-rate   { font-family: 'Archivo', sans-serif; font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.calaim-billing { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.calaim-desc   { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; line-height: 1.6; }
.calaim-reqs   { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.calaim-req    { font-size: 11px; padding: 3px 9px; border-radius: 3px; font-weight: 600; }
.calaim-req-required { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.calaim-paradox { font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; line-height: 1.6; }
.calaim-status { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.calaim-claim-gate { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--orange); border-radius: var(--radius-lg); padding: 24px; }
.claim-gate-title { font-family: 'Archivo', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.claim-gate-list { padding-left: 24px; color: var(--text-dim); font-size: 14px; line-height: 2; }
.claim-gate-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; font-family: 'IBM Plex Mono', monospace; }
.claim-gate-note code { background: var(--surface3); padding: 2px 6px; border-radius: 3px; color: var(--orange); }

/* ── WORKFORCE ─────────────────────────────────────────────────────────────── */
.wf-banners { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.wf-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 28px; }
.wf-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.wf-kpi-alert { border-color: rgba(234,179,8,0.4); }
.wf-kpi-val  { font-family: 'Archivo', sans-serif; font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.wf-kpi-label { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.wf-kpi-prov  { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.wf-kpi-note  { font-size: 11px; color: var(--text-muted); font-style: italic; line-height: 1.5; }
.wf-section-title { font-family: 'Archivo', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.wf-fabric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.wf-fabric-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 20px; }
.wf-fabric-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; padding: 16px; background: var(--surface2); border-radius: var(--radius); }
.wf-flow-step { text-align: center; padding: 10px; min-width: 100px; }
.wf-flow-icon  { font-size: 24px; margin-bottom: 6px; }
.wf-flow-label { font-size: 11px; color: var(--text-dim); line-height: 1.4; }
.wf-flow-arrow { font-size: 18px; color: var(--orange); flex-shrink: 0; }
.wf-bipa-note  { font-size: 12px; color: #93c5fd; background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); padding: 8px 12px; border-radius: var(--radius); margin-bottom: 8px; }
.wf-coaching-note { font-size: 12px; color: var(--orange); background: var(--orange-glow); border: 1px solid rgba(232,119,34,0.25); padding: 8px 12px; border-radius: var(--radius); }
.wf-labor-impact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.wf-impact-body { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.7; }
.wf-impact-prov { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ── SPECIAL (iframe) ──────────────────────────────────────────────────────── */
.special-header { margin-bottom: 20px; display: flex; flex-direction: column; gap: 4px; }
.special-actions { margin-top: 12px; }
.special-frame-wrap { width: 100%; background: var(--black); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.special-frame { width: 100%; height: calc(100vh - 260px); min-height: 500px; border: none; display: block; background: #fff; }

/* ── UTILS ─────────────────────────────────────────────────────────────────── */
strong { font-weight: 700; color: var(--text); }
em.nc-text { font-style: italic; color: var(--text-muted); }

/* ── APP SHELL (watchfloor) ────────────────────────────────────────────────── */
body.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  overflow: hidden;
}
.rail {
  background: var(--rail-bg);
  color: var(--rail-ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  text-decoration: none;
  color: var(--rail-ink);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.rail-brand:hover { text-decoration: none; color: var(--rail-ink); }
.rail-logo {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  background: #FFFFFF;
  padding: 4px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.rail-name {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rail-sub { display: block; font-size: 10px; color: var(--rail-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.rail-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.rail-group {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rail-muted);
  padding: 14px 10px 6px;
}
.rail-link {
  display: block;
  color: var(--rail-ink);
  opacity: 0.78;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 4px;
  text-decoration: none;
}
.rail-link:hover { opacity: 1; background: rgba(255,255,255,.06); text-decoration: none; color: var(--rail-ink); }
.rail-link.on {
  opacity: 1;
  background: rgba(187,32,52,.22);
  box-shadow: inset 3px 0 0 var(--gray);
  color: #fff;
}
.rail-foot {
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11px;
  color: var(--rail-muted);
}
.rail-who { line-height: 1.4; margin-bottom: 8px; }
.rail-out { color: var(--rail-ink); opacity: .7; font-size: 12px; }
.rail-out:hover { opacity: 1; color: var(--orange); text-decoration: none; }

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.strip {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 0 20px;
  background: var(--strip-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.strip-title {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.strip-stats { display: flex; flex-wrap: wrap; gap: 14px; flex: 1; min-width: 0; }
.st { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.st b { color: var(--text); font-size: 13px; }
.st b.ok { color: var(--gray); }
.st b.warn { color: var(--orange); }
.strip-ask {
  flex-shrink: 0;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 4px;
}
.strip-ask:hover { text-decoration: none; filter: brightness(1.08); color: #fff; }

.app-shell .main {
  flex: 1;
  overflow-y: auto;
  max-width: none;
  margin: 0;
  padding: 20px 22px 96px;
  width: 100%;
}
.app-shell:not(.is-dash) .page-title { font-size: 22px; letter-spacing: -0.02em; }
.app-shell:not(.is-dash) .page-header { margin-bottom: 18px; }
.app-shell.is-chat .page-header { display: none; }
.app-shell.is-chat .ask-dock,
.app-shell.is-special .ask-dock { display: none; }
.app-shell.is-chat .main { padding: 12px 16px 16px; }
.app-shell.is-chat .chat-layout { height: calc(100vh - 72px); min-height: 0; }
.app-shell.is-special .special-header { display: none; }
.app-shell.is-special .main { padding: 0; }
.app-shell.is-special .special-frame-wrap { border: none; border-radius: 0; }
.app-shell.is-special .special-frame { height: calc(100vh - 48px); min-height: 0; }

.ask-dock {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 16px 12px;
  background: var(--dock-bg);
  color: var(--dock-ink);
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  z-index: 40;
}
.ask-chips { display: flex; gap: 6px; }
.ask-chip {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: var(--dock-ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 9px;
  border-radius: 3px;
  cursor: pointer;
}
.ask-chip:hover { border-color: var(--orange); color: var(--orange); }
.ask-input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--dock-ink);
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
}
.ask-input::placeholder { color: var(--rail-muted); }
.ask-input:focus { border-color: var(--orange); }
.ask-go {
  background: var(--orange);
  color: #fff;
  border: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.board { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.board-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.board-head-acts { display: flex; gap: 8px; flex-shrink: 0; }
.board-head .page-title { font-size: 26px; margin-bottom: 6px; }
.board-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 18px 0 10px;
}
.funnel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}
.funnel-cell { background: var(--job-bg); padding: 12px 14px; }
.funnel-k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.funnel-v { font-family: 'Archivo', sans-serif; font-size: 20px; font-weight: 800; line-height: 1.2; margin: 4px 0 6px; }
.funnel-v.nc { color: var(--text-muted); font-style: italic; font-size: 16px; font-weight: 600; }

.job {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 110px;
  gap: 12px;
  background: var(--job-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  box-shadow: 0 8px 20px rgba(28,36,24,.05);
}
.job-crit { box-shadow: inset 3px 0 0 var(--orange); }
.job-warn { box-shadow: inset 3px 0 0 #C9A227; }
.job-ok { box-shadow: inset 3px 0 0 var(--gray); }
.job-idx {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding-top: 4px;
}
.job-title { font-family: 'Archivo', sans-serif; font-size: 16px; font-weight: 700; line-height: 1.25; margin: 0; }
.job-topline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.job-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border2);
  padding: 2px 7px;
  border-radius: 3px;
  color: var(--text-dim);
}
.job-chip.muted { opacity: .7; }
.job-copy { font-size: 13px; color: var(--text-dim); line-height: 1.45; margin-bottom: 8px; }
.job-bar { height: 6px; background: var(--surface3); border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.job-bar span { display: block; height: 100%; background: var(--orange); }
.job-crit .job-bar span { background: var(--orange); }
.job-warn .job-bar span { background: #C9A227; }
.job-ok .job-bar span { background: var(--gray); }
.job-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.act {
  display: inline-flex;
  align-items: center;
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}
a.act:hover, button.act:hover { border-color: var(--orange); color: var(--orange); text-decoration: none; background: var(--orange-glow); }
.job-stat { text-align: right; }
.job-stat-v { font-family: 'Archivo', sans-serif; font-size: 22px; font-weight: 800; line-height: 1; }
.job-stat-v.nc { color: var(--text-muted); font-style: italic; font-size: 18px; }
.job-stat-l { font-size: 10px; color: var(--text-muted); margin-top: 4px; letter-spacing: 0.04em; text-transform: uppercase; }

.board-side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }
.side-card { background: var(--job-bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.side-k { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 6px; }
.side-v { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.side-copy { font-size: 12px; color: var(--text-dim); line-height: 1.45; margin-bottom: 10px; }
.side-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.side-row:last-child { border-bottom: none; }
.side-flag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.side-flag.ok { color: var(--gray); }
.side-flag.warn { color: var(--orange); }
.side-card .act { margin-top: 6px; margin-right: 6px; }

.drawer {
  position: fixed;
  right: 24px;
  bottom: 88px;
  width: min(520px, calc(100vw - 260px));
  max-height: 52vh;
  background: var(--job-bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer[hidden] { display: none; }
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.drawer-x { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: 12px; font-weight: 700; }
.drawer-body { margin: 0; padding: 12px; overflow: auto; font-size: 12px; line-height: 1.45; white-space: pre-wrap; }

.page-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }

@media (max-width: 1100px) {
  .board { grid-template-columns: 1fr; }
  .board-side { position: static; }
  .funnel { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  body.app-shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .job { grid-template-columns: 36px 1fr; }
  .job-stat { grid-column: 2; text-align: left; }
  .ask-dock { grid-template-columns: 1fr auto; }
  .ask-chips { display: none; }
  .drawer { width: calc(100vw - 24px); right: 12px; left: 12px; }
}

@media (max-width: 768px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { flex-direction: row; flex-wrap: wrap; }
  .corpus-layout { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .page-title { font-size: 26px; }
}

/* ── FUNNEL PROVENANCE ACCENTS ──────────────────────────────────────────────── */
.funnel-cell { transition: background 0.12s; }
.funnel-cell:hover { background: var(--surface2); }
.funnel-cell-measured     { border-top: 2px solid var(--gray); }
.funnel-cell-not-captured { border-top: 2px solid var(--border2); }
.funnel-cell-modeled      { border-top: 2px solid rgba(74,144,164,0.55); }
.funnel-cell-assumed      { border-top: 2px solid rgba(196,111,20,0.55); }
.funnel-v { transition: color 0.12s; }

/* ── PLANT NETWORK PANEL ────────────────────────────────────────────────────── */
.plant-net {
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: var(--job-bg);
  margin-bottom: 16px;
  overflow: hidden;
}
.plant-net-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: linear-gradient(to right, rgba(28,36,24,0.05), rgba(28,36,24,0.01));
  border-bottom: 1px solid var(--border);
}
.plant-net-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  flex: 1;
}
.plant-net-grid {
  display: flex;
  align-items: stretch;
}
/* Individual plant cards */
.plant-card {
  flex: 1;
  padding: 12px 14px 14px;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.plant-card:last-child { border-right: none; }
/* Top accent bar — green for nominal, amber for flag */
.plant-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gray);
  transition: background 0.2s;
}
.plant-card-flag::before { background: #C9A227; }
.plant-card-flag { background: rgba(201,162,39,0.025); }
.plant-card-head {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  padding-top: 2px;
}
.plant-card-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  letter-spacing: 0.07em;
}
.plant-card-city {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Sensor data columns: CAST | CURE */
.plant-sensors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.sensor-col {
  padding: 6px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sensor-col-flag {
  background: rgba(201,162,39,0.07);
  border-color: rgba(201,162,39,0.35);
}
.sensor-col-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.sensor-col-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.sensor-col-flag .sensor-col-val { color: #C9A227; }
.sensor-col-val small {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 400;
}
.sensor-col-sub {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.3;
}
/* Status pip row */
.sensor-pip-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.pip {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pip-ok   { background: var(--gray); }
.pip-warn { background: #C9A227; animation: pip-warn-pulse 2s ease-in-out infinite; }
.pip-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
/* Mobile: stack plant cards vertically */
@media (max-width: 700px) {
  .plant-net-grid { flex-direction: column; }
  .plant-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .plant-card:last-child { border-bottom: none; }
  .plant-sensors { grid-template-columns: 1fr 1fr; }
}

/* ── QUOTE GATE SEQUENCE ────────────────────────────────────────────────────── */
.quote-gate {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 10px 0 12px;
}
.gate-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface2);
  transition: border-color 0.15s;
}
.gate-step:hover { border-color: var(--border2); }
.gate-step-hold {
  border-color: rgba(196,30,58,0.30);
  background: rgba(196,30,58,0.03);
}
.gate-step-hold:hover { border-color: rgba(196,30,58,0.50); }
.gate-step-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 22px;
  text-align: right;
  padding-top: 1px;
}
.gate-step-name {
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.gate-step-role {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}
.gate-step-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-top: 3px;
}
.gate-step-hold .gate-step-note { color: var(--orange); font-weight: 600; }
/* Vertical connector between gate steps */
.gate-arrow-down {
  text-align: left;
  padding: 1px 0 1px 31px;
  font-size: 11px;
  color: var(--border2);
  line-height: 1;
  user-select: none;
}

/* ── WATCHFLOOR MOTION ──────────────────────────────────────────────────────── */
@keyframes job-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pip-warn-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.85); }
}
/* Stagger job cards on load using CSS custom property --job-idx */
.job {
  animation: job-enter 0.22s ease both;
  animation-delay: calc(var(--job-idx, 0) * 0.055s);
}
/* Board-label refinement */
.board-label-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  padding: 1px 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
}
/* Crit job — faint crimson wash on row */
.job-crit { background: rgba(196,30,58,0.018); }

/* ── KEYBOARD / FOCUS ACCESSIBILITY ────────────────────────────────────────── */
.act:focus-visible,
.btn:focus-visible,
.ask-chip:focus-visible,
.ask-go:focus-visible,
.rail-link:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
a:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 2px;
}
.ask-input:focus-visible,
.chat-input:focus-visible { outline: 2px solid var(--orange); outline-offset: 0; }

/* ── REDUCED MOTION ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .job { animation: none !important; }
  .pip-warn { animation: none !important; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── Armorock marketing alignment ───────────────────────────────────────── */
:root {
  --display: 'Oswald', sans-serif;
  --sans: 'Open Sans', system-ui, sans-serif;
}
body { font-family: var(--sans); }
.page-title, .kpi-value, .section-title, .retention-val, .login-org,
.login-btn, .corpus-grounding-title, .corpus-results-title,
.tele-node-label, .agent-card-name, .chains-title, .chain-label,
.housing-kpi-val, .calaim-rate, .claim-gate-title, .wf-kpi-val,
.wf-section-title, .funnel-v, .job-title, .job-stat-v, .gate-step-name {
  font-family: var(--display);
}
.rail-name, .strip-title { font-family: var(--display); }
.rail-link.on { background: rgba(187, 32, 52, .22); box-shadow: inset 3px 0 0 var(--orange); }
.rail-logo { background: #fff; padding: 4px; border-radius: 50%; }
.btn-orange, .strip-ask, .ask-go, .chat-send { background: var(--orange); }
.btn-orange:hover, .strip-ask:hover, .ask-go:hover, .chat-send:hover:not(:disabled) { background: var(--orange-dim); }
.login-btn { background: var(--orange); color: #fff; }
.login-btn:hover { background: var(--orange-dim); }
.badge-measured, .badge-live, .badge-bipa {
  background: rgba(32, 36, 42, .08); color: var(--gray); border-color: rgba(32, 36, 42, .28);
}
.kpi-card:hover { border-color: var(--orange); box-shadow: 0 10px 24px rgba(32,36,42,.10); }
