:root {
  --mp-ink: #15213a;
  --mp-ink-2: #273756;
  --mp-muted: #65748e;
  --mp-bg: #f5f8ff;
  --mp-paper: #ffffff;
  --mp-soft: #eef6ff;
  --mp-line: rgba(21, 33, 58, 0.13);
  --mp-blue: #3b82f6;
  --mp-cyan: #22c7e8;
  --mp-green: #30d17d;
  --mp-yellow: #ffe25d;
  --mp-coral: #ff6b7a;
  --mp-purple: #8b7cf6;
  --mp-orange: #ff9f43;
  --mp-radius: 8px;
  --mp-shadow: 0 20px 50px rgba(21, 33, 58, 0.10);
  --mp-pop-shadow: 0 10px 0 rgba(21, 33, 58, 0.10), 0 22px 40px rgba(21, 33, 58, 0.08);
}

html.dark {
  --mp-ink: #f8fbff;
  --mp-ink-2: #dce9ff;
  --mp-muted: #afbdd2;
  --mp-bg: #10182b;
  --mp-paper: #16213a;
  --mp-soft: #1f2d4d;
  --mp-line: rgba(248, 251, 255, 0.15);
  --mp-shadow: 0 20px 50px rgba(0, 0, 0, 0.26);
  --mp-pop-shadow: 0 10px 0 rgba(0, 0, 0, 0.20), 0 22px 40px rgba(0, 0, 0, 0.26);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--mp-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(255, 226, 93, 0.16) 0 12%, transparent 12% 100%),
    linear-gradient(225deg, rgba(34, 199, 232, 0.16) 0 14%, transparent 14% 100%),
    linear-gradient(180deg, #fff 0%, var(--mp-bg) 46%, #eef8ff 100%);
}

html.dark body {
  background:
    linear-gradient(135deg, rgba(139, 124, 246, 0.18) 0 12%, transparent 12% 100%),
    linear-gradient(225deg, rgba(34, 199, 232, 0.12) 0 14%, transparent 14% 100%),
    var(--mp-bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(59, 130, 246, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(48, 209, 125, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, transparent 0 5rem, rgba(255, 107, 122, 0.14) 5rem 5.25rem, transparent 5.25rem 100%);
  background-size: 40px 40px, 40px 40px, 100% 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.35));
}

.mp-shell,
.brand-shell,
.lesson-band,
.grid-bg {
  background:
    linear-gradient(90deg, rgba(59, 130, 246, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(48, 209, 125, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
}

html.dark .mp-shell,
html.dark .brand-shell,
html.dark .lesson-band,
html.dark .grid-bg {
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(48, 209, 125, 0.035) 1px, transparent 1px),
    var(--mp-bg);
  background-size: 40px 40px;
}

nav,
.mp-nav,
.nav-surface {
  background: color-mix(in srgb, var(--mp-paper) 90%, transparent) !important;
  border-color: var(--mp-line) !important;
  color: var(--mp-ink) !important;
  backdrop-filter: blur(18px);
}

nav::after,
.mp-nav::after {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--mp-blue), var(--mp-cyan), var(--mp-green), var(--mp-yellow), var(--mp-coral), var(--mp-purple));
}

body.mp-shell-nav-mounted {
  padding-top: 5.25rem !important;
  overflow-x: clip !important;
  max-width: 100%;
}

html.mp-shell-nav-mounted-root {
  overflow-x: clip !important;
  max-width: 100%;
}

.mp-global-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  width: 100%;
  border-bottom: 1px solid var(--mp-line);
  background: color-mix(in srgb, var(--mp-paper) 91%, transparent) !important;
  color: var(--mp-ink);
  backdrop-filter: blur(18px);
}

.mp-global-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, 80rem);
  min-height: 5rem;
  margin: 0 auto;
}

.mp-global-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.7rem;
  color: var(--mp-ink);
  text-decoration: none;
}

.mp-global-mark {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 0.8rem;
  box-shadow: 0 8px 0 rgba(21, 33, 58, 0.10);
}

.mp-global-brand span {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.mp-global-brand strong {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0;
}

.mp-global-brand small {
  overflow: hidden;
  color: var(--mp-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mp-global-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mp-global-link,
.mp-global-theme,
.mp-global-cta,
.mp-global-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.7rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.mp-global-link,
.mp-global-theme,
.mp-global-menu-button {
  background: transparent;
  color: var(--mp-ink);
}

.mp-global-link:hover,
.mp-global-theme:hover,
.mp-global-menu-button:hover {
  border-color: var(--mp-line);
  background: var(--mp-paper);
  transform: translateY(-1px);
}

.mp-global-link.is-active {
  background: var(--mp-soft);
  color: var(--mp-blue);
}

.mp-global-theme {
  cursor: pointer;
}

.mp-global-cta {
  background: var(--mp-ink);
  color: #fff !important;
  box-shadow: 0 8px 0 rgba(21, 33, 58, 0.14);
}

html.dark .mp-global-cta {
  background: var(--mp-cyan);
  color: #07111f !important;
}

.mp-global-menu-button {
  display: none;
  cursor: pointer;
}

@media (max-width: 900px) {
  .mp-global-nav-inner {
    min-height: 4.75rem;
  }

  .mp-global-menu-button {
    display: inline-flex;
  }

  .mp-global-links {
    position: fixed;
    top: 4.9rem;
    right: 1rem;
    left: 1rem;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    border: 1px solid var(--mp-line);
    border-radius: var(--mp-radius);
    background: var(--mp-paper);
    padding: 0.75rem;
    box-shadow: var(--mp-pop-shadow);
  }

  .mp-global-links.is-open {
    display: grid;
  }

  .mp-global-link,
  .mp-global-theme,
  .mp-global-cta {
    width: 100%;
  }
}

.panel,
.glass-panel,
.mp-panel,
.item-card,
.tool-card,
.mp-card {
  background: color-mix(in srgb, var(--mp-paper) 96%, transparent) !important;
  border: 1px solid var(--mp-line) !important;
  border-radius: var(--mp-radius) !important;
  box-shadow: var(--mp-shadow);
  color: var(--mp-ink) !important;
}

.panel:hover,
.mp-panel:hover,
.item-card:hover,
.tool-card:hover,
.mp-card:hover {
  border-color: color-mix(in srgb, var(--mp-blue) 46%, var(--mp-line)) !important;
}

html.dark .mp-shell .bg-white,
html.dark .brand-shell .bg-white,
html.dark .lesson-band .bg-white,
html.dark .grid-bg .bg-white {
  background-color: var(--mp-paper) !important;
  color: var(--mp-ink) !important;
}

html.dark .mp-shell .bg-sky-100,
html.dark .mp-shell .bg-green-100,
html.dark .mp-shell .bg-yellow-100,
html.dark .mp-shell .bg-mint-100,
html.dark .brand-shell .bg-sky-100,
html.dark .brand-shell .bg-green-100,
html.dark .brand-shell .bg-yellow-100,
html.dark .brand-shell .bg-mint-100 {
  color: #07111f !important;
}

html.dark input,
html.dark textarea,
html.dark select {
  background-color: color-mix(in srgb, var(--mp-paper) 92%, #07111f 8%) !important;
  color: var(--mp-ink) !important;
}

.muted,
.text-mute,
.text-muted {
  color: var(--mp-muted) !important;
}

.mp-section-title,
.font-display {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 900;
  letter-spacing: 0;
}

.mp-chip,
.mp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--mp-line);
  border-radius: 999px;
  background: var(--mp-paper);
  color: var(--mp-ink);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.55rem 0.75rem;
}

.mp-button,
.mp-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  font-weight: 900;
  min-height: 2.75rem;
  padding: 0.75rem 1.05rem;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.mp-button {
  background: var(--mp-ink);
  color: white !important;
  box-shadow: 0 8px 0 rgba(21, 33, 58, 0.16), 0 18px 28px rgba(21, 33, 58, 0.14);
}

html.dark .mp-button {
  background: var(--mp-cyan);
  color: #07111f !important;
}

.mp-button-secondary {
  background: var(--mp-paper);
  color: var(--mp-ink) !important;
  border: 1px solid var(--mp-line);
}

.mp-button:hover,
.mp-button-secondary:hover {
  transform: translateY(-2px);
}

.mp-button:active,
.mp-button-secondary:active {
  transform: translateY(1px);
}

.mp-accent-strip {
  background: linear-gradient(90deg, var(--mp-blue), var(--mp-cyan), var(--mp-green), var(--mp-yellow), var(--mp-coral), var(--mp-purple));
  border-radius: 999px;
  height: 0.5rem;
}

.mp-pal-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background:
    linear-gradient(135deg, rgba(255, 226, 93, 0.30), transparent 42%),
    linear-gradient(225deg, rgba(34, 199, 232, 0.26), transparent 42%),
    var(--mp-paper);
  box-shadow: var(--mp-pop-shadow);
}

.mp-pal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(21, 33, 58, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(21, 33, 58, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 70%);
}

.mp-buddy {
  display: inline-grid;
  place-items: center;
  width: clamp(5.5rem, 11vw, 8rem);
  aspect-ratio: 1;
  border: 4px solid var(--mp-ink);
  border-radius: 28% 28% 22% 22%;
  background: #fff;
  box-shadow: 0 10px 0 rgba(21, 33, 58, 0.16);
  transform: rotate(-2deg);
}

.mp-buddy-face {
  position: relative;
  width: 68%;
  height: 58%;
  border: 4px solid var(--mp-ink);
  border-radius: 8px;
  background: linear-gradient(180deg, #dff6ff 0 34%, #fff 34% 100%);
}

.mp-buddy-face::before,
.mp-buddy-face::after {
  content: "";
  position: absolute;
  top: 46%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--mp-ink);
}

.mp-buddy-face::before { left: 22%; }
.mp-buddy-face::after { right: 22%; }

.mp-buddy-smile {
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: 32px;
  height: 14px;
  border-bottom: 4px solid var(--mp-ink);
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.mp-sticker-note {
  border: 1px solid rgba(21, 33, 58, 0.12);
  border-radius: var(--mp-radius);
  background: var(--mp-yellow);
  color: #15213a;
  box-shadow: 0 8px 0 rgba(21, 33, 58, 0.10);
}

.mp-mission-banner {
  border: 2px solid rgba(21, 33, 58, 0.08);
  border-radius: var(--mp-radius);
  background: linear-gradient(135deg, #dff6ff, #e5ffef 48%, #fff1ab);
  color: #15213a;
  box-shadow: var(--mp-pop-shadow);
}

.mp-role-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: color-mix(in srgb, var(--mp-paper) 92%, var(--story-a, var(--mp-blue)) 8%);
  color: var(--mp-ink);
  padding: 0.85rem;
  box-shadow: var(--mp-shadow);
}

.mp-role-strip strong,
.mp-role-strip span {
  display: block;
}

.mp-role-strip strong {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.mp-role-strip span {
  margin-top: 0.2rem;
  color: var(--mp-muted);
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1.45;
}

.mp-role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.mp-role-actions button {
  min-height: 2.45rem;
  border: 1px solid var(--mp-line);
  border-radius: 999px;
  background: var(--mp-paper);
  color: var(--mp-ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.65rem 0.8rem;
}

.mp-role-actions button[aria-pressed="true"] {
  border-color: transparent;
  background: var(--mp-ink);
  color: white;
}

html.dark .mp-role-actions button[aria-pressed="true"] {
  background: var(--mp-cyan);
  color: #07111f;
}

.mp-story-hero {
  position: relative;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background:
    radial-gradient(circle at 14% 18%, color-mix(in srgb, var(--story-c, var(--mp-yellow)) 40%, transparent) 0 8rem, transparent 8.1rem),
    linear-gradient(135deg, color-mix(in srgb, var(--story-a, var(--mp-blue)) 20%, transparent), transparent 46%),
    linear-gradient(225deg, color-mix(in srgb, var(--story-b, var(--mp-green)) 22%, transparent), transparent 42%),
    var(--mp-paper);
  box-shadow: var(--mp-pop-shadow);
  color: var(--mp-ink);
}

.mp-story-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(21, 33, 58, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(21, 33, 58, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 78%);
}

html.dark .mp-story-hero::before {
  background:
    linear-gradient(90deg, rgba(248, 251, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(248, 251, 255, 0.05) 1px, transparent 1px);
}

.mp-story-scene {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: space-between;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: color-mix(in srgb, var(--mp-paper) 78%, var(--story-a, var(--mp-blue)) 22%);
  box-shadow: 0 12px 0 rgba(21, 33, 58, 0.08);
}

.mp-story-scene svg {
  width: 100%;
  min-height: 14.5rem;
}

.mp-story-scene figcaption {
  display: grid;
  gap: 0.25rem;
  border-top: 1px solid var(--mp-line);
  background: color-mix(in srgb, var(--mp-paper) 90%, transparent);
  padding: 0.9rem;
}

.mp-story-scene figcaption strong {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.mp-story-scene figcaption span {
  color: var(--mp-muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.mp-story-scene .story-bg {
  fill: color-mix(in srgb, var(--mp-paper) 86%, var(--story-a, var(--mp-blue)) 14%);
  stroke: var(--mp-line);
  stroke-width: 2;
}

.mp-story-scene .story-grid {
  stroke: color-mix(in srgb, var(--mp-muted) 25%, transparent);
  stroke-width: 1;
}

.mp-story-scene .story-path {
  fill: none;
  stroke: var(--story-a, var(--mp-blue));
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mp-story-scene .story-line,
.mp-story-scene .story-axis,
.mp-story-scene .story-edge {
  stroke: var(--mp-ink);
  stroke-width: 5;
  stroke-linecap: round;
}

.mp-story-scene .story-edge.alt {
  stroke: var(--story-b, var(--mp-green));
}

.mp-story-scene .story-limit {
  stroke: var(--story-a, var(--mp-blue));
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 8 7;
}

.mp-story-scene .story-limit.alt {
  stroke: var(--story-b, var(--mp-green));
}

.mp-story-scene .story-dot,
.mp-story-scene .story-node,
.mp-story-scene .story-token,
.mp-story-scene .story-object,
.mp-story-scene .story-card,
.mp-story-scene .story-pan {
  fill: var(--story-c, var(--mp-yellow));
  stroke: var(--mp-ink);
  stroke-width: 4;
}

.mp-story-scene .story-dot.alt,
.mp-story-scene .story-token.alt,
.mp-story-scene .story-pan.alt,
.mp-story-scene .story-bar.alt {
  fill: var(--story-b, var(--mp-green));
}

.mp-story-scene .story-card {
  fill: color-mix(in srgb, var(--mp-paper) 75%, var(--story-b, var(--mp-green)) 25%);
}

.mp-story-scene .story-shade {
  fill: color-mix(in srgb, var(--story-c, var(--mp-yellow)) 65%, var(--story-a, var(--mp-blue)) 35%);
  fill-opacity: 0.6;
  stroke: var(--story-b, var(--mp-green));
  stroke-width: 3;
}

.mp-story-scene .story-water {
  fill: none;
  stroke: var(--story-a, var(--mp-blue));
  stroke-width: 5;
  stroke-linecap: round;
}

.mp-story-scene .story-bar {
  fill: var(--story-a, var(--mp-blue));
  stroke: var(--mp-ink);
  stroke-width: 3;
}

.mp-story-scene text {
  fill: #07111f;
  font-size: 0.9rem;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 3;
}

.mp-story-beat {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: color-mix(in srgb, var(--mp-paper) 88%, var(--story-c, var(--mp-yellow)) 12%);
  padding: 0.85rem;
}

.mp-story-beat strong {
  color: var(--mp-ink);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mp-story-beat span {
  color: var(--mp-muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.mp-teacher-card,
.mp-teacher-side,
.mp-script-card {
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: color-mix(in srgb, var(--mp-paper) 92%, var(--story-a, var(--mp-blue)) 8%);
  color: var(--mp-ink);
  box-shadow: var(--mp-shadow);
}

.mp-teacher-card {
  padding: 1rem;
}

.mp-teacher-card span,
.mp-teacher-side strong {
  display: block;
  color: var(--mp-muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mp-teacher-card p {
  margin: 0.45rem 0 0;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.55;
}

.mp-teacher-side {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  padding: 1rem;
}

.mp-teacher-side span {
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-paper);
  padding: 0.75rem;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.45;
}

.mp-script-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.mp-script-num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--story-c, var(--mp-yellow));
  color: #07111f;
  font-weight: 900;
}

.mp-script-card h3 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
}

.mp-script-card p {
  margin: 0.55rem 0 0;
  color: var(--mp-ink);
  font-size: 0.93rem;
  font-weight: 800;
  line-height: 1.55;
}

.mp-course-card {
  position: relative;
  overflow: hidden;
  border-left: 8px solid var(--mp-blue) !important;
}

.mp-course-card > * {
  position: relative;
  z-index: 1;
}

.mp-course-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 150px;
  height: 150px;
  background:
    linear-gradient(45deg, transparent 0 42%, rgba(255, 255, 255, 0.65) 42% 58%, transparent 58% 100%),
    color-mix(in srgb, var(--mp-course-color, var(--mp-blue)) 24%, transparent);
  pointer-events: none;
  transform: rotate(10deg);
  z-index: 0;
}

.mp-journey {
  counter-reset: checkpoint;
  display: grid;
  gap: 0.8rem;
}

@media (min-width: 860px) {
  .mp-journey {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.mp-checkpoint {
  position: relative;
  min-height: 9.5rem;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-paper);
  padding: 1rem;
  box-shadow: 0 8px 0 rgba(21, 33, 58, 0.07);
}

.mp-checkpoint::before {
  counter-increment: checkpoint;
  content: counter(checkpoint);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--mp-course-color, var(--mp-blue));
  color: #15213a;
  font-weight: 900;
  margin-bottom: 0.6rem;
}

.mp-strand-number { --mp-course-color: var(--mp-blue); border-left-color: var(--mp-blue) !important; }
.mp-strand-algebra { --mp-course-color: var(--mp-purple); border-left-color: var(--mp-purple) !important; }
.mp-strand-measurement { --mp-course-color: var(--mp-orange); border-left-color: var(--mp-orange) !important; }
.mp-strand-space { --mp-course-color: var(--mp-cyan); border-left-color: var(--mp-cyan) !important; }
.mp-strand-statistics { --mp-course-color: var(--mp-green); border-left-color: var(--mp-green) !important; }
.mp-strand-probability { --mp-course-color: var(--mp-coral); border-left-color: var(--mp-coral) !important; }

.mp-step-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .mp-step-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

input,
textarea,
select {
  border-color: var(--mp-line) !important;
  border-radius: var(--mp-radius) !important;
}

input[type="range"] {
  accent-color: var(--mp-coral);
}

iframe.mp-tool-frame {
  width: 100%;
  min-height: 980px;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-paper);
}

.mp-inline-tool-card {
  overflow: hidden;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background:
    linear-gradient(135deg, rgba(255, 226, 93, 0.22), transparent 35%),
    linear-gradient(225deg, rgba(34, 199, 232, 0.20), transparent 38%),
    var(--mp-paper);
  box-shadow: var(--mp-pop-shadow);
}

.mp-inline-tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--mp-line);
}

.mp-inline-tool-head h3 {
  margin: 0.4rem 0 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(1.45rem, 2.7vw, 2.4rem);
  font-weight: 900;
  line-height: 1.05;
}

.mp-inline-tool-head p {
  max-width: 46rem;
  margin: 0.55rem 0 0;
  color: var(--mp-muted);
  font-weight: 800;
  line-height: 1.55;
}

.mp-tool-family,
.mp-tool-lesson-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
}

.mp-tool-family {
  background: var(--mp-ink);
  color: #fff;
  padding: 0.55rem 0.75rem;
}

html.dark .mp-tool-family {
  background: var(--mp-cyan);
  color: #07111f;
}

.mp-tool-lesson-chip {
  flex-direction: column;
  align-items: flex-end;
  min-width: 7rem;
  border: 1px solid var(--mp-line);
  background: var(--mp-paper);
  padding: 0.7rem 0.85rem;
  text-align: right;
}

.mp-tool-lesson-chip span {
  color: var(--mp-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.mp-inline-tool-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

@media (min-width: 980px) {
  .mp-inline-tool-grid {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.36fr);
  }
}

.mp-tool-stage,
.mp-tool-side {
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background:
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(48, 209, 125, 0.05) 1px, transparent 1px),
    color-mix(in srgb, var(--mp-paper) 92%, var(--mp-soft));
  background-size: 26px 26px;
}

.mp-tool-stage {
  min-width: 0;
  padding: 1rem;
}

.mp-tool-side {
  padding: 1rem;
}

.mp-tool-side-title {
  display: inline-flex;
  border-radius: 999px;
  background: var(--mp-yellow);
  color: #15213a;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.5rem 0.7rem;
  text-transform: uppercase;
}

.mp-tool-side p {
  margin: 0.8rem 0 0;
  color: var(--mp-ink);
  font-weight: 800;
  line-height: 1.55;
}

.mp-tool-mini-note {
  margin-top: 1rem;
  border-left: 5px solid var(--mp-coral);
  border-radius: var(--mp-radius);
  background: color-mix(in srgb, var(--mp-paper) 85%, var(--mp-yellow));
  padding: 0.85rem;
}

.mp-tool-mini-note span {
  display: inline-flex;
  margin-bottom: 0.4rem;
  color: var(--mp-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mp-tool-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  min-height: 2.5rem;
  border: 1px solid var(--mp-line);
  border-radius: 999px;
  background: var(--mp-paper);
  color: var(--mp-ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0.65rem 0.9rem;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.mp-tool-reset:hover {
  border-color: color-mix(in srgb, var(--mp-blue) 48%, var(--mp-line));
  background: var(--mp-soft);
  transform: translateY(-1px);
}

.mp-tool-controls {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 760px) {
  .mp-tool-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mp-slider-row,
.mp-select-row {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-paper);
  padding: 0.75rem;
  font-size: 0.85rem;
  font-weight: 900;
}

.mp-slider-row span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mp-slider-row b {
  border-radius: 999px;
  background: var(--mp-soft);
  padding: 0.25rem 0.55rem;
}

.mp-slider-row input {
  width: 100%;
}

.mp-live-readout {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-ink);
  color: white;
  padding: 1rem;
}

html.dark .mp-live-readout {
  background: #07111f;
}

.mp-live-readout strong {
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.35;
}

.mp-live-readout span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.5;
}

.mp-number-line-wrap {
  min-height: 9rem;
  display: grid;
  align-items: center;
}

.mp-number-line {
  position: relative;
  height: 4px;
  margin: 3.2rem 1rem 2rem;
  border-radius: 999px;
  background: var(--mp-ink);
}

.mp-number-line::before {
  content: "";
  position: absolute;
  inset: -2.1rem 50% auto auto;
  width: 2px;
  height: 4.2rem;
  background: var(--mp-muted);
}

.mp-number-tick {
  position: absolute;
  top: 1rem;
  transform: translateX(-50%);
  color: var(--mp-muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.mp-number-point {
  position: absolute;
  top: -1.25rem;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 3px solid var(--mp-ink);
  border-radius: 999px;
  background: var(--mp-yellow);
  color: #15213a;
  font-size: 0.8rem;
  font-weight: 900;
  transform: translateX(-50%);
  transition: left 180ms ease;
}

.mp-point-b {
  background: var(--mp-green);
}

.mp-number-hop {
  position: absolute;
  top: -1.6rem;
  height: 1.4rem;
  border-top: 4px solid var(--mp-coral);
  border-radius: 999px 999px 0 0;
  transition: left 180ms ease, width 180ms ease;
}

.mp-fraction-model {
  display: grid;
  overflow: hidden;
  min-height: 8rem;
  border: 4px solid var(--mp-ink);
  border-radius: var(--mp-radius);
  background: var(--mp-paper);
}

.mp-fraction-model span {
  border-right: 1px solid var(--mp-line);
  background: rgba(59, 130, 246, 0.08);
}

.mp-fraction-model span.is-filled {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent),
    var(--mp-coral);
}

.mp-finance-graph,
.mp-stat-bars,
.mp-probability-bars {
  position: relative;
  display: flex;
  align-items: end;
  gap: 0.45rem;
  min-height: 13rem;
  border-bottom: 4px solid var(--mp-ink);
  border-left: 4px solid var(--mp-ink);
  padding: 1rem 0.75rem 0;
}

.mp-finance-graph span,
.mp-stat-bars span,
.mp-probability-bars span {
  display: grid;
  align-items: end;
  justify-items: center;
  flex: 1;
  min-width: 1.4rem;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--mp-cyan), var(--mp-blue));
  color: #07111f;
  font-size: 0.68rem;
  font-weight: 900;
  transition: height 160ms ease;
}

.mp-stat-bars span {
  background: linear-gradient(180deg, var(--mp-green), var(--mp-yellow));
}

.mp-probability-bars span {
  position: relative;
  background: linear-gradient(180deg, var(--mp-coral), var(--mp-orange));
}

.mp-probability-bars::after {
  content: "theory";
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  top: var(--theory, 84%);
  border-top: 2px dashed var(--mp-ink);
  color: var(--mp-ink);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: right;
}

.mp-probability-bars em {
  margin-bottom: 0.25rem;
  color: #07111f;
  font-style: normal;
}

.mp-ratio-bars {
  display: grid;
  gap: 1rem;
  padding: 1rem 0;
}

.mp-ratio-bars div {
  display: grid;
  gap: 0.45rem;
  font-weight: 900;
}

.mp-ratio-bars span {
  display: flex;
  align-items: center;
  min-height: 3rem;
  border-radius: var(--mp-radius);
  background: linear-gradient(90deg, var(--mp-purple), var(--mp-cyan));
  color: #07111f;
  padding-left: 1rem;
  transition: width 160ms ease;
}

.mp-balance-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
}

.mp-balance-pan {
  min-height: 12rem;
  border: 2px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-paper);
  padding: 0.8rem;
}

.mp-balance-pan strong {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.mp-balance-pan span {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mp-balance-pan i {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 6px;
  color: #15213a;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 900;
}

.mp-balance-pan i.is-x { background: var(--mp-purple); color: white; }
.mp-balance-pan i.is-num { background: var(--mp-yellow); }
.mp-balance-pan i.is-neg { background: var(--mp-coral); color: white; }

.mp-balance-pivot {
  position: relative;
  min-height: 9rem;
}

.mp-balance-pivot span {
  position: absolute;
  left: 50%;
  bottom: 4.5rem;
  width: 6.5rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--mp-ink);
  transform-origin: center;
  translate: -50% 0;
  transition: transform 200ms ease;
}

.mp-balance-pivot::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.8rem;
  width: 0;
  height: 0;
  border-left: 2rem solid transparent;
  border-right: 2rem solid transparent;
  border-bottom: 4rem solid var(--mp-orange);
  translate: -50% 0;
}

.mp-graph-svg,
.mp-geometry-svg,
.mp-measure-svg,
.mp-trig-svg,
.mp-network-svg,
.mp-vector-svg {
  width: 100%;
  min-height: 14rem;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-paper);
}

.mp-graph-svg .grid-line,
.mp-grid-lines line {
  stroke: color-mix(in srgb, var(--mp-muted) 26%, transparent);
  stroke-width: 1;
}

.mp-graph-svg .axis-line,
.mp-geometry-svg line,
.mp-measure-svg line,
.mp-trig-svg line,
.mp-vector-svg line {
  stroke: var(--mp-ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.mp-graph-svg path[data-curve] {
  fill: none;
  stroke: var(--mp-coral);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mp-graph-svg path[data-shade] {
  fill: color-mix(in srgb, var(--mp-yellow) 62%, var(--mp-cyan));
  fill-opacity: 0.55;
  stroke: color-mix(in srgb, var(--mp-orange) 70%, var(--mp-ink));
  stroke-width: 2;
}

.mp-graph-svg circle,
.mp-trig-svg path,
.mp-geometry-svg path {
  fill: var(--mp-yellow);
  stroke: var(--mp-ink);
  stroke-width: 3;
}

.mp-graph-svg line[data-secant] {
  stroke: var(--mp-purple);
  stroke-width: 4;
  stroke-linecap: round;
}

.mp-graph-svg line[data-limit-a],
.mp-graph-svg line[data-limit-b] {
  stroke: var(--mp-blue);
  stroke-width: 3;
  stroke-dasharray: 7 5;
  stroke-linecap: round;
}

.mp-graph-svg line[data-limit-b] {
  stroke: var(--mp-green);
}

.mp-geometry-svg polygon,
.mp-trig-svg polygon,
.mp-measure-svg .shape-fill {
  fill: color-mix(in srgb, var(--mp-cyan) 56%, white);
  stroke: var(--mp-ink);
  stroke-width: 4;
}

.mp-geometry-svg polygon[data-image] {
  fill: color-mix(in srgb, var(--mp-coral) 62%, white);
}

.mp-measure-svg .shape-top {
  fill: color-mix(in srgb, var(--mp-yellow) 70%, white);
  stroke: var(--mp-ink);
  stroke-width: 3;
}

.mp-measure-svg .shape-side {
  fill: color-mix(in srgb, var(--mp-purple) 46%, white);
  stroke: var(--mp-ink);
  stroke-width: 3;
}

.mp-geometry-svg text,
.mp-measure-svg text,
.mp-trig-svg text,
.mp-network-svg text {
  fill: var(--mp-ink);
  font-size: 14px;
  font-weight: 900;
}

.mp-network-svg line {
  stroke: var(--mp-muted);
  stroke-width: 5;
  stroke-linecap: round;
}

.mp-network-svg line.is-active {
  stroke: var(--mp-coral);
}

.mp-network-node circle {
  fill: var(--mp-yellow);
  stroke: var(--mp-ink);
  stroke-width: 4;
}

.mp-matrix-stage {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .mp-matrix-stage {
    grid-template-columns: 12rem minmax(0, 1fr);
    align-items: center;
  }
}

.mp-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  border-left: 5px solid var(--mp-ink);
  border-right: 5px solid var(--mp-ink);
  border-radius: 14px;
  padding: 0.7rem;
}

.mp-matrix span {
  display: grid;
  place-items: center;
  min-height: 3.5rem;
  border-radius: 6px;
  background: var(--mp-yellow);
  color: #15213a;
  font-size: 1.5rem;
  font-weight: 900;
}

.mp-vector-svg line[data-input-vector] {
  stroke: var(--mp-blue);
  stroke-width: 5;
}

.mp-vector-svg line[data-output-vector] {
  stroke: var(--mp-coral);
  stroke-width: 5;
}

.mp-algorithm-card {
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: #07111f;
  color: #d8ffe8;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.7;
}

.mp-algorithm-rows {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

@media (min-width: 700px) {
  .mp-algorithm-rows {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.mp-algorithm-rows span {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  background: var(--mp-paper);
  padding: 0.65rem;
  font-size: 0.8rem;
  font-weight: 900;
}

@media (max-width: 720px) {
  iframe.mp-tool-frame {
    min-height: 760px;
  }

  .mp-inline-tool-head,
  .mp-balance-board {
    grid-template-columns: 1fr;
  }

  .mp-inline-tool-head {
    flex-direction: column;
  }

  .mp-tool-lesson-chip {
    align-items: flex-start;
    text-align: left;
  }

  .mp-balance-pivot {
    display: none;
  }
}

html.mp-embedded-tool body {
  background: transparent !important;
}

html.mp-embedded-tool main {
  max-width: none !important;
  padding: 1.25rem !important;
}

html.mp-embedded-tool header,
html.mp-embedded-tool nav,
html.mp-embedded-tool main > a:first-child {
  display: none !important;
}

html.mp-embedded-tool main > section:first-child,
html.mp-embedded-tool main section:first-of-type {
  margin-top: 0 !important;
}

.mp-answer-good {
  background: #d8ffe8;
  color: #14532d;
  border: 2px solid rgba(48, 209, 125, 0.30);
}

.mp-answer-warn {
  background: #fff2b8;
  color: #713f12;
  border: 2px solid rgba(255, 226, 93, 0.45);
}

.mp-vocab-row {
  display: grid;
  gap: 0.2rem;
  border: 1px solid rgba(21, 33, 58, 0.12);
  border-radius: var(--mp-radius);
  background: rgba(255, 255, 255, 0.82);
  color: #15213a;
  padding: 0.7rem;
}

.mp-vocab-row strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.mp-vocab-row span {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.mp-worked-example {
  position: relative;
}

.mp-teacher-why {
  border-left: 5px solid var(--mp-blue);
  border-radius: var(--mp-radius);
  background: color-mix(in srgb, var(--mp-soft) 86%, var(--mp-paper));
  color: var(--mp-ink);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.6;
  padding: 0.9rem;
}

.mp-step-chain {
  counter-reset: worked-step;
}

.mp-solution-step {
  position: relative;
  background:
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    var(--mp-paper);
  background-size: 24px 24px;
  animation: mpStepIn 260ms ease both;
}

.mp-solution-step:not(:last-child)::after {
  content: "↓";
  position: absolute;
  left: 1.4rem;
  bottom: -1.05rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: var(--mp-coral);
  color: white;
  font-size: 0.85rem;
  font-weight: 900;
}

.mp-answer-detail {
  display: grid;
  gap: 0.35rem;
}

.mp-answer-detail ol {
  counter-reset: answer-step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mp-answer-detail li {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  gap: 0.6rem;
  align-items: start;
  border-radius: var(--mp-radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 0.55rem;
  line-height: 1.45;
}

.mp-answer-detail li span {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--mp-yellow);
  color: #15213a;
  font-size: 0.72rem;
  font-weight: 900;
}

@keyframes mpStepIn {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mp-assignment-card {
  min-height: 18rem;
}

.mp-difficulty-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  color: #15213a;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.mp-difficulty-easy { background: #d8ffe8; }
.mp-difficulty-core { background: #dff6ff; }
.mp-difficulty-medium { background: #fff2b8; }
.mp-difficulty-hard { background: #ffd6dc; }
.mp-difficulty-challenge { background: #e5ddff; }

.mathpal-balance-scale > div,
.mathpal-graph-canvas > div,
.mathpal-lln-simulator > div {
  border-radius: var(--mp-radius) !important;
  border: 1px solid var(--mp-line) !important;
  background:
    linear-gradient(135deg, rgba(255, 226, 93, 0.20), transparent 40%),
    linear-gradient(225deg, rgba(34, 199, 232, 0.18), transparent 42%),
    var(--mp-paper) !important;
  box-shadow: var(--mp-pop-shadow) !important;
}

.drop-zone {
  background:
    linear-gradient(90deg, rgba(59, 130, 246, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(48, 209, 125, 0.07) 1px, transparent 1px),
    rgba(255, 255, 255, 0.88) !important;
  background-size: 24px 24px !important;
}

canvas {
  max-width: 100%;
}

@media (max-width: 760px) {
  body::before {
    background-size: 32px 32px, 32px 32px, 100% 100%;
  }

  .mp-buddy {
    width: 5rem;
  }

  .mp-button,
  .mp-button-secondary {
    min-height: 2.6rem;
    padding: 0.7rem 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
