:root {
    --ink: #1f2933;
    --muted: #52606d;
    --line: #cbd2d9;
    --accent: #1d4ed8;
    --error: #b42318;
    --notice: #e6f4ea;
    --page: #f5f7fa;
    --surface: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
    color: var(--accent);
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.site-header form {
    margin: 0;
}

main {
    max-width: 480px;
    margin: 32px auto;
    padding: 0 16px;
}

h1 {
    margin-top: 0;
    font-size: 1.75rem;
}

h2 {
    margin-top: 32px;
    font-size: 1.15rem;
}

.field {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

input:not([type="hidden"]) {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--muted);
    border-radius: 4px;
    font: inherit;
}

.password-field {
    display: flex;
    gap: 8px;
}

button,
.button {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

button.secondary,
.toggle-password {
    background: var(--surface);
    color: var(--accent);
}

.toggle-password {
    flex: none;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    text-decoration: underline;
}

.error {
    margin: 4px 0 0;
    color: var(--error);
}

.hint {
    margin: -8px 0 16px;
    color: var(--muted);
}

.notice {
    padding: 10px 12px;
    border-radius: 4px;
    background: var(--notice);
}

.qr-code {
    width: 236px;
    padding: 8px;
    background: #ffffff;
}

.secret {
    word-break: break-all;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0;
    list-style: none;
}

.summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.summary div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

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

.summary dd {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

main.wide {
    max-width: 1100px;
}

[aria-invalid="true"] {
    border-color: var(--error);
}

textarea {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--muted);
    border-radius: 4px;
    font: inherit;
}

.button.secondary {
    background: var(--surface);
    color: var(--accent);
}

.table-scroll {
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
}

caption {
    padding: 10px 12px;
    color: var(--muted);
    text-align: left;
}

th,
td {
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.nowrap {
    white-space: nowrap;
}

.missing,
.warning {
    color: var(--error);
}

.warning {
    font-weight: 600;
}

.period-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

.period-form .field {
    flex: 0 1 200px;
}

.period-form button {
    margin-bottom: 16px;
}

.pages {
    display: flex;
    gap: 16px;
}

.deleted {
    padding: 0;
    list-style: none;
}

.deleted li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.deleted form {
    margin: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
