:root {
  color-scheme: light;
  --bg: #f4efe6;
  --ink: #1c1915;
  --muted: #5c564c;
  --card: #fffdf8;
  --line: #d8cfc0;
  --accent: #2f5d50;
  --error: #8a2b2b;
  --day: #c03a2b;
  --night: #2a5f9e;
  --precip: #2a5f9e;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background: var(--bg);
  color: var(--ink);
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.header {
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
}

.lede,
.error,
.wind,
.period-forecast,
.card-alert-pop,
.precip-summary,
.detail-lede,
.detail-close,
.detail-toggle,
.detail-alerts,
.daily-alerts,
.daily-text,
.hourly-time,
.hourly-summary,
.hourly-table {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
}

.cards {
  --card-count: 1;
  --card-gap: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--card-gap);
}

.card {
  position: relative;
  flex: 1 1 100%;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 8px 24px rgba(60, 45, 20, 0.06);
}

.card[data-location] {
  cursor: pointer;
}

.card[data-location]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(47, 93, 80, 0.14);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

.card:has(.card-alerts) h2 {
  padding-right: 2.1rem;
}

.current {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.weather-icon {
  display: block;
  overflow: visible;
}

.current .weather-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.temp {
  margin: 0.15rem 0;
  font-size: 2.4rem;
  line-height: 1;
}

.wind {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.error {
  margin: 0;
  color: var(--error);
  line-height: 1.45;
}

.periods {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
}

.periods li {
  display: grid;
  grid-template-columns: 4.2rem 3.15rem 1.75rem minmax(2.4rem, 1fr) 1.75rem;
  gap: 0.28rem;
  align-items: center;
  padding: 0.38rem 0;
  border-bottom: 1px solid #efe8db;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.75rem;
}

.periods li:last-child {
  border-bottom: 0;
}

.period-label {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-temp {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.periods .temp-low {
  text-align: right;
}

.periods .temp-high {
  text-align: left;
}

.temp-range {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #efe8db;
}

.temp-range-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--night);
}

.compare-temps .temp-range {
  height: 12px;
  border-radius: 0;
}

.compare-temps .temp-range-fill {
  border-radius: 0;
}

.temp-day {
  color: var(--day);
}

.temp-night {
  color: var(--night);
}

.period-forecast {
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
}

.period-forecast .weather-icon {
  width: 36px;
  height: 36px;
}

.card-alerts {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 3;
}

.card-alert-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b4532a;
  cursor: pointer;
}

.card-alert-btn svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.card-alerts.severity-extreme .card-alert-btn {
  color: #8a2b2b;
}

.card-alerts.severity-severe .card-alert-btn {
  color: #b4532a;
}

.card-alerts.severity-moderate .card-alert-btn {
  color: #b8862a;
}

.card-alerts.severity-minor .card-alert-btn,
.card-alerts.severity-unknown .card-alert-btn {
  color: #7a7468;
}

.card-alert-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.card-alert-pop {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 12.5rem;
  max-width: 17rem;
  padding: 0.5rem 0.65rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(60, 45, 20, 0.14);
}

.card-alerts:hover .card-alert-pop,
.card-alerts:focus-within .card-alert-pop,
.card-alerts.is-open .card-alert-pop {
  display: block;
}

.card-alert-event {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-alert-event + .card-alert-when + .card-alert-event {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.card-alert-when {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.compare-days-grid {
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
  column-gap: 1.1rem;
  row-gap: 0.35rem;
  align-items: start;
}

.precip-summary {
  margin: 0.7rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.precip-summary h3 {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.precip-summary table {
  width: 100%;
  border-collapse: collapse;
}

.precip-summary th,
.precip-summary td {
  padding: 0.12rem 0.3rem 0.12rem 0;
  text-align: left;
  font-size: 0.68rem;
  line-height: 1.3;
  vertical-align: baseline;
}

.precip-summary th {
  font-weight: 500;
  color: var(--muted);
}

.precip-summary td {
  color: var(--ink);
}

.precip-summary .precip-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.precip-summary th:nth-child(2),
.precip-summary td:nth-child(2),
.precip-summary th:nth-child(3),
.precip-summary td:nth-child(3) {
  text-align: right;
  padding-right: 0.45rem;
}

.precip-type {
  display: flex;
  align-items: center;
  gap: 0.18rem;
}

.precip-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  color: var(--precip);
}

.precip-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.precip-icon-snow {
  color: #5a7ea8;
}

.precip-icon-thunderstorms {
  color: #c4a046;
}

.period-condition {
  display: flex;
  align-items: center;
  gap: 0.12rem;
  min-width: 0;
}

.period-icon {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.period-pop,
.period-amt {
  color: var(--precip);
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.period-amt,
.precip-amt {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
}

.period-amt {
  color: var(--ink);
}

.period-icon .weather-icon {
  width: 26px;
  height: 26px;
  display: block;
}

.detail {
  display: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1.1rem;
  box-shadow: 0 8px 24px rgba(60, 45, 20, 0.06);
}

.detail.is-open {
  display: block;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.detail-title {
  min-width: 0;
}

.detail-header h3 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.detail-lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
}

.detail-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.detail-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.detail-toggle button[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
}

.detail-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.detail-close {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.detail-close:hover,
.detail-close:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.detail-view[hidden] {
  display: none;
}

.daily {
  list-style: none;
  margin: 0;
  padding: 0;
}

.daily li {
  padding: 0.9rem 0;
  border-top: 1px solid #efe8db;
}

.daily li:first-child {
  border-top: 0;
  padding-top: 0;
}

.daily h4 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.daily-summary {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.daily-period {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.daily-period .weather-icon {
  width: 40px;
  height: 40px;
  display: block;
}

.daily-text {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.detail-alerts-slot {
  justify-self: center;
  min-width: 0;
}

.detail-alerts {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  max-width: 22rem;
}

.detail-alert {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  padding: 0.4rem 0.6rem;
  background: #f7f1e3;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-alert .alert-mark,
.daily-alert .alert-mark {
  flex-shrink: 0;
  display: block;
}

.detail-alert .alert-mark {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.12rem;
  color: #b4532a;
}

.detail-alert.severity-extreme .alert-mark,
.daily-alert.severity-extreme .alert-mark {
  color: #8a2b2b;
}

.detail-alert.severity-severe .alert-mark,
.daily-alert.severity-severe .alert-mark {
  color: #b4532a;
}

.detail-alert.severity-moderate .alert-mark,
.daily-alert.severity-moderate .alert-mark {
  color: #b8862a;
}

.detail-alert.severity-minor .alert-mark,
.detail-alert.severity-unknown .alert-mark,
.daily-alert.severity-minor .alert-mark,
.daily-alert.severity-unknown .alert-mark {
  color: #7a7468;
}

.detail-alert-event {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.detail-alert-when {
  margin: 0.12rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.daily-alerts {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}

.daily-alert {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}

.daily-alert .alert-mark {
  width: 0.95rem;
  height: 0.95rem;
  color: #b4532a;
}

.daily-alert-when {
  font-weight: 500;
  color: var(--muted);
}

.hourly-split {
  display: grid;
  gap: 1.25rem;
}

.hourly-charts {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
}

.hourly-table-wrap {
  min-width: 0;
  max-height: min(42rem, calc(100vh - 10rem));
  overflow: auto;
}

.hourly-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.68rem;
}

.hourly-table th,
.hourly-table td {
  padding: 0.32rem 0.3rem 0.32rem 0;
  border-bottom: 1px solid #efe8db;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.3;
}

.hourly-day-row th {
  padding-top: 0.7rem;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid #efe8db;
}

.hourly-table .hourly-hour {
  width: 3.5rem;
}

.hourly-table .hourly-temp {
  width: 2.3rem;
  font-variant-numeric: tabular-nums;
}

.hourly-table .hourly-pop {
  width: 2.7rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hourly-table .hourly-weather {
  width: 2.4rem;
}

.hourly-table .hourly-weather .weather-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.hourly-table .hourly-amount {
  width: 3.8rem;
}

.hourly-table .hourly-wx {
  width: 6.2rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.hourly-table .hourly-amount .precip-amt {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hourly-table .hourly-wind {
  color: var(--muted);
}

.hourly-wind-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.wind-arrow {
  display: inline-flex;
  width: 11px;
  height: 11px;
  color: var(--muted);
  transform: rotate(var(--wind-deg, 0deg));
  flex-shrink: 0;
}

.wind-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hourly-sun-row .hourly-wx {
  color: var(--ink);
  font-weight: 600;
}

.hourly-table tbody tr:last-child td,
.hourly-table tbody tr:last-child th {
  border-bottom: 0;
}

.hourly-chart {
  margin: 0;
  width: 100%;
}

.hourly-chart figcaption {
  margin: 0 0 0.3rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
}

.hourly-chart-plot {
  position: relative;
  width: 100%;
}

.hourly-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.hourly-chart .chart-night {
  fill: rgba(70, 68, 64, 0.12);
  pointer-events: none;
}

.hourly-chart .chart-grid {
  stroke: #efe8db;
  stroke-width: 1;
}

.hourly-chart .chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.hourly-chart .chart-area {
  fill: rgba(47, 93, 80, 0.12);
}

.hourly-chart.is-precip .chart-line {
  stroke: var(--precip);
}

.hourly-chart.is-precip .chart-area {
  fill: rgba(42, 95, 158, 0.14);
}

.hourly-chart .chart-amount {
  fill: rgba(42, 95, 158, 0.32);
}

.hourly-chart .chart-amount-snow {
  fill: rgba(122, 155, 184, 0.72);
}

.hourly-chart .chart-amount-label {
  fill: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 8px;
  pointer-events: none;
}

.hourly-chart .chart-amount-icon-rain path {
  fill: #2a5f9e;
}

.hourly-chart .chart-amount-icon-snow path {
  fill: none;
  stroke: #5a7ea8;
  stroke-width: 1.35;
  stroke-linecap: round;
}

.hourly-chart .chart-axis {
  fill: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 8px;
}

.hourly-chart .chart-hour,
.hourly-chart .chart-day {
  font-size: 8px;
}

.hourly-chart .chart-hover {
  fill: var(--accent);
}

.hourly-chart.is-precip .chart-hover {
  fill: var(--precip);
}

.hourly-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: #fffdf8;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transform: translate(-50%, -120%);
  white-space: nowrap;
}

@media (max-width: 799px) {
  .detail-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .detail-alerts-slot,
  .detail-actions {
    justify-self: stretch;
  }

  .detail-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .periods li {
    grid-template-columns: 3.9rem 2.95rem 1.55rem minmax(2rem, 1fr) 1.55rem;
    gap: 0.22rem;
  }

  .period-icon .weather-icon {
    width: 24px;
    height: 24px;
  }

  .period-forecast .weather-icon {
    width: 32px;
    height: 32px;
  }
}

@media (min-width: 900px) {
  .card {
    flex: 0 0 calc((100% - var(--card-gap)) / 2);
    max-width: calc((100% - var(--card-gap)) / 2);
  }

  .detail.is-open {
    flex: 0 0 100%;
    max-width: 100%;
    order: 1;
  }

  .hourly-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.9fr);
    align-items: start;
  }

  .hourly-charts {
    position: sticky;
    top: 0.75rem;
  }
}

.compare {
  margin-bottom: 1.5rem;
}

.compare-caption {
  margin: 0 0 0.5rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* A/B captions and Layout B are only meaningful on mobile. */
.compare-caption,
.compare-vertical {
  display: none;
}

/* Layout B: days as rows, locations as columns, vertical temp bands. */
.compare-vtable {
  min-width: 0;
  table-layout: fixed;
}

.compare-vtable .vcompare-loc {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  vertical-align: bottom;
}

.compare-vtable thead th {
  background: #fffdf8;
}

.compare-vtable .vcompare-corner {
  width: 6.5rem;
  background: var(--card);
  position: sticky;
  left: 0;
  z-index: 2;
}

.compare-vtable .vcompare-day {
  text-align: left;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  box-shadow: 8px 0 12px -10px rgba(60, 45, 20, 0.25);
  vertical-align: middle;
}

.compare-vtable .vcompare-row:hover th,
.compare-vtable .vcompare-row:hover td {
  background: #faf6ee;
}

.compare-vtable .vcompare-loc.is-selected {
  color: var(--accent);
}

.compare-vtable .vcompare-cell {
  vertical-align: middle;
  padding: 0.55rem 0.35rem;
}

.vtemp {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.1rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.vtemp-high {
  font-size: 1.05rem;
  font-weight: 600;
}

.vtemp-low {
  font-size: 0.7rem;
  font-weight: 500;
  padding-bottom: 0.05rem;
}

.compare-scroll {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(60, 45, 20, 0.06);
}

.compare-table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.compare-table th,
.compare-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid #efe8db;
  vertical-align: top;
  text-align: center;
}

.compare-table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: #fffdf8;
}

.compare-table thead .compare-days-cell {
  background: #fffdf8;
}

.compare-day-head {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.compare-day-abbr {
  display: none;
}

.compare-table .compare-place {
  text-align: left;
  vertical-align: middle;
  position: sticky;
  left: 0;
  z-index: 1;
  width: 16rem;
  min-width: 16rem;
  background: var(--card);
  box-shadow: 8px 0 12px -10px rgba(60, 45, 20, 0.25);
}

.compare-table thead .compare-place {
  z-index: 2;
}

.compare-place-name {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.compare-place-short {
  display: none;
}

@media (max-width: 799px) {
  .compare-caption {
    display: block;
  }

  .compare-vertical {
    display: block;
  }

  .compare-place-full {
    display: none;
  }

  .compare-place-short {
    display: inline;
  }

  .compare-table {
    table-layout: auto;
    min-width: 0;
    width: 100%;
  }

  .compare-table th,
  .compare-table td {
    padding: 0.5rem 0.15rem;
  }

  .compare-table .compare-place {
    width: 1px;
    min-width: 0;
    max-width: none;
    padding-right: 0.35rem;
    white-space: nowrap;
  }

  .compare-place-name {
    font-size: 0.72rem;
  }

  .compare-days-grid {
    column-gap: 0.28rem;
  }

  .compare-day-head {
    font-size: 0.64rem;
  }

  .compare-day-full {
    display: none;
  }

  .compare-day-abbr {
    display: inline;
  }

  .compare-vtable .vcompare-corner {
    width: 3rem;
  }

  .compare-vtable .vcompare-loc,
  .compare-vtable .vcompare-day {
    font-size: 0.72rem;
  }

  .compare-vtable .vcompare-cell {
    padding: 0.5rem 0.15rem;
  }

  .vtemp-high {
    font-size: 0.95rem;
  }

  .vtemp-low {
    font-size: 0.62rem;
  }

  /* Day columns show only the colored bar; tap a cell to reveal the numbers. */
  .compare-day {
    cursor: pointer;
  }

  .compare-row .compare-temps {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .compare-row .compare-temps .temp-low,
  .compare-row .compare-temps .temp-high {
    display: none;
  }

  .compare-row .compare-temps .temp-range {
    height: 14px;
  }
}

.compare-row {
  cursor: pointer;
}

.compare-row:hover td,
.compare-row:hover th {
  background: #faf6ee;
}

.compare-row.is-selected td,
.compare-row.is-selected th {
  background: #f6f8f5;
}

.compare-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.compare-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.compare-table td {
  vertical-align: middle;
}

.compare-temps {
  display: grid;
  grid-template-columns: 1.6rem minmax(2.2rem, 1fr) 2.1rem;
  gap: 0.2rem;
  align-items: center;
  width: 100%;
}

.compare-temps .temp-high {
  font-size: calc(0.75rem - 1pt);
  font-weight: 600;
  color: #746d62;
  text-align: left;
}

.compare-temps .temp-low {
  font-size: calc(0.75rem - 1pt);
  font-weight: 500;
  color: #746d62;
  text-align: right;
}

@media (min-width: 1280px) {
  .page {
    max-width: 1440px;
  }

  .card {
    flex: 0 0 calc((100% - 3 * var(--card-gap)) / 4);
    max-width: calc((100% - 3 * var(--card-gap)) / 4);
  }

  .cards[data-packed] {
    --card-gap: 0.85rem;
  }

  .cards[data-packed] .card {
    flex: 0 0 calc((100% - (var(--card-count) - 1) * var(--card-gap)) / var(--card-count));
    max-width: calc((100% - (var(--card-count) - 1) * var(--card-gap)) / var(--card-count));
    padding: 1rem 0.85rem 0.85rem;
  }

  .cards[data-packed] .card h2 {
    font-size: 1.1rem;
  }

  .cards[data-packed] .current .weather-icon {
    width: 56px;
    height: 56px;
  }

  .cards[data-packed] .temp {
    font-size: 2rem;
  }

  .cards[data-packed] .periods li {
    grid-template-columns: 3.5rem 2.6rem 1.45rem minmax(1.6rem, 1fr) 1.45rem;
    gap: 0.18rem;
    font-size: 0.7rem;
  }

  .detail.is-open {
    flex: 0 0 100%;
    max-width: 100%;
    order: 1;
  }
}
