/* Tofamba Ivhu: land development control.
   Forest green, warm ivory, charcoal, muted gold, soft sage. Brick red is reserved for restrictions. */

@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("fonts/ibm-plex-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("fonts/ibm-plex-serif-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --forest: #1f3b2d;
  --forest-2: #2c5240;
  --forest-ink: #173022;
  --ivory: #f5f1e6;
  --paper: #fbf9f3;
  --charcoal: #2a2d2b;
  --muted: #62675f;
  --faint: #8a8e85;
  --sage: #d6e0cf;
  --sage-2: #e8eee3;
  --sage-ink: #4f6a52;
  --gold: #a8843a;
  --gold-soft: #f2e8cc;
  --gold-ink: #7a5f22;
  --brick: #8e3b2e;
  --brick-soft: #f4e2dc;
  --rule: #ddd6c4;
  --rule-strong: #c7bfa9;

  --serif: "Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.875rem;

  --radius: 3px;
  --rail: 76px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; line-height: 1.2; color: var(--forest-ink); }
h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }
a { color: var(--forest); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ref { font-family: var(--serif); font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  background: var(--forest);
  color: var(--sage);
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.mark {
  width: 46px; height: 46px; display: grid; place-items: center; background: var(--paper);
  border-radius: 50%; margin-bottom: 18px; box-shadow: 0 0 0 3px rgba(168, 132, 58, 0.55);
}
.mark img { height: 30px; width: auto; display: block; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand img { height: 44px; width: auto; }
.brand span { font-family: var(--serif); font-size: var(--step-2); color: var(--forest-ink); }
.rail a {
  width: 64px; padding: 10px 4px 8px; text-align: center; text-decoration: none;
  color: var(--sage); font-size: 0.6875rem; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.rail a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.rail a:hover { background: var(--forest-2); color: var(--ivory); }
.rail a[aria-current="page"] { background: var(--forest-ink); color: var(--ivory); box-shadow: inset 3px 0 0 var(--gold); }
.rail .spacer { flex: 1; }
.rail a.mark { width: 46px; height: 46px; padding: 0; border-radius: 50%; background: var(--paper); display: grid; place-items: center; }
.rail a.mark:hover { background: var(--ivory); box-shadow: 0 0 0 3px var(--gold); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 32px; border-bottom: 1px solid var(--rule); background: var(--paper);
}
.topbar .owner { font-family: var(--serif); font-size: var(--step-1); color: var(--forest-ink); }
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: var(--step--1); color: var(--muted); }
.page { padding: 28px 32px 48px; max-width: 1440px; width: 100%; }

.btn {
  border: 1px solid var(--forest); background: var(--forest); color: var(--ivory);
  padding: 7px 14px; border-radius: var(--radius); cursor: pointer; font-size: var(--step--1); font-weight: 500;
}
.btn { text-decoration: none; display: inline-block; }
.btn:hover { background: var(--forest-2); }
.btn.quiet { background: transparent; color: var(--forest); border-color: var(--rule-strong); }
.btn.quiet:hover { background: var(--sage-2); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── Status vocabulary ─────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--step--1);
  padding: 1px 8px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.tag.current { background: var(--sage-2); color: var(--forest); border-color: var(--sage); }
.tag.historical { color: var(--muted); border-color: var(--rule-strong); background: var(--paper); }
.tag.pending { background: var(--gold-soft); color: var(--gold-ink); }
.tag.restricted { background: var(--brick-soft); color: var(--brick); }
.tag.verified { background: var(--sage-2); color: var(--forest); }
.tag.unverified { background: var(--paper); color: var(--muted); border-color: var(--rule-strong); }
.tag.nofile { background: transparent; color: var(--muted); border: 1px dashed var(--rule-strong); }
.hatch {
  background-color: var(--paper);
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(42, 45, 43, 0.13) 6px 7px);
}
.diff-neg, .diff-pos { color: var(--gold-ink); font-weight: 600; }
.diff-zero { color: var(--forest); }

/* ── Overview ──────────────────────────────────────────────────────────── */
.overview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 6px; }
.overview-sub { color: var(--muted); max-width: 72ch; margin-bottom: 28px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 32px; align-items: start; }

.section { margin-bottom: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--rule-strong); padding-bottom: 8px; margin-bottom: 4px; }
.section-head .count { font-size: var(--step--1); color: var(--muted); }
.empty { color: var(--muted); padding: 14px 0; font-size: var(--step--1); }

.item {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: center;
  padding: 14px 0 14px 16px; border-bottom: 1px solid var(--rule); position: relative;
}
.item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--rule-strong); }
.item.gold::before { background: var(--gold); }
.item.brick::before { background: var(--brick); }
.item.sage::before { background: var(--sage-ink); }
.item .what { font-weight: 500; }
.item .detail { grid-column: 1; color: var(--muted); font-size: var(--step--1); }
.item .side { grid-row: 1 / span 2; grid-column: 2; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chain { display: inline-flex; gap: 4px; align-items: center; }
.chain i { width: 18px; height: 4px; border-radius: 2px; background: var(--rule-strong); display: inline-block; }
.chain i.done { background: var(--forest); }
.chain i.now { background: var(--gold); }

.balance { margin-top: 10px; }
.figures { display: grid; grid-template-columns: repeat(3, max-content); gap: 2px 28px; margin-top: 10px; }
.figures dt { font-size: var(--step--1); color: var(--muted); }
.figures dd { margin: 0; font-weight: 500; }
.balance-bar { height: 10px; background: var(--sage-2); border-radius: 2px; position: relative; overflow: hidden; border: 1px solid var(--sage); }
.balance-bar span { position: absolute; inset: 0 auto 0 0; background: var(--forest); }
.balance-legend { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--muted); margin-top: 6px; }

.facts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); margin-bottom: 30px; }
.fact { padding: 12px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper); }
.fact .v { font-family: var(--serif); font-size: var(--step-1); color: var(--forest-ink); }
.fact .k { font-size: var(--step--1); color: var(--muted); }

.tree { list-style: none; margin: 0; padding: 0; }
.tree .lh { padding: 12px 0 6px; }
.tree .lh-title { font-family: var(--serif); font-size: var(--step-1); }
.tree .dev { margin: 8px 0 0 12px; padding-left: 14px; border-left: 1px solid var(--rule-strong); }
.tree .dev-title { font-weight: 500; margin-bottom: 4px; }
.phase-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.phase-row:last-child { border-bottom: 0; }
.phase-row a { text-decoration: none; color: var(--charcoal); }
.phase-row a:hover { color: var(--forest); text-decoration: underline; }
.phase-meter { grid-column: 1 / -1; height: 4px; background: var(--sage-2); border-radius: 2px; overflow: hidden; }
.phase-meter span { display: block; height: 100%; background: var(--sage-ink); }

.events { list-style: none; margin: 0; padding: 0; }
.events li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: var(--step--1); }
.events time { color: var(--muted); }
.events a { color: var(--forest); text-decoration: none; }
.events a:hover { text-decoration: underline; }

/* ── Register: split screen ────────────────────────────────────────────── */
.register { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); flex: 1; min-height: 0; }
/* Split screens fill the window: the list and the detail each scroll on their own, and the page itself does not. */
@media (min-width: 1101px) {
  .shell.split { height: 100vh; min-height: 0; }
  .shell.split .main { height: 100vh; overflow: hidden; }
}
.reg-list { border-right: 1px solid var(--rule-strong); display: flex; flex-direction: column; min-height: 0; background: var(--paper); }
.reg-controls { padding: 18px 20px 12px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.reg-controls, .reg-controls > *, .crumbs { min-width: 0; }
.reg-list > * { min-width: 0; }
.crumbs select { width: 100%; }
.crumbs { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; font-size: var(--step--1); color: var(--muted); }
.crumbs select { flex: 1 1 0; min-width: 0; border: 1px solid var(--rule-strong); background: var(--ivory); border-radius: var(--radius); padding: 3px 6px; max-width: 100%; }
.crumbs .sep { color: var(--faint); }
.search { width: 100%; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--ivory); }
.segmented { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; width: max-content; }
.segmented button { border: 0; background: transparent; padding: 4px 12px; font-size: var(--step--1); cursor: pointer; color: var(--muted); }
.segmented button + button { border-left: 1px solid var(--rule-strong); }
.segmented button[aria-pressed="true"] { background: var(--forest); color: var(--ivory); }
.reg-table-wrap { overflow: auto; flex: 1; }
.reg-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.reg-table th { position: sticky; top: 0; background: var(--paper); text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); }
.reg-table td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.reg-table th.r, .reg-table td.r { text-align: right; }
.reg-table tbody tr { cursor: pointer; }
.reg-table tbody tr:hover { background: var(--sage-2); }
.reg-table tbody tr[aria-selected="true"] { background: var(--sage); box-shadow: inset 3px 0 0 var(--forest); }
.reg-table tr.retired td { color: var(--muted); }
.reg-table tr.retired .ref { text-decoration: line-through; text-decoration-color: var(--faint); }
.marks { display: inline-flex; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.brick { background: var(--brick); }
.dot.gold { background: var(--gold); }
.swatch { width: 14px; height: 10px; border: 1px solid var(--rule-strong); display: inline-block; border-radius: 1px; }
.reg-foot { padding: 10px 20px; border-top: 1px solid var(--rule); font-size: var(--step--1); color: var(--muted); display: flex; justify-content: space-between; }

.reg-detail { overflow: auto; padding: 26px 34px 48px; min-width: 0; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.detail-head h1 { font-size: 2.25rem; }
.detail-head .numbers { color: var(--muted); margin-top: 4px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--rule); margin-bottom: 26px; }
.kv div { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
.kv dt { font-size: var(--step--1); color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* ── The plat: lineage drawn to scale ──────────────────────────────────── */
.plat { background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 18px 20px 16px; margin-bottom: 26px; }
.plat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.plat-path { font-size: var(--step--1); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.plat-path button { border: 0; background: none; padding: 0; color: var(--forest); cursor: pointer; font-family: var(--serif); font-size: var(--step--1); }
.plat-path button:hover { text-decoration: underline; }
.plat-path .title { font-family: var(--serif); color: var(--charcoal); }
.strip { display: flex; gap: 3px; min-height: 64px; }
.lot {
  position: relative; min-width: 44px; border: 1px solid var(--rule-strong); border-radius: 2px;
  padding: 7px 8px; display: flex; flex-direction: column; justify-content: space-between;
  text-align: left; cursor: pointer; background: var(--sage-2); color: var(--charcoal); overflow: hidden;
}
.lot:hover { border-color: var(--forest); }
.lot .lot-ref { font-family: var(--serif); font-weight: 500; font-size: var(--step--1); white-space: nowrap; }
.lot .lot-area { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.lot.historical { background-color: var(--paper); }
.lot.selected { border: 2px solid var(--forest); background: var(--sage); box-shadow: 0 0 0 3px rgba(31, 59, 45, 0.12); }
.lot.selected.historical { background-color: var(--paper); }
.lot.road { background: #e9e5da; }
.lot.public_open_space { background: #dfe8d6; }
.lot.title { cursor: default; background: var(--ivory); border-style: dashed; }
.lot.narrow { padding: 6px 4px; }
.lot.narrow .lot-ref { font-size: 0.6875rem; }
.lot.narrow .lot-area { display: none; }
.lot.proposed { background: var(--gold-soft); border: 1px dashed var(--gold); cursor: default; }
.lot.proposed .lot-ref { font-family: var(--sans); font-weight: 500; }
.joint .label.proposed { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink); }
/* Historical land is hatched, as retired land is on a cadastral drawing. Declared after the fills above. */
.lot.historical, .swatch.hatch, .lot.title.hatch {
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(42, 45, 43, 0.14) 6px 7px);
}
.joint { display: grid; grid-template-columns: 1fr; justify-items: center; padding: 6px 0; position: relative; }
.joint::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--rule-strong); }
.joint .label {
  position: relative; background: var(--paper); padding: 2px 10px; font-size: var(--step--1); color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px; display: inline-flex; gap: 10px; align-items: center;
}
.joint .label strong { font-weight: 500; color: var(--charcoal); }
.plat-sum { display: grid; grid-template-columns: repeat(3, auto); justify-content: end; gap: 4px 20px; margin-top: 12px; font-size: var(--step--1); }
.plat-sum dt { color: var(--muted); }
.plat-sum dd { margin: 0; text-align: right; }
.plat-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 0.75rem; color: var(--muted); align-items: center; }
.plat-legend span { display: inline-flex; gap: 6px; align-items: center; }

.subsection { margin-bottom: 26px; }
/* The tab strip stays in view while the parcel scrolls beneath it, and never shows its own scrollbar. */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--rule-strong); margin: 4px 0 20px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  position: sticky; top: -26px; z-index: 3; background: var(--ivory); padding-top: 4px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: none; padding: 10px 16px 9px; cursor: pointer; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.tabs button:hover { color: var(--forest); }
.tabs button[aria-selected="true"] { color: var(--forest-ink); border-bottom-color: var(--gold); }
.tab-count { font-size: 0.75rem; color: var(--muted); background: var(--sage-2); border-radius: 999px; padding: 0 7px; font-weight: 400; }
.audit { list-style: none; margin: 0; padding: 0; }
.audit li { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: var(--step--1); }
.audit time { color: var(--muted); }
.back-link { display: none; color: var(--forest); text-decoration: none; font-size: var(--step--1); margin-bottom: 12px; }
.subsection h3 { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rule-strong); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: 10px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; }
.rows .sub { grid-column: 1 / -1; color: var(--muted); font-size: var(--step--1); }

/* ── Sign-in ──────────────────────────────────────────────────────────── */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); }
.signin-side {
  position: relative; color: var(--sage); padding: 56px; display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--forest) url("img/landholding-aerial.jpg") 55% 62% / cover no-repeat;
}
/* A forest-green fade from the bottom keeps the words legible and leaves the boundary visible. */
.signin-side::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(23, 48, 34, 0.94) 0%, rgba(23, 48, 34, 0.72) 30%, rgba(23, 48, 34, 0.12) 62%, rgba(23, 48, 34, 0) 100%);
}
.signin-side > * { position: relative; }
.signin-side h1 { color: var(--ivory); font-size: 2.75rem; font-weight: 400; max-width: 14ch; text-shadow: 0 1px 12px rgba(23, 48, 34, 0.45); }
.signin-side p { color: var(--sage-2); }
.signin-side p { max-width: 46ch; margin-top: 16px; }
.signin-form { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px; background: var(--paper); }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--step--1); color: var(--muted); }
.field input { padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--ivory); font-size: var(--step-1); }
.field input.code { letter-spacing: 0.4em; font-family: var(--serif); }
.error { color: var(--brick); font-size: var(--step--1); }
.code-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.code-actions[hidden] { display: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--forest); font: inherit; font-size: var(--step--1); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.secure-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--step--1); }
.secure-note svg { width: 18px; height: 18px; flex: none; stroke: var(--forest); fill: none; stroke-width: 1.6; margin-top: 1px; }
.audit-outcome { margin-left: 8px; }
/* The decisions that need this person stand out; everything else stays quiet. */
.item.decision { background: var(--gold-soft); border: 1px solid #e3d3a4; border-radius: var(--radius); padding: 16px 18px 16px 22px; margin-top: 10px; }
.item.decision::before { top: 0; bottom: 0; left: 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); }
.item.decision .what { font-size: var(--step-1); font-family: var(--serif); }
.item.decision .detail { color: var(--charcoal); }
.item.blocking { background: var(--brick-soft); border: 1px solid #e6c9c0; border-radius: var(--radius); padding: 14px 18px 14px 22px; margin-top: 10px; }
.item.blocking::before { top: 0; bottom: 0; left: 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); }
.decide { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.decide textarea { flex: 1 1 100%; min-height: 64px; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); font: inherit; }
.btn.reject { background: transparent; color: var(--brick); border-color: #d7b2a8; }
.btn.reject:hover { background: var(--brick-soft); }
.notice { background: var(--sage-2); border: 1px solid var(--sage); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; font-size: var(--step--1); }
.note { color: var(--muted); font-size: var(--step--1); }

.loading { color: var(--muted); padding: 40px 0; }

/* ── Shared pieces for the workspace screens ───────────────────────────── */
.rail a { position: relative; }
.badge {
  position: absolute; top: 4px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: var(--forest-ink); font-size: 0.6875rem; font-weight: 600; line-height: 18px; text-align: center;
}
.eyebrow { font-size: var(--step--1); color: var(--gold-ink); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.lead { max-width: 70ch; margin-bottom: 22px; }
.head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.narrow-page { max-width: 980px; }
table.plain { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
table.plain th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule-strong); }
table.plain td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); }
table.plain .r { text-align: right; }
table.plain tr.src td { color: var(--muted); }
a.lot { text-decoration: none; }

/* Approvals list */
.reg-controls h2 { margin-bottom: 2px; }
.wl-group { padding: 6px 0 10px; }
.wl-head { display: flex; justify-content: space-between; padding: 10px 20px 6px; font-size: var(--step--1); color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.wl-empty { padding: 4px 20px 10px; }
.wl-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 20px 12px 22px; text-decoration: none; color: var(--charcoal);
  border-bottom: 1px solid var(--rule); position: relative;
}
.wl-item::before { content: ""; position: absolute; left: 8px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--rule-strong); }
.wl-item.yours::before { background: var(--gold); }
.wl-item.yours { background: var(--gold-soft); }
.wl-item:hover { background: var(--sage-2); }
.wl-item[aria-current="true"] { background: var(--sage); box-shadow: inset 3px 0 0 var(--forest); }
.wl-what { font-weight: 500; }
.wl-detail { grid-column: 1; font-size: var(--step--1); color: var(--muted); }
.wl-side { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wl-docs { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; border-top: 1px solid var(--rule-strong); text-decoration: none; color: var(--forest); }
.wl-docs .small { color: var(--muted); }
.wl-docs.waiting { background: var(--gold-soft); }
.wl-docs.waiting .small { color: var(--gold-ink); font-weight: 500; }
.wl-docs:hover { background: var(--sage-2); }

/* Approval detail */
.standing { padding: 12px 16px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); color: var(--muted); margin-bottom: 22px; }
.decide-panel { background: var(--gold-soft); border: 1px solid #e3d3a4; border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; display: grid; gap: 10px; }
.decide-panel textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); font: inherit; }
.decide-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.ack { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--radius); font-size: var(--step--1); cursor: pointer; }
.ack input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--forest); flex: none; }
.status-note { border: 1px solid var(--sage); background: var(--sage-2); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 4px; margin-top: 10px; font-size: var(--step--1); }
.evidence-card { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); padding: 14px 16px; display: grid; gap: 10px; }
.ev-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.explanation { margin: 0; padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--ivory); font-family: var(--serif); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; border-left: 1px solid var(--rule-strong); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--rule-strong); background: var(--paper); margin-top: 4px; }
.timeline li.done .tl-dot { background: var(--forest); border-color: var(--forest); }
.timeline li.now .tl-dot { background: var(--gold); border-color: var(--gold); }
.timeline li.rejected .tl-dot { background: var(--brick); border-color: var(--brick); }
.tl-tag { margin-left: 8px; }

/* Forms */
.card-form { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); padding: 16px 18px; display: grid; gap: 12px; margin-bottom: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.field select, .field textarea, .card-form input, .propose input, .propose select, .propose textarea, .decide input {
  padding: 7px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--ivory); font: inherit; min-width: 0;
}
.decide input { flex: 1 1 260px; }
.propose { display: grid; gap: 16px; }
.propose h3 { margin-top: 6px; }
table.edit td { padding: 6px 10px 6px 0; }
table.edit input, table.edit select { width: 100%; }
table.edit input.r { text-align: right; }
.add-row { justify-self: start; }
.area-check { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); padding: 12px 16px; }
.area-check .figures { grid-template-columns: repeat(4, max-content); margin-top: 0; }
.check { margin-top: 10px; font-size: var(--step--1); color: var(--muted); }
.check.ok { color: var(--forest); }
.check.out { color: var(--gold-ink); font-weight: 500; }
.variance { border: 1px solid #e3d3a4; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 12px; margin: 0; }
.variance legend { font-family: var(--serif); font-size: var(--step-1); color: var(--forest-ink); padding: 0 4px; }
.radios { display: grid; gap: 6px; }
.radio { display: block; }
.narrow-field { max-width: 220px; }
.form-actions { display: flex; gap: 8px; }

/* Installed app (PWA) */
.install-slot { display: inline-flex; gap: 8px; align-items: center; }
.install-slot:empty { display: none; }
.install-tip { font-size: var(--step--1); color: var(--muted); max-width: 22ch; }
.update-banner {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; gap: 14px; align-items: center; background: var(--forest-ink); color: var(--ivory);
  padding: 10px 12px 10px 18px; border-radius: 6px; box-shadow: 0 6px 24px rgba(23, 48, 34, 0.25); font-size: var(--step--1);
}
.update-banner .btn { background: var(--gold); border-color: var(--gold); color: var(--forest-ink); }
.offline { max-width: 420px; margin: 18vh auto 0; padding: 0 20px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.offline p { color: var(--muted); }
.topbar { padding-top: calc(14px + env(safe-area-inset-top)); }

/* Evidence files */
.file-block { display: grid; gap: 10px; margin-top: 8px; }
.file-version { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); padding: 10px 12px; display: grid; gap: 8px; }
.file-version.older { opacity: 0.8; background: transparent; }
.file-line { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.file-name { font-weight: 500; }
.file-meta { flex: 1 1 100%; font-size: var(--step--1); color: var(--muted); }
.file-meta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; background: var(--ivory); padding: 0 4px; border-radius: 2px; }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.verify-file { margin-top: 0; }
.upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.doc-card { border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
.details-verify { margin-top: 10px; }
.issue-inline { background: var(--brick-soft); color: var(--brick); border-radius: var(--radius); padding: 8px 12px; font-size: var(--step--1); }
.decide-panel .file-version { background: var(--paper); }

/* Permits */
.inline-action { margin-top: 8px; }
.card-form.tight { padding: 12px 14px; gap: 10px; margin-bottom: 4px; }
.issue-box { background: var(--brick-soft); border: 1px solid #e6c9c0; border-left: 4px solid var(--brick); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; display: grid; gap: 6px; }
.warn-list { margin: -10px 0 22px; padding: 10px 16px 10px 32px; background: var(--gold-soft); border-radius: var(--radius); font-size: var(--step--1); color: var(--gold-ink); }
.wl-item.attention::before { background: var(--brick); }
.rows.conditions li.overdue { box-shadow: inset 3px 0 0 var(--brick); padding-left: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 2px 10px; border: 1px solid var(--rule-strong); border-radius: 999px; text-decoration: none; color: var(--forest); background: var(--paper); font-size: var(--step--1); }
.chip:hover { background: var(--sage-2); }

@media (max-width: 1100px) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .register { grid-template-columns: 1fr; height: auto; }
  .reg-list { border-right: 0; border-bottom: 1px solid var(--rule-strong); max-height: 52vh; }
}
@media (max-width: 720px) {
  :root { --rail: 0px; }
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: calc(60px + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); flex-direction: row; justify-content: center; z-index: 5; }
  .update-banner { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .install-tip { display: none; }
  .rail .mark, .rail a.mark, .rail .spacer { display: none; }
  .page, .reg-detail { padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); }
  .topbar { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .topbar .who span { display: none; }
  .topbar .owner { font-size: var(--step-0); }
  /* The register becomes two screens: a list of compact cards, then the parcel. */
  .register.has-selection .reg-list { display: none; }
  .register:not(.has-selection) .reg-detail { display: none; }
  .reg-list { max-height: none; border-bottom: 0; }
  .back-link { display: inline-block; }
  .reg-table thead { display: none; }
  .reg-table tbody tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "ref area" "num flags" "use flags"; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
  .reg-table td { padding: 0; border: 0; }
  .reg-table td:nth-child(1) { grid-area: ref; font-size: var(--step-0); }
  .reg-table td:nth-child(2) { grid-area: num; }
  .reg-table td:nth-child(3) { grid-area: use; color: var(--muted); }
  .reg-table td:nth-child(4) { grid-area: area; font-weight: 500; }
  .reg-table td:nth-child(5) { grid-area: flags; justify-self: end; align-self: end; }
  .detail-head h1 { font-size: 1.75rem; }
  .audit li { grid-template-columns: 1fr; gap: 2px; }
  .plat { padding: 14px 12px; }
  .plat-head { flex-direction: column; }
  .joint .label { flex-wrap: wrap; justify-content: center; text-align: center; border-radius: 12px; }
  .item { grid-template-columns: 1fr; }
  .tabs { top: -20px; }
  .area-check .figures { grid-template-columns: repeat(2, max-content); }
  .badge { top: 2px; right: 6px; }
  .workspace .reg-list { padding-bottom: 60px; }
  .head-actions { align-items: flex-start; }
  .item .side { grid-row: auto; grid-column: 1; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signin { grid-template-columns: 1fr; }
  .signin-side { padding: 32px 20px; }
  .signin-form { padding: 32px 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .lot { transition: border-color 120ms ease, box-shadow 120ms ease; }
  .plat .strip.enter .lot { animation: settle 260ms ease-out both; }
  @keyframes settle { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}

/* Notes & Actions */
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.control-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.small-btn { padding: 4px 10px; font-size: var(--step--1); }
.btn.small-btn[aria-pressed="true"] { background: var(--forest); color: var(--ivory); border-color: var(--forest); }
.reg-table input.pick { margin: 0 8px 0 0; width: 15px; height: 15px; accent-color: var(--forest); vertical-align: -2px; }
.batch-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; background: var(--gold-soft); border-top: 1px solid #e3d3a4; font-size: var(--step--1); }
.batch-bar .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.item-title { font-size: 1.75rem; }
.note-body { font-family: var(--serif); max-width: 70ch; display: grid; gap: 10px; margin: 0 0 22px; padding: 14px 18px; background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: var(--radius); white-space: pre-line; }
.item-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-bottom: 22px; }
.item-controls .inline-action { margin-top: 0; }
.item-controls .card-form.tight { min-width: min(100%, 420px); }
.status-note + .standing, .status-note { margin-bottom: 18px; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { padding: 10px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; }
.removed summary { cursor: pointer; color: var(--muted); font-size: var(--step--1); margin-top: 10px; }
.check-row { display: block; font-size: var(--step--1); }
.field select[multiple] { min-height: 120px; }
.principle { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--rule); }
.chips.inline { display: inline-flex; vertical-align: middle; }
.follow-ups { display: grid; gap: 8px; margin-top: 6px; justify-items: start; }
.fu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fu-list li { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; color: var(--charcoal); }

/* Calendar: month grid with the selected day's agenda beside it */
.calendar-page { max-width: 1240px; }
.cal-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 16px; }
.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-nav h2 { min-width: 9.5em; text-align: center; }
.cal-nav .btn { padding: 4px 12px; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--step--1); color: var(--muted); }
.cal-filter { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.cal-filter input { accent-color: var(--forest); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 22px; align-items: start; }
.cal-grid { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { padding: 6px 8px; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--rule-strong); }
.cal-day { border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper); min-height: 92px; padding: 6px 8px; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; font: inherit; }
.cal-row .cal-day:last-child { border-right: 0; }
.cal-day:hover { background: var(--sage-2); }
.cal-day.other { background: var(--ivory); color: var(--faint); }
.cal-day[aria-selected="true"] { background: var(--sage); box-shadow: inset 0 0 0 2px var(--forest); }
.cal-num { font-size: var(--step--1); font-weight: 500; }
.cal-day.today .cal-num { background: var(--forest); color: var(--ivory); border-radius: 999px; padding: 0 7px; align-self: flex-start; }
.cal-dots { display: flex; gap: 3px; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--sage-ink); }
.cal-dot.condition_due { background: var(--gold); }
.cal-dot.survey_due { background: var(--forest-ink); border-radius: 1px; }
.cal-dot.overdue { box-shadow: 0 0 0 2px var(--brick-soft), 0 0 0 3px var(--brick); }
.cal-count { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-agenda { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); padding: 14px 16px; position: sticky; top: 16px; }
.cal-agenda h3 { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rule-strong); }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.cal-entry { padding: 10px 0 10px 12px; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; position: relative; }
.cal-entry::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--sage-ink); }
.cal-entry.condition_due::before { background: var(--gold); }
.cal-entry.survey_due::before { background: var(--forest-ink); }
.cal-entry.overdue::before { background: var(--brick); }
.cal-entry.done strong { text-decoration: line-through; text-decoration-color: var(--faint); }
.cal-entry a { text-decoration: none; color: var(--charcoal); display: grid; }
.cal-entry a:hover strong { text-decoration: underline; }
.cal-kind { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.issue-box .cal-list { margin-top: 4px; }

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-agenda { position: static; }
}
@media (max-width: 720px) {
  .cal-day { min-height: 54px; padding: 4px; }
  .cal-count { display: none; }
  .cal-dow span { padding: 4px; font-size: 0.6875rem; }
  .cal-nav h2 { min-width: 0; font-size: var(--step-1); }
  .item-controls { flex-direction: column; }
  .rail a { width: 56px; }
}
.cal-dot.done { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sage-ink); }
.cal-next { margin-top: 14px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
