:root {
  /* Kayla Academy redesign palette (warm cream + gamified accents) */
  --paper: #f8f5ec;
  --ink: #3a362f;
  --muted: #8a857a;
  --line: #ece4d4;
  --grid: rgba(58, 54, 47, 0.045);
  --panel: #fffdf8;
  --teal: #46c06a;        /* primary accent (green) */
  --teal-dark: #2c9050;   /* primary edge */
  --green: #46c06a;
  --green-dark: #2c9050;
  --coral: #e0552d;       /* "needs work" / negative */
  --boost: #ff7d54;
  --boost-dark: #e0552d;
  --orange: #ff922e;
  --orange-dark: #d9701a;
  --gold: #cf9a2a;
  --gold-bright: #e8a01e;
  --blue: #2f86d6;
  --card-edge: #efe7d6;
  --shadow: 0 4px 0 var(--card-edge);
  color-scheme: light;
  font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 30px 20px 22px;
  border-right: 0;
  background: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-home {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand-home:hover .brand-mark,
.brand-home:focus-visible .brand-mark {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.brand-home:focus-visible {
  border-radius: 8px;
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p {
  margin: 0;
}

.brand h1 {
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand p {
  font-size: 0.75rem;
  line-height: 1.2;
}

.brand p,
.contest-note,
.eyebrow,
.stat-label,
.small-copy,
.skill-meta,
.choice-result,
.source-list {
  color: var(--muted);
}

.home-label {
  display: inline-block;
  margin-right: 6px;
  color: var(--ink);
  font-weight: 900;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 750;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.is-active {
  border-color: var(--ink);
  background: var(--panel);
  outline: none;
  box-shadow: 4px 4px 0 var(--ink);
}

.contest-note {
  display: grid;
  gap: 7px;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.78rem;
}

.contest-note strong {
  color: var(--ink);
}

.sidebar-companion {
  position: relative;
  margin-top: auto;
  min-height: 210px;
  overflow: visible;
}

.side-garden {
  position: absolute;
  right: 0;
  bottom: 0;
  left: -8px;
  min-height: 168px;
  overflow: visible;
}

.garden-ground {
  position: absolute;
  right: 22px;
  bottom: 12px;
  left: 18px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #d9ad60;
}

.side-garden .sidebar-companion-icon {
  position: absolute;
  bottom: 6px;
  left: 28px;
  width: 126px;
  transform-origin: 50% 100%;
  animation: companionBounce 2.4s ease-in-out infinite, gardenSway 4.8s ease-in-out infinite;
}

.side-garden.growing .sidebar-companion-icon {
  width: 138px;
  left: 22px;
}

.side-garden.thriving .sidebar-companion-icon {
  width: 150px;
  left: 16px;
}

.main {
  min-width: 0;
  padding: 44px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 42px;
  max-width: 1520px;
}

.eyebrow {
  margin-bottom: 7px;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: clamp(2.4rem, 4.4vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 14px;
}

.quick-stats div {
  min-width: 86px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 5px 5px 0 var(--ink);
  text-align: center;
}

.quick-stats span {
  display: block;
  font-size: 1.45rem;
  font-weight: 900;
}

.quick-stats small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.view {
  max-width: 1520px;
  margin: 0 auto;
}

.dashboard-grid,
.practice-grid,
.progress-grid,
.settings-grid {
  display: grid;
  gap: 20px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.practice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.progress-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
}

.settings-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.5fr);
}

.panel,
.problem-card,
.skill-card,
.stat-tile {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel,
.problem-card {
  padding: 24px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-title h3,
.problem-card h3,
.skill-card h3,
.stat-tile h3 {
  margin: 0;
  line-height: 1.15;
}

.panel-title p,
.problem-card p,
.skill-card p,
.stat-tile p {
  margin: 6px 0 0;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 400px;
  padding: 24px;
}

.quest-art {
  width: 100%;
  min-height: 230px;
  margin: 18px 0 6px;
}

.quest-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.baseball-field {
  position: relative;
  display: grid;
  gap: 10px;
}

.field-scoreboard {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.field-scoreboard strong,
.field-scoreboard span {
  display: block;
}

.field-scoreboard span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.base-label {
  fill: var(--ink);
  font-weight: 900;
}

.base-label {
  font-size: 13px;
}

.field-message {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.baseball-field.is-home-run svg {
  filter: saturate(1.14);
}

.home-run-fireworks {
  position: absolute;
  z-index: 1;
  top: 88px;
  left: 0;
  right: 0;
  height: 260px;
  overflow: hidden;
  border-radius: 8px;
  pointer-events: none;
}

.home-run-fireworks strong {
  position: absolute;
  left: 50%;
  top: 45%;
  padding: 8px 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff7d7;
  color: var(--ink);
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 6px 6px 0 var(--ink);
  transform: translate(-50%, -50%) rotate(-2deg);
  animation: homeRunPop 900ms cubic-bezier(0.18, 1.35, 0.28, 1) both;
}

.firework,
.confetti-piece {
  position: absolute;
  display: block;
}

.firework {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold);
  box-shadow:
    0 -30px 0 currentColor,
    22px -22px 0 var(--coral),
    31px 0 0 var(--teal),
    22px 22px 0 var(--blue),
    0 30px 0 var(--coral),
    -22px 22px 0 var(--teal),
    -31px 0 0 var(--gold),
    -22px -22px 0 var(--blue);
  animation: fireworkBurst 1500ms ease-out infinite both;
}

.burst-a {
  left: 18%;
  top: 24%;
}

.burst-b {
  left: 78%;
  top: 20%;
  animation-delay: 180ms;
}

.burst-c {
  left: 33%;
  top: 38%;
  animation-delay: 340ms;
}

.burst-d {
  left: 66%;
  top: 48%;
  animation-delay: 520ms;
}

.confetti-piece {
  width: 12px;
  height: 18px;
  border: 2px solid var(--ink);
  background: var(--coral);
  animation: confettiFall 1700ms ease-in-out infinite both;
}

.piece-a {
  left: 25%;
  top: 2%;
}

.piece-b {
  left: 45%;
  top: 0;
  background: var(--gold);
  animation-delay: 220ms;
}

.piece-c {
  left: 58%;
  top: 5%;
  background: var(--teal);
  animation-delay: 360ms;
}

.piece-d {
  left: 72%;
  top: 0;
  background: #fff;
  animation-delay: 500ms;
}

.base-line {
  fill: none;
  stroke: #fff;
  stroke-width: 9;
  stroke-linecap: round;
}

.base-line.is-complete {
  stroke: var(--teal);
}

.base-bag {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 3;
}

.base-bag.is-complete {
  fill: var(--gold);
}

.home-plate {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 3;
}

.home-plate.is-complete {
  fill: var(--gold);
}

.runner-marker {
  filter: drop-shadow(3px 3px 0 rgba(27, 29, 37, 0.22));
}

.runner-ball {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 3;
}

.runner-stitch {
  fill: none;
  stroke: var(--coral);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.lineup-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lineup-row span {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.mission-row,
.action-row,
.filter-row,
.answer-row,
.lesson-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mission-row {
  margin-top: 18px;
}

.home-actions {
  display: grid;
  gap: 10px;
  margin: 16px 0 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.home-actions .mission-row {
  margin-top: 0;
}

.action-guidance {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.home-action-row {
  align-items: stretch;
}

.action-btn {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 132px;
}

.action-btn span,
.action-btn small {
  display: block;
}

.action-btn small {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.btn.is-recommended {
  position: relative;
  animation: recommendedPulse 1.35s ease-in-out infinite;
}

.btn {
  min-height: 38px;
  padding: 8px 15px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn:hover,
.btn:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
  outline: none;
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn.primary {
  background: #8ab9b7;
  color: #fff;
}

.btn.coral {
  background: var(--coral);
  color: #fff;
}

.btn.gold {
  background: #f0d07a;
}

.btn.ghost {
  border-color: var(--line);
  box-shadow: none;
}

.btn.ghost:hover,
.btn.ghost:focus-visible {
  box-shadow: 3px 3px 0 var(--ink);
}

.btn.ghost.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 3px 3px 0 var(--gold);
}

.btn.compact {
  min-height: 30px;
  padding: 5px 11px;
  font-size: 0.82rem;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: 3px 3px 0 var(--ink);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0 6px;
}

.admin-progress-panel {
  grid-column: 1 / -1;
}

.admin-progress-list {
  display: grid;
  gap: 10px;
}

.admin-student-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-student-main,
.admin-student-metrics {
  display: grid;
  gap: 4px;
}

.admin-student-main span,
.admin-student-metrics span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.admin-student-metrics {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.admin-student-metrics strong {
  color: var(--ink);
}

/* AMC Vault */
.vault-panel .vault-row-label {
  margin: 14px 0 8px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.74rem;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.vault-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf6;
}

.vault-card .vault-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.vault-card .vault-card-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.vault-card .btn {
  margin-top: 2px;
  width: 100%;
}

.vault-card.diff-1 { border-left: 5px solid #4caf7d; }
.vault-card.diff-2 { border-left: 5px solid #86bb3f; }
.vault-card.diff-3 { border-left: 5px solid #e0a020; }
.vault-card.diff-4 { border-left: 5px solid #e0741f; }
.vault-card.diff-5 { border-left: 5px solid #d0453a; }
.vault-card.topic { border-left: 5px solid var(--teal); }

.admin-block-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 850;
}

.admin-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.admin-block-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.admin-block-card.is-complete {
  background: #f3faf4;
}

.admin-block-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.admin-block-card-head span,
.admin-block-metrics span,
.admin-clean,
.admin-wrong-list {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.admin-block-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.admin-wrong-list summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.admin-wrong-list div {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.admin-wrong-list p {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

/* Admin AMC practice-exam section (separate from block metrics) */
.admin-exam-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.admin-exam-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8ff;
}

.admin-exam-card.is-aime {
  border-color: #b8a24a;
  background: #fbf7e8;
}

.admin-exam-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.admin-exam-card-head strong {
  font-weight: 900;
}

.admin-exam-card-head span,
.admin-exam-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.admin-exam-scoreline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-exam-score strong {
  font-size: 1.35rem;
  font-weight: 950;
}

.admin-exam-score small {
  color: var(--muted);
  font-weight: 800;
  margin-left: 3px;
}

.admin-exam-aime {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  border: 1px solid transparent;
}

.admin-exam-aime.is-pass {
  background: #e7f7ec;
  color: #1c7a3e;
  border-color: #9ed6b0;
}

.admin-exam-aime.is-short {
  background: #f6efe0;
  color: #8a6d1e;
  border-color: #d8c68a;
}

.admin-exam-aime.is-progress {
  background: #eef3fb;
  color: #2f5c93;
  border-color: #bcd3ef;
}

.admin-exam-card.is-inprogress {
  border-color: #bcd3ef;
  background: #f4f8fd;
  border-style: dashed;
}

.admin-exam-inprogress-note {
  margin-top: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #2f5c93;
}

.admin-exam-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.admin-miss-kind {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.admin-miss-kind.is-wrong {
  background: #fbe4e0;
  color: #a53a2a;
}

.admin-miss-kind.is-skipped {
  background: #ece7dc;
  color: #7a6a44;
}

/* Admin calendar + per-day deltas */
.admin-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.admin-view-toggle .btn.is-active {
  background: var(--teal);
  color: #fff;
}

.admin-calendar-wrap {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 760px) {
  .admin-calendar-wrap {
    grid-template-columns: 1fr;
  }
}

.admin-calendar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  align-content: start;
}

.admin-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
}

.admin-cal-weekdays,
.admin-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.admin-cal-wd {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
}

.admin-cal-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.admin-cal-cell.is-empty {
  border: none;
  background: transparent;
  cursor: default;
}

.admin-cal-cell.is-active {
  background: #eaf5f0;
  border-color: var(--teal);
}

.admin-cal-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.admin-cal-cell.is-selected {
  background: var(--teal);
  border-color: var(--teal-dark);
  color: #fff;
}

.admin-cal-num {
  font-weight: 850;
  font-size: 0.85rem;
}

.admin-cal-dot {
  font-size: 0.62rem;
  font-weight: 900;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
}

.admin-cal-cell.is-selected .admin-cal-dot {
  background: #fff;
  color: var(--teal-dark);
}

.admin-cal-legend {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-day-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.admin-day-head strong {
  font-size: 1.02rem;
}

.admin-day-head span,
.admin-day-mode {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.admin-day-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-day-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-day-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.admin-day-metrics-lg {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.admin-metric-chip {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.admin-metric-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-metric-value {
  font-size: 1.1rem;
  color: var(--ink);
}

.admin-delta {
  font-size: 0.74rem;
  font-weight: 850;
}

.admin-delta.is-good {
  color: var(--green);
}

.admin-delta.is-bad {
  color: var(--coral);
}

.admin-delta.is-neutral {
  color: var(--muted);
}

.readiness-card,
.strategy-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.readiness-card.is-on-track {
  background: #edf7ee;
}

.readiness-card.is-watch {
  background: rgba(255, 252, 237, 0.82);
}

.readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.readiness-head strong,
.strategy-card > div > strong {
  display: block;
  font-size: 1.1rem;
}

.readiness-head p,
.strategy-card p {
  max-width: 76rem;
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.readiness-grid,
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.readiness-item,
.strategy-grid div {
  display: grid;
  gap: 4px;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.readiness-item.is-ready {
  border-color: var(--green);
}

.readiness-item.is-behind {
  border-color: var(--gold);
}

.readiness-item span,
.strategy-grid span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.readiness-item strong,
.strategy-grid strong {
  font-size: 1rem;
}

.readiness-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.summer-plan {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 237, 0.74);
}

.summer-plan.is-primary {
  margin-top: 4px;
  padding: 18px;
  border-width: 2px;
  background: #fffaf0;
}

.summer-plan-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.summer-plan-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 240px;
}

.summer-plan-head strong {
  display: block;
  font-size: 1.22rem;
}

.summer-plan-head p {
  max-width: 66rem;
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.summer-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.summer-block-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summer-block-card.is-complete {
  background: #edf7ee;
}

.summer-block-card strong {
  font-size: 1rem;
}

.summer-block-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.summer-block-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.summer-block-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.personal-best-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 237, 0.72);
}

.personal-best-copy {
  display: grid;
  align-content: center;
  gap: 5px;
}

.personal-best-copy .eyebrow {
  margin: 0;
}

.personal-best-copy strong {
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.05;
}

.personal-best-copy p {
  max-width: 54rem;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.personal-best-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pb-metric {
  display: grid;
  gap: 5px;
  min-height: 90px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pb-metric span,
.pb-metric small {
  color: var(--muted);
  font-weight: 800;
}

.pb-metric strong {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1;
}

.stat-tile {
  min-height: 86px;
  padding: 14px;
}

.stat-value {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 950;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.progress-bar {
  overflow: hidden;
  height: 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: #ece9df;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-right: 1px solid var(--ink);
  background: var(--green);
  transition: width 220ms ease;
}

.timer-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.timer-strip span {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.timer-strip strong {
  color: var(--ink);
}

.domain-stack {
  display: grid;
  gap: 12px;
}

.domain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name score"
    "bar bar";
  gap: 7px 12px;
  align-items: center;
}

.domain-name,
.domain-score {
  font-weight: 850;
}

.domain-name {
  grid-area: name;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.05;
}

.domain-score {
  grid-area: score;
  text-align: right;
}

.domain-row .progress-bar {
  grid-area: bar;
  min-width: 0;
}

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

.skill-card {
  position: relative;
  min-height: 178px;
  padding: 16px;
  overflow: hidden;
}

.skill-card h3 {
  font-size: 1rem;
}

.skill-card .status-dot {
  position: absolute;
  top: 12px;
  right: 12px;
}

.status-dot {
  width: 14px;
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--line);
}

.status-dot.ready {
  background: var(--gold);
}

.status-dot.good {
  background: var(--green);
}

.status-dot.weak {
  background: var(--coral);
}

.skill-meta {
  display: block;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 750;
}

.skill-card .btn {
  margin-top: 14px;
  min-height: 36px;
  padding: 7px 10px;
}

.map-tabs {
  margin-bottom: 16px;
}

.map-copy {
  margin: 4px 0 16px;
  max-width: none;
}

.map-copy h4,
.primer-panel h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.map-copy p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
}

.week-grid,
.month-grid {
  display: grid;
  gap: 12px;
}

.week-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

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

.week-card,
.month-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.week-card.is-today,
.month-card.is-current {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.week-head,
.month-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Keep the "N problems" count pill from overflowing narrow day cards:
   never split the label mid-pill, and let it wrap to its own line when tight. */
.week-head > div,
.month-head > div {
  min-width: 0;
}

.week-head .pill,
.month-head .pill {
  flex: 0 0 auto;
  max-width: 100%;
  white-space: nowrap;
}

.week-head strong,
.week-head span,
.month-head strong,
.month-head span {
  display: block;
}

.week-head strong,
.month-head strong {
  font-weight: 900;
}

.week-head span,
.month-head span,
.month-card p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

.month-card p {
  margin: 0;
}

.coach-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.coach-box strong,
.coach-box span {
  display: block;
}

.coach-box > span,
.coach-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-tags span,
.mini-tags button {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
}

.mini-tags button {
  text-align: left;
}

.mini-tags button:hover,
.mini-tags button:focus-visible {
  border-color: var(--ink);
  outline: none;
  box-shadow: 2px 2px 0 var(--ink);
}

.primer-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.primer-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  line-height: 1.45;
}

.primer-list.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-left: 0;
  list-style: none;
}

.primer-strip {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-grid span,
.sample-stack p {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f5ef;
  font-weight: 750;
  line-height: 1.4;
}

.sample-stack {
  display: grid;
  gap: 8px;
}

.session-shell {
  max-width: 1500px;
  margin: 0 auto;
}

.session-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.session-tags,
.session-clock {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.session-clock {
  justify-content: flex-end;
}

.session-clock span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.session-clock strong {
  color: var(--ink);
}

.session-clock .pace-pill {
  border-color: #b9dfbd;
  background: #e7f6e9;
  color: #2e7339;
}

.session-clock .block-work-pill {
  border-color: #e4c36f;
  background: #fff4d6;
  color: #6f4c00;
}

.session-clock .block-work-pill.is-overtime {
  border-color: #e45d4c;
  background: #fff0ed;
  color: #a83426;
}

.session-progress {
  height: 7px;
  margin-bottom: 10px;
}

.session-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.is-break-active {
  overflow: hidden;
}

.break-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #202020;
  color: #f7f4ee;
}

.break-card {
  display: grid;
  justify-items: center;
  gap: 22px;
  width: min(92vw, 780px);
}

.break-label {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #b9b9b9;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.break-label strong {
  color: #f7f4ee;
  font-size: 1.1rem;
  letter-spacing: 0;
  text-transform: none;
}

.break-ring {
  --progress-deg: 360deg;
  position: relative;
  display: grid;
  place-items: center;
  width: min(58vmin, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#ff922e var(--progress-deg), #393939 0deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.break-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #202020;
}

.break-time {
  position: relative;
  font-size: clamp(4rem, 13vw, 8rem);
  font-weight: 500;
  letter-spacing: 0;
}

.break-copy {
  max-width: 560px;
  color: #b9b9b9;
  font-weight: 750;
  text-align: center;
}

.break-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.break-actions .btn {
  min-width: 150px;
}

.break-actions .btn.primary {
  border-color: #ff922e;
  background: #ff922e;
  color: #fff;
}

.problem-card {
  max-width: none;
  min-height: min(560px, calc(100vh - 260px));
  margin: 0 auto;
  padding: 26px 28px;
}

.problem-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 42px;
}

.problem-card-head strong {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 900;
}

.problem-card h3 {
  font-size: 0.88rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.problem-card .small-copy {
  font-size: 0.8rem;
  font-weight: 750;
}

.problem-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.pill.morale {
  background: #edf7ee;
  border-color: var(--green);
}

.difficulty-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 7px 3px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  vertical-align: middle;
}

.difficulty-pill select {
  min-width: 44px;
  min-height: 24px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.difficulty-pill select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.difficulty-pill select:disabled {
  opacity: 0.65;
  cursor: default;
}

.companion-strip {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(180px, 0.5fr);
  gap: 14px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #eef9f8;
  box-shadow: 4px 4px 0 var(--ink);
}

.companion-strip.radiant {
  background: #fff7d7;
}

.companion-strip.sprout {
  background: #f7f5ef;
}

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

.companion-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.companion-icon,
.sidebar-companion-icon {
  width: 78px;
  aspect-ratio: 1;
  overflow: visible;
  animation: companionBounce 2.4s ease-in-out infinite;
}

.sidebar-companion-icon {
  width: 56px;
}

.level-strip,
.practice-set-card {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(180px, 0.35fr);
  gap: 14px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.practice-set-card {
  background: #fffaf0;
}

.level-strip strong,
.level-strip span,
.practice-set-card strong,
.practice-set-card span {
  display: block;
}

.level-strip strong,
.practice-set-card strong {
  margin-top: 4px;
  font-size: 1rem;
}

.level-strip span,
.practice-set-card span,
.level-meter span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.level-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink) !important;
  font-weight: 900 !important;
}

.level-meter {
  display: grid;
  gap: 7px;
}

.companion-icon .sunflower-stem,
.sidebar-companion-icon .sunflower-stem {
  fill: none;
  stroke: var(--green);
  stroke-width: 8;
  stroke-linecap: round;
}

.companion-icon .sunflower-leaf,
.sidebar-companion-icon .sunflower-leaf {
  fill: #79bd55;
  stroke: var(--ink);
  stroke-width: 3;
  transform-origin: 80px 130px;
  animation: leafWave 2.8s ease-in-out infinite;
}

.companion-icon .leaf-right,
.sidebar-companion-icon .leaf-right {
  animation-delay: 240ms;
}

.companion-icon .sunflower-petal,
.sidebar-companion-icon .sunflower-petal {
  fill: #fff176;
  stroke: var(--ink);
  stroke-width: 3;
}

.companion-icon .sunflower-face,
.sidebar-companion-icon .sunflower-face {
  fill: #d99a22;
  stroke: var(--ink);
  stroke-width: 4;
}

.companion-icon .sunflower-glow,
.sidebar-companion-icon .sunflower-glow {
  fill: #f0b13a;
  opacity: 0.58;
}

.companion-icon .sunflower-eye,
.sidebar-companion-icon .sunflower-eye {
  fill: var(--ink);
}

.companion-icon .sunflower-spark,
.sidebar-companion-icon .sunflower-spark {
  fill: #fff;
}

.companion-icon .sunflower-smile,
.sidebar-companion-icon .sunflower-smile {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
}

.companion-icon.sunflower-growing,
.sidebar-companion-icon.sunflower-growing {
  transform: scale(1.06);
}

.companion-icon.sunflower-thriving,
.sidebar-companion-icon.sunflower-thriving {
  transform: scale(1.12);
}

.reward-meter {
  display: grid;
  gap: 7px;
}

.problem-prompt {
  min-height: 116px;
  margin: 22px 0 34px;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  font-weight: 850;
  line-height: 1.28;
}

.problem-visual {
  margin: 14px 0 2px;
  overflow: visible;
}

.ngon-diagram {
  display: block;
  width: min(100%, 760px);
  height: auto;
  overflow: visible;
}

.rotation-diagram {
  display: block;
  width: min(100%, 760px);
  height: auto;
  overflow: visible;
}

.rotation-bg {
  fill: #f7f5ef;
  stroke: var(--line);
  stroke-width: 1;
}

.rotation-grid-line {
  stroke: rgba(31, 34, 45, 0.16);
  stroke-width: 1;
}

.rotation-axis {
  stroke: var(--ink);
  stroke-width: 2;
}

.rotation-axis-label,
.rotation-origin-label,
.rotation-point-label,
.rotation-notes text,
.rotation-key text {
  fill: var(--ink);
  font-weight: 900;
  letter-spacing: 0;
}

.rotation-axis-label,
.rotation-origin-label {
  font-size: 13px;
}

.rotation-point-label {
  font-size: 14px;
  text-anchor: middle;
}

.rotation-radius {
  stroke-width: 3;
  stroke-linecap: round;
}

.rotation-radius.original {
  stroke: var(--coral);
}

.rotation-radius.image {
  stroke: var(--teal);
}

.rotation-arc {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
  marker-end: url(#rotationArrow);
}

.rotation-arc + path,
#rotationArrow path {
  fill: var(--gold);
}

.rotation-origin {
  fill: var(--ink);
}

.rotation-point {
  stroke: var(--ink);
  stroke-width: 2;
}

.rotation-point.original {
  fill: var(--coral);
}

.rotation-point.image {
  fill: var(--teal);
}

.rotation-notes text {
  font-size: 16px;
}

.rotation-key text {
  font-size: 14px;
}

.ngon-bg {
  fill: #f7f5ef;
  stroke: var(--line);
  stroke-width: 1;
}

.ngon-shape {
  fill: #fffaf0;
  stroke: var(--ink);
  stroke-width: 3;
}

.ngon-diagonal {
  stroke: var(--teal);
  stroke-width: 3;
  stroke-linecap: round;
}

.ngon-side-callout {
  stroke: var(--coral);
  stroke-width: 4;
  stroke-linecap: round;
}

.ngon-vertex {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 2;
}

.ngon-vertex.is-start {
  fill: var(--gold);
}

.ngon-vertex.is-neighbor {
  fill: #fbefec;
}

.ngon-label,
.ngon-notes text,
.ngon-key text {
  fill: var(--ink);
  font-weight: 900;
  letter-spacing: 0;
}

.ngon-label {
  font-size: 18px;
  text-anchor: middle;
}

.ngon-notes text {
  font-size: 16px;
}

.ngon-key text {
  font-size: 14px;
}

.problem-card sup,
.problem-card sub,
.primer-panel sup,
.primer-panel sub {
  font-size: 0.65em;
  line-height: 0;
}

.problem-card sub,
.primer-panel sub {
  vertical-align: -0.25em;
}

.choices {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

/* Post-exam review: per-question "reviewed" + difficulty rating */
.rev-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf7ef;
}
.rev-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.rev-check input { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }
.rev-rate { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rev-rate-label { font-size: 0.86rem; color: var(--muted); margin-right: 2px; }
.rev-rate-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.rev-rate-btn:hover { border-color: var(--teal); }
.rev-rate-btn.is-on { background: var(--teal); border-color: var(--teal); color: #fff; }
.exam-nav-cell.is-reviewed { box-shadow: inset 0 -3px 0 var(--green); }

/* ---- Concepts library + lessons ---- */
.concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.concept-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; text-align: left; cursor: pointer;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.concept-card:hover { transform: translateY(-2px); border-color: var(--teal); box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.concept-card strong { font-size: 1.02rem; }
.concept-card-blurb { font-size: 0.86rem; color: var(--muted); }
.concept-card-badge {
  align-self: flex-start; font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 2px 8px; border-radius: 999px; background: #eee; color: var(--muted);
}
.concept-card.is-due .concept-card-badge { background: #ffe7d6; color: #b5541c; }
.concept-card.is-learned .concept-card-badge { background: #e2f6e8; color: #1f8a4c; }
.concept-card.lvl-1 { border-left: 4px solid #7ac6a4; }
.concept-card.lvl-2 { border-left: 4px solid #e2b23c; }
.concept-card.lvl-3 { border-left: 4px solid #d9694a; }

.concept-due-panel .concept-due-list { display: flex; flex-direction: column; gap: 8px; }
.concept-due-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left;
}
.concept-due-row:hover { border-color: var(--teal); }
.cdr-domain { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); min-width: 92px; }
.cdr-title { font-weight: 600; flex: 1; }
.cdr-go { color: var(--teal); font-weight: 700; font-size: 0.86rem; }

.lesson-view { display: flex; flex-direction: column; gap: 14px; }
.lesson-domain { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.lesson-title { margin: 4px 0 2px; font-size: 1.5rem; }
.lesson-blurb { color: var(--muted); margin-bottom: 6px; }
.lesson-section { margin-top: 16px; }
.lesson-section h4 { margin: 0 0 6px; font-size: 1.05rem; color: var(--ink); }
.lesson-section p { line-height: 1.6; }
.lesson-list { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }
.lesson-example {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #f2f8ff; border: 1px solid #d5e6f6; display: flex; gap: 10px; align-items: baseline; line-height: 1.55;
}
.lesson-example-tag { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: #2b6cb0; flex-shrink: 0; }
.lesson-keyfacts {
  margin: 12px 0; padding: 12px 16px; border-radius: 12px;
  background: #fbf7ef; border: 1px solid #ecdcbc;
}
.lesson-keyfacts strong { display: block; margin-bottom: 6px; }
.lesson-keyfacts ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.lesson-practice { margin-top: 18px; }
.lesson-review .rev-rate { margin-top: 4px; }

/* Inline stacked fraction bars produced by formatMathText() */
.mfrac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  margin: 0 0.15em;
  line-height: 1.05;
}
.mfrac .mnum { display: block; padding: 0 0.35em; }
.mfrac .mden { display: block; padding: 0 0.35em; border-top: 0.08em solid currentColor; }

.choice:hover,
.choice:focus-visible {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  outline: none;
}

.choice-letter {
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: #f5f3ed;
  font-weight: 900;
}

.choice.is-correct {
  border-color: var(--green);
  background: #edf7ee;
  box-shadow: inset 0 0 0 1px var(--green);
}

.choice.is-wrong {
  border-color: var(--coral);
  background: #fbefec;
  box-shadow: inset 0 0 0 1px var(--coral);
}

.lesson-box,
.explain-box,
.deep-help-box {
  display: none;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f5ef;
  color: var(--ink);
}

.lesson-box.is-visible,
.explain-box.is-visible {
  display: block;
}

.lesson-box strong,
.explain-box strong,
.deep-help-box strong {
  display: block;
  margin-bottom: 5px;
}

.lesson-example-toggle {
  margin-top: 8px;
}

.example-hint-panel {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(22, 24, 33, 0.16);
}

.example-hint-panel.is-visible {
  display: block;
}

.lesson-box p,
.example-hint-panel p {
  white-space: pre-line;
}

.explain-box p {
  white-space: pre-line;
}

.deep-help-box {
  display: block;
  background: #eef9f8;
  border-color: var(--teal);
}

.deep-help-box ol {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
  padding-left: 22px;
}

.deep-help-box li {
  line-height: 1.45;
}

.deep-help-box li.math-work-step {
  white-space: pre-line;
}

.deep-dive-prompts {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(22, 24, 33, 0.18);
}

.deep-dive-prompts span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deep-dive-prompts > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn.mini {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 0.9rem;
}

.btn.mini.is-active {
  background: #fff6d6;
  border-color: var(--gold);
}

.deep-dive-answer {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 24, 33, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.deep-dive-answer p {
  margin: 0;
  white-space: pre-line;
}

.done-copy {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.session-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.next-action {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.next-action span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.mini-chart {
  display: grid;
  gap: 10px;
}

.history-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 64px 58px;
  gap: 10px;
  align-items: center;
  min-height: 36px;
}

.pace-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 22px;
}

.pace-list span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.pace-list .is-correct {
  border-color: var(--green);
  background: #edf7ee;
}

.pace-list .is-wrong {
  border-color: var(--coral);
  background: #fbefec;
}

.pace-list .is-skipped {
  color: var(--muted);
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed var(--muted);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 850;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.save-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f5ef;
}

.save-panel strong,
.save-panel span {
  display: block;
}

.save-panel span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.cloud-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.cloud-login input {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.cloud-login-large {
  margin-top: 14px;
}

.cloud-signin-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(29, 31, 40, 0.28);
}

.cloud-signin-card {
  width: min(560px, 94vw);
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 8px 8px 0 var(--ink);
}

.cloud-signin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.cloud-signin-header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.95;
}

.cloud-signin-note {
  min-height: 1.3em;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.reminder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 150px minmax(0, 1fr);
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.source-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.source-list a {
  color: var(--blue);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cheer-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27, 29, 37, 0.22);
  animation: cheerFade 230ms ease-out both;
  pointer-events: none;
}

.cheer-overlay.is-leaving {
  animation: cheerLeave 480ms ease-in both;
}

.cheer-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(420px, 92vw);
  padding: 24px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
  overflow: hidden;
  animation: cheerPop 520ms cubic-bezier(0.2, 1.25, 0.3, 1) both;
}

.cheer-card::before,
.cheer-card::after {
  content: "";
  position: absolute;
  inset: auto;
  width: 160px;
  height: 18px;
  border: 2px solid var(--ink);
  background: currentColor;
  opacity: 0.18;
  transform: rotate(-24deg);
}

.cheer-card::before {
  top: 24px;
  left: -48px;
}

.cheer-card::after {
  right: -42px;
  bottom: 34px;
  transform: rotate(-24deg);
}

.cheer-icon {
  width: 82px;
  aspect-ratio: 1;
  padding: 11px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  filter: drop-shadow(4px 4px 0 var(--ink));
}

.cheer-icon path {
  fill: currentColor;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
}

.cheer-kicker,
.cheer-card small,
.cheer-card span {
  position: relative;
  z-index: 1;
  font-weight: 900;
}

.cheer-kicker,
.cheer-card small {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.cheer-card strong {
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1;
  text-align: center;
}

.star-rally .cheer-card {
  background: #fff7d7;
  color: var(--gold);
}

.power-burst .cheer-card {
  background: #eef9f8;
  color: var(--teal);
}

.moon-arc .cheer-card {
  background: #f1f2ff;
  color: var(--blue);
}

.flash-frame .cheer-card {
  background: #fff0eb;
  color: var(--coral);
}

.personal-best-cheer .cheer-card {
  background: #fff8d8;
  color: var(--gold);
}

@keyframes cheerFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cheerLeave {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes cheerPop {
  0% {
    opacity: 0;
    transform: scale(0.72) rotate(-5deg);
  }
  60% {
    transform: scale(1.04) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes homeRunPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72) rotate(-8deg);
  }
  62% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(-2deg);
  }
}

@keyframes fireworkBurst {
  0% {
    opacity: 0;
    transform: scale(0.1);
  }
  28% {
    opacity: 1;
  }
  76% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translateY(-18px) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(230px) rotate(260deg);
  }
}

@keyframes companionBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes gardenSway {
  0%,
  100% {
    rotate: -2deg;
  }
  50% {
    rotate: 2deg;
  }
}

@keyframes recommendedPulse {
  0%,
  100% {
    transform: translate(0, 0);
    box-shadow: 3px 3px 0 var(--ink);
  }
  50% {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--ink), 0 0 0 5px rgba(198, 147, 26, 0.25);
  }
}

@keyframes leafWave {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 14px;
    padding: 14px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow-x: auto;
  }

  .nav-item {
    min-width: 96px;
    text-align: center;
  }

  .contest-note {
    display: none;
  }

  .sidebar-companion {
    display: none;
  }

  .dashboard-grid,
  .progress-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .personal-best-summary {
    grid-template-columns: 1fr;
  }

  .session-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-clock {
    justify-content: flex-start;
  }

  .companion-strip {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .level-strip,
  .practice-set-card {
    grid-template-columns: 1fr;
  }

  .reward-meter {
    grid-column: 1 / -1;
  }

  .practice-grid,
  .skill-grid,
  .week-grid,
  .month-grid,
  .lineup-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primer-layout,
  .primer-list.compact,
  .check-grid,
  .reminder-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px 12px 28px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 28px;
  }

  .quick-stats,
  .metric-row,
  .personal-best-metrics,
  .practice-grid,
  .skill-grid,
  .week-grid,
  .month-grid,
  .lineup-row {
    grid-template-columns: 1fr;
  }

  .problem-head,
  .problem-card-head,
  .session-meta-row,
  .session-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .problem-card {
    min-height: auto;
    padding: 20px;
  }

  .problem-prompt {
    min-height: 0;
    font-size: 1.35rem;
  }

  .next-action {
    justify-items: start;
  }

  .map-copy p {
    white-space: normal;
  }
}

/* =====================================================================
   Kayla Academy redesign layer — gamified, rounded, cream theme.
   Appended last so it overrides the earlier neobrutalist styling.
   Visual only: no markup/logic dependencies changed.
   ===================================================================== */

body { font-feature-settings: "ss01"; }
h1, h2, h3, h4, .panel-title h3 { letter-spacing: -0.01em; }

/* ---- Sidebar + brand ---- */
.sidebar {
  background: #fffdf8;
  border-right: 2px solid var(--line);
}
.brand-mark {
  border: 2.5px solid #e79a1c;
  border-radius: 13px;
  background: radial-gradient(circle at 36% 30%, #ffe79a, #fcc23f 70%, #f2ad24);
  color: #7a5410;
}
.brand-home:hover .brand-mark,
.brand-home:focus-visible .brand-mark {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #f0c97a;
}

/* ---- Nav as soft pills with a green active state ---- */
.nav-item {
  border-radius: 13px;
  border: 2px solid transparent;
  font-weight: 800;
  color: #5a554a;
  transition: background 120ms ease, color 120ms ease;
}
.nav-item:hover,
.nav-item:focus-visible {
  background: #eef7e9;
  border-color: transparent;
  box-shadow: none;
  color: #2c9050;
}
.nav-item.is-active {
  background: #eaf6ea;
  border-color: #cdebcf;
  color: #2c9050;
  box-shadow: none;
}

.contest-note {
  padding: 16px 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fdfbf4;
}
.contest-note strong {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Top bar gamified stat chips ---- */
.quick-stats {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}
.quick-stats .stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 15px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: none;
  text-align: left;
}
.quick-stats .stat-chip span {
  display: inline;
  font-size: 1.05rem;
  font-weight: 900;
  color: inherit;
}
.quick-stats .stat-chip small {
  color: inherit;
  opacity: 0.72;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-chip .chip-icon { flex: 0 0 auto; }
.stat-chip .chip-diamond {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #7cc0ff, #3f8fe0);
  transform: rotate(45deg);
  border-radius: 3px;
}
.chip-streak { border-color: #ffd9a0; background: #fff6e6; color: #e8702a; }
.chip-xp { border-color: #cfe4fb; background: #eef6ff; color: #2f86d6; }
.chip-accuracy { border-color: #cfe9d6; background: #eef9f1; color: #34a657; }

/* ---- Chunky 3D buttons (Duolingo-style) ---- */
.btn {
  min-height: 40px;
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--card-edge);
  transition: filter 120ms ease, transform 90ms ease, box-shadow 90ms ease;
}
.btn:hover,
.btn:focus-visible {
  transform: none;
  filter: brightness(1.03);
  box-shadow: 0 3px 0 var(--card-edge);
  outline: none;
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--card-edge);
}
.btn.primary {
  border: none;
  background: var(--green);
  color: #fff;
  box-shadow: 0 5px 0 var(--green-dark);
}
.btn.primary:hover,
.btn.primary:focus-visible { box-shadow: 0 5px 0 var(--green-dark); }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-dark); }
.btn.coral {
  border: none;
  background: var(--boost);
  color: #fff;
  box-shadow: 0 5px 0 var(--boost-dark);
}
.btn.coral:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--boost-dark); }
.btn.gold {
  border: none;
  background: var(--gold-bright);
  color: #fff;
  box-shadow: 0 5px 0 #c47f12;
}
.btn.gold:active { transform: translateY(4px); box-shadow: 0 1px 0 #c47f12; }
.btn.ghost {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--card-edge);
}
.btn.ghost:hover,
.btn.ghost:focus-visible { box-shadow: 0 3px 0 var(--card-edge); filter: brightness(1.02); transform: none; }

/* ---- Cards: rounded with a soft drop edge ---- */
.panel,
.problem-card,
.skill-card,
.stat-tile,
.readiness-card,
.strategy-card,
.coach-box,
.companion-strip,
.level-strip,
.cheer-card {
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 4px 0 var(--card-edge);
}
.summer-plan,
.summer-plan.is-primary {
  border: 2px solid var(--line);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 4px 0 var(--card-edge);
}
.week-card,
.month-card {
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--card-edge);
}
.week-card.is-today,
.month-card.is-current {
  border-color: var(--teal);
  box-shadow: 0 5px 0 var(--teal-dark);
}

/* ---- Pills ---- */
.pill,
.difficulty-pill {
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

/* ---- Session answer choices ---- */
.choice {
  border: 2px solid var(--line);
  border-radius: 14px;
}
.choice:hover { border-color: var(--teal); }
.choice.is-correct { border-color: var(--green); background: #eef9f1; }
.choice.is-wrong { border-color: var(--coral); background: #fff3ee; }
.choice-letter {
  border: 2px solid var(--line);
  border-radius: 9px;
  background: #f3efe6;
}

/* ---- Fox mascot (ported from prototype) ---- */
@keyframes mascotIdle { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6%) rotate(1.5deg); } }
@keyframes mascotCheer { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-20%) scale(1.07) rotate(5deg); } 55% { transform: translateY(-4%) scale(0.98) rotate(-4deg); } 75% { transform: translateY(-11%) scale(1.03) rotate(3deg); } 100% { transform: translateY(0) scale(1); } }
@keyframes mascotCelebrate { 0% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-24%) rotate(-9deg); } 40% { transform: translateY(-5%) rotate(9deg); } 60% { transform: translateY(-16%) rotate(-7deg); } 80% { transform: translateY(-2%) rotate(5deg); } 100% { transform: translateY(0) rotate(0); } }
@keyframes mascotSad { 0% { transform: translateY(0) rotate(0) scale(1); } 100% { transform: translateY(6%) rotate(-4deg) scale(0.95); } }
@keyframes mascotBlink { 0%,90%,100% { transform: scaleY(1); } 95% { transform: scaleY(0.12); } }
@keyframes earTwitch { 0%,88%,100% { transform: rotate(0deg); } 94% { transform: rotate(-7deg); } }

.fox-mascot { position: relative; aspect-ratio: 1; transform-origin: 50% 95%; }
.fox-mascot.mood-idle { animation: mascotIdle 3s ease-in-out infinite; }
.fox-mascot.mood-cheer { animation: mascotCheer 0.75s ease both; }
.fox-mascot.mood-celebrate { animation: mascotCelebrate 1.1s ease both; }
.fox-mascot.mood-sad { animation: mascotSad 0.6s ease both; }

/* Sidebar companion: give the fox room and center it */
.sidebar-companion { min-height: 0; display: flex; justify-content: center; padding: 6px 0 2px; }
.side-fox-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 12px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 4px 0 var(--card-edge);
}
.side-fox-wrap { position: relative; }
.side-fox-wrap .fox-caption {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.companion-hide {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.companion-hide:hover { color: var(--ink); background: #f3efe6; }
.companion-show {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 2px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}
.companion-show:hover { background: #f3efe6; color: var(--ink); }

/* ---- Resume (paused block) banner ---- */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 2px solid #ffd9a0;
  border-radius: 18px;
  background: #fff6e6;
  box-shadow: 0 4px 0 #f3e3c2;
}
.resume-info { display: grid; gap: 3px; }
.resume-eyebrow {
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #e8702a;
}
.resume-info strong { font-size: 1.05rem; color: var(--ink); }
.resume-meta { font-weight: 700; font-size: 0.84rem; color: #9a7b54; }
.resume-actions { display: flex; align-items: center; gap: 10px; }

/* ---- Per-skill mastery indicator inside a block session (map element) ---- */
.skill-mastery {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.skill-mastery-label {
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}
.skill-mastery-bar {
  position: relative;
  flex: 1;
  max-width: 160px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.skill-mastery-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5ccb7e, var(--green));
}

/* ---- Every-10 difficulty self-rating prompt (corner) ---- */
.difficulty-check {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: min(92vw, 340px);
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid #cfe4fb;
  border-radius: 18px;
  background: #f4f9ff;
  box-shadow: 0 6px 0 #cdddf0, 0 12px 26px rgba(30, 60, 110, 0.16);
  animation: popIn 0.28s ease both;
}
@keyframes popIn { 0% { transform: translateY(10px) scale(0.96); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
.difficulty-check-head { display: grid; gap: 3px; }
.difficulty-check-head strong { font-size: 1.02rem; color: var(--ink); }
.difficulty-check-head span { font-weight: 700; font-size: 0.8rem; color: #5a7290; }
.difficulty-check-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.difficulty-check-actions .btn {
  min-height: 44px;
  padding: 8px 6px;
  font-size: 0.82rem;
  justify-content: center;
}
@media (max-width: 520px) {
  .difficulty-check { left: 16px; right: 16px; width: auto; }
}

/* ---- Admin block timing (clearer start/end/allotted vs solving vs elapsed) ---- */
.admin-block-timing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.admin-timing-cell {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf6;
}
.admin-timing-cell small {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-timing-cell strong {
  font-size: 0.98rem;
  color: var(--ink);
}
.admin-timing-note {
  margin: 8px 0 0;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--muted);
}
.admin-timing-note strong { color: #5a554a; font-weight: 850; }
.admin-idle-flag { display: inline-block; margin-top: 4px; color: #b06a12; font-weight: 800; }
@media (max-width: 620px) {
  .admin-block-timing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Official practice exam mode ---- */
.exam-launch-panel { margin-bottom: 16px; }
.past-exams-panel { margin-bottom: 16px; }
.past-exams-list { display: grid; gap: 8px; }
.past-exam-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel);
}
.past-exam-main { display: grid; gap: 2px; min-width: 150px; flex: 1; }
.past-exam-main strong { font-size: 0.98rem; }
.past-exam-main span { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.past-exam-stats { display: flex; align-items: center; gap: 14px; font-weight: 750; font-size: 0.86rem; color: var(--ink); flex-wrap: wrap; }
.past-exam-aime { padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 900; background: #fbf7ee; color: var(--muted); border: 1px solid var(--line); }
.past-exam-aime.is-pass { background: #eef9f1; color: #2c9050; border-color: #cdebcf; }
.exam-shell { display: grid; gap: 16px; max-width: 820px; margin: 0 auto; }
.exam-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border: 2px solid var(--line); border-radius: 18px;
  background: var(--panel); box-shadow: 0 4px 0 var(--card-edge);
}
.exam-title-wrap { display: grid; gap: 2px; }
.exam-title-wrap strong { font-size: 1.15rem; }
.exam-clock-wrap {
  display: grid; justify-items: end; gap: 1px; padding: 6px 14px;
  border: 2px solid #cfe4fb; border-radius: 12px; background: #eef6ff; color: #2f86d6;
}
.exam-clock-wrap strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.exam-clock-label { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.8; }
.exam-clock-wrap.is-low { border-color: #ffc9b8; background: #fff3ee; color: var(--coral); }

.exam-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); gap: 6px; }
.exam-nav-cell {
  min-height: 38px; border: 2px solid var(--line); border-radius: 9px; background: var(--panel);
  font-weight: 800; color: var(--muted); font: inherit; cursor: pointer;
}
.exam-nav-cell.is-answered { background: #eaf6ea; border-color: #cdebcf; color: #2c9050; }
.exam-nav-cell.is-current { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(70,192,106,0.35); color: var(--ink); }
.exam-nav-cell.is-flagged { background: #fff6e6; border-color: #ffd9a0; color: #e8702a; }

.exam-question { border: 2px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 4px 0 var(--card-edge); padding: 20px 22px; display: grid; gap: 14px; }
.exam-question-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.exam-question-head strong { font-size: 0.95rem; color: var(--muted); }
.exam-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fff6e6; color: #b06a12; font-weight: 750; font-size: 0.84rem; }
.exam-prompt { margin: 0; font-size: 1.2rem; font-weight: 850; line-height: 1.4; color: var(--ink); }
.exam-choices { display: grid; gap: 10px; }
.exam-choice {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fbfaf6;
  font: inherit; text-align: left; cursor: pointer;
}
.exam-choice:hover { border-color: var(--teal); }
.exam-choice.is-selected { border-color: var(--teal); background: #eaf6ea; }
.exam-choice-letter { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #f3efe6; font-weight: 900; }
.exam-choice.is-selected .exam-choice-letter { background: var(--teal); color: #fff; }
.exam-choice-text { font-weight: 800; font-size: 1.02rem; }

.exam-figure { display: grid; gap: 8px; justify-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.exam-svg { width: min(100%, 460px); height: auto; }
.exam-fig-img { width: min(100%, 540px); height: auto; display: block; image-rendering: auto; }
.exam-grid { border-collapse: collapse; }
.exam-grid td { width: 46px; height: 40px; text-align: center; border: 1px solid var(--line); font-weight: 800; color: var(--ink); }
.exam-grid td.q { background: #eaf6ea; color: #2c9050; }
.exam-figure-note { margin: 0; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-align: center; }

.exam-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.exam-progress { font-weight: 800; color: var(--muted); font-size: 0.86rem; }
.exam-submit-row { display: flex; justify-content: center; }

.exam-review { display: grid; gap: 16px; max-width: 820px; margin: 0 auto; }
.exam-review-actions { display: flex; gap: 10px; margin-top: 14px; }
.exam-review-list { display: grid; gap: 8px; }
.exam-review-row { border: 2px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.exam-review-row.is-right { border-color: #cdebcf; background: #f2fbf4; }
.exam-review-row.is-wrong { border-color: #ffc9b8; background: #fff5f1; }
.exam-review-row.is-blank { border-color: #e6ddca; background: #fbf7ee; }
.exam-review-row summary { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; font-weight: 800; flex-wrap: wrap; }
.exam-review-num { min-width: 34px; }
.exam-review-tag { font-size: 0.78rem; padding: 2px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.exam-review-row.is-right .exam-review-tag { color: #2c9050; }
.exam-review-row.is-wrong .exam-review-tag { color: var(--coral); }
.exam-review-ans { font-size: 0.84rem; color: var(--muted); }
.exam-review-time { margin-left: auto; font-size: 0.84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.exam-review-body { padding: 0 14px 14px; display: grid; gap: 8px; }
.exam-review-correct { margin: 0; font-weight: 750; }
.exam-sol-link {
  display: inline-block;
  margin-top: 2px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--blue);
  text-decoration: none;
}
.exam-sol-link:hover { text-decoration: underline; }

/* ---- AMC score + AIME qualification card ---- */
.aime-card {
  margin-top: 14px;
  padding: 16px 18px;
  border: 2px solid #cfe4fb;
  border-radius: 16px;
  background: #eef6ff;
  display: grid;
  gap: 12px;
}
.aime-card.is-pass { border-color: #cdebcf; background: #eef9f1; }
.aime-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aime-head strong { font-size: 1.6rem; color: var(--ink); display: block; }
.aime-out { font-size: 1rem; color: var(--muted); font-weight: 800; }
.aime-sub { font-size: 0.76rem; font-weight: 700; color: var(--muted); }
.aime-badge { padding: 6px 12px; border-radius: 999px; font-weight: 900; font-size: 0.82rem; white-space: nowrap; }
.aime-badge.is-pass { background: var(--green); color: #fff; }
.aime-badge.is-short { background: #fff; color: #2f86d6; border: 2px solid #cfe4fb; }
.aime-breakdown { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 750; font-size: 0.9rem; }
.aime-breakdown strong { font-size: 1.1rem; }
.aime-breakdown .ok { color: #2c9050; }
.aime-breakdown .blank { color: var(--muted); }
.aime-breakdown .bad { color: var(--coral); }
.aime-note { margin: 0; font-weight: 700; font-size: 0.88rem; color: #4a5566; line-height: 1.45; }
.aime-thresholds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.aime-th {
  display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}
.aime-th small { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.aime-th strong { font-size: 1.05rem; color: var(--ink); }
.aime-th.hit { border-color: #cdebcf; background: #f2fbf4; }
.aime-th.hit strong { color: #2c9050; }

/* ---- Review session (answers revealed) ---- */
.exam-nav-cell.rev-right { background: #eaf6ea; border-color: #cdebcf; color: #2c9050; }
.exam-nav-cell.rev-wrong { background: #fff3ee; border-color: #ffc9b8; color: var(--coral); }
.exam-nav-cell.rev-blank { background: #fbf7ee; border-color: #e6ddca; color: var(--muted); }
.exam-nav-cell.rev-right.is-current,
.exam-nav-cell.rev-wrong.is-current,
.exam-nav-cell.rev-blank.is-current { box-shadow: 0 0 0 2px rgba(70,192,106,0.4); }
.exam-choice.is-review { cursor: default; }
.exam-choice.is-review.is-correct { border-color: var(--green); background: #eef9f1; }
.exam-choice.is-review.is-wrong { border-color: var(--coral); background: #fff3ee; }
.rev-tag { margin-left: auto; font-size: 0.74rem; font-weight: 900; padding: 2px 9px; border-radius: 999px; }
.rev-tag.ok { background: var(--green); color: #fff; }
.rev-tag.bad { background: var(--coral); color: #fff; }
.rev-result { padding: 6px 12px; border-radius: 999px; font-weight: 900; font-size: 0.84rem; }
.rev-result.ok { background: #eef9f1; color: #2c9050; }
.rev-result.bad { background: #fff3ee; color: var(--coral); }
.rev-result.blank { background: #fbf7ee; color: var(--muted); }
.rev-explain {
  margin-top: 4px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fbfaf6;
  display: grid;
  gap: 6px;
}
.rev-explain strong { color: var(--ink); }
.rev-explain p { margin: 0; color: var(--muted); font-weight: 650; line-height: 1.5; }

/* ---- Concept primer (new technique) ---- */
.sol-concept {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #ffe0a8;
  border-left: 3px solid var(--gold-bright);
  border-radius: 8px;
  background: #fff8ea;
}
.sol-concept-title {
  font-size: 0.84rem;
  font-weight: 900;
  color: #b06a12;
}
.sol-concept p { margin: 0; color: #5a4a2e; font-weight: 650; line-height: 1.55; font-size: 0.92rem; }

/* ---- Worked solution methods ---- */
.sol-methods { display: grid; gap: 10px; }
.sol-method {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  background: #fbfaf6;
}
.sol-method-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: #2c9050;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.sol-method p { margin: 0; color: var(--ink); font-weight: 650; line-height: 1.55; font-size: 0.92rem; }
@media (max-width: 620px) {
  .exam-topbar { flex-direction: column; align-items: stretch; }
  .exam-clock-wrap { justify-items: start; }
}

/* Radicals: √ contents get a real overline (vinculum) — see app_4.js patch */
.rt { white-space: nowrap; }
.rt-s { margin-right: -0.06em; }
.rt-c { border-top: 0.085em solid currentColor; padding: 0.02em 0.10em 0 0.06em; }

/* Admin: collapsible student profile cards (see app_5.js) */
details.admin-student-toggle { border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 14px; margin: 10px 0; background: rgba(255, 255, 255, 0.6); }
details.admin-student-toggle > summary { cursor: pointer; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; font-size: 14px; list-style: none; }
details.admin-student-toggle > summary::-webkit-details-marker { display: none; }
details.admin-student-toggle > summary::before { content: "▸"; font-size: 13px; transition: transform 0.15s; }
details.admin-student-toggle[open] > summary::before { transform: rotate(90deg); }
details.admin-student-toggle .ast-email { opacity: 0.6; }
details.admin-student-toggle .ast-mini { margin-left: auto; font-weight: 800; opacity: 0.75; white-space: nowrap; }
details.admin-student-toggle > .admin-student-row { border-top: 1px dashed rgba(0, 0, 0, 0.08); }

/* Focus stopwatch chip: goes gold after 45 minutes of unbroken active work */
.stat-chip.chip-focus.is-hot {
  background: linear-gradient(135deg, #ffe9a8, #ffd35c);
  color: #7a5200;
  box-shadow: 0 0 0 2px rgba(255, 196, 61, 0.55), 0 4px 14px rgba(255, 196, 61, 0.45);
  animation: focusGlow 1.6s ease-in-out infinite alternate;
}
@keyframes focusGlow {
  from { box-shadow: 0 0 0 2px rgba(255, 196, 61, 0.45), 0 3px 10px rgba(255, 196, 61, 0.35); }
  to   { box-shadow: 0 0 0 3px rgba(255, 196, 61, 0.8),  0 6px 18px rgba(255, 196, 61, 0.6); }
}

/* Per-problem feedback row (see app_5.js) */
.pf-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed rgba(0, 0, 0, 0.15); border-radius: 12px; }
.pf-label { display: block; font-size: 13px; font-weight: 700; opacity: 0.75; margin-bottom: 8px; }
.pf-label em { font-style: normal; color: var(--teal, #0a8a6b); }
.pf-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.pf-chip.is-on { border-color: var(--teal, #0a8a6b); color: var(--teal, #0a8a6b); font-weight: 800; box-shadow: 0 0 0 1px var(--teal, #0a8a6b) inset; }
.pf-box input[type="text"] { flex: 1; min-width: 220px; padding: 8px 12px; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 10px; font: inherit; font-size: 13px; background: rgba(255, 255, 255, 0.7); }

/* Admin: per-question review-status chips (see app_5.js) */
.admin-rev-chip { float: right; margin-left: 8px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.06); color: rgba(0, 0, 0, 0.55); white-space: nowrap; }
.admin-rev-chip.is-on { background: rgba(16, 138, 107, 0.12); color: var(--teal, #0a8a6b); }
.admin-rev-chip.is-none { opacity: 0.6; }
.admin-review-summary { margin-top: 10px; font-size: 13px; }
.admin-rev-grid { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.admin-rev-item { white-space: nowrap; }

/* "Are you still there?" idle modal (see app_5.js) */
.amc-idle-overlay { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; background: rgba(20, 20, 20, 0.55); backdrop-filter: blur(3px); }
.amc-idle-overlay.is-open { display: flex; }
.amc-idle-card { background: #fdfbf5; border-radius: 20px; padding: 32px 34px; max-width: 380px; width: calc(100% - 40px); text-align: center; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.amc-idle-emoji { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.amc-idle-card h3 { margin: 4px 0 8px; font-size: 22px; }
.amc-idle-card p { margin: 0 0 20px; color: rgba(0, 0, 0, 0.6); font-size: 14px; line-height: 1.5; }
.amc-idle-card .btn { width: 100%; }
