/* EcoShade design system.
   One stylesheet, five parts: tokens, base, components, console shell, sign-in.
   Light theme only. No utility framework; classes name things, not styles. */

/* ───────────────────────────── 1. Tokens ───────────────────────────── */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../vendor/fonts/fraunces-latin-opsz-normal.069cb90e11a3.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../vendor/fonts/fraunces-latin-ext-opsz-normal.a04d353989ad.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../vendor/fonts/inter-latin-opsz-normal.4b73e2ff3024.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../vendor/fonts/inter-latin-ext-opsz-normal.084b211fc382.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("../vendor/fonts/jetbrains-mono-latin-wght-normal.b058178d7f30.woff2") format("woff2-variations"); }

:root {
  /* Paper and ink */
  --paper: #f5f3ec;
  --paper-2: #efece3;
  --surface: #fffefa;
  --ink: #141915;
  --ink-2: #454c47;
  --ink-3: #737a74;
  --rule: #dfdcd1;
  --rule-strong: #c4c0b2;

  /* Brand */
  --green: #296b2b;
  --green-ink: #1f5b29;
  --green-deep: #133c1a;
  --green-night: #0d2a13;
  --green-wash: #e7eee1;
  --green-on-deep: #a9d3a0;

  /* Status: fixed everywhere (map, tables, packs). Always paired with the word. */
  --clear: #1f7a3a;      --clear-wash: #e2f0e4;   --clear-ink: #145428;
  --review: #b7791f;     --review-wash: #f7ecd6;  --review-ink: #7a4f0d;
  --blocked: #b3261e;    --blocked-wash: #f8e3e0; --blocked-ink: #8a1b15;
  --pending: #6b6f6c;    --pending-wash: #eaeae5; --pending-ink: #4a4e4b;
  --returned: #44608a;   --returned-wash: #e3e9f2; --returned-ink: #2f466a;

  --focus: #1d5fd1;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --step--1: 0.75rem;   /* 12 */
  --step-0: 0.8125rem;  /* 13: interface text */
  --step-1: 0.875rem;   /* 14: reading text */
  --step-2: 1.0625rem;  /* 17 */
  --step-3: 1.375rem;   /* 22 */
  --step-4: 1.875rem;   /* 30 */
  --step-5: 2.75rem;    /* 44 */

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --radius: 5px;
  --radius-lg: 9px;
  --rail: 232px;
  --shadow-pop: 0 1px 0 rgba(20, 25, 21, .04), 0 10px 30px -12px rgba(20, 25, 21, .28);
}

/* ───────────────────────────── 2. Base ───────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--font-ui);
  font-feature-settings: "cv05", "cv08", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 560;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.012em;
  line-height: 1.12;
  color: var(--green-deep);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font: 650 var(--step-1)/1.3 var(--font-ui); letter-spacing: -0.003em; }
a { color: var(--green-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-deep); }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.94em; font-feature-settings: "zero"; }
kbd {
  display: inline-block; min-width: 1.5em; padding: 0 5px; text-align: center;
  border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 4px;
  background: var(--surface); font-size: var(--step--1); line-height: 1.5; color: var(--ink-2);
}
img, svg { display: block; max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s5) 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: #cfe3c8; }

.skip { position: absolute; left: var(--s3); top: -60px; z-index: 50; background: var(--ink); color: #fff;
  padding: var(--s2) var(--s4); border-radius: var(--radius); }
.skip:focus { top: var(--s3); color: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--ink-3); }
.eyebrow {
  font: 600 0.6875rem/1.2 var(--font-ui); letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3);
}

/* ───────────────────────────── 3. Components ───────────────────────────── */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 34px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink);
  font: 550 var(--step-0)/1 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); background: #fff; }
.btn:active { transform: translateY(0.5px); }
.btn--primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.btn--danger { background: var(--surface); border-color: #dcb3af; color: var(--blocked-ink); }
.btn--danger:hover { background: var(--blocked-wash); border-color: var(--blocked); color: var(--blocked-ink); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--paper-2); border-color: transparent; }
.btn--lg { height: 42px; padding: 0 18px; font-size: var(--step-1); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* Status pill: a word, a dot, a colour. Never colour alone. */
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 7px;
  border-radius: 11px; font: 600 var(--step--1)/1 var(--font-ui); letter-spacing: 0.005em; white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status--clear { background: var(--clear-wash); color: var(--clear-ink); }
.status--clear::before { background: var(--clear); }
.status--review { background: var(--review-wash); color: var(--review-ink); }
.status--review::before { background: var(--review); border-radius: 1px; transform: rotate(45deg); }
.status--blocked { background: var(--blocked-wash); color: var(--blocked-ink); }
.status--blocked::before { background: var(--blocked); border-radius: 1px; }
.status--pending { background: var(--pending-wash); color: var(--pending-ink); }
.status--pending::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pending); }
.status--returned { background: var(--returned-wash); color: var(--returned-ink); }
.status--returned::before { background: var(--returned); width: 8px; height: 3px; border-radius: 1px; }

/* Quiet tag for facts that are not a status */
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2);
  font: 500 var(--step--1)/1 var(--font-ui); white-space: nowrap;
}
.tag--sample { border-style: dashed; border-color: var(--review); color: var(--review-ink); background: transparent; }

/* Identifier */
.mono-id {
  font: 500 0.78rem/1.2 var(--font-mono); letter-spacing: -0.01em; color: var(--ink);
  font-feature-settings: "zero"; white-space: nowrap;
}
a.mono-id { color: var(--green-ink); text-decoration: none; border-bottom: 1px solid transparent; }
a.mono-id:hover { border-bottom-color: currentColor; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); flex-wrap: wrap;
  padding-bottom: var(--s4); border-bottom: 1px solid var(--rule-strong); margin-bottom: var(--s5); }
.page-head__text { min-width: 0; }
.page-head .eyebrow { margin-bottom: var(--s2); }
.page-head__lede { margin-top: var(--s2); color: var(--ink-2); font-size: var(--step-1); max-width: 68ch; }
.page-head__actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* Figures strip: a ruled row of numbers, like the top of a ledger */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); margin-bottom: var(--s6); }
.figure { padding: var(--s4) var(--s4) var(--s4) 0; border-right: 1px solid var(--rule); }
.figure + .figure { padding-left: var(--s4); }
.figure:last-child { border-right: 0; }
.figure__value { font-family: var(--font-display); font-variation-settings: "opsz" 72; font-weight: 520;
  font-size: var(--step-4); line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.02em; }
.figure__label { margin-top: var(--s2); color: var(--ink-2); font-size: var(--step--1); }
.figure__note { margin-top: 2px; color: var(--ink-3); font-size: var(--step--1); }
.figure--attention .figure__value { color: var(--review-ink); }
.figure--alarm .figure__value { color: var(--blocked-ink); }
a.figure { text-decoration: none; color: inherit; }
a.figure:hover .figure__label { color: var(--green-ink); text-decoration: underline; }

/* Section */
.section { margin-bottom: var(--s7); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s3); }
.section__head h2 { font-size: var(--step-2); font-family: var(--font-ui); font-weight: 650; letter-spacing: -0.005em; color: var(--ink); font-variation-settings: normal; }
.section__more { font-size: var(--step--1); }

/* Data table */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--rule-strong); }
.table { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.table th {
  text-align: left; white-space: nowrap; padding: 9px var(--s3) 8px 0; color: var(--ink-3);
  font: 600 0.6875rem/1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}
.table td { padding: 10px var(--s3) 10px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table th.r, .table td.r { text-align: right; padding-right: var(--s4); font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background-color .08s; }
.table tbody tr:hover { background: rgba(255, 254, 250, .8); }
.table tbody tr[aria-selected="true"] { background: var(--green-wash); box-shadow: inset 3px 0 0 var(--green); }
.table tbody tr[aria-selected="true"] td:first-child { padding-left: var(--s3); }
.table td.primary { font-weight: 550; }
.table td .sub { display: block; color: var(--ink-3); font-size: var(--step--1); font-weight: 400; }
.table a.row-link { color: inherit; text-decoration: none; }
.table a.row-link:hover { color: var(--green-ink); text-decoration: underline; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  padding: var(--s3) 0; color: var(--ink-3); font-size: var(--step--1); }
.pager { display: flex; gap: var(--s1); }

/* Filter bar */
.filters { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.filters__search { flex: 1 1 220px; max-width: 340px; }
.segmented { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; color: var(--ink-2);
  text-decoration: none; font-weight: 500; border-right: 1px solid var(--rule); white-space: nowrap; }
.segmented a:last-child { border-right: 0; }
.segmented a:hover { background: var(--paper); color: var(--ink); }
.segmented a[aria-current="true"] { background: var(--ink); color: #fff; }
.segmented .count { font-variant-numeric: tabular-nums; opacity: .65; font-size: var(--step--1); }

/* Form fields */
.field { display: grid; gap: 6px; margin-bottom: var(--s4); }
.field > label, .field__label { font-weight: 600; font-size: var(--step-0); color: var(--ink); }
.field__hint { color: var(--ink-3); font-size: var(--step--1); }
.field__error { color: var(--blocked-ink); font-size: var(--step--1); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: 400 var(--step-1)/1.4 var(--font-ui);
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #9a9f9a; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(41, 107, 43, .18); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--blocked); }
.input--code { font-family: var(--font-mono); letter-spacing: 0.32em; font-size: 1.25rem; height: 48px; text-align: center; font-feature-settings: "zero"; }
.select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23454c47' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }

/* Notices */
.notice { display: grid; grid-template-columns: 3px 1fr; gap: var(--s3); padding: var(--s3) var(--s4) var(--s3) 0;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: var(--s4); overflow: hidden; }
.notice::before { content: ""; background: var(--ink-3); }
.notice--error::before { background: var(--blocked); }
.notice--warn::before { background: var(--review); }
.notice--ok::before { background: var(--clear); }
.notice strong { display: block; }

/* Empty state */
.empty { padding: var(--s7) var(--s5); text-align: center; border: 1px dashed var(--rule-strong); border-radius: var(--radius-lg); }
.empty h3 { font-family: var(--font-display); font-weight: 540; font-size: var(--step-2); color: var(--green-deep); }
.empty p { margin: var(--s2) auto 0; max-width: 46ch; color: var(--ink-2); }
.empty .btn { margin-top: var(--s4); }

/* Timeline */
.timeline { position: relative; display: grid; gap: var(--s4); padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--rule-strong); }
.timeline__item { position: relative; }
.timeline__item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink-3); }
.timeline__item--clear::before { border-color: var(--clear); background: var(--clear); }
.timeline__item--review::before { border-color: var(--review); }
.timeline__item--blocked::before { border-color: var(--blocked); background: var(--blocked); }
.timeline__when { color: var(--ink-3); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.timeline__what { font-weight: 550; }
.timeline__detail { color: var(--ink-2); margin-top: 2px; }

/* Definition rows: label left, value right, ruled */
.facts { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; border-top: 1px solid var(--rule); }
.facts dt, .facts dd { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-3); padding-right: var(--s4); }
.facts dd { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

/* Panel: used sparingly, for a thing that floats above the page or a form block */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: var(--s5); }
.panel--flush { padding: 0; overflow: hidden; }

/* Drawer */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(480px, 100vw); background: var(--surface); z-index: 40;
  border-left: 1px solid var(--rule-strong); box-shadow: var(--shadow-pop); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .18s ease-out; }
.drawer[open], .drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--rule); }
.drawer__body { padding: var(--s5); overflow-y: auto; flex: 1; }
.drawer__foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--rule); display: flex; gap: var(--s2); justify-content: flex-end; }

/* Two-column page: content and a side note column */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s7); align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; gap: var(--s6); } }

/* ───────────────────────────── 4. Console shell ───────────────────────────── */

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--green-deep); color: #dfe9da; padding: var(--s5) 0 var(--s4);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s5); color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__word { font: 700 1.0625rem/1 var(--font-ui); letter-spacing: -0.015em; }
.brand__sub { display: block; margin: 6px var(--s5) 0 calc(var(--s5) + 36px); color: var(--green-on-deep); font-size: 0.6875rem; letter-spacing: 0.09em; text-transform: uppercase; }

.nav { margin-top: var(--s6); flex: 1; }
.nav__group + .nav__group { margin-top: var(--s5); }
.nav__label { padding: 0 var(--s5); margin-bottom: 6px; color: #7fa67a; font: 600 0.65rem/1.2 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; }
.nav__link { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  height: 32px; padding: 0 var(--s5); color: #cfdcc9; text-decoration: none; font-weight: 500; }
.nav__link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav__link[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .1); font-weight: 600; }
.nav__link[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 2px 2px 0; background: #8fd183; }
.nav__link:focus-visible { outline-color: #fff; outline-offset: -2px; }
.nav__count { min-width: 20px; padding: 0 6px; height: 18px; border-radius: 9px; background: rgba(255, 255, 255, .14);
  color: #fff; font: 600 0.6875rem/18px var(--font-ui); text-align: center; font-variant-numeric: tabular-nums; }
.nav__count--attention { background: #e7b550; color: #2b1d02; }

.rail__foot { margin-top: var(--s5); padding: var(--s4) var(--s5) 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.who__name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who__role { color: var(--green-on-deep); font-size: var(--step--1); }
.rail__foot form { margin-top: var(--s3); }
.linkish { background: none; border: 0; padding: 0; color: #cfdcc9; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.linkish:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: var(--s6) clamp(var(--s5), 4vw, 56px) var(--s8); max-width: 1440px; width: 100%; }
.content--wide { max-width: none; }
.content--flush { padding: 0; max-width: none; }

.banner { display: flex; align-items: center; gap: var(--s3); padding: 7px clamp(var(--s5), 4vw, 56px);
  background: #fbf3df; border-bottom: 1px solid #e9d8ac; color: var(--review-ink); font-size: var(--step--1); }
.banner strong { font-weight: 650; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; padding: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .brand { padding: var(--s3) var(--s4); }
  .brand__sub, .nav__label, .rail__foot .who { display: none; }
  .nav { display: flex; margin: 0; flex: 1; }
  .nav__group { display: flex; }
  .nav__group + .nav__group { margin: 0; border-left: 1px solid rgba(255,255,255,.12); }
  .nav__link { height: 48px; padding: 0 var(--s3); white-space: nowrap; }
  .nav__link[aria-current="page"]::before { top: auto; left: 8px; right: 8px; bottom: 0; width: auto; height: 3px; border-radius: 2px 2px 0 0; }
  .rail__foot { margin: 0; border: 0; padding: 0 var(--s4); white-space: nowrap; }
  .rail__foot form { margin: 0; }
  .content { padding-top: var(--s5); }
  h1 { font-size: var(--step-3); }
}

/* ───────────────────────────── 5. Sign-in ───────────────────────────── */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
.auth__art { position: relative; overflow: hidden; background: var(--green-deep); color: #fff;
  padding: clamp(var(--s6), 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; }
.auth__art svg.contours { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth__art > * { position: relative; }
.auth__statement { font-family: var(--font-display); font-variation-settings: "opsz" 144; font-weight: 480;
  font-size: clamp(2.25rem, 4.4vw, 3.75rem); line-height: 1.02; letter-spacing: -0.025em; color: #fff; max-width: 11ch; }
.auth__statement em { font-style: normal; color: #9ad48e; }
.auth__caption { margin-top: var(--s5); color: #c5d8be; max-width: 40ch; font-size: var(--step-1); line-height: 1.55; }
.auth__meta { display: flex; gap: var(--s6); color: var(--green-on-deep); font-size: var(--step--1); letter-spacing: 0.04em; }
.auth__meta b { display: block; color: #fff; font: 520 var(--step-3)/1.1 var(--font-display); letter-spacing: -0.01em; margin-bottom: 4px; }

.auth__form { display: flex; align-items: center; justify-content: center; padding: var(--s6); background: var(--paper); }
.auth__card { width: min(380px, 100%); }
.auth__card h1 { font-size: var(--step-4); margin-bottom: var(--s2); }
.auth__card > p { color: var(--ink-2); font-size: var(--step-1); margin-bottom: var(--s5); }
.auth__card .btn { width: 100%; margin-top: var(--s2); }
.auth__foot { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--rule); color: var(--ink-3); font-size: var(--step--1); }
.qr { width: 188px; padding: 10px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-lg); margin-bottom: var(--s4); }
.qr svg { width: 100%; height: auto; }
.secret { display: block; padding: var(--s3); background: var(--paper-2); border-radius: var(--radius); font-family: var(--font-mono); font-size: var(--step-0); letter-spacing: 0.04em; margin: var(--s2) 0 var(--s5); word-spacing: 0.2em; }
.steps { counter-reset: step; display: grid; gap: var(--s2); margin-bottom: var(--s5); color: var(--ink-2); font-size: var(--step-1); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 22px 1fr; gap: var(--s2); }
.steps li::before { content: counter(step); font: 600 var(--step--1)/22px var(--font-ui); width: 22px; height: 22px; text-align: center; border-radius: 50%; background: var(--green-wash); color: var(--green-ink); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { min-height: 0; padding: var(--s5); gap: var(--s5); }
  .auth__statement { font-size: 2rem; max-width: none; }
  .auth__caption, .auth__meta { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Component kit page */
.kit-row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.kit-swatch { width: 96px; }
.kit-swatch i { display: block; height: 44px; border-radius: var(--radius); border: 1px solid rgba(0,0,0,.08); }
.kit-swatch span { display: block; margin-top: 4px; font-size: var(--step--1); color: var(--ink-2); }
.sw-paper { background: var(--paper); } .sw-surface { background: var(--surface); } .sw-ink { background: var(--ink); }
.sw-green { background: var(--green); } .sw-deep { background: var(--green-deep); } .sw-wash { background: var(--green-wash); }
.sw-clear { background: var(--clear); } .sw-review { background: var(--review); } .sw-blocked { background: var(--blocked); }
.sw-pending { background: var(--pending); } .sw-returned { background: var(--returned); }

/* ───────────────────────────── 6. Records, maps, checks ───────────────────────────── */

.crumbs { display: flex; gap: var(--s2); align-items: center; margin-bottom: var(--s3); font-size: var(--step--1); color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--green-ink); text-decoration: underline; }
.h1-id { font-family: var(--font-mono); font-weight: 600; font-size: 1.625rem; letter-spacing: -0.02em; color: var(--ink); font-variation-settings: normal; font-feature-settings: "zero"; }
.page-head__meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.section--tight { margin: var(--s6) 0 0; }
.section__head--spaced { margin-top: var(--s6); }
.footnote { font-size: var(--step--1); margin-top: var(--s2); }
.stack > * + * { margin-top: var(--s3); }
.plainlist { display: grid; gap: 6px; }
.breakall { word-break: break-all; }
.table td.wrap { white-space: normal; max-width: 44ch; color: var(--ink-2); }
.table td.wrap strong { color: var(--ink); font-weight: 600; }
.table tbody tr.is-hover { background: var(--green-wash); }

.tag--ok { border-color: #bcd9c2; background: var(--clear-wash); color: var(--clear-ink); }
.tag--warn { border-color: #e6d09d; background: var(--review-wash); color: var(--review-ink); }
.tag--bad { border-color: #e6bdb8; background: var(--blocked-wash); color: var(--blocked-ink); }

.code { margin: 0; padding: var(--s4); background: #10231a; color: #d9eadb; border-radius: var(--radius-lg); overflow: auto; max-height: 560px;
  font: 400 0.75rem/1.6 var(--font-mono); tab-size: 2; }
.facts--masked dd[aria-label="Hidden"] { font-family: var(--font-mono); color: var(--ink-3); letter-spacing: 0.08em; }
.reveal { margin-top: var(--s4); padding: var(--s4); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); }
.reveal .field { margin-bottom: var(--s3); }

/* Map */
.map { position: relative; width: 100%; height: 100%; min-height: 320px; background: #ece8dc; border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); overflow: hidden; }
.map--record { height: 420px; }
.mapsplit { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: var(--s5); align-items: start; }
.mapsplit__map { position: sticky; top: var(--s4); height: calc(100vh - 2 * var(--s4)); min-height: 420px; display: flex; flex-direction: column; }
.mapsplit__map .map { flex: 1; }
@media (max-width: 1100px) {
  .mapsplit { grid-template-columns: 1fr; }
  .mapsplit__map { position: static; height: 360px; order: -1; }
}
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); padding-top: var(--s2); font-size: var(--step--1); color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg--clear { background: var(--clear); } .lg--review { background: var(--review); } .lg--blocked { background: var(--blocked); }
.lg--pending { background: var(--pending); } .lg--returned { background: var(--returned); } .lg--pa { background: transparent; border: 2px dashed #5a6b3c; border-radius: 2px; }
.maplibregl-ctrl-group { border-radius: var(--radius) !important; box-shadow: 0 0 0 1px var(--rule-strong) !important; }
.maplibregl-ctrl-scale { background: rgba(255, 254, 250, .8) !important; border-color: var(--ink-2) !important; color: var(--ink-2) !important; font: 500 10px/1.3 var(--font-ui) !important; }
.maplibregl-ctrl-attrib { font: 400 10px/1.4 var(--font-ui) !important; }

/* Check list */
.checks { border-top: 1px solid var(--rule); }
.check { display: grid; grid-template-columns: 14px 1fr auto; gap: var(--s3); align-items: start; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.check__mark { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--ink-3); }
.check--review .check__mark { background: var(--review); border-radius: 1px; transform: rotate(45deg); }
.check--block .check__mark, .check--fail .check__mark { background: var(--blocked); border-radius: 1px; }
.check--ok .check__mark { background: var(--clear); }
.check__what { font-weight: 550; }
.check__detail { color: var(--ink-2); margin-top: 1px; }
.check__sev { color: var(--ink-3); font-size: var(--step--1); white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ───────────────────────────── 7. Review workbench ───────────────────────────── */

.keys { color: var(--ink-3); font-size: var(--step--1); }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:focus-visible { outline-offset: -2px; }
.crumbs__nav { margin-left: auto; display: flex; gap: var(--s4); }
.h1-id a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.h1-id a:hover { border-bottom-color: var(--ink); }
.reasonline { margin-bottom: var(--s3); }
.caselist { margin-top: var(--s3); }

.bench { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr); gap: var(--s5); align-items: start; }
.bench__map { position: sticky; top: var(--s4); height: calc(100vh - 2 * var(--s4)); min-height: 480px; display: flex; flex-direction: column; }
.bench__map .map { flex: 1; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 1100px) { .bench { grid-template-columns: 1fr; } .bench__map { position: static; height: 460px; } }

.imgbar { scrollbar-width: none; display: flex; align-items: stretch; background: var(--green-night); border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow-x: auto; }
.imgbar__label { display: flex; align-items: center; padding: 0 var(--s4); color: #8fb489; font: 600 0.6875rem/1 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.imgbar__btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-left: 1px solid rgba(255,255,255,.1);
  background: transparent; color: #cfdcc9; font: 600 var(--step-0)/1 var(--font-ui); font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.imgbar__btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.imgbar__btn[aria-pressed="true"] { background: #f5f3ec; color: var(--ink); }
.imgbar__btn kbd { background: transparent; border-color: rgba(255,255,255,.25); color: inherit; opacity: .7; min-width: 1.4em; }
.imgbar__btn[aria-pressed="true"] kbd { border-color: var(--rule-strong); }
.imgbar__btn--cutoff::after { content: "cut-off"; font: 600 0.625rem/1 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #e7b550; }
.imgbar__btn--cutoff[aria-pressed="true"]::after { color: var(--review-ink); }
.imgbar__btn--plain { margin-left: auto; font-weight: 500; }
.imgbar__btn:focus-visible { outline-color: #fff; outline-offset: -3px; }
.lg--focus { background: transparent; border: 2px solid #d8b800; border-radius: 2px; }
.legend__note { color: var(--ink-3); flex-basis: 100%; }

.benchsec { padding: var(--s4) 0; border-top: 1px solid var(--rule-strong); }
.benchsec:first-of-type { border-top: 0; padding-top: 0; }
.benchsec h2 { font: 650 var(--step-1)/1.3 var(--font-ui); color: var(--ink); letter-spacing: -0.003em; font-variation-settings: normal; margin-bottom: var(--s2); }
.benchsec__meta { font-size: var(--step--1); margin-bottom: var(--s2); }
.evidence { width: 100%; border-collapse: collapse; }
.evidence th { text-align: left; font-weight: 450; padding: 6px var(--s3) 6px 0; border-bottom: 1px solid var(--rule); }
.evidence td { text-align: right; padding: 6px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; font-weight: 550; }
.evidence .sub { display: block; color: var(--ink-3); font-size: 0.6875rem; }
.evidence tr.is-attention th, .evidence tr.is-attention td { color: var(--blocked-ink); }
.evidence tr.is-attention th { box-shadow: inset 3px 0 0 var(--blocked); padding-left: var(--s3); }
.evidence tr.is-missing td { color: var(--review-ink); }
.evidence__sum th { font-weight: 650; }
.facts--tight dt, .facts--tight dd { padding: 6px 0; }
.checks--tight { margin-top: var(--s3); }
.checks--tight .check { grid-template-columns: 14px 1fr; padding: 7px 0; }

.benchsec--decide { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); padding: var(--s4); margin-top: var(--s2); }
.choices { display: grid; gap: 6px; margin-bottom: var(--s4); }
.choice { display: grid; grid-template-columns: 18px 1fr auto; gap: var(--s3); align-items: start; padding: 9px 11px; border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer; }
.choice:hover { border-color: var(--ink-3); }
.choice input { margin: 2px 0 0; accent-color: var(--green); }
.choice b { display: block; font-weight: 650; }
.choice span { color: var(--ink-2); }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-wash); box-shadow: inset 0 0 0 1px var(--green); }
.choice--danger:has(input:checked) { border-color: var(--blocked); background: var(--blocked-wash); box-shadow: inset 0 0 0 1px var(--blocked); }
.choice--danger input { accent-color: var(--blocked); }
.decide__actions { display: flex; gap: var(--s2); }

/* ───────────────────────────── 8. Custody ───────────────────────────── */

.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 0 var(--s5); }
.formgrid__full { grid-column: 1 / -1; }
@media (max-width: 760px) { .formgrid { grid-template-columns: 1fr; } }
.check-line { display: flex; gap: var(--s2); align-items: flex-start; font-weight: 500; margin-bottom: 6px; }
.check-line input { margin-top: 3px; accent-color: var(--green); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.input--kg { width: 96px; height: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.bullets { list-style: disc; padding-left: 18px; margin-top: 4px; display: grid; gap: 2px; }
.btn[aria-disabled="true"] { pointer-events: auto; }
.drawer h3 { font-family: var(--font-display); font-weight: 540; font-size: var(--step-2); color: var(--green-deep); }

.candidates { border-top: 1px solid var(--rule); }
.candidate { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--rule); }
.candidate .sub { display: block; color: var(--ink-3); font-size: var(--step--1); }
.candidate__why { display: block; color: var(--review-ink); font-size: var(--step--1); margin-top: 2px; }
.candidate--no .mono-id { color: var(--ink-3); }

.genealogy { overflow-x: auto; padding: var(--s3) 0 var(--s2); border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.genealogy svg { max-width: none; }
.g-head { font: 600 10px/1 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; fill: var(--ink-3); }
.g-link { fill: none; stroke: #9bb89a; stroke-width: 1.4; }
.g-link--bad { stroke: var(--blocked); stroke-dasharray: 4 3; }
.g-node rect { fill: var(--surface); stroke: var(--rule-strong); stroke-width: 1; }
.g-node--lot rect { fill: var(--green-deep); stroke: var(--green-deep); }
.g-node--lot .g-label, .g-node--lot .g-sub { fill: #fff; }
.g-node--bad rect { stroke: var(--blocked); fill: var(--blocked-wash); }
.g-node--lot.g-node--bad rect { fill: var(--blocked); stroke: var(--blocked); }
.g-label { font: 600 11px/1 var(--font-mono); fill: var(--ink); }
.g-sub { font: 400 10px/1 var(--font-ui); fill: var(--ink-3); }
.g-node a:hover rect { stroke: var(--green); stroke-width: 1.6; }

/* ───────────────────────────── 9. Partner portal ───────────────────────────── */

.pbar { display: flex; align-items: center; gap: var(--s5); padding: 0 clamp(var(--s4), 4vw, 56px); height: 60px; background: var(--green-deep); color: #dfe9da; }
.pbar .brand { padding: 0; }
.pbar__org { padding-left: var(--s5); border-left: 1px solid rgba(255,255,255,.2); color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar__nav { display: flex; align-self: stretch; margin-left: var(--s4); }
.pbar__nav a { display: flex; align-items: center; padding: 0 var(--s4); color: #cfdcc9; text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.pbar__nav a:hover { color: #fff; }
.pbar__nav a[aria-current="page"] { color: #fff; border-bottom-color: #8fd183; font-weight: 600; }
.pbar__who { margin-left: auto; display: flex; align-items: center; gap: var(--s4); white-space: nowrap; }
.pcontent { margin: 0 auto; max-width: 1280px; }
.pfoot { max-width: 1280px; margin: 0 auto; padding: var(--s4) clamp(var(--s5), 4vw, 56px) var(--s6); color: var(--ink-3); font-size: var(--step--1); border-top: 1px solid var(--rule); }
.map--side { height: 380px; }
.heldlist { border-top: 1px solid var(--rule); }
.heldlist li { display: flex; justify-content: space-between; gap: var(--s4); padding: 9px 0; border-bottom: 1px solid var(--rule); }
.heldlist b { font-weight: 650; }
@media (max-width: 760px) {
  .pbar { height: auto; flex-wrap: wrap; gap: var(--s2) var(--s4); padding-top: var(--s3); }
  .pbar__org { border: 0; padding: 0; }
  .pbar__nav { order: 3; flex-basis: 100%; margin: 0; }
  .pbar__nav a { height: 40px; padding: 0 var(--s4) 0 0; }
  .pbar__who span { display: none; }
}

/* ───────────────────────────── 10. Overview, people, system ───────────────────────────── */

.todo { border-top: 1px solid var(--rule-strong); }
.todo__row { display: grid; grid-template-columns: 64px 1fr 20px; align-items: center; gap: var(--s3); padding: 11px 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.todo__row:hover { background: rgba(255, 254, 250, .8); color: var(--ink); }
.todo__row b { font: 520 var(--step-3)/1 var(--font-display); letter-spacing: -0.02em; }
.todo__row small { display: block; color: var(--ink-3); font-size: var(--step--1); }
.todo__row i { font-style: normal; color: var(--ink-3); }
.todo__row:hover i { color: var(--green-ink); }
.todo__row--attention b { color: var(--review-ink); }
.todo__row--alarm b { color: var(--blocked-ink); }
.prose { max-width: 68ch; font-size: var(--step-1); line-height: 1.6; }
.input--note { width: 220px; height: 32px; }
.inline-form--wide { display: flex; }
.inline-form--wide .input { flex: 1; min-width: 180px; height: 32px; font-size: var(--step--1); }
.table td.wrap--wide { max-width: 70ch; }
.table--log td { padding-top: 7px; padding-bottom: 7px; font-size: var(--step--1); }
.formgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--s5); }
@media (max-width: 900px) { .formgrid--4 { grid-template-columns: 1fr 1fr; } }

/* Grid children may shrink below their content, so wide maps and tables never push the page sideways. */
.bench > *, .mapsplit > *, .split > * { min-width: 0; }

/* Error pages */
.errorpage { display: grid; place-items: center; min-height: 100vh; padding: var(--s5); }
.errorpage__box { max-width: 460px; }
.errorpage__box .eyebrow { margin-top: var(--s7); }
.errorpage__box h1 { margin: var(--s2) 0 var(--s3); }
.errorpage__box p { color: var(--ink-2); font-size: var(--step-1); margin-bottom: var(--s5); }
.brand--ink, .brand--ink:hover { color: var(--green-deep); padding: 0; }

/* HTMX request indicators (HTMX is told not to inject its own <style>, which the CSP would block). */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.map__loading { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgba(20, 25, 21, 0.82); color: #fff; font-size: 12px; letter-spacing: 0.01em; pointer-events: none; }
.map__loading[hidden] { display: none; }
