:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #1d1d1f;
  background: #fff;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  --ink: #1d1d1f;
  --muted: #5e5e65;
  --line: #e6e6e9;
  --sidebar: #f3f3f5;
  --surface: #f7f7f8;
  --selected: #e8e8ed;
  --blue: #0056be;
  --ring: #1680f5;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { display: grid; grid-template-columns: 232px minmax(0, 1fr); margin: 0; line-height: 1.5; }
a { color: var(--blue); text-underline-offset: .2em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 3; padding: 8px 12px; background: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-y: auto;
  padding: 24px 16px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 28px; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand img { display: block; object-fit: contain; mix-blend-mode: multiply; }
.sidebar h2 { margin: 0 8px 8px; font-size: .875rem; color: var(--muted); font-weight: 650; }
#groups { display: grid; gap: 2px; }
#groups button, .sidebar-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 6px 9px;
  color: var(--muted);
  font-size: .875rem;
  text-align: start;
  text-decoration: none;
}
#groups button:hover, .sidebar-links a:hover, #groups button[aria-pressed="true"] { color: var(--ink); background: var(--selected); }
#groups button[aria-pressed="true"] { font-weight: 650; }
.group-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.sidebar-links { display: grid; margin-top: auto; padding-top: 12px; }
.sidebar-links a:first-child { border-top: 1px solid var(--line); border-radius: 0; }

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 44px);
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  background: #fffffff2;
}
.section-name { font-size: .95rem; font-weight: 650; }
.control-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: .875rem;
  text-decoration: none;
}
.control-link:hover { background: var(--surface); }
.dashboard { width: min(100%, 1160px); margin: 0 auto; padding: 43px clamp(20px, 4vw, 52px) 30px; }
.page-heading h1 { margin: 0; font-size: clamp(2.1rem, 4vw, 2.75rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 720; }
.page-heading p { margin: 10px 0 0; color: var(--muted); }
.notice { padding: 13px 16px; margin: 24px 0; border-radius: 8px; background: #fff5df; color: #704a10; }
.run-overview { margin-top: 28px; border: 1px solid var(--line); border-radius: 12px; }
.totals, .revisions { margin: 0; display: grid; }
.totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.totals div { padding: 16px 20px; }
.totals div + div { border-left: 1px solid var(--line); }
.totals dt, .revisions dt { font-size: .875rem; color: var(--muted); }
.totals dd { margin: 2px 0 0; font-size: 1.85rem; font-weight: 690; line-height: 1.2; font-variant-numeric: tabular-nums; }
.revisions { grid-template-columns: 1fr 1fr minmax(0, 1.4fr); gap: 10px 22px; padding: 13px 20px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.revisions div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.revisions dd { margin: 0; font: .875rem var(--mono); overflow-wrap: anywhere; }

.measurements { margin-top: 36px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-heading h2 { margin: 0; font-size: 1.38rem; letter-spacing: -.02em; }
.section-heading a { font-size: .875rem; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; }
.search { flex: 1 1 210px; min-width: 0; }
.search input, .mobile-group select {
  width: 100%;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem;
}
.mobile-group { display: none; }
.segmented { display: flex; flex: none; align-items: center; gap: 2px; padding: 3px; background: var(--selected); border-radius: 8px; }
.segmented button { min-width: 62px; min-height: 34px; padding: 3px 10px; border: 0; border-radius: 6px; background: transparent; font-size: .875rem; }
.segmented button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px #0002; font-weight: 650; }
.segmented button:not([aria-pressed="true"]):hover { background: #ffffff80; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 540px; border-collapse: collapse; text-align: start; font-size: .9rem; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); }
th { background: var(--surface); font-weight: 650; white-space: nowrap; }
th button { border: 0; padding: 1px 0; background: transparent; font-weight: inherit; }
th button:hover, th[aria-sort="ascending"] button, th[aria-sort="descending"] button { color: var(--blue); }
th button span { color: var(--muted); font-size: .8125rem; font-weight: 400; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafafb; }
.number { text-align: end; font-variant-numeric: tabular-nums; }
td code { font: .875rem var(--mono); overflow-wrap: anywhere; }
td:first-child { width: 46%; }
.status-label { font-size: .875rem; white-space: nowrap; }
.status-effective { color: #176641; }
.status-skipped { color: var(--muted); }
.row-note { display: block; margin-top: 2px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.table-note, footer { font-size: .875rem; color: var(--muted); }
.table-note { margin: 9px 0 0; }
footer { margin-top: 24px; }
footer p { margin: 0; }

@media (max-width: 760px) {
  body { display: block; }
  .sidebar { display: none; }
  .dashboard { padding-top: 32px; }
  .mobile-group { display: block; flex: 1 1 130px; min-width: 0; position: relative; }
  .mobile-group select { appearance: none; padding-right: 29px; }
  .mobile-group::after { content: ""; position: absolute; right: 12px; top: 15px; width: 8px; height: 8px; pointer-events: none; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
  .totals div { padding: 12px 10px; }
  .totals dd { font-size: 1.55rem; }
  .revisions { padding: 11px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .revisions div:last-child { grid-column: 1 / -1; }
  .measurements { margin-top: 28px; }
}
