.reveal .slides section {
  text-align: left;
}

.reveal .slides section h1,
.reveal .slides section h2,
.reveal .slides section h3 {
  text-align: center;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.reveal input,
.reveal button,
.reveal select,
.reveal textarea,
.reveal label,
.reveal summary {
  touch-action: manipulation;
}

.reveal input[type="range"] {
  touch-action: pan-x;
}

.reveal {
  font-size: 24px;
  color: #3f3f3f;
}

.reveal,
.reveal .slides,
.reveal .slide-background,
.reveal .slide-background-content {
  background: rgb(247, 247, 247);
}

.reveal h1 {
  font-size: 1.8em;
}

.reveal h2 {
  font-size: 1.4em;
}

.reveal h3 {
  font-size: 1.15em;
}

.back-link-row {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-top: 12px;
}

.back-link {
  display: inline-block;
  margin: 6px auto 0;
  font-size: 0.95em;
  letter-spacing: 0.03em;
  color: #1f1f1f;
  text-decoration: none;
}

.formula-line {
  margin: 18px auto 12px;
  text-align: center;
}

.button-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 12px auto 16px;
}

.slide-btn {
  display: block;
  margin: 0;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 0 #1b4c61;
  background: #2e6f8e;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.slide-btn:hover {
  background: #3a7f9f;
}

.slide-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #1b4c61;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px 10px;
  width: min(920px, 96%);
  margin: 0 auto 16px;
}

.sample-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-height: 26px;
}

.formula-pair-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: min(1080px, 98%);
  margin: 0 auto;
  flex-wrap: wrap;
}

.formula-output {
  width: min(940px, 96%);
  margin: 8px auto 0;
  min-height: 34px;
  text-align: center;
  overflow-wrap: anywhere;
}

.formula-output-inline {
  width: auto;
  min-width: 280px;
  margin: 4px 0 0;
}

.plot-narrow {
  display: block;
  width: 560px;
  max-width: 84%;
  margin: 10px auto 6px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #c4c4c4;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-slider {
  background: #2e6f8e;
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.9em;
}

.slider-value {
  display: inline-block;
  min-width: 54px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
