/* ============================================================
   Argorix SOC Agent Fabric — visual system
   Professional security console: dense, legible, calm.
   Motion is purposeful (see app.js / GSAP), never decorative.
   ============================================================ */

:root {
  /* Elevation ramp — cool neutrals, not pure grey */
  --bg: #0a0e14;
  --surface: #10161f;
  --surface-2: #151d28;
  --surface-3: #1b2432;
  --hairline: #1e2836;
  --border: #26313f;
  --border-strong: #33404f;

  /* Text ramp */
  --text: #e4eaf2;
  --text-dim: #b3c0d1;
  --muted: #8493a6;
  --faint: #5a6878;

  /* Semantics — calibrated for dark backgrounds */
  --accent: #4c9aff;
  --accent-soft: rgba(76, 154, 255, 0.12);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.12);
  --warn: #f5b942;
  --warn-soft: rgba(245, 185, 66, 0.12);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --critical: #ff4d78;
  --critical-soft: rgba(255, 77, 120, 0.12);

  --radius: 8px;
  --radius-sm: 5px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, .45);
  --mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, monospace;
  --sans: "Bahnschrift", "Aptos Display", "Segoe UI Variable Text", system-ui, sans-serif;

  font-size: 14px;
  color-scheme: dark;
}

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

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(76, 154, 255, .06), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 77, 120, .04), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: "cv02", "cv03", "tnum";
  height: 100vh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100vh; display: flex; flex-direction: column; }

::selection { background: var(--accent-soft); color: var(--text); }

/* Scrollbars — thin, unobtrusive */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px;
                             border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------------- login ---------------- */
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh;
              padding: 1rem; }
.login-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: 14px;
  padding: 2.2rem 2rem 1.9rem; width: 396px; box-shadow: var(--shadow-2);
  position: relative; overflow: hidden;
}

.google-login {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; margin: 24px 0 0; padding: 0 18px;
  border: 1px solid #747775; border-radius: 6px; background: #fff;
  color: #1f1f1f; text-decoration: none; font-size: 14px; font-weight: 650;
  letter-spacing: .01em; box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.google-login:hover {
  background: #f8faff; border-color: #5f6368;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22); transform: translateY(-1px);
}
.google-login:active { background: #eef3fe; transform: translateY(0); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.google-login:focus-visible { outline-color: #8ab4f8; outline-offset: 3px; }
.google-logo { display: block; width: 20px; height: 20px; flex: 0 0 20px; }
.login-divider { margin:20px 0 12px; color:#607997; font-size:10px; letter-spacing:.12em; text-align:center; text-transform:uppercase; }
.login-lock { margin:22px 0 10px; padding:13px 14px; border:1px solid #745d25; border-radius:7px;
  background:#2a220f; color:#e7c873; font-size:12px; line-height:1.55; }
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76, 154, 255, .55), transparent);
}
.login-logo {
  display: block; width: 292px; height: 206px; margin: -.4rem auto .2rem;
  background-image: url("/brand/1533635c-1f1b-46ac-9ada-3009d4161006.png");
  background-repeat: no-repeat;
  background-size: 439px 293px;
  background-position: -78px -42px;
}
.login-card .sub {
  color: var(--muted); font-size: .8rem; margin-bottom: 1.5rem; text-align: center;
  letter-spacing: .01em;
}
.field { margin-bottom: .85rem; }
.field label {
  display: block; font-size: .68rem; color: var(--muted); margin-bottom: .34rem;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.field input, .field select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: .58rem .7rem;
  font-size: .88rem; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input:hover, textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  background: var(--accent); color: #05121f; border: 0; border-radius: var(--radius-sm);
  padding: .58rem 1rem; font-weight: 650; cursor: pointer; font-size: .86rem;
  font-family: inherit; letter-spacing: .01em;
  transition: filter .15s ease, transform .1s ease, background .15s ease,
              border-color .15s ease, opacity .15s ease;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:active:not(:disabled) { transform: translateY(1px); }
button.secondary {
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border);
}
button.secondary:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
button.danger { background: var(--danger); color: #180507; }
button:disabled { opacity: .42; cursor: not-allowed; }
.login-card > button[type="submit"] { width: 100%; padding: .66rem; margin-top: .3rem; }
.error-msg {
  color: var(--danger); font-size: .8rem; margin-top: .75rem; text-align: center;
  background: var(--danger-soft); border: 1px solid rgba(255,107,107,.25);
  border-radius: var(--radius-sm); padding: .45rem .6rem;
}

/* ---------------- AI runtime settings ---------------- */
.settings-page { max-width: 1120px; margin: 0 auto; width: 100%; }
.runtime-note {
  margin: 0 0 1rem; padding: .75rem .85rem; border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent); color: var(--text-dim);
  font-size: .84rem;
}
.runtime-profile { margin-bottom: .85rem; }
.runtime-profile-head { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom: .85rem; }
.runtime-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:.1rem .8rem; }
.runtime-grid .field { min-width:0; }
.runtime-options { display:flex; align-items:center; gap:1.1rem; margin-top:.15rem; color:var(--text-dim); font-size:.82rem; }
.runtime-options label { display:flex; align-items:center; gap:.38rem; cursor:pointer; }
.runtime-options input { accent-color:var(--accent); }
.runtime-actions { display:flex; justify-content:flex-end; gap:.55rem; margin-top:.85rem; }
.runtime-error { color:var(--danger); margin-top:.55rem; }
@media (max-width: 960px) { .runtime-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .runtime-grid { grid-template-columns:1fr; } .runtime-options { align-items:flex-start; flex-direction:column; gap:.5rem; } }
.mcp-catalog { margin-top: 1rem; }
.mcp-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:.55rem; margin-top:.75rem; }
.mcp-entry { min-width:0; padding:.7rem; border:1px solid var(--hairline); border-radius:var(--radius-sm); background:var(--surface-2); }
.mcp-entry-head { display:flex; align-items:flex-start; justify-content:space-between; gap:.5rem; margin-bottom:.4rem; }
.mcp-entry .small { margin:.25rem 0; overflow-wrap:anywhere; }
.mcp-entry a { display:inline-block; margin-top:.35rem; color:var(--accent); font-size:.75rem; text-decoration:none; }
.mcp-entry a:hover { text-decoration:underline; }
@media (max-width: 760px) { .mcp-grid { grid-template-columns:1fr; } }

/* ---------------- shell ---------------- */
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: 0 1rem;
  height: 54px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  font-weight: 750; letter-spacing: .1em; font-size: .82rem; display: flex;
  align-items: center; gap: .55rem; white-space: nowrap; flex-shrink: 0;
}
.topbar .brand span { color: var(--accent); }
.brand-mark {
  height: 28px; width: 28px; flex-shrink: 0;
  background-image: url("/brand/1533635c-1f1b-46ac-9ada-3009d4161006.png");
  background-repeat: no-repeat;
  background-size: 126.5px 84.4px;
  background-position: -48.6px -10.3px;
}
.topbar nav { display: flex; gap: .1rem; }
.topbar nav a {
  color: var(--muted); text-decoration: none; padding: .4rem .72rem;
  border-radius: var(--radius-sm); font-size: .83rem; font-weight: 500;
  position: relative; transition: color .15s ease, background .15s ease;
}
.topbar nav a:hover { color: var(--text-dim); background: var(--surface-3); }
.topbar nav a.active { color: var(--text); background: var(--surface-3); }
.topbar nav a.active::after {
  content: ""; position: absolute; left: .72rem; right: .72rem; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.topbar .spacer { flex: 1; }
.topbar .who-label { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.topbar .who-label b { color: var(--text-dim); font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; padding: .14rem .5rem; border-radius: 999px;
  font-size: .66rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
  background: var(--surface-3);
}
.badge.level { color: var(--accent); border-color: rgba(76,154,255,.35); background: var(--accent-soft); }
.badge.sim { color: var(--warn); border-color: rgba(245,185,66,.3); background: var(--warn-soft); }
.badge.ok { color: var(--ok); border-color: rgba(61,220,151,.3); background: var(--ok-soft); }
.badge.risk-informational { color: var(--muted); }
.badge.risk-low { color: var(--ok); border-color: rgba(61,220,151,.3); }
.badge.risk-medium { color: var(--warn); border-color: rgba(245,185,66,.3); }
.badge.risk-high { color: var(--danger); border-color: rgba(255,107,107,.3); background: var(--danger-soft); }
.badge.risk-critical { color: var(--critical); border-color: rgba(255,77,120,.35); background: var(--critical-soft); }
.badge.injection { color: var(--critical); border-color: rgba(255,77,120,.45); background: var(--critical-soft); }

.main { flex: 1; overflow: auto; padding: 1.1rem 1.2rem; }

/* ---------------- SOC operations ----------------
   Direction: command-center editorial. Dense telemetry is framed by large,
   quiet typography and sharp risk signals instead of generic dashboard tiles. */
.operations-page, .alert-detail { max-width: 1480px; margin: 0 auto; }
.ops-hero {
  min-height: 188px; display: grid; grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center; gap:2rem; margin:-1.1rem -1.2rem 1rem; padding:2.2rem 2.4rem;
  border-bottom:1px solid var(--border); overflow:hidden; position:relative;
  background:
    linear-gradient(90deg, rgba(76,154,255,.08), transparent 42%),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(255,255,255,.018) 80px),
    var(--surface);
}
.ops-hero::after { content:""; position:absolute; right:16%; top:-110px; width:360px; height:360px;
  border:1px solid rgba(76,154,255,.13); border-radius:50%; box-shadow:0 0 0 48px rgba(76,154,255,.018),0 0 0 96px rgba(76,154,255,.012); pointer-events:none; }
.ops-hero-copy { position:relative; z-index:1; max-width:760px; }
.ops-kicker { color:var(--accent); font-family:var(--mono); font-size:.67rem; letter-spacing:.14em;
  font-weight:700; margin-bottom:.45rem; }
.ops-hero h1, .alert-command h1 { font-size:clamp(1.8rem, 3vw, 3rem); line-height:1; letter-spacing:-.045em; font-weight:750; }
.ops-hero p { color:var(--text-dim); max-width:700px; line-height:1.55; margin-top:.8rem; }
.ops-posture { display:flex; align-items:center; gap:1rem; position:relative; z-index:1; }
.posture-ring { width:112px; height:112px; border-radius:50%; display:grid; place-content:center; text-align:center;
  background:radial-gradient(circle at center, var(--surface) 57%, transparent 59%),
             conic-gradient(var(--ok) var(--coverage), var(--surface-3) 0);
  box-shadow:inset 0 0 0 1px var(--border), 0 0 40px rgba(61,220,151,.06); }
.posture-ring strong { font-size:1.5rem; line-height:1; }
.posture-ring span { color:var(--muted); font:600 .52rem var(--mono); letter-spacing:.08em; margin-top:.35rem; }
.ops-posture .small { margin-top:.5rem; max-width:150px; }
.ops-ingest { position:relative; z-index:1; white-space:nowrap; }
.ops-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.65rem; margin-bottom:.8rem; }
.ops-metric { background:var(--surface); border:1px solid var(--border); border-top:2px solid var(--border-strong);
  padding:.85rem 1rem 1rem; min-height:108px; position:relative; overflow:hidden; }
.ops-metric::after { content:""; position:absolute; right:-28px; bottom:-34px; width:90px; height:90px;
  border:1px solid var(--hairline); transform:rotate(45deg); }
.ops-metric.accent { border-top-color:var(--accent); }
.ops-metric.critical { border-top-color:var(--critical); }
.ops-metric.danger { border-top-color:var(--danger); background:linear-gradient(180deg,var(--danger-soft),var(--surface) 70%); }
.ops-metric-label { color:var(--muted); font:.65rem var(--mono); text-transform:uppercase; letter-spacing:.1em; }
.ops-metric-value { font-size:2rem; line-height:1; font-weight:750; letter-spacing:-.04em; margin:.65rem 0 .35rem; }
.ops-metric-note { color:var(--faint); font-size:.71rem; }
.ops-grid { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:.8rem; align-items:start; }
.ops-queue, .ops-side { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.ops-section-head { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.9rem 1rem;
  border-bottom:1px solid var(--hairline); }
.ops-section-head .ops-kicker { margin:0 0 .2rem; }
.ops-section-head h2 { font-size:.98rem; }
.ops-table-wrap { overflow:auto; }
.ops-table tbody tr { cursor:pointer; }
.ops-table tbody tr.sla-breached { background:linear-gradient(90deg,rgba(255,107,107,.07),transparent 38%); }
.ops-table td { padding:.75rem .7rem; }
.ops-table td:nth-child(2) b { display:block; max-width:520px; margin-bottom:.22rem; }
.risk-score { width:44px; height:44px; display:grid; place-content:center; font:750 1rem var(--mono);
  border:1px solid var(--border); background:var(--surface-2); }
.risk-score.low { color:var(--ok); border-color:rgba(61,220,151,.3); }
.risk-score.medium { color:var(--warn); border-color:rgba(245,185,66,.3); }
.risk-score.high { color:var(--danger); border-color:rgba(255,107,107,.35); }
.risk-score.critical { color:var(--critical); border-color:rgba(255,77,120,.5); box-shadow:0 0 18px rgba(255,77,120,.1); }
.confidence { display:block; color:var(--faint); font-size:.58rem; margin-top:.18rem; white-space:nowrap; }
.sla-text { font:600 .66rem var(--mono); color:var(--text-dim); white-space:nowrap; }
.sla-text.breached { color:var(--danger); }
.ops-side { padding-bottom:1rem; }
.status-row { display:grid; grid-template-columns:90px 1fr 24px; gap:.55rem; align-items:center; padding:.6rem 1rem 0; }
.status-row > span { color:var(--text-dim); font-size:.72rem; text-transform:capitalize; }
.status-row > b { text-align:right; font:700 .72rem var(--mono); }
.status-track { height:4px; background:var(--surface-3); overflow:hidden; }
.status-track i { display:block; height:100%; background:var(--accent); }
.ops-principle { margin:1rem 1rem 0; padding:1rem; border:1px solid rgba(76,154,255,.18); background:var(--accent-soft); }
.ops-principle > span { display:block; color:var(--accent); font:.58rem var(--mono); letter-spacing:.1em; }
.ops-principle b { display:block; margin:.5rem 0; font-size:.87rem; }
.ops-principle p { color:var(--muted); font-size:.74rem; line-height:1.5; }
.ops-empty { min-height:320px; display:grid; place-content:center; justify-items:center; gap:.55rem; color:var(--muted); text-align:center; }
.ops-empty span { max-width:380px; font-size:.8rem; }
.empty-radar { width:72px; height:72px; border:1px solid var(--border-strong); border-radius:50%; position:relative;
  background:linear-gradient(90deg,transparent 49%,var(--border) 50%,transparent 51%),linear-gradient(transparent 49%,var(--border) 50%,transparent 51%); }
.empty-radar::after { content:""; position:absolute; inset:10px; border:1px solid var(--hairline); border-radius:50%; }

/* alert command detail */
.back-link { display:inline-block; color:var(--muted); text-decoration:none; font-size:.76rem; margin-bottom:.8rem; }
.back-link:hover { color:var(--accent); }
.alert-command { display:grid; grid-template-columns:118px minmax(0,1fr) auto; gap:1.4rem; align-items:center;
  background:var(--surface); border:1px solid var(--border); padding:1.3rem; margin-bottom:.8rem; position:relative; overflow:hidden; }
.alert-command::after { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--accent); }
.alert-score { width:108px; height:108px; display:grid; place-content:center; text-align:center; border:1px solid var(--border-strong); background:var(--surface-2); }
.alert-score > span { font:.58rem var(--mono); letter-spacing:.14em; color:var(--muted); }
.alert-score strong { font:750 2.5rem var(--mono); line-height:1; margin:.3rem 0; }
.alert-score small { color:var(--muted); font-size:.62rem; }
.alert-score.critical strong { color:var(--critical); }
.alert-score.high strong { color:var(--danger); }
.alert-score.medium strong { color:var(--warn); }
.alert-score.low strong { color:var(--ok); }
.alert-command h1 { font-size:clamp(1.35rem,2.4vw,2.3rem); }
.alert-command-copy > p { color:var(--text-dim); margin:.65rem 0; line-height:1.5; max-width:850px; }
.alert-tags { display:flex; gap:.4rem; flex-wrap:wrap; }
.alert-actions { display:flex; flex-direction:column; gap:.45rem; min-width:170px; }
.alert-detail-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 300px; gap:.8rem; align-items:start; }
.alert-detail-grid .card { padding:0; overflow:hidden; }
.factor-row { display:grid; grid-template-columns:48px 1fr; gap:.8rem; padding:.85rem 1rem; border-bottom:1px solid var(--hairline); }
.factor-impact { color:var(--accent); font:750 1rem var(--mono); padding-top:.08rem; }
.factor-row b { text-transform:capitalize; font-size:.84rem; }
.factor-row p, .recommendation p { color:var(--muted); font-size:.76rem; line-height:1.45; margin-top:.2rem; }
.untrusted-strip { color:var(--warn); background:var(--warn-soft); padding:.7rem 1rem; font-size:.7rem; border-top:1px solid rgba(245,185,66,.2); }
.recommendation { display:grid; grid-template-columns:40px 1fr; gap:.7rem; padding:.85rem 1rem; border-bottom:1px solid var(--hairline); }
.rec-number { color:var(--faint); font:700 .7rem var(--mono); padding-top:.15rem; }
.rec-meta { display:flex; gap:.35rem; margin-bottom:.42rem; }
.recommendation b { font-size:.84rem; }
.alert-context { padding:.95rem 1rem !important; }
.context-row { display:flex; justify-content:space-between; gap:1rem; padding:.62rem 0; border-bottom:1px solid var(--hairline); }
.context-row span { color:var(--muted); font-size:.7rem; }
.context-row b { text-align:right; font:600 .72rem var(--mono); overflow-wrap:anywhere; }
.case-link { display:block; color:var(--accent); text-decoration:none; margin-top:.85rem; font-size:.76rem; }
.feedback-log { padding:0; margin-top:.8rem; }
.feedback-item { display:grid; grid-template-columns:auto 1fr auto; gap:.8rem; align-items:center; padding:.75rem 1rem; border-bottom:1px solid var(--hairline); }
.feedback-item time { color:var(--faint); font:.65rem var(--mono); }

@media (max-width:1150px) {
  .ops-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .alert-detail-grid { grid-template-columns:1fr 1fr; }
  .alert-context { grid-column:1/-1; }
}
@media (max-width:850px) {
  .ops-hero { grid-template-columns:1fr; gap:1rem; }
  .ops-posture { display:none; }
  .ops-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ops-grid, .alert-detail-grid { grid-template-columns:1fr; }
  .alert-command { grid-template-columns:88px 1fr; }
  .alert-score { width:80px; height:80px; }
  .alert-actions { grid-column:1/-1; flex-direction:row; flex-wrap:wrap; }
}

/* ---------------- lists / cards / tables ---------------- */
.page-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.page-head h2 { font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .95rem 1rem; margin-bottom: .7rem; box-shadow: var(--shadow-1);
  transition: border-color .15s ease, background .15s ease;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--border-strong); background: var(--surface-2); }
.card-title { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.card-title b { font-size: .92rem; font-weight: 650; }

table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th {
  text-align: left; color: var(--muted); font-weight: 650; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .07em; padding: .5rem .65rem;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }
td { padding: .52rem .65rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); font-size: .77rem; font-variant-ligatures: none; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }

/* ---------------- investigation workspace ---------------- */
.workspace {
  display: grid; grid-template-columns: 330px minmax(0, 1fr) 358px; gap: .8rem;
  height: calc(100vh - 54px - 2.2rem);
}
.workspace > section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-1);
}
.workspace h3 {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  padding: .72rem .9rem; border-bottom: 1px solid var(--hairline); flex-shrink: 0;
  font-weight: 650; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  background: var(--surface-2);
}
.panel-body { flex: 1; overflow-y: auto; padding: .85rem .9rem; }

/* metric strip */
.metrics { display: flex; gap: .5rem; padding: .6rem .9rem; flex-shrink: 0;
           border-bottom: 1px solid var(--hairline); background: var(--surface); }
.metric { flex: 1; background: var(--surface-2); border: 1px solid var(--hairline);
          border-radius: var(--radius-sm); padding: .4rem .55rem; min-width: 0; }
.metric-value { font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums;
                line-height: 1.15; }
.metric-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .07em;
                color: var(--faint); font-weight: 600; white-space: nowrap;
                overflow: hidden; text-overflow: ellipsis; }
.metric.accent .metric-value { color: var(--accent); }
.metric.warn .metric-value { color: var(--warn); }
.metric.danger .metric-value { color: var(--danger); }

/* chat */
.chat-msg { margin-bottom: .75rem; }
.chat-msg .who { font-size: .67rem; color: var(--faint); margin-bottom: .25rem;
                 text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.chat-msg .bubble {
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: .58rem .72rem; font-size: .85rem;
  white-space: pre-wrap; word-break: break-word; line-height: 1.5; color: var(--text-dim);
}
.chat-msg.analyst .bubble { border-color: rgba(76,154,255,.3); background: var(--accent-soft);
                            color: var(--text); }
.chat-input { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--hairline);
              background: var(--surface-2); }
.chat-input textarea { resize: none; height: 62px; flex: 1; font-size: .84rem; }

/* tabs */
.tabs { display: flex; gap: .15rem; padding: .5rem .6rem 0; flex-shrink: 0;
        border-bottom: 1px solid var(--hairline); background: var(--surface-2); }
.tabs button {
  background: none; color: var(--muted); font-size: .77rem; padding: .42rem .7rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-weight: 600;
  position: relative; letter-spacing: .01em;
}
.tabs button:hover { color: var(--text-dim); }
.tabs button.active { color: var(--text); background: var(--surface); }
.tabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent);
}

/* plan steps */
.step { display: flex; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--hairline);
        font-size: .83rem; align-items: baseline; }
.step:last-child { border-bottom: 0; }
.step .st { width: 84px; flex-shrink: 0; font-size: .66rem; font-weight: 700;
            letter-spacing: .06em; }
.st.completed { color: var(--ok); } .st.failed { color: var(--danger); }
.st.skipped { color: var(--faint); } .st.pending, .st.running { color: var(--warn); }

/* ---------------- tool trace ---------------- */
.trace-summary {
  margin-bottom: .7rem; padding: .5rem .65rem; background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
.trace-row {
  display: flex; gap: .6rem; align-items: flex-start; padding: .42rem .5rem;
  border-radius: var(--radius-sm); position: relative;
  transition: background .12s ease;
}
.trace-row:hover { background: var(--surface-2); }
.trace-row::before {
  content: ""; position: absolute; left: 12px; top: 26px; bottom: -4px; width: 1px;
  background: var(--hairline);
}
.trace-row:last-child::before { display: none; }
.trace-glyph {
  width: 16px; height: 16px; flex-shrink: 0; font-weight: 700; font-size: .7rem;
  display: grid; place-items: center; border-radius: 50%; margin-top: .1rem;
  border: 1px solid currentColor; background: var(--surface);
}
.trace-glyph.ok { color: var(--ok); }
.trace-glyph.deny { color: var(--danger); background: var(--danger-soft); }
.trace-glyph.warn { color: var(--warn); }
.trace-main { flex: 1; min-width: 0; }
.trace-call { font-size: .785rem; word-break: break-all; line-height: 1.45; }
.trace-tool { color: var(--text); font-weight: 600; }
.trace-args { color: var(--faint); }
.trace-reason { color: var(--danger); margin-top: .15rem; }
.trace-meta { flex-shrink: 0; white-space: nowrap; display: flex; align-items: center;
              gap: .35rem; font-variant-numeric: tabular-nums; }
.trace-skipped { margin-top: .7rem; padding-top: .55rem; border-top: 1px solid var(--hairline); }

/* ---------------- timeline ---------------- */
.timeline-item {
  padding: .55rem .1rem .55rem .75rem; border-left: 2px solid var(--hairline);
  font-size: .83rem; position: relative; margin-left: .2rem;
}
.timeline-item::before {
  content: ""; position: absolute; left: -5px; top: .82rem; width: 8px; height: 8px;
  border-radius: 50%; background: var(--border-strong); border: 2px solid var(--surface);
}
.timeline-item:hover { border-left-color: var(--border-strong); }
.timeline-item .t { color: var(--faint); font-family: var(--mono); font-size: .69rem;
                    display: flex; align-items: center; gap: .3rem; flex-wrap: wrap;
                    margin-bottom: .15rem; }
.timeline-item.injected { border-left-color: var(--critical); }
.timeline-item.injected::before { background: var(--critical); }

/* ---------------- findings ---------------- */
.finding-row {
  border: 1px solid var(--hairline); border-left-width: 3px; border-radius: var(--radius-sm);
  margin-bottom: .5rem; background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease;
}
.finding-row:hover { background: var(--surface-3); }
.finding-row.high { border-left-color: var(--danger); }
.finding-row.medium { border-left-color: var(--warn); }
.finding-row.low { border-left-color: var(--faint); }
.finding-row.blocked { border-left-color: var(--critical); }
.finding-head { display: flex; align-items: center; gap: .55rem; cursor: pointer;
                padding: .55rem .7rem; }
.finding-head:hover .finding-title { color: var(--accent); }
.finding-title { flex: 1; font-size: .865rem; font-weight: 600; line-height: 1.35;
                 transition: color .15s ease; }
.finding-caret { color: var(--faint); font-size: .7rem; flex-shrink: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--faint);
       box-shadow: 0 0 0 3px transparent; }
.dot.high, .dot.risk-high { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot.medium, .dot.risk-medium { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.blocked, .dot.risk-critical { background: var(--critical); box-shadow: 0 0 0 3px var(--critical-soft); }
.dot.risk-low { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conf-tag {
  font-size: .625rem; font-weight: 700; letter-spacing: .07em; padding: .14rem .42rem;
  border-radius: 3px; white-space: nowrap; border: 1px solid currentColor; flex-shrink: 0;
}
.conf-tag.high { color: var(--danger); background: var(--danger-soft); }
.conf-tag.medium { color: var(--warn); background: var(--warn-soft); }
.conf-tag.low { color: var(--muted); }
.conf-tag.blocked { color: var(--critical); background: var(--critical-soft); }
.finding-detail { padding: 0 .7rem .6rem 1.85rem; display: grid; gap: .3rem;
                  overflow: hidden; line-height: 1.5; }
.tech-chip {
  display: inline-block; font-family: var(--mono); font-size: .69rem;
  border: 1px solid var(--border); border-radius: 3px; padding: .05rem .32rem;
  margin-right: .25rem; color: var(--accent); background: var(--accent-soft);
}

/* ---------------- ATT&CK ---------------- */
.tactic { margin-top: .85rem; }
.tactic:first-of-type { margin-top: .6rem; }
.tactic-head { display: flex; justify-content: space-between; align-items: baseline;
               border-bottom: 1px solid var(--hairline); padding-bottom: .28rem;
               margin-bottom: .4rem; }
.tactic-name { font-size: .7rem; font-weight: 700; text-transform: uppercase;
               letter-spacing: .08em; color: var(--accent); }
.technique {
  display: grid; grid-template-columns: 74px 1fr auto; gap: .45rem; align-items: baseline;
  padding: .35rem .5rem; border-radius: var(--radius-sm); background: var(--surface-2);
  margin-bottom: .3rem; border: 1px solid transparent;
  transition: border-color .15s ease, background .15s ease;
}
.technique:hover { border-color: var(--border); background: var(--surface-3); }
.tech-id { font-size: .72rem; color: var(--accent); font-weight: 600; }
.tech-name { font-size: .79rem; color: var(--text-dim); }

/* ---------------- recommended actions ---------------- */
.rec-action {
  display: flex; align-items: center; gap: .55rem; width: 100%;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-left-width: 3px; text-align: left; margin-bottom: .42rem; padding: .55rem .65rem;
}
.rec-action:hover:not(:disabled) { border-color: var(--border-strong);
                                   background: var(--surface-3); }
.rec-action.risk-critical { border-left-color: var(--critical); }
.rec-action.risk-high { border-left-color: var(--danger); }
.rec-action.risk-medium { border-left-color: var(--warn); }
.rec-label { flex: 1; font-weight: 600; font-size: .84rem; }
.rec-risk { color: var(--faint); text-transform: uppercase; font-size: .62rem;
            letter-spacing: .07em; font-weight: 650; }
.rec-report { width: 100%; margin-top: .3rem; }

/* action / proposal cards */
.finding { border: 1px solid var(--border); border-radius: var(--radius-sm);
           padding: .65rem .75rem; margin-bottom: .6rem; background: var(--surface-2); }
.finding .fh { display: flex; justify-content: space-between; gap: .5rem;
               align-items: center; flex-wrap: wrap; margin-bottom: .3rem; }
.finding .fh b { font-size: .84rem; font-family: var(--mono); }
.drawer-row { display: flex; justify-content: space-between; gap: .8rem; padding: .26rem 0;
              font-size: .78rem; border-bottom: 1px dashed var(--hairline); }
.drawer-row:last-child { border-bottom: 0; }
.drawer-row .k { color: var(--faint); white-space: nowrap; }
.drawer-row .mono { text-align: right; word-break: break-all; color: var(--text-dim); }

.evd-link { color: var(--accent); cursor: pointer; font-family: var(--mono);
            font-size: .72rem; text-decoration: none; border-bottom: 1px dotted transparent; }
.evd-link:hover { border-bottom-color: var(--accent); }

pre.raw {
  background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: .6rem; overflow: auto; font-size: .72rem; max-height: 300px;
  font-family: var(--mono); white-space: pre-wrap; word-break: break-all;
  color: var(--text-dim); line-height: 1.5;
}

.notice {
  border: 1px solid rgba(245,185,66,.35); background: var(--warn-soft); color: var(--warn);
  border-radius: var(--radius-sm); padding: .55rem .7rem; font-size: .79rem;
  margin-bottom: .7rem; line-height: 1.45;
}
.notice.injection { border-color: rgba(255,77,120,.4); background: var(--critical-soft);
                    color: var(--critical); }
hr.sep { border: 0; border-top: 1px solid var(--hairline); margin: .85rem 0; }
.actions-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
h4.muted { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em;
           font-weight: 700; color: var(--faint); margin-bottom: .5rem; }

/* ---------------- flow graph ---------------- */
.graph { display: flex; flex-direction: column; align-items: center; gap: .12rem;
         padding: .4rem 0; }
.gnode {
  width: 100%; max-width: 330px; text-align: center; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); padding: .5rem .65rem;
  transition: border-color .15s ease;
}
.gnode:hover { border-color: var(--border-strong); }
.gnode.gate { border-color: rgba(76,154,255,.4); background: var(--accent-soft); }
.gnode.terminal { border-color: rgba(245,185,66,.35); background: var(--warn-soft); }
.gnode-title { font-size: .81rem; font-weight: 650; }
.gnode-sub { font-size: .71rem; color: var(--muted); word-break: break-word;
             margin-top: .1rem; }
.garrow { color: var(--border-strong); font-size: .85rem; line-height: 1.2; }
.gfan { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center;
        max-width: 380px; }
.gleaf { font-size: .71rem; border: 1px solid var(--border); border-radius: 999px;
         padding: .22rem .62rem; background: var(--surface-2); color: var(--text-dim); }

/* ---------------- toasts ---------------- */
#toasts { position: fixed; bottom: 1.1rem; right: 1.1rem; z-index: 60;
          display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: .6rem .75rem; box-shadow: var(--shadow-2); font-size: .82rem;
  display: flex; gap: .55rem; align-items: flex-start; line-height: 1.45;
}
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast-glyph { font-weight: 700; flex-shrink: 0; }
.toast.ok .toast-glyph { color: var(--ok); }
.toast.error .toast-glyph { color: var(--danger); }
.toast.warn .toast-glyph { color: var(--warn); }
.toast-body { min-width: 0; word-break: break-word; }
.toast-title { font-weight: 650; margin-bottom: .1rem; }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 8, 12, .72); z-index: 70;
  display: grid; place-items: center; padding: 1rem; backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
  width: 100%; max-width: 460px; overflow: hidden;
}
.modal-head { padding: .85rem 1rem; border-bottom: 1px solid var(--hairline);
              background: var(--surface-2); display: flex; align-items: center; gap: .55rem; }
.modal-title { font-size: .92rem; font-weight: 650; }
.modal-body { padding: 1rem; display: grid; gap: .7rem; max-height: 60vh; overflow-y: auto; }
.modal-foot { padding: .75rem 1rem; border-top: 1px solid var(--hairline);
              display: flex; justify-content: flex-end; gap: .5rem; background: var(--surface-2); }
.modal-summary { background: var(--surface-2); border: 1px solid var(--hairline);
                 border-radius: var(--radius-sm); padding: .6rem .7rem; }
.modal-warn { font-size: .79rem; color: var(--critical); background: var(--critical-soft);
              border: 1px solid rgba(255,77,120,.3); border-radius: var(--radius-sm);
              padding: .5rem .65rem; line-height: 1.45; }

/* ---------------- responsive ---------------- */
@media (max-width: 1280px) {
  .workspace { grid-template-columns: 290px minmax(0, 1fr) 320px; }
}
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  body { overflow: auto; }
  .workspace > section { max-height: 70vh; }
  .topbar { flex-wrap: wrap; height: auto; padding: .5rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
