:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #60707d;
  --line: #d7dee2;
  --panel: #ffffff;
  --band: #f4f7f8;
  --heat: #c2412d;
  --heat-soft: #f4b39d;
  --cool: #187a7a;
  --cool-soft: #b7ded8;
  --gold: #b47b12;
  --navy: #243b53;
  --shadow: 0 14px 34px rgba(24, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fbfcfc;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px clamp(20px, 5vw, 64px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1,
h2,
h3,
p {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: 0;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar nav a {
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 6px;
  background: #fff;
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 56px;
}

.eyebrow {
  color: var(--cool);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.band,
.site-profile,
.image-panel,
.site-figure {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
  border-left: 5px solid var(--navy);
  min-height: 132px;
}

.metric.good {
  border-left-color: var(--cool);
}

.metric.warn {
  border-left-color: var(--heat);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  line-height: 1.15;
}

.band {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.baseline-band,
.notes-band {
  background: var(--band);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
}

.section-head > p {
  max-width: 560px;
  color: var(--muted);
}

.split,
.site-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.chart-panel {
  min-width: 0;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(132px, 180px) minmax(180px, 1fr) 48px;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.bar-label {
  color: var(--navy);
  font-weight: 650;
}

.bar-track {
  display: block;
  height: 14px;
  background: #e8edef;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--heat));
  border-radius: inherit;
}

.image-panel,
.site-figure {
  margin: 0;
  padding: 12px;
}

.image-panel img,
.site-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filters button,
.site-picker select {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 11px;
  font: inherit;
}

.filters button.active {
  border-color: var(--cool);
  background: #e7f3f0;
  color: #0b5959;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  background: #edf3f3;
  color: var(--navy);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

td.number,
th.number {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

.delta {
  display: inline-block;
  min-width: 58px;
  border-radius: 999px;
  padding: 2px 8px;
  text-align: center;
  font-weight: 700;
}

.delta.good {
  color: #075b5b;
  background: var(--cool-soft);
}

.delta.bad {
  color: #7b1f12;
  background: var(--heat-soft);
}

.delta.neutral {
  color: var(--muted);
  background: #e8edef;
}

.site-picker {
  display: grid;
  gap: 4px;
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 700;
}

.site-picker-card {
  min-width: 280px;
  padding: 12px;
  border: 2px solid var(--cool);
  background: #eef8f6;
  box-shadow: var(--shadow);
}

.site-picker select {
  width: 100%;
  border-color: #79b9b2;
  background:
    linear-gradient(45deg, transparent 50%, var(--cool) 50%),
    linear-gradient(135deg, var(--cool) 50%, transparent 50%),
    linear-gradient(to right, #d8ebe8, #d8ebe8);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    calc(100% - 40px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 70%;
  background-repeat: no-repeat;
  padding-right: 48px;
}

.site-profile {
  padding: 18px;
}

.site-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.site-description {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 0.98rem;
}

.site-title h3 {
  font-size: 1.45rem;
}

.risk-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff7e6;
  color: #7a510b;
  white-space: nowrap;
}

.site-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.site-stats div {
  border: 1px solid var(--line);
  padding: 10px;
  background: #fbfcfc;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
}

dd {
  margin: 2px 0 0;
  font-weight: 750;
}

.components {
  display: grid;
  gap: 10px;
}

.component-row {
  display: grid;
  grid-template-columns: 112px minmax(140px, 1fr) 42px;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
}

.component-fill {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--cool);
}

.risk-explainer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.risk-explainer article {
  border: 1px solid var(--line);
  background: #fbfcfc;
  padding: 16px;
}

.risk-explainer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
}

.risk-explainer p,
.plain-note {
  color: var(--muted);
}

.plain-note {
  margin-top: 14px;
  max-width: 820px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.note-grid article {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px;
}

.note-grid h3 {
  margin-bottom: 7px;
}

.note-grid p,
.caveat {
  color: var(--muted);
}

.caveat {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

@media (max-width: 900px) {
  .topbar,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .summary-grid,
  .split,
  .site-grid,
  .note-grid,
  .risk-explainer {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: minmax(104px, 0.8fr) minmax(140px, 1fr) 42px;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100vw - 20px, 1180px);
  }

  .metric,
  .band,
  .site-profile {
    padding: 14px;
  }

  .site-stats {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
