:root {
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6b6a66;
  --line: rgba(11, 11, 11, 0.12);
  --accent: #2a5db0;
  --radius: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #e9edf0;
}
#map { position: absolute; inset: 0; z-index: 0; }

#panel, #layers, #bar {
  position: absolute;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  max-width: 340px;
}
#panel { top: 12px; left: 12px; max-width: 360px; max-height: calc(100% - var(--legend-h, 160px) - var(--legend-bottom, 28px) - 28px); overflow-y: auto; }
#bar { bottom: 12px; left: 12px; right: 56px; max-width: none; display: flex; align-items: flex-start; gap: 8px 28px; padding: 10px 14px; }
#bar .meta { margin: 0; flex: 0 1 auto; min-width: 0; }
#legend { flex: 1; min-width: 0; max-width: 560px; }
#layers {
  top: 12px; right: 12px; width: 230px; padding: 8px 6px;
  max-height: calc(100% - var(--legend-h, 120px) - var(--legend-bottom, 12px) - 36px); overflow-y: auto;
}
#layers h2 { font-size: 12px; font-weight: 400; color: var(--ink-3); margin: 2px 8px 4px; }
#overlays-title { margin-top: 10px !important; }
.layer-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px;
  background: none; font: inherit; font-size: 13px; text-align: left; color: var(--ink); cursor: pointer;
}
.layer-row:hover { background: rgba(11, 11, 11, 0.05); }
.layer-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.layer-row[aria-checked="true"] { background: #e6edf8; color: var(--accent); }
.layer-row.away { color: var(--ink-3); }
.layer-mark { flex: none; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 50%; }
.layer-row[role="switch"] .layer-mark { border-radius: 3px; }
/* An overlay switched on shows it by its mark only: the highlighted row is the one layer under it. */
.layer-row[role="switch"][aria-checked="true"] { background: none; color: var(--ink); }
.layer-row[role="switch"][aria-checked="true"].away { color: var(--ink-3); }
.layer-row[role="switch"][aria-checked="true"] .layer-mark { box-shadow: inset 0 0 0 2px var(--surface); }
.layer-row[aria-checked="true"] .layer-mark { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px #e6edf8; }
.layer-reach { margin-left: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.layers-toggle { display: none; }
.place { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin: 6px 0 8px; font-size: 15px; }
.place .link-button { margin-left: 0; }
.link-button { margin-left: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; }
#toast {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); max-width: min(440px, calc(100% - 32px));
  margin: 0; padding: 7px 12px; border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 13px;
  pointer-events: none; z-index: 3;
}

h1 { font-size: 20px; font-weight: 600; margin: 0; }
.title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lang-switch { font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; cursor: pointer; }
.title-actions { display: flex; gap: 6px; flex-shrink: 0; }
#about, #explain {
  width: calc(100% - 32px); max-width: 560px; max-height: calc(100% - 32px); padding: 0; overflow-y: auto;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
#about::backdrop, #explain::backdrop { background: rgba(11, 11, 11, 0.35); }
.about-head {
  position: sticky; top: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 14px 16px 8px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.about-head h2 { margin: 0; font-size: 18px; }
#about-body, #explain-body { padding: 0 16px 16px; font-size: 14px; }
#about-body h3, #explain-body h3 { margin: 14px 0 4px; font-size: 14px; }
#about-body p, #about-body ul { margin: 0; }
#about-body ul { padding-left: 18px; }
#about-body li + li { margin-top: 4px; }
#about-body a, #explain-body a { color: var(--accent); }
/* An explained phenomenon: its paragraphs, days of the archive that show it, then the other phenomena. */
#explain-body > p { margin: 10px 0 0; line-height: 1.5; }
.explain-examples { margin: 12px 0 0; padding: 0; list-style: none; }
.explain-examples li { padding: 8px 10px; border-radius: var(--radius); background: rgba(11, 11, 11, 0.04); }
.explain-examples li + li { margin-top: 6px; }
.explain-examples p { margin: 0 0 4px; font-size: 13px; line-height: 1.45; }
.explain-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.explain-list .lang-switch { font-weight: 400; }
.why-more { margin-left: 4px; font-size: 12px; white-space: nowrap; }
.meta { margin: 0 0 10px; font-size: 14px; }
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fbf1d3;
  color: #5c4500;
  font-size: 13px;
  cursor: help;
}
.badge.final { background: #e1f3e1; color: #1d4d1d; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.day-nav { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.day-nav button { font: inherit; color: var(--ink); background: transparent; cursor: pointer; }
.day-step {
  width: 26px; height: 26px; padding: 0; font-size: 16px; line-height: 1;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.day-step:disabled { color: var(--ink-3); cursor: default; opacity: 0.5; }
.day-pick { border: 0; padding: 2px 4px; text-decoration: underline dotted; text-underline-offset: 3px; }
.day-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The native date picker opens from the date button; the field itself stays out of sight under it. */
#day-input { position: absolute; left: 30px; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; pointer-events: none; }

.panel-more { display: block; margin: 0 0 0 auto; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.panel-more::after { content: " ▾"; }
.panel-more[aria-expanded="true"]::after { content: " ▴"; }
.segmented { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented button {
  flex: 1;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.segmented button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Folded, the report keeps its title and sea; the rest is for the reader to open. */
#panel.folded #summary, #panel.folded #brief, #panel.folded .section { display: none; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tile { display: grid; padding: 6px 8px; border-radius: var(--radius); background: rgba(11, 11, 11, 0.04); }
.tile-label, .tile-unit { font-size: 11px; color: var(--ink-2); line-height: 1.3; }
.tile strong { font-size: 19px; font-weight: 600; line-height: 1.25; }
.tiles-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 4px; font-size: 12px; }
/* A report section: a title button, one line with the main number and a short source, the rest folded. */
.section { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; padding: 0; border: 0;
  background: none; font: inherit; font-size: 12px; color: var(--ink-2); text-align: left; cursor: pointer;
}
.sec-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sec-chev::before { content: "▸"; color: var(--ink-3); }
.sec-head[aria-expanded="true"] .sec-chev::before, #commentary[open] .sec-chev::before { content: "▾"; }
.sec-line { display: block; margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.sec-source { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.sec-source a { color: inherit; }
.sec-body { margin-top: 6px; }
.sec-body h3 { font-size: 13px; font-weight: 600; margin: 8px 0 0; }
.sec-method { margin-top: 6px; font-size: 12px; }
.sec-method > summary { cursor: pointer; color: var(--accent); }
.sec-method .note { margin-top: 4px; }
.tiles-foot .sec-method { margin-top: 0; }
.sec-show { margin: 0; font-size: 12px; }
.sec-why { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.sec-why strong { font-weight: 600; }
.sec-why a { color: inherit; }
/* In brief: a few plain sentences under the numbers, each with why it matters and a way into its section. */
#brief { margin-top: 8px; }
.brief-title { margin: 0; font-size: 12px; font-weight: 400; color: var(--ink-2); }
#brief ul { margin: 2px 0 0; padding: 0; list-style: none; }
#brief li + li { margin-top: 6px; }
.brief-text { margin: 0; font-size: 14px; line-height: 1.45; }
.brief-more { margin-left: 2px; font-size: 12px; white-space: nowrap; }
#commentary > summary { display: block; list-style: none; cursor: pointer; }
#commentary > summary::-webkit-details-marker { display: none; }
#commentary .commentary-title { margin: 0; }
.commentary-story p { margin: 6px 0 0; }
.note { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }

#commentary { margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--line); font-size: 14px; }
#commentary .label { font-weight: 400; color: var(--ink-2); font-size: 13px; }
#commentary p { margin: 6px 0 0; }
#commentary #commentary-older { font-size: 12px; color: var(--ink-2); }
#commentary-areas { margin-top: 6px; }
#commentary-areas > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.obis { margin: 4px 0 2px; font-size: 13px; }
.obis summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.obis-group { margin-top: 3px; }
.obis-latin { font-style: italic; color: var(--ink); }
.obis-note { color: var(--ink-2); font-size: 12px; margin-top: 4px; }
.obis-note a { color: inherit; }
.obis-popup h3 { margin: 0 0 2px; font-size: 14px; }
.obis-popup .obis summary { color: var(--ink-2); }
#commentary dl { margin: 4px 0 0; }
#commentary dt { font-weight: 600; margin-top: 6px; }
#commentary dd { margin: 0; }
#commentary .note a, #panel .note a { color: var(--ink-2); }
#commentary h3 { font-size: 13px; font-weight: 400; color: var(--ink-2); margin: 10px 0 0; }
#commentary ol { margin: 0; padding: 0; list-style: none; counter-reset: event; }
#commentary ol.numbered li { counter-increment: event; }
#commentary li { display: grid; grid-template-columns: 18px 10px 1fr; column-gap: 6px; margin-top: 6px; }
#commentary li::before { content: ""; color: var(--ink-2); font-size: 13px; }
#commentary ol.numbered li::before { content: counter(event) "."; }
#commentary li .swatch { width: 10px; height: 10px; border-radius: 2px; margin-top: 6px; }
#commentary li strong { font-weight: 600; }
#commentary li p, #commentary li .obis { grid-column: 3; margin: 0; }
#commentary li .obis { margin-top: 2px; }

#legend h2 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.legend-row { display: flex; gap: 2px; }
.legend-row span { flex: 1; height: 14px; border-radius: 2px; }
.legend-labels { display: flex; gap: 2px; font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.legend-labels span { flex: 1; text-align: center; }
.legend-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
#legend .note a { color: var(--ink-2); }

#error {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--surface); padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line);
}

@media (max-width: 640px) {
  /* On a phone the map has the screen: the report is a sheet over the bar at the bottom, folded to the sea and
     its three numbers, and pulled up to read; the layers are one button at the top. */
  #panel {
    top: auto; left: 8px; right: 8px; max-width: none; padding: 8px 12px 10px;
    bottom: calc(var(--legend-h, 70px) + var(--legend-bottom, 8px) + 6px);
    max-height: calc(100% - var(--legend-h, 70px) - var(--legend-bottom, 8px) - 70px);
  }
  #panel::before { content: ""; display: block; width: 32px; height: 4px; margin: 0 auto 6px; border-radius: 2px; background: var(--line); }
  #panel h1 { font-size: 16px; }
  #panel .place { margin: 2px 0 6px; font-size: 14px; }
  #panel.folded #summary { display: block; }
  #panel.folded .tiles-foot { display: none; }
  /* Folded on a phone, the brief keeps its first sentence. */
  #panel.folded #brief:not([hidden]) { display: block; margin-top: 6px; }
  #panel.folded #brief .brief-title, #panel.folded #brief .sec-why, #panel.folded #brief .brief-more,
  #panel.folded #brief li + li { display: none; }
  .tile { padding: 4px 6px; }
  .tile strong { font-size: 16px; }
  .tile-unit { display: none; }
  #bar { left: 8px; right: 8px; bottom: 8px; padding: 6px 12px; flex-wrap: wrap; gap: 4px; }
  #legend { flex-basis: 100%; }
  #legend .note { display: none; }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }  /* pinch to zoom; room for the bar */
  #layers { top: 8px; right: 8px; left: auto; width: auto; max-width: calc(100% - 16px); max-height: none; padding: 0; overflow: visible; }
  .layers-toggle { display: block; padding: 7px 12px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; }
  #layers-body { display: none; max-height: 60vh; overflow-y: auto; padding: 6px; border-top: 1px solid var(--line); }
  #layers.open #layers-body { display: block; }
  /* Folded on a phone: the legend keeps its title (tap to unfold). */
  #legend h2 { cursor: pointer; }
  #legend h2::after { content: " ▾"; color: var(--ink-2); }
  #legend.folded h2::after { content: " ▸"; }
  #legend.folded > :not(h2) { display: none; }
  #legend.folded h2 { margin: 0; }
  .badge-words { display: none; }
  #bar .meta { flex-wrap: nowrap; }
  #legend h2 { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel-more::after { content: " ▴"; }
  .panel-more[aria-expanded="true"]::after { content: " ▾"; }
}

.legend-kind { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 8px; margin-bottom: 4px; }
.legend-kind .kind { font-size: 12px; color: var(--ink-2); padding-top: 1px; }
.legend-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.legend-cells div { display: grid; gap: 2px; font-size: 11px; color: var(--ink-2); text-align: center; }
.legend-cells .swatch { height: 14px; border-radius: 2px; }

#ice { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#ice h2 { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.ice-line { margin: 0; font-size: 13px; }
#ice .note { margin: 6px 0 0; }
.ice-credit { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.ice-credit a { color: inherit; }
#legend .legend-sub { font-size: 13px; font-weight: 600; margin: 8px 0 4px; }

#history { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#history h2 { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
#history p { margin: 2px 0 0; font-size: 13px; }
#history .note { margin-top: 6px; }
#cover { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#cover h2 { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
#cover p { margin: 2px 0 0; font-size: 13px; }
#cover .note { margin-top: 6px; }
.cover-chart .zero { stroke: var(--ink-2); stroke-width: 0.8; }
.cover-chart .month { stroke: rgba(11, 11, 11, 0.08); stroke-width: 0.6; }
.year-chart .old { fill: none; stroke: rgba(11, 11, 11, 0.13); stroke-width: 0.6; }
.year-chart .baseline { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 2; }
.year-chart .warm { fill: none; stroke: #c0392b; stroke-width: 2; }
.year-chart .now.warm-dot { fill: #c0392b; }
.polar-key i.old { border-top: 1px solid rgba(11, 11, 11, 0.3); }
.polar-key i.warm { border-top: 2px solid #c0392b; }
.polar-key i.baseline { border-top: 1.5px dashed var(--ink); }

#polar-ice { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#polar-ice h2 { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
#polar-ice h3 { font-size: 13px; font-weight: 600; margin: 8px 0 0; }
#polar-ice p { margin: 2px 0 0; font-size: 13px; }
#polar-ice .note { margin-top: 6px; }
.year-chart { display: block; width: 100%; height: auto; margin-top: 4px; }
.year-chart text { font-size: 9px; fill: var(--ink-3); }
.year-chart .band { fill: rgba(11, 11, 11, 0.08); }
.year-chart .median { fill: none; stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 2; }
.year-chart .last { fill: none; stroke: #9aa4ab; stroke-width: 1.2; }
.year-chart .this { fill: none; stroke: var(--accent); stroke-width: 2; }
.year-chart .now { fill: var(--accent); }
.year-chart .grid { stroke: var(--line); stroke-width: 1; }
.polar-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }
.polar-key i { display: inline-block; width: 14px; height: 0; margin-right: 4px; vertical-align: middle; border-top: 2px solid var(--accent); }
.polar-key i.last { border-top: 1.5px solid #9aa4ab; }
.polar-key i.median { border-top: 1.5px dashed var(--ink-3); }
.polar-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: start; margin-top: 4px; }
.polar-row p { margin: 0; }
.polar-map { display: block; width: 100%; height: auto; border-radius: 4px; background: #1f3a5a; }
.polar-map image { image-rendering: pixelated; }
.polar-map .edge { fill: none; stroke: #f0a030; stroke-width: 2.5; stroke-linejoin: round; }
.polar-key i.ice { width: 10px; height: 10px; border: 1px solid var(--ink-3); background: #fff; }
.polar-key i.edge { border-top: 2.5px solid #f0a030; }
.polar-key i.band { height: 8px; border: 0; background: rgba(11, 11, 11, 0.08); }

#chlorophyll { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#chlorophyll h2 { font-size: 14px; font-weight: 600; margin: 0 0 2px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#chlorophyll h2 button { font: inherit; font-size: 12px; font-weight: 400; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
#chlorophyll p { margin: 4px 0 0; font-size: 13px; }
#chlorophyll .note { margin-top: 6px; }
#copernicus { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#copernicus h2 { font-size: 14px; font-weight: 600; margin: 0 0 2px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#copernicus h2.cm-next { margin-top: 10px; }
#copernicus h2 button { font: inherit; font-size: 12px; font-weight: 400; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
#copernicus p { margin: 4px 0 0; font-size: 13px; }
#copernicus .note { margin-top: 6px; }
#coral { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#coral h2 { font-size: 14px; font-weight: 600; margin: 0 0 2px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#coral h2 button { font: inherit; font-size: 12px; font-weight: 400; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
#coral p { margin: 4px 0 0; font-size: 13px; }
#coral .note { margin-top: 6px; }
.legend-cells.coral { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; row-gap: 3px; }
.legend-cells.coral div { display: flex; align-items: center; gap: 6px; text-align: left; }
.legend-cells .swatch.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.value-coral { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.value-coral .value-note { display: block; }
.legend-gradient { height: 14px; border-radius: 2px; }
.legend-swatches i.outline { background: transparent !important; border: 2px solid; box-sizing: border-box; }
.legend-swatches { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.legend-swatches span { display: inline-flex; align-items: center; gap: 4px; }
.legend-swatches i { width: 14px; height: 14px; border-radius: 2px; display: inline-block; }
.segmented button[hidden] { display: none; }
#stations { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#stations h2 { font-size: 14px; font-weight: 600; margin: 0; }
.station-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--ink-2); }
.station-key { display: inline-flex; align-items: center; gap: 5px; }
.station-key .dot { box-shadow: 0 0 0 1.5px #1d2a33; }
.stations-raised { margin: 6px 0 0; font-size: 13px; }
.station-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin-top: 4px; }
.station-row .value-chip { margin: 2px 0 0; }
.station-charts:empty { display: none; }
.station-chart { margin-top: 6px; }
.station-svg { display: block; width: 100%; height: auto; }
.station-svg text { font-size: 9px; fill: var(--ink-3); }
.station-svg .grid { stroke: var(--line); stroke-width: 1; }
.station-svg .line { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.station-svg .dot { fill: var(--accent); }
.station-svg .warning { stroke: #f08a24; stroke-width: 1.2; stroke-dasharray: 4 2; }
.value-chip.outlined { box-shadow: inset 0 0 0 1px var(--line); }
.station-card .value-note:last-child { margin-top: 6px; }
#species { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
#species h2 { font-size: 14px; font-weight: 600; margin: 0; }
.species-window, .species-older { margin: 0 0 6px; font-size: 12px; color: var(--ink-2); }
.species-top { margin: 6px 0 0; font-size: 13px; }
.species-lag { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }
#species .segmented { margin: 6px 0 8px; }
#species .segmented button { font-size: 12px; padding: 4px 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="false"] { color: var(--ink-3); background: transparent; }
.chip[aria-pressed="false"] .dot { opacity: 0.25; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px #fff, 0 0 0 2px var(--line); }

.obs-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); }
.obs-card.no-photo { grid-template-columns: minmax(0, 1fr); }
.obs-photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; display: block; }
.obs-name { font-weight: 600; }
.obs-latin { font-style: italic; color: var(--ink-2); }
.obs-meta, .obs-credit { color: var(--ink-2); font-size: 12px; }
.obs-credit { color: var(--ink-3); }
.obs-meta a, .obs-credit a { color: inherit; }
.obs-link { margin-top: 4px; }
.obs-link a { color: var(--accent); }
.value-card { font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); min-width: 190px; }
.value-where, .value-note { color: var(--ink-2); font-size: 12px; }
.value-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 4px 0; }
.value-big { font-size: 22px; font-weight: 600; line-height: 1.15; }
.value-chip { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; color: #fff; margin-bottom: 4px; }
.value-chip.light { color: var(--ink); }
.value-note a { color: inherit; }
.value-ice { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink); }
.value-ice .value-note { display: block; }
.value-ice .value-chip { margin: 2px 0 0; }
/* A card taller than the screen scrolls its text, while the × stays pinned to the card's corner;
   a floated spacer keeps the first lines of text clear of the ×. */
.maplibregl-popup-content { padding: 10px 12px; border-radius: 10px; }
.maplibregl-popup-content > :first-child { max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto; }
.maplibregl-popup-content > :first-child::before { content: ""; float: right; width: 30px; height: 26px; }
/* MapLibre's own × is 12px and bare: a round button large enough to see and to hit with a finger. */
.maplibregl-popup-close-button {
  top: 6px; right: 6px; width: 30px; height: 30px; padding: 0 0 2px;
  border-radius: 50%; background: #e7e8ea; color: var(--ink);
  font-size: 22px; line-height: 1; font-weight: 400;
}
.maplibregl-popup-close-button:hover { background: #d4d6da; }
.maplibregl-popup-close-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Short screens: the panel scrolls rather than run under the legend. */
@media (min-width: 641px) and (max-height: 820px) {
  #panel { max-height: min(calc(100vh - 250px), calc(100% - var(--legend-h, 160px) - var(--legend-bottom, 28px) - 28px)); overflow-y: auto; }
}

/* A section whose data is from another day than the map. */
.section-date {
  display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; font-weight: 400; color: var(--ink-2); white-space: nowrap; vertical-align: 1px;
}
