/* Compact weather cards. Typography and text colors follow the active theme. */
.tempest-weather,
.tempest-forecast {
  --tempest-line: rgba(112, 133, 146, .32);
  --tempest-panel: rgba(104, 143, 163, .08);
  --tempest-accent: #4e8da8;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding: 1rem;
  border: 1px solid var(--tempest-line);
  border-radius: .8rem;
  background: transparent;
  box-shadow: 0 3px 14px rgba(30, 54, 68, .06);
  color: inherit;
}
.tempest-weather *, .tempest-weather *::before, .tempest-weather *::after,
.tempest-forecast *, .tempest-forecast *::before, .tempest-forecast *::after { box-sizing: border-box; }
.tempest-weather__header { margin: 0 0 .85rem; padding-left: .7rem; border-left: .2rem solid var(--tempest-accent); }
.tempest-weather__title, .tempest-forecast__title {
  margin: 0 0 .22rem;
  color: inherit;
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tempest-forecast__title { margin-bottom: .8rem; }
.tempest-weather__updated { margin: 0; font-size: .78em; line-height: 1.35; opacity: .9; }
.tempest-weather__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.4rem), 1fr));
  gap: .4rem;
}
.tempest-weather__metric {
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid var(--tempest-line);
  border-radius: .5rem;
  background: var(--tempest-panel);
}
.tempest-weather__label, .tempest-weather__value { display: block; overflow-wrap: anywhere; }
.tempest-weather__label { font-size: .76em; line-height: 1.3; opacity: .9; }
.tempest-weather__value { margin-top: .15rem; font-size: 1em; font-weight: 700; line-height: 1.25; }
.tempest-weather__message { margin: 0; }
.tempest-weather__warning {
  margin: 0 0 .75rem;
  padding: .55rem .65rem;
  border-left: .2rem solid currentColor;
  border-radius: .25rem;
  background: rgba(180, 120, 0, .12);
  color: inherit;
  font-size: .85em;
  font-weight: 600;
  line-height: 1.35;
}
.tempest-weather__credit, .tempest-forecast__credit { margin: .7rem 0 0; font-size: .75em; line-height: 1.35; opacity: .9; }
.tempest-weather__credit a, .tempest-forecast__credit a { color: inherit; text-decoration: underline; }

/* Forecast cards share the compact visual language of the observation card. */
.tempest-forecast__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: .4rem;
}
.tempest-forecast__day { min-width: 0; padding: .6rem; border: 1px solid var(--tempest-line); border-radius: .5rem; background: var(--tempest-panel); }
.tempest-forecast__date { margin: 0 0 .3rem; color: inherit; font-size: .88em; font-weight: 700; line-height: 1.3; }
.tempest-forecast__conditions { margin: 0 0 .3rem; font-size: .85em; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.tempest-forecast__reading { margin: .15rem 0; font-size: .8em; line-height: 1.35; }

/* List view keeps labels and readings aligned without overflowing narrow columns. */
.tempest-weather--list .tempest-weather__grid,
.tempest-forecast--list .tempest-forecast__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.tempest-weather--list .tempest-weather__metric,
.tempest-forecast--list .tempest-forecast__day {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .2rem .7rem;
  padding: .45rem 0;
  border: 0;
  border-bottom: 1px solid var(--tempest-line);
  border-radius: 0;
  background: transparent;
}
.tempest-weather--list .tempest-weather__metric { justify-content: space-between; }
.tempest-weather--list .tempest-weather__label { flex: 1 1 6.5rem; }
.tempest-weather--list .tempest-weather__value { margin: 0; }
.tempest-forecast--list .tempest-forecast__date { flex: 0 1 6rem; margin: 0; }
.tempest-forecast--list .tempest-forecast__conditions { flex: 1 1 6rem; margin: 0; }
.tempest-forecast--list .tempest-forecast__reading { margin: 0; }

/* All-station columns shrink according to available container width, including builders. */
.tempest-all-stations, .tempest-all-stations__grid { min-width: 0; max-width: 100%; }
.tempest-all-stations__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .85rem; align-items: start; }
.tempest-all-stations__grid > * { min-width: 0; }
.tempest-all-stations__unavailable { padding: .8rem 1rem; border: 1px solid rgba(112, 133, 146, .32); border-radius: .8rem; font-size: .875em; line-height: 1.4; }
.tempest-all-stations--cols-1 .tempest-all-stations__grid { grid-template-columns: minmax(0, 1fr); }
.tempest-all-stations--cols-2 .tempest-all-stations__grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(14.5rem, calc(50% - .425rem))), 1fr)); }
.tempest-all-stations--cols-3 .tempest-all-stations__grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(14.5rem, calc(33.3333% - .5667rem))), 1fr)); }
.tempest-all-stations--cols-4 .tempest-all-stations__grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(14.5rem, calc(25% - .6375rem))), 1fr)); }

/* Keep text readable and break long values in narrow builder columns. */
.tempest-weather__updated,
.tempest-weather__warning,
.tempest-weather__message,
.tempest-weather__credit,
.tempest-forecast__date,
.tempest-forecast__reading,
.tempest-forecast__credit,
.tempest-all-stations__unavailable,
.tempest-all-stations__unavailable h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tempest-weather__label { font-size: .85em; }

/* On phones, each station takes the full available width. */
@media (max-width: 600px) {
  .tempest-all-stations .tempest-all-stations__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tempest-weather__label,
  .tempest-weather__updated,
  .tempest-weather__credit,
  .tempest-forecast__credit { font-size: .875em; }
  .tempest-weather,
  .tempest-forecast,
  .tempest-all-stations__unavailable {
    padding: .8rem;
  }
}
