:root {
  --bg: #07100f;
  --surface: #0b1715;
  --surface-2: #0e1c19;
  --line: #20332f;
  --text: #edf6f3;
  --muted: #8ea49e;
  --faint: #5e7770;
  --mint: #7cf7c7;
  --red: #ff6f6f;
  --amber: #f4c56a;
  --mono: "JetBrains Mono", monospace;
  --sans: "DM Sans", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 75% 0%, rgba(255,111,111,.07), transparent 30rem), var(--bg);
  font-family: var(--sans);
}
button, input { font: inherit; }
.topbar {
  height: 68px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid #162724;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: var(--mint); color: #062119;
  font: 700 12px var(--mono);
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 12px; }
main { width: min(880px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 80px; }
.page-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 28px; }
.eyebrow, .section-label { color: var(--mint); font: 600 10px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 8px 0 0; font-size: clamp(34px, 6vw, 54px); letter-spacing: -.05em; }
.identity-card {
  min-width: 240px; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); display: grid; gap: 4px;
}
.identity-card span, .identity-card small { color: var(--muted); font-size: 10px; }
.identity-card strong { font: 600 12px var(--mono); }
.identity-card .secondary-button { justify-self: end; margin-top: 5px; }
.control-card {
  min-height: 170px; padding: 26px 28px; border: 1px solid var(--line);
  border-radius: 15px; background: var(--surface); display: flex;
  justify-content: space-between; align-items: center; gap: 28px;
}
.control-card h2 { margin: 7px 0 8px; font-size: 25px; }
.control-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.kill-switch {
  min-width: 158px; min-height: 78px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface-2); color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 13px;
}
.kill-switch:disabled { opacity: .58; cursor: not-allowed; }
.switch-track { width: 48px; height: 26px; padding: 3px; border-radius: 99px; background: #31403d; }
.switch-track i { display: block; width: 20px; height: 20px; border-radius: 50%; background: #a9b8b4; transition: transform .18s ease; }
.kill-switch strong { font: 700 13px var(--mono); }
.kill-switch.is-on { border-color: rgba(255,111,111,.55); background: rgba(255,111,111,.08); color: #ffc1c1; }
.kill-switch.is-on .switch-track { background: var(--red); }
.kill-switch.is-on .switch-track i { transform: translateX(22px); background: #fff; }
.kill-switch.is-off { color: var(--mint); }
.message, .stale-banner { margin-top: 14px; padding: 12px 15px; border-radius: 9px; font-size: 12px; }
.message { color: #ffc1c1; border: 1px solid rgba(255,111,111,.35); background: rgba(255,111,111,.08); }
.message.is-info { color: var(--amber); border-color: rgba(244,197,106,.35); background: rgba(244,197,106,.08); }
.stale-banner { color: var(--amber); border: 1px solid rgba(244,197,106,.3); }
.exposure-warning {
  margin-top: 14px; padding: 14px 16px; border-radius: 9px;
  color: var(--amber); border: 1px solid rgba(244,197,106,.35);
  background: rgba(244,197,106,.07); font-size: 12px; line-height: 1.5;
}
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--line); }
.status-grid article { min-height: 104px; padding: 18px; background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; }
.status-grid span { color: var(--muted); font-size: 11px; }
.status-grid strong { font: 600 12px var(--mono); overflow-wrap: anywhere; }
.safety-note { margin-top: 18px; padding: 18px 20px; border-left: 2px solid var(--red); background: rgba(255,111,111,.04); display: grid; gap: 6px; }
.safety-note span { color: var(--muted); line-height: 1.55; font-size: 12px; }
.secondary-button, .danger-button {
  min-height: 37px; border-radius: 8px; padding: 0 13px; cursor: pointer; font-weight: 700; font-size: 11px;
}
.secondary-button { color: var(--text); border: 1px solid var(--line); background: var(--surface); }
.danger-button { color: #240707; border: 1px solid var(--red); background: var(--red); }
dialog { width: min(470px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--surface); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.72); }
dialog form { padding: 25px; }
dialog h2 { margin: 0 0 14px; }
.dialog-body { color: var(--muted); line-height: 1.65; white-space: pre-line; }
.pin-label { display: block; margin-top: 20px; color: var(--muted); font-size: 11px; }
.pin-input {
  width: 100%; height: 44px; margin-top: 7px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); background: var(--surface-2);
  font: 600 18px var(--mono); letter-spacing: .2em;
}
.pin-input:focus { outline: 2px solid rgba(124,247,199,.28); border-color: var(--mint); }
.dialog-error {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  color: #ffc1c1; background: rgba(255,111,111,.08); font-size: 11px;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
@media (max-width: 720px) {
  main { padding-top: 32px; }
  .page-heading, .control-card { align-items: stretch; flex-direction: column; }
  .identity-card { min-width: 0; }
  .status-grid { grid-template-columns: 1fr 1fr; }
}
