:root {
  color-scheme: dark;
  --bg: #090b10;
  --card: rgba(255, 255, 255, 0.07);
  --card-strong: rgba(255, 255, 255, 0.11);
  --text: #f4f7fb;
  --muted: #aab4c4;
  --brand: #7c5cff;
  --brand-2: #16d9e3;
  --danger: #ff6b6b;
  --ok: #64e6a1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 92, 255, .35), transparent 34rem),
    radial-gradient(circle at 100% 10%, rgba(22, 217, 227, .25), transparent 30rem),
    var(--bg);
}

.shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px 14px 36px;
}

.card, .scenario {
  border: 1px solid rgba(255,255,255,.12);
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}

.hero { padding: 26px; margin-bottom: 16px; }
.eyebrow { color: var(--brand-2); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 10px 0 12px; font-size: clamp(30px, 8vw, 58px); line-height: .95; }
p { color: var(--muted); line-height: 1.55; margin: 0; }
.identity { margin-top: 18px; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.scenario {
  color: var(--text);
  padding: 16px;
  text-align: left;
  cursor: pointer;
}
.scenario span { display: block; font-size: 16px; font-weight: 750; margin-bottom: 5px; }
.scenario small { color: var(--muted); line-height: 1.35; }
.scenario.selected { border-color: rgba(22, 217, 227, .75); background: linear-gradient(135deg, rgba(124,92,255,.24), rgba(22,217,227,.12)); }

section.card:not(.hero) { padding: 18px; }
h2 { margin: 0 0 14px; font-size: 22px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
input, textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  color: var(--text);
  background: rgba(0,0,0,.28);
  padding: 13px 14px;
  font: inherit;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--brand-2); }
button#submit, .gate-actions button {
  border: 0;
  border-radius: 18px;
  padding: 15px 18px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}
button#submit:disabled, .gate-actions button:disabled { opacity: .55; cursor: progress; }
.status { min-height: 24px; margin-top: 12px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.error { color: var(--danger); }

.gate-shell { width: min(760px, 100%); }
.gate-card { display: grid; gap: 14px; }
.gate-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.1);
}
.gate-label { color: var(--muted); font-size: 14px; }
.gate-state { font-size: 28px; font-weight: 850; }
.gate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gate-actions #refresh { grid-column: 1 / -1; }
.gate-actions .danger-action { background: linear-gradient(135deg, #ff8b5c, #ff5c7a); }
.gate-snapshot {
  display: none;
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(0,0,0,.25);
}

@media (max-width: 640px) {
  .grid, .gate-actions { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
}
