:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1b1d1f;
  --muted: #55595e;
  --line: #d4d2cc;
  --accent: #0f5e57;
  --accent-text: #ffffff;
  --danger: #a3261b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141516;
    --surface: #1d1f21;
    --text: #ecebe7;
    --muted: #a7a9ab;
    --line: #3a3d40;
    --accent: #5fb3a8;
    --accent-text: #0b1312;
    --danger: #f08a7e;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
main { max-width: 440px; margin: 0 auto; padding: 24px 16px calc(32px + env(safe-area-inset-bottom)); }
header { margin-bottom: 28px; }
.brand { margin: 0; font-weight: 600; letter-spacing: 0.01em; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 8px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.origin { font-size: 0.9rem; color: var(--muted); word-break: break-all; }
.fine { font-size: 0.85rem; color: var(--muted); margin-top: 20px; }
form { margin-top: 8px; }
.field { position: relative; margin-bottom: 16px; }
label { display: block; font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 12px 0; }
input[type=text], input[type=password], input:not([type]) {
  width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
input:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.field input[type=password], .field input[data-shown] { padding-right: 96px; }
.toggle {
  position: absolute; right: 6px; bottom: 6px; min-height: 36px; padding: 0 10px;
  background: transparent; color: var(--accent); border: 0; font: inherit; font-size: 0.9rem; cursor: pointer;
}
button[type=submit] {
  width: 100%; min-height: 50px; margin-top: 8px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
}
button[disabled] { opacity: 0.6; cursor: progress; }
.msg { color: var(--danger); min-height: 1.5em; margin: 4px 0 0; }
.codes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; columns: 2; padding-left: 1.2em; }
.qr { display: block; width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; margin: 12px 0; }
code.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
@media (prefers-reduced-motion: no-preference) { button { transition: opacity 120ms ease; } }
