:root {
  --weather-map-bg: var(--background-subtle);
  --weather-map-grid: color-mix(in srgb, var(--border-strong) 64%, transparent);
  --weather-map-label: var(--foreground);
  --weather-temp-cold: #2563eb;
  --weather-temp-mild: #14b8a6;
  --weather-temp-warm: #f59e0b;
  --weather-temp-hot: #dc2626;
  --weather-rain-low: #bfdbfe;
  --weather-rain-high: #1d4ed8;
  --weather-cloud-low: #d4d4d8;
  --weather-cloud-high: #3f3f46;
}

:root[data-theme="dark"],
:root[data-theme="hc-dark"] {
  --weather-map-bg: #111827;
  --weather-temp-cold: #60a5fa;
  --weather-temp-mild: #2dd4bf;
  --weather-temp-warm: #fbbf24;
  --weather-temp-hot: #f87171;
  --weather-rain-low: #334155;
  --weather-rain-high: #60a5fa;
  --weather-cloud-low: #3f3f46;
  --weather-cloud-high: #e4e4e7;
}

:root[data-theme="colorblind"] {
  --weather-temp-cold: #0072b2;
  --weather-temp-mild: #009e73;
  --weather-temp-warm: #e69f00;
  --weather-temp-hot: #d55e00;
  --weather-rain-low: #c7dcef;
  --weather-rain-high: #0072b2;
}

:root[data-hz-boot="1"] *,
:root[data-hz-boot="1"] *::before,
:root[data-hz-boot="1"] *::after {
  transition: none !important;
}

.weather-body {
  --header-height: var(--main-header-height);
  margin: 0;
  min-width: 20rem;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-family);
}

.weather-page {
  min-height: 100vh;
}

.weather-main {
  display: grid;
  gap: var(--space-5);
  width: min(100%, 100rem);
  margin-inline: auto;
  padding: calc(var(--header-height) + var(--space-6)) var(--space-6) var(--space-12);
}

.weather-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: var(--control-h-l);
}

.weather-intro h1 {
  margin: 0;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: -0.025em;
}

.weather-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 30rem;
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  text-align: right;
}

.weather-status-dot {
  width: var(--space-2);
  height: var(--space-2);
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: var(--warning);
}

.weather-status.is-ready .weather-status-dot {
  background: var(--success);
}

/* Publishing has fallen behind: the frame on screen is no longer the expected current one. */
.weather-status.is-stale .weather-status-dot {
  background: var(--warning);
}

.weather-status.is-stale {
  color: var(--foreground);
}

.weather-status.is-error {
  color: var(--destructive);
}

.weather-status.is-error .weather-status-dot {
  background: var(--destructive);
}

.weather-current {
  display: grid;
  grid-template-columns: minmax(18rem, 1.25fr) minmax(32rem, 2fr) auto;
  align-items: center;
  gap: var(--space-5);
  padding-block: var(--space-4);
  border-block: 1px solid var(--border);
}

.weather-current-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-width: 0;
}

.weather-current-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.weather-current-head > div {
  min-width: 0;
}

.weather-current h2,
.weather-city-section h2,
.weather-timeline-section h2,
.weather-calendar-section h2,
.weather-history-section h2,
.weather-map-toolbar h2 {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

#weatherMapTitle,
#weatherTimelineTitle,
#weatherCalendarTitle,
#weatherHistoryTitle {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

.weather-condition-icon {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: var(--fs-display-lg);
}

.weather-temperature {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
}

.weather-temperature strong {
  font-family: var(--font-sans-en), var(--font-family);
  font-size: var(--fs-display-xl);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}

.weather-temperature span {
  margin: var(--space-1) 0 0 var(--space-1);
  color: var(--muted-foreground);
  font-size: var(--fs-body-lg);
}

.weather-condition-copy {
  margin: var(--space-1) 0 0;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  margin: 0;
}

.weather-metrics div {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  padding-inline: var(--space-4);
  border-left: 1px solid var(--border);
}

.weather-metrics dt {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--muted-foreground);
  font-size: var(--fs-2xs);
  line-height: var(--lh-xs);
}

.weather-metrics dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: var(--lh-sm);
  white-space: nowrap;
}

.weather-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 25rem);
  height: min(48rem, calc(100vh - 7rem));
  min-height: 40rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.weather-map-surface {
  display: grid;
  grid-template-rows: auto minmax(28rem, 1fr);
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.weather-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 4.75rem;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.weather-map-time {
  margin: var(--space-1) 0 0;
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}

.weather-map-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.weather-segmented {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.weather-segmented button {
  min-height: var(--control-h-s);
  padding-inline: var(--control-px-s);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-s);
  font-weight: 600;
  cursor: pointer;
}

.weather-segmented button:hover {
  color: var(--foreground);
  background: var(--hover-overlay);
}

.weather-segmented button.is-active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

.weather-segmented button:focus-visible,
.weather-map-wrap canvas:focus-visible,
.weather-city-list:focus-visible,
.weather-timeline:focus-visible,
.weather-history-scroll:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.weather-resolution .select {
  min-width: 5.75rem;
}

.weather-map-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--weather-map-bg);
  isolation: isolate;
}

.weather-map-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.weather-map-wrap canvas.is-city-hover {
  cursor: pointer;
}

.weather-map-wrap canvas.is-dragging {
  cursor: grabbing;
}

.weather-map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-2);
  color: var(--muted-foreground);
  text-align: center;
}

.weather-map-empty .hz-icon {
  font-size: var(--fs-display-lg);
}

.weather-map-tooltip {
  position: absolute;
  max-width: 14rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  pointer-events: none;
  z-index: 2;
}

.weather-map-tooltip strong,
.weather-map-tooltip span {
  display: block;
}

.weather-map-tooltip span {
  margin-top: var(--space-1);
  color: var(--muted-foreground);
}

.weather-map-controls {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: grid;
  gap: var(--space-2);
  z-index: 1;
}

.weather-map-controls .icon-btn-circle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-sm);
}

/* Touch users reach the map controls with a finger, and pinch is the only other way to zoom. */
@media (pointer: coarse) {
  .weather-map-controls .icon-btn-circle {
    width: 2.75rem;
    height: 2.75rem;
  }
}

.weather-map-legend {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card);
  color: var(--muted-foreground);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-2xs);
  line-height: var(--lh-xs);
  z-index: 1;
}

.weather-map-legend i {
  width: 7rem;
  height: var(--space-2);
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--weather-temp-cold), var(--weather-temp-mild), var(--weather-temp-warm), var(--weather-temp-hot));
}

.weather-map-legend[data-layer="precipitation"] i {
  background: linear-gradient(90deg, var(--weather-rain-low), var(--weather-rain-high));
}

.weather-map-legend[data-layer="cloud"] i {
  background: linear-gradient(90deg, var(--weather-cloud-low), var(--weather-cloud-high));
}

.weather-rail {
  display: block;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--card);
}

.weather-city-head,
.weather-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.weather-city-section {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: var(--space-4);
  height: 100%;
  min-height: 0;
  padding: var(--space-5);
}

.weather-city-count {
  flex: 0 0 auto;
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  white-space: nowrap;
}

.weather-city-search {
  display: block;
}

.weather-city-list {
  min-height: 12rem;
  overflow: auto;
  border-top: 1px solid var(--border);
  scrollbar-gutter: stable;
}

.weather-city-row {
  display: grid;
  gap: var(--space-2);
  width: 100%;
  min-height: 5.25rem;
  padding: var(--space-3) var(--space-2);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.weather-city-row:last-child {
  border-bottom: 0;
}

.weather-city-row:hover,
.weather-city-row.is-active {
  background: var(--hover-overlay);
}

.weather-city-row.is-active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.weather-city-row.is-active .weather-city-condition,
.weather-city-row.is-active .weather-city-row-details {
  color: var(--foreground);
}

.weather-city-row:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.weather-city-row-main,
.weather-city-identity,
.weather-city-row-details {
  display: flex;
  align-items: center;
}

.weather-city-row-main {
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.weather-city-identity {
  gap: var(--space-2);
  min-width: 0;
}

.weather-city-identity > .hz-icon {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: var(--fs-h3);
}

.weather-city-identity > span:last-child {
  display: grid;
  gap: var(--space-0-5);
  min-width: 0;
}

.weather-city-name {
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: var(--lh-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-city-condition {
  display: block;
  color: var(--muted-foreground);
  font-size: var(--fs-2xs);
  font-weight: 400;
  line-height: var(--lh-xs);
  white-space: nowrap;
}

.weather-city-temp {
  min-width: 3.2rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.weather-city-row-details {
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  padding-left: calc(var(--fs-h3) + var(--space-2));
  color: var(--muted-foreground);
  font-size: var(--fs-2xs);
  line-height: var(--lh-xs);
}

.weather-city-row-details span {
  white-space: nowrap;
}

.weather-city-empty {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
  text-align: center;
}

.weather-timeline-section {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.weather-calendar-section {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.weather-history-section {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.weather-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.weather-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.weather-calendar-meta {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  text-align: right;
}

.weather-history-meta {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  text-align: right;
}

.weather-calendar-state {
  display: grid;
  min-height: 10rem;
  place-content: center;
  justify-items: center;
  gap: var(--space-2);
  border-block: 1px solid var(--border);
  color: var(--muted-foreground);
  text-align: center;
}

.weather-history-state {
  display: grid;
  min-height: 10rem;
  place-content: center;
  justify-items: center;
  gap: var(--space-2);
  border-block: 1px solid var(--border);
  color: var(--muted-foreground);
  text-align: center;
}

.weather-history-state.is-error {
  color: var(--destructive);
}

.weather-history-state .hz-icon {
  font-size: var(--fs-display);
}

.weather-history-state p {
  max-width: 30rem;
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
}

.weather-history-scroll {
  min-width: 0;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.weather-history-scroll:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.weather-history-weekdays,
.weather-history-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(8.5rem, 1fr));
  min-width: 59.5rem;
}

.weather-history-weekdays span {
  padding: var(--space-2) var(--space-3);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: var(--lh-xs);
  text-align: center;
}

.weather-history-day,
.weather-history-blank {
  min-height: 8.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.weather-history-blank {
  background: var(--background-subtle);
}

.weather-history-day {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--card);
}

.weather-history-date,
.weather-history-condition,
.weather-history-temperature {
  display: flex;
  align-items: center;
}

.weather-history-date {
  justify-content: space-between;
  gap: var(--space-2);
}

.weather-history-date strong,
.weather-history-date small,
.weather-history-condition,
.weather-history-rain {
  font-size: var(--fs-2xs);
  line-height: var(--lh-xs);
}

.weather-history-date strong {
  font-size: var(--fs-xs);
}

.weather-history-date small,
.weather-history-rain {
  color: var(--muted-foreground);
}

.weather-history-condition {
  gap: var(--space-1);
}

.weather-history-condition .hz-icon {
  color: var(--primary);
  font-size: var(--fs-h3);
}

.weather-history-temperature {
  gap: var(--space-2);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.weather-history-temperature strong {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
}

.weather-history-temperature span {
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
}

.weather-calendar-state.is-error {
  color: var(--destructive);
}

.weather-calendar-state .hz-icon {
  font-size: var(--fs-display);
}

.weather-calendar-state p {
  max-width: 30rem;
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
}

.weather-calendar-state .btn,
.weather-history-state .btn {
  margin-top: var(--space-1);
}

.weather-calendar-grid {
  display: grid;
  /* The forecast runs up to 7 days but often returns fewer; track the real day count so the row
     fills the width instead of leaving empty cells. The cap keeps a 1-2 day forecast from
     stretching into absurdly wide cards. */
  grid-template-columns: repeat(var(--weather-calendar-columns, 7), minmax(0, 28rem));
  justify-content: start;
  min-width: 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.weather-calendar-grid:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.weather-calendar-day {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-width: 0;
  min-height: 12rem;
  padding: var(--space-4);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.weather-calendar-day.is-selected {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  box-shadow: inset 0 3px 0 var(--primary);
}

.weather-calendar-day.is-selected .weather-calendar-date em,
.weather-calendar-day.is-selected .weather-calendar-temperature span,
.weather-calendar-day.is-selected .weather-calendar-details dt {
  color: var(--foreground);
}

.weather-calendar-date,
.weather-calendar-date > span,
.weather-calendar-condition,
.weather-calendar-temperature,
.weather-calendar-details div {
  display: flex;
  align-items: center;
}

.weather-calendar-date {
  justify-content: space-between;
  gap: var(--space-2);
}

.weather-calendar-date > span {
  gap: var(--space-2);
  min-width: 0;
}

.weather-calendar-date strong {
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  white-space: nowrap;
}

.weather-calendar-date small,
.weather-calendar-date em {
  color: var(--muted-foreground);
  font-size: var(--fs-2xs);
  font-style: normal;
  line-height: var(--lh-xs);
  white-space: nowrap;
}

.weather-calendar-date em {
  color: var(--primary);
  font-weight: 600;
}

.weather-calendar-condition {
  gap: var(--space-2);
}

.weather-calendar-condition .hz-icon {
  color: var(--primary);
  font-size: var(--fs-h2);
}

.weather-calendar-condition strong {
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
}

.weather-calendar-temperature {
  gap: var(--space-2);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.weather-calendar-temperature strong {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

.weather-calendar-temperature span {
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
}

.weather-calendar-details {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.weather-calendar-details div {
  justify-content: space-between;
  gap: var(--space-2);
}

.weather-calendar-details dt,
.weather-calendar-details dd {
  margin: 0;
  font-size: var(--fs-2xs);
  line-height: var(--lh-xs);
}

.weather-calendar-details dt {
  color: var(--muted-foreground);
}

.weather-calendar-details dd {
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
}

.weather-timeline-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.weather-timeline-meta > p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}

.weather-timeline-meta .btn {
  flex: 0 0 auto;
}

.weather-timeline {
  display: grid;
  grid-auto-columns: minmax(7rem, 1fr);
  grid-auto-flow: column;
  overflow-x: auto;
  border-block: 1px solid var(--border);
  scrollbar-gutter: stable;
}

.weather-time-card {
  display: grid;
  justify-items: start;
  gap: var(--space-2);
  min-height: 8rem;
  padding: var(--space-3);
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.weather-time-card:hover {
  background: var(--hover-overlay);
}

.weather-time-card.is-selected {
  box-shadow: inset 0 -3px 0 var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.weather-time-card.is-selected .weather-time-date,
.weather-time-card.is-selected .weather-time-rain {
  color: var(--foreground);
}

.weather-time-card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.weather-time-label,
.weather-time-date,
.weather-time-rain {
  white-space: nowrap;
}

.weather-time-label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* Outlined rather than filled: white on --primary only reaches 4.24:1 at this size. */
.weather-time-label em {
  padding: 0 var(--space-1);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--foreground);
  font-size: var(--fs-2xs);
  font-style: normal;
  font-weight: 600;
  line-height: 1.4;
}

.weather-time-date,
.weather-time-rain {
  color: var(--muted-foreground);
  font-size: var(--fs-2xs);
  line-height: var(--lh-xs);
}

/* Reserve the row so cards without a date label stay aligned with day-start cards. */
.weather-time-date {
  min-height: var(--lh-xs);
}

.weather-time-card.is-day-start:not(:first-child) {
  border-left: 1px solid var(--border-strong);
}

.weather-time-main {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.weather-time-main .hz-icon {
  color: var(--primary);
  font-size: var(--fs-h2);
}

.weather-time-temp {
  font-family: var(--font-mono);
  font-size: var(--fs-body-lg);
  font-weight: 600;
  white-space: nowrap;
}

.weather-source-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}

.weather-source-note p {
  margin: 0;
}

.weather-workspace.is-loading .weather-map-wrap,
.weather-workspace.is-loading .weather-city-section {
  opacity: 0.58;
}

@media (max-width: 64rem) {
  .weather-main {
    padding-inline: var(--space-4);
  }

  .weather-workspace {
    grid-template-columns: minmax(0, 1fr) 22rem;
  }

  .weather-current {
    grid-template-columns: minmax(16rem, 1fr) minmax(25rem, 2fr);
  }

  .weather-current > .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .weather-map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .weather-map-actions {
    width: 100%;
  }
}

@media (max-width: 56rem) {
  .weather-main {
    gap: var(--space-4);
    padding: calc(var(--header-height) + var(--space-5)) var(--space-3) var(--space-8);
  }

  .weather-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .weather-intro h1 {
    font-size: var(--fs-h1);
    line-height: var(--lh-h1);
  }

  .weather-status {
    max-width: none;
    text-align: left;
  }

  .weather-current {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .weather-metrics {
    border-top: 1px solid var(--border);
  }

  .weather-metrics div {
    padding: var(--space-3) var(--space-2) 0;
    border-left: 0;
  }

  .weather-workspace {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .weather-map-surface {
    grid-template-rows: auto 28rem;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .weather-map-toolbar {
    padding: var(--space-4);
  }

  .weather-map-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .weather-segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .weather-resolution .select-wrapper,
  .weather-resolution .select {
    width: 100%;
  }

  .weather-rail {
    display: block;
    height: auto;
    overflow: visible;
  }

  .weather-current,
  .weather-city-section,
  .weather-timeline-section,
  .weather-calendar-section,
  .weather-history-section {
    padding: var(--space-4);
  }

  /* The list scrolls inside the page here, so give it enough height to show more than a few
     cities without pushing the forecast sections far down. */
  .weather-city-list {
    max-height: min(60vh, 32rem);
  }

  .weather-timeline-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .weather-calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 30rem) {
  .weather-map-surface {
    grid-template-rows: auto 23rem;
  }

  .weather-map-legend {
    right: var(--space-3);
    left: var(--space-3);
    justify-content: center;
  }

  .weather-map-legend i {
    min-width: 0;
    flex: 1;
  }

  .weather-current-summary {
    align-items: flex-start;
  }

  .weather-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-metrics div:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .weather-city-row-details {
    gap: var(--space-1) var(--space-2);
  }

  .weather-calendar-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .weather-calendar-meta {
    text-align: left;
  }

  .weather-history-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .weather-history-meta {
    text-align: left;
  }

  .weather-calendar-grid {
    grid-auto-columns: minmax(10rem, 72vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    scrollbar-gutter: stable;
  }
}

@media (prefers-reduced-motion: reduce) {
  .weather-workspace.is-loading .weather-map-wrap,
  .weather-workspace.is-loading .weather-city-section {
    transition: none;
  }
}
