:root {
  --bg: #f4f2ee; --card: #ffffff; --fg: #1d2329; --muted: #6a7178;
  --line: #dcd8d0; --accent: #2f6f5e; --accent-fg: #ffffff; --err: #b3261e; --ok: #2f6f5e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121517; --card: #1b1f22; --fg: #e6e8ea; --muted: #9aa1a8;
    --line: #2c3236; --accent: #5fb39b; --accent-fg: #0d1211; --err: #f2867e; --ok: #7fd1b8;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
header, main { max-width: 640px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 28px; padding-bottom: 8px; }
h1 { margin: 0; font-size: 1.6rem; }
h2 { margin: 0 0 14px; font-size: 1.15rem; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin: 16px 0;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 10px;
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
.file input { padding: 12px; }
button {
  width: 100%; padding: 12px; font: inherit; font-weight: 600;
  background: var(--accent); color: var(--accent-fg);
  border: 0; border-radius: 8px; cursor: pointer;
}
button:disabled { opacity: .6; cursor: progress; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
header { position: relative; }
.back { margin: 0 0 6px; font-size: .9rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover, .back a:focus-visible { color: var(--accent); text-decoration: underline; }
.logout { position: absolute; top: 30px; right: 16px; }
button.link {
  width: auto; padding: 4px 0; background: none; color: var(--accent);
  font-weight: 500; font-size: .9rem; text-decoration: underline;
}
.err { color: var(--err); font-weight: 600; margin: 0 0 12px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--fg); }
label.check input { width: auto; margin: 0; }
.hint a { color: var(--accent); }
.steps { margin: 0 0 8px; padding-left: 20px; }
.steps li { margin: 4px 0; }
img.qr { display: block; margin: 12px auto; background: #fff; border-radius: 8px; image-rendering: pixelated; }
code.secret { font-size: .95rem; word-break: break-all; }
.hint { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
#message { min-height: 1.5em; font-weight: 600; padding-bottom: 32px; }
#message.ok { color: var(--ok); }
#message.err { color: var(--err); }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; gap: 0; } }
