.cmp-scene {
  --cmp-focus: #2563eb;
  --cmp-focus-soft: #dbeafe;
  --cmp-calc: #6d28d9;
  --cmp-calc-soft: #ede9fe;
  --cmp-diff: #c2410c;
  --cmp-diff-soft: #ffedd5;
  --cmp-proven: #047857;
  --cmp-proven-soft: #d1fae5;
  --cmp-ink: #17345c;
  --cmp-muted: #718096;
  width: min(860px, 100%);
  color: var(--cmp-ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.cmp-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.cmp-progress i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #dbe4f0;
}

.cmp-progress i.is-done { background: #93c5fd; }
.cmp-progress i.is-now {
  width: 18px;
  background: var(--cmp-focus);
}

.cmp-caption {
  display: grid;
  min-height: 44px;
  place-content: center;
  margin-bottom: 6px;
  text-align: center;
}

.cmp-caption.is-empty { min-height: 12px; }

.cmp-caption strong {
  color: var(--cmp-ink);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 750;
  line-height: 1.25;
}

.cmp-pair {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  margin: 4px 0 18px;
  color: var(--cmp-ink);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  line-height: 1;
}

.cmp-pair.is-hero {
  margin: 28px 0 12px;
  animation: cmp-enter 0.5s ease;
}

.cmp-pair.is-live {
  margin: 0 0 18px;
  font-size: clamp(22px, 3vw, 32px);
  opacity: 0.72;
}

.cmp-pair.is-result {
  margin: 24px 0 8px;
  animation: cmp-enter 0.45s ease;
}

.cmp-pair.is-derived {
  font-size: clamp(28px, 4vw, 40px);
}

.cmp-sign {
  color: var(--cmp-focus);
  font-style: normal;
  min-width: 0.9em;
  text-align: center;
}

.cmp-sign.is-ask,
.cmp-pair.is-hero .cmp-sign {
  animation: cmp-soft-pulse 1.6s ease-in-out infinite;
}

.cmp-sign.is-match { color: var(--cmp-focus); }
.cmp-sign.is-diff { color: var(--cmp-diff); }
.cmp-scene.is-final .cmp-sign,
.cmp-pair.is-result .cmp-sign { color: var(--cmp-proven); animation: none; }

.cmp-plain,
.cmp-frac,
.cmp-root {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cmp-plain.is-focus,
.cmp-plain.is-now,
.cmp-frac.is-now {
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--cmp-focus-soft);
}

.cmp-frac {
  flex-direction: column;
  gap: 3px;
  min-width: 1.1em;
  font-size: 0.72em;
}

.cmp-frac-bar {
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
}

.cmp-frac-num,
.cmp-frac-den { line-height: 1; }

.cmp-root {
  gap: 1px;
  align-items: stretch;
}

.cmp-root-sym {
  font-weight: 600;
  transform: translateY(-4%);
}

.cmp-root-rad {
  padding: 0 2px 2px;
  border-top: 3px solid currentColor;
}

.cmp-stage {
  min-height: 92px;
  animation: cmp-enter 0.45s ease;
}

.cmp-digits {
  display: grid;
  justify-content: center;
  gap: 10px;
}

.cmp-digit-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.cmp-digit {
  display: grid;
  width: clamp(34px, 5vw, 48px);
  height: clamp(42px, 6vw, 56px);
  place-items: center;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--cmp-ink);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
}

.cmp-digit.is-comma {
  width: 18px;
  background: transparent;
  font-weight: 600;
}

.cmp-digit.is-past { opacity: 0.38; }
.cmp-digit.is-focus { transform: scale(1.06); }
.cmp-digit.is-match {
  color: var(--cmp-focus);
  background: var(--cmp-focus-soft);
}
.cmp-digit.is-diff {
  color: var(--cmp-diff);
  background: var(--cmp-diff-soft);
}
.cmp-digit.is-padded {
  color: var(--cmp-calc);
  background: var(--cmp-calc-soft);
  box-shadow: inset 0 0 0 2px #c4b5fd;
}

.cmp-digit-result {
  display: flex;
  justify-content: center;
  font-size: 28px;
}

.cmp-place-stack,
.cmp-bars,
.cmp-scales,
.cmp-transform,
.cmp-return,
.cmp-int-parts,
.cmp-length {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.cmp-place-row { width: min(640px, 100%); }

.cmp-places {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.cmp-place {
  display: grid;
  min-width: 72px;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.cmp-place strong {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
}

.cmp-place span {
  color: var(--cmp-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.cmp-place.is-extra {
  color: var(--cmp-diff);
  background: var(--cmp-diff-soft);
}

.cmp-bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 420px);
  align-items: center;
  gap: 12px;
  width: min(520px, 100%);
}

.cmp-bar-label {
  justify-self: end;
  font-size: 22px;
  font-weight: 800;
}

.cmp-bar {
  display: grid;
  grid-template-columns: repeat(var(--cells), minmax(0, 1fr));
  gap: 3px;
  height: 28px;
}

.cmp-bar-cell {
  min-width: 0;
  border-radius: 4px;
  background: #e2e8f0;
}

.cmp-bar-cell.is-filled { background: var(--cmp-focus); }

.cmp-cross {
  position: relative;
  display: grid;
  width: min(320px, 100%);
  margin: 0 auto;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 120px auto;
  place-items: center;
}

.cmp-cross-cell {
  z-index: 1;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 14px;
  background: #f8fafc;
  font-size: 28px;
  font-weight: 800;
}

.cmp-cross-cell.is-tl { grid-column: 1; grid-row: 1; }
.cmp-cross-cell.is-tr { grid-column: 2; grid-row: 1; }
.cmp-cross-cell.is-bl { grid-column: 1; grid-row: 3; }
.cmp-cross-cell.is-br { grid-column: 2; grid-row: 3; }

.cmp-cross-cell.is-lit {
  color: var(--cmp-calc);
  background: var(--cmp-calc-soft);
}

.cmp-cross-svg {
  position: absolute;
  inset: 18px 12px;
  width: calc(100% - 24px);
  height: calc(100% - 36px);
  overflow: visible;
}

.cmp-cross-line {
  fill: none;
  stroke: #93c5fd;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
}

.cmp-cross-line.is-on {
  animation: cmp-draw 0.7s ease forwards;
}

.cmp-cross-line.is-ad.is-on { stroke: var(--cmp-focus); }
.cmp-cross-line.is-bc.is-on { stroke: var(--cmp-calc); }

.cmp-equations {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  text-align: center;
}

.cmp-eq {
  color: var(--cmp-ink);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
}

.cmp-eq b { font-weight: 800; }
.cmp-eq.is-now { color: var(--cmp-calc); }
.cmp-eq.is-past { color: var(--cmp-muted); font-size: 18px; }

.cmp-transform,
.cmp-return,
.cmp-int-parts,
.cmp-length {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
}

.cmp-arrow {
  color: var(--cmp-muted);
  font-weight: 600;
}

.cmp-note {
  color: var(--cmp-ink);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  text-align: center;
}

.cmp-because {
  color: var(--cmp-muted);
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 650;
  text-align: center;
}

.cmp-trail {
  display: grid;
  gap: 4px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.cmp-trail li {
  color: var(--cmp-muted);
  font-size: 15px;
  font-weight: 700;
}

.cmp-trail li.is-now { color: var(--cmp-ink); }

.cmp-nline {
  position: relative;
  width: min(560px, 100%);
  height: 84px;
  margin: 8px auto 18px;
}

.cmp-nline-track {
  position: absolute;
  top: 38px;
  right: 8px;
  left: 8px;
  height: 3px;
  border-radius: 99px;
  background: #cbd5e1;
}

.cmp-nline-end {
  position: absolute;
  top: 10px;
  color: var(--cmp-muted);
  font-size: 12px;
  font-weight: 700;
}

.cmp-nline-end.is-min { left: 0; }
.cmp-nline-end.is-max { right: 0; }

.cmp-nline-point {
  position: absolute;
  top: 22px;
  transform: translateX(-50%);
  text-align: center;
}

.cmp-nline-point i {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto 8px;
  border-radius: 99px;
  background: var(--cmp-focus);
}

.cmp-nline-point span {
  color: var(--cmp-ink);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.cmp-nline-point.is-bound i { background: #64748b; }
.cmp-nline-point.is-on i {
  width: 18px;
  height: 18px;
  background: var(--cmp-proven);
}
.cmp-nline-point.is-miss i { background: #cbd5e1; }
.cmp-nline-point.is-hit i { background: var(--cmp-proven); }

.cmp-mono {
  color: var(--cmp-muted);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.cmp-scales { width: 100%; }

@keyframes cmp-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes cmp-soft-pulse {
  50% { opacity: 0.42; }
}

@keyframes cmp-draw {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 640px) {
  .cmp-bar-row { grid-template-columns: 1fr; }
  .cmp-bar-label { justify-self: start; }
  .cmp-digit { width: 30px; height: 40px; }
}

/* Proportional number line used by the number-comparison lesson. */
.cmp-axis-scene { width: min(760px, 100%); min-width: 0; margin-inline: auto; color: #242a30; font-family: "Cambria Math", Cambria, "Times New Roman", serif; font-variant-numeric: tabular-nums; }
.cmp-axis-conversions { display: grid; gap: 8px; min-height: 2em; text-align: center; font-size: clamp(17px, 3.8vw, 25px); overflow-wrap: anywhere; }
.cmp-axis-diagram { display: block; width: 100%; height: auto; margin-block: 20px; overflow: visible; }
.cmp-axis-diagram path { fill: none; stroke: #414950; stroke-width: 1.5; }
.cmp-axis-diagram text { fill: #242a30; stroke: none; text-anchor: middle; font-size: 27px; }
.cmp-axis-point path { stroke: #8b9298; stroke-dasharray: 3 4; }
.cmp-axis-point circle { fill: #242a30; }
.cmp-axis-interval path { stroke: #526d81; stroke-width: 4; }
.cmp-axis-interval circle { fill: white; stroke: #526d81; stroke-width: 2; }
.cmp-axis-interval text { font-size: 23px; fill: #526d81; }
.cmp-axis-answer { border-top: 1px solid #d6d9dd; padding-top: 18px; text-align: center; font-size: clamp(22px, 5vw, 34px); }
