:root {
  color-scheme: light;
  --navy: #0a0f1e;
  --navy-2: #0f172a;
  --navy-soft: #0f172a;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #d5dbe3;
  --soft: #f8fafc;
  --panel: #ffffff;
  --brand: #0b7681;
  --brand-strong: #085e67;
  --cyan: #3fc7d4;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #15803d;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 26px -14px rgba(15, 23, 42, 0.10);
  --radius: 8px;
  --radius-lg: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--soft);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 15, 30, 0.97);
}
.site-header-inner {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}
.brand img {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-name {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.3px;
  color: #fff;
}
.brand-pill {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  padding: 3px 8px;
}
.brand-tagline {
  display: block;
  margin-top: 1px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 650;
}

.header-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.site-nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
}
.site-nav a:hover,
.site-nav a.active,
.site-nav a[aria-current="page"] {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 40px;
  flex: 1 1 auto;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(520px, 1.45fr) minmax(360px, 0.9fr);
  align-items: start;
  gap: 24px;
  margin-bottom: 16px;
  padding: 40px 32px 44px;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(63, 199, 212, 0.11), rgba(10, 15, 30, 0) 42%),
    var(--navy);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  gap: 16px;
}

.hero-copy .eyebrow {
  color: var(--cyan);
}

.hero-copy h1 {
  color: #fff;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  line-height: 1.08;
  max-width: 28ch;
}

.subhead {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.hero-copy .subhead {
  color: #c3cce2;
}

.scenario-box {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  padding: 16px 18px;
}

.scenario-label {
  display: block;
  margin-bottom: 7px;
  color: #6ee7d8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.how-steps {
  margin: 0;
  padding-left: 18px;
  color: #d7deee;
  font-size: 0.9rem;
  line-height: 1.45;
}

.how-steps li + li {
  margin-top: 8px;
}

.how-steps strong {
  color: #fff;
}

.scenario-note {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.4;
}

.hero-action {
  display: grid;
  gap: 14px;
  align-items: start;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.hero-action .primary {
  width: auto;
  min-width: 188px;
  background: var(--cyan);
  color: #04212a;
}

.hero-action .primary:hover {
  background: #5fd0db;
}

.app-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, auto));
  gap: 8px;
  align-items: center;
}
.metrics div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 0;
}
.metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metrics strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.header-action:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: #e3f2f3;
}
.header-action:disabled {
  color: var(--muted);
  background: var(--soft);
  cursor: not-allowed;
}
.header-action-accent {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.header-action-accent:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}
.header-action-accent.disabled {
  pointer-events: none;
  background: #d5e9eb;
  border-color: #a9d6da;
  color: #085e67;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 14px;
  min-height: 720px;
  height: min(860px, calc(100vh - 48px));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-height: 0;
  overflow: hidden;
}

.scenarios-panel,
.route-panel {
  display: flex;
  flex-direction: column;
}

.panel-head,
.route-head,
.modal-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.route-head,
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.route-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.route-head.baseline { background: #fef2f2; }
.route-head.guarded { background: #e3f2f3; }

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
h1, h2, h3 { margin: 0; line-height: 1.18; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 13px; }
.panel-head h2 { font-size: 22px; }

.scenario-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow: auto;
}
.scenario {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}
.scenario:hover,
.scenario.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 118, 129, 0.12);
}
.scenario strong { display: block; font-size: 15px; }
.scenario small { color: var(--brand-strong); font-weight: 700; }
.scenario p { margin: 8px 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badges span {
  border: 1px solid #a9d6da;
  background: #e3f2f3;
  color: #085e67;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  height: 40px;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}
.primary:hover { background: #09656e; }
.primary:disabled { opacity: 0.6; cursor: wait; }
.primary svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.hero-action .primary {
  height: 46px;
}
.hero-action .primary svg {
  width: 20px;
  height: 20px;
}
.secondary {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  height: 38px;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}
.secondary:hover {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.34);
}
.secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.status-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-chip.ok {
  border-color: #bbf7d0;
  color: var(--ok);
  background: #f0fdf4;
}
.status-chip.warn {
  border-color: #fde68a;
  color: var(--warn);
  background: #fffbeb;
}
.outcome-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 11px;
  line-height: 1;
}

.graph {
  display: grid;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.node {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}
.node span {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #98a2b3;
  margin-bottom: 5px;
}
.node.complete span { background: var(--ok); }
.node.running span { background: #1570ef; }
.node.warning span,
.node.skipped span { background: var(--warn); }
.node strong { display: block; font-size: 12px; }
.node small { color: var(--muted); font-size: 11px; line-height: 1.25; }

.transcript {
  min-height: 0;
  padding: 14px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}
.brief,
.empty,
.error {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fafbfc;
}
.error { color: var(--danger); border-color: #fecdca; background: #fff1f0; }
.small { padding: 10px; font-size: 12px; }

.turn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}
.turn.is-new {
  animation: rise 220ms ease both;
}
@media (prefers-reduced-motion: reduce) {
  .turn.is-new { animation: none; }
}
.turn header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.turn header span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.turn p { margin: 0; line-height: 1.45; font-size: 14px; }
.turn.agent { border-left: 4px solid var(--brand); }
.turn.hacker { border-left: 4px solid var(--danger); }
.turn.customer { border-left: 4px solid #1570ef; }
.turn.law_enforcer { border-left: 4px solid #6941c6; }
.turn.case_file { border-left: 4px solid #12b76a; }
.turn.pending {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  background: #fafbfc;
}
.turn.pending span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 900ms ease-in-out infinite;
}
.turn.pending p { font-size: 13px; }

.route-message {
  margin: 12px 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
}
.route-message.good { border-color: #abefc6; color: var(--ok); background: #ecfdf3; }
.route-message.warn { border-color: #fedf89; color: var(--warn); background: #fffaeb; }
.route-message.bad { border-color: #fedf89; color: var(--warn); background: #fffaeb; }

.telemetry-modal {
  width: min(980px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.28);
}
.telemetry-modal::backdrop {
  background: rgba(16, 24, 40, 0.42);
}
.telemetry-section {
  padding: 0 12px 12px;
  min-height: 0;
}
.telemetry-section h3 {
  margin: 8px 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: #fafbfc;
  font-size: 13px;
}
.status-row.ok { border-color: #abefc6; color: var(--ok); background: #ecfdf3; }
.status-row.warn { border-color: #fedf89; color: var(--warn); background: #fffaeb; }

.vcon-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.vcon-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  min-width: 0;
}
.vcon-column h4 {
  margin: 0 0 10px;
  font-size: 13px;
}
.telemetry-kv,
.score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #eef2f6;
  font-size: 12px;
}
.telemetry-kv span,
.score-row span {
  color: var(--muted);
}
.telemetry-kv strong,
.score-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.telemetry-scores {
  margin-top: 8px;
}
.call-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #eef2f6;
}
.call-metrics div {
  min-width: 0;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  padding: 8px;
  background: #fafbfc;
}
.call-metrics span,
.call-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.call-metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}
.call-metrics b {
  font-weight: 800;
  color: var(--ink);
}
.route-call-logs {
  border-top: 1px solid #eef2f6;
  margin-top: 8px;
  padding-top: 10px;
}
.route-call-logs h5 {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.event-log {
  display: grid;
  gap: 8px;
}
.event-log.compact {
  max-height: 360px;
  overflow: auto;
}
.event {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
}
.event.llm { border-left: 4px solid var(--brand); }
.event.mcp { border-left: 4px solid #6941c6; }
.event.mcp.blocked { border-left-color: var(--danger); }
.event > span {
  display: block;
  min-width: 0;
}
.event strong,
.event small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event small { color: var(--muted); margin-top: 2px; }
.event b {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ok);
}

@media (max-width: 760px) {
  .vcon-columns,
  .call-metrics {
    grid-template-columns: 1fr;
  }
}
.event.blocked b { color: var(--danger); }
.event p {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.event pre {
  display: none;
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 6px;
  background: #101828;
  color: #e6edf7;
  font-size: 11px;
  white-space: pre-wrap;
}
.event.open pre { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 1100px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }
  .workspace {
    height: auto;
    min-height: 0;
  }
  .panel { min-height: 320px; }
  .site-header-inner {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }
  .app-toolbar {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
  .header-end {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .metrics { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .graph { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
}

@media (max-width: 860px) {
  .topbar {
    padding: 24px 18px 28px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1480px);
    padding: 18px 0 28px;
  }
  .metrics {
    grid-template-columns: 1fr;
  }
  .brand-tagline {
    display: none;
  }
  .header-actions,
  .site-nav {
    width: 100%;
  }
  .header-action {
    flex: 1 1 auto;
  }
  .hero-buttons {
    align-items: stretch;
    flex-direction: column;
  }
  .hero-action .primary {
    width: 100%;
  }
  .hero-copy h1 {
    max-width: none;
  }
  .run-toolbar,
  .route-head,
  .modal-head {
    align-items: stretch;
    flex-direction: column;
  }
}

.site-footer {
  background: var(--navy-soft);
  padding: 48px 20px 32px;
  margin-top: 0;
  flex-shrink: 0;
}
.footer-inner {
  width: min(1160px, calc(100vw - 40px));
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 54px;
  padding-bottom: 36px;
  border-bottom: 1px solid #1e293b;
}
.footer-brand .logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.footer-brand p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 10px;
}
.footer-social {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.footer-col h5 {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin: 0 0 13px;
}
.footer-col a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 9px;
}
.footer-col a:hover {
  color: #f8fafc;
}
.footer-bottom {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.footer-bottom p {
  color: #64748b;
  font-size: 12.5px;
  margin: 0;
}
.footer-bottom a {
  color: #64748b;
}
.footer-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-pill {
  color: #94a3b8;
  border: 1px solid #334155;
  background: #1e293b;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.footer-pill-link:hover {
  color: #f8fafc;
  border-color: var(--cyan);
}

@media (max-width: 980px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .footer-links {
    grid-template-columns: 1fr;
  }
}
