/* Municipal Valuation Roll: survey sheet theme
   Drafting-film paper, survey-ink blue, parcel green, boundary red for disputes.
   Dark mode is a blueprint. */

:root {
  --paper: #F3F6F8;
  --sheet: #FFFFFF;
  --sheet-2: #F7F9FB;
  --rule: #D8E0E7;
  --rule-strong: #A8B7C4;
  --ink: #0F2A47;
  --text: #1B2A3A;
  --muted: #56687B;
  --faint: #8395A7;
  --accent: #1D4F91;
  --accent-tint: #E4ECF6;
  --land: #2E7A55;
  --land-tint: #E2F0E7;
  --boundary: #B3261E;
  --boundary-tint: #FBEAE8;
  --grid: rgba(29, 79, 145, 0.055);

  --c-res: #D9EADB;
  --c-bus: #D3E0EF;
  --c-ind: #DCE0E6;
  --c-agr: #BFDDBF;
  --c-vac: #FFFFFF;
  --c-state: #FFFFFF;
  --c-muni: #FFFFFF;
  --c-pbo: #FFFFFF;
  --hatch: #6A83A0;
  --plan-line: #29496C;
  --plan-halo: rgba(255, 255, 255, 0.86);

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --radius: 3px;
  --rail: 256px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C1A2A;
    --sheet: #102238;
    --sheet-2: #0E1F33;
    --rule: #203D5C;
    --rule-strong: #35597F;
    --ink: #E8F0F8;
    --text: #D2DEEA;
    --muted: #93A9C0;
    --faint: #6C859F;
    --accent: #8FBAF0;
    --accent-tint: #16304F;
    --land: #6DC398;
    --land-tint: #133528;
    --boundary: #F28B82;
    --boundary-tint: #3B1D24;
    --grid: rgba(143, 186, 240, 0.06);
    --c-res: #173B35;
    --c-bus: #183557;
    --c-ind: #1E3149;
    --c-agr: #1C4733;
    --c-vac: #102238;
    --c-state: #102238;
    --c-muni: #102238;
    --c-pbo: #102238;
    --hatch: #6F93BC;
    --plan-line: #8FB3DA;
    --plan-halo: rgba(12, 26, 42, 0.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0C1A2A;
  --sheet: #102238;
  --sheet-2: #0E1F33;
  --rule: #203D5C;
  --rule-strong: #35597F;
  --ink: #E8F0F8;
  --text: #D2DEEA;
  --muted: #93A9C0;
  --faint: #6C859F;
  --accent: #8FBAF0;
  --accent-tint: #16304F;
  --land: #6DC398;
  --land-tint: #133528;
  --boundary: #F28B82;
  --boundary-tint: #3B1D24;
  --grid: rgba(143, 186, 240, 0.06);
  --c-res: #173B35;
  --c-bus: #183557;
  --c-ind: #1E3149;
  --c-agr: #1C4733;
  --c-vac: #102238;
  --c-state: #102238;
  --c-muni: #102238;
  --c-pbo: #102238;
  --hatch: #6F93BC;
  --plan-line: #8FB3DA;
  --plan-halo: rgba(12, 26, 42, 0.85);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 600; margin: 0; }
h1 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.35rem); line-height: 1.08; font-variation-settings: "opsz" 48; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; line-height: 1.2; font-variation-settings: "opsz" 24; }
h3 { font-size: 1.05rem; line-height: 1.3; }
p { margin: 0 0 0.75rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.25rem 0; }
small, .small { font-size: 0.8125rem; }
.muted { color: var(--muted); }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: var(--sheet); padding: 0.5rem 0.75rem; z-index: 50; border-radius: var(--radius); }
.skip:focus { top: 1rem; }

/* ── Shell ───────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--sheet) calc(var(--rail) - 1px), var(--rule) calc(var(--rail) - 1px), var(--rule) var(--rail), transparent var(--rail)); }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--sheet);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
}
.rail-head { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; line-height: 1.1; }
.brand-act { display: block; font-family: var(--sans); font-size: 0.75rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.muni-switch { margin-top: 1rem; }
.muni-switch label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.25rem; }
.muni-switch select { width: 100%; font-weight: 600; }
.muni-switch button { margin-top: 0.4rem; }
.js .muni-switch button { display: none; }

.nav { padding: 0.75rem 0.75rem 1rem; flex: 1; }
.nav-group { font-size: 0.75rem; color: var(--faint); margin: 1rem 0.5rem 0.25rem; }
.nav-group:first-child { margin-top: 0.25rem; }
.nav a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.42rem 0.5rem; border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-size: 0.9rem;
}
.nav a:hover { background: var(--sheet-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-tint); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.nav svg { flex: none; width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.4; opacity: 0.8; }
.nav .count { margin-left: auto; font-size: 0.75rem; color: var(--boundary); font-weight: 600; }

.rail-foot { border-top: 1px solid var(--rule); padding: 0.85rem 1.25rem 1rem; font-size: 0.85rem; }
.who { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.6rem; color: var(--ink); font-weight: 600; }
.who-mark { width: 26px; height: 26px; border: 1px solid var(--rule-strong); border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 0.85rem; }
.rail-links { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; }
.rail-links a, .rail-links button { font: inherit; font-size: 0.82rem; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.rail-links a:hover, .rail-links button:hover { color: var(--ink); }

.rail .menu-toggle { display: none; }

.main { min-width: 0; padding: 2rem clamp(1rem, 3vw, 2.75rem) 4rem; }
.main-inner { max-width: 1280px; margin: 0 auto; }

/* ── Page heading ───────────────────────────────────── */
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.5rem; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head .lede { color: var(--muted); margin: 0.5rem 0 0; max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* ── Buttons & fields ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: 600 0.875rem/1 var(--sans);
  padding: 0.62rem 0.95rem; min-height: 38px;
  border-radius: var(--radius); border: 1px solid var(--rule-strong);
  background: var(--sheet); color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--sheet); }
.btn-quiet { border-color: transparent; background: none; color: var(--accent); padding-inline: 0.4rem; }
.btn-quiet:hover { border-color: transparent; text-decoration: underline; }
.btn-sm { min-height: 32px; padding: 0.45rem 0.7rem; font-size: 0.82rem; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.field label, .label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 0.78rem; color: var(--faint); }
.req { color: var(--boundary); }
.input, .field input, .field select, .field textarea, select, input[type="text"], input[type="search"], input[type="number"], input[type="email"], input[type="password"], input[type="date"], input[type="datetime-local"], textarea {
  font: 400 0.95rem/1.3 var(--sans);
  color: var(--text);
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
  min-height: 40px;
  width: 100%;
}
select { padding-right: 2rem; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type="file"] { padding: 0.45rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.5rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--ink); margin-bottom: 0.75rem; padding: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; }
.filters input[type="search"], .filters input[type="text"] { min-width: 260px; }
.filters select { min-width: 190px; }
.result-count { margin-left: auto; font-size: 0.85rem; color: var(--muted); align-self: center; }

/* ── Sheets (panels) ─────────────────────────────────── */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.sheet-pad { padding: 1.25rem 1.35rem; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1rem 1.35rem 0.75rem; border-bottom: 1px solid var(--rule); }
.sheet-head h2 { font-size: 1.12rem; }
.sheet-head .aside { font-size: 0.82rem; color: var(--muted); }
.section { margin-top: 2rem; }
.section > h2 { margin-bottom: 0.75rem; }
.cols { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.cols-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-top: 1.25rem; }

/* key/value particulars, like the schedule on a deed */
.particulars { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin: 0; }
.particulars > div { padding: 0.75rem 1.35rem; border-top: 1px solid var(--rule); }
.particulars dt { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.15rem; }
.particulars dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.particulars .serif { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }

/* ── Tables ─────────────────────────────────────────── */
.table-wrap { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left; font-weight: 500; font-size: 0.78rem; color: var(--muted);
  padding: 0.6rem 0.85rem; background: var(--sheet-2); border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap; position: sticky; top: 0;
}
.table td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table td:first-child a.row-link { white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: var(--sheet-2); }
.table .num, .table th.num { text-align: right; }
.table tfoot td { border-top: 1px solid var(--rule-strong); border-bottom: 0; font-weight: 600; color: var(--ink); background: var(--sheet-2); }
.table .money { font-family: var(--serif); font-size: 0.98rem; font-weight: 500; color: var(--ink); white-space: nowrap; text-align: right; }
.table .money.strong { font-weight: 700; }
.table .sub { display: block; font-size: 0.8rem; color: var(--muted); }
.table a.row-link { color: var(--ink); text-decoration: none; }
.table a.row-link:hover { text-decoration: underline; }
.empty { padding: 2.5rem 1.35rem; text-align: center; color: var(--muted); }
.empty strong { display: block; font-family: var(--serif); color: var(--ink); font-size: 1.05rem; margin-bottom: 0.25rem; }

/* erf identifier: number set in the serif, portion lighter */
.erf { font-family: var(--serif); font-weight: 600; color: var(--ink); white-space: nowrap; font-size: 1rem; }
.erf .ptn { font-weight: 400; color: var(--muted); }
.erf-big { font-size: inherit; }

/* status tags */
.tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; font-weight: 600; line-height: 1;
  padding: 0.28rem 0.5rem; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor; background: transparent;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-dispute { color: var(--boundary); background: var(--boundary-tint); border-color: transparent; }
.tone-land { color: var(--land); background: var(--land-tint); border-color: transparent; }
.tone-ink { color: var(--accent); background: var(--accent-tint); border-color: transparent; }
.tone-neutral { color: var(--muted); border-color: var(--rule-strong); }
.tone-neutral::before { background: var(--faint); }

/* category swatch */
.cat { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.sw { width: 14px; height: 10px; border: 1px solid var(--plan-line); flex: none; background: var(--c-res); }
.sw-res { background: var(--c-res); }
.sw-bus { background: var(--c-bus); }
.sw-ind { background: repeating-linear-gradient(135deg, var(--hatch) 0 1px, var(--c-ind) 1px 4px); }
.sw-agr { background: radial-gradient(var(--land) 0.7px, var(--c-agr) 0.9px) 0 0 / 4px 4px; }
.sw-vac { background: radial-gradient(var(--hatch) 0.6px, var(--c-vac) 0.8px) 0 0 / 5px 5px; }
.sw-state { background: repeating-linear-gradient(45deg, var(--hatch) 0 1px, var(--c-state) 1px 4px); }
.sw-muni { background: repeating-linear-gradient(45deg, var(--hatch) 0 1px, transparent 1px 4px), repeating-linear-gradient(135deg, var(--hatch) 0 1px, var(--c-muni) 1px 4px); }
.sw-pbo { background: repeating-linear-gradient(90deg, var(--hatch) 0 1px, var(--c-pbo) 1px 4px); }
.sw-other { background: var(--sheet-2); }

/* alerts */
.note { border-left: 3px solid var(--accent); background: var(--accent-tint); padding: 0.75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1rem; color: var(--ink); }
.note-dispute { border-color: var(--boundary); background: var(--boundary-tint); }
.note-ok { border-color: var(--land); background: var(--land-tint); }

/* ── Dashboard: the general plan ─────────────────────── */
.plan-sheet { background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); position: relative; }
.plan-sheet::before { /* drafting grid */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.plan-frame { position: relative; padding: 1.25rem 1.25rem 0.5rem; }
.plan { display: block; width: 100%; height: auto; }
.plan .parcel rect { stroke: var(--plan-line); stroke-width: 0.6; fill: var(--c-res); transition: fill 120ms ease; }
.plan .c-res rect { fill: var(--c-res); }
.plan .c-bus rect { fill: var(--c-bus); }
.plan .c-ind rect { fill: url(#p-ind); }
.plan .c-agr rect { fill: url(#p-agr); }
.plan .c-vac rect { fill: url(#p-vac); }
.plan .c-state rect { fill: url(#p-state); }
.plan .c-muni rect { fill: url(#p-muni); }
.plan .c-pbo rect { fill: url(#p-pbo); }
.plan .c-other rect { fill: var(--sheet-2); }
.plan .is-disputed rect { stroke: var(--boundary); stroke-width: 1.6; stroke-dasharray: 5 2.5; }
.plan .parcel:hover rect, .plan .parcel:focus rect { fill: var(--accent-tint); stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: none; }
.plan .parcel:focus { outline: none; }
.plan .erf-label { font: 600 9px var(--serif); fill: var(--plan-line); pointer-events: none; }
.plan .block-edge { fill: none; stroke: var(--plan-line); stroke-width: 1.4; }
.plan .beacon { fill: var(--sheet); stroke: var(--plan-line); stroke-width: 1; }
.plan .block-name {
  font: italic 500 22px var(--serif); fill: var(--ink); letter-spacing: 0.01em; pointer-events: none;
  paint-order: stroke; stroke: var(--plan-halo); stroke-width: 5px; stroke-linejoin: round;
}
.plan .block-value { font: 500 11px var(--sans); fill: var(--muted); pointer-events: none; paint-order: stroke; stroke: var(--plan-halo); stroke-width: 4px; }
.plan .pat-line { stroke: var(--hatch); stroke-width: 0.8; }
.plan .pat-dot { fill: var(--hatch); }
.plan .pat-dot-land { fill: var(--land); }
.plan .pat-bg-ind { fill: var(--c-ind); }
.plan .pat-bg-agr { fill: var(--c-agr); }
.plan .pat-bg-plain { fill: var(--sheet); }

.plan-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding: 0.25rem 1.25rem 1rem; font-size: 0.82rem; color: var(--muted); position: relative; }
.plan-meta .key { display: inline-flex; align-items: center; gap: 0.4rem; }
.plan-meta .key-dispute { width: 18px; height: 10px; border: 1.6px dashed var(--boundary); }
.north { display: inline-flex; align-items: center; gap: 0.35rem; }

@media (prefers-reduced-motion: no-preference) {
  .plan .block { animation: settle 700ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 28ms); }
  .plan .block-edge { stroke-dasharray: 4000; stroke-dashoffset: 4000; animation: draw 800ms ease-out forwards; animation-delay: calc(var(--i, 0) * 28ms); }
}
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* title block: the drawing's schedule of key figures */
.title-block { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); position: relative; background: var(--sheet); border-radius: 0 0 var(--radius) var(--radius); }
.title-block > div { padding: 0.9rem 1.25rem 1rem; border-left: 1px solid var(--rule); }
.title-block > div:first-child { border-left: 0; }
.title-block dt { font-size: 0.78rem; color: var(--muted); }
.title-block dd { margin: 0.2rem 0 0; }
.fig { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: clamp(1.35rem, 1rem + 1vw, 1.8rem); line-height: 1.1; font-variation-settings: "opsz" 36; letter-spacing: -0.01em; white-space: nowrap; }
.fig-dispute { color: var(--boundary); }
.fig-note { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

/* category ledger with value bars */
.cat-ledger { list-style: none; margin: 0; padding: 0.35rem 0; }
.cat-ledger li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 1rem; padding: 0.55rem 1.35rem; }
.cat-ledger .bar { grid-column: 1 / -1; height: 5px; background: var(--sheet-2); border-radius: 3px; overflow: hidden; }
.cat-ledger .bar i { display: block; height: 100%; background: var(--plan-line); opacity: 0.75; border-radius: 3px; }
.cat-ledger .money { font-family: var(--serif); font-weight: 600; color: var(--ink); white-space: nowrap; }
.cat-ledger .cnt { color: var(--muted); font-size: 0.82rem; margin-left: 0.4rem; }

/* objections ledger */
.status-run { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--rule); }
.status-run a { flex: 1 1 33%; padding: 0.75rem 1.35rem; text-decoration: none; color: var(--text); border-right: 1px solid var(--rule); border-top: 1px solid var(--rule); margin-top: -1px; }
.status-run a:hover { background: var(--sheet-2); }
.status-run a:nth-child(3n) { border-right: 0; }
.status-run b { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--ink); line-height: 1.15; }
.status-run .open b { color: var(--boundary); }
.status-run span { font-size: 0.8rem; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 0.7rem 1.35rem; border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.75rem; }
.feed li:first-child { border-top: 0; }
.feed .what { color: var(--ink); font-weight: 500; }
.feed .meta { font-size: 0.8rem; color: var(--muted); }
.feed .money { font-family: var(--serif); font-weight: 600; color: var(--ink); text-align: right; white-space: nowrap; }

/* roll calendar */
.rollline { list-style: none; margin: 0; padding: 1.25rem 1.35rem 1.35rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 1.1rem 0; position: relative; }
.rollline li { position: relative; padding: 1.4rem 1rem 0 0; }
.rollline li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; border-top: 1px solid var(--rule-strong); }
.rollline li::after { content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--sheet); border: 1.5px solid var(--plan-line); }
.rollline li.is-active::after { background: var(--land); border-color: var(--land); }
.rollline li.is-progress::after { background: var(--sheet); border: 1.5px dashed var(--accent); }
.rollline .when { font-family: var(--serif); font-weight: 600; color: var(--ink); }
.rollline .what { font-size: 0.85rem; color: var(--text); }
.rollline .who { font-size: 0.78rem; color: var(--muted); margin: 0.2rem 0 0; display: block; font-weight: 400; }

/* ── Property: SG diagram & valuation certificate ─────── */
.deed { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--sheet); overflow: hidden; }
.diagram-pane { position: relative; padding: 1rem 1.25rem 1.1rem; border-right: 1px solid var(--rule); }
.diagram-pane::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 20px 20px; }
.diagram { display: block; width: 100%; height: auto; position: relative; }
.diagram .lot { fill: var(--c-res); stroke: var(--plan-line); stroke-width: 1.6; }
.diagram .lot.c-bus { fill: var(--c-bus); }
.diagram .lot.c-ind { fill: var(--c-ind); }
.diagram .lot.c-agr { fill: var(--c-agr); }
.diagram .lot.c-vac, .diagram .lot.c-state, .diagram .lot.c-muni, .diagram .lot.c-pbo { fill: var(--sheet); }
.diagram .lot.is-disputed { stroke: var(--boundary); stroke-dasharray: 7 3; }
.diagram .nb { stroke: var(--plan-line); stroke-width: 0.8; stroke-dasharray: 2 3; opacity: 0.6; fill: none; }
.diagram .bcn { fill: var(--sheet); stroke: var(--plan-line); stroke-width: 1.2; }
.diagram .bcn-l { font: italic 600 13px var(--serif); fill: var(--ink); }
.diagram .len { font: 500 10px var(--sans); fill: var(--muted); paint-order: stroke; stroke: var(--sheet); stroke-width: 3px; }
.diagram .lot-erf { font: 600 22px var(--serif); fill: var(--ink); }
.diagram .lot-ext { font: 400 11px var(--sans); fill: var(--muted); }
.diagram .n-arrow { fill: var(--plan-line); }
.diagram .n-text { font: italic 600 12px var(--serif); fill: var(--ink); }
.sides { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 0.5rem; position: relative; }
.sides th { text-align: left; font-weight: 500; color: var(--muted); padding: 0.25rem 0.4rem; border-bottom: 1px solid var(--rule); }
.sides td { padding: 0.25rem 0.4rem; color: var(--text); border-bottom: 1px dotted var(--rule); }
.sides td:first-child { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--ink); }
.sides .num { text-align: right; }
.diagram-caption { font-size: 0.75rem; color: var(--faint); margin-top: 0.4rem; position: relative; }

.certificate { padding: 1.35rem 1.5rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; position: relative; }
.certificate .label { display: block; }
.value-fig { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -0.02em; font-variation-settings: "opsz" 60; white-space: nowrap; }
.value-fig .r { font-weight: 400; color: var(--muted); margin-right: 0.12em; font-size: 0.62em; vertical-align: 0.34em; }
.split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--sheet-2); }
.split .land { background: var(--land); }
.split .imp { background: var(--plan-line); opacity: 0.55; }
.split-key { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; }
.split-key b { display: block; font-family: var(--serif); color: var(--ink); font-size: 1rem; font-weight: 600; }
.split-key .k { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 0.35rem; vertical-align: 0; }
.history-bars { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.history-bars li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; font-size: 0.84rem; color: var(--muted); }
.history-bars .hb-bar { height: 6px; background: var(--sheet-2); border-radius: 3px; overflow: hidden; }
.history-bars .hb-bar i { display: block; height: 100%; background: var(--rule-strong); border-radius: 3px; }
.history-bars .is-current .hb-bar i { background: var(--ink); }
.history-bars .hb-val { font-family: var(--serif); color: var(--ink); font-weight: 600; text-align: right; min-width: 7.5rem; }
.cert-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 0.9rem; margin-top: auto; }
.cert-foot dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 0.15rem 0.9rem; font-size: 0.84rem; }
.cert-foot dt { color: var(--muted); }
.cert-foot dd { margin: 0; color: var(--ink); }

/* deed stamp: double-ruled, slightly rotated */
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 0.45rem 0.8rem; border: 2px solid var(--land); outline: 1px solid var(--land); outline-offset: 2px;
  border-radius: 4px; color: var(--land); transform: rotate(-4deg);
  font-family: var(--serif); font-weight: 700; font-size: 0.95rem; line-height: 1.1; letter-spacing: 0.02em;
}
.stamp small { font-family: var(--sans); font-weight: 500; font-size: 0.7rem; letter-spacing: 0; }
.stamp-dispute { color: var(--boundary); border-color: var(--boundary); outline-color: var(--boundary); }
.stamp-draft { color: var(--accent); border-color: var(--accent); outline-color: var(--accent); }

/* ── Map ─────────────────────────────────────────────── */
.map-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
#map { height: min(72vh, 680px); min-height: 420px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--sheet-2); }
.leaflet-tile-pane { filter: saturate(0.25) contrast(0.95) brightness(1.03); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(0.92) hue-rotate(185deg) saturate(0.4) brightness(0.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(0.92) hue-rotate(185deg) saturate(0.4) brightness(0.9); } }
.leaflet-container { font-family: var(--sans) !important; }
.leaflet-popup-content { font-size: 0.85rem; line-height: 1.4; }
.leaflet-popup-content b { font-family: var(--serif); font-size: 1rem; }
.legend-list { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.legend-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--sheet); box-shadow: 0 0 0 1px var(--plan-line); flex: none; }

/* ── Calendar (appeal board) ──────────────────────────── */
.sitting { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.25rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.sitting:first-child { border-top: 0; }
.sitting-date { font-family: var(--serif); color: var(--ink); }
.sitting-date b { display: block; font-size: 2rem; line-height: 1; font-weight: 600; }
.sitting-date span { font-size: 0.85rem; color: var(--muted); }
.sitting.is-past .sitting-date b { color: var(--muted); }

/* ── Login & public pages ─────────────────────────────── */
.plain-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.plain-body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 28px 28px; }
.plain-body > * { position: relative; z-index: 1; }
.public-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--rule); background: var(--sheet); }
.public-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2rem) 4rem; flex: 1; }
.public-main.narrow { max-width: 680px; }
.public-foot { border-top: 1px solid var(--rule); padding: 1.25rem clamp(1rem, 4vw, 3rem); font-size: 0.82rem; color: var(--muted); background: var(--sheet); }
.public-foot p { max-width: 80ch; margin: 0 0 0.3rem; }
.search-panel { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto; gap: 0.75rem; align-items: end; }
.search-panel .field { margin: 0; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1.5rem; padding: 1rem 1.35rem; border-top: 1px solid var(--rule); }
.result-list li:first-child { border-top: 0; }
.result-list .addr { font-size: 1.05rem; color: var(--ink); font-weight: 500; }
.result-list .facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.84rem; color: var(--muted); }
.result-list .value { text-align: right; }
.result-list .value .label { display: block; }
.result-list .value .fig { font-size: 1.45rem; }

.login { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); min-height: 100vh; }
.login-art { position: relative; border-right: 1px solid var(--rule); background: var(--sheet); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(1.5rem, 4vw, 3rem); }
.login-art .login-plan { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-art .lot { fill: none; stroke: var(--plan-line); stroke-width: 1; opacity: 0.5; }
.login-art .lot-hi { fill: var(--c-res); stroke: var(--plan-line); stroke-width: 1.4; opacity: 1; }
.login-art .lot-dispute { fill: none; stroke: var(--boundary); stroke-width: 1.4; stroke-dasharray: 6 3; opacity: 0.9; }
.login-art .road { font: italic 500 15px var(--serif); fill: var(--muted); }
.login-copy { position: relative; max-width: 30rem; }
.login-copy h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.1rem); }
.login-copy p { color: var(--muted); margin-top: 0.75rem; font-size: 1rem; }
.login-foot { position: relative; font-size: 0.8rem; color: var(--muted); }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.5rem, 5vw, 3.5rem); background: var(--paper); }
.login-form h2 { margin-bottom: 0.35rem; }
.login-form .muted { margin-bottom: 1.5rem; }
.login-form .btn { width: 100%; margin-top: 0.4rem; min-height: 44px; }
.login-alt { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 0.9rem; }

.receipt { text-align: left; }
.receipt .ref { font-family: var(--serif); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); font-weight: 600; color: var(--ink); letter-spacing: 0.01em; margin: 0.5rem 0 1rem; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .cols, .cols-even { grid-template-columns: minmax(0, 1fr); }
  .deed { grid-template-columns: minmax(0, 1fr); }
  .diagram-pane { border-right: 0; border-bottom: 1px solid var(--rule); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .rail { position: sticky; top: 0; height: auto; max-height: 100vh; z-index: 20; border-right: 0; border-bottom: 1px solid var(--rule); }
  .rail-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 1rem; border-bottom: 0; }
  .brand-act { display: none; }
  .rail .menu-toggle { display: inline-flex; }
  .js .rail .rail-body { display: none; }
  .js .rail.is-open .rail-body { display: block; border-top: 1px solid var(--rule); }
  .rail.is-open { overflow-y: auto; }
  .muni-switch-wide { display: none; }
  .main { padding-top: 1.25rem; }
  .title-block { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-block > div:nth-child(3) { border-left: 0; }
  .title-block > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { min-height: 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .login-art .login-plan { display: none; }
  .login-foot { margin-top: 1rem; }
}
@media (min-width: 901px) {
  .muni-switch-narrow { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input[type="search"], .filters input[type="text"], .filters select { min-width: 0; }
  .result-count { margin-left: 0; }
  .search-panel { grid-template-columns: minmax(0, 1fr); }
  .plan-frame { padding: 0.75rem 0.75rem 0.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .plan { min-width: 820px; }
  .sitting { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .result-list li { grid-template-columns: minmax(0, 1fr); }
  .result-list .value { text-align: left; }
  .page-head { align-items: flex-start; }
  .particulars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .particulars > div { padding: 0.65rem 1rem; }
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 0.7rem 1rem; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.75rem; }
  .table-stack td { padding: 0; border: 0; text-align: left; }
  .table-stack td.num, .table-stack td.money { text-align: right; }
  .table-stack td.hide-sm { display: none; }
  .table-stack tfoot td { padding: 0.7rem 1rem; }
}

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

@media print {
  .rail, .actions, .filters { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
