/* Burn scars — the app layer on top of the EOCube Design System (src/vendor/eocube: tokens.css, eo.css).
   Tokens only: no literal colour or length outside the spacing/radius/size tokens except small optical values.
   Rules marked `→ ds` exist only because the system lacks the pattern; `grep -n '→ ds' src/app.css` is the list to
   raise on rocs/ui/design-system. */

/* The binary burn-scar detection colour (perimeters, clusters, thumbnails, burn mask). Theme-aware on purpose
   (decision D1, MR !6); → ds: a constant `burn-mask` class token would replace it. */
:root { --fire: var(--danger); }

/* ── page & shell ── */
[hidden] { display: none !important; } /* eo.css components set display (callouts: flex), which would beat the attribute */
html, body { height: 100%; margin: 0; overflow: hidden; }
.eo-shell-body { min-height: 0; }
main.eo-map { min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; z-index: var(--z-map); background: var(--surface-3); } /* its own stacking context, under the map controls */
#map:focus-visible { outline: none; box-shadow: var(--focus-ring) inset; }
.eo-header .eo-brand img { width: auto; }
/* → ds: a partner mark on the header band (the Logos README: partner marks always sit on logo-plate); hidden with the product name under bp-nav. */
.eo-header .eo-brand-partner { height: 36px; padding: 0 var(--space-2); display: grid; place-items: center; background: var(--logo-plate); border-radius: var(--radius-sm); margin-left: var(--space-2); }
.eo-header .eo-brand-partner img { height: 28px; width: auto; display: block; }
.eo-header .eo-product { color: var(--on-brand); text-decoration: none; white-space: nowrap; }
.eo-header .eo-product:hover { text-decoration: underline; }
.eo-header .eo-hbtn[aria-pressed="true"] { background: var(--brand-navy-hover); }
.eo-header #lang { font-size: 12px; font-weight: 600; letter-spacing: .04em; }

/* ── sidebar ── */
.eo-sidebar .views { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.views .eo-btn-group { display: flex; }
.views .eo-btn-group .eo-btn { flex: 1 1 0; }
.pv { display: none; }
body[data-view="fires"] .pv[data-view="fires"], body[data-view="data"] .pv[data-view="data"], body[data-view="settings"] .pv[data-view="settings"] { display: block; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.sec-head .eo-label { margin: 0; }
.sidebar-actions { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: var(--space-3) var(--space-4); background: var(--surface); border-top: 1px solid var(--border); }
.sidebar-actions .eo-btn { width: 100%; }

/* segmented radio groups keep native radios (the viewer reads them); → ds: the system's group is aria-pressed buttons */
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg .eo-btn { position: relative; }
.seg .eo-btn:has(> input:checked) { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); z-index: 1; }
.seg .eo-btn:has(> input:focus-visible) { box-shadow: var(--focus-ring); z-index: 2; }

/* place: search + region */
.place { gap: var(--space-2); }
.search { position: relative; }
.search eo-icon { position: absolute; left: 10px; top: 9px; color: var(--ink-muted); pointer-events: none; }
.search .eo-input { padding-left: 34px; }
.search-results { position: absolute; z-index: var(--z-popover); left: 0; right: 0; top: calc(100% + var(--space-1)); display: none; max-height: 260px; overflow: auto; padding: var(--space-1) 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.search-results.open { display: block; }
.search-results button { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; padding: var(--space-2) var(--space-3); border: 0; background: none; color: var(--ink); cursor: pointer; }
.search-results button:hover, .search-results button:focus-visible { background: var(--surface-2); }
.search-results .hint { padding: var(--space-2) var(--space-3); font-size: 12px; color: var(--ink-muted); }
.county-note { font-size: 13px; line-height: 20px; }

/* filters */
.filters { display: grid; gap: var(--space-3); }
.filters .sec-head { margin-bottom: 0; }
.chips { gap: 6px; }
.hist-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.hist { width: 100%; height: 72px; display: block; touch-action: none; cursor: crosshair; user-select: none; }
.hist rect.bar { fill: var(--data-1); opacity: .35; }
.hist rect.bar.in { opacity: 1; }
.hist rect.bar.hot { fill: var(--accent); opacity: 1; }
.hist .brush { fill: var(--accent-tint); }
.hist .axis { stroke: var(--border); stroke-width: 1; }
.hist text { font-family: var(--font-mono); font-size: 10px; fill: var(--ink-muted); }
.hist .asof { stroke: var(--brand-teal); stroke-width: 2; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.dates .eo-input { padding: 0 var(--space-2); }
.eo-field > label.with-value, .eo-field > .field-label { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.eo-field .eo-btn-group { display: flex; }
.eo-field .eo-btn-group .eo-btn { flex: 1 1 auto; }

/* fire list (compact STAC item cards) */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.list-head b { font-weight: 600; }
.eo-select.sort { width: auto; height: var(--control-height-sm); font-size: 13px; }
.cards { display: grid; gap: var(--space-2); }
.fire.eo-item-compact { position: relative; grid-template-columns: 72px minmax(0, 1fr); align-items: center; padding: var(--space-2); }
.fire.hover { border-color: var(--border-strong); background: var(--surface-2); }
.fire .eo-item-id { padding-right: var(--control-height-sm); font-family: var(--font-sans); font-size: 14px; }
.fire .eo-item-id b { font-weight: 600; font-variant-numeric: tabular-nums; }
.fire .eo-item-coll { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fire .eo-item-coll .eo-code-sm { color: var(--ink-2); }
.fire .cmp-btn { position: absolute; top: var(--space-1); right: var(--space-1); }
.fire .eo-item-meta { gap: var(--space-1); }
.fire .eo-chip .eo-dot { animation: none; }
.thumb { position: relative; }
.thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb svg path, .thumb svg circle { fill: color-mix(in srgb, var(--fire) 30%, transparent); stroke: var(--fire); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.thumb svg path.x { fill: none; stroke-width: 2; }
.load-more { padding-top: var(--space-2); }
.load-more .eo-btn { width: 100%; }
.empty { padding: var(--space-4) 0; display: grid; gap: var(--space-2); justify-items: start; }
.empty h3, .empty p { margin: 0; }

/* data & settings views */
.src-alert { margin-bottom: var(--space-3); font-size: 13px; line-height: 20px; }
.source-pop { display: grid; min-width: 0; }
.source-pop .eo-label { margin-bottom: var(--space-1); }
.src-item { display: grid; gap: var(--space-1); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); min-width: 0; }
.src-item:last-child { border-bottom: 0; }
.src-head { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; font-size: 13px; }
.src-head b { font-weight: 600; }
.src-url { color: var(--ink-muted); overflow-wrap: anywhere; }
.src-cols { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.src-cols code { font-size: 11px; background: var(--surface-2); padding: 1px 6px; border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.pv .eo-caption { margin: 0; }
.setting { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-height); cursor: pointer; }
.setting .lbl { display: grid; }

/* ── map chrome ── */
.map-progress { position: absolute; z-index: var(--z-map-controls); top: 0; left: 0; right: 0; height: 4px; border-radius: 0; background: var(--accent-tint); }
.map-progress[hidden] { display: none; }
.map-progress[data-det] > span { animation: none; transform: none; width: var(--p, 0%); } /* row groups loaded / total while the fires parquet streams */
.map-tr { position: absolute; z-index: var(--z-map-controls); display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.source { height: var(--control-height-sm); padding: 0 var(--space-3); font-size: 13px; cursor: pointer; box-shadow: var(--shadow-md); font-family: inherit; }
.map-tr .eo-map-readout { position: static; }
/* OpenLayers: controls: [] except the ScaleLine, which renders into the MapToolbar's scale slot */
.eo-map .ol-scale-line { position: static; background: transparent; padding: 0; border-radius: 0; }
.eo-map .ol-scale-line-inner { border: 2px solid var(--ink); border-top: 0; color: var(--ink); font-family: var(--font-sans); font-size: 11px; line-height: 1; padding-top: 2px; text-align: center; text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface); }
.eo-map-scale { flex-wrap: wrap; }
.frame .ol-scale-line { background: color-mix(in srgb, var(--brand-navy) 85%, transparent); border-radius: var(--radius-sm); padding: 2px 4px; bottom: var(--space-2); left: var(--space-2); }
.frame .ol-scale-line-inner { border-color: var(--on-brand); color: var(--on-brand); font-family: var(--font-sans); font-size: 11px; }
.eo-map-tip { background: var(--ink); color: var(--surface); font-family: var(--font-sans); font-size: 12px; line-height: 16px; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); white-space: nowrap; pointer-events: none; }
.map-legend { position: absolute; z-index: var(--z-map-controls); width: auto; max-width: 300px; }
.map-legend .eo-panel-body { padding: var(--space-2) var(--space-3); }
.map-legend .eo-legend-classes { grid-template-columns: 14px 1fr; }
.map-legend .eo-legend-classes > span:nth-child(3n) { display: none; }
.sw-perimeter { background: color-mix(in srgb, var(--fire) 22%, transparent); border: 2px solid var(--fire) !important; }
.sw-mask { background: var(--fire); }
.sw-window { background: transparent; border: 1px dashed var(--map-footprint) !important; }
.source .eo-icon { width: 14px; height: 14px; }

/* ── dialogs (native <dialog> + showModal: Esc, focus trap and inertness for free) ── */
/* eo.css gives .eo-dialog display:flex, which beats the UA's dialog:not([open]) rule */
dialog.eo-dialog:not([open]) { display: none; }
dialog.eo-dialog { padding: 0; margin: auto; width: calc(100vw - 2 * var(--space-4)); max-height: calc(100vh - 2 * var(--space-4)); }
dialog.eo-dialog::backdrop { background: color-mix(in srgb, var(--brand-navy) 55%, transparent); }
dialog.eo-dialog .eo-dialog-head .eo-btn { margin-left: 0; }
dialog.eo-dialog .eo-dialog-head .eo-spacer { flex: 1; }
.eo-dialog-head h2 { margin: 0; }

/* compare: wider than eo-dialog-wide so three square frames stay readable (→ ds: a full-bleed comparison dialog) */
dialog.cmp { max-width: 1440px; height: calc(100vh - 2 * var(--space-4)); }
.cmp .eo-dialog-head { flex-wrap: wrap; row-gap: var(--space-1); }
.cmp-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr); gap: var(--space-3) var(--space-4); overflow: hidden; padding: var(--space-3) var(--space-5); }
.cmp-tools { grid-column: 1; gap: var(--space-3); }
.cmp-tools .pair { display: none; gap: var(--space-2); }
.cmp-tools .pair .eo-select { width: auto; height: var(--control-height-sm); font-size: 13px; }
dialog.cmp[data-mode="swipe"] .pair { display: flex; }
.cmp-stage { grid-column: 1; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.cmp-meta { grid-column: 2; grid-row: 1 / -1; min-height: 0; overflow: auto; display: grid; gap: var(--space-3); align-content: start; }
.cmp-meta .eo-card { padding: var(--space-3); }
.cmp-meta .eo-kv dd { overflow-wrap: anywhere; }
.frames { display: grid; gap: var(--space-3); grid-auto-flow: column; grid-auto-columns: var(--fs, 300px); grid-auto-rows: var(--fs, 300px); }
.frame { position: relative; background: var(--surface-3); border-radius: var(--radius-md); overflow: hidden; }
.frame-map { position: absolute; inset: 0; }
/* captions sit on imagery: the navy band colours are constant in both themes */
.stamp, .unavail, .side-label { position: absolute; z-index: 700; pointer-events: none; padding: var(--space-1) var(--space-2); background: color-mix(in srgb, var(--brand-navy) 85%, transparent); color: var(--on-brand); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px; line-height: 18px; }
.stamp { left: var(--space-2); top: var(--space-2); display: flex; gap: var(--space-2); align-items: baseline; }
.stamp b { font-family: var(--font-sans); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.stamp .rel.pos::before { content: "+"; }
.unavail { right: var(--space-2); bottom: var(--space-2); display: none; font-family: var(--font-sans); }
.frame.unavailable .unavail { display: block; }
.unavail .mono { display: block; font-family: var(--font-mono); font-size: 11px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.side-label { bottom: var(--space-2); font-family: var(--font-sans); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
.side-label { top: var(--space-2); bottom: auto; } .side-label.l { left: var(--space-2); } .side-label.r { right: var(--space-2); } /* the scale bar owns the bottom-left corner */
.divider { position: absolute; z-index: 750; background: var(--on-brand); box-shadow: 0 0 0 1px var(--brand-navy); cursor: ew-resize; touch-action: none; }
.divider.v { top: 0; bottom: 0; width: 2px; left: 50%; }
.divider.h { left: 0; right: 0; height: 2px; top: 50%; cursor: ns-resize; }
.divider::after { content: ""; position: absolute; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-navy); border: 2px solid var(--on-brand); left: 50%; top: 50%; transform: translate(-50%, -50%); }
.divider span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--on-brand); font-size: 14px; font-weight: 700; line-height: 1; z-index: 1; }
.prov summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.prov .eo-kv { margin-top: var(--space-2); font-size: 12px; }
.cmp-foot { justify-content: space-between; flex-wrap: wrap; align-items: center; }
.cmp-foot kbd { font-size: 11px; padding: 0 5px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* about */
.about .eo-dialog-body > * { margin: 0; }
.about-logo { height: 44px; width: auto; align-self: flex-start; }
.about-partners { display: flex; flex-wrap: wrap; gap: var(--space-3); }
/* → ds: partner plates exist only inside .eo-footer; map apps put them in the About dialog */
.about-partners .plate { height: 44px; min-width: 72px; padding: 0 var(--space-3); display: grid; place-items: center; background: var(--logo-plate); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.about-partners .plate img { height: 28px; width: auto; max-width: 140px; display: block; }
.about-partners .plate img[src$="hria.png"] { height: 32px; }

/* ── narrow screens (eo.css turns the sidebar into a 40vh strip under the map below 900px) ── */
@media (max-width: 899px) {
  .map-legend { display: none; }
  /* the header fits from 720px (bp-nav): About becomes icon-only and the current-page link goes (the product name links there too) */
  .eo-header .about-label { display: none; }
  .eo-header nav a[aria-current="page"] { display: none; }
  .eo-header { gap: var(--space-3); }
  /* the status pill starts right of the map toolbar instead of covering its first button */
  .map-tr { left: calc(2 * var(--space-3) + var(--control-height) + 2px); }
  .source { max-width: 100%; height: auto; min-height: var(--control-height-sm); padding-block: var(--space-1); text-align: left; }
  .source #sourceLabel { min-width: 0; white-space: normal; line-height: 16px; } /* wraps rather than hiding the fire count */

  /* compare goes full screen: the frames share whatever height is left after the head, the tools and a short
     facts strip, so nothing overlaps and no page scroll competes with panning the maps (→ ds: full-screen dialog) */
  dialog.cmp { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .cmp .eo-dialog-head { gap: var(--space-1) var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); font-size: 16px; }
  .cmp .eo-dialog-head h2 { font-size: 20px; line-height: 28px; }
  .cmp #cmpTags { order: 1; flex: 1 0 100%; } /* chips on their own line; title, date and the buttons share the first */
  .cmp-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2) var(--space-3); overflow: hidden; }
  .cmp-tools { flex: none; flex-wrap: wrap; row-gap: var(--space-2); }
  .cmp-tools .pair { flex-wrap: wrap; }
  #cmpHint { display: none; }
  .cmp-stage { flex: 1 1 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: stretch; min-height: 0; }
  .frames { min-height: 0; gap: var(--space-2); grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); grid-auto-columns: auto; }
  .cmp-meta { flex: 0 1 auto; max-height: 30%; overflow: auto; overscroll-behavior: contain; }
  .cmp-meta .eo-card { padding: var(--space-2) var(--space-3); }
  .stamp { padding: 2px var(--space-2); font-size: 11px; line-height: 16px; }
  .stamp > * { white-space: nowrap; }
  .cmp-foot { padding: var(--space-2) var(--space-3); }
  .cmp-foot .kbd { display: none; }
}
/* phones held sideways: frames side by side, facts in a column on the right */
@media (max-width: 899px) and (orientation: landscape) {
  .cmp .eo-dialog-head { flex-wrap: nowrap; }
  .cmp #cmpTags { order: 0; flex: 0 1 auto; min-width: 0; overflow: hidden; }
  .cmp-body { display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: auto minmax(0, 1fr); }
  .cmp-stage { grid-column: 1; }
  .cmp-meta { grid-column: 2; grid-row: 1 / -1; max-height: none; }
  .frames { grid-auto-flow: column; grid-template-columns: none; grid-template-rows: minmax(0, 1fr); grid-auto-columns: minmax(0, 1fr); }
}
@media (hover: none) { .cmp-foot .kbd { display: none; } } /* keyboard shortcuts mean nothing on touch */
@media (max-width: 719px) { .eo-header .eo-brand-partner { display: none; } }
@media (max-width: 639px) {
  .eo-header { gap: var(--space-2); padding: 0 var(--space-3); }
  .eo-header .eo-product { padding-left: var(--space-2); }
}
