.kernel-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  border: 0;
}
.kernel-choices label span {
  display: block;
  padding: 6px 16px;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  color: var(--brand-purple);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.kernel-choices label:hover span { background: var(--tint); }
.kernel-choices input:checked + span { color: var(--surface); background: var(--brand-purple); border-color: var(--brand-purple); }
.kernel-choices input:focus-visible + span { outline: 3px solid var(--brand-purple); outline-offset: 3px; }
.kernel-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-block: 18px;
}
.kernel-pair .card { display: flex; flex-direction: column; }
.kernel-pair .card-head { padding-bottom: 5px; }
.kernel-pair .card-head p { line-height: 1.6rem; }
.kernel-pair .kernel-equation { font: 1.15rem var(--serif); color: var(--ink); }
.kernel-equation sup, .kernel-cutoff sup { line-height: 0; }
#kernel-contour { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; }
.kernel-details {
  flex: 1;
  margin-top: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
}
.kernel-sample { margin: 14px 0 0; }
.kernel-sample .matrix-bracket { display: block; padding: 2px 0; }
.kernel-sample table {
  width: 100%;
  border-spacing: 0;
  font: 1rem var(--serif);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.kernel-sample td { padding: 1px 4px; white-space: nowrap; }
.kernel-sample figcaption, .kernel-cutoff { color: var(--muted); font-size: .9rem; }
.kernel-sample figcaption { margin-top: 8px; }
.kernel-error { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-block: 14px 4px; }
.kernel-error output { color: var(--brand-purple); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kernel-theory h3 { margin-bottom: 6px; }
.kernel-theory p + p { margin-top: 8px; }
.kernel-reference { margin: 18px 0 0; color: var(--muted); font-size: .93rem; }
@media (max-width: 740px) {
  .kernel-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kernel-pair { grid-template-columns: 1fr; gap: 16px; }
  .kernel-details { padding-inline: 18px; }
}
@media (max-width: 460px) {
  .kernel-choices { gap: 6px; }
  .kernel-choices label span { padding: 6px 9px; font-size: .92rem; }
}
