:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --card: #1b222c;
  --soft: #252e3a;
  --text: #f5f7fb;
  --muted: #9ea9b8;
  --green: #16ff91;
  --red: #ff405a;
  --amber: #ffc247;
  --blue: #69adff;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, rgba(0, 240, 160, .12), transparent 28rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { touch-action: manipulation; }

.mobile-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
}
.mobile-header, .section-title, summary, footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-header { margin-bottom: 14px; }
.eyebrow { margin: 0 0 3px; color: var(--green); font-size: .7rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 11vw, 3.6rem); line-height: .95; }
h2 { margin-bottom: 0; font-size: 1rem; }
h3 { margin: 0 0 8px; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }

.card { margin-bottom: 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: linear-gradient(180deg, rgba(38,47,59,.96), rgba(24,30,38,.98)); box-shadow: 0 14px 34px rgba(0,0,0,.25); overflow: hidden; }
.badge { padding: 8px 10px; border-radius: 999px; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.badge.good { background: rgba(22,255,145,.13); color: var(--green); }
.badge.bad { background: rgba(255,64,90,.14); color: var(--red); }
.badge.checking { background: rgba(255,255,255,.08); color: var(--muted); }

.install-hint { position: relative; margin-bottom: 12px; padding: 11px 42px 11px 12px; border: 1px solid rgba(105,173,255,.3); border-radius: 12px; background: rgba(105,173,255,.1); color: #cfe4ff; font-size: .84rem; line-height: 1.4; }
.install-hint button { position: absolute; top: 5px; right: 7px; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; }
.login-card { padding: 14px; }
.login-card label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.secret-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
input { min-width: 0; height: 48px; padding: 0 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: rgba(255,255,255,.06); color: var(--text); }
.secret-row button, .control-grid button { min-height: 48px; border: 1px solid rgba(22,255,145,.55); border-radius: 10px; background: rgba(22,255,145,.1); color: var(--green); font-weight: 900; }
.login-card p, .note { margin: 9px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }

.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.metric { min-height: 116px; padding: 14px; }
.metric span { color: var(--muted); font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.metric strong { display: block; margin: 8px 0 4px; color: var(--green); font-size: 1.35rem; line-height: 1.05; }
.metric small { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.metric.bad { border-color: rgba(255,64,90,.65); }
.metric.bad strong { color: var(--red); }

.section-title { min-height: 52px; padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.section-title span { color: var(--muted); font-size: .78rem; }
.alert-panel { border-color: rgba(255,64,90,.5); }
.stack { display: grid; gap: 8px; }
#alerts, .split, .disclosure-body { padding: 12px; }
.alert, .row { padding: 10px 11px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.04); }
.alert { border-color: rgba(255,194,71,.3); color: #ffe1a3; font-size: .82rem; line-height: 1.35; }
.alert.danger { border-color: rgba(255,64,90,.4); color: #ffabb7; }
.row { display: grid; gap: 3px; }
.row-head { display: flex; justify-content: space-between; gap: 10px; }
.row strong { overflow-wrap: anywhere; }
.row span, .row small { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.controls-card { padding-bottom: 13px; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; padding: 12px 12px 0; }
.control-grid .wide { grid-column: 1 / -1; }
.control-grid .warning { border-color: rgba(255,194,71,.6); background: rgba(255,194,71,.1); color: var(--amber); }
.control-grid .danger { border-color: rgba(255,64,90,.7); background: rgba(255,64,90,.12); color: var(--red); }
.control-grid .neutral { border-color: rgba(105,173,255,.55); background: rgba(105,173,255,.1); color: #a9d0ff; }
.control-grid button:disabled { opacity: .42; }
.note { padding: 0 13px; }

.split { display: grid; gap: 14px; }
summary { min-height: 54px; padding: 13px 14px; cursor: pointer; list-style: none; font-weight: 900; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--green); font-size: 1.3rem; }
details[open] summary::after { content: "−"; }
summary strong { margin-left: auto; color: var(--muted); font-size: .8rem; }
.disclosure-body { border-top: 1px solid rgba(255,255,255,.08); }
.empty { padding: 10px; color: var(--muted); font-size: .82rem; }
footer { padding: 8px 2px 0; color: var(--muted); font-size: .76rem; }
footer a { color: #a9d0ff; }

@media (min-width: 650px) {
  .split { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 390px) {
  .hero-grid { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: 1fr; }
  .control-grid .wide { grid-column: auto; }
}
