:root {
    color-scheme: light;
    --bg: #f3f6fa;
    --paper: #fff;
    --ink: #182637;
    --muted: #516277;
    --line: #d9e2ee;
    --control-line: #8394aa;
    --blue: #2350b1;
    --blue-dark: #183d8e;
    --red: #a52c3d;
    --radius: 12px;
    font: 16px/1.55 system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: .17em; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid #2459cc; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -.035em; }
h2 { font-size: 1.22rem; letter-spacing: -.015em; }
h3 { font-size: 1.06rem; }
p { margin: .5rem 0 .9rem; }
p:last-child { margin-bottom: 0; }
code, .mono { font-family: ui-monospace, monospace; overflow-wrap: anywhere; font-size: .92em; }
.shell { width: min(100% - 2rem, 1160px); margin-inline: auto; }
.main { padding-block: 2rem 4rem; }
.narrow { max-width: 525px; }
.skip { position: absolute; z-index: 3; left: .75rem; top: .75rem; transform: translateY(-180%); background: var(--paper); padding: .6rem; }
.skip:focus { transform: translateY(0); }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 67px; display: flex; gap: 1rem 2rem; align-items: center; flex-wrap: wrap; }
.topbar-inner > form { margin-inline-start: auto; }
.brand { display: inline-flex; gap: .65rem; align-items: center; text-decoration: none; font-weight: 750; color: var(--ink); }
.brand-mark { background: var(--blue); color: white; border-radius: 9px; width: 35px; height: 35px; display: grid; place-items: center; }
.brand-mark svg { width: 22px; height: 22px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .3rem; }
.topbar nav a { min-height: 44px; display: inline-flex; align-items: center; padding: .25rem .75rem; border-radius: 7px; text-decoration: none; color: var(--muted); }
.topbar nav a[aria-current], .topbar nav a:hover { background: #e8f0ff; color: var(--blue-dark); }
.page-heading, .panel-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1.25rem; }
.page-heading { margin-bottom: 1.35rem; }
.eyebrow { font-size: .83rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--blue); margin: 0 0 .4rem; }
.muted-text, .cell-note { color: var(--muted); }
.cell-note { display: block; font-size: .9rem; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .65rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: clamp(1rem, 3vw, 1.45rem); min-width: 0; }
.panel + .panel, .settings-grid + .panel { margin-top: 1rem; }
.panel-heading { margin-bottom: .85rem; }
.stack { display: grid; gap: .95rem; }
.panel > .stack, details > .stack { margin-top: 1rem; }
.stack .button { justify-self: start; }
.filters, .field-grid, .settings-grid { display: grid; gap: 1rem; }
.filters { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
.settings-grid, .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid > .panel { margin-top: 0; }
.field { display: grid; align-content: start; gap: .35rem; min-width: 0; font-weight: 620; }
.field input, .field select, .field textarea { width: 100%; color: var(--ink); background: var(--paper); padding: .5rem .65rem; border: 1px solid var(--control-line); border-radius: 7px; min-height: 44px; font-weight: 400; }
.field textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.check input { width: 19px; height: 19px; flex: none; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .86rem; border-radius: 8px; border: 1px solid transparent; text-decoration: none; font-weight: 650; text-align: center; line-height: 1.2; }
.primary { color: white; background: var(--blue); }
.primary:hover { background: var(--blue-dark); color: white; }
.secondary { color: var(--blue-dark); background: var(--paper); border-color: var(--control-line); }
.secondary:hover, .quiet:hover { background: #edf3ff; }
.quiet { background: transparent; color: var(--muted); }
.danger-button { color: var(--red); background: #fff; border-color: #d6a5ad; }
.danger-button:hover { background: #ffedf0; }
.notice { margin: 0 0 1rem; border-radius: 8px; background: #eaf5ee; color: #21563b; padding: .8rem 1rem; }
.notice ul { margin: .4rem 0 0; }
.notice.error { background: #ffeff2; color: #8b2836; }
.field-error { font-weight: 500; color: var(--red); }
.table-panel { padding-inline: 0; }
.table-panel > .panel-heading, .table-panel > .pagination { padding-inline: 1.3rem; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .93rem; }
th, td { padding: .75rem 1.15rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f1f5fa; color: #3e526b; font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
td time { white-space: nowrap; }
.badges, .actions, .pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.badge { display: inline-block; padding: .14rem .56rem; border-radius: 20px; font-size: .82rem; font-weight: 650; }
.good { color: #215a3d; background: #e5f4ea; }
.muted { color: #4d5d70; background: #eaf0f6; }
.info { color: #24498d; background: #e9f0ff; }
.warn { color: #774a0c; background: #fdf1dc; }
.danger { color: #9a2839; background: #ffe9ee; }
.masked { color: var(--muted); letter-spacing: .15em; }
.empty { padding: 1.7rem 1.3rem; color: var(--muted); }
.empty strong { color: var(--ink); }
.pagination, .actions { margin-top: .9rem; }
.inline-form { margin-top: .45rem; }
.disclosure { margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--line); }
summary { color: var(--blue-dark); font-weight: 650; min-height: 44px; padding-block: .52rem; cursor: pointer; }
summary code { margin-inline-start: .35rem; }
.setting-row { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-block: .55rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.setting-row:hover, .setting-open { color: var(--blue-dark); }
.section-form { margin-block: .9rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .7rem; margin: 1rem 0; }
dt { font-size: .87rem; color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.snapshot { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: .75rem; }
.qr { display: inline-flex; background: white; border: 1px solid var(--line); padding: .5rem; }
.qr svg { width: 170px; height: 170px; }
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .25rem; }
@media (max-width: 740px) {
    .topbar-inner { gap: .4rem .75rem; padding-block: .55rem; }
    .topbar nav { order: 3; width: 100%; }
    .filters, .settings-grid { grid-template-columns: 1fr; }
    .filters .button { justify-self: start; }
}
@media (max-width: 470px) {
    .field-grid { grid-template-columns: 1fr; }
    .main { padding-top: 1.1rem; }
    th, td { padding-inline: .75rem; }
}
