.weather {
  --deep-pine: #24382e;
  --weather-panel: #111412;
  --weather-plot: #080a09;
  --weather-border: #343b36;
  --weather-text: #f8faf7;
  --weather-secondary: #c1cbc4;
  --chart-grid: #39443e;
  --chart-label: #c1cbc4;
  --chart-cursor: #f8faf7;
  --chart-selection: #9fdea639;
  --weather-clay: #ffa78b;
  --weather-green: #9fdea6;
  --weather-ochre: #ffd373;
  --weather-blue: #9bceff;
  padding-block: clamp(1.25rem, 3vw, 2.75rem) 3rem;
}

.weather-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  color: var(--paper);
  background: linear-gradient(112deg, var(--deep-pine), #47634d);
  border-radius: 20px;
  padding: clamp(1.35rem, 4vw, 3rem);
}

.weather-intro .eyebrow { color: #f2c9a9; margin-bottom: .5rem; }
.weather-intro h1 { font-size: clamp(2.45rem, 5.5vw, 4.75rem); margin: 0 0 .35rem; }
.weather-intro p { color: #edf1e8; margin-bottom: 0; }
.weather-source {
  border-left: 1px solid #cfdacd66;
  padding-left: 1.15rem;
  font-size: .85rem;
  line-height: 1.55;
}
.weather-source strong, .weather-source time { display: block; }
.weather-source time { color: #e2e9dc; }
.weather-current { margin-top: 1.75rem; }
.conditions-heading, .history-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  margin-bottom: .65rem;
}
.weather h2 { font-size: clamp(1.65rem, 3.5vw, 2.45rem); margin: 0; }
.conditions-heading p, .history-heading p { color: var(--muted); margin: 0; font-size: .87rem; }
.weather-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .65rem; }
.weather-metric, .weather-chart {
  color: var(--weather-text);
  background: var(--weather-panel);
  border: 1px solid var(--weather-border);
  min-width: 0;
}
.weather-metric {
  border-radius: 12px;
  border-top: 3px solid var(--series-color);
  padding: .7rem .85rem .75rem;
}
.weather-metric h3 { margin: 0; font-size: .84rem; font-weight: 700; }
.weather-reading {
  color: var(--weather-text);
  font-family: Georgia, serif;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  line-height: 1.3;
  margin: .25rem 0 .4rem;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}
.weather-reading small { color: var(--weather-secondary); font: 600 .78rem system-ui, sans-serif; }
.weather-extreme { color: var(--weather-secondary); font-size: .74rem; line-height: 1.55; margin: 0; }
.weather-unavailable, .weather-note { color: var(--muted); margin: .65rem 0 0; font-size: .82rem; }
.weather-history { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.2rem; }
.history-heading { align-items: end; margin-bottom: .8rem; }
.history-heading p { margin-top: .3rem; }
.history-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .85rem;
  background: #eee8d9;
  border-radius: 10px;
  padding: .45rem .55rem;
  margin-bottom: .8rem;
}
.history-tools p { margin: 0; font-size: .82rem; color: var(--ink); }
.weather-segments { display: inline-flex; flex-wrap: wrap; gap: .2rem; }
.weather-segments button, .weather-reset {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: .35rem .65rem;
  font-size: .8rem;
  font-weight: 650;
  min-height: 42px;
  cursor: pointer;
}
.weather-segments button[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: white;
}
.weather button:focus-visible, .weather-plot:focus-within { outline: 2px solid var(--clay); outline-offset: 2px; }
.weather-plot:focus-within { outline-color: var(--chart-cursor); }
.weather-reset { margin-left: auto; }
.weather-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.weather-chart { border-radius: 13px; padding: .85rem .9rem .5rem; }
.weather-chart h3 { font: 500 1.22rem/1.35 Georgia, serif; margin: 0 0 .2rem; }
.weather-readout { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .75rem; color: var(--weather-secondary); font-size: .76rem; min-height: 2.75em; font-variant-numeric: tabular-nums; }
.weather-readout span { white-space: nowrap; }
.weather-swatch { display: inline-block; vertical-align: middle; width: 16px; height: 3px; border-radius: 2px; margin-right: .3rem; background: var(--series-color); }
.weather-swatch.is-dashed { background: repeating-linear-gradient(90deg, var(--series-color) 0 6px, transparent 6px 10px); }
.weather-plot { position: relative; border: 1px solid var(--weather-border); border-radius: 6px; background: var(--weather-plot); }
.weather-plot canvas {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: pan-y;
  cursor: crosshair;
}
.weather-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}
@media (max-width: 1050px) {
  .weather-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .weather-intro { align-items: start; flex-direction: column; gap: .75rem; }
  .weather-source { border-left: 0; border-top: 1px solid #cfdacd66; padding: .5rem 0 0; }
  .weather-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weather-charts { grid-template-columns: 1fr; }
  .weather-chart { padding-inline: .65rem; }
}
.weather-source #weather-status { display: block; color: #edf1e8; }
.weather-freshness { margin: .15rem 0 .35rem; font-size: .74rem; line-height: 1.45; color: var(--weather-secondary); }
.weather-freshness[data-stale="true"] { color: var(--weather-ochre); }
