* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: var(--color-red-dark); text-underline-offset: .22em; }
button { cursor: pointer; color: inherit; }
figure, h1, h2, h3 { margin: 0; }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.3; }
h2 { font-size: var(--text-h2); margin-bottom: 28px; }
h3 { font-size: var(--text-h3); }
.eco-wrap { width: min(100%, var(--content-max)); padding-inline: var(--page-gutter); margin-inline: auto; }
.eco-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--header-height); padding: 8px clamp(16px, 4vw, 64px); background: var(--pale); border-bottom: 1px solid var(--line); }
.eco-header a { text-decoration: none; }
.eco-brand { font-weight: 700; }
.eco-header nav { display: flex; gap: clamp(10px, 3vw, 32px); font-size: var(--text-sm); }
.eco-kicker { margin: 0 0 12px; color: var(--color-red-dark); font-weight: 700; letter-spacing: .08em; }
.eco-chapter { font-size: 25px; }
.eco-section { padding-top: var(--chapter-space); }
.eco-panel { background: var(--pale); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-panel); overflow: hidden; }
.eco-compare, .eco-story-map { position: relative; background: var(--color-map-neutral); }
.eco-compare { --split: 50%; height: clamp(300px, 47vw, 610px); }
.eco-map { position: absolute; inset: 0; }
.eco-year, .eco-map-label, .eco-imagery-credit, .eco-status { position: absolute; padding: 4px 10px; background: var(--pale); border-radius: var(--radius-sm); }
.eco-year { top: 12px; font-weight: 700; }
.eco-year-left { left: 12px; }
.eco-year-right { right: 12px; }
.eco-map-label { top: 12px; left: 12px; font-weight: 700; }
.eco-imagery-credit { bottom: 6px; right: 6px; font-size: 11px; }
.eco-status { top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; width: max-content; max-width: 85%; }
.eco-divider { position: absolute; left: var(--split); inset-block: 0; width: 2px; background: white; box-shadow: 0 0 0 1px #26372f60; pointer-events: none; }
.eco-divider span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--pale); font-weight: 700; box-shadow: var(--shadow-panel); pointer-events: auto; touch-action: none; cursor: ew-resize; }
.eco-compare-controls, .eco-legend, .eco-scenes { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.eco-compare-controls label { flex: 1; min-width: 0; display: grid; text-align: center; color: var(--muted); font-size: var(--text-sm); }
.eco-compare-controls input { width: 100%; height: 28px; margin: 0; accent-color: var(--color-green); cursor: ew-resize; }
.eco-compare-controls button, .eco-scenes button { min-height: 44px; padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); font-size: var(--text-sm); }
.eco-scenes button[aria-pressed="true"] { background: var(--color-green); border-color: var(--color-green); color: white; }
.eco-legend { flex-wrap: wrap; font-size: var(--text-sm); border-top: 1px solid var(--line); }
.eco-legend-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.eco-legend, .eco-scenes { position: relative; }
.eco-legend .atlas-help-content, .eco-scenes .atlas-help-content {
  inset-inline-start: 10px;
  top: auto;
  bottom: 100%;
  width: min(28rem, calc(100% - 20px));
}
.eco-section .atlas-help > summary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding-inline: 6px;
  font-size: var(--text-sm);
}
.eco-scenes .atlas-help > summary { min-width: 44px; }
.eco-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.eco-swatches span::before { content: ''; display: inline-block; width: 14px; height: 12px; margin-right: 5px; background: var(--swatch); vertical-align: -1px; border: 1px solid #26372f45; }
.eco-caption { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: var(--text-xs); line-height: 1.65; }
.eco-sediment-station a { display: inline-block; margin-inline-start: .55em; }
.eco-transition { margin: 32px 0 0; max-width: 49em; }
.eco-story { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(20px, 4vw, 52px); align-items: start; }
.eco-story-visual { position: sticky; top: calc(var(--header-height) + 16px); }
.eco-story-map { height: clamp(270px, 41vh, 480px); }
.eco-scenes { flex-wrap: wrap; }
.eco-story-text article { display: grid; align-content: start; gap: 8px; min-height: 47vh; padding: 12px 0 20px; border-top: 1px solid var(--line); scroll-margin-top: 14px; }
.eco-story-text article p { margin: 0; }
.eco-story-text article a { font-size: var(--text-sm); }
.eco-observations { padding: clamp(18px, 4vw, 36px); margin-top: 36px; }
.eco-observations figure > p { margin-block: 12px 0; }
.eco-sediment-chart { display: grid; gap: 18px; max-width: 650px; margin-block: 24px; }
.eco-sediment-row { display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.eco-sediment-row dd { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; white-space: nowrap; }
.eco-sediment-row dd::before {
  content: '';
  /* Reserve the same space for the value in both rows. */
  flex: 0 0 calc(max(0px, 100% - 8em) * var(--bar-share));
  height: 12px;
  border-radius: 2px;
  background: var(--color-green);
}
.eco-observations figcaption, .eco-sediment-station p { max-width: 65em; color: var(--muted); font-size: var(--text-sm); }
.eco-sediment-station { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.eco-sediment-station h4 { margin: 0 0 4px; font-size: 1rem; }
.eco-sediment-station p { margin: 0; }
.eco-watershed { padding-bottom: var(--chapter-space); }
@media (max-width: 740px) {
  .eco-story { grid-template-columns: 1fr; }
  .eco-story { gap: 12px; }
  .eco-story-visual { z-index: 2; }
  .eco-story-map { height: clamp(150px, 26vh, 260px); }
  .eco-story-text article { min-height: 44vh; scroll-margin-top: calc(clamp(150px, 26vh, 260px) + 120px); }
  .eco-scenes { gap: 6px; padding: 5px 10px; }
  .eco-scenes summary span { display: none; }
}
@media (max-height: 520px) and (max-width: 740px) {
  .eco-story-visual { position: relative; top: auto; }
  .eco-story-text article { scroll-margin-top: 0; }
}
