:root {
  color-scheme: light;
  --ink: #15181d;
  --muted: #667085;
  --line: #d9dee7;
  --paper: #f7f7f4;
  --panel: #ffffff;
  --green: #0d7d61;
  --red: #b42318;
  --gold: #ad7800;
  --blue: #2457a6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow a {
  color: var(--blue);
  text-decoration: none;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.json-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration-color: #bfd0ec;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.candidate {
  font-weight: 800;
}

.candidate-link {
  color: var(--ink);
  text-decoration-color: var(--line);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.candidate-link:hover {
  color: var(--blue);
  text-decoration-color: var(--blue);
}

.print-cell {
  min-width: 190px;
}

.print-value {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.muted {
  color: var(--muted);
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.section-title {
  margin: 28px 0 10px;
  font-size: 18px;
  line-height: 1.2;
}

.prose section {
  max-width: 880px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.prose h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
}

.prose p {
  margin: 0 0 10px;
  color: #344054;
  font-size: 15px;
  line-height: 1.6;
}

.detail-note {
  margin: 4px 0 18px;
  max-width: 920px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.samples-table {
  min-width: 1120px;
}

.reliability-table {
  min-width: 1180px;
  table-layout: fixed;
}

.reliability-table th:nth-child(1),
.reliability-table td:nth-child(1) {
  width: 150px;
}

.reliability-table th:nth-child(2),
.reliability-table td:nth-child(2),
.reliability-table th:nth-child(3),
.reliability-table td:nth-child(3),
.reliability-table th:nth-child(4),
.reliability-table td:nth-child(4) {
  width: 110px;
}

.reliability-table th:nth-child(5),
.reliability-table td:nth-child(5),
.reliability-table th:nth-child(6),
.reliability-table td:nth-child(6) {
  width: 320px;
}

.reliability-table th:nth-child(7),
.reliability-table td:nth-child(7) {
  width: 150px;
}

.compact-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  font-size: 13px;
  line-height: 1.25;
}

.compact-list strong {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.history-panel {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.history-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 520px;
  height: 170px;
  padding: 18px 16px 14px;
}

.history-bar {
  position: relative;
  flex: 1 0 10px;
  max-width: 20px;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--green), var(--blue));
}

.history-bar span {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  display: none;
  transform: translateX(-50%);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.history-bar:hover span {
  display: block;
}

.history-table-wrap {
  margin-top: 10px;
}

.history-table {
  min-width: 1120px;
  table-layout: fixed;
}

.history-table th,
.history-table td {
  padding-right: 12px;
  padding-left: 12px;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 132px;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 86px;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 68px;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: 134px;
}

.history-table th:nth-child(5),
.history-table td:nth-child(5) {
  width: auto;
  min-width: 520px;
}

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
  width: 120px;
}

.history-table td {
  vertical-align: top;
}

.history-window {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.25;
}

.history-window span {
  display: block;
}

.history-window span:not(:first-child) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-print {
  font-size: 16px;
  font-weight: 800;
}

.calc-line {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid #e6eaf1;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc-terms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  white-space: normal;
}

.calc-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.calc-final {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: normal;
}

.calc-terms + .calc-final {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #edf0f5;
}

.calc-final strong {
  color: var(--ink);
}

.calc-final-rule {
  color: var(--muted);
}

.calc-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.calc-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid #e6eaf1;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc-step strong {
  color: var(--ink);
}

.calc-step.selected {
  border-color: #b9d2ff;
  background: #f3f7ff;
  color: var(--ink);
}

.calc-badge {
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.valid-text {
  color: var(--green);
  font-weight: 800;
}

.invalid-text {
  color: var(--red);
  font-weight: 800;
}

.flag {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.flag.NO_PRINT {
  background: #fff1f0;
  color: var(--red);
}

.flag.TWO_VENUE,
.flag.WEIGHT_BOOTSTRAP {
  background: #fff7df;
  color: var(--gold);
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }
}
