:root {
  color-scheme: light;
  --ink: #182337;
  --secondary: #5d6b80;
  --quiet: #65758b;
  --paper: #f3f5f8;
  --surface: #ffffff;
  --border: #dde4ec;
  --brand: #2859c7;
  --accent: #3567df;
  --navy: #162235;
  --up: #9e373b;
  --down: #187259;
  --num: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, .plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.shell { width: min(1400px, calc(100% - 64px)); margin-inline: auto; }

.masthead { background: var(--navy); color: #f8fafc; }
.masthead-inner { display: flex; align-items: center; min-height: 54px; }
.brand {
  color: inherit;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 750;
  white-space: nowrap;
  letter-spacing: -0.038em;
}
.brand span { color: #b9ccff; }

.dashboard { padding-block: 23px 22px; }
.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 16px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 2.4vw, 1.95rem); line-height: 1.2; font-weight: 730; letter-spacing: -0.033em; }
.updated { color: var(--secondary); font-size: 0.8125rem; }

.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.chart-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.card-header { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 8px; padding: 9px 12px 0; }
.card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9375rem;
  font-weight: 680;
  line-height: 1.3;
}
.local-ranges {
  display: inline-flex;
  flex: none;
  gap: 1px;
  padding: 2px;
  border: 1px solid #e0e7f0;
  border-radius: 5px;
  background: #f3f6fa;
}
.local-ranges label { position: relative; cursor: pointer; }
.local-ranges span {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 24px;
  padding-inline: 2px;
  border-radius: 3px;
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 560;
  white-space: nowrap;
}
.local-ranges label:hover span { color: var(--brand); }
.local-ranges input:checked + span {
  background: var(--surface);
  box-shadow: 0 0 0 1px #dce5f3;
  color: var(--brand);
  font-weight: 680;
}
.local-ranges input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -1px; }
.reading { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 2px; min-height: 29px; margin: 3px 12px 0; }
.value { font: 680 clamp(1.14rem, 1.45vw, 1.42rem)/1.15 var(--num); letter-spacing: -0.055em; white-space: nowrap; }
.unit { color: var(--quiet); font-size: 0.75rem; white-space: nowrap; }
.change { margin-inline-start: 4px; font: 620 0.75rem var(--num); white-space: nowrap; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--secondary); }
.stale { color: #8a5718; font-size: 0.75rem; }

.plot { position: relative; height: 155px; margin: 5px 8px 0 6px; outline-offset: -1px; cursor: crosshair; }
.plot canvas { display: block; width: 100%; height: 100%; }
.plot-empty { display: grid; place-items: center; cursor: default; }
.empty { max-width: 25ch; padding-inline: 10px; color: var(--secondary); font-size: 0.8125rem; text-align: center; }
.guide, .marker, .tooltip { pointer-events: none; position: absolute; top: 0; left: 0; }
.guide { width: 1px; background: #8a9bb986; }
.marker { width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); margin: -4px; }
.tooltip {
  min-width: 122px;
  z-index: 2;
  padding: 7px 9px;
  border-radius: 5px;
  background: #162235;
  color: #f6f8ff;
  box-shadow: 0 4px 10px #14254a28;
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: nowrap;
}
.tooltip time { display: block; color: #cbd6e8; }
.point-value { display: block; margin-top: 3px; font: 650 0.8125rem var(--num); }
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-inline: 12px;
  padding-block: 7px;
  border-top: 1px solid #eff2f6;
  color: var(--quiet);
  font-size: 0.75rem;
}
.source { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--brand); }
.source:hover, .site-footer a:hover { text-decoration: underline; }
.window { flex: none; white-space: nowrap; }
.site-footer { padding-block: 0 21px; color: var(--secondary); font-size: 0.75rem; }
.site-footer a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 1080px) {
  .shell { width: calc(100% - 42px); }
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 790px) {
  .dashboard { padding-block-start: 19px; }
  .chart-grid { gap: 10px; }
  .plot { height: 142px; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 26px); }
  .page-heading { display: grid; margin-bottom: 13px; }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .plot { height: 153px; }
}
