:root {
  --ink: #17212b;
  --muted: #5d6773;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #d9dde3;
  --blue: #235c9f;
  --green: #14795d;
  --gold: #b36b00;
  --red: #b13a34;
  --violet: #6741a3;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.eyebrow,
.tag,
.station-number {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 3vw, 2.2rem);
}

h2 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.15;
}

h3 {
  font-size: 1rem;
}

.scorebox {
  min-width: 112px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  text-align: center;
}

.scorebox strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.score-label,
.score-target {
  display: block;
  font-size: 0.76rem;
  color: #cfd7df;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.75fr);
  gap: 28px;
  align-items: stretch;
  padding: 36px 0 22px;
}

.lesson-brief,
.visual-panel,
.progress-panel,
.teacher-note,
.challenge-zone,
.station {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lesson-brief {
  padding: clamp(24px, 5vw, 44px);
}

.lesson-brief p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.primary-btn,
.ghost-btn,
.step-controls button,
.quick-check button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 700;
}

.primary-btn,
.quick-check button[type="submit"],
.next-step {
  color: white;
  background: var(--blue);
}

.ghost-btn,
.prev-step,
.hint-btn {
  color: var(--ink);
  background: #edf1f5;
}

.visual-panel {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 16px;
  padding: 18px;
  overflow: hidden;
}

.axis-card {
  position: relative;
  min-height: 210px;
  background: linear-gradient(#edf2f7 1px, transparent 1px), linear-gradient(90deg, #edf2f7 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.axis::before,
.axis::after {
  content: "";
  position: absolute;
  background: #647181;
}

.axis::before {
  left: 50%;
  top: 14px;
  bottom: 14px;
  width: 2px;
}

.axis::after {
  top: 50%;
  left: 14px;
  right: 14px;
  height: 2px;
}

.parabola {
  position: absolute;
  left: 24%;
  top: 24%;
  width: 54%;
  height: 58%;
  border: 5px solid var(--red);
  border-top: 0;
  border-radius: 0 0 999px 999px;
}

.line {
  position: absolute;
  left: 16%;
  top: 58%;
  width: 70%;
  height: 4px;
  background: var(--green);
  transform: rotate(-24deg);
  transform-origin: center;
}

.shape-card {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.prism {
  position: relative;
  width: 106px;
  height: 78px;
}

.prism span {
  position: absolute;
  display: block;
  border: 3px solid var(--gold);
}

.prism span:nth-child(1) {
  left: 4px;
  top: 18px;
  width: 54px;
  height: 44px;
  clip-path: polygon(0 100%, 0 0, 100% 100%);
}

.prism span:nth-child(2) {
  left: 42px;
  top: 8px;
  width: 54px;
  height: 44px;
  clip-path: polygon(0 100%, 0 0, 100% 100%);
}

.prism span:nth-child(3) {
  left: 28px;
  top: 32px;
  width: 50px;
  height: 24px;
  transform: skewX(-24deg);
}

.sector {
  width: 78px;
  height: 78px;
  background: conic-gradient(var(--violet) 0deg 115deg, transparent 115deg 360deg);
  border-radius: 50%;
  border: 3px solid var(--violet);
}

.mini-equations {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 6px 0 18px;
}

.timeline div {
  padding: 14px;
  background: #eaf4ef;
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline span {
  margin-top: 4px;
  color: var(--muted);
}

.teacher-note,
.progress-panel,
.challenge-zone {
  margin: 18px 0;
  padding: 20px;
}

.progress-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.progress-panel p {
  color: var(--muted);
}

.meter {
  height: 18px;
  overflow: hidden;
  background: #edf1f5;
  border-radius: 999px;
}

#meterFill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 250ms ease;
}

.milestone {
  margin: 0;
  font-weight: 700;
}

.stations {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}

.station {
  overflow: hidden;
}

.station-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  background: #f5f7fa;
  border-bottom: 1px solid var(--line);
}

.station-head h2 {
  margin-bottom: 0;
}

.station-points {
  align-self: start;
  min-width: 86px;
  padding: 8px 10px;
  color: white;
  background: var(--green);
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
}

.station-body {
  display: grid;
  grid-template-columns: 0.8fr 1.25fr 1fr;
  gap: 16px;
  padding: 20px;
}

.recall,
.worked,
.quick-check,
.practice-ladder {
  padding: 16px;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.recall p,
.worked-question,
.check-question,
.step-content,
.hint,
.feedback {
  color: var(--muted);
  line-height: 1.5;
}

.worked-question,
.check-question {
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--ink);
}

.step-card {
  min-height: 128px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.step-counter {
  margin-bottom: 8px;
  color: var(--blue);
  font-weight: 700;
}

.step-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.quick-check form {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.quick-check input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #b9c2cd;
  border-radius: 8px;
}

.feedback.correct {
  color: var(--green);
  font-weight: 700;
}

.feedback.try {
  color: var(--red);
  font-weight: 700;
}

.practice-ladder {
  grid-column: 1 / -1;
}

.practice-ladder > p {
  color: var(--muted);
}

.practice-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.practice-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.practice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.difficulty {
  padding: 4px 8px;
  border-radius: 999px;
  color: white;
  background: var(--blue);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.difficulty.hard {
  background: var(--red);
}

.practice-item h4 {
  margin: 0;
  font-size: 0.95rem;
}

.practice-item p {
  margin: 0;
  line-height: 1.45;
}

.practice-answer {
  padding: 10px;
  color: var(--muted);
  background: #f5f7fa;
  border-radius: 8px;
}

.reveal-practice {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink);
  background: #edf1f5;
  border-radius: 8px;
  font-weight: 700;
}

.challenge-zone {
  display: grid;
  grid-template-columns: 0.55fr 1fr;
  gap: 18px;
  margin-bottom: 40px;
}

.challenge-zone p {
  color: var(--muted);
}

.challenge-grid {
  display: grid;
  gap: 12px;
}

.challenge-card {
  padding: 14px;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.challenge-card label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
}

.challenge-card p {
  margin: 10px 0;
}

.challenge-card ol {
  margin: 10px 0 0 22px;
  padding: 0;
  color: var(--ink);
}

.challenge-card li {
  margin: 7px 0;
  line-height: 1.35;
}

.depth-diagram {
  position: relative;
  width: min(100%, 420px);
  height: 180px;
  margin: 14px auto;
  background: linear-gradient(#edf2f7 1px, transparent 1px), linear-gradient(90deg, #edf2f7 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tank-body,
.tank-roof {
  position: absolute;
  left: 26%;
  width: 48%;
  border: 3px solid var(--blue);
}

.tank-body {
  top: 68px;
  height: 70px;
  background: rgba(35, 92, 159, 0.08);
}

.tank-roof {
  top: 30px;
  height: 40px;
  background: rgba(20, 121, 93, 0.1);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.tank-label {
  position: absolute;
  padding: 3px 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.tank-width {
  left: 42%;
  bottom: 18px;
}

.tank-height {
  right: 9%;
  top: 86px;
}

.tank-length {
  left: 8%;
  top: 142px;
}

.mistake-list {
  display: grid;
  gap: 8px;
}

.mistake-list div {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mistake-list span {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

math {
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: 1.08em;
}

@media (max-width: 920px) {
  .hero-grid,
  .progress-panel,
  .station-body,
  .challenge-zone {
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
  }

  .scorebox {
    min-width: 92px;
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .quick-check form {
    flex-direction: column;
  }

  .practice-items {
    grid-template-columns: 1fr;
  }
}
