:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f2;
  color: #172824;
  --muted: #50645d;
  --line: #dce6df;
  --accent: #136750;
  --mint: #dcf0e7;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 2px solid #277d63; outline-offset: 3px; }
.top {
  min-height: 72px;
  padding: 0 max(5vw, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fcfdfa;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 700; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #173d33; color: #e2f7ed; font-size: 16px; }
main { width: min(1160px, 90vw); margin: 44px auto 60px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.18; letter-spacing: -.04em; }
h2 { font-size: 20px; letter-spacing: -.02em; }
p { color: var(--muted); line-height: 1.6; }
.heading, .panel-heading, .controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.heading { margin-bottom: 24px; }
.heading p, .panel-heading p { margin-top: 6px; font-size: 14px; }
.button, select, .login input {
  min-height: 40px; padding: 8px 13px; border-radius: 8px; border: 1px solid var(--line);
  color: #20332d; background: #fbfdfb;
}
.button.primary { background: #165944; border-color: #165944; color: white; font-weight: 650; }
.button.quiet:hover, select:hover { background: #eaf4ee; }
.login {
  margin: 11vh auto 0; max-width: 425px; padding: 34px;
  border: 1px solid var(--line); border-radius: 17px; background: white;
}
.login h1 { font-size: 30px; }
.login p { margin-top: 11px; }
.login form { margin-top: 24px; display: grid; gap: 9px; }
.login label { color: var(--muted); font-size: 14px; }
.login input { width: 100%; }
.login .primary { margin-top: 6px; }
.load { text-align: center; margin-top: 8vh; }
.error { color: #9f3223; font-size: 14px; }
.error:not(:empty) { margin-block: 12px; }
.metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.metric { min-width: 0; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: #fcfefc; }
.metric:first-child { background: var(--mint); border-color: #cfe6da; }
.metric-name { color: var(--muted); font-size: 13px; }
.metric-value { margin-top: 9px; font-size: clamp(18px, 2.3vw, 27px); font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.unit { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 5px; }
.panel { background: #fcfefc; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.empty { padding: 40px 28px; }
.empty p { margin-top: 9px; }
.segments { display: flex; gap: 3px; padding: 3px; background: #ebf0eb; border-radius: 9px; white-space: nowrap; }
.segments button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 7px 10px; font-size: 13px; }
.segments button[aria-pressed="true"] { color: #154f3b; background: #fff; font-weight: 650; }
.plot { position: relative; height: 284px; margin-top: 17px; }
canvas { width: 100%; height: 100%; display: block; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; background: #f7faf7; border-radius: 8px; }
.point-control { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 4px 2px 0; }
.point-control input { width: min(28%, 220px); accent-color: var(--accent); }
.point-control output, #history-label { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.history { margin-top: 18px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 15px; white-space: nowrap; font-size: 14px; }
th, td { text-align: right; padding: 11px 10px; border-bottom: 1px solid #e7eee8; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
#more { margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 860px) { .metrics { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) {
  main { margin-top: 27px; width: 92vw; }
  .top { min-height: 59px; }
  .heading, .panel-heading { align-items: flex-start; flex-direction: column; }
  .panel { padding: 15px; }
  .range-controls { flex-wrap: wrap; justify-content: flex-start; gap: 7px; }
  .metrics { gap: 7px; }
  .metric { padding: 11px 9px; }
  .plot { height: 225px; }
  .point-control output { font-size: 12px; }
  .login { padding: 25px; }
}
