/* WEA Stewardship — stylesheet. No framework, no data. Written T1.05, made a
   small system in the UI pass (unit 1, 2026-09-14): layout · cards · tables ·
   forms · badges · buttons · flash · filter bar · pager · breadcrumbs · focus ·
   responsive · print. Every class the views used before the pass still exists.
   The bar is docs/UI_STANDARDS.md; the view-side idiom is its section 9. */

/* ------------------------------------------------------------ tokens, base */
:root {
  --ink: #1f2a33; --muted: #5f6b76; --line: #d8dee4; --line-soft: #e9edf1;
  --bg: #f5f7f9; --card: #ffffff; --row-hover: #f3f6f8;
  --brand: #2f5d3a; --brand-ink: #ffffff; --brand-soft: #e6efe8;
  --ok: #1e6b3a; --ok-bg: #eef7f0; --err: #9a2b2b; --err-bg: #fbeeee;
  --info: #2b4f8a; --info-bg: #eef2fb; --warn: #8a5a12; --warn-bg: #fdf4e3;
  --focus: #1a73e8;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: .5rem 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.prewrap { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* focus is visible everywhere, for mouse-free use (standards section 6) */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.topbar :focus-visible { outline-color: #ffffff; }

/* ------------------------------------------------------------ layout */
.skip { position: absolute; left: -999px; top: .5rem; z-index: 100; padding: .5rem .9rem; background: #fff; color: var(--ink); border: 2px solid var(--focus); border-radius: 4px; text-decoration: none; }
.skip:focus { left: .5rem; }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem; background: var(--brand); color: var(--brand-ink); flex-wrap: wrap; }
.topbar a { color: var(--brand-ink); text-decoration: none; }
.brand { font-weight: 600; font-size: 1.05rem; }
.nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.nav a { padding: .2rem .35rem; border-radius: 3px; border-bottom: 2px solid transparent; }
.nav a:hover { text-decoration: underline; }
.nav a.is-current { border-bottom-color: #ffffff; font-weight: 600; }
.nav-group { display: inline-flex; gap: .6rem; align-items: center; padding-left: 1rem; border-left: 1px solid rgba(255,255,255,.35); }
.nav-group-title { opacity: .75; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }

.who { margin-left: auto; position: relative; font-size: .9rem; }
.who summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem; border-radius: 4px; border: 1px solid rgba(255,255,255,.35); }
.who summary::-webkit-details-marker { display: none; }
.who summary::after { content: "\25BE"; opacity: .8; }
.who-roles { opacity: .85; }
.who-menu { position: absolute; right: 0; top: calc(100% + .35rem); min-width: 16rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: .75rem .9rem; z-index: 50; display: grid; gap: .45rem; }
.who-menu a { color: var(--brand); }
.who-menu p { margin: 0; }
.who-email { font-weight: 600; }
.who-tz { color: var(--muted); font-size: .85rem; }
.who-menu .btn { color: var(--ink); border-color: var(--line); }

.page { max-width: 1180px; margin: 1.5rem auto; padding: 0 1rem; }
.page-head { margin: 0 0 1rem; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-title h1 { margin: 0; }
.page-title .actions { margin: 0; }
.page-head + .card { margin-top: .25rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot { max-width: 1180px; margin: 2rem auto; padding: 0 1rem; display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }

/* ------------------------------------------------------------ breadcrumbs */
.crumbs ol { list-style: none; margin: 0 0 .35rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "\203A"; padding: 0 .35rem; color: var(--muted); }
.crumbs li[aria-current] { color: var(--ink); }

/* ------------------------------------------------------------ cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card > h2:first-child, .card > .row-between:first-child h1 { margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; }
.card-grid .card { margin-bottom: 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.25rem; margin: .5rem 0 1rem; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0 2rem; }
.quick-links { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: .5rem 1.5rem; }
.quick-links a { font-weight: 600; }

/* ------------------------------------------------------------ detail pages (UI pass unit 2) */
.lede { margin: -.5rem 0 1rem; color: var(--muted); }
.card h2 .count { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: .35rem; white-space: nowrap; }
.card-grid.cards-3 { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin-bottom: 1.25rem; }
.card-grid .card .dl { margin-bottom: .5rem; }
.table tfoot .totals th, .table tfoot .totals td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 600; background: var(--bg); }
.table tfoot .totals th { text-align: right; color: var(--muted); font-size: .85rem; }
details.collapsed-rows { margin: .25rem 0 .5rem; }
details.collapsed-rows > summary { cursor: pointer; color: var(--ink); font-size: .9rem; padding: .35rem 0; }
details.collapsed-rows > summary:hover { text-decoration: underline; }
.table tr.is-invalid-row td { background: var(--err-bg); }
.table td .field-error { margin-top: .25rem; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; max-width: 100%; position: relative; } /* relative: absolutely positioned .vh labels inside a wide table stay inside the clip (unit 6, 1024 px check) */
.table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.table th, .table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table thead th { border-bottom: 2px solid var(--line); background: var(--card); }
.table tbody tr:hover > td { background: var(--row-hover); }
.table tr.inactive td { color: var(--muted); }
.table tr.superseded td { color: var(--muted); font-style: italic; }
.table th.num, .table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.empty { color: var(--muted); padding: 1rem .5rem; }
.table th a.sort { color: inherit; text-decoration: none; display: inline-block; }
.table th a.sort:hover { text-decoration: underline; }
.table th[aria-sort] { color: var(--ink); }
.table th[aria-sort] a.sort { border-bottom: 2px solid var(--brand); }
.sort-ind { font-size: .7rem; }
.table.sticky thead th { position: sticky; top: 0; z-index: 1; }
.table.wide { font-size: .9rem; }
.table.wide th, .table.wide td { padding: .35rem .35rem; }
.table .actions { margin: 0; gap: .4rem; flex-wrap: wrap; }
.table input[type=text] { width: 100%; min-width: 10rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.table input[type=text].amt { width: 6.5rem; min-width: 5.5rem; }
.table input[type=text].note { width: 9rem; min-width: 7rem; }
.table select { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 4px; font: inherit; background: #fff; }
.table select.sm { min-width: 7rem; max-width: 9rem; }
.table label.key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.table label.check { display: block; font-size: .8rem; margin-top: .25rem; white-space: nowrap; }
.tag { display: inline-block; font-size: .75rem; padding: .05rem .4rem; border: 1px solid var(--line); border-radius: 3px; margin-left: .35rem; color: var(--muted); }

/* ------------------------------------------------------------ forms */
.form label { display: block; margin: .75rem 0 .25rem; font-weight: 600; font-size: .9rem; }
.form label.check { font-weight: 400; display: flex; align-items: center; gap: .5rem; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=date], .form input[type=file], .form select, .form textarea {
  width: 100%; max-width: 480px; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 4px; font: inherit; background: #fff; color: var(--ink);
}
.form textarea { max-width: 640px; min-height: 6rem; }
.form input[type=date] { width: auto; }
.form input:disabled, .form select:disabled, .form textarea:disabled { background: var(--bg); color: var(--muted); }
.form fieldset { border: 1px solid var(--line); border-radius: 4px; padding: .5rem 1rem 1rem; margin: 1rem 0; min-width: 0; }
.form legend { font-weight: 600; font-size: .9rem; padding: 0 .35rem; }
.form .static { padding: .45rem 0; color: var(--muted); }
.form .hint, .hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.form .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 1.5rem; }
.req { color: var(--err); font-weight: 600; }
.field-error { display: block; color: var(--err); font-size: .85rem; margin-top: .2rem; }
.form .is-invalid, .form [aria-invalid="true"] { border-color: var(--err); }
.errors { border: 1px solid var(--err); background: var(--err-bg); color: var(--err); border-radius: 4px; padding: .6rem .9rem; margin: 0 0 1rem; }
.errors p { margin: 0 0 .25rem; }
.errors ul { margin: 0; padding-left: 1.25rem; }
.problems { margin: .25rem 0 .75rem 1.25rem; }
.problems li { color: var(--err); margin: .2rem 0; }
.input-group { display: inline-flex; align-items: stretch; max-width: 480px; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; text-align: right; }
.input-group .adorn { display: inline-flex; align-items: center; padding: 0 .6rem; border: 1px solid var(--line); border-left: 0; border-radius: 0 4px 4px 0; background: var(--bg); color: var(--muted); font-size: .9rem; }
.actions { margin-top: 1rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
[data-scope].is-hidden { display: none; }
[data-forest-af].is-hidden { display: none; }
[data-contractor-block].is-hidden { display: none; } /* T2.02 */
[hidden] { display: none !important; }

/* task / modification forms (UI pass unit 3): live mirrors, the in-form ALN add-new, the district group */
.form .mirror { color: var(--muted); }
.form .mirror [data-mirror-out], .form .mirror [data-split-out] { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.form .mirror-diff:not(:empty) { display: block; color: var(--warn); }
.form .subform { margin-top: 1rem; padding: .6rem .9rem .9rem; border: 1px dashed var(--line); border-radius: 4px; background: var(--bg); }
.form .subform-title, .form .districts-title { margin: 0; font-weight: 600; font-size: .9rem; }
.form .subform .btn { margin-top: .6rem; }
.form .districts { margin-top: 1rem; }
.form .districts [data-forest-af] > p.muted { margin: .5rem 0 .1rem; font-weight: 600; }
/* T1.19: the NICRA preset pick list under its rate input (task and agreement forms) */
.form select.preset-pick { margin-top: .3rem; }
.commit { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.commit .problems { margin: .2rem 0 0; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--brand); border-radius: 4px; background: var(--brand); color: #fff; font: inherit; line-height: 1.3; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn-secondary, .btn-quiet { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover, .btn-quiet:hover { background: var(--brand-soft); filter: none; }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err-bg); filter: none; }
.btn-sm { padding: .25rem .6rem; font-size: .85rem; }
.btn[disabled], .btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; filter: none; }
.topbar .btn-quiet { color: var(--brand-ink); border-color: currentColor; opacity: .85; }
.topbar .btn-quiet:hover { background: transparent; }

/* ------------------------------------------------------------ badges (text + colour, never colour alone) */
.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.badge-active, .badge-committed, .badge-dispositioned { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.badge-closed { color: var(--err); border-color: var(--err); background: var(--err-bg); }
.badge-draft { color: var(--info); border-color: var(--info); background: var(--info-bg); }
.badge-open { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); }
.badge-superseded, .badge-inactive { color: var(--muted); border-color: var(--line); background: var(--bg); text-decoration: line-through; }
.badge-inactive { text-decoration: none; }
/* UI pass unit 4: documents' visibility (finalized = NDA-visible, working copy = WEA only) and the timber "Latest" marker */
.badge-finalized, .badge-latest { color: var(--info); border-color: var(--info); background: var(--info-bg); }
.badge-working { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); }
.form.status-form { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line-soft); }
.form.status-form .actions { margin-top: 0; }
h1 .badge { font-size: .85rem; vertical-align: middle; margin-left: .25rem; }
/* UI pass unit 5: admin forms — a caption for a static (read-only) value, the non-blocking
   duplicate-name notice, a select inside an input group, a short numeric input, the key name beside a setting's label */
.form .label-static { display: block; margin: .75rem 0 .25rem; font-weight: 600; font-size: .9rem; }
.field-notice { display: block; color: var(--warn); font-size: .85rem; margin-top: .2rem; }
.input-group select { border-top-right-radius: 0; border-bottom-right-radius: 0; width: auto; min-width: 12rem; }
.form input[type=text].short { width: 8rem; max-width: 8rem; }
.form label .key-name { font-weight: 400; font-size: .8rem; }
.form .grid2 > fieldset { margin-top: .5rem; }

/* ------------------------------------------------------------ flash */
.flash { display: flex; align-items: flex-start; gap: .75rem; padding: .6rem .9rem; border-radius: 4px; margin: 0 0 1rem; border: 1px solid; }
.flash-text { flex: 1 1 auto; }
.flash-success { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.flash-error { color: var(--err); border-color: var(--err); background: var(--err-bg); }
.flash-info { color: var(--info); border-color: var(--info); background: var(--info-bg); }
.flash-close { flex: 0 0 auto; background: transparent; border: 0; color: inherit; font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.flash-close:hover { opacity: .7; }
p.flash { display: block; }

/* ------------------------------------------------------------ filter bar, active filters, chips */
.form.filter { display: flex; align-items: flex-end; gap: .75rem; margin-bottom: .5rem; flex-wrap: wrap; }
.form.filter label { margin: 0 0 .25rem; }
.form.filter select { width: auto; min-width: 12rem; }
.form.filter input[type=text] { width: auto; min-width: 14rem; }
.form.filter .actions { margin: 0; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .9rem; margin: .25rem 0 .5rem; }
.active-filters .clear { margin-left: .35rem; }
.chip { display: inline-block; font-size: .85rem; padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer; }
.chip:hover { background: var(--bg); }
.chip.is-on { border-color: var(--brand); background: var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .5rem; }

/* UI pass unit 6: the flags screen's kind chips are checkboxes (kind[]) whose <label> is the chip;
   with JavaScript (html.js, app.js block f) the boxes are hidden and the chip toggles them.
   The bulk bar sticks to the bottom of the viewport while the flag table scrolls. */
.form.filter .chips-group { flex-basis: 100%; border: 0; padding: 0; margin: .25rem 0 0; min-width: 0; }
.form.filter .chips-group legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: .25rem; }
.chip-item { display: inline-flex; align-items: center; gap: .3rem; }
html.js .chip-box { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
.chip-box:focus-visible + .chip { outline: 3px solid var(--focus); outline-offset: 2px; }
label.chip { margin: 0; font-weight: 400; }
.chip code { font-size: .85em; }
.chip-count { display: inline-block; min-width: 1.4em; padding: 0 .35em; margin-left: .2em; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .8em; text-align: center; font-variant-numeric: tabular-nums; }
.chip.is-on .chip-count { background: var(--brand); color: #fff; }
html:not(.js) .js-only { display: none; }
.table th.check, .table td.check { width: 1.5rem; padding-right: 0; }
.bulk-bar { position: sticky; bottom: 0; z-index: 5; margin: .5rem -1.5rem -1.25rem; padding: .6rem 1.5rem .9rem; background: var(--card); border-top: 2px solid var(--brand); box-shadow: 0 -6px 16px rgba(0,0,0,.08); }
.bulk-bar-title { margin: 0 0 .25rem; }
.bulk-bar-fields { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.bulk-bar-fields > div.grow { flex: 1 1 18rem; }
.bulk-bar-fields label { margin-top: 0; }
.bulk-bar-fields label.check { margin-bottom: .5rem; }
.bulk-bar-fields .actions { margin: 0 0 .1rem; }
.bulk-bar-fields select { width: auto; min-width: 9rem; }
.bulk-bar-fields input[type=text] { max-width: 100%; }
.table .row-form { display: inline-flex; gap: .3rem; align-items: center; margin-right: .3rem; }

/* ------------------------------------------------------------ pager */
.pager { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .9rem; color: var(--muted); margin: .25rem 0; }
.pager-per { display: inline-flex; gap: .35rem; align-items: center; }
.pager .per { padding: .1rem .45rem; border-radius: 3px; }
.pager .per.is-active { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.pager-nav { display: inline-flex; gap: .75rem; align-items: center; }

/* ------------------------------------------------------------ misc pages */
.error-page code { background: var(--bg); padding: 0 .3rem; border-radius: 3px; }

/* ------------------------------------------------------------ home (UI pass, 2026-09-15): the landing page.
   Section cards — an icon in a soft brand-tinted circle, the title beside it, a one-line description, a row of
   stats (large number over a small label; a stat that is a link shows the number in the brand colour) and a link
   row at the bottom — three across at 1280, two at 1024, one below 720. The panels under the grid sit side by
   side at 1280 and stack at 1024; an odd last panel spans the row. Nothing here is hidden in print. */
.icon { width: 1.5rem; height: 1.5rem; vertical-align: middle; }
.home-lede { margin: -.5rem 0 1.25rem; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.home-grid .card, .home-panels .card { margin-bottom: 0; }
.home-card { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem 1.25rem 1rem; }
.home-card-head { display: flex; align-items: center; gap: .75rem; }
.home-card-head h2 { margin: 0; font-size: 1.1rem; }
.home-card-head h2 a { color: var(--ink); text-decoration: none; }
.home-card-head h2 a:hover { color: var(--brand); text-decoration: underline; }
.home-icon { flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.home-desc { margin: 0; color: var(--muted); font-size: .92rem; }
.home-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: .35rem 0 .25rem; }
.stat { display: inline-flex; flex-direction: column; align-items: flex-start; min-width: 4rem; max-width: 8.5rem; color: var(--ink); text-decoration: none; }
.stat-num { font-size: 1.7rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .8rem; line-height: 1.25; color: var(--muted); }
a.stat .stat-num { color: var(--brand); }
a.stat:hover .stat-label { color: var(--brand); text-decoration: underline; }
.home-links { margin: auto 0 0; padding-top: .6rem; border-top: 1px solid var(--line-soft); font-size: .92rem; }
.home-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.home-panels > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.home-panels .card > h2:first-child { margin-top: 0; }
.home-panels .table { margin-bottom: .5rem; font-size: .92rem; }
.home-panels .table th, .home-panels .table td { padding: .4rem .4rem; }
.home-panels .table td.when { white-space: normal; min-width: 6.5rem; }
.home-panels .home-links { border-top: 0; padding-top: 0; margin: 0; }
.home-overdue { color: var(--warn); font-weight: 600; }
.home-empty-card p { margin: 0; }
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-panels { grid-template-columns: minmax(0, 1fr); }
  .home-panels > .card:last-child:nth-child(odd) { grid-column: auto; }
}
@media (max-width: 720px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ responsive: no page-level horizontal scroll at 1024 px */
@media (max-width: 1024px) {
  .page, .foot { max-width: 100%; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card { padding: 1rem; }
  .form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number], .form select, .form textarea { max-width: 100%; }
  .bulk-bar { margin: .5rem -1rem -1rem; padding: .6rem 1rem .9rem; }
}
@media (max-width: 720px) {
  .topbar { gap: .75rem; }
  .who { margin-left: 0; }
  .who-menu { left: 0; right: auto; }
  .page-title { align-items: flex-start; }
}

/* ------------------------------------------------------------ print: sponsors print agreement pages
   (unit 6, checked with Chrome --print-to-pdf of the agreement, task and modification pages: no chrome,
   no buttons or filters, the editing sub-forms and their headings gone, inline table inputs printed as
   text, wide tables shrunk to the page, collapsed rows opened by app.js on beforeprint or marked). */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .skip, .topbar, .nav, .who, .btn, button, .actions, .form.filter, .active-filters, .pager, .flash, .foot, .flash-close, .crumbs,
  form.form, .bulk-bar, .chips, a.tag, .field-error, .errors, .hint, .problems, .subform, .commit,
  h3:has(+ form.form), h3:has(+ p + form.form), h3 + p:has(+ form.form),
  section.card:has(> h2 + form.form), section.card:has(> h2 + p + form.form) { display: none !important; }
  h2, h3 { break-after: avoid; }
  .tag { white-space: nowrap; display: inline-block; }
  .page { max-width: 100%; margin: 0; padding: 0; }
  .card { border: 0; border-top: 1px solid #bbb; border-radius: 0; padding: 6pt 0 0; margin: 0 0 10pt; break-inside: auto; }
  .card > h2 { margin-top: 0; }
  .card-grid.cards-3 > .card:first-child, .page-head + .card { border-top: 0; }
  .lede { margin-top: 0; }
  .table-wrap { overflow: visible; }
  .table { width: 100%; font-size: 9pt; }
  .table th, .table td { border-bottom: 1px solid #999; padding: 2pt 3pt; white-space: normal; }
  .table th.num, .table td.num { white-space: nowrap; }
  .table.wide { font-size: 7.5pt; }
  .table thead th { background: transparent; }
  .table tbody tr:hover > td { background: transparent; }
  .table input[type=text], .table select { border: 0; background: transparent; padding: 0; min-width: 0; width: auto; appearance: none; font: inherit; color: inherit; }
  .table input[type=checkbox] { display: none; }
  .badge { border: 1px solid #000; color: #000; background: transparent; }
  a { color: #000; text-decoration: none; }
  .sort-ind { display: none; }
  .dl-wrap, .card-grid { display: block; }
  details.collapsed-rows { display: block; }
  details.collapsed-rows > summary { list-style: none; font-weight: 600; }
  details.collapsed-rows > summary::-webkit-details-marker { display: none; }
  details.collapsed-rows:not([open]) > summary::after { content: " — collapsed on screen and not printed; open the section before printing to include the rows"; font-weight: 400; color: #555; }
  tr, .dl { break-inside: avoid; }
}

/* T2.02: entries — the computed panel on the entry form and detail page, the
   drawdown figures on the task page; a negative figure reads as a warning. */
.dl dd.warn, .table td.warn { color: var(--err); font-weight: 600; }
.task-figures { margin-bottom: 1rem; }
.form.filter label.check { margin-top: 1.6rem; }

/* T2.05: the outbox row page shows the notice text exactly as sent. */
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; margin: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg, #fff); }

/* ------------------------------------------------------------ T2.08: M2 lists fit 1280 px without a scroll bar
   Compound sortable headers ("Task · forest", "Units × rate") carry two sort links in one th; only the active
   link gets the underline. Long notes and contractor names truncate inside a fixed-width inline-block with the
   full text in the title attribute. Row actions sit on one line and wrap only when the column runs out. */
.table th[aria-sort] a.sort:not(.is-active) { border-bottom: 0; }
.table .trunc { display: inline-block; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.table .tag { white-space: nowrap; }
.table td.performed { min-width: 6rem; }
.table td.performed .trunc { max-width: 7rem; }
.table.queue th, .table.queue td { padding-left: .3rem; padding-right: .3rem; }
.table.queue .trunc { max-width: 8rem; }
.table .row-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.table .row-actions .row-form { margin-right: 0; }
.table .row-actions .row-links { white-space: nowrap; font-size: .85rem; }
.table.history th.comment, .table.history td.comment { width: 50%; min-width: 16rem; }
@media (max-width: 1100px) {
  .table .trunc { max-width: 7rem; }
  .card-grid.cards-3 { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); } /* entry page: two cards per row at 1024, the Drawdown figures stop wrapping */
}

/* T2.08: the notification options as a stacked list — label line, description line */
.form .choices { margin: .5rem 0 .75rem; }
.form .choice { margin: .55rem 0; }
.form .choice label.check { margin: 0; white-space: nowrap; }
.form .choice .choice-desc { display: block; margin: .1rem 0 0 1.6rem; color: var(--muted); font-size: .85rem; }
