:root {
  color-scheme: dark;
  --ink: #090b0e;
  --ink-soft: #14181d;
  --paper: #0d1014;
  --paper-raised: #12171c;
  --panel: #101419;
  --line: #29313a;
  --line-strong: #4a5661;
  --muted: #8e9aa5;
  --text: #edf3f6;
  --text-soft: #c2ccd2;
  --acid: #69d9ff;
  --acid-strong: #28b8ee;
  --danger: #f078d4;
  --warning: #f2b84b;
  --good: #69a9ff;
  --cool: #71808d;
  --sidebar: 244px;
  --inspector: 318px;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(640px, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--text);
  padding: 22px 16px 18px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 5px 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--acid);
  color: #071015;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.brand strong { display: block; font-size: 15px; letter-spacing: -.02em; }
.brand small, .automation-link small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.primary-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 5px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.nav-item:hover, .nav-item.is-active { background: #171d23; color: var(--text); }
.nav-icon { width: 16px; color: var(--acid); font-size: 17px; }
.nav-count { margin-left: auto; color: var(--muted); font-size: 11px; }

.sidebar-section { margin-top: 18px; }
.section-kicker { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar .section-kicker { padding: 0 8px 8px; color: var(--muted); }
.section-kicker span { float: right; color: var(--cool); }

.automation-link {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  padding: 10px 8px;
  text-align: left;
  cursor: pointer;
}

.automation-link.is-selected { background: #171d23; color: var(--text); box-shadow: inset 2px 0 var(--acid); }
.automation-link:disabled { cursor: default; opacity: .7; }
.automation-link strong { display: block; font-size: 12px; line-height: 1.35; }

.status-beacon, .connection-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--cool);
}

.status-beacon.is-live, .connection-dot { background: var(--acid); box-shadow: 0 0 0 4px rgba(105,217,255,.1); }

.sidebar-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 4px 7px;
  padding: 14px 8px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.sidebar-foot .connection-dot { grid-row: span 2; }
.sidebar-foot strong { color: var(--text-soft); font-size: 10px; font-weight: 600; }
.sidebar-foot form { grid-column: 2; }
.logout-button { border: 0; background: transparent; padding: 5px 0 0; color: var(--muted); font-size: 10px; cursor: pointer; }
.logout-button:hover, .logout-button:focus-visible { color: var(--text); text-decoration: underline; outline: none; }

.workspace { min-width: 0; padding: 26px 42px 64px; }

.workspace-header {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.workspace-title { display: flex; align-items: center; gap: 12px; min-width: max-content; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 2.5vw, 38px); line-height: 1; letter-spacing: -.055em; }
h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.04em; }
h3 { margin: 4px 0 7px; font-size: 21px; letter-spacing: -.035em; }

.state-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #2f7893;
  border-radius: 999px;
  color: var(--acid);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.state-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); }
.workspace-summary { max-width: 520px; margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.45; }
.header-actions { display: flex; flex: 0 0 auto; gap: 8px; }

.button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.button-primary { border-color: var(--acid); background: var(--acid); color: #071015; }
.button-primary:hover { background: #99e7ff; }
.button-quiet { background: transparent; }
.button-quiet { color: var(--text); }
.button-quiet:hover { background: #192028; }

.metric-line {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}

.metric-line > div { padding: 22px 20px 22px 0; }
.metric-line > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.metric-line span, .metric-line small { display: block; color: var(--muted); font-size: 10px; }
.metric-line span { margin-bottom: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.metric-line strong { display: block; font-size: 17px; letter-spacing: -.025em; }
.metric-line strong em { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 600; }
.metric-line small { margin-top: 5px; line-height: 1.35; }
.metric-line .metric-alert strong { color: var(--acid); }
.metric-line small b { color: var(--text-soft); font-weight: 750; }

.definition-ribbon {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-strong);
  overflow-x: auto;
}

.definition-step { display: flex; align-items: center; gap: 8px; min-width: max-content; }
.definition-step small, .definition-step strong { display: block; }
.definition-step small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.definition-step strong { margin-top: 3px; font-size: 11px; }
.step-index { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 9px; font-weight: 800; }
.definition-step.is-problem .step-index { border-color: var(--danger); color: var(--danger); background: rgba(240,120,212,.08); }
.ribbon-arrow { color: var(--muted); }

.activity { padding-top: 24px; }
.activity-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.activity-head h2 { margin: 0; }
.view-switch { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; }
.view-switch button { border: 0; border-radius: 3px; background: transparent; padding: 6px 9px; color: var(--muted); font-size: 10px; font-weight: 700; }
.view-switch button { cursor: pointer; }
.view-switch button.is-active { background: var(--acid); color: #071015; }

.run-query { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; border-top: 1px solid var(--line-strong); }
.run-filters, .run-pages { display: flex; align-items: center; gap: 2px; }
.run-filters button, .run-pages button { border: 0; background: transparent; color: var(--muted); padding: 7px 9px; font-size: 9px; font-weight: 800; cursor: pointer; }
.run-filters button:hover, .run-pages button:hover { color: var(--text); background: #161c22; }
.run-filters button.is-active { color: var(--acid); background: rgba(105, 210, 255, .08); }
.run-filters button span { margin-left: 4px; color: #8e9aa5; font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.run-pages { color: var(--muted); font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.run-pages button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); }
.run-pages button:disabled { color: #46515b; cursor: default; background: transparent; }

.run-workbench { display: grid; grid-template-columns: 220px minmax(0, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-strong); }
.run-list { max-height: 570px; overflow-y: auto; border-right: 1px solid var(--line); }
.run-empty { padding: 24px 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.run-row {
  width: 100%;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 14px 13px 14px 2px;
  text-align: left;
  cursor: pointer;
}
.run-row[hidden], .run-empty[hidden] { display: none; }

.run-row { color: var(--text); }
.run-row:hover { background: #161c22; }
.run-row.is-selected { background: #192129; padding-left: 9px; box-shadow: inset 2px 0 var(--acid); }
.run-status { width: 6px; height: 6px; border-radius: 50%; background: var(--cool); }
.run-status-good { border-radius: 50%; background: var(--good); }
.run-status-warning { border-radius: 1px; background: var(--warning); transform: rotate(45deg); }
.run-status-danger { border-radius: 1px; background: var(--danger); box-shadow: 0 0 0 3px rgba(240,120,212,.1); }
.run-status-warning { background: var(--warning); }
.run-row-copy strong { display: block; }
.run-row-copy strong { font-size: 11px; }
.run-row-copy small { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 5px; margin-top: 3px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.run-token-cost { color: var(--acid); font-weight: 800; }
.run-token-divider { color: var(--muted); font-weight: 600; }
.run-token-cost[data-token-state="unknown"] { color: var(--muted); font-weight: 600; }
.run-token-cost[data-token-state="not-applicable"] { color: #9db2c0; font-weight: 700; }
.run-result { color: var(--muted); font-size: 9px; font-weight: 750; }

.run-detail { min-width: 0; background: var(--paper-raised); padding: 23px 25px 18px; }
.run-detail-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.run-context, .evidence-context { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.run-context { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 9px; }
.run-context-divider { color: #68727d; font-weight: 600; }
.run-reference { border: 0; background: transparent; padding: 0; color: var(--acid); font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; }
.run-reference:hover, .run-reference:focus-visible { text-decoration: underline; outline: none; }
.run-detail-head p { max-width: 580px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.run-verdict { flex: 0 0 auto; align-self: flex-start; border-radius: 999px; padding: 6px 9px; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.run-verdict.danger { background: rgba(240,120,212,.13); color: #ff9be2; }
.run-verdict.good { background: rgba(105,169,255,.13); color: #96c3ff; }
.run-verdict.warning { background: rgba(242,184,75,.13); color: #ffd584; }

.timeline { padding: 8px 0 3px; }
.timeline-stage { position: relative; width: 100%; display: grid; grid-template-columns: 24px 64px minmax(0,1fr) auto; align-items: start; gap: 10px; min-height: 58px; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--text); padding: 8px 4px 8px 0; text-align: left; cursor: pointer; }
.timeline-stage:hover, .timeline-stage:focus-visible { background: #171e25; border-bottom-color: var(--line); outline: none; }
.timeline-stage::before { content: ""; position: absolute; left: 7px; top: 23px; bottom: -10px; width: 1px; background: var(--line); }
.timeline-stage:last-child::before { display: none; }
.stage-node { z-index: 1; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--cool); background: var(--paper-raised); color: var(--text); font-size: 10px; font-weight: 900; }
.timeline-stage.pass .stage-node { border-radius: 50%; border-color: var(--good); color: var(--good); }
.timeline-stage.warning .stage-node { border-color: var(--warning); color: var(--warning); clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }
.timeline-stage.failed .stage-node { border-radius: 2px; border-color: var(--danger); color: var(--danger); }
.stage-kind { padding-top: 1px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.stage-copy strong { display: block; font-size: 12px; }
.stage-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.stage-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.stage-meta { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.stage-state { align-self: start; display: inline-flex; align-items: center; justify-content: center; min-width: 58px; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.stage-state.pass { border-color: #356a9d; color: #92c4ff; }
.stage-state.warning { border-color: #8b6827; color: #ffd584; }
.stage-state.failed { border-color: #874074; color: #ff9be2; }
.stage-open { color: var(--acid); font-size: 9px; font-weight: 800; }

.run-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.run-footer span, .run-footer strong { display: block; }
.run-footer > div > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.run-footer strong { max-width: 520px; margin-top: 5px; font-size: 11px; line-height: 1.45; }
.text-action { border: 0; background: transparent; padding: 0; color: var(--acid); font-size: 10px; font-weight: 800; cursor: pointer; }
.text-action span { display: inline; }

.inspector {
  display: none;
  position: fixed;
  z-index: 22;
  top: 0;
  right: 0;
  width: min(390px, 100vw);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 52px 24px 29px;
  box-shadow: -20px 0 60px rgba(0,0,0,.55);
}
.inspector.is-open { display: block; }
.inspector-top { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.inspector-top h2 { font-size: 18px; }
.read-only-label { align-self: flex-start; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }

.definition-list { margin: 0; }
.definition-list > div { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.definition-list dt { color: var(--muted); font-size: 10px; }
.definition-list dd { margin: 0; font-size: 10px; font-weight: 750; }
.inspector-rule { height: 1px; margin: 22px 0; background: var(--line-strong); }
.inspector-section { margin-bottom: 25px; }
.inspector-heading { margin: 0 0 8px; color: var(--text); font-size: 11px; letter-spacing: 0; }
.inspector-section p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.decision-state { display: inline-block; margin-top: 8px; padding: 5px 7px; background: rgba(105,169,255,.12); color: #92c4ff; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }

.trigger-list { list-style: none; margin: 10px 0 0; padding: 0; }
.trigger-list li { position: relative; padding: 11px 42px 11px 0; border-top: 1px solid var(--line); }
.trigger-list span, .trigger-list strong { display: block; }
.trigger-list span { color: var(--muted); font-size: 9px; }
.trigger-list strong { margin-top: 4px; font-size: 10px; }
.trigger-list em { position: absolute; right: 0; top: 15px; color: var(--acid); font-size: 8px; font-style: normal; font-weight: 850; text-transform: uppercase; }
.trigger-list .is-draft { color: var(--text-soft); }

.inspector-note { margin-top: 32px; padding: 14px; border: 1px solid var(--line-strong); background: #0b0f13; color: var(--text); }
.inspector-note strong { color: var(--acid); font-size: 10px; }
.inspector-note p { margin: 7px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.5; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(2,4,6,.72); backdrop-filter: blur(3px); }
.drawer {
  display: none;
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  width: min(720px, 100vw);
  height: 100vh;
  overflow-y: auto;
  background: #11161b;
  padding: 46px 38px 34px;
  box-shadow: -20px 0 60px rgba(0,0,0,.55);
}
.drawer.is-open { display: block; }
.drawer h2 { max-width: 540px; margin: 0; font-size: 31px; line-height: 1.05; }
.drawer-intro { max-width: 560px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.drawer-close { position: absolute; top: 18px; right: 22px; border: 0; background: transparent; font-size: 26px; cursor: pointer; }
.trust-boundary { margin: 24px 0 0; border-left: 3px solid var(--acid); background: #141c22; padding: 14px 16px; }
.trust-boundary strong { color: var(--acid); font-size: 11px; }
.trust-boundary p { margin: 6px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.55; }
.field { display: block; margin: 28px 0 18px; }
.field > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.field textarea { width: 100%; resize: vertical; border: 1px solid var(--line-strong); border-radius: 3px; background: #0b0f13; color: var(--text); padding: 12px; font: 12px/1.55 Inter, ui-sans-serif, sans-serif; }
.field textarea:focus { border-color: var(--acid); outline: 1px solid var(--acid); }
.field-goal { margin-top: 22px; }
.simulation-result { margin-top: 25px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); padding: 18px 0; }
.simulation-result span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.simulation-result strong { display: block; margin-top: 8px; font-size: 18px; letter-spacing: -.03em; }
.simulation-result p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.agent-handoff { margin-top: 26px; border: 1px solid var(--line-strong); background: #0b0f13; }
.handoff-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.handoff-head h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.handoff-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.handoff-head > span { flex: 0 0 auto; border: 1px solid var(--line-strong); padding: 4px 6px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.agent-handoff pre { max-height: 340px; margin: 0; overflow: auto; padding: 16px; color: #ccefff; font: 10px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.drawer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 26px; }

.raw-evidence { min-height: 410px; padding: 18px 0 4px; }
.raw-evidence-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.raw-evidence-head strong { display: block; margin-top: 5px; font-size: 12px; }
.raw-evidence pre, .evidence-block pre {
  margin: 16px 0 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #080b0e;
  color: #ccefff;
  padding: 16px;
  font: 10px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.copy-button { border: 1px solid var(--line-strong); border-radius: 3px; background: transparent; color: var(--acid); padding: 7px 10px; font-size: 9px; font-weight: 800; cursor: pointer; }
.copy-button:hover { background: #19232b; }

.evidence-drawer {
  display: none;
  position: fixed;
  z-index: 22;
  top: 0;
  right: 0;
  width: min(600px, 100vw);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line-strong);
  background: #0e1318;
  padding: 46px 38px 34px;
  box-shadow: -20px 0 60px rgba(0,0,0,.6);
}
.evidence-drawer.is-open { display: block; }
.evidence-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 8px; }
.evidence-title-row h2 { max-width: 430px; margin: 0; font-size: 30px; line-height: 1.08; }
.evidence-diagnosis { margin: 17px 0 24px; color: var(--text-soft); font-size: 13px; line-height: 1.65; }
.evidence-facts { margin: 0; border-top: 1px solid var(--line-strong); }
.evidence-block + .evidence-facts { margin-top: 26px; }
.evidence-facts > div { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.evidence-facts dt { color: var(--muted); font-size: 10px; }
.evidence-facts dd { margin: 0; overflow-wrap: anywhere; color: var(--text); font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.evidence-block { margin-top: 26px; }
.evidence-heading { margin: 0 0 10px; color: var(--text-soft); font-size: 11px; letter-spacing: 0; }
.agent-boundaries { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.agent-boundaries > div { min-width: 0; padding: 13px 14px 13px 0; }
.agent-boundaries > div + div { border-left: 1px solid var(--line); padding-left: 14px; }
.agent-boundaries span, .agent-boundaries strong, .agent-boundaries small { display: block; }
.agent-boundaries span { color: var(--muted); font-size: 9px; }
.agent-boundaries strong { margin-top: 5px; font-size: 13px; }
.agent-boundaries small { margin-top: 4px; color: var(--text-soft); font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.agent-verdict { margin: 12px 0 0; border-left: 3px solid var(--warning); background: #1b1811; padding: 11px 13px; color: var(--text); font-size: 11px; line-height: 1.55; }
.comparison-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line-strong); padding: 11px 0; }
.comparison-head strong { color: var(--acid); font: 800 10px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.comparison-head span { color: var(--muted); font-size: 9px; text-align: right; }
.comparison-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; border-top: 1px solid var(--line); }
.comparison-grid > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.comparison-grid > div:nth-child(odd) { padding-right: 12px; }
.comparison-grid > div:nth-child(even) { border-left: 1px solid var(--line); padding-left: 12px; }
.comparison-grid dt { color: var(--muted); font-size: 9px; }
.comparison-grid dd { margin: 0; color: var(--text); font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.token-breakdown { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line-strong); }
.token-breakdown > div { min-width: 0; padding: 12px; border-right: 1px solid var(--line); }
.token-breakdown > div:last-child { border-right: 0; }
.token-breakdown span, .token-breakdown strong { display: block; }
.token-breakdown span { color: var(--muted); font-size: 8px; }
.token-breakdown strong { margin-top: 5px; color: var(--text); font: 800 15px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.token-analysis { margin: 12px 0 0; border-left: 3px solid var(--acid); background: #141c22; padding: 12px 14px; color: var(--text-soft); font-size: 11px; line-height: 1.55; }
.execution-overview { border-top: 1px solid var(--line-strong); padding-top: 8px; }
.overview-scale { display: flex; justify-content: space-between; margin-left: 58px; color: var(--muted); font: 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-overview-svg { display: block; width: 100%; height: auto; margin-top: 7px; overflow: visible; }
.execution-overview-svg text { fill: var(--muted); font: 700 17px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.overview-runner { fill: #456070; }
.overview-session { fill: #73d7ff; opacity: .72; }
.overview-activity { fill: #496070; stroke: #0e1318; stroke-width: 2; }
.overview-activity { cursor: pointer; }
.overview-activity:hover, .overview-activity:focus, .overview-activity.is-selected { stroke: #fff; stroke-width: 5; outline: none; }
.overview-activity.kind-process_wait { fill: #ffd166; }
.overview-activity.kind-network, .overview-activity.kind-messaging, .overview-activity.kind-database { fill: #78a7d2; }
.overview-activity.kind-file_io, .overview-activity.kind-search { fill: #79909d; }
.overview-activity.is-critical { fill: #ff9be2; }
.overview-token { stroke: #ff9be2; stroke-width: 5; }
.overview-timeout { stroke: #ff9be2; stroke-width: 4; stroke-dasharray: 8 5; }
.overview-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; border-bottom: 1px solid var(--line); padding: 7px 0 9px 58px; color: var(--muted); font: 8px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.overview-legend strong { color: #ff9be2; }
.timeline-instruction { margin: 10px 0 0; color: var(--text-soft); font-size: 9px; }
.execution-selection { margin-top: 14px; border-top: 1px solid var(--acid); border-bottom: 1px solid var(--line-strong); padding: 12px 0 14px; }
.execution-selection-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.execution-selection-head strong { font: 800 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-selection-head span { flex: 0 0 auto; color: var(--muted); font: 8px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-selection-tokens { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin: 10px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.execution-selection-tokens > div { min-width: 0; padding: 9px 7px; border-right: 1px solid var(--line); }
.execution-selection-tokens > div:last-child { border-right: 0; }
.execution-selection-tokens dt { color: var(--muted); font-size: 7px; }
.execution-selection-tokens dd { margin: 4px 0 0; color: var(--text); font: 800 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.execution-selection-calls { margin-top: 10px; }
.execution-selection-calls > section { border-top: 1px solid var(--line); padding-top: 8px; }
.execution-selection-calls > section > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.execution-selection-calls strong, .execution-selection-calls code { font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-selection-calls code { color: #92c4ff; }
.execution-call { display: grid; grid-template-columns: minmax(0,1fr) 58px 86px 56px; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); color: var(--text-soft); font-size: 8px; }
.execution-call strong { text-align: right; color: var(--text); }
.execution-selection > p, .execution-selection-calls > p { margin: 9px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.execution-timeline { margin-top: 14px; }
.execution-interval { display: grid; grid-template-columns: 50px 12px minmax(0,1fr); gap: 10px; min-height: 98px; cursor: pointer; }
.execution-interval:hover .execution-interval-copy, .execution-interval:focus .execution-interval-copy, .execution-interval.is-selected .execution-interval-copy { border-bottom-color: var(--acid); outline: none; }
.execution-time { padding-top: 2px; text-align: right; }
.execution-time strong, .execution-time span { display: block; }
.execution-time strong { color: var(--text-soft); font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-time span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.execution-node { position: relative; }
.execution-node::before { content: ''; position: absolute; top: 5px; bottom: -5px; left: 5px; border-left: 1px solid #456070; }
.execution-node::after { content: ''; position: absolute; top: 4px; left: 2px; width: 7px; height: 7px; border: 1px solid #73d7ff; background: #0e1318; }
.execution-interval:last-child .execution-node::before { display: none; }
.execution-interval-copy { min-width: 0; padding: 0 0 15px; border-bottom: 1px solid var(--line); }
.execution-interval-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.execution-interval-head > strong { overflow-wrap: anywhere; font: 800 10px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-interval-head > span { flex: 0 0 auto; border: 1px solid #a94d91; padding: 3px 5px; color: #ff9be2; font: 800 7px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-interval-copy > small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.execution-technical { display: block; margin-top: 4px; color: #92c4ff; font: 8px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-bars { margin-top: 9px; display: grid; gap: 4px; }
.execution-bars > div { display: grid; grid-template-columns: 28px minmax(0,1fr) 48px; gap: 7px; align-items: center; }
.execution-bars span { color: var(--muted); font: 700 7px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-bars meter { display: block; width: 100%; height: 5px; border: 0; background: #1a242d; }
.execution-bars meter::-webkit-meter-bar { border: 0; border-radius: 0; background: #1a242d; }
.execution-bars meter::-webkit-meter-optimum-value { border-radius: 0; background: #73d7ff; }
.execution-bars meter::-moz-meter-bar { border-radius: 0; background: #73d7ff; }
.execution-bars meter.token-meter::-webkit-meter-optimum-value { background: repeating-linear-gradient(90deg, #ff9be2 0 4px, transparent 4px 6px); }
.execution-bars meter.token-meter::-moz-meter-bar { background: #ff9be2; }
.execution-bars strong { text-align: right; color: var(--text-soft); font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-token-detail { margin: 6px 0 0 35px; color: var(--muted); font: 8px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.execution-interval.crosses-timeout .execution-interval-copy { border-bottom-color: #a94d91; }
.execution-full-trace { margin-top: 14px; border-top: 1px solid var(--line-strong); }
.execution-full-trace summary { padding: 12px 0; color: var(--acid); font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; }
.execution-full-trace[open] summary { border-bottom: 1px solid var(--line); }
.evidence-source-details { margin-top: 22px; border-top: 1px solid var(--line-strong); }
.evidence-source-details summary { padding: 12px 0; color: var(--muted); font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; }
.evidence-source-details[open] summary { color: var(--text-soft); border-bottom: 1px solid var(--line); }
.burn-paths { border-top: 1px solid var(--line-strong); }
.burn-path { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.burn-path strong, .burn-path small { display: block; }
.burn-path strong { font: 800 10px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.burn-path small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.burn-path > span { color: var(--text-soft); font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.attribution-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.rule-evaluation { display: block; margin-top: 10px; color: var(--acid); font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.condition-list { margin-top: 10px; border-top: 1px solid var(--line-strong); }
.condition-row { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 14px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.condition-result { border: 1px solid var(--line-strong); padding: 5px 6px; text-align: center; font: 800 8px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.condition-result.is-match { border-color: #356a9d; color: #92c4ff; }
.condition-result.is-miss { border-color: #874074; color: #ff9be2; }
.condition-copy span, .condition-copy strong, .condition-copy code { display: block; }
.condition-copy span { color: var(--muted); font-size: 9px; }
.condition-copy strong { margin-top: 4px; font-size: 11px; }
.condition-copy code { margin-top: 5px; overflow-wrap: anywhere; color: var(--text-soft); font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.evidence-callout { margin-top: 24px; border-left: 3px solid var(--acid); background: #141c22; padding: 14px 16px; }
.evidence-callout strong { display: block; margin-top: 7px; font-size: 11px; line-height: 1.55; }
.evidence-policy { border-left-color: var(--warning); background: #1b1811; }
.command-list { margin-top: 10px; border-top: 1px solid var(--line); }
.debug-command { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.debug-command code { overflow-wrap: anywhere; color: #ccefff; font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.debug-command button { border: 1px solid var(--line-strong); border-radius: 3px; background: transparent; color: var(--acid); padding: 5px 8px; font-size: 8px; font-weight: 800; cursor: pointer; }
.debug-command button:hover { background: #19232b; }
.evidence-next { margin-top: 28px; border-left: 3px solid var(--acid); background: #141c22; padding: 14px 16px; }
.evidence-next strong { display: block; margin-top: 7px; font-size: 11px; line-height: 1.55; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 4px; background: #151b21; color: var(--text); font-size: 11px; opacity: 0; pointer-events: none; }
.toast.is-visible { opacity: 1; }

.entrance { opacity: 1; }

.login-page { display: grid; min-height: 100vh; place-items: center; background: #090d11; }
.login-shell { width: min(390px, calc(100vw - 32px)); }
.login-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--acid); font-size: 11px; font-weight: 900; }
.login-brand strong { color: var(--text); font-size: 15px; }
.login-panel { margin-top: 22px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); padding: 28px 0 30px; }
.login-panel h1 { font-size: 34px; }
.login-panel > p { margin: 8px 0 24px; color: var(--muted); font-size: 12px; }
.login-panel form { display: grid; gap: 16px; }
.login-panel label span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.login-panel input { width: 100%; border: 1px solid var(--line-strong); border-radius: 3px; background: #11171c; color: var(--text); padding: 12px; font: 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.login-panel input:focus { border-color: var(--acid); outline: none; }
.login-panel form button { min-height: 42px; border: 1px solid var(--acid); border-radius: 3px; background: var(--acid); color: #071015; font-weight: 850; cursor: pointer; }
.login-message { margin-bottom: 18px; border-left: 3px solid var(--warning); background: #1b1811; padding: 11px 13px; color: var(--text-soft); font-size: 11px; }
.google-handoff { display: grid; min-height: 44px; place-items: center; border: 1px solid var(--line-strong); border-radius: 3px; background: #11171c; color: var(--text); font-size: 12px; font-weight: 800; }
.google-handoff:hover, .google-handoff:focus-visible { border-color: var(--acid); outline: none; }
.login-separator { margin: 20px 0; color: var(--muted); font-size: 10px; text-align: center; text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 1180px) {
  :root { --sidebar: 210px; }
  .app-shell { grid-template-columns: var(--sidebar) minmax(600px, 1fr); }
  .workspace { padding: 26px 30px 52px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 14px; }
  .brand { padding-bottom: 12px; }
  .primary-nav { display: none; }
  .sidebar-section { display: none; }
  .sidebar-foot { position: absolute; right: 14px; top: 16px; width: 160px; margin: 0; border: 0; padding: 0; }
  .workspace { padding: 26px 18px 42px; }
  .workspace-header { grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .workspace-title { grid-column: 1; }
  .workspace-summary { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .metric-line { grid-template-columns: repeat(2, 1fr); }
  .metric-line > div:nth-child(odd):not(:first-child) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .metric-line > div:nth-child(even):not(:nth-child(2)) { border-top: 1px solid var(--line); }
  .run-query { align-items: flex-start; flex-direction: column; gap: 4px; padding: 7px 0; }
  .run-filters { max-width: 100%; overflow-x: auto; }
  .run-pages { align-self: flex-end; }
  .run-workbench { display: block; }
  .run-list { display: flex; max-height: none; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .run-row { flex: 0 0 190px; border-right: 1px solid var(--line); border-bottom: 0; }
  .run-detail { padding: 20px 16px; }
  .timeline-stage { grid-template-columns: 20px 58px minmax(0,1fr) auto; }
  .stage-meta { display: none; }
  .inspector { padding: 52px 18px 26px; }
}

@media (max-width: 540px) {
  .sidebar-foot { display: none; }
  .workspace-header { grid-template-columns: 1fr; }
  .workspace-title, .workspace-summary, .header-actions { grid-column: 1; grid-row: auto; }
  .workspace-title { align-items: flex-start; flex-wrap: wrap; }
  h1 { font-size: 34px; }
  .header-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .button { padding: 0 9px; }
  .metric-line strong { font-size: 14px; }
  .definition-ribbon { gap: 9px; }
  .ribbon-arrow { display: none; }
  .activity-head { align-items: flex-start; }
  .view-switch { display: none; }
  .run-detail-head, .run-footer { display: block; }
  .run-verdict { display: inline-block; margin-top: 12px; }
  .run-footer .text-action { margin-top: 14px; }
  .timeline-stage { grid-template-columns: 18px 1fr; gap: 10px; }
  .stage-kind { grid-column: 2; margin-top: -2px; }
  .stage-copy { grid-column: 2; }
  .stage-actions { grid-column: 2; justify-content: flex-start; }
  .timeline-stage::before { left: 6px; }
  .drawer { padding: 44px 20px 28px; }
  .evidence-drawer { padding: 44px 20px 28px; }
  .evidence-facts > div { grid-template-columns: 105px minmax(0,1fr); gap: 12px; }
  .token-breakdown { grid-template-columns: 1fr 1fr; }
  .token-breakdown > div:nth-child(2) { border-right: 0; }
  .token-breakdown > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
