/* Scoped styles for PreK-Grade 8 Infinite Interactive Math Practice Tutor.
   All rules are scoped under .math-tutor or .mt-* so global site styles
   (/css/style.css: header, nav, footer, cookie banner) remain untouched. */

.mt-grade-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
  align-items: center;
}

.mt-grade-pill {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.mt-grade-pill:hover {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #a5b4fc;
}

.mt-grade-pill.active {
  background: #4338ca;
  color: #ffffff;
  border-color: #4338ca;
}

.mt-grade-pill.mt-pill-worksheets {
  background: #f7f5f0;
  color: #1a6fb5;
  border-color: #bfdbfe;
  margin-left: auto;
}

.mt-grade-pill.mt-pill-worksheets:hover {
  background: #e0f2fe;
  color: #12557f;
}

.math-tutor {
  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
  margin: 16px 0 32px;
}

.math-tutor *,
.math-tutor *::before,
.math-tutor *::after {
  box-sizing: border-box;
}

.math-tutor .hidden-step {
  display: none !important;
}

.math-tutor .fade-in {
  animation: mtFadeIn 0.35s ease-out;
}

@keyframes mtFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Top Banner & Controls */
.math-tutor .mt-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #4338ca;
  color: #ffffff;
  padding: 16px 20px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.18);
  margin-bottom: 16px;
}

.math-tutor .mt-banner-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
}

.math-tutor .mt-banner-sub {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #c7d2fe;
}

.math-tutor .mt-banner-stats {
  display: flex;
  align-items: center;
  gap: 14px;
}

.math-tutor .mt-streak-badge {
  background: rgba(30, 27, 75, 0.55);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.math-tutor .mt-mastery-badge {
  background: rgba(30, 27, 75, 0.55);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.math-tutor .mt-mastery-bar {
  width: 56px;
  height: 8px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  overflow: hidden;
}

.math-tutor .mt-mastery-fill {
  height: 100%;
  width: 0%;
  background: #34d399;
  transition: width 0.25s ease;
}

.math-tutor .mt-streak-num {
  color: #fbbf24;
}

.math-tutor .mt-reset-btn {
  background: transparent;
  border: 0;
  color: #e0e7ff;
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 4px 6px;
  font-family: inherit;
}

.math-tutor .mt-reset-btn:hover {
  color: #ffffff;
}

.math-tutor .mt-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 14px;
  align-items: end;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.math-tutor .mt-reasoning-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.math-tutor .mt-reasoning-toggle:hover {
  border-color: #6366f1;
  background: #eef2ff;
}

.math-tutor .mt-reasoning-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
  cursor: pointer;
  margin: 0;
}

.math-tutor .mt-control-group {
  min-width: 0;
}

.math-tutor .mt-control-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  margin-bottom: 5px;
}

.math-tutor .mt-control-group select {
  width: 100%;
  max-width: 100%;
  padding: 9px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.math-tutor .mt-new-btn {
  background: #4f46e5;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s;
}

.math-tutor .mt-new-btn:hover {
  background: #4338ca;
}

/* Main Two-Column Tutor Grid */
.math-tutor .mt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.math-tutor .mt-left-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.math-tutor .mt-canvas-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.math-tutor .mt-topic-badge {
  align-self: flex-start;
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.math-tutor .mt-problem-prompt {
  width: 100%;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  line-height: 1.45;
}

.math-tutor .mt-problem-prompt:empty {
  display: none;
}

.math-tutor #mt-canvas.is-tracing {
  cursor: crosshair;
  touch-action: none;
}

.math-tutor .mt-type-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.math-tutor .mt-type-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: inherit;
  color: #1e293b;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.math-tutor .mt-type-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.math-tutor .mt-type-input:disabled {
  background: #f8fafc;
  color: #64748b;
}

.math-tutor .mt-mode-link {
  align-self: flex-start;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-family: inherit;
}

.math-tutor .mt-mode-link:hover {
  color: #3730a3;
}

.math-tutor .mt-trace-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.math-tutor .mt-trace-bar-bg {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.math-tutor .mt-trace-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #16a34a);
  transition: width 0.2s ease;
}

.math-tutor .mt-trace-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.math-tutor .mt-clear-btn {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.math-tutor .mt-clear-btn:hover {
  background: #f1f5f9;
}

.math-tutor .mt-canvas-stage {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.math-tutor .mt-canvas-head {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.math-tutor .mt-canvas-head .mt-topic-badge {
  margin-bottom: 0;
}

.math-tutor .mt-scratch-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.math-tutor .mt-tool-btn {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.math-tutor .mt-tool-btn:hover {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #a5b4fc;
}

.math-tutor .mt-tool-btn.is-active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

.math-tutor #mt-scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  border-radius: 10px;
}

.math-tutor #mt-scratch-canvas.is-drawing {
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
}

.math-tutor .mt-keypad-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.math-tutor .mt-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.math-tutor .mt-key-btn {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 4px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: background-color 0.1s, transform 0.05s;
}

.math-tutor .mt-key-btn:hover {
  background: #eef2ff;
  border-color: #818cf8;
}

.math-tutor .mt-key-btn:active {
  transform: scale(0.96);
}

.math-tutor .mt-key-btn.mt-key-fn {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.9rem;
}

.math-tutor .mt-canvas-input {
  position: absolute;
  z-index: 5;
  text-align: center;
  font-weight: 800;
  font-family: inherit;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.96);
  border: 2.5px solid #4f46e5;
  border-radius: 6px;
  padding: 0 4px;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.math-tutor .mt-canvas-input:focus {
  outline: none;
  border-color: #4338ca;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.25);
}

.math-tutor .mt-canvas-input:disabled {
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  border-color: #94a3b8;
  box-shadow: none;
}

.math-tutor #mt-canvas {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  aspect-ratio: 520 / 400;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

/* Phased Givens & Goal Card */
.math-tutor .mt-givens-card {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.math-tutor .mt-givens-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #312e81;
  display: flex;
  align-items: center;
  gap: 8px;
}

.math-tutor .mt-givens-list {
  margin: 0;
  padding-left: 20px;
  color: #3730a3;
  font-weight: 500;
  font-size: 0.95rem;
}

.math-tutor .mt-givens-list li {
  margin-bottom: 4px;
}

.math-tutor .mt-prove-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #c7d2fe;
}

.math-tutor .mt-prove-box p {
  margin: 0;
  font-weight: 700;
  color: #312e81;
  font-size: 1.02rem;
}

.math-tutor .mt-prove-box span {
  color: #4338ca;
}

/* Right Column: Interactive Steps */
.math-tutor .mt-right-col {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.math-tutor .mt-step-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.math-tutor .mt-step-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

.math-tutor .mt-audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.math-tutor .mt-audio-btn {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.15s, opacity 0.15s;
}

.math-tutor .mt-audio-btn:hover:not(:disabled) {
  background: #e0e7ff;
}

.math-tutor .mt-audio-btn.is-active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

.math-tutor .mt-audio-btn:disabled {
  cursor: not-allowed;
}

.math-tutor .mt-step-badge {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.math-tutor .mt-coach-box {
  background: #fffbeb;
  color: #78350f;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 16px;
}

.math-tutor .mt-question {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  border-left: 4px solid #6366f1;
  padding: 4px 0 4px 14px;
  margin-bottom: 18px;
  line-height: 1.4;
}

.math-tutor .mt-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.math-tutor .option-label {
  display: block;
  position: relative;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.15s, background-color 0.15s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.math-tutor .option-label:hover {
  background: #f8fafc;
}

.math-tutor .option-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.math-tutor .option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.math-tutor .radio-custom {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  flex-shrink: 0;
  transition: all 0.15s;
}

.math-tutor .option-text {
  font-size: 1.02rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
}

/* Selected radio state */
.math-tutor .option-label:has(input:checked) {
  border-color: #6366f1;
  background-color: #e0e7ff;
}

.math-tutor .option-label:has(input:checked) .radio-custom {
  border-color: #6366f1;
  background-color: #6366f1;
  box-shadow: inset 0 0 0 4px #ffffff;
}

/* Disabled / locked state after checking */
.math-tutor .option-label:has(input:disabled) {
  opacity: 0.65;
  cursor: not-allowed;
  background-color: #f8fafc;
}

.math-tutor .option-label:has(input:disabled:checked) {
  border-color: #ef4444;
  background-color: #fef2f2;
  opacity: 1;
}

.math-tutor .option-label:has(input:disabled:checked) .radio-custom {
  border-color: #ef4444;
  background-color: #ef4444;
  box-shadow: inset 0 0 0 4px #ffffff;
}

.math-tutor .option-label.is-correct-locked:has(input:disabled:checked) {
  border-color: #16a34a;
  background-color: #f0fdf4;
}

.math-tutor .option-label.is-correct-locked:has(input:disabled:checked) .radio-custom {
  border-color: #16a34a;
  background-color: #16a34a;
}

/* Feedback Boxes */
.math-tutor .mt-feedback-correct {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}

.math-tutor .mt-feedback-correct p {
  margin: 8px 0 0;
  color: #166534;
  font-weight: 500;
}

.math-tutor .mt-feedback-wrong {
  margin-top: 18px;
  padding: 18px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

.math-tutor .mt-feedback-wrong p {
  margin: 6px 0 0;
  color: #991b1b;
  font-weight: 500;
}

.math-tutor .mt-vocab-review {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #fecaca;
}

.math-tutor .mt-vocab-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b91c1c;
  margin-bottom: 10px;
}

.math-tutor .mt-vocab-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
}

.math-tutor .mt-vocab-badge {
  display: inline-block;
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

.math-tutor .mt-vocab-badge.is-right {
  border-color: #bbf7d0;
  color: #166534;
}

.math-tutor .mt-vocab-exp {
  margin: 5px 0 0 2px;
  line-height: 1.4;
  color: #7f1d1d;
}

.math-tutor .mt-check-btn {
  margin-top: 20px;
  width: 100%;
  background: #4f46e5;
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  transition: background-color 0.15s, opacity 0.15s;
}

.math-tutor .mt-check-btn:hover:not(:disabled) {
  background: #4338ca;
}

.math-tutor .mt-check-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Success Banner */
.math-tutor .mt-success-card {
  margin-top: 12px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  padding: 28px 22px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.math-tutor .mt-success-emoji {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.math-tutor .mt-success-card h3 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.math-tutor .mt-success-card p {
  margin: 0 0 20px;
  color: #e0e7ff;
  font-weight: 500;
}

.math-tutor .mt-next-btn {
  background: #ffffff;
  color: #4338ca;
  border: 0;
  border-radius: 999px;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, background-color 0.15s;
}

.math-tutor .mt-next-btn:hover {
  background: #f8fafc;
  transform: scale(1.03);
}

/* Hub page grid */
.mt-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0 32px;
}

.mt-hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  text-decoration: none;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.mt-hub-card:hover {
  transform: translateY(-2px);
  border-color: #6366f1;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.12);
}

.mt-hub-card h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: #3730a3;
}

.mt-hub-card p {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.45;
}

.mt-hub-cta {
  font-size: 0.88rem;
  font-weight: 700;
  color: #4f46e5;
}

/* Curriculum Overview FAQ Accordion */
.mt-curriculum-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 22px;
}

.mt-curriculum-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease;
}

.mt-curriculum-item[open] {
  border-color: #c7d2fe;
}

.mt-curriculum-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.98rem;
  color: #1e293b;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.mt-curriculum-summary::-webkit-details-marker {
  display: none;
}

.mt-curriculum-summary:hover {
  background: #f8fafc;
}

.mt-curriculum-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mt-curriculum-code {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.mt-curriculum-std {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 999px;
}

.mt-curriculum-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mt-curriculum-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 9px;
  border-radius: 999px;
}

.mt-curriculum-chevron {
  font-size: 0.85rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.mt-curriculum-item[open] .mt-curriculum-chevron {
  transform: rotate(180deg);
  color: #4f46e5;
}

.mt-subtopic-list {
  margin: 0;
  padding: 4px 20px 16px 40px;
  border-top: 1px solid #f1f5f9;
  background: #fafbff;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 24px;
  list-style: disc;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.5;
}

.mt-subtopic-list li {
  margin: 4px 0 0;
}

@media (max-width: 900px) {
  .math-tutor .mt-grid {
    grid-template-columns: 1fr;
  }
  .math-tutor .mt-controls {
    grid-template-columns: 1fr;
  }
  .mt-grade-pill.mt-pill-worksheets {
    margin-left: 0;
  }
}
