:root {
    --fg: #1b1f24;
    --bg: #ffffff;
    --muted: #57606a;
    --line: #d0d7de;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fg: #e6edf3;
        --bg: #0d1117;
        --muted: #9198a1;
        --line: #30363d;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--fg);
    background: var(--bg);
}

.site-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

main {
    max-width: 48rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

p { color: var(--muted); }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.signout { display: flex; align-items: center; gap: 0.75rem; margin: 0; }
.who { color: var(--muted); overflow-wrap: anywhere; }

.stack { display: flex; flex-direction: column; gap: 0.5rem; max-width: 24rem; }
.stack label { font-weight: 600; margin-top: 0.5rem; }

input {
    font: inherit;
    padding: 0.6rem 0.7rem;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    width: 100%;
}

button {
    font: inherit;
    font-weight: 600;
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: #1f6feb;
    cursor: pointer;
}

button.link {
    margin: 0;
    padding: 0;
    font-weight: 400;
    color: inherit;
    background: none;
    text-decoration: underline;
}

.form-error, .field-error { color: #cf222e; }
.form-error ul { margin: 0; padding-left: 1.2rem; }
.validation-summary-valid { display: none; }

button.secondary, a.button.secondary {
    color: var(--fg);
    background: transparent;
    border: 1px solid var(--line);
}

a.button {
    display: inline-block;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    color: #fff;
    background: #1f6feb;
    text-decoration: none;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.actions button { margin-top: 0; }

.or { margin: 0.5rem 0; text-align: center; color: var(--muted); }

.notice {
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-left: 4px solid #1f6feb;
    border-radius: 6px;
    color: var(--fg);
}

.steps { padding-left: 1.2rem; }
.steps > li { margin-bottom: 1.5rem; }

.qr { width: min(240px, 100%); background: #fff; padding: 0.5rem; border-radius: 6px; }
.qr svg { display: block; width: 100%; height: auto; }

kbd { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

.codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.25rem 1.5rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.facts dt { font-weight: 600; margin-top: 1rem; }
.facts dd { margin: 0.25rem 0 0; color: var(--muted); }

.passkeys { list-style: none; padding: 0; }
.passkeys li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}

form.inline { display: flex; gap: 0.5rem; align-items: center; margin: 0; }
form.inline input { width: auto; flex: 1 1 10rem; }
form.inline button { margin-top: 0; }

.muted { color: var(--muted); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media print {
    .site-header, .actions, nav { display: none; }
    body { color: #000; background: #fff; }
}

select {
    font: inherit;
    padding: 0.6rem 0.7rem;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
}

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--line); }
@media (max-width: 40rem) {
    table.list thead { display: none; }
    table.list tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
    table.list td { display: block; border: 0; padding: 0.15rem 0; }
}

.hint { font-size: 0.9rem; color: var(--muted); }

.notice.success { border-left-color: #1a7f37; }
.notice.success strong { color: #1a7f37; }
@media (prefers-color-scheme: dark) {
    .notice.success { border-left-color: #3fb950; }
    .notice.success strong { color: #3fb950; }
}
