:root {
  color-scheme: light dark;
  --surface: light-dark(#f1f5f7, #111c23);
  --card: light-dark(#fff, #182832);
  --text: light-dark(#1a2e39, #e3edf2);
  --muted: light-dark(#4c6370, #a5bbc7);
  --line: light-dark(#c6d6de, #405c6b);
  --accent: light-dark(#08647a, #83d8e9);
  --selected: light-dark(#d8f0f5, #173e48);
  --good: light-dark(#28603e, #9ad9ae);
  --caution: light-dark(#854700, #ffbe80);
  font:
    100%/1.55 system-ui,
    sans-serif;
  color: var(--text);
  background: var(--surface);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  width: min(100% - 2rem, 60rem);
  margin: 2rem auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1.1;
  margin-block: 0.25rem 1rem;
}

h2 {
  font-size: 1.3rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

form,
.status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-bar {
  justify-content: space-between;
  margin-block: 1rem;
}

input,
button {
  min-height: 2.75rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--text);
  background: var(--card);
  font: inherit;
}

input {
  flex: 1 1 6rem;
  min-width: 6rem;
  max-width: 15rem;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

.overview,
.week {
  display: grid;
  gap: 0.65rem;
}

.overview {
  grid-template-columns: 1fr 1fr;
}

.week {
  grid-template-columns: repeat(auto-fit, minmax(min(7rem, 100%), 1fr));
  margin-top: 0.5rem;
}

.week button {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  text-align: start;
}

.week button[aria-pressed="true"] {
  background: var(--selected);
  border-color: var(--accent);
}

.card,
.hourly {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--card);
}

.card {
  padding: 1rem;
}

section + section,
.overview + section {
  margin-top: 1.25rem;
}

.overview section {
  margin: 0;
}

.muted,
footer,
#status {
  color: var(--muted);
  font-size: 0.88rem;
}

#bike-note {
  font-weight: 650;
  margin-block: 0.2rem;
}

[data-tone="good"] {
  color: var(--good);
}

[data-tone="caution"] {
  color: var(--caution);
}

.hourly {
  overflow-x: auto;
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.45rem 0.75rem;
  text-align: start;
}

tbody tr {
  border-top: 1px solid var(--line);
}

footer {
  margin-top: 1.5rem;
}

a {
  color: var(--accent);
}

@media (max-width: 38rem) {
  main {
    margin-block: 1.15rem;
  }

  .overview {
    grid-template-columns: 1fr;
  }
}
