/* Auditor portal layout: a light sidebar on desktop (the Ziro ridges faint at
   its foot), a top bar with scrolling tabs on phones. */
body.portal { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--card); color: var(--ink); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; --contour: color-mix(in srgb, var(--canopy) 13%, transparent); }
.side.contours::before { height: 150px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; padding: 0 6px; }
.brand .mark { width: 36px; height: 36px; }
.brand b { display: block; font: 400 22px/1.05 var(--display); letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; font-stretch: 112%; letter-spacing: .05em; text-transform: uppercase; margin-top: 3px; }
#tabs { display: flex; flex-direction: column; gap: 2px; }
#tabs button { appearance: none; border: 0; background: transparent; color: var(--muted); font: 500 15px/1 var(--body);
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-align: left; position: relative; }
#tabs button:hover { background: var(--bg); color: var(--ink); }
#tabs button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
#tabs button.on::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
#tabs .ico { width: 19px; height: 19px; }
#tabs .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
#tabs .count:empty { display: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.side-foot .pill { color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.content { padding: 26px 32px 40px; max-width: 1480px; width: 100%; min-width: 0; margin: 0; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pagehead h1 { margin: 4px 0 0; font-size: 34px; letter-spacing: -.01em; }

/* KPI strip: the carbon figure leads, the rest support it. */
.kpis { display: grid; grid-template-columns: minmax(280px, 1.4fr) repeat(4, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; min-height: 118px; }
.kpi.lead { justify-content: space-between; }
/* Figures speak for themselves: no decorative icons on the stat cards. */
.kpi > .ico, .kpi > div > .ico:first-child:last-child { display: none; }
.kpi .big { display: block; }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi.lead { background: var(--canopy); color: var(--on-canopy); border: 0; --contour: rgba(255, 255, 255, .12); }
.kpi.lead .big { color: #fff; font-size: 48px; }
.kpi.lead small { color: var(--on-canopy-muted); }
.kpi.lead .delta { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; color: #a6e3c3;
  background: rgba(93, 191, 140, .14); padding: 3px 9px; border-radius: 5px; align-self: flex-start; max-width: 100%; }
.kpi.alerting .big { color: var(--bad); }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.split .map { height: calc(100vh - 290px); min-height: 420px; }
#panel:empty { display: none; }
.split #panel { max-height: calc(100vh - 290px); min-height: 420px; overflow: auto; margin: 0; }
.panel-empty { height: 100%; min-height: 380px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.panel-empty .ico { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
#panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--body); font-weight: 600; margin: 22px 0 10px; }
#panel select, .status-select { width: auto; min-height: 34px; padding: 5px 32px 5px 10px; margin: 0; font-size: 14px; display: inline-block; }
.alert-card { border-left: 3px solid var(--bad); background: var(--bad-soft); border-radius: 9px; padding: 12px 14px; margin-top: 8px; font-size: 14px; }
.chart { color: var(--muted); }
.chart .ndvi { stroke: var(--accent); } .chart .vh { stroke: var(--radar); }
.chart .lndvi { fill: var(--accent); } .chart .lvh { fill: var(--radar); }

/* Sign-in */
.signin { max-width: 420px; margin: 8vh auto; }
.signin h2 { font-size: 26px; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi.lead { grid-column: 1 / -1; } .split { grid-template-columns: 1fr; }
  .split .map, .split #panel { height: auto; max-height: none; min-height: 0; } .split .map { height: 60vh; } }
@media (max-width: 760px) {
  body.portal { display: block; }
  .side { position: sticky; z-index: 1000; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px 0; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; } .side-foot #who { display: none; }
  #tabs { flex-direction: row; width: 100%; overflow-x: auto; gap: 2px; padding-bottom: 8px; scrollbar-width: none; }
  #tabs button { white-space: nowrap; padding: 9px 12px; flex: none; }
  #tabs button.on::before { left: 12px; right: 12px; top: auto; bottom: -1px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .content { padding: 18px 14px 32px; } .pagehead h1 { font-size: 24px; }
}

/* Project overview */
.funnel { display: grid; gap: 14px; margin-top: 8px; font-size: 14px; }
.bar { display: block; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* Audit trip planner */
.trip { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.trip h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--body); font-weight: 600; margin: 22px 0 10px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.ticks label { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 8px 6px; border-radius: 10px; color: var(--ink); font-weight: 400; cursor: pointer; }
.ticks label:hover { background: var(--line-2); }
.ticks input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.ticks b { display: block; font-weight: 600; font-size: 14px; } .ticks small { color: var(--muted); font-size: 12.5px; }
.team { display: grid; gap: 10px; }
.member { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.member input, .member select { margin: 0; min-height: 38px; padding: 6px 30px 6px 10px; font-size: 14px; min-width: 0; }
.member input { grid-column: 1 / 3; padding-right: 10px; }
.member > button { grid-column: 3; grid-row: 1; }
.member select[data-f=home] { grid-column: 1 / 3; }
.iconbtn.plain { background: transparent; color: var(--muted); width: 34px; height: 34px; }
.iconbtn.plain:hover { background: var(--line-2); color: var(--bad); }
.ico.x { transform: rotate(45deg); }
.sheet-out h2 { font-size: 24px; }
.sheet-out table { font-size: 14px; }
.permits td { min-width: 200px; }
ul.plain { margin: 0; padding-left: 16px; display: grid; gap: 6px; }
ol.todo { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.lockbar.warnbar { background: var(--gold-soft); margin-top: 14px; } .lockbar.warnbar .ico { color: var(--warn); }
@media (max-width: 1100px) { .trip { grid-template-columns: 1fr; } }
@media print {
  body.portal { display: block; background: #fff; }
  .side, .no-print, .pagehead { display: none !important; }
  .content { padding: 0; }
  .trip { display: block; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .sheet-out h3 { break-after: avoid; }
  tr { break-inside: avoid; }
}
.grants input[type=date] { width: 170px; margin: 0 0 4px; }
.grants input[data-f=next_step] { min-width: 240px; margin: 0; }
.grants td:first-child { min-width: 320px; }
.team-split { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); }
@media (max-width: 1100px) { .team-split { grid-template-columns: 1fr; } }

/* Field health: sync receipts and app errors */
.health-kpis .kpi.lead .big { font-size: 40px; }
.kpi.warning .big { color: var(--warn); }
.kpi[data-kpi="version"] .big { font: 600 20px/1.2 var(--mono); overflow-wrap: anywhere; }
table.health td { vertical-align: top; }
table.health td:first-child { min-width: 170px; }
table.health .badge { margin-left: 4px; white-space: nowrap; }
table.health.errs td:first-child { min-width: 320px; }
table.health details summary { cursor: pointer; font-size: 12.5px; margin-top: 4px; }
table.health details .synclog { max-height: 180px; overflow: auto; font-size: 11.5px; white-space: pre-wrap; }
.small-note { font-size: 13px; margin: 8px 2px 0; }
.lockbar.practicebar { background: var(--practice-soft); } .lockbar.practicebar .ico { color: var(--practice); }
table.health small.muted { white-space: nowrap; }

/* Payouts: the record form folded into its own panel. */
.card h3.subhead, .subhead { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--body); font-weight: 600; margin: 22px 0 6px; }
details.recordpay { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; background: var(--bg); }
details.recordpay summary { display: flex; align-items: center; gap: 8px; padding: 14px 0; cursor: pointer; list-style: none; color: var(--accent); }
details.recordpay summary::-webkit-details-marker { display: none; }
details.recordpay summary .ico { width: 18px; height: 18px; transition: transform .2s; }
details.recordpay[open] summary .ico { transform: rotate(45deg); }
details.recordpay .grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
details.recordpay .grid2 label { margin: 6px 0 10px; }
details.recordpay input, details.recordpay select { background-color: var(--card); }
.recordpay-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 0 16px; }
.recordpay-foot p { margin: 0; font-weight: 600; color: var(--ink); }
td.nowrap, td.tag { white-space: nowrap; }

/* Consent */
.consent-v .stage .ico, table .stage .ico { width: 13px; height: 13px; margin-right: 3px; }
table.consent-ev tr.is-bad td { background: var(--bad-soft); }

/* Grievances: one card each, what they said in the middle. */
.g-kpis { grid-template-columns: minmax(320px, 1.6fr) repeat(3, minmax(130px, 1fr)); }
.g-kpis .g-url { display: block; font: 600 15px/1.35 var(--mono); color: var(--brand-on-dark); overflow-wrap: anywhere; margin-bottom: 4px; }
.g-kpis .kpi.lead a.delta { text-decoration: none; }
.g-kpis .kpi.lead a.delta .ico { width: 14px; height: 14px; color: inherit; }
.glist { display: grid; gap: 12px; }
.gcard { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.4fr) minmax(260px, 1fr); gap: 20px; align-items: start; margin: 0; }
.gmeta { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.gmeta > .tag + .stage { margin-top: -2px; }
.gmeta b { font-size: 15px; margin-top: 4px; }
.gmeta small { color: var(--muted); font-size: 13px; }
.gmeta > span:first-child { display: inline-flex; gap: 6px; }
blockquote.gsaid { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--brand); font-size: 15px; line-height: 1.55; color: var(--ink); }
.greply label { margin: 0 0 10px; }
.greply select { width: 100%; }
.greply textarea { min-height: 76px; }
.greply p { margin: 2px 0 0; font-size: 14px; }
@media (max-width: 1100px) { .gcard { grid-template-columns: 1fr; gap: 12px; } .g-kpis { grid-template-columns: repeat(3, 1fr); } .g-kpis .kpi.lead { grid-column: 1 / -1; } }

/* Overview: the credit figure leads; acres, farmers and payments stack beside it. */
.overview-kpis { grid-template-columns: minmax(340px, 1.7fr) minmax(260px, 1fr); }
.kpi-stack { display: grid; gap: 12px; }
.kpi-stack .kpi { flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px; min-height: 0; padding: 14px 18px; }
.kpi-stack .kpi > .ico { width: 40px; height: 40px; padding: 10px; box-sizing: border-box; border-radius: 9px; background: var(--accent-soft); color: var(--accent); flex: none; }
.kpi-stack .kpi .big { font-size: 26px; line-height: 1.1; }
.kpi.lead .eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.credit-fig { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.kpi.lead .credit-fig .big { font-size: 56px; line-height: 1; letter-spacing: -.02em; }
.credit-fig .unit { font: 400 19px/1 var(--display); color: var(--on-canopy-muted); }
.credit-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; line-height: 1.45; color: var(--on-canopy-muted); }
.credit-notes li { position: relative; padding-left: 14px; }
.credit-notes li::before { content: ''; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-on-dark); opacity: .8; }
@media (max-width: 1100px) { .overview-kpis { grid-template-columns: 1fr; } .kpi-stack { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } }

/* Plot register */
.tablebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tablebar .muted { font-size: 14px; }

/* Quality checks */
.qa-kpis { grid-template-columns: minmax(300px, 1.5fr) repeat(3, minmax(140px, 1fr)); }
.card > .cardhead { align-items: flex-start; gap: 20px; margin-bottom: 12px; }
.card > .cardhead h2 { margin: 0 0 4px; }
.card > .cardhead + p.lede { margin: -4px 0 14px; max-width: 90ch; }
.cardacts .btn { margin: 0; }
.card > .cardhead > .muted { white-space: nowrap; font-size: 14px; margin-top: 4px; }
.cardacts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: none; }
#pickmsg:empty { display: none; }
#pickmsg { margin: -4px 0 10px; }
th.num, td.num { text-align: right; }
table.qa td { vertical-align: middle; }
table.qa .qa-count { display: block; font-size: 13.5px; white-space: nowrap; }
table.qa .bar { width: 72px; height: 6px; margin-top: 5px; }
table.qa tr.is-bad td { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }
table.qa td.result small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
table .stage { white-space: nowrap; }
.badc { color: var(--bad); }
.ndvi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.ndvi-row { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 10px; background: var(--bg); }
.ndvi-row span { font-size: 13px; color: var(--muted); }
.ndvi-row b { font: 400 28px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.ndvi-row.eff { background: var(--canopy); }
.ndvi-row.eff span { color: var(--on-canopy-muted); }
.ndvi-row.eff b { color: #fff; }

/* Plans and annual report */
.report-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; background: var(--canopy); color: var(--on-canopy);
  border: 0; --contour: rgba(255, 255, 255, .12); }
.report-copy { display: flex; gap: 16px; align-items: flex-start; }
.report-copy > .ico { width: 44px; height: 44px; padding: 11px; box-sizing: border-box; border-radius: 9px; background: rgba(255, 255, 255, .08); color: var(--brand-on-dark); flex: none; }
.report-hero h2 { color: #fff; margin: 2px 0 6px; }
.report-hero p { margin: 0; color: var(--on-canopy-muted); max-width: 70ch; }
.reportbar { display: flex; align-items: flex-end; gap: 10px; }
.reportbar label { margin: 0; color: var(--on-canopy-muted); }
.reportbar select { margin: 4px 0 0; min-width: 110px; background-color: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .18); }
.reportbar select option { color: initial; }
.reportbar .btn { margin: 0; }
table.plans td.activities { min-width: 240px; }
@media (max-width: 1100px) { .report-hero { grid-template-columns: 1fr; } .qa-kpis { grid-template-columns: repeat(3, 1fr); } .qa-kpis .kpi.lead { grid-column: 1 / -1; } .ndvi { grid-template-columns: 1fr; } }
th .nt { text-transform: none; }
td.who b { display: block; font-weight: 600; }
td.who { min-width: 140px; }
td.plotcell { white-space: nowrap; }
td.plotcell .badges { display: flex; gap: 4px; margin-top: 6px; }
td.evidence { white-space: nowrap; }
td.evidence small { display: block; color: var(--muted); font-size: 12.5px; }
td.who small { display: block; color: var(--muted); font-size: 12.5px; }
td.stackcell { min-width: 150px; }
td.stackcell > * { display: flex; width: fit-content; }
td.stackcell > * + * { margin-top: 6px; }

/* Sidebar groups; the list scrolls on short screens. */
#tabs { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
#tabs button { padding: 9px 12px; font-size: 14.5px; flex: none; }
#tabs button.on::before { left: -8px; }
.navhead { display: block; flex: none; margin: 14px 12px 4px; font-size: 11px; font-weight: 650; font-stretch: 115%; letter-spacing: .09em; text-transform: uppercase; color: color-mix(in srgb, var(--muted) 80%, transparent); }
#tabs:has(#healthtab[hidden]) .staffhead { display: none; }
.side { gap: 18px; }
@media (max-width: 760px) { .navhead { display: none; } #tabs { flex: none; order: 3; overflow-y: visible; margin: 0; padding: 0 0 8px; } #tabs button.on::before { left: 12px; } }

/* Payouts: lots table, the public ledger and data room links. */
table.lots small, table.nature small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: normal; }
table.lots td.eudr, td.eudr { white-space: nowrap; }
td.eudr small { display: block; color: var(--muted); font-size: 12px; }
.share-row { display: grid; grid-template-columns: minmax(260px, 1fr) 2.2fr; gap: 16px; align-items: start; }
.share-row.solo { grid-template-columns: minmax(260px, 520px); }
.share-row > .card, .share-row > #drcard > .card { margin: 0; }
.ledgercta { background: var(--canopy); color: var(--on-canopy); border: 0; --contour: rgba(255, 255, 255, .12); padding: 20px; }
.ledgercta .eyebrow { color: var(--brand-on-dark); }
.ledgercta h2 { color: #fff; margin: 6px 0 8px !important; font-size: 20px !important; }
.ledgercta p { color: var(--on-canopy-muted); font-size: 14px; margin: 0 0 16px; }
.ledgercta p b { color: #fff; }
.drform { display: grid; grid-template-columns: 2fr 1.3fr 1.1fr auto; gap: 0 12px; align-items: end; }
.drform label { margin: 8px 0 0; }
.drform .btn { margin: 0; }
#dataroom-card table { margin-top: 16px !important; }
@media (max-width: 1100px) { .share-row { grid-template-columns: 1fr; } .drform { grid-template-columns: 1fr 1fr; } }

/* Biochar and nature */
.nature-kpis .kpi.lead .big { font-size: 40px; }
table.nature td.notes { min-width: 180px; color: var(--muted); }
table.nature select[data-iucn] { min-width: 180px; min-height: 38px; margin: 0; padding: 6px 32px 6px 10px; font-size: 14px; border-radius: 10px; }
.sumline { margin: 12px 0 0; font-size: 15px; }

/* Registry exports */
.reg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.reg-grid .card { margin: 0; }
.regcard { display: flex; flex-direction: column; }
.reghead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.reghead > div { flex: 1; min-width: 0; }
.reghead h2 { margin: 0 !important; }
.reghead small { color: var(--muted); font-size: 13px; }
.regmark { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.regmark .ico { width: 22px; height: 22px; }
.regmark.pv { background: var(--accent-soft); color: var(--accent); }
.regmark.ac { background: var(--gold-soft); color: var(--gold-ink); }
.filelist { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.filelist li { font: 500 12px/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; padding: 6px 8px; border-radius: 8px; background: var(--bg); color: var(--ink); }
.regopts { margin: 4px 0 0; padding: 4px 14px 10px; border-radius: 10px; background: var(--bg); }
.regopts label.check { font-size: 14px; font-weight: 550; margin: 8px 0; }
.regopts p.note { margin: 6px 0 0; font-size: 12.5px; }
.regfoot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.regfoot .btn { margin: 0; }
@media (max-width: 1100px) { .reg-grid { grid-template-columns: 1fr; } }

/* Satellite against field (satfield.js) and tree survival */
.chart .fieldpt { fill: var(--gold); stroke: var(--card); stroke-width: 1.5; }
.chart .fieldln { stroke: var(--gold); } .chart .lfield { fill: var(--gold-ink); }
.sf-kpis { grid-template-columns: minmax(280px, 1.4fr) repeat(2, minmax(160px, 1fr)); }
.sf-only { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin: 0; }
#sftable tr.is-bad td { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }
#sftable td small, .surv small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) { .sf-kpis { grid-template-columns: 1fr; } }
/* Plot and farmer share a cell; the chosen plot's reason, chart and figures sit below the table. */
#sftable th { white-space: normal; vertical-align: bottom; line-height: 1.3; }
#sftable td.sfplot small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; white-space: nowrap; }
#sftable tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
#sftable tr.on:not(.is-bad) td { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.sfdetail .cardhead h2 { margin: 0 0 2px; }
.sfwhy { margin: 2px 0 16px; padding: 11px 14px; border-radius: 9px; background: var(--bg); font-size: 14.5px; line-height: 1.5; }
.sfwhy.verdict-field_up_satellite_down { background: var(--bad-soft); }
.sfwhy.verdict-field_down_satellite_steady { background: var(--gold-soft); }
.sfwhy.verdict-agree { background: var(--accent-soft); }
.sfbody { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.sfplotchart { padding: 14px; border-radius: 10px; background: var(--bg); }
.sfbody .kv { margin: 0; font-size: 14.5px; }
#sfopen { margin-top: 16px; }
@media (max-width: 1100px) { .sfbody { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* Phones: nothing may be wider than the screen. Grid columns get a zero
   minimum so long words and pills wrap instead of pushing the page sideways. */
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pay-kpis { grid-template-columns: minmax(280px, 1.4fr) repeat(2, minmax(160px, 1fr)); }
.kpis > *, .split > *, .trip > *, .share-row > *, .reg-grid > * { min-width: 0; }
@media (max-width: 1100px) { .pay-kpis, .sf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trip { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .split.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .kpis, .qa-kpis, .g-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi-stack { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  /* An odd card left alone on the last row takes the full width. */
  .kpis > .kpi.lead:first-child ~ .kpi:last-child:nth-child(even), .kpis > .kpi:first-child:not(.lead) ~ .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { padding: 14px 16px; min-height: 0; }
  .kpi.lead .credit-fig .big { font-size: 46px; }
  .kpi.lead .big { font-size: 38px; }
  /* Card titles sit above their buttons; tables keep short cells on one line
     and scroll inside their card, long cells wrap at a readable width. */
  .cardhead { flex-wrap: wrap; }
  .card > .cardhead { gap: 8px 12px; }
  .card > .cardhead > .muted { white-space: normal; }
  .cardacts { justify-content: flex-start; flex: 0 1 auto; max-width: 100%; }
  .cardacts .btn { max-width: 100%; }
  .table-wrap table { width: max-content; min-width: 100%; }
  .table-wrap th, .table-wrap td { max-width: 15em; }
  .panel-empty { min-height: 160px; }
  .permits td { min-width: 150px; }
  .grants td:first-child { min-width: 200px; }
}

/* ---------------------------------------------------------------- night forest */
/* Sidebar: dark glass, the ridgelines faint at its foot, a glowing open tab. */
.side { background: rgba(8, 16, 12, .9); border-right: 1px solid var(--edge); --contour: rgba(62, 230, 160, .05); --lines-o: .35; }
.side.contours::after { height: 150px; }
.brand b { font-family: var(--display); font-size: 21px; letter-spacing: -.025em; }
.brand small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--brand); }
#tabs button { border-radius: 10px; transition: background .15s, color .15s; }
#tabs button:hover { background: rgba(255, 255, 255, .04); }
#tabs button.on { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px rgba(62, 230, 160, .25); }
#tabs button.on::before { box-shadow: 0 0 10px var(--brand); }
#tabs .count { color: #1d0703; }

/* Stat cards: the icon returns in its own green; the alert count glows red. */
.kpi { border-radius: var(--radius); transition: border-color .18s, transform .18s; }
.kpi:not(.lead):hover { border-color: rgba(62, 230, 160, .25); transform: translateY(-2px); }
.kpi > .ico, .kpi > div > .ico:first-child:last-child { display: block; }
.kpis > .kpi:not(.lead) { justify-content: space-between; }
.kpi > .ico { --g: var(--g1); box-sizing: border-box; width: 38px; height: 38px; padding: 9px; border-radius: 12px; flex: none; color: var(--g);
  background: color-mix(in srgb, var(--g) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 28%, transparent); }
.kpis > .kpi:nth-child(5n+3) > .ico, .kpi-stack .kpi:nth-child(2) > .ico { --g: var(--g3); }
.kpis > .kpi:nth-child(5n+4) > .ico, .kpi-stack .kpi:nth-child(3) > .ico { --g: var(--g2); }
.kpis > .kpi:nth-child(5n) > .ico { --g: var(--g5); }
.kpis > .kpi.alerting > .ico, .kpis > .kpi.warning > .ico { --g: var(--bad); }
.kpi.lead > .ico { display: none; }
.kpi.lead { min-height: 170px; }
.kpi.lead .big { text-shadow: 0 0 30px rgba(62, 230, 160, .25); }
.kpi.lead .delta { background: rgba(62, 230, 160, .12); color: var(--brand); box-shadow: inset 0 0 0 1px rgba(62, 230, 160, .25); font-family: var(--mono); font-size: 12px; }
.kpi-stack .kpi > .ico { color: var(--g); }
.pagehead h1 { font-size: 36px; letter-spacing: -.03em; }
.panel-empty .ico { color: rgba(62, 230, 160, .3); }
.alert-card { border-radius: 12px; }
.filelist li { background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--edge); }
details.recordpay { background: rgba(0, 0, 0, .2); border-color: var(--edge); }
.member { border-color: var(--edge); }
.reportbar select { background-color: rgba(0, 0, 0, .3); }
@media (max-width: 760px) { .side { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); } .side.contours::before, .side.contours::after { display: none; } }
@media print { .card, .kpi { background: #fff; border-color: #ccc; } }
.kpi.lead.contours::after { height: 70px; opacity: .3; }
.side-foot .pill { font-family: var(--body); }
