.year-map-page {
  --year-border: #d8e3e8;
  --year-navy: #122f41;
  --year-ink: #173c50;
  --year-muted: #526b79;
  background: #f3f7f8;
}

.year-map-main { padding-top: 34px; }
.year-map-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.year-map-header h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); line-height: 1.02; }
.year-map-header h1 span { color: #387288; font-variant-numeric: lining-nums; }
.year-map-header p { margin-top: 10px; color: var(--year-muted); font-size: .94rem; }
.year-map-year-form { flex: 0 0 auto; }
.year-map-year-form label, .year-map-date-row label {
  display: block;
  margin-bottom: 5px;
  color: #456676;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.year-map-year-form > div { display: flex; gap: 6px; }
.year-map-year-form select { background-color: white; padding-left: 12px; border: 1px solid var(--year-border); }
.year-map-year-form button { padding: 0 11px; font-weight: 650; }
.year-map-year-form button span { margin-left: 3px; }
.year-map-no-year { padding: 24px; }
.year-map-no-year p { margin-top: 8px; color: var(--year-muted); }

.year-map-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.year-map-metrics button, .year-map-stepper button {
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--year-border);
  border-radius: 7px;
  background: #fff;
  color: var(--year-ink);
  font-size: .82rem;
  font-weight: 650;
}
.year-map-metrics button:hover, .year-map-stepper button:hover:not(:disabled) { border-color: #87a6b5; background: #eef5f7; }
.year-map-metrics button[aria-pressed="true"] { border-color: #214e62; background: #214e62; color: #fff; }

.year-map-timeline, .year-map-panel {
  min-width: 0;
  padding: 16px 19px;
  border: 1px solid var(--year-border);
  border-radius: 12px;
  background: #fff;
}
.year-map-date-row { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.year-map-date-row time {
  display: block;
  font: 400 clamp(1.4rem, 2.9vw, 2rem)/1.05 Georgia, serif;
  letter-spacing: -.025em;
}
.year-map-stepper { display: flex; gap: 5px; }
.year-map-stepper button { min-width: 42px; white-space: nowrap; }
.year-map-stepper button:disabled { opacity: .45; cursor: default; }
.year-map-stepper .year-map-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 82px;
  border-color: #214e62;
  background: #214e62;
  color: #fff;
}
.year-map-stepper .year-map-play:hover:not(:disabled) { border-color: #173c50; background: #173c50; }
#year-map-play-icon { width: 12px; font-size: .7rem; }
.year-map-next-label { margin-right: 6px; }
.year-map-daily-mean { margin-top: 7px; color: var(--year-muted); font-size: .78rem; }
.year-map-daily-mean strong { margin-left: 5px; color: var(--year-ink); font-variant-numeric: tabular-nums; }
.year-map-track { position: relative; height: 52px; margin: 7px 8px 0; }
.year-map-track svg { display: block; width: 100%; height: 46px; border-bottom: 1px solid #bdd2dc; }
.year-map-chart-mean { fill: none; stroke: var(--year-ink); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.year-map-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 7px;
  left: var(--progress, 0%);
  width: 1px;
  background: #173c50;
  pointer-events: none;
}
.year-map-track input { position: absolute; z-index: 1; bottom: -4px; left: -8px; width: calc(100% + 16px); height: 52px; margin: 0; appearance: none; background: transparent; cursor: ew-resize; }
.year-map-track input::-webkit-slider-runnable-track { height: 16px; background: transparent; }
.year-map-track input::-moz-range-track { height: 16px; background: transparent; }
.year-map-track input::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: #234e63; box-shadow: 0 0 0 1px #234e63; transform: translateY(11px); }
.year-map-track input::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: #234e63; box-shadow: 0 0 0 1px #234e63; transform: translateY(11px); }
.year-map-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1px; }
.year-map-months button { padding: 6px 0; border-radius: 4px; color: var(--year-muted); font-size: .72rem; }
.year-map-months button:hover, .year-map-months button[aria-current] { background: #eaf1f4; color: #173c50; }
.year-map-months button[aria-current] { font-weight: 750; }
.year-map-chart-label { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 2px; color: var(--year-muted); font-size: .71rem; }
.year-map-chart-mean-key { display: inline-flex; align-items: center; gap: 5px; }
.year-map-chart-mean-key::before { content: ""; width: 14px; height: 2px; border-radius: 1px; background: var(--year-ink); }

.year-map-workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.year-map-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 17px 20px 16px;
  overflow: hidden;
  border-radius: 12px;
  background-color: var(--year-navy);
  background-image: radial-gradient(ellipse at 64% 35%, #36627c75, transparent 65%),
    repeating-linear-gradient(90deg, #8dc8e30e 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, #8dc8e30e 0 1px, transparent 1px 42px);
  color: #d5e7ef;
}
.year-map-map-header { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.year-map-canvas h2 { color: #f2f8fa; font-size: 1.65rem; }
.year-map-map-header p { margin-top: 4px; font-size: .78rem; }
.year-map-leader-jump { display: none; }
.year-map-north { font-size: .72rem; letter-spacing: .15em; padding: 5px 0 0 8px; }
.year-map-drawing { height: clamp(335px, 42vw, 475px); position: relative; display: grid; place-items: center; }
.year-map-drawing > svg { width: 100%; height: 100%; min-height: 0; }
.year-map-outline { fill: #42667a55; stroke: #91b8c8; stroke-width: 2.5px; stroke-linejoin: round; }
.year-map-tile { cursor: pointer; stroke: #091e2c; stroke-width: 1.5px; }
.year-map-tile:is(:hover, :focus-visible, .is-highlighted, .is-selected) { stroke: #fff; stroke-width: 3px; vector-effect: non-scaling-stroke; outline: none; }
.year-map-empty { position: absolute; text-align: center; padding: 9px 12px; border-radius: 6px; background: #122f41; color: #fff; font-size: .8rem; }
.year-map-legend { display: flex; gap: 10px 24px; justify-content: space-between; align-items: end; flex-wrap: wrap; font-size: .7rem; color: #c5dce6; }
.year-map-legend > div { flex: 0 1 270px; }
#year-map-legend-title { margin-bottom: 5px; color: #fff; font-weight: 650; }
#year-map-scale { display: flex; padding-bottom: 1.2em; }
.year-map-scale-key { position: relative; flex: 1; }
.year-map-scale-label { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.year-map-scale-key:first-child .year-map-scale-label { left: 0; transform: none; }
.year-map-scale-key:last-child .year-map-scale-label { left: auto; right: 0; transform: none; }
.year-map-scale-key::before { display: block; content: ""; height: 5px; background: var(--swatch); }
.year-map-scale-key:first-child::before { border-radius: 6px 0 0 6px; }
.year-map-scale-key:last-child::before { border-radius: 0 6px 6px 0; }

.year-map-station {
  position: absolute;
  z-index: 2;
  left: 15px;
  bottom: 64px;
  width: min(265px, calc(100% - 30px));
  padding: 13px 40px 13px 14px;
  border: 1px solid #a4c3d1;
  border-radius: 9px;
  background: #f5fafb;
  color: var(--year-ink);
  box-shadow: 0 10px 30px #031c2d60;
}
.year-map-station button { position: absolute; top: 6px; right: 6px; width: 35px; height: 35px; border-radius: 5px; font-size: 1.35rem; }
.year-map-station button:hover { background: #e1edf1; }
.year-map-station p { margin: 3px 0 6px; font-size: .81rem; }
.year-map-station a, .year-map-featured > a { font-size: .78rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.year-map-sidebar { display: grid; gap: 12px; }
.year-map-panel h2 { font-size: 1.65rem; }
.year-map-panel > p { margin-top: 4px; color: var(--year-muted); font-size: .82rem; }
.year-map-panel .year-map-leaders-label { margin-top: 4px; color: var(--year-muted); font-size: .82rem; font-weight: 650; }
.year-map-coldest { margin-top: 14px; }
.year-map-leaders { display: grid; gap: 6px; margin-top: 12px; list-style: none; }
.year-map-leaders:empty { margin: 0; }
.year-map-leader {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 47px;
  padding: 7px 9px;
  border: 1px solid #e3edf1;
  border-radius: 7px;
  background: #f5f9fa;
  text-align: left;
}
.year-map-leader:hover, .year-map-leader[aria-expanded="true"] { background: #e7f0f3; border-color: #abc5d0; }
.year-map-rank { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 5px; border-left: 3px solid var(--reading-color); background: #e3edf1; font-size: .72rem; font-weight: 700; }
.year-map-leader-name { font-size: .81rem; font-weight: 600; overflow-wrap: anywhere; }
.year-map-leader-value { font-size: .86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.year-map-featured { background: #eaf2f5; }
.year-map-featured > p:empty { display: none; }
.year-map-featured > a { display: inline-block; margin-top: 11px; }
.year-map-record { display: grid; gap: 4px; width: 100%; min-width: 0; padding: 13px; border: 1px solid var(--year-border); border-left: 4px solid var(--reading-color); border-radius: 8px; background: #fff; text-align: left; }
.year-map-record:hover { background: #f3f9fb; border-color: #adc9d6; border-left-color: var(--reading-color); }
.year-map-featured .year-map-record { margin-top: 10px; }
.year-map-record-label { color: var(--year-muted); font-size: .77rem; font-weight: 650; }
.year-map-record-value { font: 400 2rem/1.12 Georgia, serif; }
.year-map-record-station { color: var(--year-muted); font-size: .78rem; overflow-wrap: anywhere; }
.year-map-records { margin-top: 26px; }
.year-map-records > p { margin-top: 5px; color: var(--year-muted); font-size: .85rem; }
#year-map-record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.year-map-page [hidden] { display: none !important; }

@media (max-width: 760px) {
  .year-map-main { padding: 21px 12px 35px; }
  .year-map-header { flex-wrap: wrap; gap: 12px; margin-bottom: 13px; }
  .year-map-header p { margin-top: 5px; font-size: .86rem; }
  .year-map-year-form { display: flex; align-items: center; gap: 9px; }
  .year-map-year-form label { margin: 0; }
  .year-map-north { display: none; }
  .year-map-leader-jump { display: block; padding: 6px 8px; border: 1px solid #90b6c4; border-radius: 6px; color: #eaf5f8; font-size: .75rem; white-space: nowrap; }
  .year-map-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .year-map-metrics button { min-height: 40px; padding: 4px; font-size: clamp(.65rem, 3vw, .8rem); overflow-wrap: anywhere; }
  .year-map-workspace { grid-template-columns: minmax(0, 1fr); }
  .year-map-timeline, .year-map-panel, .year-map-canvas { padding: 12px; }
  .year-map-drawing { height: clamp(320px, 89vw, 390px); }
  .year-map-canvas h2 { font-size: 1.45rem; }
  .year-map-months button { font-size: clamp(.57rem, 2.65vw, .72rem); }
  #year-map-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-map-record { padding: 10px; }
}

@media (max-width: 460px) {
  .year-map-date-row { align-items: center; }
  .year-map-date-row time {
    display: flex;
    align-items: center;
    min-height: 2.1em;
    font-size: 1.2rem;
  }
  .year-map-next-label { display: none; }
}
