:root {
    color-scheme: light;
    --ink: #152e2b;
    --muted: #4e645f;
    --green: #204f43;
    --dark: #173c35;
    --paper: #f0f4f1;
    --white: #fff;
    --line: #cbd7d1;
    --ochre: #f1cf8b;
    --error: #862f27;
    --success: #205642;
    font: 16px/1.55 system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
::selection { background: #d1e8dc; color: var(--ink); }
:focus-visible { outline: 3px solid #06705b; outline-offset: 3px; }
a { color: var(--green); font-weight: 650; text-underline-offset: .22em; }
p { margin: .35rem 0 1.05rem; max-width: 69ch; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0 0 .65em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); letter-spacing: -.035em; }
h2 { font-size: 1.35rem; letter-spacing: -.018em; }
h3 { font-size: 1.12rem; }
small, .fine { display: block; color: var(--muted); font-size: .875rem; }
section, .split, .summary-strip { margin-bottom: 2.4rem; }
svg, img { max-width: 100%; }
.skip { position: absolute; left: 1rem; top: -8rem; z-index: 3; background: var(--white); padding: .75rem; }
.skip:focus { top: 1rem; }
.masthead { background: var(--dark); color: var(--white); border-bottom: 3px solid var(--ochre); }
.masthead-inner { max-width: 1280px; width: calc(100% - 2rem); min-height: 70px; margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: .55rem; }
.brand { display: flex; gap: .7rem; align-items: center; line-height: 1.18; }
.brand svg { color: var(--ochre); flex: none; }
.brand strong { font-size: 1.14rem; }
.brand small { color: #d0e4da; margin-top: .18rem; }
.masthead nav { display: flex; gap: clamp(.75rem, 3vw, 1.5rem); align-items: center; flex-wrap: wrap; }
.masthead a, .masthead .nav-button { color: #edf8f2; }
.masthead :focus-visible { outline-color: var(--ochre); }
.masthead .nav-button { background: transparent; padding-inline: 0; text-decoration: underline; text-underline-offset: .22em; border: 0; }
.shell { width: calc(100% - 2rem); max-width: 1280px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.4rem) 0 3rem; }
.page-head, .section-head { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: .9rem; margin-bottom: 1rem; }
.page-head p, .section-head p { color: var(--muted); }
.back { display: inline-block; margin-bottom: 1.2rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2rem); align-items: start; }
.split section { margin-bottom: 0; }
.ledger { min-width: 0; }
.side-panel { background: var(--white); padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid var(--line); border-radius: .8rem; }
.side-panel p:last-child { margin-bottom: 0; }
.login-frame { max-width: 1060px; margin: 1rem auto; display: grid; grid-template-columns: 1.08fr 1fr; background: var(--white); border: 1px solid var(--line); border-radius: .9rem; overflow: hidden; }
.entry-art { background: var(--dark); color: #bbd4c9; display: grid; align-content: center; padding: clamp(1rem, 4vw, 2.4rem); }
.entry-art svg { height: auto; }
.entry-art p { margin: 0; font-size: .9rem; }
.entry-form { padding: clamp(1rem, 5vw, 3rem); align-self: center; margin-bottom: 0; }
.entry-form h1 { font-size: clamp(1.85rem, 3.5vw, 2.75rem); }
.stack { display: grid; gap: .9rem; align-content: start; }
.stack > button { justify-self: start; }
label { display: grid; gap: .28rem; font-weight: 650; min-width: 0; }
label small { font-weight: 400; }
input:not([type="checkbox"]), select, textarea {
    display: block; width: 100%; min-width: 0; border-radius: .4rem; border: 1px solid #829b90;
    min-height: 44px; padding: .52rem .65rem; background: var(--white); color: var(--ink); font: inherit;
}
textarea { resize: vertical; }
input[type=file] { font-size: .94rem; }
input::file-selector-button { border: 0; background: #e0eee6; color: var(--ink); padding: .4rem .55rem; border-radius: .25rem; cursor: pointer; margin-right: .55rem; }
fieldset { border: 1px solid var(--line); border-radius: .4rem; padding: .85rem; margin: 0; }
legend { font-weight: 650; }
.check { display: flex; gap: .55rem; align-items: center; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--green); flex: none; }
.check:has(input:disabled) { color: var(--muted); }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.button, button {
    display: inline-flex; justify-content: center; align-items: center; min-height: 44px;
    border: 1px solid var(--green); padding: .52rem .9rem; border-radius: .4rem; font: inherit; font-weight: 680;
    background: var(--green); color: var(--white); text-decoration: none; cursor: pointer; text-align: center;
}
.button:hover, button:hover { background: var(--dark); }
.quiet { background: var(--white); color: var(--green); }
.quiet:hover { background: #e6f0e9; }
.danger { color: var(--error); border-color: var(--error); }
button:disabled { opacity: .65; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.lookup { align-items: end; margin-bottom: .8rem; }
.proof + .proof { margin-top: .65rem; }
.separated { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.notice { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .45rem; max-width: none; }
.notice.error { background: #fbeeea; color: var(--error); }
.notice.success { background: #e3f3e9; color: var(--success); }
.empty { max-width: none; padding: 1.15rem; border: 1px dashed #8fa79c; border-radius: .5rem; color: var(--muted); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: .55rem; background: var(--white); }
table { border-collapse: collapse; width: 100%; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: .75rem .85rem; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
thead { background: #e7eee9; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #f7faf8; }
td details[open] { min-width: 16rem; }
summary { cursor: pointer; color: var(--green); font-weight: 650; }
details[open] > summary { margin-bottom: .7rem; }
.tag { display: inline-block; font-size: .82rem; padding: .21rem .5rem; border-radius: .35rem; background: #f5ebd7; color: #583d12; font-weight: 650; }
.tag.done { background: #dff0e5; color: var(--success); }
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: .55rem; margin-bottom: 2.2rem; }
.stages a { display: grid; gap: .15rem; padding: .8rem 1rem; background: var(--white); text-decoration: none; }
.stages a:hover { background: #e7f1eb; }
.stages strong { font-size: 1.22rem; color: var(--ink); }
.stages span { font-size: .88rem; }
.stages small { font-weight: 400; }
.file-list, .record-list { list-style: none; padding: 0; }
.file-list li { padding: .52rem 0; display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; border-bottom: 1px solid var(--line); }
.setup { margin-top: 1.25rem; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 1.1rem 2rem; background: var(--dark); color: var(--white); padding: .9rem 1.1rem; border-radius: .55rem; }
.summary-strip dd { margin: 0; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.record-list { border-top: 1px solid var(--line); }
.record { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 1rem 1.6rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.record .tag { margin-bottom: .55rem; }
.record h2, .record p { overflow-wrap: anywhere; }
.photo-open { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #e1ede5; border-radius: .45rem; overflow: hidden; }
.photo-open img { width: 100%; height: 100%; object-fit: contain; }
.identifiers { font-variant-numeric: tabular-nums; letter-spacing: .025em; }
.filters, .pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; margin: 1rem 0; }
.filters a { border: 1px solid var(--line); padding: .38rem .6rem; border-radius: .35rem; background: var(--white); }
.filters [aria-current] { background: var(--green); color: var(--white); }
.capture-shell { max-width: 580px; }
.capture-head { margin-bottom: 1rem; }
.capture-head h1 { margin-bottom: .35rem; }
.capture-shell .side-panel { margin-bottom: 1rem; }
.photo-field { background: #edf4ef; border: 1px solid var(--line); border-radius: .55rem; padding: .8rem; }
.preview { height: 115px; width: 100%; object-fit: contain; }
.wide { width: 100%; }
.capture-footer .fine, .form-status { margin: .55rem 0 0; }
@media (max-width: 760px) {
    .split, .record { grid-template-columns: 1fr; }
    .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-frame { grid-template-columns: 1fr; }
    .entry-art { order: 2; padding: 1rem; }
    .entry-art svg { max-height: 185px; margin: 0 auto; }
    .capture-shell { padding-top: 1.15rem; }
    .capture-shell .stack { gap: .7rem; }
}
@media (max-width: 390px) {
    .field-pair { grid-template-columns: 1fr; }
    .masthead nav { width: 100%; }
}
