:root {
  color-scheme: dark;
  --bg: #0c141d;
  --surface: #15212e;
  --subtle: #102a2a;
  --line: #3e5265;
  --grid: #2e4255;
  --text: #edf5fc;
  --muted: #afc4d6;
  --accent: #73e5c4;
  --amber: #ffcc78;
  --orange: #ffa78f;
  --red: #ffa1b4;
}
:root:has(meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
  --bg: #eff4f8;
  --surface: #fff;
  --subtle: #e4f5ef;
  --line: #879dae;
  --grid: #c5d2df;
  --text: #14283b;
  --muted: #425c71;
  --accent: #086c57;
  --amber: #815700;
  --orange: #a13d19;
  --red: #a2143e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.45 system-ui, sans-serif; }
main { width: min(100% - 1.5rem, 76rem); margin-inline: auto; padding: 1.1rem 0 2.5rem; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--accent); text-underline-offset: .16em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.masthead, .masthead nav, .section-header { display: flex; align-items: center; justify-content: space-between; gap: .55rem; flex-wrap: wrap; }
.masthead { margin-bottom: .85rem; }
h1 { font-size: clamp(1.35rem, 1rem + 1.45vw, 2rem); letter-spacing: -.035em; }
h2, h3 { font-size: 1.1rem; letter-spacing: -.015em; }
.masthead nav { gap: .8rem; }
.masthead a { font-size: .85rem; }
button, select {
  min-height: 2.45rem;
  padding: .35rem .62rem;
  border: 1px solid var(--line);
  border-radius: .42rem;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}
button[aria-pressed="true"] { border-color: var(--accent); background: var(--subtle); }
.health {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .24rem .75rem;
  padding: .52rem .7rem;
  margin-bottom: .65rem;
  border: 1px solid var(--line);
  border-inline-start: .22rem solid var(--tone);
  border-radius: .48rem;
  background: var(--surface);
  --tone: var(--muted);
}
.health[data-health="normal"] { --tone: var(--accent); }
.health[data-health="watch"], .health[data-health="stale"] { --tone: var(--amber); }
.health[data-health="high"] { --tone: var(--red); }
.health-copy { display: flex; align-items: baseline; flex-wrap: wrap; gap: .08rem .7rem; }
.health strong { color: var(--tone); }
.health p, #health-detail, .metric-note, .muted, #status, .chart output, .thresholds {
  color: var(--muted);
  font-size: .85rem;
}
.overview, #charts { display: grid; gap: .6rem; }
.overview { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.1rem), 1fr)); }
.resource, .chart, .disclosure { background: var(--surface); border: 1px solid var(--line); border-radius: .62rem; }
.resource { display: grid; align-content: start; gap: .32rem; min-width: 0; padding: .62rem .72rem; }
.resource h2 { font-size: .91rem; }
.resource h2 span { color: var(--muted); font-size: .76rem; font-weight: 500; }
.reading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .24rem; }
.reading strong { font-size: clamp(1.34rem, 1.03rem + 1.15vw, 2.02rem); line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.046em; }
.reading span { font-size: .78rem; color: var(--muted); }
.resource meter { width: 100%; height: .55rem; }
.resource meter::-webkit-meter-bar { background: var(--grid); border: 0; border-radius: 2rem; }
.resource meter::-webkit-meter-optimum-value { background: var(--accent); }
.resource meter::-webkit-meter-suboptimum-value { background: var(--amber); }
.resource meter::-webkit-meter-even-less-good-value { background: var(--red); }
.resource meter:-moz-meter-optimum::-moz-meter-bar { background: var(--accent); }
.resource meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--amber); }
.resource meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--red); }
.metric-pairs { display: grid; gap: .08rem .85rem; }
.metric-pairs div { display: flex; align-items: baseline; justify-content: space-between; gap: .35rem; }
.metric-pairs dt { color: var(--muted); font-size: .78rem; }
.metric-pairs dd { font-weight: 680; font-size: .92rem; font-variant-numeric: tabular-nums; }
.history { margin-top: 1.25rem; }
#periods { display: flex; flex-wrap: wrap; gap: .28rem; }
#periods button { min-width: 2.65rem; }
#status { min-height: 1.45em; margin: .35rem 0 .65rem; }
#status[data-warning="true"] { color: var(--amber); }
#charts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 27rem), 1fr)); }
.chart { min-width: 0; padding: .65rem .72rem; }
.chart-header, .chart-context, .inspector { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .6rem; }
.chart-header, .chart-context { justify-content: space-between; }
.chart-header select { max-inline-size: 100%; }
.chart-context { color: var(--muted); font-size: .8rem; margin-block: .35rem .15rem; min-height: 1.2em; }
.chart-context .peak { color: var(--text); }
.chart-context .peak[data-level="high"] { color: var(--red); }
.chart-context .peak[data-level="watch"] { color: var(--amber); }
.plot { min-height: 186px; overflow: clip; }
.plot .u-over { touch-action: pan-y; }
.inspector { min-height: 1.6rem; align-items: center; }
.inspector input { inline-size: min(100%, 8rem); min-block-size: 1.7rem; margin: 0; accent-color: var(--accent); }
.chart output { display: block; font-variant-numeric: tabular-nums; }
.thresholds { display: flex; gap: .65rem; flex-wrap: wrap; list-style: none; padding: 0; margin: .1rem 0 .15rem; }
.thresholds li::before, .reference::before { content: ''; vertical-align: middle; display: inline-block; width: .9rem; border-top: 2px dashed var(--threshold, var(--muted)); margin-inline-end: .25rem; }
.thresholds li:nth-child(1) { --threshold: var(--amber); }
.thresholds li:nth-child(2) { --threshold: var(--orange); }
.thresholds li:nth-child(3) { --threshold: var(--red); }
.disclosure { margin-top: .65rem; padding: .55rem .72rem; }
.disclosure summary { min-height: 1.8rem; cursor: pointer; font-weight: 650; }
.disclosure[open] summary { margin-bottom: .42rem; }
.disclosure p + p { margin-top: .45rem; }
.disclosure li { margin-block: .3rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .55rem; margin-block: .55rem; }
.facts dt { color: var(--muted); font-size: .84rem; }
.facts dd { font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; max-block-size: min(34rem, 72vh); margin: .4rem 0; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .84rem; font-variant-numeric: tabular-nums; }
th, td { padding: .42rem .52rem; border-bottom: 1px solid var(--grid); white-space: nowrap; text-align: right; }
thead { position: sticky; inset-block-start: 0; z-index: 2; background: var(--surface); color: var(--muted); }
tr > :first-child { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); text-align: left; box-shadow: 1px 0 var(--grid); }
thead tr > :first-child { z-index: 3; }
th[scope="rowgroup"] { color: var(--accent); }
td:last-child { text-align: left; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 36rem) {
  .masthead nav { gap: .55rem; }
  .masthead button { padding-inline: .4rem; font-size: .83rem; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource.system { grid-column: 1 / -1; }
  .system .metric-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #periods { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #periods button { min-width: 0; padding-inline: .12rem; font-size: .79rem; }
  tr > :first-child { max-inline-size: 8.5rem; white-space: normal; }
}
