/* ===========================================================================
   GSOC Operator Watchfloor — monochrome military console.
   Black / white / grey. Greyscale chrome, no blue. Status uses muted signal
   colors only; capability identity colors surface on hover/active.
   =========================================================================== */
:root {
  --bg-0: #050505;
  --bg-1: #0c0c0d;
  --bg-2: #131314;
  --bg-3: #1c1c1e;
  --line: #242426;
  --line-2: #343437;
  --text: #e6e6e6;
  --text-dim: #9a9a9d;
  --muted: #6a6a6e;
  --accent: #f2f2f2;             /* white accent, not cyan */
  --accent-glow: rgba(255, 255, 255, 0.10);
  --green: #9bb83f;              /* muted olive — "go" */
  --yellow: #c9a24a;             /* field amber */
  --orange: #c07c3a;
  --red: #c0473f;               /* muted signal red */
  --magenta: #8a8a8d;            /* desaturated to grey */
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, monospace;
  --sans: -apple-system, "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background:
    linear-gradient(180deg, #0a0a0b 0%, var(--bg-0) 55%),
    var(--bg-0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ----------------------------- Sidebar ---------------------------------- */
.sidebar {
  background:
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  border-right: 1px solid var(--line);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  margin: 4px 8px 24px;
}
.brand-glyph {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
}
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-top: 4px;
}

nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: block;
  padding: 9px 12px;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.4px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 120ms ease;
}
.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-link.active {
  color: var(--accent);
  background: linear-gradient(90deg, var(--accent-glow) 0%, transparent 100%);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.utc { margin-left: auto; opacity: 0.7; }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}
.status-dot.ok   { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.warn { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }

/* ----------------------------- Page ------------------------------------- */
.page { padding: 22px 32px; min-width: 0; }
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.head-right { display: flex; gap: 12px; align-items: center; }
.cycle-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  font-weight: 700;
}
.tier-mon { background: rgba(138,150,168,0.15); color: var(--text-dim); }
.tier-sgt { background: rgba(77,208,225,0.15); color: var(--accent); }
.tier-aut { background: rgba(37,193,154,0.18); color: var(--green); }
.tier-ful { background: rgba(178,101,224,0.18); color: var(--magenta); }

.sev-flash    { background: var(--red); color: white; }
.sev-critical { background: var(--red); color: white; }
.sev-priority { background: var(--orange); color: var(--bg-0); }
.sev-elevated { background: var(--yellow); color: var(--bg-0); }
.sev-routine  { background: rgba(77,208,225,0.18); color: var(--accent); }
.sev-monitor  { background: rgba(138,150,168,0.18); color: var(--text-dim); }

/* ----------------------------- Cards ------------------------------------ */
.grid { display: grid; gap: 16px; }
.grid-overview {
  grid-template-columns: 1fr 1fr 1fr;
  grid-auto-rows: min-content;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.card-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.card-head .muted { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); }

/* ----------------------------- Tables ----------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.data-table th {
  text-align: left;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-2);
  text-transform: uppercase;
  font-size: 10px;
}
.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.data-table tr:hover td { background: var(--bg-2); }

/* ----------------------------- Case list -------------------------------- */
.case-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 540px; overflow-y: auto;
}
.case-row {
  display: grid;
  grid-template-columns: 90px 80px 1fr 90px 70px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
}
.case-row .sev {
  padding: 2px 8px; border-radius: 3px; font-size: 10px;
  font-weight: 700; letter-spacing: 1.4px; text-align: center;
}
.case-row .cid { color: var(--accent); }
.case-row .title { color: var(--text); }
.case-row .meta { color: var(--text-dim); text-align: right; font-size: 11px; }

/* ----------------------------- KPI grid --------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpi-cell {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}
.kpi-cell .label {
  font-size: 10px; letter-spacing: 1.2px;
  color: var(--text-dim); text-transform: uppercase;
}
.kpi-cell .value {
  font-family: var(--mono);
  font-size: 22px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 6px;
}

.kpi-big {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi-big .kpi-cell .value { font-size: 30px; }

/* ----------------------------- Map -------------------------------------- */
.map-mini {
  height: 280px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.leaflet-container { background: #0a0f17 !important; }
.leaflet-tile {
  filter: brightness(0.7) saturate(0.8);
}
.leaflet-popup-content-wrapper {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 12px;
}
.leaflet-popup-tip { background: var(--bg-1); }

/* ----------------------------- Audit stream ----------------------------- */
.audit-stream {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.audit-stream.tall { max-height: 60vh; }
.audit-line { padding: 2px 4px; border-bottom: 1px dashed var(--line); }
.audit-line .ts { color: var(--muted); }
.audit-line .tool { color: var(--accent); margin: 0 6px; }
.audit-line .status-ran    { color: var(--green); }
.audit-line .status-gated  { color: var(--yellow); }
.audit-line .status-error  { color: var(--red); }
.audit-line .status-approved { color: var(--green); }
.audit-line .status-denied { color: var(--red); }

/* ----------------------------- Approvals -------------------------------- */
.approval-queue {
  display: flex; flex-direction: column; gap: 10px;
}
.approval-item {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
.approval-item .tool {
  font-family: var(--mono); color: var(--accent); font-weight: 600;
}
.approval-item .reason { color: var(--text-dim); font-size: 12px; }
.approval-item .input  {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  word-break: break-word;
  max-height: 80px;
  overflow-y: auto;
}
.btn {
  padding: 7px 14px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  font-weight: 700;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { background: var(--bg-2); }
.btn-go    { background: var(--green); color: var(--bg-0); border-color: var(--green); }
.btn-stop  { background: var(--red); color: white; border-color: var(--red); }

/* ----------------------------- Cascades --------------------------------- */
.cascades { display: flex; flex-direction: column; gap: 12px; }
.cascade-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.cascade-card .head {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px;
}
.cascade-card .head .id { color: var(--accent); }
.cascade-card .progress {
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}
.cascade-card .progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
}

/* ----------------------------- SITREPs ---------------------------------- */
.sitreps { display: flex; flex-direction: column; gap: 14px; }
.sitrep-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}
.sitrep-card h3 {
  font-family: var(--sans);
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 2px;
}
.sitrep-card .field { display: flex; gap: 10px; }
.sitrep-card .field .k { color: var(--text-dim); width: 96px; }

/* ----------------------------- Roster ----------------------------------- */
.roster-list {
  display: flex; flex-direction: column; gap: 6px;
}
.roster-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 80px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono); font-size: 12px;
}
.roster-row .role { color: var(--accent); }

/* ----------------------------- Chat ------------------------------------- */
.chat-card { display: flex; flex-direction: column; min-height: 70vh; }
.chat-log {
  flex: 1;
  overflow-y: auto;
  font-family: var(--sans);
  font-size: 13px;
  padding: 10px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 14px;
  min-height: 50vh;
}
.chat-msg { padding: 10px 14px; border-radius: 8px; max-width: 80%; }
.chat-msg.user   { align-self: flex-end; background: var(--accent); color: var(--bg-0); }
.chat-msg.agent  { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); }
.chat-msg .model {
  font-size: 10px; color: var(--text-dim); margin-top: 6px;
  font-family: var(--mono); letter-spacing: 1px;
}
.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.chat-form input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
}
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-form button {
  background: var(--accent);
  color: var(--bg-0);
  font-weight: 700;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  letter-spacing: 1.5px;
  cursor: pointer;
}

/* ----------------------------- Filter chips ----------------------------- */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.chip {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 1px;
}
.chip.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ----------------------------- Misc ------------------------------------- */
.exposure { font-family: var(--mono); font-size: 12px; line-height: 1.8; }
.decisions { display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 12px; }
.decision-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
}
.decision-card .ts { color: var(--muted); }
.decision-card .summary { color: var(--text); margin-top: 4px; }

/* ----------------------------- Floating capability toolbar ------------- */
/* Capability launcher — single glass pill → the /capabilities index.
   (Replaced the four floating clusters; the .cap-toolbar/.cap-btn rules
   below are retained but no longer rendered.) */
.cap-launch {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  background: rgba(13, 17, 23, 0.78);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  transition: all 140ms ease;
}
.cap-launch i { font-size: 15px; }
.cap-launch:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateY(-1px);
}
.cap-launch.active {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, rgba(13, 17, 23, 0.78));
}
@media (max-width: 720px) {
  .cap-launch span { display: none; }
  .cap-launch { padding: 12px; }
}

.cap-toolbar {
  position: fixed;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(13, 17, 23, 0.78);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  z-index: 80;
}
.cap-toolbar.cap-right { right: 22px; }
.cap-toolbar.cap-left  { left: 270px; }
.cap-toolbar.cap-row-1 { bottom: 78px; }
.cap-toolbar.cap-row-2 { bottom: 22px; }

.cap-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: 13px;
  transition: all 140ms ease;
  position: relative;
}
.cap-btn:hover {
  color: var(--cap, var(--accent));
  border-color: var(--cap, var(--accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--cap, var(--accent)) 45%, transparent);
  transform: translateY(-1px);
}
.cap-btn.active {
  color: var(--cap, var(--accent));
  border-color: var(--cap, var(--accent));
  background: color-mix(in srgb, var(--cap, var(--accent)) 14%, var(--bg-2));
}
.cap-btn.st-ok::after {
  content: "";
  position: absolute;
  top: 2px; right: 2px;
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green);
}
.cap-btn.st-warn::after {
  content: ""; position: absolute; top: 2px; right: 2px;
  width: 6px; height: 6px; background: var(--yellow);
  border-radius: 50%; box-shadow: 0 0 6px var(--yellow);
}
.cap-btn.st-off::after {
  content: ""; position: absolute; top: 2px; right: 2px;
  width: 6px; height: 6px; background: var(--muted);
  border-radius: 50%;
}

@media (max-width: 1100px) {
  .cap-toolbar.cap-left  { left: 230px; }
}
@media (max-width: 720px) {
  .cap-toolbar { display: none; }
}

/* ----------------------------- Status chips ---------------------------- */
.cap-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 700;
  margin-left: 10px;
  text-transform: uppercase;
}
.cap-chip.st-live,    .st-live    { color: var(--green);    border: 1px solid var(--green); }
.cap-chip.st-dry-run, .st-dry-run { color: var(--yellow);   border: 1px solid var(--yellow); }
.cap-chip.st-planned, .st-planned { color: var(--muted);    border: 1px solid var(--line-2); }

.cap-index-intro {
  font-size: 13px;
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 20px;
}

/* ----------------------------- Capability cards ------------------------ */
.cap-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.cap-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  position: relative;
  overflow: hidden;
}
.cap-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cap, var(--accent)), transparent);
  opacity: 0.5;
}
.cap-card:hover {
  border-color: var(--cap, var(--accent));
  transform: translateY(-1px);
}
.cap-card.st-planned { opacity: 0.65; }
.cap-card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cap, var(--accent)) 14%, var(--bg-2));
  color: var(--cap, var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.cap-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.4px;
}
.cap-card-blurb {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.5;
}
.cap-card-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ----------------------------- Capabilities ---------------------------- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.cap-tile {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  display: block;
  position: relative;
  overflow: hidden;
}
.cap-tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}
.cap-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.cap-tile h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 1px;
}
.cap-tile p {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 12px;
  line-height: 1.5;
}
.cap-meta {
  display: flex; gap: 8px;
  font-family: var(--mono); font-size: 11px;
  color: var(--muted);
}

@media (max-width: 1100px) { .cap-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px)  { .cap-grid { grid-template-columns: 1fr; } }

/* ----------------------------- Integrations ---------------------------- */
.import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.import-tile {
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 12px 14px;
}
.import-tile h3 {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 1.6px;
  color: var(--accent);
}
.import-tile p { font-size: 11px; margin: 4px 0 10px; }
.import-tile input[type=file] {
  font-size: 11px; color: var(--text-dim);
}
.import-tile a { display: inline-block; margin-top: 8px; font-size: 11px; text-decoration: underline; }

.connectors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.connector-tile {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
}
.connector-name {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-size: 12px;
}
.connector-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin: 4px 0 6px;
}
.connector-url {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg-0);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

@media (max-width: 1100px) {
  body { grid-template-columns: 200px 1fr; }
  .grid-overview { grid-template-columns: 1fr 1fr; }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 720px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid-overview, .grid-2 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
}

/* ===========================================================================
   Floating capability toolbar — four glass clusters (v2-alpha style)
   =========================================================================== */
.cap-toolbar {
  position: fixed;
  z-index: 9000;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 12px;
  background: rgba(13, 17, 23, 0.72);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(10px);
}
.cap-toolbar.cap-left  { left: 256px; }
.cap-toolbar.cap-right { right: 20px; }
.cap-toolbar.cap-row-1 { bottom: 16px; }
.cap-toolbar.cap-row-2 { bottom: 72px; }

.cap-btn {
  width: 42px; height: 42px;
  border-radius: 6px;                 /* squarer = more utilitarian */
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-dim);             /* monochrome by default */
  background: #0a0a0b;
  border: 1px solid var(--line-2);
  transition: transform .12s, box-shadow .12s, background .12s, color .12s, border-color .12s;
  flex-shrink: 0;
  position: relative;
  filter: grayscale(1);               /* hold identity color back */
}
.cap-btn:hover {
  transform: translateY(-2px);
  filter: grayscale(0);
  color: var(--cap);
  border-color: color-mix(in srgb, var(--cap) 60%, transparent);
  background: #111;
  box-shadow: 0 0 12px color-mix(in srgb, var(--cap) 35%, transparent);
}
.cap-btn.active {
  filter: grayscale(0);
  color: var(--cap);
  border-color: var(--cap);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cap) 40%, transparent);
}
.cap-btn.st-planned { opacity: 0.55; }
.cap-btn.st-planned::after {
  content: ""; position: absolute; right: 4px; bottom: 4px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted);
}

/* status chips + tokens */
.cap-chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .5px;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
  margin-left: 8px; vertical-align: middle;
  border: 1px solid currentColor;
}
.st-live    { color: var(--green); }
.st-dry-run { color: var(--yellow); }
.st-planned { color: var(--muted); }

/* ---- capability page ---- */
.cap-hero {
  display: flex; gap: 18px; align-items: center;
  padding: 18px 20px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--cap) 14%, var(--bg-1)) 0%, var(--bg-1) 60%);
}
.cap-hero-icon {
  width: 56px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--cap);
  background: rgba(0,0,0,0.3);
  border: 1px solid color-mix(in srgb, var(--cap) 50%, transparent);
}
.cap-hero-title { font-size: 20px; font-weight: 700; }
.cap-hero-blurb { color: var(--text-dim); margin: 6px 0 0; max-width: 70ch; }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cap-grid .span-2 { grid-column: 1 / -1; }

dl.wiring { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
dl.wiring dt { color: var(--muted); font-size: 12px; }
dl.wiring dd { margin: 0; font-size: 13px; }
.wiring-note { color: var(--text-dim); font-size: 12px; margin-top: 12px; }
.tag {
  font-family: var(--mono); font-size: 11px;
  padding: 1px 6px; margin-right: 4px; border-radius: 4px;
  background: var(--bg-3); color: var(--text-dim);
}
code {
  font-family: var(--mono); font-size: 12px;
  background: var(--bg-3); padding: 1px 5px; border-radius: 4px;
  color: var(--accent);
}

/* ---- capabilities index grid ---- */
.cap-index-intro { margin-bottom: 16px; }
.cap-cards {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.cap-card {
  display: flex; gap: 14px; padding: 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-1); transition: border-color .15s, transform .15s;
}
.cap-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--cap) 60%, var(--line));
}
.cap-card-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--cap);
  background: rgba(0,0,0,0.3);
  border: 1px solid color-mix(in srgb, var(--cap) 45%, transparent);
}
.cap-card-title { font-weight: 650; }
.cap-card-blurb { color: var(--text-dim); font-size: 12px; margin: 4px 0; }
.cap-card-meta { color: var(--muted); font-size: 11px; font-family: var(--mono); }

/* ===========================================================================
   "BAD ASS" tactical layer — grid, vignette, corner brackets, stencil type.
   Pure greyscale chrome. Sits on top of the monochrome base.
   =========================================================================== */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 28px 100%,
    radial-gradient(ellipse at 50% 0%, transparent 55%, rgba(0,0,0,0.55) 100%);
}
.sidebar, .page { position: relative; z-index: 1; }

/* heavier divider + scanline tick on the top bar */
.page-head {
  border-bottom: 1px solid var(--line-2);
  position: relative;
}
.page-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 120px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* stencil-style headings */
.page-head h1, .card-head h2 {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 2px;
}
.page-head h1 { font-size: 17px; }
.page-head h1::before {
  content: "▮ "; color: var(--accent); opacity: .8;
}

/* brand: boxed callsign */
.brand-glyph {
  color: #fff !important;
  text-shadow: 0 0 14px rgba(255,255,255,0.25);
  border: 1px solid var(--line-2);
  padding: 6px 10px;
  display: inline-block;
  border-radius: 4px;
  background: #0a0a0b;
}

/* classification strip in the sidebar footer */
.sidebar-footer::before {
  content: "UNCLASS // FOUO";
  display: block;
  font-family: var(--mono); font-size: 9px; letter-spacing: 2px;
  color: var(--muted);
  border-top: 1px dashed var(--line-2);
  padding-top: 8px; margin-bottom: 8px;
}

/* cards: sharp, framed, faint top highlight */
.card {
  border-radius: 6px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent 40px),
    var(--bg-1);
}

/* corner brackets on the capability hero — targeting reticle vibe */
.cap-hero {
  border-radius: 6px;
  position: relative;
}
.cap-hero::before, .cap-hero::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid var(--cap);
}
.cap-hero::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.cap-hero::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.cap-hero-icon { border-radius: 6px; }
.cap-hero-title { font-family: var(--mono); text-transform: uppercase; letter-spacing: 1.5px; }

/* capability cards: squarer + left status rail */
.cap-card { border-radius: 6px; border-left: 3px solid var(--line-2); }
.cap-card.st-live    { border-left-color: var(--green); }
.cap-card.st-dry-run { border-left-color: var(--yellow); }
.cap-card.st-planned { border-left-color: var(--muted); }
.cap-card-icon { border-radius: 6px; filter: grayscale(.4); }
.cap-card:hover .cap-card-icon { filter: grayscale(0); }
.cap-card-title { font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }

/* toolbar cluster: add a tiny stencil label tab */
.cap-toolbar { border-radius: 8px; }
.cap-toolbar::before {
  content: attr(data-cluster);
  position: absolute; top: -16px; left: 4px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
}

/* status dot pulse */
.status-dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---- Define Watch page ---- */
.define-wrap { display: grid; grid-template-columns: 360px 1fr; gap: 16px; }
.define-form .fld { display: block; margin: 10px 0; font-family: var(--mono);
  font-size: 10px; letter-spacing: 1.5px; color: var(--text-dim); text-transform: uppercase; }
.define-form input, .define-form select, .define-form textarea {
  width: 100%; margin-top: 5px; padding: 8px 10px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 5px; color: var(--text);
  font-family: var(--sans); font-size: 13px; letter-spacing: normal; text-transform: none; }
.define-form input[type=range] { padding: 0; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-primary { width: 100%; margin-top: 14px; padding: 11px; cursor: pointer;
  background: var(--accent); color: #000; border: 0; border-radius: 5px;
  font-family: var(--mono); font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; font-size: 12px; }
.btn-primary:disabled { background: var(--bg-3); color: var(--muted); cursor: not-allowed; }
.live-preview { margin-top: 14px; padding: 10px; background: #000; border: 1px solid var(--line);
  border-radius: 6px; min-height: 60px; font-family: var(--mono); font-size: 11px; }
.preview-hdr { color: var(--red); letter-spacing: 1px; margin-bottom: 8px; text-transform: uppercase; }
.preview-row { padding: 2px 0; border-bottom: 1px solid var(--line); }
.define-map-col { display: flex; flex-direction: column; gap: 16px; }
.define-map { height: 460px; border: 1px solid var(--line); border-radius: 8px; }
.aoi-row { display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.aoi-row .title { flex: 1; }
.aoi-del { margin-left: auto; background: transparent; border: 1px solid var(--line-2);
  color: var(--red); border-radius: 4px; cursor: pointer; padding: 2px 7px; }

/* ---- AI Operator panel (Overview) ---- */
.ai-operator { margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ai-operator .card-head h2 i { color: var(--accent); margin-right: 6px; }
.ai-head-right { display: flex; align-items: center; gap: 12px; }
.ai-model { font-family: var(--mono); font-size: 11px; color: var(--green); }
.ai-status { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.btn-run { background: var(--accent); color: #000; border: 0; border-radius: 5px;
  font-family: var(--mono); font-weight: 700; font-size: 11px; letter-spacing: 1px;
  padding: 7px 12px; cursor: pointer; text-transform: uppercase; }
.btn-run:disabled { background: var(--bg-3); color: var(--muted); cursor: wait; }
.ai-body { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.ai-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.ai-summary { font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: var(--text); white-space: pre-wrap; max-height: 240px; overflow-y: auto;
  background: #000; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.ai-action-row { font-family: var(--mono); font-size: 11px; padding: 3px 0;
  border-bottom: 1px solid var(--line); }

/* ---- rendered markdown (Claude SITREPs / decisions / chat) ---- */
.md, .ai-summary { font-family: var(--sans); }
.md h1, .md h2, .md h3, .ai-summary h1, .ai-summary h2, .ai-summary h3 {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); margin: 12px 0 6px; }
.md h1, .ai-summary h1 { font-size: 14px; }
.md h2, .ai-summary h2 { font-size: 13px; }
.md h3, .ai-summary h3 { font-size: 12px; color: var(--text); }
.md p, .ai-summary p { margin: 6px 0; line-height: 1.5; }
.md strong, .ai-summary strong { color: #fff; }
.md ul, .md ol, .ai-summary ul, .ai-summary ol { margin: 6px 0; padding-left: 18px; }
.md li, .ai-summary li { margin: 2px 0; }
.md code, .ai-summary code { font-family: var(--mono); font-size: 11px;
  background: var(--bg-3); padding: 1px 5px; border-radius: 4px; color: var(--accent); }
.md table, .ai-summary table { border-collapse: collapse; width: 100%; margin: 8px 0;
  font-family: var(--mono); font-size: 11px; }
.md th, .ai-summary th { text-align: left; text-transform: uppercase; font-size: 10px;
  letter-spacing: 1px; color: var(--text-dim); border-bottom: 1px solid var(--line-2);
  padding: 6px 8px; }
.md td, .ai-summary td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.md tr:hover td, .ai-summary tr:hover td { background: var(--bg-2); }
.md hr, .ai-summary hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }

/* ---- analytics + threat graph ---- */
.chart { width: 100%; min-height: 220px; }
.threat-graph { width: 100%; height: 560px; }
.threat-graph svg { width: 100%; }
.graph-legend { display: flex; gap: 18px; margin-top: 12px; font-family: var(--mono);
  font-size: 11px; color: var(--text-dim); }
.graph-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.graph-legend .dot.aoi { background: #4dd0e1; }
.graph-legend .dot.case { background: #c0473f; }
.graph-legend .dot.actor { background: #9bb83f; }

/* ---- LLM on/off toggle ---- */
.ai-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.ai-toggle input { display: none; }
.ai-toggle .slider { width: 34px; height: 18px; border-radius: 10px; background: var(--bg-3);
  border: 1px solid var(--line-2); position: relative; transition: .2s; flex-shrink: 0; }
.ai-toggle .slider::before { content: ""; position: absolute; width: 12px; height: 12px;
  border-radius: 50%; background: var(--muted); top: 2px; left: 2px; transition: .2s; }
.ai-toggle input:checked + .slider { background: color-mix(in srgb, var(--green) 35%, #000);
  border-color: var(--green); }
.ai-toggle input:checked + .slider::before { transform: translateX(16px); background: var(--green); }
.ai-toggle-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; }

/* ---- live console page ---- */
.console-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.console-controls { display: flex; gap: 16px; align-items: center; font-family: var(--mono); font-size: 11px; }
.sys-errors.good { color: var(--green); }
.sys-errors.bad { color: var(--red); }
.console { background: #000; border: 1px solid var(--line); border-radius: 6px;
  height: calc(100vh - 180px); overflow-y: auto; padding: 12px;
  font-family: var(--mono); font-size: 11px; line-height: 1.45; }
.cline { white-space: pre-wrap; color: var(--text-dim); }
.cline.ok { color: var(--text); }
.cline.err { color: var(--red); }

/* ---- replay / spatiotemporal ---- */
.replay-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.replay-bar #rp-slider { flex: 1; accent-color: var(--accent); }
.rp-stamp { font-family: var(--mono); font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.replay-map { height: 460px; }

/* ---- sitrep generate bar ---- */
.sitrep-gen { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sitrep-gen select { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  border-radius: 5px; padding: 7px 10px; font-family: var(--mono); font-size: 12px; }

/* ---- connect page ---- */
.connect-wrap .fld { display: block; margin: 12px 0; font-family: var(--mono);
  font-size: 10px; letter-spacing: 1.5px; color: var(--text-dim); text-transform: uppercase; }
.connect-wrap input { width: 100%; max-width: 520px; margin-top: 5px; padding: 9px 11px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 5px;
  color: var(--text); font-family: var(--mono); font-size: 13px; letter-spacing: normal; }
.connect-result { margin-top: 14px; font-family: var(--mono); font-size: 12px;
  padding: 10px; border-radius: 6px; background: #000; border: 1px solid var(--line); min-height: 20px; }
.connect-result.good { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); color: var(--green); }
.connect-result.bad { border-color: color-mix(in srgb, var(--red) 50%, var(--line)); color: var(--red); }

/* ---- connect: insecure checkbox ---- */
.fld-check { display: flex; align-items: center; gap: 8px; margin: 10px 0;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.fld-check input { width: auto; }

/* ---- AI controls ---- */
.posture-slider { width: 100%; accent-color: var(--accent); height: 6px; }
.posture-scale { display: flex; justify-content: space-between; font-family: var(--mono);
  font-size: 10px; color: var(--muted); margin-top: 6px; }
.posture-badge { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--accent); }
#ct-prompt, .controls-page textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2);
  color: var(--text); border-radius: 6px; padding: 10px; font-family: var(--mono); font-size: 12px; }
.ct-row { display: flex; gap: 14px; margin: 12px 0; }
.ct-row .fld { flex: 1; display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--text-dim); text-transform: uppercase; }
.ct-row input, .ct-row select { width: 100%; margin-top: 5px; padding: 8px 10px; background: var(--bg-2);
  border: 1px solid var(--line-2); color: var(--text); border-radius: 5px; font-family: var(--mono); font-size: 12px; }
