:root {
  color-scheme: dark;
  --bg: #071012;
  --panel: #10191d;
  --panel-2: #132329;
  --line: #264149;
  --text: #eef7f5;
  --muted: #92a6aa;
  --green: #3ee486;
  --red: #ff6b78;
  --yellow: #f1c84b;
  --blue: #68b7ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, rgba(62,228,134,.12), transparent 28%), var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.app-shell {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}
.hero, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 25, 29, .94);
  box-shadow: 0 20px 70px rgba(0,0,0,.24);
}
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 2px; font-size: 34px; }
h2 { margin-bottom: 6px; font-size: 21px; }
p { color: var(--muted); }
.home-link, button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1a252a;
  color: var(--text);
  padding: 10px 12px;
  text-decoration: none;
  cursor: pointer;
}
button { font-weight: 800; }
button:hover, .home-link:hover { border-color: var(--green); }
.top-grid, .stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.panel { padding: 14px; }
.control-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.primary-toggle {
  min-width: 180px;
}
.primary-toggle.on {
  background: rgba(62,228,134,.14);
  color: var(--green);
  border-color: rgba(62,228,134,.6);
}
.primary-toggle.off {
  background: rgba(255,107,120,.14);
  color: var(--red);
  border-color: rgba(255,107,120,.65);
}
.section-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.step {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(104,183,255,.13);
  color: var(--blue);
  font-weight: 900;
}
.switch-row, .direction-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.switch-row label, .direction-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
label {
  color: var(--muted);
  font-weight: 700;
}
input, select {
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1316;
  color: var(--text);
  padding: 10px;
  font: inherit;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}
.api-grid, .reason-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.mini-card {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0d171a;
}
.mini-card strong, .mini-card span {
  display: block;
  color: var(--muted);
}
.mini-card b {
  display: block;
  margin: 7px 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}
.mini-card.good { border-color: rgba(62,228,134,.45); }
.mini-card.warn { border-color: rgba(241,200,75,.55); }
.mini-card.bad { border-color: rgba(255,107,120,.55); }
.mini-card.off { opacity: .68; }
@media (max-width: 980px) {
  .top-grid, .stage-grid, .api-grid, .reason-grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .hero, .control-card { align-items: stretch; flex-direction: column; }
  .primary-toggle, .home-link { width: 100%; text-align: center; }
  h1 { font-size: 28px; }
}
