/*
 * Strata v0.2 — RITA-derived design system.
 *
 * Quiet, square, evidence first. Square corners, no shadows, no
 * gradients, 1 px rules, one accent per view. IBM Plex Sans +
 * Plex Mono. Scoped under #strata-root so no rule leaks into the
 * surrounding Lab site when the app is ever embedded.
 */

/* ─── Theme tokens ────────────────────────────────────────────── */
:root {
  --paper:        #F6F5F2;
  --surface:      #FFFFFF;
  --ink:          #111110;
  --sand:         #E9E1D3;
  --line:         #DCDAD4;
  --line-soft:    #EBE9E3;
  --mute:         #6B6963;
  --accent:       #1D6B55;
  --warn:         #C2502A;
  --sun:          #E2A93B;
  --legacy-mixed: #B9A98C;
  --sans: "IBM Plex Sans", system-ui, -apple-system, Arial, sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #111110;
    --surface:      #1A1A18;
    --ink:          #F6F5F2;
    --sand:         #2A2722;
    --line:         #34332F;
    --line-soft:    #26251F;
    --mute:         #CFCCC4;
    --accent:       #3F9C80;
    --warn:         #E0784F;
    --sun:          #E2A93B;
    --legacy-mixed: #8C7F69;
    color-scheme:   dark;
  }
}
:root[data-theme="dark"] {
  --paper:        #111110;
  --surface:      #1A1A18;
  --ink:          #F6F5F2;
  --sand:         #2A2722;
  --line:         #34332F;
  --line-soft:    #26251F;
  --mute:         #CFCCC4;
  --accent:       #3F9C80;
  --warn:         #E0784F;
  --sun:          #E2A93B;
  --legacy-mixed: #8C7F69;
  color-scheme:   dark;
}

html, body { height: 100%; margin: 0; padding: 0; }
body.strata-standalone {
  /* Pin to the visible viewport so the app fills exactly the window,
     never spills below. dvh keeps the sum right when a mobile browser
     bar shows and hides. */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ─── App shell ───────────────────────────────────────────────── */
#strata-root {
  display: grid;
  grid-template-rows: auto auto 1fr;      /* topbar | banner | content */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.003em;
  min-height: 100vh;
}
body.strata-standalone #strata-root {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
#strata-root *, #strata-root *::before, #strata-root *::after { box-sizing: border-box; }
#strata-root p { margin: 0; }
#strata-root h1, #strata-root h2, #strata-root h3, #strata-root h4 {
  margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2;
}
#strata-root a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
#strata-root a:hover { color: var(--accent); }
#strata-root button { font: inherit; cursor: pointer; background: transparent; border: 0; padding: 0; color: inherit; }
#strata-root :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#strata-root ul { list-style: none; margin: 0; padding: 0; }

/* ─── Labels (uppercase mono) ─────────────────────────────────── */
.sr-label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute);
}

/* ─── Top app bar ─────────────────────────────────────────────── */
.sr-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sr-brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.sr-brand svg { color: var(--ink); }
.sr-brand-name {
  font-family: var(--sans); font-weight: 600; font-size: 17px; letter-spacing: -0.02em;
}
.sr-brand-sub {
  margin-left: 2px; padding-left: 10px; border-left: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute);
}
.sr-tabs { display: flex; gap: 20px; align-items: center; }
.sr-tabs a {
  text-decoration: none; color: var(--mute);
  font-size: 13px; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.sr-tabs a.is-current { color: var(--ink); border-bottom-color: var(--ink); }
.sr-tabs a:hover { color: var(--ink); }
.sr-tools { display: inline-flex; align-items: center; gap: 8px; }
.sr-tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 32px; height: 32px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.sr-tbtn:hover { background: var(--sand); }
.sr-tbtn svg { width: 15px; height: 15px; }
.sr-theme .icon-sun { display: none; }
.sr-theme .icon-moon { display: inline-block; }
:root[data-theme="dark"] .sr-theme .icon-sun { display: inline-block; }
:root[data-theme="dark"] .sr-theme .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sr-theme .icon-sun { display: inline-block; }
  :root:not([data-theme="light"]) .sr-theme .icon-moon { display: none; }
}

/* ─── Pilot sand banner ───────────────────────────────────────── */
.sr-pilot-banner {
  background: var(--sand); color: var(--ink);
  padding: 10px 20px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.5;
}
.sr-pilot-banner strong { font-weight: 600; }

/* ─── Page container (per view) ───────────────────────────────── */
.sr-page {
  display: flex; flex-direction: column;
  min-height: 0;
  overflow-y: auto;    /* content pages scroll; map page overrides below */
}
.sr-page.is-map { overflow: hidden; }

/* ─── Map view ────────────────────────────────────────────────── */
.sr-map-page {
  display: grid;
  grid-template-columns: 320px 1fr 420px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.sr-map-page.no-detail { grid-template-columns: 320px 1fr; }

.sr-col {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.sr-col:last-child { border-right: 0; }
.sr-col-left { }
.sr-col-map {
  position: relative;
  background: var(--paper);
  border-right: 1px solid var(--line);
  min-height: 0;
}
.sr-col-detail {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  min-height: 0;
}

/* Facts strip (left panel) */
.sr-facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.sr-fact { background: var(--surface); padding: 12px 16px; position: relative; }
.sr-fact .sr-label { display: block; margin-bottom: 4px; }
.sr-fact .sr-n { font-family: var(--sans); font-weight: 600; font-size: 22px; line-height: 1.1; color: var(--ink); letter-spacing: -0.015em; }
.sr-fact .sr-n .sr-unit { font-size: 11px; color: var(--mute); font-weight: 500; margin-left: 3px; }
.sr-fact--alert .sr-n { color: var(--warn); }

/* Filters */
.sr-filters { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sr-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.sr-search:focus-within { border-color: var(--ink); }
.sr-search input {
  flex: 1; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 13px; color: var(--ink); min-width: 0;
}
.sr-filter-group { margin-bottom: 10px; }
.sr-filter-group:last-child { margin-bottom: 0; }
.sr-filter-label { display: block; margin-bottom: 6px; }
.sr-chipset { display: flex; flex-wrap: wrap; gap: 4px; }
.sr-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.sr-chip:hover { border-color: var(--ink); }
.sr-chip.is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.sr-chip .sr-pill-dot { width: 7px; height: 7px; background: currentColor; }

/* Site list */
.sr-list-head {
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.sr-list-count { color: var(--mute); font-family: var(--mono); font-size: 11px; }
.sr-list-wrap { flex: 1; overflow-y: auto; }
.sr-list { }
.sr-site-row {
  display: grid;
  grid-template-columns: 3px 1fr 72px;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left; width: 100%;
  background: var(--surface);
  align-items: start;
}
.sr-site-row:hover { background: var(--paper); }
.sr-site-row.is-active { background: var(--sand); }
.sr-site-row .sr-stage-bar { background: var(--line); align-self: stretch; }
.sr-site-row[data-stage="operating"]           .sr-stage-bar { background: var(--ink); }
.sr-site-row[data-stage="reopening_planned"]   .sr-stage-bar { background: var(--sun); }
.sr-site-row[data-stage="legacy_bare"]         .sr-stage-bar { background: var(--warn); }
.sr-site-row[data-stage="legacy_mixed"]        .sr-stage-bar { background: var(--legacy-mixed); }
.sr-site-row[data-stage="recovering"]          .sr-stage-bar { background: var(--accent); opacity: 0.6; }
.sr-site-row[data-stage="vegetated"]           .sr-stage-bar { background: var(--accent); }
.sr-site-row[data-stage="insufficient_data"]   .sr-stage-bar { background: var(--line); }
.sr-site-main { min-width: 0; }
.sr-site-name {
  display: block; font-size: 13.5px; font-weight: 600; color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
}
.sr-site-meta {
  display: block; margin-top: 3px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sr-site-flags {
  display: block; margin-top: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--warn);
  line-height: 1.35; word-break: break-word;
}
.sr-site-right {
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  min-width: 0;
}
.sr-site-area {
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  white-space: nowrap; font-weight: 500;
}
.sr-site-area .sr-unit { color: var(--mute); margin-left: 2px; font-weight: 400; }
.sr-site-alert {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--warn);
}

/* Map legend + attribution */
.sr-map-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; cursor: grab;
  background: var(--paper);
}
.sr-map-svg:active { cursor: grabbing; }
.sr-country { fill: var(--sand); stroke: var(--line); stroke-width: 0.7; }
:root[data-theme="dark"] .sr-country { fill: #22221E; stroke: #2E2D29; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sr-country { fill: #22221E; stroke: #2E2D29; }
}
.sr-marker { cursor: pointer; }
.sr-marker:hover { opacity: 0.78; }
.sr-marker-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.sr-marker-dot[data-stage="operating"]          { fill: var(--ink); }
.sr-marker-dot[data-stage="reopening_planned"]  { fill: var(--sun); }
.sr-marker-dot[data-stage="legacy_bare"]        { fill: var(--warn); }
.sr-marker-dot[data-stage="legacy_mixed"]       { fill: var(--legacy-mixed); }
.sr-marker-dot[data-stage="recovering"]         { fill: var(--accent); fill-opacity: 0.6; stroke: var(--accent); stroke-width: 1.5; }
.sr-marker-dot[data-stage="vegetated"]          { fill: var(--accent); }
.sr-marker-dot[data-stage="insufficient_data"]  { fill: var(--surface); stroke: var(--mute); stroke-width: 1.5; }
.sr-marker-flag { fill: var(--warn); stroke: var(--surface); stroke-width: 1; }
.sr-marker-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
  fill: var(--ink); pointer-events: none;
}
.sr-map-legend {
  position: absolute; left: 16px; bottom: 16px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 10px 14px; max-width: 320px;
}
.sr-map-legend .sr-label { display: block; margin-bottom: 6px; }
.sr-swatches { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.sr-sw { display: inline-flex; align-items: center; gap: 8px; }
.sr-sw span.d { width: 11px; height: 11px; display: inline-block; }
.sr-sw--op          span.d { background: var(--ink); }
.sr-sw--rp          span.d { background: var(--sun); }
.sr-sw--lb          span.d { background: var(--warn); }
.sr-sw--lm          span.d { background: var(--legacy-mixed); }
.sr-sw--rc          span.d { background: var(--accent); opacity: 0.6; }
.sr-sw--vg          span.d { background: var(--accent); }
.sr-sw--id          span.d { background: var(--surface); border: 1.5px solid var(--mute); }
.sr-sw--flag        span.d { background: var(--warn); }
.sr-map-attrib {
  position: absolute; right: 16px; bottom: 16px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 4px 8px;
  font-family: var(--mono); font-size: 10px; color: var(--mute);
}
.sr-map-zoom {
  position: absolute; right: 16px; top: 16px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
}
.sr-map-zoom button {
  width: 32px; height: 32px; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.sr-map-zoom button + button { border-top: 1px solid var(--line-soft); }
.sr-map-zoom button:hover { background: var(--sand); }
.sr-map-zoom svg { width: 14px; height: 14px; }

/* ─── Detail panel ────────────────────────────────────────────── */
.sr-detail-empty {
  padding: 56px 28px; color: var(--mute); text-align: center;
}
.sr-detail-empty h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.sr-detail-empty p  { font-size: 12.5px; max-width: 36ch; margin: 0 auto; line-height: 1.6; }

.sr-detail-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: relative;
}
.sr-detail-code {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--mute); text-transform: uppercase;
}
.sr-detail h2 { font-size: 20px; line-height: 1.3; margin-bottom: 12px; }
.sr-detail-sub { color: var(--mute); font-size: 13px; margin: 0 0 12px; }
.sr-detail-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.sr-pill {
  padding: 2px 10px; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.sr-pill-stage[data-stage="operating"]          { background: var(--ink); color: var(--surface); }
.sr-pill-stage[data-stage="reopening_planned"]  { background: var(--sun); color: #2A1C06; }
.sr-pill-stage[data-stage="legacy_bare"]        { background: var(--warn); color: #FFFFFF; }
.sr-pill-stage[data-stage="legacy_mixed"]       { background: var(--legacy-mixed); color: #2A220E; }
.sr-pill-stage[data-stage="recovering"]         { background: var(--accent); color: #FFFFFF; opacity: 0.78; }
.sr-pill-stage[data-stage="vegetated"]          { background: var(--accent); color: #FFFFFF; }
.sr-pill-stage[data-stage="insufficient_data"]  { background: var(--surface); color: var(--mute); border: 1px solid var(--line); }
.sr-pill-flag { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.sr-detail-close {
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px;
  border: 1px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.sr-detail-close:hover { background: var(--sand); }
.sr-detail-close svg { width: 14px; height: 14px; }

.sr-sect {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.sr-sect .sr-sect-head { display: block; margin-bottom: 10px; }
.sr-sect .sr-sect-note { color: var(--mute); font-size: 12.5px; margin: 10px 0 0; line-height: 1.55; }

/* Key facts strip (vertical rules + 3 px ink border-left for alerts) */
.sr-kf {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line);
}
.sr-kf-cell { background: var(--surface); padding: 12px 16px; position: relative; }
.sr-kf-cell::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; background: var(--ink);
}
.sr-kf-cell[data-alert="1"]::before { background: var(--warn); }
.sr-kf-cell .sr-label { display: block; margin-bottom: 4px; }
.sr-kf-cell .sr-n { font-family: var(--sans); font-weight: 600; font-size: 19px; line-height: 1.1; color: var(--ink); letter-spacing: -0.015em; }
.sr-kf-cell .sr-n .sr-unit { font-size: 11px; color: var(--mute); font-weight: 500; margin-left: 3px; }

/* Live scene placeholder */
.sr-live-panel {
  background: var(--sand);
  padding: 16px 18px;
  border: 1px dashed var(--line);
  color: var(--ink);
  font-size: 12.5px; line-height: 1.55;
}
.sr-live-panel strong { font-weight: 600; }
.sr-live-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 7px 12px;
  background: var(--ink); color: var(--surface);
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
}
.sr-live-btn:hover { background: #000; color: #FFF; }

/* Change chart */
.sr-chart { background: var(--surface); border: 1px solid var(--line); padding: 10px; }
.sr-chart svg { width: 100%; height: 180px; display: block; }
.sr-chart .cv-grid { stroke: var(--line-soft); stroke-width: 1; fill: none; }
.sr-chart .cv-axis { stroke: var(--line); stroke-width: 1; fill: none; }
.sr-chart .cv-baseline { stroke: var(--mute); stroke-dasharray: 3 3; stroke-width: 1; fill: none; }
.sr-chart .cv-text { font-family: var(--mono); font-size: 9.5px; fill: var(--mute); }
.sr-chart .cv-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.sr-chart .cv-dot { stroke-width: 2; fill: var(--surface); }
.sr-chart-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; font-size: 11.5px; color: var(--mute); }
.sr-chart-legend .sr-sw span.d { width: 10px; height: 10px; }
.sr-chart-legend .sr-sw--veg  span.d { background: var(--accent); }
.sr-chart-legend .sr-sw--bare span.d { background: var(--warn); opacity: 0.75; }
.sr-chart-legend .sr-sw--iron span.d { background: var(--sun); }
.sr-chart-legend .sr-sw--red  span.d { background: #B23A47; }

.sr-recovery {
  margin-top: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.sr-recovery .sr-label { display: block; margin-bottom: 4px; }
.sr-recovery p { font-size: 13.5px; line-height: 1.55; color: var(--ink); }

/* Pathways */
.sr-pathways {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.sr-pathway {
  background: var(--surface); border: 1px solid var(--line);
  padding: 14px 16px;
}
.sr-pathway h4 {
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
}
.sr-pathway ul { font-size: 12.5px; color: var(--ink); line-height: 1.55; }
.sr-pathway li { padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.sr-pathway li:last-child { border-bottom: 0; }
.sr-pathway .sr-pathway-footer {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--mute); font-style: italic;
}
@media (max-width: 900px) { .sr-pathways { grid-template-columns: 1fr; } }

/* Around the site table */
.sr-around { font-size: 13px; }
.sr-around dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 0; }
.sr-around dt { color: var(--mute); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.sr-around dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.sr-wc-bar { display: flex; height: 8px; overflow: hidden; margin-top: 10px; border: 1px solid var(--line); }
.sr-wc-bar > span { display: block; }

/* Community empty state */
.sr-community {
  background: var(--surface); border: 1px solid var(--line);
  padding: 14px 16px;
  font-size: 13px; line-height: 1.55; color: var(--mute);
}

/* Action buttons row */
.sr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-abtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}
.sr-abtn:hover { background: var(--sand); }
.sr-abtn svg { width: 13px; height: 13px; }
.sr-abtn.is-done { background: var(--accent); color: #FFF; border-color: var(--accent); }

.sr-detail-foot {
  padding: 14px 22px; background: var(--paper);
  font-size: 11.5px; color: var(--mute); line-height: 1.55;
}

/* ─── Compare page ────────────────────────────────────────────── */
.sr-compare-wrap { padding: 20px; overflow-x: auto; }
.sr-compare-wrap h2 { margin-bottom: 6px; font-size: 20px; }
.sr-compare-wrap .sr-sect-note { margin-bottom: 16px; }
.sr-compare {
  width: 100%; min-width: 980px; border-collapse: collapse;
  font-size: 12.5px; background: var(--surface);
}
.sr-compare th, .sr-compare td {
  padding: 8px 10px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
.sr-compare th {
  background: var(--surface); color: var(--mute);
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.sr-compare td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
.sr-compare tr:hover td { background: var(--paper); }
.sr-compare-actions {
  display: flex; gap: 8px; margin-bottom: 18px;
}

/* ─── Content pages (method / data / about) ───────────────────── */
.sr-content {
  max-width: 760px; margin: 0 auto; padding: 32px 20px 48px;
}
.sr-content h1 { font-size: 32px; margin-bottom: 10px; line-height: 1.15; }
.sr-content h2 { font-size: 20px; margin: 28px 0 10px; }
.sr-content h3 { font-size: 15px; margin: 20px 0 8px; }
.sr-content p  { margin: 0 0 14px; font-size: 15px; line-height: 1.65; color: var(--ink); }
.sr-content ul, .sr-content ol { margin: 0 0 14px; padding-left: 1.2em; font-size: 15px; line-height: 1.65; color: var(--ink); }
.sr-content li { margin: 4px 0; }
.sr-content table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 13.5px; }
.sr-content th, .sr-content td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.sr-content th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); border-bottom: 1px solid var(--line); }
.sr-content code { font-family: var(--mono); font-size: 12.5px; background: var(--sand); padding: 1px 5px; }
.sr-content hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* Sheet handle and body shim: present in the DOM at every width so
   the mobile sheet rules can turn them on; hidden on desktop so they
   are a no-op. */
.sr-sheet-handle { display: none; }
.sr-col-left .sr-sheet-body,
.sr-col-detail .sr-sheet-body { display: contents; }

/* ─── Breakpoints ─────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .sr-map-page { grid-template-columns: 280px 1fr 380px; }
}
@media (max-width: 1024px) {
  /* Two-column with the detail panel wrapping below. Let the whole
     page scroll on this breakpoint so the stacked panels are
     reachable. */
  body.strata-standalone, body.strata-standalone #strata-root {
    height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible;
  }
  .sr-page { overflow: visible; }
  .sr-map-page {
    grid-template-columns: 260px 1fr;
    grid-template-rows: auto auto;
    height: auto; overflow: visible;
  }
  .sr-col-detail {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow-y: visible;
  }
  .sr-col-map { min-height: 56vh; }
  .sr-col-left { max-height: 70vh; }
  .sr-col { overflow: visible; }
  .sr-col-left, .sr-col-map { overflow: hidden; }  /* keep map crop + list scroll */
}
@media (max-width: 720px) {
  /* On phones, pin the whole app to the viewport again (no page
     scroll), hide the pilot banner, compress the topbar, and turn
     the left column into a bottom sheet that overlays the map. The
     map keeps the full remaining viewport under it. */
  body.strata-standalone,
  body.strata-standalone #strata-root {
    height: 100vh; height: 100dvh; min-height: 0;
    overflow: hidden;
  }
  .sr-topbar { padding: 10px 12px; }
  .sr-tabs { display: none; }
  .sr-brand-sub { display: none; }
  .sr-pilot-banner { display: none; }
  .sr-page { overflow: hidden; }

  .sr-map-page {
    display: block;
    position: relative;
    height: 100%;
    overflow: hidden;
  }
  .sr-map-page.no-detail { }

  .sr-col-map {
    position: absolute; inset: 0;
    border-right: 0; border-bottom: 0;
    min-height: 0;
    z-index: 1;
  }
  .sr-leaflet { position: absolute; inset: 0; }

  /* Floating sheet, overlays the bottom edge of the map. */
  .sr-col-left,
  .sr-col-detail {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 10;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-right: 0; border-bottom: 0; border-left: 0;
    box-shadow: 0 -6px 24px rgba(17, 17, 16, 0.14);
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: height .28s cubic-bezier(.3,.7,.3,1);
    will-change: height;
  }
  :root[data-theme="dark"] .sr-col-left,
  :root[data-theme="dark"] .sr-col-detail {
    box-shadow: 0 -6px 24px rgba(0,0,0,0.55);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sr-col-left,
    :root:not([data-theme="light"]) .sr-col-detail {
      box-shadow: 0 -6px 24px rgba(0,0,0,0.55);
    }
  }

  /* Three states */
  .sr-col-left.sr-sheet--peek,
  .sr-col-detail.sr-sheet--peek { height: 136px; }
  .sr-col-left.sr-sheet--half,
  .sr-col-detail.sr-sheet--half { height: 52vh; height: 52dvh; }
  .sr-col-left.sr-sheet--full,
  .sr-col-detail.sr-sheet--full { height: 92vh; height: 92dvh; }

  /* Grab handle at the top of the sheet */
  .sr-sheet-handle {
    position: relative;
    display: flex !important;      /* override desktop display:none */
    align-items: center; justify-content: center;
    padding: 10px 14px 6px;
    cursor: pointer;
    background: var(--surface);
    border-bottom: 1px solid var(--line-soft);
    user-select: none;
    touch-action: none;
  }
  .sr-sheet-handle::before {
    content: ""; width: 44px; height: 4px; border-radius: 2px;
    background: var(--line); display: block;
  }
  .sr-sheet-caption {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--mute); pointer-events: none;
  }
  .sr-sheet-close {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    border-radius: 0;
  }
  .sr-sheet-close svg { width: 14px; height: 14px; }
  .sr-sheet-close:hover { background: var(--sand); }

  /* Scrollable body under the handle */
  .sr-col-left .sr-sheet-body,
  .sr-col-detail .sr-sheet-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  .sr-col-left.sr-sheet--peek .sr-sheet-body,
  .sr-col-detail.sr-sheet--peek .sr-sheet-body {
    overflow: hidden;
  }

  /* Compress totals + filters inside the sheet */
  .sr-col-left .sr-facts { grid-template-columns: 1fr 1fr; }
  .sr-col-left .sr-fact { padding: 10px 14px; }
  .sr-col-left .sr-fact .sr-n { font-size: 18px; }
  .sr-col-left .sr-filters { padding: 12px 14px 10px; }
  .sr-col-left .sr-list-head { padding: 10px 14px; }
  .sr-col-left .sr-list { }
  .sr-col-left .sr-site-row { padding: 10px 14px; }

  /* Detail card inside the sheet */
  .sr-col-detail .sr-detail-head,
  .sr-col-detail .sr-sect,
  .sr-col-detail .sr-detail-foot {
    padding-left: 14px; padding-right: 14px;
  }
  .sr-col-detail .sr-detail-close { display: none; }   /* use the sheet handle's X */

  /* Map legend becomes a small corner badge on phones */
  .sr-map-legend {
    max-width: 48%; left: 10px; bottom: 160px;
    padding: 7px 10px; font-size: 10.5px;
    z-index: 5;
  }
  .sr-map-legend .sr-swatches { gap: 4px; }
  .sr-basemap-switch {
    top: 10px; right: 50px; left: auto;
    padding: 0;
  }
  .sr-basemap-switch button { padding: 5px 8px; font-size: 10px; }
  .sr-leaflet .leaflet-control-zoom { margin-top: 54px !important; }
}

/* ─── Live Sentinel-2 panel ───────────────────────────────────── */
.sr-live-panel {
  background: var(--sand);
  padding: 14px 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}
.sr-live-panel p { margin: 0 0 10px; }
.sr-live-panel p:last-child { margin-bottom: 0; }
.sr-live-panel strong { font-weight: 600; }
.sr-live-note {
  font-size: 11.5px; color: var(--mute); margin-top: 8px;
}
.sr-live-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--ink); color: var(--surface);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.sr-live-btn:hover { background: #000; color: #FFF; }
.sr-live-mini {
  padding: 4px 8px; margin-left: 8px;
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
}
.sr-live-mini:hover { background: var(--sand); }

.sr-live-loading .sr-live-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--ink);
  animation: sr-spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle; margin-right: 10px;
}
.sr-live-loading .sr-live-step { display: inline; vertical-align: middle; }
@keyframes sr-spin { to { transform: rotate(360deg); } }

.sr-live-err { background: #FBE8E0; border-color: #F5B9A3; }
:root[data-theme="dark"] .sr-live-err { background: #3A1E15; border-color: #6B2E1E; color: #F8C4B2; }

.sr-live-result { }
.sr-live-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.sr-live-head strong {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink); word-break: break-all;
}
.sr-live-meta {
  font-family: var(--mono); font-size: 11px; color: var(--mute);
  letter-spacing: 0.05em;
}

.sr-live-canvases {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 10px;
}
.sr-live-canvases figure {
  margin: 0; background: var(--paper); border: 1px solid var(--line);
  padding: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.sr-live-canvases canvas {
  background: #000; display: block;
  max-width: 100%; height: auto;
  image-rendering: pixelated;
}
.sr-live-canvases figcaption {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--mute);
  text-align: center;
}

.sr-live-legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  padding: 10px 14px; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px;
}
.sr-cls-sw { display: inline-flex; align-items: center; gap: 6px; }
.sr-cls-sw .d { width: 12px; height: 12px; display: inline-block; }

.sr-live-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 10px;
}
.sr-live-stats-col {
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
}
.sr-live-stats-col .sr-label { display: block; margin-bottom: 6px; }
.sr-live-stats-col dl {
  display: grid; grid-template-columns: 1fr auto;
  gap: 4px 10px; margin: 0; font-size: 12.5px;
}
.sr-live-stats-col dt { color: var(--mute); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.sr-live-stats-col dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }

@media (max-width: 760px) {
  .sr-live-canvases { grid-template-columns: 1fr; }
  .sr-live-stats { grid-template-columns: 1fr; }
}

/* ─── Leaflet integration ─────────────────────────────────────── */
.sr-leaflet { position: absolute; inset: 0; z-index: 1; }
.sr-leaflet .leaflet-control-attribution {
  background: rgba(255,255,255,0.85); color: var(--ink);
  font-family: var(--mono); font-size: 10px; padding: 2px 6px;
}
:root[data-theme="dark"] .sr-leaflet .leaflet-control-attribution,
:root:not([data-theme="light"]) .sr-leaflet .leaflet-control-attribution {
  background: rgba(17,17,16,0.85); color: var(--ink);
}
.sr-leaflet .leaflet-control-zoom a {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  width: 32px; height: 32px; line-height: 30px; font-size: 18px;
}
.sr-leaflet .leaflet-control-zoom a:hover { background: var(--sand); }
.sr-leaflet .leaflet-container {
  background: var(--sand);
  font-family: var(--sans);
}
/* Custom pin wrapper (made as a DivIcon via SVG). */
.sr-leaflet .sr-pin-wrap { }
.sr-leaflet .sr-pin-wrap--dim { opacity: 0.35; }
.sr-leaflet .sr-poly { }

/* Basemap switch (top-right of the map, left of Leaflet's zoom) */
.sr-basemap-switch {
  position: absolute; z-index: 1000;
  top: 10px; right: 50px;
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
}
.sr-basemap-switch button {
  padding: 6px 10px; font: inherit;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); background: var(--surface);
  border: 0; border-right: 1px solid var(--line); cursor: pointer;
}
.sr-basemap-switch button:last-child { border-right: 0; }
.sr-basemap-switch button:hover { background: var(--sand); }
.sr-basemap-switch button.is-on { background: var(--ink); color: var(--surface); }

/* Map legend is a floating card on top of the Leaflet layers */
.sr-map-legend { z-index: 1000; }

/* ─── Onboarding modal ────────────────────────────────────────── */
.sr-onboard {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(17, 17, 16, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.sr-onboard[hidden] { display: none; }
:root[data-theme="dark"] .sr-onboard { background: rgba(0, 0, 0, 0.72); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sr-onboard { background: rgba(0, 0, 0, 0.72); } }

.sr-onboard-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  padding: 28px 32px 24px;
  max-width: 680px; width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.sr-onboard-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: 1px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.sr-onboard-close:hover { background: var(--sand); }
.sr-onboard-close svg { width: 14px; height: 14px; color: var(--ink); }

.sr-onboard-kick {
  display: block; margin-bottom: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: var(--mute); text-transform: uppercase;
}
.sr-onboard-card h2 {
  font-size: 22px; line-height: 1.3; margin-bottom: 10px; font-weight: 600;
  color: var(--ink);
}
.sr-onboard-lead {
  font-size: 14px; line-height: 1.6; color: var(--ink); margin: 0 0 18px;
}
.sr-onboard-steps {
  display: grid; gap: 10px; margin: 0 0 20px;
}
.sr-onboard-step {
  display: grid; grid-template-columns: 32px 1fr; gap: 14px;
  padding: 12px 14px;
  background: var(--paper); border: 1px solid var(--line-soft);
}
.sr-onboard-step strong { color: var(--ink); font-weight: 600; }
.sr-onboard-step div { font-size: 13px; line-height: 1.55; color: var(--ink); }
.sr-onboard-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; font-family: var(--mono); font-size: 13px; font-weight: 600;
  background: var(--ink); color: var(--surface);
}

.sr-onboard-legend {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  padding: 12px 14px; margin: 10px 0 20px;
  background: var(--paper); border: 1px solid var(--line-soft);
  font-size: 12px;
}
.sr-onboard-sw { display: inline-flex; align-items: center; gap: 6px; }
.sr-onboard-sw .d { width: 12px; height: 12px; display: inline-block; }

.sr-onboard-pilot {
  padding: 12px 14px; margin: 0 0 20px;
  background: var(--sand); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.55;
}
.sr-onboard-pilot strong { font-weight: 600; }

.sr-onboard-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.sr-abtn-primary {
  background: var(--ink); color: var(--surface); border-color: var(--ink);
}
.sr-abtn-primary:hover { background: #000; color: #FFF; }
:root[data-theme="dark"] .sr-abtn-primary,
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sr-abtn-primary { background: var(--ink); color: #111110; border-color: var(--ink); } }

@media (max-width: 600px) {
  .sr-onboard-card { padding: 22px 20px 20px; max-height: calc(100vh - 24px); }
  .sr-onboard-card h2 { font-size: 18px; }
}

/* ─── Audiences / Partners / Pathways / Communities / Pipeline ── */
.sr-content-wide { max-width: 1080px; }
.sr-lede {
  font-size: 16px; line-height: 1.6; color: var(--ink);
  margin: 0 0 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.sr-aud-grid, .sr-path-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin: 0 0 28px; }
@media (max-width: 900px) { .sr-aud-grid, .sr-path-grid { grid-template-columns: 1fr; } }
.sr-aud, .sr-path {
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line);
}
.sr-aud .sr-aud-kick, .sr-aud .sr-aud-ex { display: block; }
.sr-aud .sr-aud-kick { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.sr-aud h3, .sr-path h4 { font-size: 15px; margin-bottom: 8px; }
.sr-aud p, .sr-path p { font-size: 13.5px; line-height: 1.55; color: var(--ink); margin: 0 0 10px; }
.sr-aud p:last-child, .sr-path p:last-child { margin-bottom: 0; }
.sr-aud .sr-aud-ex {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--mute);
}

.sr-partners { display: grid; gap: 14px; margin: 0 0 28px; }
.sr-partner {
  padding: 16px 20px; background: var(--surface); border: 1px solid var(--line);
}
.sr-partner h3 {
  font-size: 16px; margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.sr-partner-role {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mute); font-weight: 400;
}
.sr-partner p { font-size: 13.5px; line-height: 1.6; color: var(--ink); margin: 0; }

/* Communities page */
.sr-com {
  padding: 20px 22px; margin: 0 0 20px;
  background: var(--surface); border: 1px solid var(--line);
}
.sr-com header .sr-label { display: block; margin-bottom: 6px; }
.sr-com header h2 { font-size: 20px; margin-bottom: 6px; }
.sr-com-meta { color: var(--mute); font-size: 13px; margin: 0 0 16px; }
.sr-com-sect { margin: 0 0 18px; }
.sr-com-sect .sr-label { display: block; margin-bottom: 6px; }
.sr-com-sect p { font-size: 13.5px; line-height: 1.6; margin: 0 0 6px; }
.sr-com-sect ul { margin: 0; padding-left: 20px; }
.sr-com-sect li { margin: 4px 0; font-size: 13.5px; line-height: 1.5; }
.sr-com-paths {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.sr-com-paths .sr-label { grid-column: 1 / -1; }
.sr-com-path {
  padding: 10px 12px; background: var(--paper); border: 1px solid var(--line-soft);
}
.sr-com-path h4 { font-size: 12px; margin-bottom: 4px; }
.sr-com-path p { font-size: 12px; line-height: 1.5; color: var(--ink); margin: 0; }
.sr-com-foot {
  padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 12px; color: var(--mute);
}
.sr-s2-plan { background: var(--sand); padding: 20px 22px; border: 1px solid var(--line); margin: 0 0 20px; }
.sr-s2-plan h2 { margin: 0 0 10px; font-size: 17px; }
.sr-s2-plan ul { margin: 0; padding-left: 20px; }
.sr-s2-plan li { font-size: 13.5px; line-height: 1.6; margin: 4px 0; }
@media (max-width: 760px) { .sr-com-paths { grid-template-columns: 1fr; } }

/* Pipeline page */
.sr-pipe {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px; align-items: stretch;
  margin: 10px 0 32px;
}
.sr-pipe-col {
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.sr-pipe-arrow {
  align-self: center; font-family: var(--mono); font-size: 22px; color: var(--mute);
  padding: 0 6px;
}
.sr-pipe-kick {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute); display: block;
}
.sr-pipe-box {
  padding: 10px 12px; background: var(--paper); border: 1px solid var(--line);
}
.sr-pipe-box h3 { font-family: var(--mono); font-size: 13px; margin-bottom: 6px; letter-spacing: 0.02em; }
.sr-pipe-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent); color: #FFFFFF;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 8px;
}
:root[data-theme="dark"] .sr-pipe-badge,
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sr-pipe-badge { color: #0b0b0b; } }
.sr-pipe-list { margin: 0; padding-left: 20px; }
.sr-pipe-list li { font-size: 12.5px; line-height: 1.5; margin: 6px 0; color: var(--ink); }
.sr-pipe-list li span { color: var(--mute); font-size: 11.5px; display: block; }
.sr-pipe-ol { padding-left: 20px; }

@media (max-width: 980px) {
  .sr-pipe {
    grid-template-columns: 1fr;
  }
  .sr-pipe-arrow { align-self: center; transform: rotate(90deg); padding: 0; }
}
