/* ==========================================================================
   /keyboard-comparison/ — page-specific rules only.
   Everything else comes from /assets/css/design-system.css.
   ========================================================================== */

/* Two session pickers. One column on phones, two from 768px up. */
.cmp-pickers {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space);
}

.cmp-side {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.cmp-side__tag { margin: 0; }

/* Keep a metric value and its unit on one baseline: .metric__value is display:block
   in the design system, which would otherwise push "ms" onto its own line. */
.metric__row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.15rem;
  min-inline-size: 0;
}

.metric__row .metric__value { display: inline-block; }

/* The verdict sentence. Colour is never the only signal — the words carry the
   meaning and the state is also spelled out in .verdict text itself. */
.verdict {
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
  margin-block-start: var(--space);
  padding-inline-start: 0.75rem;
  border-inline-start: 3px solid var(--border-strong);
}

.verdict--clear { border-inline-start-color: var(--accent); }
.verdict--maybe { border-inline-start-color: var(--warn); }
.verdict--none  { border-inline-start-color: var(--text-3); }

/* Worked arithmetic, one step per line. */
.calc {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.calc li + li { border-block-start: 1px solid var(--border); }
.calc b { color: var(--text); font-weight: 600; }

/* Paired charts: stacked on phones, side by side from 768px. */
.chart-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space);
}

.chart-pair > .chart { min-inline-size: 0; }

/* Two charts in one row are half as wide, so they get a shorter box. */
@media (min-width: 768px) {
  .cmp-pickers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-pair > .chart { --chart-h: clamp(180px, 22vw, 260px); }
}

/* Chart legend swatches match the series colours kb-charts.js uses for A and B. */
.legend-a { color: var(--c1); }
.legend-b { color: var(--c2); }

/* The "Better" column reads A / B / Equal / —, never colour alone. */
.cell-better { white-space: nowrap; font-weight: 600; color: var(--text); }
.cell-better[data-better="none"] { color: var(--text-2); font-weight: 400; }

.env-warn-list { margin: 0; padding-inline-start: 1.2rem; }
.env-warn-list li + li { margin-block-start: 0.25rem; }
