:root {
  color-scheme: light dark;
  --bg: #e9edf4;
  --surface: #fff;
  --line: #e3e8ef;
  --border: #c2ccd9;
  --ink: #0f1c2e;
  --secondary: #3a4a5e;
  --muted: #586777;
  --green: #00854b;
  --green-hover: #007540;
  --link: #006b3d;
  --hover: #dcf2e6;
  --error-text: #b32b20;
  --error-bg: #fee6e3;
  --on-green: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a131e;
    --surface: #10202f;
    --line: #213447;
    --border: #2a4055;
    --ink: #e9f0f8;
    --secondary: #c2cfdd;
    --muted: #8a9bb0;
    --green: #17a35f;
    --green-hover: #3ecb86;
    --link: #3ecb86;
    --hover: #0f3a28;
    --error-text: #ffb8ae;
    --error-bg: #452421;
    --on-green: #071d14;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "IBM Plex Sans", Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.layout { width: min(100% - 48px, 420px); margin: clamp(32px, 12vh, 104px) auto 32px; }
.layout.wide { max-width: 640px; width: min(100% - 48px, 640px); }
.mast, .account, .product, .factor { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mast { min-height: 36px; margin-bottom: 24px; }
.brand { font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.account { font-size: 14px; color: var(--secondary); min-width: 0; }
.account span { overflow-wrap: anywhere; }
h1 { margin: 0 0 12px; font-weight: 600; font-size: 24px; line-height: 30px; letter-spacing: -.015em; }
.sheet { border: 1px solid var(--line); background: var(--surface); padding: 16px; border-radius: 10px; box-shadow: 0 1px 2px rgba(15,28,46,.06); }
p { margin: 0 0 16px; }
form:not(.account form) { display: grid; gap: 12px; }
label { display: grid; gap: 4px; color: var(--secondary); font-size: 13px; font-weight: 600; }
input, button { font: inherit; color: var(--ink); }
input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 16px; font-weight: 400; }
input:focus, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 40%, transparent); outline-offset: 2px; }
input:focus { border-color: var(--green); outline-offset: 0; }
button, summary { cursor: pointer; }
button { min-height: 36px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 600; }
.primary { background: var(--green); color: var(--on-green); border-color: var(--green); margin-top: 4px; }
.primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.quiet { padding-inline: 12px; }
a, summary { color: var(--link); font-weight: 600; }
a:hover, summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.after { display: inline-block; margin-top: 12px; font-size: 14px; }
.hint, .subtitle { color: var(--muted); font-size: 13px; font-weight: 400; }
.hint { margin: -8px 0 0; }
.intro, .empty { color: var(--secondary); }
.error { background: var(--error-bg); color: var(--error-text); border-radius: 6px; padding: 8px 12px; font-size: 14px; }
.qr { display: block; max-width: 100%; height: auto; margin: 0 auto 12px; background: white; }
details { margin: 0 0 16px; font-size: 14px; }
.setup-key { display: block; overflow-wrap: anywhere; color: var(--ink); margin-top: 8px; }
.products { margin: -8px -8px 8px; }
.product { padding: 12px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.product:hover { background: var(--hover); text-decoration: none; }
.product svg { color: var(--link); flex: none; }
.subtitle { display: block; margin-top: 2px; }
.factor { border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }
@media (max-width: 540px) {
  .layout, .layout.wide { width: calc(100% - 24px); margin-top: 24px; }
  .mast { margin-bottom: 16px; }
}
.profile { display: grid; gap: 12px; margin: 0; }
.profile dt { color: var(--muted); font-size: 13px; }
.profile dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.access-scope { margin: 0; padding: 0; min-width: 0; border: 0; }
.access-scope legend { margin-bottom: 8px; padding: 0; color: var(--secondary); font-size: 13px; font-weight: 600; }
.remember-login, .access-scope label { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--ink); font-size: 14px; }
.remember-login input[type="checkbox"], .access-scope input[type="checkbox"] { flex: none; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--green); }
.access-scope label:has(input:disabled), .access-scope small { color: var(--muted); font-weight: 400; }
.staff-toolbar { padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.staff-create-link { display: inline-flex; align-items: center; min-height: 36px; margin: 0; padding: 0 16px; border: 1px solid var(--green); border-radius: 8px; font-size: 14px; text-decoration: none; }
.staff-create-link:hover { text-decoration: none; }
.staff-approval { padding-top: 12px; border-top: 1px solid var(--line); }
h1, .account a, .product > span:first-child { overflow-wrap: anywhere; }
.brand, .account form { flex: none; }
.account a, .product > span:first-child { min-width: 0; }
