:root {
  color-scheme: light;
  --navy: #0b3557;
  --navy-deep: #072943;
  --teal: #07969a;
  --teal-dark: #00777d;
  --gold: #f7b83f;
  --ink: #173a55;
  --muted: #587086;
  --line: #cfdee3;
  --paper: #ffffff;
  --soft: #eef7f5;
  --cream: #fbfaf6;
  --danger: #a13a30;
  --shadow: 0 22px 60px rgba(9, 50, 73, .12);
  --radius: 26px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 8%, rgba(7, 150, 154, .12), transparent 30rem),
    linear-gradient(180deg, #fff 0, var(--cream) 45rem, #f5faf9 100%);
  font-family: Inter, Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button, select, input[type="radio"] + span { -webkit-tap-highlight-color: transparent; }
button, a, select { touch-action: manipulation; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(247, 184, 63, .75);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 12px 18px;
  color: #fff;
  background: var(--navy);
  border-radius: 12px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 12px max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid rgba(11, 53, 87, .1);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}
.brand img { width: 48px; height: 48px; }
.brand span { display: grid; }
.brand strong { font-size: 1.25rem; line-height: 1.1; }
.brand small {
  margin-top: 4px;
  color: var(--teal-dark);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .11em;
}

.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a { color: var(--ink); font-weight: 800; text-decoration: none; }
.site-header nav a:hover { color: var(--teal-dark); }
.site-header .home-link {
  padding: 12px 19px;
  color: #fff;
  background: var(--navy);
  border-radius: 999px;
}
.site-header .home-link:hover { color: #fff; background: var(--teal-dark); }

main {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 58px 0 88px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .75fr);
  gap: 80px;
  align-items: end;
  padding: 18px 10px 52px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--teal-dark);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow span { width: 34px; height: 2px; background: currentColor; }
.eyebrow.light { color: #7ee5df; }

.intro h1 {
  max-width: 790px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(3.2rem, 6vw, 6.3rem);
  line-height: .92;
  letter-spacing: -.065em;
}
.intro h1 em { color: var(--teal); font-style: normal; }
.intro-copy { padding-bottom: 8px; }
.intro-copy > p:first-child { margin: 0; font-size: 1.22rem; line-height: 1.7; }
.local-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.local-note span,
.privacy-line span,
.editor-footer p > span { color: var(--teal-dark); font-weight: 900; }

.setup-layout {
  display: grid;
  grid-template-columns: minmax(380px, 520px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(11, 53, 87, .15);
  border-radius: 32px;
  box-shadow: var(--shadow);
  background: var(--navy);
}

.setup-card {
  display: grid;
  gap: 23px;
  padding: clamp(28px, 4vw, 48px);
  background: #fff;
}

.card-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.card-heading > span,
.editor-section-heading > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  color: var(--navy);
  background: var(--gold);
  border-radius: 14px;
  font-weight: 950;
}
.card-heading small,
.editor-section-heading small {
  color: var(--teal-dark);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.card-heading h2 { margin: 2px 0 0; color: var(--navy); font-size: 1.65rem; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setup-card > label,
.field-grid label,
.editor-section label { display: grid; gap: 8px; min-width: 0; }
.setup-card label > span,
.field-grid label > span,
.duration-choice legend,
.editor-section label > span {
  color: var(--ink);
  font-size: .88rem;
  font-weight: 850;
}
label span small { color: var(--muted); font-weight: 600; }

input[type="text"], select, textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f9fcfc;
}
input[type="text"]:focus, select:focus, textarea:focus { border-color: var(--teal); background: #fff; }
textarea { min-height: 100px; line-height: 1.55; resize: vertical; }
.setup-card label > small { color: var(--muted); font-size: .78rem; }

.duration-choice { margin: 0; padding: 0; border: 0; }
.duration-choice legend { margin-bottom: 9px; }
.duration-choice > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.duration-choice label { position: relative; }
.duration-choice input { position: absolute; opacity: 0; }
.duration-choice span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fcfc;
  font-size: .86rem;
  font-weight: 850;
  cursor: pointer;
}
.duration-choice input:checked + span { border-color: var(--gold); background: #fff4d8; color: var(--navy); }
.duration-choice input:focus-visible + span { outline: 3px solid rgba(247, 184, 63, .75); outline-offset: 3px; }

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 13px 22px;
  color: #fff;
  border: 0;
  border-radius: 15px;
  background: var(--teal);
  box-shadow: 0 14px 30px rgba(7, 150, 154, .2);
  font-weight: 900;
  cursor: pointer;
}
.primary-action:hover { background: var(--teal-dark); }
.privacy-line { margin: -10px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }

.setup-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 690px;
  padding: clamp(38px, 6vw, 90px);
  color: #fff;
  background:
    radial-gradient(circle at 85% 14%, rgba(126, 229, 223, .16), transparent 23rem),
    linear-gradient(145deg, var(--navy) 0%, #0d5264 100%);
}
.setup-preview::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -150px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(126, 229, 223, .15);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(126, 229, 223, .035), 0 0 0 110px rgba(247, 184, 63, .025);
}
.preview-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 30px;
  color: var(--navy);
  background: var(--gold);
  border-radius: 22px;
  font-size: 2rem;
  font-weight: 950;
  transform: rotate(-4deg);
}
.setup-preview h2 { max-width: 540px; margin: 0 0 30px; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1; letter-spacing: -.045em; }
.setup-preview ol { position: relative; z-index: 1; display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.setup-preview li { display: flex; gap: 16px; align-items: center; padding: 15px 0; border-top: 1px solid rgba(255,255,255,.13); }
.setup-preview li > span { display: grid; place-items: center; flex: 0 0 38px; height: 38px; color: var(--navy); background: #dff7f4; border-radius: 12px; font-weight: 950; }
.setup-preview li strong { font-size: 1.1rem; }
.setup-preview li p { margin: 2px 0 0; color: #d8e9ed; }

.saved-lesson-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 18px;
  background: rgba(255,255,255,.1);
}
.saved-lesson-card small { color: #b9dcdf; }
.saved-lesson-card strong { font-size: 1.18rem; }
.saved-lesson-card button { justify-self: start; padding: 0; color: var(--gold); border: 0; background: transparent; font-weight: 900; cursor: pointer; }

.lesson-workspace { margin-top: 42px; }
.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(9,50,73,.09);
}
.ready-state { display: flex; align-items: center; gap: 13px; }
.ready-state > span { width: 13px; height: 13px; border: 4px solid #d6f4ed; border-radius: 50%; background: #19a77d; }
.ready-state small { color: var(--teal-dark); font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ready-state h2 { margin: 0; color: var(--navy); font-size: 1.45rem; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.toolbar-actions button,
.student-controls button {
  min-height: 44px;
  padding: 10px 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}
.toolbar-actions .edit-button { color: var(--navy); border-color: var(--gold); background: #fff4d8; }
.toolbar-actions .student-button { color: #fff; border-color: var(--teal); background: var(--teal); }
.toolbar-actions button:hover { border-color: var(--teal); }

.save-state { display: flex; justify-content: flex-end; align-items: center; gap: 7px; min-height: 36px; padding: 6px 8px; color: var(--muted); font-size: .82rem; }
.save-state p { margin: 0; }
.save-state span { color: #168763; font-weight: 950; }
.save-state.is-saving span { color: var(--gold); }
.save-state.is-error span { color: var(--danger); }

.teacher-view {
  overflow: hidden;
  border: 1px solid rgba(11,53,87,.14);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}
.teacher-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 38px;
  padding: clamp(32px, 5vw, 64px);
  color: #fff;
  background: linear-gradient(135deg, var(--navy), #0b6974);
}
.teacher-cover .eyebrow { color: #90ece5; }
.teacher-cover h2 { margin: 0; font-size: clamp(2.5rem, 5vw, 5rem); line-height: .96; letter-spacing: -.055em; overflow-wrap: anywhere; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.lesson-meta span { padding: 7px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(255,255,255,.08); font-size: .82rem; font-weight: 800; }
.route-card { align-self: end; display: grid; gap: 10px; padding: 22px; color: var(--navy); border-radius: 20px; background: var(--gold); }
.route-card small { font-weight: 800; }
.route-card strong { font-size: 1.2rem; overflow-wrap: anywhere; }
.route-card a { color: var(--navy); font-weight: 950; text-decoration: none; }

.teacher-main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(310px, .65fr); }
.teacher-flow { display: grid; gap: 0; padding: clamp(28px, 4vw, 52px); }
.teacher-goal,
.say-to-students { padding: 22px 24px; border-radius: 18px; }
.teacher-goal { background: #edf9f6; }
.say-to-students { margin-top: 16px; color: #fff; background: var(--navy); }
.teacher-goal small,
.say-to-students small,
.teacher-side small,
.student-goal small,
.student-support-row small,
.student-footer small,
.current-step small {
  display: block;
  margin-bottom: 7px;
  color: var(--teal-dark);
  font-size: .71rem;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.say-to-students small { color: #82e2dd; }
.teacher-goal p, .say-to-students p { margin: 0; font-size: 1.05rem; font-weight: 700; }

.teacher-timeline { display: grid; gap: 12px; margin-top: 24px; }
.teacher-phase { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; }
.teacher-phase > span { display: grid; place-items: center; width: 54px; height: 54px; color: var(--navy); border-radius: 16px; background: #fff2cf; font-size: 1.15rem; font-weight: 950; }
.teacher-phase > span small { display: block; font-size: .65rem; }
.teacher-phase h3 { margin: 0; color: var(--navy); font-size: 1.15rem; }
.teacher-phase p { margin: 8px 0 0; color: var(--muted); }

.teacher-side { display: grid; align-content: start; gap: 14px; padding: clamp(28px, 4vw, 52px); border-left: 1px solid var(--line); background: #f4faf9; }
.teacher-side article { padding: 20px; border: 1px solid #d8e6e5; border-radius: 18px; background: #fff; }
.teacher-side p { margin: 0; }
.teacher-side ul { margin: 0; padding-left: 20px; }
.teacher-side li + li { margin-top: 5px; }
.teacher-side .student-steps { counter-reset: steps; display: grid; gap: 10px; padding: 0; list-style: none; }
.student-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.student-steps li::before { counter-increment: steps; content: counter(steps); display: grid; place-items: center; width: 28px; height: 28px; color: var(--navy); border-radius: 9px; background: #dff5f2; font-weight: 950; }
.support-card { border-left: 4px solid var(--teal) !important; }
.challenge-card { border-left: 4px solid var(--gold) !important; }

.lesson-editor { display: grid; gap: 18px; }
.editor-heading {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding: 34px clamp(28px, 4vw, 52px);
  color: #fff;
  border-radius: 26px;
  background: var(--navy);
}
.editor-heading h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.1; }
.editor-heading > p { max-width: 410px; margin: 18px 0 0; color: #d1e6ea; }
.editor-heading .eyebrow { color: #7ee5df; }
.editor-section { display: grid; gap: 18px; padding: clamp(26px, 4vw, 42px); border: 1px solid var(--line); border-radius: 24px; background: #fff; }
.editor-section-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.editor-section-heading > span { width: 42px; height: 42px; border-radius: 12px; }
.editor-section-heading h3 { margin: 1px 0 0; color: var(--navy); font-size: 1.35rem; }
.editor-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-three-column { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-editor-list { display: grid; gap: 11px; }
.step-editor-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 44px; gap: 10px; align-items: start; }
.step-editor-row > span { display: grid; place-items: center; height: 44px; color: var(--navy); border-radius: 12px; background: #dff5f2; font-weight: 950; }
.step-editor-row textarea { min-height: 82px; }
.step-editor-row button { display: grid; place-items: center; width: 44px; height: 44px; color: var(--danger); border: 1px solid #edcfca; border-radius: 12px; background: #fff6f4; font-weight: 900; cursor: pointer; }
.add-step { justify-self: start; padding: 9px 13px; color: var(--teal-dark); border: 1px solid #abd8d6; border-radius: 11px; background: #f1fbf9; font-weight: 850; cursor: pointer; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.editor-footer p { margin: 0; color: var(--muted); }

.student-dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--navy-deep);
}
.student-dialog::backdrop { background: rgba(3,22,36,.86); }
.student-shell { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; color: #fff; background: linear-gradient(130deg, #082e4a 0%, #0c4658 100%); }
.student-header { display: grid; grid-template-columns: 250px 1fr 54px; align-items: center; gap: 20px; min-height: 92px; padding: 16px 28px; border-bottom: 1px solid rgba(255,255,255,.14); }
.student-brand { display: flex; align-items: center; gap: 12px; }
.student-brand > span { display: grid; place-items: center; width: 46px; height: 46px; color: var(--navy); border-radius: 14px; background: var(--gold); font-size: 1.35rem; font-weight: 950; }
.student-brand div { display: grid; }
.student-brand small { color: #8bdedb; font-weight: 800; }
.student-brand strong { font-size: 1.25rem; }
.student-progress { display: flex; justify-content: center; gap: 9px; }
.student-progress span { width: 42px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.2); }
.student-progress span.is-complete { background: #7de3d8; }
.student-progress span.is-current { background: var(--gold); }
.close-student { width: 50px; height: 50px; color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; background: rgba(255,255,255,.08); font-size: 1.8rem; cursor: pointer; }
.student-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(24px, 4vw, 64px); align-items: center; padding: clamp(28px, 5vw, 72px); }
.student-meta { margin: 0 0 8px; color: #81ddd9; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.student-content h2 { max-width: 1000px; margin: 0; font-size: clamp(3rem, 6vw, 6.5rem); line-height: .92; letter-spacing: -.06em; overflow-wrap: anywhere; }
.student-goal { max-width: 960px; margin-top: 30px; padding: 17px 20px; color: var(--navy); border-radius: 16px; background: #e8f9f5; }
.student-goal p { margin: 0; font-size: clamp(1.05rem, 1.8vw, 1.45rem); font-weight: 800; }
.student-opening { max-width: 1000px; margin: 24px 0; color: #d7e9ed; font-size: clamp(1.05rem, 1.6vw, 1.32rem); }
.current-step { max-width: 1000px; padding: clamp(20px, 3vw, 34px); color: var(--navy); border-left: 8px solid var(--gold); border-radius: 18px; background: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.current-step small { color: var(--teal-dark); }
.current-step p { margin: 0; font-size: clamp(1.35rem, 2.6vw, 2.4rem); line-height: 1.3; font-weight: 900; }
.student-support-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 1000px; margin-top: 14px; }
.student-support-row article { padding: 14px 17px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.07); }
.student-support-row small { color: #83dfda; }
.student-support-row article:last-child small { color: #ffd479; }
.student-support-row p { margin: 0; color: #e7f1f3; font-size: .92rem; }

.student-controls { display: grid; gap: 13px; align-content: center; }
.timer-ring {
  --progress: 0deg;
  display: grid;
  place-items: center;
  width: min(300px, 100%);
  aspect-ratio: 1;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--progress), rgba(255,255,255,.12) 0);
}
.timer-ring::before { content: ""; grid-area: 1/1; width: 84%; height: 84%; border-radius: 50%; background: var(--navy-deep); }
.timer-ring > span { z-index: 1; grid-area: 1/1; display: grid; text-align: center; }
.timer-ring small { color: #9ac8d0; font-weight: 850; text-transform: uppercase; }
.timer-ring strong { font-size: clamp(3rem, 5vw, 5rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.timer-buttons, .step-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.student-controls button { color: #fff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
.student-controls #timer-toggle,
.student-controls #next-step { color: var(--navy); border-color: var(--gold); background: var(--gold); }
.student-controls a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 12px 16px; color: #fff; border: 1px solid #66cfc8; border-radius: 13px; text-decoration: none; font-weight: 900; }
.student-controls a[hidden] { display: none; }
.student-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 18px 30px; color: var(--navy); background: #fff; }
.student-footer > div { padding: 2px 14px; }
.student-footer > div + div { border-left: 1px solid var(--line); }
.student-footer p { margin: 0; font-weight: 800; }

.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(380px, calc(100% - 44px)); padding: 13px 17px; color: #fff; border-radius: 13px; background: var(--navy); box-shadow: var(--shadow); font-weight: 800; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(24px, calc((100vw - 1440px) / 2)); color: #d2e3e7; background: var(--navy-deep); font-size: .84rem; }
.site-footer p { margin: 0; }

[hidden] { display: none !important; }

@media (max-width: 1100px) {
  .intro { grid-template-columns: 1fr; gap: 28px; }
  .setup-layout { grid-template-columns: minmax(340px, 46%) 1fr; }
  .setup-preview { padding: 48px; }
  .teacher-main { grid-template-columns: 1fr; }
  .teacher-side { border-top: 1px solid var(--line); border-left: 0; }
  .editor-three-column { grid-template-columns: 1fr; }
  .student-main { grid-template-columns: 1fr 280px; }
}

@media (max-width: 820px) {
  .site-header { min-height: 72px; padding: 10px 18px; }
  .site-header nav a:not(.home-link) { display: none; }
  .brand img { width: 42px; height: 42px; }
  main { width: min(100% - 28px, 720px); padding-top: 38px; }
  .intro { padding: 0 2px 34px; }
  .intro h1 { font-size: clamp(3rem, 13vw, 5rem); }
  .setup-layout { grid-template-columns: 1fr; }
  .setup-preview { min-height: 520px; }
  .workspace-toolbar, .editor-heading, .editor-footer { align-items: stretch; flex-direction: column; }
  .workspace-toolbar { display: flex; }
  .toolbar-actions { justify-content: stretch; }
  .toolbar-actions button { flex: 1 1 150px; }
  .teacher-cover { grid-template-columns: 1fr; }
  .route-card { align-self: auto; }
  .editor-heading { display: flex; }
  .editor-two-column { grid-template-columns: 1fr; }
  .editor-footer { display: flex; }
  .student-dialog { overflow: auto; }
  .student-shell { min-height: 100%; }
  .student-header { grid-template-columns: 1fr auto; }
  .student-progress { grid-column: 1 / -1; grid-row: 2; }
  .student-main { grid-template-columns: 1fr; }
  .student-controls { grid-template-columns: minmax(180px, 240px) 1fr; align-items: center; }
  .timer-ring { grid-row: 1 / span 3; }
  .student-footer { grid-template-columns: 1fr; }
  .student-footer > div + div { padding-top: 12px; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 560px) {
  .brand small { font-size: .62rem; }
  .site-header .home-link { padding: 10px 13px; font-size: .86rem; }
  main { width: min(100% - 20px, 520px); }
  .intro-copy > p:first-child { font-size: 1.02rem; }
  .setup-card, .setup-preview { padding: 26px 20px; }
  .field-grid { grid-template-columns: 1fr; }
  .duration-choice > div { grid-template-columns: 1fr 1fr; }
  .setup-preview { min-height: 490px; }
  .workspace-toolbar { padding: 17px; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-actions button { min-width: 0; }
  .teacher-cover, .teacher-flow, .teacher-side, .editor-section { padding: 24px 19px; }
  .teacher-phase { grid-template-columns: 1fr; }
  .step-editor-row { grid-template-columns: 36px minmax(0, 1fr); }
  .step-editor-row > span { height: 40px; }
  .step-editor-row button { grid-column: 2; justify-self: end; margin-top: -4px; }
  .editor-heading { padding: 26px 20px; }
  .editor-footer { padding: 20px; }
  .student-header { padding: 12px 15px; }
  .student-main { padding: 24px 15px; }
  .student-content h2 { font-size: clamp(2.5rem, 15vw, 4rem); }
  .student-support-row { grid-template-columns: 1fr; }
  .student-controls { grid-template-columns: 1fr; }
  .timer-ring { grid-row: auto; width: 210px; }
  .site-footer { flex-direction: column; }
}

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

@media print {
  body { background: #fff; }
  .site-header, .intro, .setup-layout, .workspace-toolbar, .save-state, .lesson-editor, .site-footer, .toast { display: none !important; }
  main { width: 100%; padding: 0; }
  .lesson-workspace { margin: 0; }
  .teacher-view { border: 0; box-shadow: none; }
  .teacher-cover { padding: 24px; color: #082e4a; border-bottom: 2px solid #082e4a; background: #fff; }
  .teacher-cover .eyebrow { color: #00777d; }
  .teacher-cover h2 { font-size: 34pt; }
  .lesson-meta span { border-color: #9fb5c0; background: #fff; }
  .route-card { border: 1px solid #d09b32; }
  .teacher-main { grid-template-columns: 1fr; }
  .teacher-flow, .teacher-side { padding: 24px; }
  .teacher-side { border: 0; background: #fff; }
  .teacher-phase, .teacher-side article, .teacher-goal, .say-to-students { break-inside: avoid; }
  .say-to-students { color: #082e4a; border: 1px solid #082e4a; background: #fff; }
  .say-to-students small { color: #00777d; }
}
