:root {
  color-scheme: dark;
  --bg: #0c1110;
  --surface: #131918;
  --surface-raised: #19211f;
  --line: #2a3532;
  --ink: #f0f5f2;
  --muted: #98a7a2;
  --green: #75e4b3;
  --green-soft: #173a2d;
  --amber: #ffc766;
  --amber-soft: #3c301a;
  --red: #ff8b7a;
  --red-soft: #3e201e;
  --focus: #a8f1d2;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: #070a09; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--bg); }
button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hidden { display: none !important; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; min-height: 44px; padding: 12px 14px; color: #07100c; background: var(--focus); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.admin-shell { min-height: 100dvh; max-width: 720px; margin: 0 auto; background: radial-gradient(circle at 85% -5%, rgba(117, 228, 179, .1), transparent 28%), var(--bg); }
.topbar { position: sticky; z-index: 20; top: 0; min-height: 68px; padding: max(14px, env(safe-area-inset-top)) 18px 12px; display: flex; align-items: center; justify-content: space-between; background: rgba(12, 17, 16, .9); border-bottom: 1px solid rgba(42, 53, 50, .75); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 12px; font-weight: 850; letter-spacing: .16em; }
.brand svg { width: 30px; height: 30px; padding: 5px; fill: none; stroke: var(--green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; border: 1px solid var(--line); border-radius: 9px; }
.status-pill { min-height: 34px; padding: 8px 11px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-pill::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: currentColor; }
.status-locked { color: var(--amber); background: var(--amber-soft); }
.status-active { color: var(--green); background: var(--green-soft); }

main { padding: 24px 16px calc(38px + env(safe-area-inset-bottom)); }
.intro { padding: 18px 2px 23px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 10vw, 54px); line-height: 1; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
p { line-height: 1.55; }
.intro > p:last-child { max-width: 560px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }

.state-card { margin-bottom: 30px; padding: 20px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-raised); }
.state-card::after { content: ""; position: absolute; width: 135px; height: 135px; right: -55px; top: -55px; border: 24px solid rgba(255, 199, 102, .08); border-radius: 50%; }
.state-card.active::after { border-color: rgba(117, 228, 179, .09); }
.state-kicker { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.state-value { display: block; margin-top: 9px; color: var(--amber); font-size: 27px; font-weight: 780; letter-spacing: -.035em; }
.state-card.active .state-value { color: var(--green); }
.state-card p { max-width: 490px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.section-heading { margin: 0 2px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface); cursor: pointer; }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { color: var(--ink); border-color: #42514d; }
.icon-button:active { transform: scale(.97); }
.gate-list { display: grid; gap: 9px; }
.gate { min-height: 67px; padding: 13px 14px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.gate-icon { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--amber); background: var(--amber-soft); }
.gate.ok .gate-icon { color: var(--green); background: var(--green-soft); }
.gate-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gate-copy { min-width: 0; flex: 1; }
.gate-copy strong, .gate-copy small { display: block; }
.gate-copy strong { font-size: 13px; }
.gate-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.gate-state { color: var(--amber); font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.gate.ok .gate-state { color: var(--green); }

.control-card { margin-top: 30px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.control-card h2 { margin-bottom: 8px; }
.control-card p { margin: 0 0 17px; color: var(--muted); font-size: 12px; }
.blocker-list { margin: 0 0 18px; padding: 0; display: grid; gap: 7px; list-style: none; }
.blocker-list li { padding-left: 17px; position: relative; color: var(--amber); font-size: 11px; line-height: 1.45; }
.blocker-list li::before { content: ""; position: absolute; left: 1px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.button { min-height: 48px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 13px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button-primary { color: #08100d; background: var(--green); }
.button-secondary { color: var(--ink); background: #26302e; }
.button-danger { color: #21100d; background: var(--red); }
.button-stop { width: 100%; color: #21100d; background: var(--red); }
.button-arm { width: 100%; color: #07100c; background: var(--green); }
.footnote { margin: 20px 2px 0; color: #71807b; font-size: 10px; }

.center-screen { min-height: calc(100dvh - 120px); padding: 42px 2px; display: flex; flex-direction: column; justify-content: center; }
.center-screen h1 { font-size: clamp(36px, 11vw, 52px); }
.center-screen > p:not(.eyebrow) { margin: 17px 0 24px; color: var(--muted); font-size: 14px; }
.lock-mark { width: 74px; height: 74px; margin-bottom: 28px; display: grid; place-items: center; border-radius: 22px; color: var(--green); background: var(--green-soft); }
.lock-mark svg { width: 33px; height: 33px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.loading-screen { padding-top: 18px; }
.skeleton { background: linear-gradient(90deg, #151c1a 25%, #202a27 50%, #151c1a 75%); background-size: 200% 100%; border-radius: 18px; animation: shimmer 1.25s infinite; }
.skeleton-title { width: 70%; height: 55px; margin-bottom: 25px; }
.skeleton-hero { height: 145px; margin-bottom: 28px; }
.skeleton-row { height: 67px; margin-bottom: 9px; }
@keyframes shimmer { to { background-position: -200% 0; } }

dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; color: var(--ink); border: 1px solid #394641; border-radius: 22px; background: var(--surface-raised); box-shadow: 0 30px 100px rgba(0, 0, 0, .55); }
dialog::backdrop { background: rgba(2, 5, 4, .76); backdrop-filter: blur(5px); }
dialog form { padding: 22px; }
.dialog-icon { width: 50px; height: 50px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 15px; color: var(--red); background: var(--red-soft); }
.dialog-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
dialog h2 { font-size: 25px; }
dialog p:not(.eyebrow, .form-error) { margin: 10px 0 18px; color: var(--muted); font-size: 12px; }
.check-row { min-height: 56px; padding: 12px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 13px; color: #c4cfcb; font-size: 12px; line-height: 1.45; cursor: pointer; }
.check-row input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--green); }
.phrase-field { margin-top: 17px; display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.phrase-field code { margin-top: 7px; padding: 8px 10px; display: block; color: var(--amber); border: 1px dashed #5a4a28; border-radius: 9px; background: #1d1b14; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
#phrase-input { width: 100%; min-height: 48px; margin-top: 9px; padding: 0 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: #0f1514; font-size: 16px; }
.form-error { margin: 10px 0 0; color: var(--red); font-size: 11px; }
.dialog-actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 11px 14px; color: var(--ink); background: #26302e; border: 1px solid #3b4844; border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  body { padding: 20px 0; }
  .admin-shell { min-height: calc(100dvh - 40px); border: 1px solid #1f2926; border-radius: 25px; overflow: clip; box-shadow: 0 26px 90px rgba(0, 0, 0, .38); }
  main { padding-inline: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
