:root {
  color-scheme: dark;
  --bg: #0a0f1f;
  --panel: rgba(12, 18, 36, 0.92);
  --panel-2: rgba(16, 23, 46, 0.96);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #98a7c2;
  --accent: #76f3d3;
  --accent-2: #7aa7ff;
  --warn: #ffc76d;
  --danger: #ff7474;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", "Aptos", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(122, 167, 255, 0.2), transparent 30%),
    radial-gradient(circle at top right, rgba(118, 243, 211, 0.14), transparent 24%),
    linear-gradient(180deg, #07101f 0%, #0a0f1f 100%);
  min-height: 100vh;
}

.shell {
  width: min(1450px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 18px 0 24px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 10px;
}
h1, h2, h3 {
  margin: 0;
  font-weight: 700;
}
h1 { font-size: clamp(2.4rem, 4vw, 4.4rem); line-height: 1; }
.subtitle { color: var(--muted); max-width: 70ch; margin: 14px 0 0; }

.hero-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}
.stat, .panel, .response-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(21, 28, 54, 0.95), rgba(10, 15, 31, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.stat {
  border-radius: 16px;
  padding: 16px;
}
.stat span, .label, .summary { color: var(--muted); }
.stat strong { display: block; margin-top: 8px; font-size: 1rem; }
.stat-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
.status-good { display: block; margin-top: 8px; color: var(--accent); }
.status-bad { display: block; margin-top: 8px; color: var(--danger); }

.grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 20px;
}
.panel {
  border-radius: 22px;
  padding: 20px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #04111d;
  cursor: pointer;
}
button.secondary {
  background: linear-gradient(135deg, #8b5cf6, #7aa7ff);
  color: white;
}
button.ghost {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
  border: 1px solid var(--line);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.field-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.field-grid input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.7);
  padding: 12px 14px;
  color: var(--text);
}
.response-card {
  margin-top: 16px;
  border-radius: 18px;
  padding: 18px;
}
.response-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
}
.badge.muted { background: rgba(148, 163, 184, 0.14); color: var(--muted); }
.badge.good { background: rgba(118, 243, 211, 0.12); color: var(--accent); }
.badge.bad { background: rgba(255, 116, 116, 0.12); color: var(--danger); }
.badge.warn { background: rgba(255, 199, 109, 0.12); color: var(--warn); }
.json {
  margin: 14px 0 0;
  padding: 14px;
  background: rgba(5, 10, 20, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  min-height: 210px;
}
.flow {
  display: grid;
  gap: 12px;
}
.flow-step {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(6, 11, 23, 0.8);
}
.flow-step.active {
  border-color: rgba(118, 243, 211, 0.6);
  box-shadow: inset 0 0 0 1px rgba(118, 243, 211, 0.18);
}
.flow-step .order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  margin-right: 12px;
  background: rgba(122, 167, 255, 0.16);
  color: var(--accent-2);
  font-weight: 800;
}
.flow-step p { margin: 10px 0 0; color: var(--muted); }

.scenarios-panel { margin-top: 20px; }
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.scenario-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(6, 11, 23, 0.8);
  cursor: pointer;
}
.scenario-card:hover {
  border-color: rgba(122, 167, 255, 0.6);
}
.scenario-card .tag {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 1100px) {
  .grid, .cards, .hero, .hero-stats, .field-grid { grid-template-columns: 1fr; display: grid; }
  .hero { align-items: start; }
}
