:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 100%;
  color: #142d2a;
  background: #f1f6f4;
  --muted: #536c65;
  --line: #dbe6e1;
  --green: #0b6954;
  --green-soft: #e3f2ec;
  --red: #aa433c;
  --red-soft: #faeeeb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button:not(:disabled), select:not(:disabled) { cursor: pointer; }
a { color: inherit; text-underline-offset: .24em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.site-header { background: #142f2a; color: #f8fffc; }
.header-inner, main { width: min(100% - 3rem, 72rem); margin: 0 auto; }
.header-inner { min-height: 4.125rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 720; letter-spacing: -.028em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: .625rem;
  background: #a4e9cb;
  color: #16372e;
  font-size: .875rem;
  font-weight: 800;
}
.source { font-size: .875rem; color: #d3e7e0; text-decoration-color: #84a99b; }
.site-header a:focus-visible { outline-color: #a4e9cb; }

main { padding: 2.1rem 0 3rem; }
.page-heading { margin-bottom: 1.5rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.55rem); font-weight: 740; letter-spacing: -.045em; line-height: 1.2; }
.page-heading p { margin-top: .6rem; color: var(--muted); line-height: 1.55; }

.view-controls, .view-switch, .date-control { display: flex; align-items: center; }
.view-controls { justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap; margin-bottom: .9rem; }
.view-switch { gap: .2rem; background: #e6eeeb; padding: .24rem; border-radius: .7rem; }
.view-switch button {
  border: 0;
  padding: .5rem .9rem;
  border-radius: .48rem;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  min-height: 2.5rem;
}
.view-switch button[aria-pressed="true"] { background: white; color: var(--green); box-shadow: 0 1px 3px #183d281a; }
.view-switch button:disabled { opacity: .58; }
.date-control { gap: .55rem; flex-wrap: wrap; font-size: .875rem; color: var(--muted); }
#base-day { margin-right: .3rem; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  width: .4rem;
  height: .4rem;
  right: .87rem;
  top: 44%;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
select {
  appearance: none;
  border: 1px solid #c3d4cd;
  background: white;
  border-radius: .55rem;
  padding: .58rem 2.2rem .58rem .7rem;
  min-height: 2.5rem;
  font-variant-numeric: tabular-nums;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}
.metrics button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  min-width: 0;
  min-height: 6.1rem;
  padding: .75rem .85rem;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: .75rem;
}
.metrics button:hover { border-color: #79ab9b; }
.metrics button[aria-pressed="true"] { border-color: #3b9179; box-shadow: inset 0 0 0 1px #3b9179; background: #f1fbf6; }
.metric-label { font-size: .875rem; color: var(--muted); font-weight: 620; }
.metrics strong { font-size: 1.7rem; line-height: 1.12; font-weight: 730; font-variant-numeric: tabular-nums; }
.metric-detail { font-size: .8125rem; color: var(--muted); }
.positive { color: var(--green); }
.negative { color: var(--red); }

.results { border: 1px solid var(--line); border-radius: .9rem; background: white; overflow: clip; }
.results-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: .9rem 1.2rem; }
.results h2 { font-size: 1.15rem; font-weight: 680; }
.results-heading { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.capture { margin-top: .25rem; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.search { width: min(100%, 15rem); position: relative; }
.search input {
  width: 100%;
  min-height: 2.6rem;
  border: 1px solid #c3d4cd;
  border-radius: .55rem;
  background: #f8fbfa;
  padding: .55rem .65rem .55rem 2.15rem;
}
.search-icon {
  position: absolute;
  left: .82rem;
  top: .8rem;
  width: .75rem;
  height: .75rem;
  border: 1.6px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: .34rem;
  height: 1.6px;
  top: .62rem;
  left: .55rem;
  background: var(--muted);
  transform: rotate(45deg);
}

table { width: 100%; table-layout: fixed; border-collapse: collapse; }
col.is-heat { width: clamp(4.2rem, 14vw, 9rem); }
col.is-change { width: clamp(5.4rem, 17vw, 10rem); }
thead { background: #edf4f1; color: #3d5e54; }
th, td { padding: .63rem 1.2rem; text-align: left; overflow-wrap: anywhere; }
thead th { font-size: .875rem; font-weight: 680; }
tbody th { font-weight: 600; white-space: pre-wrap; }
tbody td { font-variant-numeric: tabular-nums; }
tbody tr { border-bottom: 1px solid #e8efec; }
tbody tr:hover { background: #f7fbf9; }
.heat-cell { text-align: right; }
.missing { color: var(--muted); }
.movement {
  display: inline-block;
  font-size: .875rem;
  font-weight: 640;
  padding: .22rem .45rem;
  border-radius: .35rem;
  background: #edf2ef;
  color: #496157;
}
.movement.new, .movement.up { background: var(--green-soft); color: var(--green); }
.movement.dropped, .movement.down { background: var(--red-soft); color: var(--red); }
.notice { padding: 1.5rem 1.2rem; color: var(--muted); border-top: 1px solid var(--line); }
.notice[data-error="true"] { color: var(--red); }
.date-gap { padding: .6rem 1.2rem; color: var(--muted); font-size: .875rem; background: #edf4f1; }
.results-foot { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; flex-wrap: wrap; padding: .7rem 1.2rem; color: var(--muted); font-size: .8125rem; }
.count { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 44rem) {
  .header-inner, main { width: calc(100% - 1.5rem); }
  main { padding-top: 1.5rem; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics button { min-height: 5.2rem; padding: .65rem; }
  .results-head, .results-foot, .notice, .date-gap { padding-left: .7rem; padding-right: .7rem; }
  th, td { padding-left: .45rem; padding-right: .45rem; }
  th:first-child, td:first-child { padding-left: .7rem; }
}

@media (max-width: 24rem) {
  .search { width: 100%; }
  .movement { padding-left: .3rem; padding-right: .3rem; }
}
