/* Home page, header, science-area tiles and the teacher lesson library. Loaded last. */
:root {
  --chem: #2f6b3a;
  --chem-bg: #eaf2e3;
  --life: #2f7d32;
  --life-bg: #e6f4e4;
  --earth: #1f6f8b;
  --earth-bg: #e3f1f6;
  --forces: #c25e12;
  --forces-bg: #fdeedd;
  --skills: #6941c6;
  --skills-bg: #efe9fb;
}
.area-explore,
.area-chem {
  --area: var(--chem);
  --area-bg: var(--chem-bg);
}
.area-life {
  --area: var(--life);
  --area-bg: var(--life-bg);
}
.area-earth {
  --area: var(--earth);
  --area-bg: var(--earth-bg);
}
.area-forces {
  --area: var(--forces);
  --area-bg: var(--forces-bg);
}
.area-skills {
  --area: var(--skills);
  --area-bg: var(--skills-bg);
}

/* Header: logo, Teacher guide and Admin on the left */
header {
  flex-wrap: wrap;
  row-gap: 10px;
}
.top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  gap: 10px;
  margin-right: 6px;
}
.brand-mark {
  background: none;
  padding: 0;
  transform: none;
  box-shadow: none;
  line-height: 0;
}
.brand-mark svg {
  display: block;
}
.brand-name {
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
}
.top-btn {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.top-btn:hover {
  background: #fff;
  border-color: var(--blue);
  color: var(--blue);
}
#admin-button {
  background: #fdf0c4;
  border-color: #ecd58e;
}
.nav-teach {
  color: var(--muted);
}
@media (max-width: 800px) {
  .brand-name {
    font-size: 17px;
  }
  .top-btn {
    font-size: 13px;
    padding: 5px 10px;
  }
}

/* Home */
.home-hero {
  text-align: center;
  margin: 8px auto 26px;
  max-width: 720px;
}
.home-hero h1 {
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.08;
  margin: 0 0 8px;
}
.home-hero p {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}
.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 34px;
}
.door {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--soft-shadow);
  padding: 26px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  text-align: center;
  border-top: 8px solid var(--blue);
}
.door-teacher {
  border-top-color: var(--accent);
}
.door-icon {
  font-size: 44px;
  line-height: 1;
}
.door h2 {
  margin: 0 0 6px;
  font-size: 28px;
}
.door-btn {
  min-height: 56px;
  font-size: 19px;
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.door-btn.primary {
  border: 0;
  background: var(--blue);
  color: #fff;
}
.door-teacher .door-btn.primary {
  background: #b7790c;
}
.door-teacher .door-btn.primary:hover {
  background: #96620a;
}
.door-note {
  color: var(--muted);
  font-size: 14px;
  margin: 2px 0 0;
}
.home-h2 {
  font-size: 24px;
  margin: 0 0 12px;
}

/* Science-area tiles (home and Explore) */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  border-bottom: 5px solid var(--area, var(--blue));
  background: var(--area-bg, var(--card));
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--soft-shadow);
  transition: transform 0.15s;
}
.hub-card:hover {
  transform: translateY(-2px);
}
.hub-icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 4px;
}
.hub-card b {
  display: block;
  font-family: var(--heading-font);
  font-size: 20px;
  line-height: 1.15;
  color: var(--area, var(--ink));
}
.hub-card span:not(.hub-icon) {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
}

/* Explore area bar */
.areabar:not([hidden]) {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 18px;
}
.areabar button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 13px;
  min-height: 38px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.areabar button.active {
  background: var(--area-bg);
  border-color: var(--area);
  color: var(--area);
  box-shadow: inset 0 0 0 1px var(--area);
}
.areabar .areabar-all {
  background: none;
  border-style: dashed;
  color: var(--muted);
}
.subnav span {
  white-space: nowrap;
  margin-right: 8px;
}

/* Students page */
.class-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #eaf2e3;
  border: 1px solid #cddfc4;
  border-radius: 14px;
  padding: 12px 16px;
  margin: 0 0 22px;
}
.class-strip .primary {
  min-height: 46px;
}
.topic-band {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--area, var(--muted));
  margin: 0 0 4px;
}
.task-unit {
  border-top: 5px solid var(--area, var(--line));
}
.help-card {
  background: #fff8e1;
  border: 1px solid #ecd58e;
  border-radius: 12px;
  padding: 8px 14px;
  margin: 10px 0 14px;
}
.help-card summary {
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.help-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 8px 0 4px;
}
.help-words div {
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
}
.help-words dt {
  font-weight: 700;
}
.help-words dd {
  margin: 2px 0 0;
}

/* Teach: two big tabs, then area → topic → lesson */
.teach-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.teach-top h1 {
  margin: 0;
  font-size: 34px;
}
.tabs-big {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tabs-big button {
  min-height: 50px;
  padding: 10px 22px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
.tabs-big button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.lib-h {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  margin: 22px 0 12px;
}
.lib-h span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  flex: none;
}
.area-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.area-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: var(--area-bg, #fff);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--soft-shadow);
  text-align: center;
}
.area-tile.area-all {
  background: #fff;
  border-color: var(--line);
}
.area-tile .area-icon {
  font-size: 30px;
  line-height: 1;
}
.area-tile b {
  font-size: 16px;
  line-height: 1.2;
}
.area-tile small {
  color: var(--muted);
  font-size: 13px;
}
.area-tile.active {
  border-color: var(--area, var(--ink));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--area, var(--ink)) 25%, transparent);
}
.year-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}
.year-chips .chip {
  min-height: 40px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
}
.year-chips .chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.topic-card {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 16px 18px !important;
  background: #fff;
  border-top: 6px solid var(--area) !important;
  cursor: pointer;
  min-height: 0;
}
.topic-card .unit-title {
  font-size: 21px;
  font-weight: 800;
  font-family: var(--heading-font);
  line-height: 1.15;
}
.topic-card .unit-q {
  color: var(--ink);
  font-size: 15px;
}
.topic-card .unit-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  margin-top: auto;
}
.topic-empty {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 16px 18px;
}
.unit-head {
  border-left: 6px solid var(--area);
  padding-left: 16px;
}
.unit-head h2 {
  margin: 2px 0 4px;
  font-size: 32px;
}
.unit-head .unit-big-q {
  font-size: 18px;
  margin: 0;
}
.lesson-card {
  width: 100%;
}
.lesson-go {
  margin-left: auto;
  font-size: 28px;
  color: var(--muted);
  align-self: center;
}
details.more {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 16px;
  margin: 10px 0;
}
details.more > summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
}
details.more[open] {
  padding-bottom: 14px;
}
.full-plan {
  margin-top: 18px;
}
.full-plan > summary {
  font-size: 18px;
}
.lesson-go-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 16px 0 10px;
}
.big-btn {
  min-height: 52px;
  padding: 10px 22px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.big-btn.primary {
  border: 0;
  background: var(--blue);
  color: #fff;
}
.print-menu {
  position: relative;
}
.print-menu > summary {
  list-style: none;
}
.print-menu > summary::-webkit-details-marker {
  display: none;
}
.print-menu > div {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--soft-shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 220px;
}
.print-menu > div button {
  text-align: left;
  border: 0 !important;
  background: none !important;
  padding: 10px 12px !important;
  border-radius: 8px;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}
.print-menu > div button:hover {
  background: var(--paper) !important;
}
.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.glance > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
}
.glance h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--muted);
}
.glance p {
  margin: 0;
}
.steps-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
  counter-reset: s;
}
.steps-row li {
  counter-increment: s;
  background: var(--paper);
  border-radius: 12px;
  padding: 12px 14px;
}
.steps-row li::before {
  content: counter(s);
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  margin-right: 8px;
}
@media (min-width: 1000px) {
  header {
    flex-wrap: nowrap;
  }
  nav {
    order: 0;
    width: auto;
    margin: 0 auto;
  }
}
.nav {
  font-size: 16px;
}
.nowrap {
  white-space: nowrap;
}

/* Materials needed / no materials */
.mat-badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  margin: 4px 0;
  white-space: nowrap;
}
.mat-none {
  background: #e3f4e6;
  color: #22663a;
}
.mat-need {
  background: #fdeedd;
  color: #9a4a0c;
}
.lesson-body .mat-badge {
  align-self: flex-start;
}
.year-chips .chip-ipad {
  margin-left: auto;
}
.year-chips .chip-ipad.active {
  background: #22663a;
  border-color: #22663a;
}

/* ---------- Lesson hooks: mystery, warm-up flip cards, finish, celebration ---------- */
.mystery-card {
  background: linear-gradient(135deg, #1d2a3a, #2d3f63);
  color: #fff;
  border-radius: 18px;
  padding: 16px 20px 14px;
  margin: 6px 0 14px;
  box-shadow: var(--soft-shadow);
}
.mystery-badge {
  display: inline-block;
  background: #f6c945;
  color: #1d2a3a;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 14px;
}
.mystery-q {
  font-family: var(--heading-font);
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 700;
  margin: 10px 0 6px;
}
.mystery-card .say {
  filter: invert(1);
}
.mystery-tip {
  margin: 0;
  color: #d6def0;
  font-size: 14px;
}
.warmup {
  margin: 0 0 16px;
}
.warmup h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.flip-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.flip-card {
  border-radius: 14px;
  background: #fff;
  border: 2px solid var(--line);
  border-top: 5px solid #2f6b3a;
  padding: 10px 14px;
}
.flip-card.c1 {
  border-top-color: #d9533c;
}
.flip-card.c2 {
  border-top-color: #2f7d32;
}
.flip-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 650;
  min-height: 44px;
}
.flip-card summary::-webkit-details-marker {
  display: none;
}
.flip-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper);
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}
.flip-card[open] {
  background: #fff8e1;
}
.flip-card p {
  margin: 8px 0 2px;
  animation: flip-in 0.3s ease;
}
@keyframes flip-in {
  from {
    transform: rotateX(70deg);
    opacity: 0;
  }
}
.finish-btn {
  background: #2f7d32 !important;
}
.celebrate {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}
.celebrate i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  animation: confetti 2.4s ease-in forwards;
}
@keyframes confetti {
  to {
    transform: translateY(110vh) rotate(720deg);
  }
}
.celebrate-msg {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  padding: 18px 26px;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.45);
  max-width: min(90vw, 520px);
  animation: pop 0.35s ease;
}
@keyframes pop {
  from {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .celebrate-msg,
  .flip-card p {
    animation: none;
  }
}

/* Present: Kahoot-style "who agrees?" tiles */
.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 10px 0;
}
.vote-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 0;
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 700;
  cursor: pointer;
  min-height: 120px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
}
.vote-tile.v0 {
  background: #d9353c;
}
.vote-tile.v1 {
  background: #1f6fc5;
}
.vote-tile.v2 {
  background: #c99a08;
}
.vote-tile.v3 {
  background: #2f8a3a;
}
.vote-tile:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}
.vote-shape {
  font-size: 36px;
}
.vote-text {
  flex: 1;
}
.vote-count {
  font-size: 40px;
  min-width: 56px;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 4px 8px;
}
.vote-tile.bump .vote-count {
  animation: pop-count 0.25s ease;
}
@keyframes pop-count {
  50% {
    transform: scale(1.3);
  }
}
.vote-help {
  font-size: 20px;
}
.vote-answer {
  font-size: 22px;
}

/* In-lesson activity buttons */
.do-activity {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f3f7ee;
  border: 1px solid #cddfc4;
}
.do-activity.main {
  background: #eaf2e3;
  border: 2px solid #2f6b3a;
}
.do-activity h3 {
  margin: 0 0 8px;
  font-size: 17px;
}
.activity-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.activity-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 18px 10px 12px;
  border-radius: 14px;
  border: 0;
  background: #2f6b3a;
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 0 #234f2b;
}
.activity-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #234f2b;
}
.activity-btn b {
  display: block;
  font-size: 17px;
}
.activity-btn small {
  display: block;
  opacity: 0.85;
  font-size: 13px;
}
.act-play {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: #2f6b3a;
  font-size: 16px;
}
.teach-return {
  font-size: 18px !important;
  padding: 14px 22px !important;
}
.free-line {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px !important;
}
.free-pill {
  background: #e3f4e6;
  color: #22663a;
  font-weight: 800;
  font-size: 15px;
  border-radius: 999px;
  padding: 5px 14px;
}
.free-pill.alt {
  background: #eaf2e3;
  color: #234f2b;
}

/* "Your lesson" bar on activity pages opened from a lesson */
.lesson-bar:not([hidden]) {
  order: 20;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #1d2a3a;
  color: #fff;
  border-radius: 14px;
  padding: 8px 10px 8px 16px;
}
.lesson-bar-title {
  font-size: 15px;
}
.lesson-bar-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lesson-bar-tabs button {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: none;
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 38px;
  font-weight: 650;
  cursor: pointer;
}
.lesson-bar-tabs button.active {
  background: #f6c945;
  border-color: #f6c945;
  color: #1d2a3a;
}
.lesson-bar .teach-return {
  position: static !important;
  margin-left: auto;
  background: #f6c945 !important;
  color: #1d2a3a !important;
  box-shadow: none !important;
  font-size: 17px !important;
  padding: 8px 18px !important;
  min-height: 44px;
}
@media (min-width: 1000px) {
  header:has(.lesson-bar:not([hidden])) {
    flex-wrap: wrap;
  }
}

/* Student iPads: hide the teacher parts */
.student-mode .nav-teach,
.student-mode .top-btn,
.student-mode #admin-button,
.student-mode .door-teacher,
.student-mode #teacher-button,
.student-mode .teacher-only {
  display: none !important;
}

/* ---------- Wattle theme: eucalyptus green, wattle gold, sand and bark brown ---------- */
:root {
  --ink: #26301f;
  --muted: #5f604c;
  --paper: #f6f0df;
  --card: #fffcf3;
  --line: #e5dac0;
  --line-strong: #cbbd9c;
  --blue: #2f6b3a;
  --blue-dark: #234f2b;
  --lime: #f2c230;
  --accent: #d39a12;
  --bark: #7a5230;
  --soft-shadow: 0 1px 2px rgba(58, 45, 20, 0.07), 0 8px 20px -12px rgba(58, 45, 20, 0.3);
  --chem: #b5651d;
  --chem-bg: #f8ebdc;
  --life: #3f7d3a;
  --life-bg: #e7f2e0;
  --earth: #7a5230;
  --earth-bg: #f1e8dc;
  --forces: #a87800;
  --forces-bg: #fbf1d2;
  --skills: #3f6f66;
  --skills-bg: #e3efea;
}
body {
  background: var(--paper);
  color: var(--ink);
}
header {
  background: var(--card);
  border-bottom: 3px solid var(--lime);
}
.nav.active {
  border-bottom-color: var(--lime);
  color: var(--blue-dark);
}
.top-btn {
  background: #fbf3d6;
  border-color: #e6cf86;
}
.top-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.door {
  border-top-color: var(--blue);
}
.door-teacher {
  border-top-color: var(--bark);
}
.door-teacher .door-btn.primary {
  background: var(--bark);
}
.door-teacher .door-btn.primary:hover {
  background: #5f3f24;
}
.free-pill {
  background: #e7f2e0;
  color: #2f5a2a;
}
.free-pill.alt {
  background: #fbf1d2;
  color: #6e4f00;
}
.lib-h span,
.steps-row li::before {
  background: var(--accent);
}
.tabs-big button.active,
.year-chips .chip.active {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}
.mystery-card {
  background: linear-gradient(135deg, #234f2b, #3d6b34);
}
.mystery-tip {
  color: #e2eed8;
}
.flip-card {
  border-top-color: var(--blue);
}
.flip-card.c1 {
  border-top-color: var(--accent);
}
.flip-card.c2 {
  border-top-color: var(--bark);
}
.finish-btn {
  background: var(--accent) !important;
  color: var(--ink) !important;
}
.lesson-bar:not([hidden]) {
  background: #234f2b;
}
.class-strip {
  background: #eaf2e3;
  border-color: #cddfc4;
}
.activity-btn {
  background: var(--blue);
  box-shadow: 0 4px 0 var(--blue-dark);
}
.act-play {
  color: var(--blue);
}
.mat-none {
  background: #e7f2e0;
  color: #2f5a2a;
}
.mat-need {
  background: #f1e8dc;
  color: #6b4426;
}
.eyebrow {
  color: var(--bark);
}
.primary {
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.12),
    0 4px 10px -4px rgba(47, 107, 58, 0.55);
}
a { color: var(--blue); }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}
.request-cta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}
.adm-requests {
  margin-bottom: 18px;
}

/* Lesson progress strip */
.lesson-steps {
  position: sticky;
  top: var(--hdr-h, 0px);
  z-index: 15;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px;
  margin: 0 0 14px;
  background: rgba(246, 240, 223, 0.95);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  border: 1px solid var(--line);
}
.lesson-steps button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.step-tick {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: inline-grid;
  place-items: center;
  font-size: 11px;
}
.lesson-steps button.done {
  border-color: var(--blue);
  background: #eaf2e3;
}
.lesson-steps button.done .step-tick {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.lesson-steps button.done .step-tick::after {
  content: "✓";
}
/* Practice picker */
.practice-years {
  margin: 10px 0 12px;
  color: var(--muted);
}
.practice-topic.open {
  grid-column: 1 / -1;
}
.practice-topic.open .topic-card {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.practice-topic .task-lessons {
  list-style: none;
  margin: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}
.practice-topic .task-lessons button {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
}
.practice-topic .task-lessons .lesson-num {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--area);
  color: #fff;
}
.practice-topic .topic-card {
  width: 100%;
}
.cl-finished {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  padding: 12px 14px;
  background: #fbf3d6;
  border: 1px solid #e6cf86;
  border-radius: 14px;
}
.cl-finished button {
  min-height: 46px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
}
.cl-lesson .lesson-num {
  background: var(--area-bg) !important;
  font-size: 20px;
}

/* Teacher review banner, starter, admin stats */
.tc-review-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin: 0 0 16px;
  border-radius: 14px;
  background: #fbf3d6;
  border: 1px solid #e6cf86;
}
.tc-review-banner b {
  margin-right: 6px;
}
.tc-review-banner button {
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.tc-review-pill {
  align-self: flex-start;
  background: #fbf3d6;
  color: #6e4f00;
  border: 1px solid #e6cf86;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 800;
}
.tc-start {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 0 0 16px;
}
.tc-start h3 {
  margin: 0 0 8px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}
.stat-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.stat-tile b {
  display: block;
  font-size: 28px;
  color: var(--blue);
  font-family: var(--heading-font);
}
.stat-tile span {
  color: var(--muted);
  font-size: 14px;
}
.adm-stats {
  margin: 10px 0 22px;
}

/* Student home: To do / Done tabs, feedback banner, avatar, journal */
.cl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.cl-tabs button {
  min-height: 46px;
  padding: 6px 18px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.cl-tabs button span {
  display: inline-block;
  min-width: 24px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1ead8;
  font-size: 14px;
}
.cl-tabs button.active {
  border-color: var(--blue);
  background: #eaf2e3;
  color: var(--blue);
}
.cl-tabs .cl-journal-btn {
  margin-left: auto;
  border-color: var(--bark);
  color: var(--bark);
}
.cl-feedback-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 0 0 16px;
  border-radius: 16px;
  background: #fbf3d6;
  border: 2px solid #e6cf86;
  font-size: 17px;
}
.cl-feedback-banner > span {
  font-size: 26px;
}
.cl-feedback-banner .primary {
  margin-left: auto;
}
.cl-avatar {
  display: inline-grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: #fbf3d6;
  border: 2px solid #e6cf86;
  vertical-align: middle;
  font-size: 0.9em;
}
.journal-list {
  display: grid;
  gap: 14px;
  margin: 10px 0 24px;
}
.journal-entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--area, var(--blue));
  border-radius: 16px;
  padding: 14px 18px;
}
.journal-entry h3 {
  margin: 4px 0;
}
.journal-entry p {
  margin: 6px 0;
}
.journal-q {
  font-style: italic;
  color: var(--muted);
}
.journal-feedback {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eaf2e3;
}
@media (max-width: 560px) {
  .cl-tabs .cl-journal-btn,
  .cl-feedback-banner .primary {
    margin-left: 0;
  }
}

/* Phones: a compact two-row header (brand + reading help + year, then the main tabs). */
@media (max-width: 560px) {
  header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 6px 8px;
    padding: 8px 12px 0;
  }
  header .top-left {
    grid-column: 1;
    min-width: 0;
  }
  header .top-left .top-btn:not(#admin-button) {
    display: none;
  }
  header .brand-name {
    font-size: 17px;
  }
  header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0;
  }
  header .support-button {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  header .level {
    grid-column: 3;
    grid-row: 1;
    margin: 0;
  }
  header .level .level-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  header .level select {
    min-height: 40px;
    padding: 4px 6px;
    font-size: 15px;
  }
  header #lesson-bar,
  header #who {
    grid-column: 1 / -1;
  }
}
/* Footer: tidy row of links that wraps neatly. */
footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
footer .footer-link {
  white-space: nowrap;
}

/* Teacher review: blank fields summary and quick comments */
.tc-blank-note {
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f4efe2;
  color: var(--muted);
  font-size: 14px;
}
.tc-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 12px;
}
.tc-starter {
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  cursor: pointer;
}
.tc-starter:hover,
.tc-starter:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}
.tc-mfa-setup {
  display: grid;
  gap: 8px;
  max-width: 520px;
}
.tc-mfa-qr {
  background: #fff;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.tc-mfa-secret {
  word-break: break-all;
}
.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
}
.check-row input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}
.adm-audit summary h2 {
  display: inline;
}

/* Small-schools toolkit */
.toolkit .lead {
  font-size: 18px;
  max-width: 760px;
}
.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}
.toolkit-card {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.toolkit-card b {
  font-size: 17px;
}
.toolkit-card span {
  color: var(--muted);
  font-size: 14px;
}
.toolkit-card:hover,
.toolkit-card:focus-visible {
  border-color: var(--blue);
}
.time-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 12px;
}
.time-presets > span {
  font-weight: 700;
  margin-right: 4px;
}
.shoebox-list {
  list-style: none;
  padding: 0;
  margin: 6px 0;
  display: grid;
  gap: 4px;
}
.shoebox-list li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 6px;
  align-items: baseline;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
}
.shoebox-list small {
  color: var(--muted);
  white-space: nowrap;
}
.planner td {
  vertical-align: top;
}

/* One step at a time (student lessons) */
.step-mode .rec-section:not(.step-current) {
  display: none;
}
.step-mode:not(.step-last) .rec-actions:not(.rec-section .rec-actions) {
  display: none;
}
.step-foot {
  display: none;
}
.step-mode .step-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}
.step-foot button {
  min-height: 52px;
  padding: 8px 20px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 800;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.step-foot button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.step-foot-done {
  font-weight: 800;
  color: var(--blue);
}
.lesson-steps button.current {
  outline: 3px solid var(--lime, #f2c230);
  outline-offset: 1px;
}
.lesson-steps .step-mode-toggle {
  margin-left: auto;
  background: transparent;
  border-style: dashed;
  font-weight: 600;
}

/* Challenge (extension) topics */
.mat-challenge {
  background: #ece6fb;
  color: #4b3a8f;
  margin-left: 4px;
}
.challenge-note {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #f1edfc;
  border: 1px solid #d4c9f2;
}
.challenge-note p {
  margin: 4px 0 0;
}
.challenge-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 2px dashed #b9a8ec;
  background: #f6f3fe;
  color: #4b3a8f;
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}
.challenge-cta small {
  font-weight: 600;
  font-size: 14px;
}

/* Warm-up: optional "Write it first" */
.warm-card {
  display: grid;
  gap: 6px;
  align-content: start;
}
.warm-write .link-button {
  font-size: 14px;
}
.warm-row {
  display: flex;
  gap: 6px;
}
.warm-row input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font: inherit;
}
.warm-row button {
  min-height: 42px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.warm-mine {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fbf3d6;
}

/* Class size, everyday swaps, present pair picker */
.class-size {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  font-weight: 600;
}
.class-size input {
  width: 72px;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font: inherit;
}
.swaps {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fbf3d6;
  border: 1px solid #e6cf86;
}
.swaps h3 {
  margin-top: 0;
}
.present-pick {
  margin-left: auto;
  margin-right: 8px;
  min-height: 40px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}
.materials-list {
  list-style: none;
  padding-left: 0;
}

/* UX pass */
.getting-ready .class-size {
  display: flex !important;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.getting-ready .class-size input {
  width: 80px !important;
  flex: none;
}
.lesson-crumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.lesson-pager {
  display: flex;
  gap: 14px;
}
.warm-card {
  grid-template-rows: 1fr auto;
}
.warm-card .flip-card {
  height: 100%;
}
/* Present: size text to the screen's height as well as its width, so slides fit 720p projectors */
#present .present-slide {
  font-size: clamp(16px, min(2.2vw, 3.5vh), 28px);
}
#present .present-slide h2 {
  font-size: clamp(26px, min(4.4vw, 7vh), 60px);
  margin-bottom: 1.5vh;
}
#present .present-big {
  font-size: clamp(24px, min(4vw, 6.5vh), 54px);
}
#present .present-mid {
  font-size: clamp(18px, min(2.7vw, 4.2vh), 34px);
}
#present .present-steps,
#present .present-recall {
  gap: 1vh;
}

/* Area cards with doors (Learn · Lab · Detective · Play) */
.hub-card {
  cursor: default;
}
.hub-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.hub-doors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.hub-doors button {
  min-height: 40px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.hub-doors button span {
  display: inline !important;
  font-size: inherit !important;
}
.hub-doors button:hover,
.hub-doors button:focus-visible {
  border-color: var(--area, var(--blue));
}
.board-missions {
  margin-top: 18px;
}
.board-missions summary {
  cursor: pointer;
}
.board-missions summary h2 {
  display: inline;
}

/* Self-check and before/after check */
.self-check {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f3e8;
  border: 1px solid var(--line);
}
.self-check h3 {
  margin: 0;
}
.self-row {
  border: 0;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.self-row legend {
  width: 100%;
  font-weight: 700;
  margin-bottom: 4px;
}
.self-chip input {
  position: absolute;
  opacity: 0;
}
.self-chip > span {
  display: inline-block;
  min-height: 40px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.self-chip input:checked + span {
  border-color: var(--blue);
  background: #eaf2e3;
}
.self-chip input:focus-visible + span {
  outline: 3px solid var(--lime, #f2c230);
}
.self-summary {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f6f3e8;
}
.self-summary ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.probe-grid {
  grid-template-columns: repeat(3, 1fr);
}
