:root {
    color-scheme: light;
    font-family: system-ui, sans-serif;
    color: #17243b;
    background: #f4f6fa;
    line-height: 1.5;
    --accent: #2454a6;
    --border: #d8e0ec;
    --muted: #51627a;
}

* { box-sizing: border-box; }
body { margin: 0; }
a, .link { color: var(--accent); }
a:hover, .link:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #487fc9; outline-offset: 3px; }

.shell { width: min(72rem, 100% - 2rem); margin-inline: auto; }
main.shell { margin-block: 2.5rem; }
.shell.narrow { width: min(38rem, 100% - 2rem); }
.topbar { background: white; border-bottom: 1px solid var(--border); }
.topbar-inner, nav, .heading { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar-inner, .heading { justify-content: space-between; }
.topbar-inner { min-height: 4rem; padding-block: .5rem; }
.brand { color: inherit; font-size: 1.15rem; font-weight: 750; text-decoration: none; }
nav a { text-decoration: none; }
nav a[aria-current] { font-weight: 700; text-decoration: underline; text-underline-offset: .35em; }
nav form, td form { display: inline; }

h1 { margin: 0; line-height: 1.2; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -.025em; }
.heading { margin-bottom: 1.4rem; }
.panel { padding: clamp(1rem, 4vw, 2rem); }
.panel, .table-wrap { background: white; border: 1px solid var(--border); border-radius: .75rem; }
.empty { color: var(--muted); }
.back { display: inline-block; margin-bottom: .85rem; }
.panel h1 { margin-bottom: 1.5rem; }
.panel .field, .panel form > div > div { margin-bottom: 1.2rem; }
label { display: block; font-weight: 620; margin-bottom: .3rem; }
label:has(+ input[type="checkbox"]) { display: inline; }
input, select, button { font: inherit; }
input:not([type="checkbox"], [type="hidden"]), select {
    width: 100%;
    border: 1px solid #a8b7cb;
    border-radius: .4rem;
    background: white;
    color: inherit;
    padding: .55rem .65rem;
}
input[type="checkbox"] { width: 1rem; height: 1rem; vertical-align: middle; accent-color: var(--accent); }
button { cursor: pointer; }
.primary {
    display: inline-block;
    padding: .55rem .9rem;
    color: white;
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: .45rem;
    font-weight: 680;
    text-decoration: none;
}
.primary:hover { background: #173d80; }
.link { border: 0; padding: 0; background: transparent; text-decoration: underline; }
.help-text, .muted, small { color: var(--muted); }
.help-text { margin-top: .35rem; font-size: .9rem; }
.form-error-message, .panel form ul, .error { color: #98272c; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { text-align: left; background: #edf2fa; }
th, td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
td { overflow-wrap: anywhere; }
tbody tr:last-child > * { border-bottom: 0; }
small { display: block; }
details { margin-top: .4rem; font-size: .9rem; }
summary { cursor: pointer; }
details ul { padding-left: 1rem; margin-block: .3rem 0; }
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; min-width: 7rem; }
.notice { padding: .75rem 1rem; border-radius: .5rem; margin: 0 0 1rem; }
.notice.info { background: #e6eefc; color: #274673; }
.notice.success { background: #e2f4ea; }
.notice.error { background: #fcecee; }
.status { display: inline-block; font-size: .9rem; font-weight: 650; }
.success { color: #216743; }
.info { color: #274673; }
