:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #15181d;
  --muted: #5d6573;
  --border: #dde1e7;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 14px;
  --tap: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #181b21;
    --surface-2: #22262e;
    --text: #eceef2;
    --muted: #9aa3b2;
    --border: #2c313a;
    --accent: #4f8cff;
    --accent-text: #0b0d10;
    --ok: #4ade80;
    --warn: #fbbf24;
    --danger: #f87171;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #181b21;
  --surface-2: #22262e;
  --text: #eceef2;
  --muted: #9aa3b2;
  --border: #2c313a;
  --accent: #4f8cff;
  --accent-text: #0b0d10;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
.boot { padding: 40px 16px; text-align: center; color: var(--muted); }

.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 20px; margin: 0; }
.pill {
  font-size: 13px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.off { color: var(--warn); }
.pill.pending { color: var(--warn); }

main { flex: 1; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); display: grid; gap: 12px; align-content: start; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px;
}
.card h2 { font-size: 15px; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.big { font-size: 24px; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.soon { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

.tabs {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  min-height: 60px; border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 14px; display: grid; place-items: center; gap: 2px; padding: 6px 0;
}
.tabs button[aria-current="page"] { color: var(--accent); font-weight: 700; }
.tabs .ico { font-size: 20px; line-height: 1; }

.auth { max-width: 420px; margin: 0 auto; padding: 48px 16px; display: grid; gap: 16px; }
.auth h1 { margin: 0; font-size: 26px; }
label { display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
input {
  font: inherit; font-size: 18px; min-height: var(--tap); padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  font: inherit; font-weight: 700; min-height: var(--tap); padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; background: var(--accent); color: var(--accent-text);
  cursor: pointer;
}
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn:disabled { opacity: .55; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.error { color: var(--danger); margin: 0; }
.okmsg { color: var(--ok); margin: 0; }
.disclaimer { font-size: 14px; color: var(--muted); border-inline-start: 3px solid var(--warn); padding-inline-start: 10px; }
.stack { display: grid; gap: 12px; }
