:root {
  color-scheme: dark;
  --bg: #08121f;
  --panel: #0e1b2c;
  --line: #24384f;
  --text: #f4f6f8;
  --muted: #96a3b0;
  --signal: #8cc8e4;
  --accent: #3b8fb8;
  --alert: #f5b27a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.bar strong { flex: 1; font-size: 15px; }
main { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.pad { padding: 16px; }
h1 { margin: 8px 0; font-size: 22px; line-height: 1.25; }
h2 { margin: 24px 0 8px; font-size: 16px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 14px; }
.notice { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--alert); color: var(--alert); font-size: 14px; }
.error { margin: 10px 0; color: var(--alert); font-size: 14px; min-height: 1.5em; }
label { display: block; margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: #06101b;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: progress; }
button.ghost { background: transparent; color: var(--signal); border-color: var(--line); font-weight: 500; }
button.danger { background: transparent; color: var(--alert); border-color: var(--alert); font-weight: 500; }
.bar button { min-height: 36px; padding: 4px 10px; font-size: 14px; }
.stack { display: grid; gap: 10px; margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.row > button { flex: 1 1 140px; }
.accounts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.account { border: 1px solid var(--line); background: var(--panel); }
.account .tap {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 12px 14px 10px;
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 400;
  text-align: left;
}
.account .name { font-weight: 600; overflow-wrap: anywhere; }
.account .who { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.account .code { margin-top: 4px; font: 600 32px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; color: var(--signal); font-variant-numeric: tabular-nums; }
.account .code.soon { color: var(--alert); }
.account .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 10px; color: var(--muted); font-size: 13px; }
.account .foot button { min-height: 32px; padding: 2px 8px; font-size: 13px; }
progress { display: block; width: 100%; height: 3px; border: 0; background: var(--line); appearance: none; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.scanner { position: relative; margin-top: 12px; aspect-ratio: 1; max-height: 60dvh; width: 100%; background: #000; overflow: hidden; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; min-height: 32px; color: var(--signal); }
ol { padding-left: 20px; margin: 8px 0; }
li { margin: 4px 0; }
