:root {
  --bg: #ffffff;
  --surface: #f6f5f2;
  --text: #1f2328;
  --muted: #5f6670;
  --line: #e2e0da;
  --accent: #1d4ed8;
  --low: #2f7d4f;
  --moderate: #a86a00;
  --high: #b42318;
  --radius: 10px;
  --panel-width: 420px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; overflow: hidden; }

#panel {
  width: var(--panel-width);
  max-width: 100%;
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  /* Keep the selected pale green background across the entire information panel. */
  background: #eff1ec;
  padding: 20px 20px 40px;
  z-index: 2;
}
#map { flex: 1; height: 100%; }

.brand h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.brand-home { display: block; width: fit-content; max-width: 100%; }
.brand-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* Transparent logo from the supplied artwork, without the tagline; preserve its proportions. */
.brand-logo { display: block; width: 280px; max-width: 100%; height: auto; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.coverage { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.search { position: relative; margin: 16px 0 8px; }
#search-input {
  width: 100%; font-size: 16px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius); outline: none;
}
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15); }
#search-results {
  list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; z-index: 5;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); max-height: 320px; overflow-y: auto;
}
#search-results li { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
#search-results li[aria-selected="true"], #search-results li:hover { background: var(--surface); }
#search-results .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.message { font-size: 13px; color: var(--muted); background: var(--surface); padding: 10px 12px; border-radius: 8px; }
.message.error { color: var(--high); }

section { border-top: 1px solid var(--line); padding: 16px 0 4px; }
section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.intro { border-top: none; font-size: 14px; line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.parcel-title { font-size: 18px; font-weight: 600; margin: 8px 0 2px; }
.parcel-sub { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.example-buttons, .report-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.example-buttons button, .report-actions button {
  font: inherit; font-size: 12px; color: var(--accent); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; cursor: pointer;
}
.example-buttons button:hover, .report-actions button:hover { background: var(--surface); }
.example-buttons button:focus-visible, .report-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#examples { margin: 16px 0; }
#examples h2 { display: inline; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: normal; }
#share-message input { display: block; width: 100%; margin-top: 6px; font: inherit; padding: 6px; }
.interpretation { font-size: 14px; line-height: 1.5; margin: 8px 0 12px; }

/* Four primary values stay together in the desktop panel and on narrow screens.
   Allow long labels and acreage values to wrap within their own grid cell. */
.parcel-summary { border-top: none; padding: 6px 0 16px; }
.parcel-summary h2 { margin-bottom: 8px; }
.summary-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.summary-metric { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.summary-metric dt { min-height: 2.6em; font-size: 12px; font-weight: 500; line-height: 1.3; }
.summary-metric dd { margin: 6px 0 0; font-size: 26px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary-primary dd { font-size: 36px; letter-spacing: -0.02em; }
.summary-unit { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: normal; }
.summary-area dd { font-size: 20px; line-height: 1.3; }
.summary-unavailable { color: var(--muted); font-size: 16px; font-weight: 400; }
.summary-caption { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.3; }
.summary-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); }
.scale { position: relative; height: 10px; border-radius: 5px; margin: 12px 0 4px; display: flex; overflow: hidden; }
.scale span { flex: 1; }
.scale-marker { position: relative; height: 0; }
.scale-marker i { position: absolute; top: -18px; width: 3px; height: 16px; background: var(--text); border-radius: 2px; transform: translateX(-1px); }
.scale-marker .range { position: absolute; top: -16px; height: 14px; min-width: 2px; border: 1.5px solid var(--text); border-radius: 4px; background: rgba(255, 255, 255, 0.3); }
.scale-marker .median { position: absolute; top: -16px; width: 1px; height: 14px; background: var(--text); }
.scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

.metric { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.metric:last-child { border-bottom: none; }
.metric .label { font-weight: 500; }
.metric .note { color: var(--muted); font-size: 12px; margin-top: 2px; }
/* Agency names and multiple bordering owners must fit narrow parcel reports too. */
.metric .num { font-weight: 600; min-width: 0; max-width: 60%; flex-shrink: 0; overflow-wrap: anywhere; text-align: right; }

.factor { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.factor:last-of-type { border-bottom: none; }
.factor .row { display: flex; align-items: center; gap: 8px; }
.factor .arrow { font-weight: 700; width: 16px; text-align: center; }
.factor .arrow.up { color: var(--high); }
.factor .arrow.down { color: var(--low); }
.bar { position: relative; height: 6px; background: var(--surface); border-radius: 3px; margin: 6px 0 4px 24px; }
.bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #9aa0a6; }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.bar i.up { left: 50%; background: #e34a33; }
.bar i.down { right: 50%; background: #5b9a72; }
.factor .note { margin-left: 24px; color: var(--muted); font-size: 12px; }
.factor .note.unstable { color: var(--moderate); }
/* Embedding models: landscape pattern and terrain subsections; terrain components sit under the terrain total. */
section h3 { font-size: 14px; font-weight: 600; margin: 12px 0 0; }
.factor.component { margin-left: 24px; font-size: 13px; }

.level { font-weight: 700; }
.level.low { color: var(--low); }
.level.moderate { color: var(--moderate); }
.level.high { color: var(--high); }
.component { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.component:last-of-type { border-bottom: none; }
.component .row { display: flex; justify-content: space-between; gap: 12px; }
.component p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.callout { background: var(--surface); padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; margin: 10px 0; }

ul.fires { list-style: none; padding: 0; margin: 4px 0 8px; font-size: 14px; }
ul.fires li { padding: 5px 0; }
ul.fires .row { display: flex; justify-content: space-between; gap: 12px; }
ul.fires .num { font-weight: 600; white-space: nowrap; }
ul.fires .note { color: var(--muted); font-size: 12px; margin-top: 1px; }
details ul.fires { color: var(--text); }
details { margin: 8px 0; font-size: 13px; }
details summary { cursor: pointer; color: var(--accent); }
details table { width: 100%; border-collapse: collapse; margin-top: 6px; }
details td { padding: 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
details td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.map-card {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 250px;
  max-height: calc(100% - 24px); overflow-y: auto;
  background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; font-size: 13px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.map-card h2 { display: inline; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0; }
.map-card summary { cursor: pointer; margin-bottom: 6px; }
.map-card:not([open]) summary { margin-bottom: 0; }
.map-card label { display: flex; gap: 6px; align-items: center; padding: 3px 0; cursor: pointer; }
.map-card label[hidden] { display: none; }
#legend { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
#legend .item { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
#legend .swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.1); }
#legend .title { font-weight: 600; margin: 6px 0 2px; }
#legend .swatch.line { height: 0; border: 0; border-top: solid #4b5563; border-radius: 0; }

.maplibregl-popup-content { font-size: 13px; }
.hover .maplibregl-popup-content { padding: 4px 8px; font-size: 12px; pointer-events: none; }
.hover .maplibregl-popup-tip { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 760px) {
  body { flex-direction: column-reverse; }
  #panel { width: 100%; height: 55%; border-right: none; border-top: 1px solid var(--line); padding: 16px; }
  #map { height: 45%; flex: none; }
  .map-card { width: 200px; max-height: calc(45% - 16px); font-size: 12px; top: 8px; right: 8px; padding: 8px 10px; }
}

/* Print the complete report as flowing text, independent of the screen's panel/map layout.
   Disclosure contents are opened by the browser print events in app.js, including Ctrl/Cmd+P. */
@media print {
  @page { margin: 16mm; }
  html, body { display: block; height: auto; overflow: visible; }
  #panel { width: 100%; max-width: none; height: auto; overflow: visible; padding: 0; border: 0; }
  #map, #layers, .search, #examples, .report-actions, #share-message { display: none !important; }
  :root { --muted: #444; }
  .brand { margin-bottom: 16px; }
  .parcel-title { font-size: 22px; }
  section { padding-top: 12px; }
  section h2, section h3, .parcel-title { break-after: avoid; }
  .parcel-summary { break-inside: avoid; }
  .metric, .factor, .component, .callout, ul.fires li, tr { break-inside: avoid; }
  p { orphans: 3; widows: 3; }
  details summary { color: var(--text); cursor: default; }
  details summary::marker { content: ""; }
  details summary::-webkit-details-marker { display: none; }
  .scale, .scale-marker, .chip, .bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .small, .component p, .metric .note, .factor .note, ul.fires .note { font-size: 10pt; }
}
