:root {
  --bg: #f4f6fa; --card: #ffffff; --text: #0f172a; --muted: #5b6577; --line: #e2e7ef;
  --accent: #2552d0; --accent-text: #ffffff; --ok: #137a43; --ok-bg: #e5f5ec;
  --warn: #8a5a00; --warn-bg: #fff4dc; --danger: #b42318; --danger-bg: #fdecea;
  --radius: 14px; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --card: #141b2d; --text: #e7ecf5; --muted: #95a1b6; --line: #24304a;
    --accent: #6b8cff; --accent-text: #0b1120; --ok: #4ade80; --ok-bg: #11301f;
    --warn: #fbbf24; --warn-bg: #33270a; --danger: #f87171; --danger-bg: #3a1414;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh; padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; display: flex; align-items: center; gap: 10px; letter-spacing: .2px; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: url(/icons/icon-192.png) center / cover; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 8px 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
label { display: block; font-weight: 550; font-size: .925rem; margin-bottom: 4px; }
input {
  width: 100%; font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button {
  font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); min-height: 44px;
}
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--danger); color: #fff; }
button.big { width: 100%; padding: 16px; font-size: 1.05rem; }
button.link { background: none; color: var(--accent); padding: 8px; min-height: 0; }
button:disabled { opacity: .55; cursor: default; }
.pill { display: inline-block; font-size: .8rem; font-weight: 650; padding: 2px 10px; border-radius: 999px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.neutral { background: var(--line); color: var(--muted); }
.banner { border-radius: 10px; padding: 12px; margin: 12px 0; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.danger { background: var(--danger-bg); color: var(--danger); }
.code { font: 600 2rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 4px; text-align: center; padding: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; }
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 2;
}
.nav a { flex: 1; text-align: center; padding: 14px 0; color: var(--muted); text-decoration: none; font-weight: 600; position: relative; }
.nav a.active { color: var(--accent); }
.dot { position: absolute; top: 10px; margin-left: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px; z-index: 3;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
