/* MDO Property: layout and app components. Tokens come from mdo.css (brand pack v1.0). */
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding: 10px 16px; background: var(--surface); border-bottom: var(--border) solid var(--line);
}
.brand { font: 600 1.2rem/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: .02em; margin: 0; }
.brand span { color: var(--accent-text); font-weight: 500; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.top nav a {
  padding: 6px 12px; border-radius: var(--radius-pill); color: var(--ink-2); text-decoration: none;
  transition: background-color var(--dur) var(--ease);
}
.top nav a:hover { background: var(--surface-2); }
.top nav a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.who { display: flex; align-items: center; gap: 8px; }
.who form { margin: 0; }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: .94rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 16px 0; }
.card-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
form.stack { gap: 8px; }
section.card { margin-bottom: 16px; }
.grid section.card, .stack section.card { margin-bottom: 0; }
.stat { font: 600 2.2rem/1.1 var(--font-display); margin: 4px 0; }
.table-wrap.flat { border: 0; border-radius: 0; }
.num { text-align: right; white-space: nowrap; }
th.num a { justify-content: flex-end; }
th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--accent-text); }
.reg td { white-space: nowrap; }
.reg td:nth-child(3), .reg td:nth-child(4) { white-space: normal; min-width: 12em; }
.detail { max-width: 28em; overflow-wrap: anywhere; }
.plain { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: var(--border) solid var(--line); }
.list li:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.crumbs { margin: 0 0 4px; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: minmax(8em, 38%) 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.strat h3 { margin-top: 1em; }
.cvv-change { font-weight: 600; font-variant-numeric: tabular-nums; }
.cvv-rate { display: block; margin-top: 2px; }
.cvv-note { margin: 8px 0 0; font-size: .86rem; }
.strat ul { padding-left: 1.2em; margin: 0 0 .5em; }
.sources { font-size: .94rem; overflow-wrap: anywhere; }
code.path { display: block; overflow-wrap: anywhere; color: var(--ink-2); }
.snap img { display: block; width: 100%; height: auto; border-radius: var(--radius-control); border: var(--border) solid var(--line); }
.notice { background: var(--surface-2); border: var(--border) solid var(--line); border-radius: var(--radius-control); padding: 8px 12px; font-size: .94rem; color: var(--ink-2); }
.notice.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
form.inline { display: inline; margin-left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* sign-in */
.signin { max-width: 420px; margin: 8vh auto; padding: 28px; }
.signin .brand { margin-bottom: 20px; }
.signin .brand .bmark {               /* the mark (templates/_mark.svg) on its ultramarine tile */
  display: inline-flex; vertical-align: middle; margin-right: 12px;
  border-radius: var(--radius-control); background: var(--action); color: var(--action-ink);
}
.bmark .mk, .cmark .mk { display: block; }
.signin input { width: 100%; }
.signin .btn { width: 100%; margin-top: 8px; }
input.code { font-family: var(--font-data); font-size: 1.4rem; letter-spacing: .3em; text-align: center; }

/* filters */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; margin: 12px 0 16px; align-items: end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .94rem; color: var(--ink-3); }
.filters label:first-child { grid-column: 1 / -1; }
.filters input, .filters select { width: 100%; }
.filters .actions { display: flex; gap: 8px; }
.bar-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 12px; }
.bar-row p { margin: 0; }

/* recommendation colours */
.rec-rent { --rc: var(--rec-rent); } .rec-palm { --rc: var(--rec-palm); }
.rec-develop { --rc: var(--rec-develop); } .rec-sell { --rc: var(--rec-sell); }
.rec-hold { --rc: var(--rec-hold); } .rec-keep { --rc: var(--rec-keep); }
.rec-pending { --rc: var(--rec-pending); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mc, var(--rc, var(--rec-pending))); margin-right: 6px; vertical-align: baseline; }
.rec { white-space: nowrap; }
.chip.rec-chip { font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: .94rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; }
.sqkey { display: inline-block; width: 14px; height: 14px; border: 2px dashed var(--ink-2); margin-right: 6px; }
.olkey { display: inline-block; width: 14px; height: 14px; border: 3px solid var(--good); margin-right: 6px; }
.olkey.dash { border-style: dashed; border-color: var(--warn); }
.olkey.plain { border-color: var(--ink-2); }
.legend[hidden] { display: none; }

/* map */
.map { height: 70vh; min-height: 360px; border-radius: var(--radius); border: var(--border) solid var(--line); }
.leaflet-container { font: 400 15px/1.4 var(--font-body); background: var(--surface-3); }
.leaflet-interactive.pin { fill: var(--mc, var(--rc)); stroke: var(--map-halo); stroke-width: 2px; fill-opacity: .95; }
.leaflet-interactive.sq { stroke: var(--mc, var(--rc)); fill: var(--mc, var(--rc)); fill-opacity: .08; stroke-width: 2px; stroke-dasharray: 6 5; }
.leaflet-interactive.mill { fill: var(--ink-2); stroke: var(--map-halo); stroke-width: 1.5px; fill-opacity: .9; }
/* surveyed outlines: field-check status by default (confirmed good, to confirm warn) */
.leaflet-interactive.outline { --fcc: var(--warn); stroke: var(--mc, var(--fcc)); fill: var(--mc, var(--fcc)); }
.leaflet-interactive.outline.fc-confirmed { --fcc: var(--good); }
/* Colour by: the map (and each legend) carries .colour-<mode>; every pin, square and outline
   carries one class per mode (rec-, ls-, cv-, lc-), so a mode switch is one class change.
   Anything with no value for the mode is mute (--ink-3, as the lease chip's grey). */
.colour-rec .outline { --mc: var(--rc); }
.colour-lease .leaflet-interactive, .colour-cvv .leaflet-interactive, .colour-cover .leaflet-interactive,
.colour-lease .ls-grey, .colour-cvv .cv-unknown, .colour-cover .lc-unclear, .colour-cover .lc-none { --mc: var(--ink-3); }
.colour-lease .ls-red, .colour-cvv .cv-bad { --mc: var(--bad); }
.colour-lease .ls-amber, .colour-cvv .cv-warn { --mc: var(--warn); }
.colour-lease .ls-green, .colour-cvv .cv-good { --mc: var(--good); }
.colour-cover .lc-oil-palm { --mc: var(--cover-palm); }
.colour-cover .lc-other-crop { --mc: var(--cover-crop); }
.colour-cover .lc-cleared { --mc: var(--cover-cleared); }
.colour-cover .lc-forest-scrub { --mc: var(--cover-forest); }
.colour-cover .lc-built-up { --mc: var(--cover-built); }
.colour-cover .lc-water-swamp { --mc: var(--cover-water); }
.colour-cover .lc-mixed { --mc: var(--cover-mixed); }
/* overlays: mill reach rings (thin line, very low fill), hillshade, comparables */
/* the line is the halo token: the ink tokens vanish on dark imagery; the fill keeps the ring's colour */
path.reach { stroke: var(--map-halo); fill-opacity: .035; stroke-width: 1.5px; stroke-opacity: .85; }
path.reach.r30 { fill: var(--good); }
path.reach.r50 { fill: var(--warn); stroke-dasharray: 7 6; }
.leaflet-tile-pane .hillshade { mix-blend-mode: multiply; }
.comp-pin {
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  border-radius: var(--radius-control); background: var(--surface); color: var(--accent-text);
  border: 2px solid var(--accent-text); font: 600 12px/1 var(--font-data);
}
.comp-pin.region { border-style: dashed; }
.comp-pop { max-width: 300px; font: 400 14px/1.35 var(--font-body); }
.comp-pop h3 { margin: 0 0 6px; font-size: 1rem; }
.comp-pop ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.comp-pop li { padding: 6px 0; border-top: var(--border) solid var(--line); }
.comp-pop .cp-what { font-weight: 600; }
.comp-pop .cp-fig { font-variant-numeric: tabular-nums; }
.comp-pop .cp-meta, .comp-pop .cp-note { color: var(--ink-3); font-size: .86rem; }
.maptools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.leaflet-tooltip { font: 400 14px/1.35 var(--font-body); }
.leaflet-tooltip strong { display: block; font-family: var(--font-data); font-weight: 400; }

/* expiry ladder bars */
.ladder td { vertical-align: middle; }
.barcell { width: 45%; }
.bar { display: block; height: 10px; border-radius: var(--radius-pill); background: var(--accent-text); min-width: 0; }
.bar.warn { background: var(--warn); }
.w-0 { width: 0%; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }

@media (max-width: 760px) {
  .card-grid { grid-template-columns: 1fr; }
  .top { padding: 8px 12px; }
  .top nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .top nav a { white-space: nowrap; }
  .who { margin-left: auto; }
  .who .chip { display: none; }
  .wrap { padding: 12px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .map { height: 62vh; }
  .stat { font-size: 1.8rem; }
}

/* lease traffic light: red/amber/green reuse the pack's bad/warn/good chips; grey is mute */
.chip.mute { background: transparent; color: var(--ink-3); border-color: var(--line-2); border-style: dashed; }
/* a title with no spaces (a pasted formula, a long reference) wraps instead of widening the phone page */
h1 { overflow-wrap: anywhere; }

/* eLASIS field check on the card */
.fieldcheck { margin-top: 1em; padding-top: 12px; border-top: var(--border) solid var(--line); }
.fieldcheck .fc-area { font-weight: 600; font-variant-numeric: tabular-nums; }
.fieldcheck .fc-candidate { margin: 0 0 8px; }
.fieldcheck .fc-notes { margin: 10px 0 0; }
.fc-shot { margin: 12px 0 0; }
.fc-shot img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: var(--radius-control); border: var(--border) solid var(--line); }
.fc-shot figcaption { margin-top: 4px; font-size: .86rem; }
.fc-source { margin: 8px 0 0; font-size: .86rem; }
.fieldcheck .fc-pending { margin: 0 0 8px; font-size: .94rem; }

/* overview bento: stat tiles and bars. Widths and heights are 5% step classes (w-N, h-N)
   or SVG geometry attributes, because style-src 'self' blocks every inline style. */
.ov-sub { margin: -4px 0 16px; color: var(--ink-2); font-size: .94rem; }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin: 0 0 14px; }
.bento .tile { margin: 0; min-width: 0; padding: 16px 18px; container-type: inline-size; }
.t-kpi { grid-column: span 3; }
.t-rec, .t-group, .t-ladder { grid-column: span 6; }
.t-state, .t-tier, .t-vacant { grid-column: span 3; }
.solo .t-rec { grid-column: span 7; }
.solo .t-state { grid-column: span 5; }
.t-visit { grid-column: span 9; }
.tile h2 {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px;
  margin: 0 0 12px; font-size: 1.02rem; font-weight: 500;
}
.tile h2 small { font: 400 .84rem/1.3 var(--font-body); color: var(--ink-2); }
.tile .note { margin: 10px 0 0; font-size: .86rem; color: var(--ink-2); }
.tile .more { margin: 12px 0 0; font-size: .9rem; }

/* KPI tiles; the hero sits on the accent fill */
.kpi .lab, .split .lab { margin: 0; font-size: .9rem; color: var(--ink-2); }
.kpi-n { display: block; margin: 6px 0 4px; font: 600 2.6rem/1.1 var(--font-display); color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
.kpi-n .unit { margin-left: 8px; font: 500 1rem/1 var(--font-display); color: var(--ink-2); letter-spacing: 0; }
.kpi .fine, .split .fine { display: block; margin: 0; font-size: .86rem; color: var(--ink-2); }
.bento .tile.hero { background: var(--accent); border-color: transparent; }
.hero .lab, .hero .fine, .hero .kpi-n, .hero .kpi-n .unit { color: var(--accent-ink); }

/* proportion bars (SVG: x and width are attributes, colour comes from the class) */
.pbar { display: block; width: 100%; height: 16px; margin: 4px 0 14px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-3); }
.pbar rect { fill: var(--rc, var(--rec-pending)); stroke: var(--card, var(--surface)); stroke-width: 2px; vector-effect: non-scaling-stroke; transition: opacity var(--dur) var(--ease); }
.pbar a:hover rect { opacity: .78; }
.pbar.tbar { height: 12px; margin: 14px 0 0; }
.pbar rect.tier-company { fill: var(--action); }
.pbar rect.tier-private { fill: var(--accent-text); fill-opacity: .5; }
.rlegend { display: grid; grid-template-columns: repeat(auto-fill, minmax(14em, 1fr)); gap: 6px 18px; font-size: .9rem; }
.rlegend a { display: flex; align-items: center; min-width: 0; color: var(--ink); text-decoration: none; }
.rlegend .dot { flex: none; }
.rlegend .k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlegend .nv { margin-left: auto; padding-left: 10px; font: 400 .82rem var(--font-data); color: var(--ink-2); white-space: nowrap; }
.rlegend a:hover .k, .hbars .k a:hover { color: var(--accent-text); text-decoration: underline; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split a { display: block; min-width: 0; color: inherit; text-decoration: none; }
.split .kpi-n { font-size: 1.9rem; margin: 2px 0; }
.split a:hover .lab { color: var(--accent-text); }

/* ranked bars: name, bar, parcels, acres; the bar drops under the name in a narrow tile */
.hbars { display: grid; row-gap: 8px; font-size: .92rem; }
.hbars li { display: grid; grid-template-columns: minmax(5em, 10em) minmax(2em, 1fr) 3em 6.5em; align-items: center; gap: 4px 10px; }
.hbars .k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .k a { color: var(--ink); text-decoration: none; }
.trk { display: block; height: 8px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.trk i { display: block; height: 100%; border-radius: inherit; background: var(--action); }
.hbars .n { font: 400 .82rem var(--font-data); color: var(--ink-2); text-align: right; white-space: nowrap; }
.hbars .n.ac { color: var(--ink); }
@container (max-width: 380px) {
  .hbars li { grid-template-columns: minmax(0, 1fr) auto 6em; }
  .hbars .trk { grid-column: 1 / -1; grid-row: 2; height: 6px; }
}
details.more summary { cursor: pointer; color: var(--accent-text); }
details.more[open] summary { margin-bottom: 8px; }

/* expiry ladder: one column per year, the count above, the year below */
.cols { display: flex; margin: 4px 0 0; }
.cols li { flex: 1 1 0; min-width: 0; }
.cols .c { display: block; color: var(--ink-2); text-decoration: none; }
.ctrk { display: flex; align-items: flex-end; height: 132px; padding-top: 18px; border-bottom: var(--border) solid var(--line-2); }
.ctrk i { position: relative; flex: 1 1 auto; margin: 0 2px; border-radius: 3px 3px 0 0; background: var(--action); transition: opacity var(--dur) var(--ease); }
.col.warn .ctrk i { background: var(--warn); }
.col.bad .ctrk i { background: var(--bad); }
.ctrk b { position: absolute; bottom: 100%; left: 0; right: 0; padding-bottom: 2px; font: 400 .72rem/1 var(--font-data); color: var(--ink-2); text-align: center; }
.yl { display: block; margin-top: 5px; font: 400 .72rem/1 var(--font-data); color: var(--ink-3); text-align: center; white-space: nowrap; }
a.c:hover .ctrk i { opacity: .78; }
a.c:hover .yl { color: var(--accent-text); }
.h-0 { height: 0; } .h-5 { height: 5%; } .h-10 { height: 10%; } .h-15 { height: 15%; } .h-20 { height: 20%; } .h-25 { height: 25%; } .h-30 { height: 30%; } .h-35 { height: 35%; } .h-40 { height: 40%; } .h-45 { height: 45%; } .h-50 { height: 50%; } .h-55 { height: 55%; } .h-60 { height: 60%; } .h-65 { height: 65%; } .h-70 { height: 70%; } .h-75 { height: 75%; } .h-80 { height: 80%; } .h-85 { height: 85%; } .h-90 { height: 90%; } .h-95 { height: 95%; } .h-100 { height: 100%; }

/* parcel chips: the id in the data face, the short word after it */
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; white-space: nowrap;
  border: var(--border) solid var(--line-2); border-radius: var(--radius-control);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: .9rem; line-height: 1.4;
  transition: border-color var(--dur) var(--ease);
}
.pchip .data { font-size: .86rem; }
.pchip .s { font-size: .82rem; color: var(--ink-2); }
.pchip.warn { border-color: var(--warn); }
.pchip:hover { border-color: var(--accent-text); }

@media (max-width: 1100px) {
  .t-kpi, .t-state, .t-tier { grid-column: span 6; }
  .t-rec, .t-group, .t-ladder, .t-visit, .t-vacant, .solo .t-rec, .solo .t-state { grid-column: span 12; }
}
@media (max-width: 760px) {
  .bento { gap: 10px; margin-bottom: 10px; }
  .bento > .tile, .bento .t-kpi, .bento .t-state, .bento .t-tier, .solo .t-rec, .solo .t-state { grid-column: 1 / -1; }
  .kpi-n { font-size: 2.2rem; }
  .ctrk { height: 112px; }
  .cols li:nth-child(even) .yl { visibility: hidden; }   /* every other year */
  .ctrk b { font-size: .64rem; }
}
.fieldcheck .fc-group { margin: 0 0 8px; }
.fc-cands { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.fc-cand { padding: 10px 12px; border: var(--border) solid var(--line); border-radius: var(--radius-control); background: var(--surface-2); }
.fc-cand .fc-cand-head { margin: 0 0 4px; }
.fc-cand .kv { margin: 0; }
.fc-cand .fc-cand-shot { margin: 6px 0 0; font-size: .94rem; }
