:root {
  --bg: #f5f4f0; --panel: #fff; --text: #1c1b19; --muted: #6b6862; --line: #e2dfd8;
  --accent: #2f6f5e; --accent-text: #fff; --ok: #2f7d4f; --bad: #b3322b; --chip: #eeece6; --code: #f0eee8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --panel: #1e1d1b; --text: #ecebe7; --muted: #9d9992; --line: #32302c;
    --accent: #6cc2a6; --accent-text: #0d1512; --ok: #5cc28a; --bad: #f0746b; --chip: #2a2926; --code: #262522;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: 28px 16px 64px; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 10px; }
p { margin: 8px 0; }
.lead { color: var(--muted); margin-bottom: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-top: 2px; }
.step > div { flex: 1; min-width: 0; }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 12px 0; }
.choice { text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px;
  padding: 12px; font: inherit; cursor: pointer; }
.choice.selected { border-color: var(--accent); outline: 2px solid var(--accent); }
.choice b { display: block; }
button.primary, button.ghost, button.danger, a.button { font: inherit; border-radius: 8px; padding: 10px 16px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; display: inline-block; }
button.primary, a.button { background: var(--accent); color: var(--accent-text); font-weight: 600; }
button.ghost { background: none; border-color: var(--line); color: var(--text); }
button.danger { background: none; border-color: var(--line); color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
button.small { padding: 5px 10px; font-size: 14px; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; width: 100%; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > .fixed { flex: 0 0 auto; }
.secret { display: flex; gap: 8px; align-items: center; background: var(--code); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.secret code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 10px; width: max-content; max-width: 100%; margin: 10px 0; }
.qr svg { max-width: 100%; height: auto; }
.warn { border-left: 3px solid var(--bad); padding: 6px 0 6px 12px; margin: 12px 0; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
ul.plain { padding-left: 18px; margin: 6px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; border-top: 0; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.scroll { overflow-x: auto; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 9px 14px; border-radius: 8px; max-width: calc(100% - 32px); }
