:root {
  --bg: #0f1216;
  --panel: #171c22;
  --line: #2b343e;
  --ink: #eef2f6;
  --muted: #9aa7b4;
  --dim: #6f7d8b;
  --low: #3fa66a;
  --mod: #d9a441;
  --high: #e2703a;
  --solar: #e8c15a;
  --accent: #5aa9e6;
  --r: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: clamp(22px, 3.6vw, 32px);
}

p {
  margin: 0;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

.sitehead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.name {
  font-weight: 700;
}

.name span,
.muted {
  color: var(--muted);
  font-weight: 400;
}

.dim {
  color: var(--dim);
  font-size: 13px;
}

.badge {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 12px;
}

.badge.stale {
  border-color: var(--mod);
  color: var(--mod);
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}

.panel + .panel {
  margin-top: 14px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.headline-copy,
.section-copy,
.details-copy {
  max-width: 70ch;
}

.headline-copy,
.section-copy {
  margin-top: 8px;
}

.section-title {
  font-size: 19px;
}

.chart-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.range-selector {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.range-option {
  min-width: 62px;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.range-option.selected {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.range-option:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.numbers-title {
  font-size: 17px;
}

.striphead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.strip-title {
  font-size: 14px;
  font-weight: 700;
}

.chart-mount {
  width: 100%;
  overflow: hidden;
}

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

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend-swatch {
  display: inline-block;
  width: 26px;
  height: 4px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: middle;
}

.legend-gust {
  background: linear-gradient(90deg, #3fa66a, #d9a441, #d0342c);
}

.legend-temp {
  background: linear-gradient(90deg, #2f6fd0, #9fd0c8, #d0342c);
}

.legend-solar {
  background: var(--solar);
}

details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 14px;
}

.details-copy {
  margin-top: 12px;
}

table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.l-low {
  color: var(--low);
}

.l-mod {
  color: var(--mod);
}

.l-high {
  color: var(--high);
}

.table-wrap {
  overflow-x: auto;
}

.foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

.foot p + p {
  margin-top: 6px;
}

.loading,
.error-state {
  color: var(--muted);
}

.stale-advisory {
  margin-top: 10px;
  color: var(--mod);
  font-size: 14px;
}

@media (max-width: 520px) {
  .wrap {
    padding-right: 12px;
    padding-left: 12px;
  }

  .sitehead {
    align-items: flex-start;
  }

  .badge {
    margin-left: 0;
  }

  .panel {
    padding: 14px;
  }

  .chart-intro {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .striphead {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .legend {
    gap: 8px 14px;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    padding: 6px 5px;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap tbody {
    display: block;
  }

  .table-wrap tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
  }

  .table-wrap tr:first-child {
    display: none;
  }

  .table-wrap td {
    min-width: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .table-wrap td:first-child,
  .table-wrap td:last-child {
    grid-column: span 2;
  }

  .table-wrap td::before {
    display: block;
    margin-bottom: 1px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }

  .table-wrap td:nth-child(1)::before {
    content: "Day";
  }

  .table-wrap td:nth-child(2)::before {
    content: "Risk";
  }

  .table-wrap td:nth-child(3)::before {
    content: "Impact";
  }

  .table-wrap td:nth-child(4)::before {
    content: "Highest gust";
  }

  .table-wrap td:nth-child(5)::before {
    content: "Temperature";
  }

  .table-wrap td:nth-child(6)::before {
    content: "Sunshine";
  }
}
