﻿:root {
  color-scheme: light;
  --font-sans: Aptos, "Trebuchet MS", "Segoe UI", sans-serif;
  --font-display: "Trebuchet MS", Aptos, "Segoe UI", sans-serif;
  --ink-50: #f7f8fb;
  --ink-100: #eef1f6;
  --ink-200: #dfe5ef;
  --ink-500: #5f7392;
  --ink-600: #445875;
  --ink-700: #30415a;
  --ink-800: #223147;
  --ink-900: #142236;
  --accent-50: #ecfbff;
  --accent-200: #a9e7f4;
  --accent-300: #76d4eb;
  --accent-400: #37bddb;
  --accent-600: #0f7f9d;
  --accent-700: #11657d;
  --success-50: #edfcf2;
  --success-500: #2f9d63;
  --danger-50: #fff1f1;
  --danger-500: #db5b5b;
  --shadow-soft: 0 24px 60px -32px rgba(15, 23, 42, 0.28);
  --shadow-card: 0 16px 30px -24px rgba(20, 34, 54, 0.35);
  --shadow-lift: 0 12px 24px -18px rgba(22, 77, 95, 0.5);
}

html {
  scroll-behavior: smooth;
  font-size: 115%;
}

body {
  min-height: 100vh;
  background: #ffffff;
  font-family: var(--font-sans);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

body.help-guide-open {
  overflow: hidden;
}

::selection {
  background: var(--accent-200);
  color: var(--ink-900);
}

button,
input,
select {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 4px rgba(169, 231, 244, 0.7), 0 0 0 6px #ffffff;
}

.surface-shell {
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.lesson-header-summary {
  padding-right: 9rem;
}

.lesson-header-help {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 2;
}

.help-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  border: 1px solid rgba(118, 212, 235, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  padding: 0.46rem 0.82rem 0.46rem 0.56rem;
  color: var(--accent-700);
  box-shadow: 0 16px 30px -24px rgba(15, 127, 157, 0.42);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.help-trigger:hover {
  transform: translateY(-1px);
  border-color: var(--accent-400);
  color: var(--accent-700);
  box-shadow: 0 18px 34px -24px rgba(15, 127, 157, 0.5);
}

.help-trigger-icon-wrap {
  display: inline-flex;
  height: 1.72rem;
  width: 1.72rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(15, 127, 157, 0.12), rgba(15, 127, 157, 0.18));
}

.help-trigger-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.help-trigger-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.help-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(55, 189, 219, 0.14), transparent 32%),
    rgba(20, 34, 54, 0.28);
  padding: 1.25rem;
  backdrop-filter: blur(7px);
}

.help-guide-card {
  width: min(100%, 68rem);
  max-height: min(100vh - 2rem, 46rem);
  overflow: auto;
  border: 1px solid rgba(223, 229, 239, 0.98);
  border-radius: 2rem;
  background:
    radial-gradient(circle at top right, rgba(118, 212, 235, 0.18), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 248, 251, 0.98));
  box-shadow: 0 34px 72px -38px rgba(20, 34, 54, 0.52);
}

.help-guide-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem 0;
}

.help-guide-close {
  display: inline-flex;
  height: 2.4rem;
  width: 2.4rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(223, 229, 239, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-700);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.help-guide-close:hover {
  transform: translateY(-1px);
  border-color: var(--accent-300);
  color: var(--accent-700);
}

.help-guide-close-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.help-guide-body {
  padding: 0.6rem 1.05rem 0;
}

.help-guide-preview {
  border: 1px solid rgba(169, 231, 244, 0.9);
  border-radius: 1.5rem;
  background:
    linear-gradient(180deg, rgba(236, 251, 255, 0.95), rgba(255, 255, 255, 0.98));
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.help-guide-preview-results {
  border-color: rgba(223, 229, 239, 0.98);
  background:
    linear-gradient(180deg, rgba(247, 248, 251, 0.98), rgba(255, 255, 255, 0.98));
}

.help-guide-preview-topbar,
.help-guide-preview-toolbar,
.help-guide-results-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.help-guide-preview-brand,
.help-guide-preview-toolbar-left,
.help-guide-preview-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.help-guide-preview-logo {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.5rem;
  background: linear-gradient(180deg, var(--accent-400), var(--accent-600));
  box-shadow: 0 10px 18px -14px rgba(15, 127, 157, 0.72);
}

.help-guide-preview-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-900);
}

.help-guide-preview-progress {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.help-guide-preview-progress-wrap {
  margin-top: 0.95rem;
}

.help-guide-progress-caption {
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.help-guide-preview-progress-wrap .help-guide-preview-progress {
  margin-top: 0.55rem;
}

.help-guide-progress-node {
  display: inline-flex;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid rgba(95, 115, 146, 0.44);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.help-guide-progress-node-complete {
  border-color: var(--accent-400);
  background: var(--accent-50);
}

.help-guide-progress-node-active {
  border-color: var(--ink-900);
  background: var(--ink-900);
}

.help-guide-preview-toolbar {
  margin-top: 0.95rem;
}

.help-guide-preview .help-trigger {
  padding: 0.38rem 0.68rem 0.38rem 0.48rem;
  box-shadow: 0 12px 24px -20px rgba(15, 127, 157, 0.42);
  pointer-events: none;
}

.help-guide-preview .help-trigger:hover {
  transform: none;
}

.help-guide-preview .help-trigger-icon-wrap {
  height: 1.46rem;
  width: 1.46rem;
}

.help-guide-preview .help-trigger-label {
  font-size: 0.76rem;
}

.help-guide-preview-nav {
  flex-shrink: 0;
}

.help-guide-preview-nav-button,
.help-guide-action-orb .action-orb-button {
  pointer-events: none;
}

.help-guide-preview-nav-button {
  height: 2.1rem;
  width: 2.1rem;
}

.help-guide-action-orb .action-orb-button {
  min-width: 4.35rem;
}

.help-guide-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  border: 1px solid rgba(223, 229, 239, 0.98);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink-700);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.help-guide-chip-accent {
  border-color: rgba(15, 127, 157, 0.38);
  background: rgba(236, 251, 255, 0.98);
  color: var(--accent-700);
}

.help-guide-chip-success {
  border-color: rgba(47, 157, 99, 0.45);
  background: rgba(237, 252, 242, 0.98);
  color: var(--success-500);
}

.help-guide-chip-danger {
  border-color: rgba(219, 91, 91, 0.4);
  background: rgba(255, 241, 241, 0.98);
  color: var(--danger-500);
}

.help-guide-chip-sun {
  border-color: rgba(228, 186, 69, 0.46);
  background: rgba(255, 251, 238, 0.98);
  color: #8a5f07;
}

.help-guide-metric {
  display: inline-flex;
  min-width: 6rem;
  flex-direction: column;
  gap: 0.08rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(223, 229, 239, 0.96);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
}

.help-guide-metric-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-900);
}

.help-guide-metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.help-guide-results-summary {
  margin-top: 1rem;
}

.help-guide-results-caption {
  display: inline-flex;
  margin-top: 1rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.help-guide-results-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.help-guide-copy-block {
  margin-top: 0.7rem;
}

.help-guide-copy-block-first {
  margin-top: 0.05rem;
}

.help-guide-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink-900);
}

.help-guide-intro {
  max-width: 52rem;
  margin: 0.38rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-700);
}

.help-guide-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.help-guide-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.help-guide-section {
  border: 1px solid rgba(223, 229, 239, 0.96);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.78rem;
}

.help-guide-section-copy {
  margin-bottom: 0.65rem;
}

.help-guide-section-eyebrow {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-700);
}

.help-guide-section-title {
  margin: 0.22rem 0 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-900);
}

.help-guide-section-description {
  margin: 0.22rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ink-600);
}

.help-guide-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.help-guide-point {
  border: 1px solid rgba(223, 229, 239, 0.96);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.78rem 0.82rem;
  box-shadow: 0 16px 30px -32px rgba(20, 34, 54, 0.36);
}

.help-guide-point-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--ink-900);
}

.help-guide-point-copy {
  margin: 0.28rem 0 0;
  font-size: 0.8rem;
  line-height: 1.38;
  color: var(--ink-600);
}

.help-guide-point-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.help-guide-answer-preview {
  width: min(100%, 11rem);
  flex-direction: column;
  align-items: stretch;
  gap: 0.42rem;
  margin-inline: auto;
}

.help-guide-choice-card {
  gap: 0.5rem;
  padding: 0.45rem 0.62rem;
  box-shadow: 0 12px 24px -24px rgba(20, 34, 54, 0.28);
  pointer-events: none;
}

.help-guide-choice-bullet {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  border: 1.5px solid rgba(95, 115, 146, 0.5);
  border-radius: 999px;
  background: #ffffff;
}

.help-guide-choice-bullet-selected {
  border-color: var(--accent-600);
  background:
    radial-gradient(circle at center, var(--accent-600) 0 34%, transparent 38%),
    #ffffff;
}

.help-guide-choice-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-800);
}

.help-guide-navigation-preview {
  flex-wrap: wrap;
  gap: 0.55rem;
}

.help-guide-card-progress {
  width: auto;
  gap: 0.18rem;
  padding: 0;
  justify-content: center;
}

.help-guide-card-progress-node {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.68rem;
  pointer-events: none;
}

.help-guide-lock-preview {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.help-guide-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  padding: 0.46rem 0.68rem;
  border: 1px solid rgba(223, 229, 239, 0.98);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink-700);
  box-shadow: 0 12px 24px -24px rgba(20, 34, 54, 0.28);
}

.help-guide-lock-icon {
  width: 0.92rem;
  height: 0.92rem;
}

.help-guide-lock-label {
  font-size: 0.76rem;
  font-weight: 700;
}

.help-guide-lock-copy {
  font-size: 0.76rem;
  line-height: 1.34;
  color: var(--ink-600);
}

.help-guide-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

.help-guide-checkbox-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.help-guide-checkbox-box {
  position: relative;
  display: inline-flex;
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  border: 1.5px solid rgba(95, 115, 146, 0.6);
  border-radius: 0.32rem;
  background: #ffffff;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.help-guide-checkbox-box::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.22rem;
  height: 0.48rem;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: translate(-50%, -58%) rotate(45deg);
  transform-origin: center;
  opacity: 0;
}

.help-guide-checkbox-input:checked + .help-guide-checkbox-box {
  border-color: var(--accent-600);
  background: var(--accent-600);
}

.help-guide-checkbox-input:checked + .help-guide-checkbox-box::after {
  opacity: 1;
}

.help-guide-checkbox-input:focus-visible + .help-guide-checkbox-box {
  box-shadow: 0 0 0 4px rgba(169, 231, 244, 0.7), 0 0 0 6px #ffffff;
}

.help-guide-checkbox-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-700);
}

.help-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.05rem 1rem;
}

.help-guide-footer-compact {
  gap: 0.8rem;
}

.help-guide-pagination,
.help-guide-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.help-guide-page-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(194, 204, 221, 0.95);
}

.help-guide-page-dot-active {
  background: var(--accent-600);
  box-shadow: 0 0 0 6px rgba(169, 231, 244, 0.34);
}

.help-guide-footer-button {
  min-width: 5.6rem;
}

.help-guide-action-orb .action-orb-button {
  min-width: 3.95rem;
  gap: 0.18rem;
}

.help-guide-action-orb .action-orb-circle {
  width: 2rem;
  height: 2rem;
}

.help-guide-action-orb .action-orb-label {
  font-size: 0.58rem;
}

.help-guide-preview-nav-button {
  height: 1.85rem;
  width: 1.85rem;
}

.help-guide-preview-nav-button svg {
  width: 0.88rem;
  height: 0.88rem;
}

.surface-panel {
  border-radius: 28px;
  border: 1px solid rgba(238, 241, 246, 0.95);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-card);
}

.choice-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border-radius: 16px;
  border: 1px solid var(--ink-100);
  background: #ffffff;
  padding: 0.8rem 1rem;
  text-align: left;
  box-shadow: 0 14px 28px -24px rgba(20, 34, 54, 0.22);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent-200);
  box-shadow: 0 18px 32px -24px rgba(20, 34, 54, 0.28);
}

.choice-card-selected {
  border-color: var(--accent-400);
  background: var(--accent-50);
  box-shadow: var(--shadow-lift);
}

.choice-card-correct {
  border-color: var(--success-500);
  background: var(--success-50);
}

.choice-card-incorrect {
  border-color: var(--danger-500);
  background: var(--danger-50);
}

.fraction-inline {
  display: inline-flex;
  min-width: 1.28rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.question-inline-fraction {
  min-width: 1.42rem;
  margin: 0 0.14rem;
  vertical-align: middle;
}

.question-inline-fraction-large {
  min-width: 1.72rem;
  margin: 0 0.18rem;
  font-size: 1.22em;
}

.question-inline-fraction-choice {
  min-width: 1.58rem;
  margin: 0 0.14rem;
  font-size: 1.08em;
}

.choice-fraction-large {
  min-width: 1.62rem;
  font-size: 1.14em;
}

.question-choice-mixed-number {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.question-choice-mixed-whole {
  font-size: 0.84em;
  line-height: 1;
}

.g4q18-prompt-mixed-number .question-choice-mixed-whole {
  font-size: 1.04em;
}

.g4q22-prompt-mixed-number .question-choice-mixed-whole {
  font-size: 1.04em;
}

.g4q25-mixed-number .question-choice-mixed-whole {
  font-size: 0.84em;
}

.g4q25-mixed-number .question-inline-fraction-choice {
  font-size: 1em;
}

.g4q27-prompt-fraction {
  font-size: 0.96em;
}

.g4q27-prompt-fraction .fraction-inline-part {
  font-size: 1em;
}

.g4q27-choice-mixed-number .question-choice-mixed-whole {
  font-size: 0.8em;
}

.g4q36-fraction-inline {
  font-size: 0.96em;
}

.g4q36-fraction-inline .fraction-inline-part {
  font-size: 1em;
}

.g4q36-mixed-number .question-choice-mixed-whole {
  font-size: 0.96em;
}

.g4q36-value-row {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.22rem;
  white-space: nowrap;
}

.g4q36-value-token {
  align-items: baseline;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.22rem 0.62rem;
  border-radius: 0.45rem;
  line-height: 1;
}

.g4q36-value-token .fraction-inline,
.g4q36-value-token .question-choice-mixed-number {
  line-height: 1;
}

.g4q36-value-token .question-choice-mixed-number {
  align-items: center;
}

.g4q36-value-separator {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  color: var(--ink-700);
  font-weight: 600;
}

.g4q36-axis-label-token {
  position: relative;
  top: 0.22rem;
}

.g4q38-stem-table .fraction-inline {
  font-size: 1em;
}

.g4q38-stem-table .fraction-inline-part {
  font-size: 1em;
}

.g4q05-comparison-select,
.g4q05-comparison-select option {
  font-size: 1.28rem;
  font-weight: 700;
}

.g5q05-choice-copy {
  font-size: 1rem;
}

.g5q14-choice-copy,
.g5q19-choice-copy {
  font-size: 0.8em;
}

.fraction-inline-part {
  display: block;
  font-size: 0.8em;
}

.fraction-inline-bar {
  width: 100%;
  margin: 0.08rem 0;
  border-top: 1.5px solid currentColor;
}

.equation-missing-box {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin: 0 0.16em;
  border: 1.75px solid currentColor;
  vertical-align: -0.12em;
}

.matrix-header-compact .fraction-inline {
  min-width: 1.52rem;
}

.matrix-header-compact .fraction-inline-part {
  font-size: 0.94em;
}

.matrix-header-compact .value-label-token {
  font-size: 1.02em;
}

.matrix-header-cell .fraction-inline {
  min-width: 1.48rem;
}

.matrix-header-cell .fraction-inline-part {
  font-size: 1em;
}

.choice-card-selected .choice-card-visual-panel,
.choice-card-correct .choice-card-visual-panel,
.choice-card-incorrect .choice-card-visual-panel {
  background: transparent;
  box-shadow: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.nav-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(223, 229, 239, 0.95);
  background: rgba(255, 255, 255, 0.95);
  padding: 0.2rem;
  box-shadow: 0 10px 20px -20px rgba(20, 34, 54, 0.65);
}

.nav-button {
  display: inline-flex;
  height: 2.3rem;
  width: 2.3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #ffffff;
  color: var(--ink-700);
  box-shadow: 0 8px 18px -18px rgba(20, 34, 54, 0.55);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.nav-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--accent-300);
  color: var(--accent-700);
}

.nav-button svg {
  width: 1rem;
  height: 1rem;
}

.nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.action-orb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.72rem;
}

.action-orb-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.action-orb-button {
  display: inline-flex;
  min-width: 4.35rem;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink-700);
  transition: transform 0.2s ease, color 0.2s ease;
}

.action-orb-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.action-orb-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.action-orb-circle {
  display: inline-flex;
  height: 2.3rem;
  width: 2.3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  box-shadow: 0 12px 22px -20px rgba(20, 34, 54, 0.45);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.action-orb-button:hover:not(:disabled) .action-orb-circle {
  transform: translateY(-1px);
}

.action-orb-circle-clear {
  border-color: var(--ink-200);
  background: #ffffff;
  color: var(--ink-600);
}

.action-orb-button-clear:hover:not(:disabled) .action-orb-circle-clear {
  border-color: var(--ink-500);
  color: var(--ink-800);
}

.action-orb-circle-check {
  border-color: var(--accent-600);
  background: var(--accent-600);
  color: #ffffff;
  box-shadow: 0 14px 26px -18px rgba(15, 127, 157, 0.62);
}

.action-orb-button-check:hover:not(:disabled) .action-orb-circle-check {
  border-color: var(--accent-700);
  background: var(--accent-700);
}

.action-orb-circle-results {
  border-color: var(--success-500);
  background: #ffffff;
  color: var(--success-500);
  box-shadow: 0 14px 26px -18px rgba(47, 157, 99, 0.38);
}

.action-orb-button-results:hover:not(:disabled) .action-orb-circle-results {
  background: var(--success-50);
}

.action-orb-label {
  display: inline-block;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink-600);
}

.action-orb-button-check .action-orb-label {
  color: var(--accent-700);
}

.action-orb-button-results .action-orb-label {
  color: var(--success-500);
}

.action-orb-circle-back {
  border-color: rgba(95, 115, 146, 0.5);
  background: #ffffff;
  color: var(--ink-700);
}

.action-orb-button-back:hover:not(:disabled) .action-orb-circle-back {
  background: rgba(95, 115, 146, 0.08);
  border-color: var(--ink-500);
  color: var(--ink-800);
}

.action-orb-circle-review {
  border-color: #b8891b;
  background: #ffffff;
  color: #8a5f07;
  box-shadow: 0 14px 26px -18px rgba(138, 95, 7, 0.34);
}

.action-orb-button-review:hover:not(:disabled) .action-orb-circle-review {
  background: #fff7df;
  border-color: #a97712;
  color: #7a5406;
}

.action-orb-button-review .action-orb-label {
  color: #8a5f07;
}

.action-orb-circle-restart {
  border-color: rgba(219, 91, 91, 0.82);
  background: #ffffff;
  color: var(--danger-500);
  box-shadow: 0 14px 26px -18px rgba(219, 91, 91, 0.34);
}

.action-orb-button-restart:hover:not(:disabled) .action-orb-circle-restart {
  background: var(--danger-50);
}

.action-orb-button-restart .action-orb-label {
  color: var(--danger-500);
}

.action-orb-icon {
  width: 0.9rem;
  height: 0.9rem;
}

.action-orb-tooltip {
  position: absolute;
  bottom: calc(100% + 0.42rem);
  left: 50%;
  z-index: 20;
  max-width: none;
  white-space: nowrap;
  transform: translateX(-50%) translateY(4px);
  border-radius: 0.7rem;
  background: rgba(20, 34, 54, 0.96);
  padding: 0.4rem 0.55rem;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  box-shadow: 0 14px 24px -18px rgba(20, 34, 54, 0.72);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  transition-delay: 0s;
}

.action-orb-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  height: 0.5rem;
  width: 0.5rem;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(20, 34, 54, 0.96);
}

.action-orb-wrap:hover .action-orb-tooltip,
.action-orb-wrap:focus-within .action-orb-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 2s;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.action-button-compact {
  border-radius: 0.85rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.8rem;
}

.action-primary {
  color: #ffffff;
  background: var(--accent-600);
  box-shadow: var(--shadow-lift);
}

.action-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--accent-700);
}

.action-secondary {
  border: 1px solid var(--ink-200);
  background: #ffffff;
  color: var(--ink-700);
}

.action-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent-300);
  color: var(--accent-700);
}

.field-shell {
  border-radius: 1rem;
  border: 1px solid var(--ink-200);
  background: #ffffff;
  padding: 0.65rem 0.85rem;
  box-shadow: 0 8px 18px -24px rgba(20, 34, 54, 0.5);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.field-shell:focus-within {
  border-color: var(--accent-400);
  box-shadow: var(--shadow-lift);
}

.question-copy p {
  color: var(--ink-800);
}

.select-field {
  min-width: 8rem;
  appearance: none;
  border-radius: 1rem;
  border: 1px solid var(--ink-200);
  background-color: #ffffff;
  color: var(--ink-900);
  font-size: 0.95rem;
  padding: 0.35rem 2.2rem 0.35rem 0.85rem;
  box-shadow: 0 8px 18px -18px rgba(20, 34, 54, 0.5);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  background-image:
    linear-gradient(45deg, transparent 50%, #30415a 50%),
    linear-gradient(135deg, #30415a 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 4px),
    calc(100% - 16px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.select-field:hover,
.select-field:focus {
  border-color: var(--accent-300);
  box-shadow: var(--shadow-lift);
}

.inline-keypad-field {
  display: inline-flex;
  min-width: 9.2rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  border: 1px solid var(--ink-200);
  border-radius: 0.7rem;
  background: #ffffff;
  padding: 0.2rem 0.22rem 0.2rem 0.7rem;
  box-shadow: 0 8px 18px -18px rgba(20, 34, 54, 0.32);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.inline-keypad-field:hover {
  border-color: var(--accent-300);
}

.inline-keypad-field-active {
  border-color: var(--accent-400);
  box-shadow: var(--shadow-lift);
}

.inline-keypad-field-value,
.inline-keypad-field-placeholder {
  display: inline-flex;
  min-height: 1.6rem;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink-900);
}

.inline-keypad-field-placeholder {
  color: var(--ink-300, #b8c0cc);
}

.inline-keypad-trigger {
  display: inline-flex;
  height: 2rem;
  width: 2.35rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink-200);
  border-radius: 0.55rem;
  background: #ffffff;
  color: var(--ink-700);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.inline-keypad-trigger:hover {
  border-color: var(--accent-300);
  color: var(--accent-700);
}

.inline-keypad-trigger-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.dropdown-keypad-backdrop {
  position: fixed;
  inset: 0;
  z-index: 88;
  background: rgba(20, 34, 54, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.dropdown-keypad-backdrop-open {
  opacity: 1;
  pointer-events: auto;
}

.dropdown-keypad-sheet {
  position: fixed;
  left: 50%;
  bottom: 0.9rem;
  z-index: 89;
  width: min(78rem, calc(100vw - 1.5rem));
  transform: translateX(-50%) translateY(1.25rem);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.28s ease,
    opacity 0.22s ease;
}

.dropdown-keypad-sheet-open {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.dropdown-keypad-panel {
  width: 100%;
  max-width: none;
  margin-right: 0;
}

.dropdown-keypad-panel .math-editor-toolbar {
  margin-top: 0;
}

.dropdown-keypad-panel .math-keypad-region {
  margin-top: 0.08rem;
}

.dropdown-keypad-sheet-compact {
  width: min(31rem, calc(100vw - 1rem));
}

.dropdown-keypad-sheet-inline {
  position: static;
  left: auto;
  bottom: auto;
  margin: 1rem auto 0;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  display: none;
}

.dropdown-keypad-sheet-inline.dropdown-keypad-sheet-open {
  display: block;
}

.dropdown-keypad-panel-compact {
  max-width: 31rem;
  margin-inline: auto;
}

.dropdown-keypad-panel-compact .math-keypad-region {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.dropdown-keypad-panel-compact .math-keypad-left {
  border-right: 0;
}

.dropdown-keypad-panel-compact .math-keypad-grid {
  width: 100%;
}

.dropdown-keypad-panel-compact .math-keypad-blank {
  display: none;
}

.math-toolbar-spacer {
  flex: 1 1 auto;
}

.question-grid-nav {
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.2rem;
  overflow-x: auto;
  background: transparent;
  border: 0;
  padding: 0.1rem 0;
}

.progress-node {
  display: inline-flex;
  flex: 0 0 auto;
  height: 1.6rem;
  width: 1.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1.5px solid rgba(95, 115, 146, 0.55);
  background: #ffffff;
  color: var(--ink-500);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  transition:
    transform 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.progress-node:hover {
  transform: translateY(-1px);
  border-color: var(--accent-300);
  color: var(--accent-700);
}

.progress-node-answered {
  border-color: var(--accent-400);
  background: var(--accent-50);
  color: var(--accent-700);
}

.progress-node-correct {
  border-color: var(--success-500);
  background: var(--success-50);
  color: var(--success-500);
}

.progress-node-incorrect {
  border-color: var(--danger-500);
  background: var(--danger-50);
  color: var(--danger-500);
}

.progress-node-active {
  border-color: var(--ink-900);
  background: var(--ink-900);
  color: #ffffff;
}

.progress-node-active.progress-node-correct {
  border-color: var(--success-500);
  background: var(--success-500);
  color: #ffffff;
}

.progress-node-active.progress-node-incorrect {
  border-color: var(--danger-500);
  background: var(--danger-500);
  color: #ffffff;
}

.result-chip-neutral {
  border-color: var(--ink-200);
  background: #ffffff;
  color: var(--ink-800);
}

.result-chip-correct {
  border-color: var(--success-500);
  background: var(--success-50);
  color: var(--success-500);
}

.result-chip-incorrect {
  border-color: var(--danger-500);
  background: var(--danger-50);
  color: var(--danger-500);
}

.results-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 34, 54, 0.18);
  padding: 1.25rem;
  backdrop-filter: blur(4px);
}

.results-confirm-overlay[hidden] {
  display: none;
}

.results-confirm-card {
  width: min(100%, 40rem);
  border-radius: 1.6rem;
  border: 1px solid rgba(223, 229, 239, 0.98);
  background: rgba(255, 255, 255, 0.98);
  padding: 1.35rem 1.45rem 1.2rem;
  box-shadow: 0 26px 58px -34px rgba(20, 34, 54, 0.42);
}

.results-confirm-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-900);
}

.results-confirm-text {
  margin: 1rem 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-800);
}

.results-confirm-subtext {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-500);
}

.results-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.results-confirm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.75rem;
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  font-size: 0.95rem;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.results-confirm-button:hover {
  transform: translateY(-1px);
}

.results-confirm-button-cancel {
  border: 1px solid var(--ink-200);
  background: #ffffff;
  color: var(--ink-800);
}

.results-confirm-button-cancel:hover {
  border-color: var(--ink-500);
}

.results-confirm-button-danger {
  border: 1px solid var(--danger-500);
  background: var(--danger-500);
  color: #ffffff;
  box-shadow: 0 14px 24px -18px rgba(219, 91, 91, 0.5);
}

.results-confirm-button-danger:hover {
  border-color: #c84d4d;
  background: #c84d4d;
}

.io-table-prompt-wrap {
  display: flex;
  justify-content: center;
  margin: 1rem 0 0.3rem;
}

.io-table-prompt {
  border-collapse: collapse;
  background: #ffffff;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink-900);
}

.io-table-prompt td {
  min-width: 3rem;
  border: 1px solid var(--ink-700);
  padding: 0.55rem 0.8rem;
  text-align: center;
}

.io-table-prompt td:first-child {
  min-width: 7.4rem;
  text-align: left;
}

.io-table-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.io-table-choice-grid-q4 {
  justify-content: center;
  grid-template-columns: repeat(auto-fit, 14rem);
  column-gap: 3.1rem;
}

.io-table-choice {
  display: flex;
  justify-content: center;
}

.io-table-choice-table {
  border-collapse: collapse;
  background: #ffffff;
  color: var(--ink-900);
  font-size: 0.98rem;
  font-weight: 600;
}

.io-table-choice-table td {
  min-width: 2.8rem;
  border: 1px solid var(--ink-700);
  padding: 0.5rem 0.72rem;
  text-align: center;
}

.io-table-choice-table td:first-child {
  min-width: 6.6rem;
  text-align: left;
}

.graph-choice-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.work-error-table-wrap {
  display: flex;
  justify-content: center;
  margin-top: 0.4rem;
}

.work-error-table {
  border-collapse: collapse;
  background: #ffffff;
  color: var(--ink-900);
  box-shadow: 0 10px 22px -22px rgba(20, 34, 54, 0.35);
}

.work-error-table th,
.work-error-table td {
  border: 1px solid rgba(34, 49, 71, 0.42);
  padding: 0.45rem 0.7rem;
}

.work-error-table thead th {
  background: #ffffff;
  font-size: 0.94rem;
  font-weight: 800;
  text-align: center;
}

.work-error-step-cell {
  background: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.work-error-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 1rem;
  font-weight: 600;
}

.work-error-text {
  white-space: pre;
}

.work-error-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.38rem;
  background: transparent;
  padding: 0.16rem;
  color: var(--ink-900);
  font: inherit;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.work-error-number:hover {
  background: rgba(17, 101, 125, 0.08);
}

.work-error-number-selected {
  background: rgba(205, 84, 180, 0.95);
  color: #ffffff;
  box-shadow: 0 8px 18px -16px rgba(205, 84, 180, 0.75);
}

.work-error-part-b {
  margin-top: 1.45rem;
}

.work-error-part-b-plain {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.work-error-spotter-plain {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.work-error-answer-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.work-error-answer-row-inline {
  display: block;
  width: min(100%, 26rem);
}

.work-error-currency {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink-900);
}

.work-error-total-field {
  min-width: 9.6rem;
}

.work-error-inline-keypad {
  width: 100%;
}

.work-error-inline-keypad .math-input-panel {
  width: 100%;
  max-width: 100%;
  margin-right: 0;
}

.math-editor-display-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.65rem;
}

.math-editor-display-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.work-error-currency-inline {
  padding-top: 0;
}

@media (max-width: 980px) {
  .graph-choice-grid-2x2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .help-guide-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .help-guide-points {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .lesson-header-summary {
    padding-right: 0;
  }

  .lesson-header-help {
    position: static;
    margin: 0 0 0.8rem auto;
  }

  .lesson-header .relative.flex.flex-col.gap-4 {
    align-items: stretch;
  }

  .question-grid-nav {
    gap: 0.16rem;
  }

  .help-trigger {
    padding-inline: 0.72rem;
  }

  .help-guide-overlay {
    padding: 0;
  }

  .help-guide-card {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .help-guide-card-top,
  .help-guide-body,
  .help-guide-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .help-guide-title {
    font-size: 1.6rem;
  }

  .help-guide-footer {
    align-items: stretch;
  }

  .help-guide-footer,
  .help-guide-footer-compact {
    flex-direction: column;
  }

  .help-guide-actions {
    width: 100%;
    justify-content: stretch;
  }

  .help-guide-section-grid {
    grid-template-columns: 1fr;
  }

  .help-guide-footer-button {
    flex: 1 1 0;
  }
}

.mini-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--ink-500);
}

.math-input-panel {
  width: 50%;
  max-width: 50%;
  margin-right: auto;
}

.math-editor-display {
  display: flex;
  min-height: 8rem;
  align-items: center;
  border: 1.5px solid #b8bec4;
  border-radius: 0.65rem;
  background: #f7f7f7;
  padding: 0.95rem 1.05rem;
}

.math-editor-display:focus-visible {
  outline: 2px solid #40bdf3;
  outline-offset: 2px;
}

.math-editor-display-inner {
  display: flex;
  min-height: 5.25rem;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.28rem;
  font-family: var(--font-serif);
  font-size: 2.15rem;
  line-height: 1.05;
  color: #111827;
}

.math-editor-display-empty .math-editor-display-inner {
  color: rgba(17, 24, 39, 0.68);
}

.math-editor-character {
  display: inline-flex;
  min-height: 2.45rem;
  align-items: flex-end;
}

.math-editor-character-sign {
  font-weight: 700;
  transform: scaleX(1.24);
  transform-origin: center;
}

.math-editor-mixed-number {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
}

.math-editor-character-mixed {
  min-height: auto;
  align-items: center;
}

.math-editor-empty-spacer {
  display: inline-block;
  min-width: 0.2rem;
  min-height: 2.7rem;
}

.math-editor-caret {
  display: inline-block;
  width: 2px;
  height: 2.45rem;
  border-radius: 999px;
  background: #111827;
  animation: math-editor-caret-blink 1.1s steps(1, end) infinite;
}

.math-editor-fraction-token {
  display: inline-flex;
  min-width: 2.9rem;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: 0 0.18rem;
}

.math-editor-fraction-slot {
  display: inline-flex;
  min-width: 2.25rem;
  min-height: 1.7rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.22rem;
  cursor: text;
}

.math-editor-fraction-slot-active {
  border-radius: 0.2rem;
  background: rgba(219, 234, 254, 0.72);
}

.math-editor-fraction-bar {
  width: 100%;
  border-top: 2px solid #111827;
}

.math-editor-slot-placeholder {
  display: inline-block;
  width: 1.2rem;
  height: 1.5rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.28);
  opacity: 0.7;
}

.math-editor-slot-placeholder-active {
  border-bottom-color: rgba(37, 99, 235, 0.75);
}

.math-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  margin-top: 0.45rem;
  border: 1.5px solid #c3c8cf;
  border-radius: 0.4rem;
  background: #f3f3f3;
  padding: 0.7rem 0.75rem;
}

.math-toolbar-button {
  display: inline-flex;
  height: 3.4rem;
  width: 3.4rem;
  align-items: center;
  justify-content: center;
  border: 2px solid #aeb4ba;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.math-toolbar-button:focus-visible,
.math-key-button:focus-visible {
  outline: 2px solid #40bdf3;
  outline-offset: 2px;
}

.math-toolbar-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.math-toolbar-icon {
  color: #111827;
}

.math-keypad-region {
  display: grid;
  grid-template-columns: minmax(19rem, 46%) 1fr;
  min-height: 26rem;
  margin-top: 0.08rem;
  overflow: hidden;
  border: 1.5px solid #bcc4cb;
  border-radius: 0.85rem;
  background: #f3f3f3;
}

.math-keypad-left {
  border-right: 1px solid #ced5db;
  background: #f5f5f5;
  padding: 0.82rem;
}

.math-keypad-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.72rem;
  width: 85%;
}

.math-key-button {
  grid-column: span 2;
  display: flex;
  min-height: 5.2rem;
  align-items: center;
  justify-content: center;
  border: 2px solid #afb5bb;
  border-radius: 0.32rem;
  background: #fafafa;
  color: #111827;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.math-key-button-wide {
  grid-column: span 3;
}

.math-keypad-spacer {
  grid-column: span 2;
  min-height: 5.2rem;
}

.math-key-button-label {
  font-family: var(--font-serif);
  font-size: 2.35rem;
  line-height: 1;
}

.math-key-button-label-minus {
  display: inline-block;
  font-weight: 700;
  transform: scaleX(1.38);
  transform-origin: center;
}

.math-key-button-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.math-key-button-icon {
  color: #111827;
}

.math-keypad-blank {
  background: #f3f3f3;
}

@keyframes math-editor-caret-blink {
  0%,
  55% {
    opacity: 1;
  }

  56%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .math-keypad-region {
    grid-template-columns: minmax(0, 1fr) 0.55fr;
    min-height: 22rem;
  }
}

@media (max-width: 640px) {
  .math-editor-display {
    min-height: 6.5rem;
  }

  .math-editor-display-inner {
    min-height: 3.8rem;
    font-size: 1.8rem;
  }

  .math-toolbar-button {
    height: 3rem;
    width: 3rem;
  }

  .math-keypad-region {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .math-keypad-blank {
    display: none;
  }
}

.math-toolbar-button:hover:not(:disabled),
.math-key-button:hover {
  border-color: #8f98a2;
  background: #ffffff;
}

.math-key-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  border-color: #cfd5db;
  background: #f2f4f6;
}

.math-editor-display {
  min-height: 4.8rem;
  border-radius: 0.5rem;
  padding: 0.55rem 0.72rem;
}

.math-editor-display-inner {
  min-height: 3rem;
  gap: 0.18rem;
  font-size: 1.35rem;
}

.math-editor-character {
  min-height: 1.6rem;
}

.math-editor-mixed-number {
  gap: 0.1rem;
}

.math-editor-empty-spacer {
  min-height: 1.7rem;
}

.math-editor-caret {
  height: 1.55rem;
}

.math-editor-fraction-token {
  min-width: 1.9rem;
  padding: 0 0.12rem;
}

.math-editor-fraction-slot {
  min-width: 1.55rem;
  min-height: 1.1rem;
  padding: 0 0.14rem;
}

.math-editor-slot-placeholder {
  width: 0.8rem;
  height: 1rem;
}

.math-editor-toolbar {
  gap: 0.45rem;
  margin-top: 0.3rem;
  padding: 0.45rem 0.5rem;
}

.math-toolbar-button {
  height: 2.15rem;
  width: 2.15rem;
}

.math-toolbar-icon {
  width: 1rem;
  height: 1rem;
}

.math-keypad-region {
  grid-template-columns: minmax(11.5rem, 46%) 1fr;
  min-height: 15.75rem;
  border-radius: 0.55rem;
}

.math-keypad-left {
  padding: 0.5rem;
}

.math-keypad-grid {
  gap: 0.45rem;
  width: 85%;
}

.math-key-button {
  min-height: 3.15rem;
  border-radius: 0.24rem;
}

.math-keypad-spacer {
  min-height: 3.15rem;
}

.math-key-button-label {
  font-size: 1.45rem;
}

.math-key-button-icon {
  width: 1.6rem;
  height: 1.6rem;
}

@media (max-width: 900px) {
  .math-keypad-region {
    min-height: 13.5rem;
  }
}

@media (max-width: 640px) {
  .math-editor-display {
    min-height: 4.2rem;
  }

  .math-editor-display-inner {
    min-height: 2.6rem;
    font-size: 1.15rem;
  }

  .math-toolbar-button {
    height: 1.95rem;
    width: 1.95rem;
  }

  .math-key-button {
    min-height: 2.75rem;
  }

  .math-key-button-label {
    font-size: 1.25rem;
  }
}

.math-editor-display {
  min-height: 3.15rem;
  border-radius: 0.38rem;
  padding: 0.35rem 0.46rem;
}

.math-editor-display-inner {
  min-height: 1.8rem;
  gap: 0.1rem;
  font-size: 0.9rem;
}

.math-editor-character {
  min-height: 0.95rem;
}

.math-editor-mixed-number {
  gap: 0.06rem;
}

.math-editor-empty-spacer {
  min-height: 1rem;
}

.math-editor-caret {
  width: 1px;
  height: 0.95rem;
}

.math-editor-fraction-token {
  min-width: 1.15rem;
  gap: 0.04rem;
  padding: 0 0.05rem;
}

.math-editor-fraction-slot {
  min-width: 0.92rem;
  min-height: 0.7rem;
  padding: 0 0.08rem;
}

.math-editor-slot-placeholder {
  width: 0.46rem;
  height: 0.62rem;
}

.math-editor-toolbar {
  gap: 0.24rem;
  margin-top: 0.18rem;
  padding: 0.26rem 0.31rem;
}

.math-toolbar-button {
  height: 1.43rem;
  width: 1.43rem;
  border-width: 1.5px;
}

.math-toolbar-icon {
  width: 0.68rem;
  height: 0.68rem;
}

.math-keypad-region {
  grid-template-columns: minmax(6.9rem, 46%) 1fr;
  min-height: 9.4rem;
  border-radius: 0.34rem;
}

.math-keypad-left {
  padding: 0.28rem;
}

.math-keypad-grid {
  gap: 0.24rem;
  width: 85%;
}

.math-key-button {
  min-height: 2.1rem;
  border-width: 1.5px;
  border-radius: 0.16rem;
}

.math-keypad-spacer {
  min-height: 2.1rem;
}

.math-key-button-label {
  font-size: 0.88rem;
}

.math-key-button-icon {
  width: 1.14rem;
  height: 1.14rem;
}

@media (max-width: 900px) {
  .math-keypad-region {
    min-height: 8.1rem;
  }
}

@media (max-width: 640px) {
  .math-editor-display {
    min-height: 2.88rem;
  }

  .math-editor-display-inner {
    min-height: 1.6rem;
    font-size: 0.8rem;
  }

  .math-toolbar-button {
    height: 1.18rem;
    width: 1.18rem;
  }

  .math-key-button {
    min-height: 1.76rem;
  }

  .math-key-button-label {
    font-size: 0.78rem;
  }
}

.equation-input-panel {
  width: 100%;
  max-width: 58rem;
  margin-right: auto;
}

.equation-editor-display {
  align-items: stretch;
}

.equation-editor-display:focus-within {
  outline: 2px solid #40bdf3;
  outline-offset: 2px;
}

.equation-editor-input {
  width: 100%;
  min-height: 2.35rem;
  border: 0;
  background: transparent;
  color: #111827;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0;
}

.equation-keypad-region {
  display: grid;
  grid-template-columns: minmax(20rem, 62%) 1fr;
  min-height: 12rem;
  margin-top: 0.08rem;
  overflow: hidden;
  border: 1.5px solid #bcc4cb;
  border-radius: 0.34rem;
  background: #f3f3f3;
}

.equation-keypad-left {
  border-right: 1px solid #ced5db;
  background: #f5f5f5;
  padding: 0.28rem;
}

.equation-keypad-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.24rem;
  width: 100%;
}

.equation-key-button {
  display: flex;
  min-height: 2.1rem;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #afb5bb;
  border-radius: 0.16rem;
  background: #fafafa;
  color: #111827;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.equation-key-button:hover {
  border-color: #8f98a2;
  background: #ffffff;
}

.equation-keypad-spacer {
  min-height: 2.1rem;
}

.equation-key-button-label {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}

.equation-key-button-label-variable {
  font-style: italic;
}

@media (max-width: 900px) {
  .equation-keypad-region {
    min-height: 10.8rem;
  }
}

@media (max-width: 640px) {
  .equation-keypad-region {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .equation-keypad-left {
    border-right: 0;
  }
}

.line-plot-builder {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.line-plot-builder-chart {
  --line-plot-axis-inset: 0.75rem;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
}

.line-plot-builder-title {
  margin: 0 0 0.8rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: #142236;
}

.line-plot-builder-grid {
  display: grid;
  grid-template-columns: repeat(var(--plot-columns), minmax(0, 1fr));
  margin-inline: var(--line-plot-axis-inset);
  border-top: 1.5px dashed #b8c6d4;
  border-left: 1.5px dashed #b8c6d4;
  background: #fff;
}

.line-plot-builder-cell {
  display: flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  border-right: 1.5px dashed #b8c6d4;
  border-bottom: 1.5px dashed #b8c6d4;
  background: transparent;
  color: #233248;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.line-plot-builder-cell:hover {
  background: rgba(64, 189, 243, 0.08);
}

.line-plot-builder-cell-selected {
  background: rgba(20, 34, 54, 0.03);
}

.line-plot-builder-cell-mark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.line-plot-builder-axis-row {
  display: grid;
  grid-template-columns: var(--line-plot-axis-inset) 1fr var(--line-plot-axis-inset);
  align-items: center;
  gap: 0;
  margin-top: 0.38rem;
}

.line-plot-builder-axis-inner {
  position: relative;
}

.line-plot-builder-axis-line {
  position: absolute;
  top: 0.48rem;
  right: 0;
  left: 0;
  height: 2px;
  background: #142236;
}

.line-plot-builder-axis-arrow {
  width: 0;
  height: 0;
}

.line-plot-builder-axis-arrow-left {
  border-top: 0.42rem solid transparent;
  border-right: 0.75rem solid #142236;
  border-bottom: 0.42rem solid transparent;
}

.line-plot-builder-axis-arrow-right {
  border-top: 0.42rem solid transparent;
  border-bottom: 0.42rem solid transparent;
  border-left: 0.75rem solid #142236;
}

.line-plot-builder-tick-grid,
.line-plot-builder-label-grid {
  display: grid;
  grid-template-columns: repeat(var(--plot-columns), minmax(0, 1fr));
}

.line-plot-builder-label-grid {
  margin-inline: var(--line-plot-axis-inset);
}

.line-plot-builder-tick {
  display: flex;
  min-height: 1rem;
  align-items: center;
  justify-content: center;
}

.line-plot-builder-tick-mark {
  position: relative;
  z-index: 1;
  width: 2px;
  height: 0.95rem;
  border-radius: 999px;
  background: #233248;
}

.line-plot-builder-label {
  min-height: 1.4rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 500;
  color: #233248;
}

.line-plot-builder-axis-label {
  margin-top: 0.38rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: #142236;
}

@media (max-width: 640px) {
  .line-plot-builder-chart {
    max-width: 100%;
  }

  .line-plot-builder-cell {
    min-height: 1.74rem;
  }

  .line-plot-builder-label {
    font-size: 0.86rem;
  }
}
