/* Present Perfect — Lesson Control Room
   Built on Rise Academy tokens. Calm white surfaces, ink-first,
   blue used sparingly, acid only on live indicators / active selections. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--rise-black);
  background: #F4F4EE;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }
::selection { background: var(--rise-acid); color: var(--rise-blue); }

/* ─── App shell grid ─────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-rows: 64px 1fr 96px;
  grid-template-columns: 280px 1fr 360px;
  grid-template-areas:
    "topbar  topbar  topbar"
    "stages  main    teacher"
    "tracker tracker tracker";
  height: 100vh;
  min-height: 720px;
  gap: 0;
}

.topbar  { grid-area: topbar; }
.stages  { grid-area: stages; }
.main    { grid-area: main; overflow-y: auto; overflow-x: hidden; }
.teacher { grid-area: teacher; overflow-y: auto; }
.tracker { grid-area: tracker; }

/* ─── Top bar ────────────────────────────────────────────────── */
.topbar {
  background: var(--rise-pure-white);
  border-bottom: 1px solid rgba(34,34,34,0.08);
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 26px; height: 26px; }
.brand b { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.brand .sep { width: 1px; height: 22px; background: rgba(34,34,34,0.10); margin: 0 4px; }

.lesson-meta { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.lesson-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.012em;
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.lesson-title .crumb {
  font-weight: 500; color: var(--neutral-500); font-size: 13px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(34,34,34,0.05); color: var(--neutral-700);
}
.chip-blue { background: rgba(47,13,255,0.08); color: var(--rise-blue); }
.chip-acid {
  background: var(--rise-acid); color: var(--rise-blue);
  font-weight: 800;
}
.chip-ink { background: var(--rise-black); color: var(--rise-pure-white); }
.chip .dot { width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.chip-live .dot { background: var(--rise-acid); animation: blink 1.4s ease-in-out infinite; }

.topbar-timer {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  padding: 6px 14px; border-radius: 10px;
  background: rgba(34,34,34,0.05); color: var(--rise-black);
}
.topbar-timer small { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--neutral-500); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px;
  padding: 9px 16px; border-radius: 10px;
  transition: all 180ms cubic-bezier(0.2,0.8,0.2,1);
  white-space: nowrap;
}
.btn-ink { background: var(--rise-black); color: var(--rise-pure-white); }
.btn-ink:hover { background: #2A2A2C; transform: translateY(-1px); }
.btn-blue { background: var(--rise-blue); color: var(--rise-pure-white); }
.btn-blue:hover { background: var(--blue-600); transform: translateY(-1px); }
.btn-acid { background: var(--rise-acid); color: var(--rise-blue); }
.btn-acid:hover { background: var(--acid-200); }
.btn-light { background: var(--rise-pure-white); color: var(--rise-black); box-shadow: inset 0 0 0 1px rgba(34,34,34,0.12); }
.btn-light:hover { background: #FAFAF6; box-shadow: inset 0 0 0 1px rgba(34,34,34,0.22); }
.btn-quiet { color: var(--neutral-700); padding: 9px 12px; }
.btn-quiet:hover { background: rgba(34,34,34,0.05); }
.btn:active { transform: scale(0.98); }

/* ─── Stages timeline (left) ─────────────────────────────────── */
.stages {
  background: var(--rise-pure-white);
  border-right: 1px solid rgba(34,34,34,0.08);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
}
.stages-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--neutral-500);
  padding: 4px 10px 0;
}
.stages-list {
  display: flex; flex-direction: column;
  position: relative;
}
.stages-list::before {
  content: ""; position: absolute;
  left: 22px; top: 14px; bottom: 14px;
  width: 1.5px; background: rgba(34,34,34,0.08);
  z-index: 0;
}
.stage-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 10px 10px 8px;
  border-radius: 12px;
  text-align: left;
  position: relative; z-index: 1;
  transition: background 160ms cubic-bezier(0.2,0.8,0.2,1);
}
.stage-item:hover { background: rgba(34,34,34,0.035); }
.stage-item.active { background: rgba(34,34,34,0.05); }
.stage-num {
  width: 26px; height: 26px; flex: none;
  border-radius: 8px;
  background: var(--rise-pure-white);
  box-shadow: inset 0 0 0 1.5px rgba(34,34,34,0.18);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: var(--neutral-600);
  font-variant-numeric: tabular-nums;
  transition: all 200ms cubic-bezier(0.2,0.8,0.2,1);
}
.stage-item.done .stage-num {
  background: var(--rise-black);
  color: var(--rise-pure-white);
  box-shadow: none;
}
.stage-item.active .stage-num {
  background: var(--rise-blue);
  color: var(--rise-pure-white);
  box-shadow: 0 0 0 4px rgba(47,13,255,0.12);
}
.stage-item.active .stage-num::after {
  content: ""; position: absolute;
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--rise-acid);
  top: 6px; right: 2px;
  box-shadow: 0 0 0 2px var(--rise-pure-white);
}
.stage-body { flex: 1; min-width: 0; padding-top: 1px; }
.stage-label {
  font-size: 13.5px; font-weight: 700; letter-spacing: -0.005em;
  color: var(--rise-black); line-height: 1.25;
}
.stage-item:not(.active):not(.done) .stage-label { color: var(--neutral-700); font-weight: 600; }
.stage-sub {
  font-size: 11px; color: var(--neutral-500);
  margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.stages-foot {
  margin-top: auto;
  padding: 14px;
  background: rgba(34,34,34,0.025);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 14px;
}
.stages-foot .progress-track {
  height: 4px; background: rgba(34,34,34,0.08);
  border-radius: 999px; overflow: hidden; margin: 8px 0;
}
.stages-foot .progress-fill {
  height: 100%; background: var(--rise-black); border-radius: 999px;
  transition: width 320ms cubic-bezier(0.2,0.8,0.2,1);
}

/* ─── Main content area ──────────────────────────────────────── */
.main {
  padding: 28px 36px 36px;
  background: #F4F4EE;
}
.stage-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 24px;
}
.stage-head .lhs {
  display: flex; flex-direction: column; gap: 8px;
}
.stage-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--neutral-500);
}
.stage-eyebrow b { color: var(--rise-blue); }
.stage-h1 {
  font-size: 30px; font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.05; margin: 0;
  display: flex; align-items: baseline; gap: 12px;
}
.stage-h1 em {
  font-style: normal; font-weight: 300;
  color: var(--neutral-400);
}
.stage-blurb { font-size: 14px; color: var(--neutral-600); max-width: 540px; }

.stage-actions { display: flex; gap: 8px; }

/* Animation for stage transitions */
.stage-fade { animation: fadeUp 320ms cubic-bezier(0.2,0.8,0.2,1); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47,13,255,0.0); }
  50% { box-shadow: 0 0 0 6px rgba(47,13,255,0.08); }
}

/* Generic card */
.card {
  background: var(--rise-pure-white);
  border-radius: 18px;
  border: 1px solid rgba(34,34,34,0.06);
  padding: 18px;
  transition: all 200ms cubic-bezier(0.2,0.8,0.2,1);
}
.card-quiet { background: rgba(255,255,255,0.55); }

/* ─── Stage 1: warmup question cards ─────────────────────────── */
.q-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.q-card {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 18px;
  padding: 18px;
  min-height: 154px;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: all 220ms cubic-bezier(0.2,0.8,0.2,1);
  position: relative;
  text-align: left;
}
.q-card:hover { transform: translateY(-2px); border-color: rgba(34,34,34,0.18); box-shadow: 0 8px 20px rgba(34,34,34,0.05); }
.q-card.picked {
  background: var(--rise-black);
  color: var(--rise-pure-white);
  border-color: var(--rise-black);
}
.q-card .qnum {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--neutral-500);
  font-variant-numeric: tabular-nums;
}
.q-card.picked .qnum { color: rgba(255,255,255,0.55); }
.q-card .qtext {
  font-size: 16px; font-weight: 700; letter-spacing: -0.012em;
  line-height: 1.25; margin-top: auto;
}
.q-card .qtext em {
  font-style: normal; color: var(--rise-blue); font-weight: 800;
}
.q-card.picked .qtext em { color: var(--rise-acid); }
.q-card .pick-pill {
  position: absolute; top: 14px; right: 14px;
  width: 22px; height: 22px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(34,34,34,0.05); color: var(--neutral-500);
  font-size: 11px;
  transition: all 180ms;
}
.q-card:hover .pick-pill { background: rgba(47,13,255,0.10); color: var(--rise-blue); }
.q-card.picked .pick-pill { background: var(--rise-acid); color: var(--rise-blue); }

/* ─── Stage 2: drag/sort columns ─────────────────────────────── */
.sort-cols {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px;
  align-items: flex-start;
}
.sort-col {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 18px;
  padding: 16px;
  min-height: 380px;
  display: flex; flex-direction: column; gap: 10px;
}
.sort-col.pool {
  background: rgba(34,34,34,0.025);
  border: 1px dashed rgba(34,34,34,0.18);
}
.sort-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 6px;
  border-bottom: 1px solid rgba(34,34,34,0.06);
  margin-bottom: 4px;
}
.sort-col-head .label {
  font-size: 12.5px; font-weight: 800; letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
}
.sort-col-head .label .swatch { width: 10px; height: 10px; border-radius: 4px; }
.sort-col-head .count {
  font-size: 11px; font-weight: 700; color: var(--neutral-500);
  font-variant-numeric: tabular-nums;
  background: rgba(34,34,34,0.05);
  padding: 2px 7px; border-radius: 999px;
}
.sort-card {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.10);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 13.5px; line-height: 1.4;
  cursor: grab;
  display: flex; align-items: flex-start; gap: 8px;
  transition: all 180ms cubic-bezier(0.2,0.8,0.2,1);
}
.sort-card:hover { border-color: rgba(34,34,34,0.25); transform: translateX(2px); }
.sort-card:active { cursor: grabbing; }
.sort-card .handle {
  color: var(--neutral-400); flex: none; padding-top: 1px;
}
.sort-card .body { flex: 1; }
.sort-card .body em { font-style: normal; font-weight: 800; color: var(--rise-blue); }
.sort-card.correct { background: rgba(31,174,92,0.07); border-color: rgba(31,174,92,0.35); }
.sort-card.wrong { background: rgba(229,72,77,0.06); border-color: rgba(229,72,77,0.35); }
.sort-card .verdict { font-size: 11px; font-weight: 700; }
.sort-card.correct .verdict { color: var(--success); }
.sort-card.wrong .verdict { color: var(--danger); }

/* ─── Stage 3: grammar lab ───────────────────────────────────── */
.lab-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.lab-formula {
  background: var(--rise-black); color: var(--rise-pure-white);
  border-radius: 22px; padding: 24px;
  position: relative; overflow: hidden; isolation: isolate;
}
.lab-formula::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 85% 18%, rgba(47,13,255,0.45), transparent 55%),
    radial-gradient(circle at 12% 88%, rgba(199,255,84,0.10), transparent 50%);
  pointer-events: none;
}
.lab-formula > * { position: relative; z-index: 1; }
.lab-formula .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.55);
}
.formula-row {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 4px;
}
.formula-piece {
  font-size: 28px; font-weight: 800; letter-spacing: -0.025em;
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}
.formula-piece.acid { background: var(--rise-acid); color: var(--rise-blue); box-shadow: none; }
.formula-plus { font-size: 22px; font-weight: 300; opacity: 0.55; }
.formula-eg {
  margin-top: 14px; font-size: 13.5px; opacity: 0.72;
  display: flex; flex-direction: column; gap: 4px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 14px;
}
.formula-eg b { font-weight: 800; color: var(--rise-acid); font-feature-settings: "ss01"; }

.lab-uses { display: flex; flex-direction: column; gap: 10px; }
.use-row {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid; grid-template-columns: 130px 1fr;
  gap: 14px; align-items: center;
  transition: all 200ms;
}
.use-row:hover { border-color: rgba(47,13,255,0.25); }
.use-row .tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--rise-blue);
  display: flex; align-items: center; gap: 6px;
}
.use-row .tag .swatch { width: 8px; height: 8px; border-radius: 3px; background: var(--rise-blue); }
.use-row .ex {
  font-size: 14.5px; line-height: 1.35;
}
.use-row .ex em { font-style: normal; font-weight: 800; color: var(--rise-blue); }

/* Grammar timeline visualization */
.timeline-vis {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 22px;
  padding: 22px 24px 26px;
  margin-top: 14px;
}
.timeline-vis h4 {
  font-size: 14px; font-weight: 800; margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.timeline-vis p { font-size: 12.5px; color: var(--neutral-600); margin: 0 0 18px; }
.timeline-svg-wrap { position: relative; }

/* ─── Stage 4: controlled practice ───────────────────────────── */
.cp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.cp-card {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 16px;
  padding: 16px 18px;
  transition: all 200ms cubic-bezier(0.2,0.8,0.2,1);
}
.cp-card .qline {
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  margin-bottom: 10px; line-height: 1.4;
}
.cp-card .qline .blank {
  display: inline-block; min-width: 60px;
  border-bottom: 2px dotted var(--neutral-400);
  margin: 0 4px;
  text-align: center; font-weight: 800;
  color: var(--neutral-400);
  vertical-align: baseline;
  padding-bottom: 1px;
  transition: all 200ms;
}
.cp-card.answered .blank { border-bottom-color: transparent; color: var(--rise-blue); }
.cp-card.wrong .blank { color: var(--danger); }
.cp-options { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-opt {
  font-size: 13px; font-weight: 700;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(34,34,34,0.05);
  color: var(--neutral-700);
  transition: all 180ms;
}
.cp-opt:hover:not(:disabled) { background: rgba(34,34,34,0.10); transform: translateY(-1px); }
.cp-opt:disabled { cursor: default; opacity: 0.55; }
.cp-opt.correct {
  background: rgba(31,174,92,0.16);
  color: var(--success);
  box-shadow: inset 0 0 0 1.5px rgba(31,174,92,0.45);
  opacity: 1;
}
.cp-opt.incorrect {
  background: rgba(229,72,77,0.10);
  color: var(--danger);
  text-decoration: line-through;
  opacity: 1;
}
.cp-feedback {
  font-size: 12px; margin-top: 8px;
  color: var(--neutral-600);
  display: flex; align-items: center; gap: 6px;
}
.cp-feedback.good { color: var(--success); }
.cp-feedback.bad { color: var(--danger); }
.cp-meter {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.cp-meter .label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--neutral-500); }
.cp-meter .track { flex: 1; height: 6px; background: rgba(34,34,34,0.06); border-radius: 999px; overflow: hidden; }
.cp-meter .fill { height: 100%; background: var(--rise-black); border-radius: 999px; transition: width 320ms cubic-bezier(0.2,0.8,0.2,1); }
.cp-meter .score {
  font-variant-numeric: tabular-nums;
  font-size: 16px; font-weight: 800; letter-spacing: -0.01em;
}

/* ─── Stage 5: speaking sprint pairs ─────────────────────────── */
.sprint-grid {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px;
}
.pairs-card {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 22px;
  padding: 20px 22px 22px;
  display: flex; flex-direction: column;
  min-height: 460px;
}
.pairs-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.pair-list {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.pair-row {
  display: grid; grid-template-columns: 28px 1fr auto 1fr;
  align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(34,34,34,0.025);
  transition: all 280ms cubic-bezier(0.2,0.8,0.2,1);
}
.pair-row .pidx {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.pair-row .pname {
  font-size: 13.5px; font-weight: 700; letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
}
.pair-row .pname .av {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800;
  background: var(--rise-pure-white);
  box-shadow: inset 0 0 0 1.5px rgba(34,34,34,0.15);
  color: var(--rise-black);
}
.pair-row .x {
  font-size: 11px; font-weight: 700; color: var(--neutral-400);
  letter-spacing: 0.1em;
}
.prompts-card {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 22px;
  padding: 20px 22px;
}
.prompt-stem {
  font-size: 13px; font-weight: 700; color: var(--rise-blue);
  background: rgba(47,13,255,0.06); padding: 8px 12px; border-radius: 10px;
  margin-bottom: 8px; display: inline-block;
}
.prompt-line {
  font-size: 15px; line-height: 1.45;
  padding: 10px 4px;
  border-bottom: 1px dashed rgba(34,34,34,0.08);
}
.prompt-line:last-child { border-bottom: 0; }
.prompt-line em { font-style: normal; font-weight: 800; color: var(--rise-black); }

.rounds {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 14px;
}
.round-pill {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(34,34,34,0.025);
  border: 1px solid rgba(34,34,34,0.06);
  display: flex; flex-direction: column; gap: 2px;
}
.round-pill .eb { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--neutral-500); }
.round-pill .v { font-size: 14px; font-weight: 800; letter-spacing: -0.005em; }
.round-pill.active { background: var(--rise-black); color: var(--rise-pure-white); border-color: var(--rise-black); }
.round-pill.active .eb { color: rgba(255,255,255,0.6); }

/* ─── Stage 6: role-play scenarios ───────────────────────────── */
.rp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.rp-card {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 22px;
  padding: 22px;
  display: flex; flex-direction: column;
  transition: all 240ms cubic-bezier(0.2,0.8,0.2,1);
}
.rp-card:hover { box-shadow: 0 8px 24px rgba(34,34,34,0.06); transform: translateY(-2px); border-color: rgba(34,34,34,0.12); }
.rp-card.featured { background: var(--rise-black); color: var(--rise-pure-white); border-color: var(--rise-black); }
.rp-card.featured .rp-eyebrow { color: rgba(255,255,255,0.55); }
.rp-card.featured .rp-roles .role { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.92); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); }
.rp-card.featured .phrase-chip { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.rp-card.featured .rp-challenge { background: var(--rise-acid); color: var(--rise-blue); }
.rp-card.featured .rp-criteria li::before { background: var(--rise-acid); }
.rp-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--neutral-500);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.rp-eyebrow .idx { font-variant-numeric: tabular-nums; }
.rp-title { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
.rp-roles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rp-roles .role {
  font-size: 12px; font-weight: 700;
  background: rgba(34,34,34,0.04); padding: 5px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.rp-roles .role b { font-weight: 800; color: var(--rise-blue); }
.rp-block { margin-bottom: 12px; }
.rp-block .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--neutral-500); margin-bottom: 6px; }
.phrase-row { display: flex; flex-wrap: wrap; gap: 5px; }
.phrase-chip {
  font-size: 12px; padding: 4px 9px;
  background: rgba(34,34,34,0.05);
  border-radius: 8px;
  color: var(--neutral-700);
}
.rp-challenge {
  font-size: 13px; font-weight: 700;
  background: rgba(47,13,255,0.06);
  color: var(--rise-blue);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  line-height: 1.35;
  display: flex; gap: 8px;
}
.rp-challenge svg { flex: none; margin-top: 2px; }
.rp-criteria { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.rp-criteria li {
  font-size: 12.5px; color: var(--neutral-700);
  padding-left: 18px; position: relative;
  line-height: 1.4;
}
.rp-criteria li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 8px; height: 2px; border-radius: 1px; background: var(--rise-blue);
}

/* ─── Stage 7: plot twist generator ──────────────────────────── */
.twist-stage {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 24px;
  padding: 36px;
  min-height: 460px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.twist-stage::before {
  content: ""; position: absolute; inset: -40px;
  background:
    radial-gradient(circle at 80% 25%, rgba(199,255,84,0.18), transparent 60%),
    radial-gradient(circle at 18% 85%, rgba(47,13,255,0.05), transparent 55%);
  pointer-events: none;
}
.twist-stage > * { position: relative; }
.twist-card-stack {
  position: relative; min-height: 200px;
  margin: 28px 0;
}
.twist-card {
  position: absolute; inset: 0;
  background: var(--rise-black); color: var(--rise-pure-white);
  border-radius: 22px;
  padding: 30px 36px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: all 380ms cubic-bezier(0.2,0.8,0.2,1);
  box-shadow: 0 24px 48px rgba(34,34,34,0.15);
}
.twist-card.behind-1 {
  transform: translateY(-12px) scale(0.96);
  opacity: 0.55;
  background: var(--neutral-600);
  z-index: 1;
}
.twist-card.behind-2 {
  transform: translateY(-22px) scale(0.92);
  opacity: 0.3;
  background: var(--neutral-500);
  z-index: 0;
}
.twist-card.front { z-index: 2; }
.twist-card.front.animating {
  animation: dealCard 380ms cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes dealCard {
  0% { transform: translateY(20px) rotate(2deg); opacity: 0; }
  100% { transform: translateY(0) rotate(0); opacity: 1; }
}
.twist-card .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--rise-acid);
  display: flex; align-items: center; gap: 10px;
}
.twist-card .copy {
  font-size: 26px; font-weight: 800; letter-spacing: -0.022em;
  line-height: 1.1;
  margin: 14px 0;
}
.twist-card .copy em { font-style: normal; color: var(--rise-acid); font-weight: 800; }
.twist-card .hint {
  font-size: 13px; opacity: 0.65;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 14px;
}
.twist-actions {
  display: flex; gap: 8px; align-items: center;
  margin-top: auto;
}
.twist-tally {
  margin-left: auto;
  font-size: 11.5px; color: var(--neutral-500);
  font-variant-numeric: tabular-nums;
}

/* ─── Stage 8: exit challenge ────────────────────────────────── */
.exit-grid {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px;
}
.exit-tasks { display: flex; flex-direction: column; gap: 10px; }
.exit-task {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid; grid-template-columns: 28px 1fr auto;
  align-items: flex-start; gap: 12px;
}
.exit-task .nx {
  width: 24px; height: 24px; border-radius: 8px;
  background: rgba(34,34,34,0.05); color: var(--neutral-600);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
}
.exit-task .body { padding-top: 1px; }
.exit-task .title { font-size: 14px; font-weight: 700; letter-spacing: -0.005em; line-height: 1.3; }
.exit-task .sub { font-size: 12.5px; color: var(--neutral-600); margin-top: 4px; line-height: 1.4; }
.exit-task .sub em { font-style: normal; font-weight: 700; color: var(--rise-black); }
.exit-task .check {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(34,34,34,0.05);
  color: var(--neutral-500);
  transition: all 180ms;
}
.exit-task .check:hover { background: rgba(34,34,34,0.10); }
.exit-task.done .check { background: var(--success); color: white; }
.exit-task.done .nx { background: var(--rise-black); color: var(--rise-pure-white); }

.exit-meter {
  background: var(--rise-pure-white);
  border: 1px solid rgba(34,34,34,0.06);
  border-radius: 22px;
  padding: 22px;
}
.exit-meter h4 { font-size: 14px; font-weight: 800; letter-spacing: -0.005em; margin: 0; }
.exit-meter .sub { font-size: 12.5px; color: var(--neutral-600); margin: 4px 0 16px; }
.exit-criterion {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(34,34,34,0.06);
}
.exit-criterion:last-of-type { border-bottom: 0; }
.exit-criterion .icn {
  width: 22px; height: 22px; border-radius: 8px;
  background: rgba(34,34,34,0.05);
  display: grid; place-items: center;
  flex: none;
}
.exit-criterion.on .icn { background: var(--rise-acid); color: var(--rise-blue); }
.exit-criterion .lbl { font-size: 13px; font-weight: 600; flex: 1; line-height: 1.3; }
.exit-criterion .pct { font-size: 11px; font-weight: 700; color: var(--neutral-500); font-variant-numeric: tabular-nums; }
.exit-criterion.on .pct { color: var(--rise-blue); }

.exit-summary {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(34,34,34,0.06);
  display: flex; align-items: center; justify-content: space-between;
}
.exit-summary .big {
  font-size: 32px; font-weight: 800; letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

/* ─── Teacher panel (right) ──────────────────────────────────── */
.teacher {
  background: var(--rise-pure-white);
  border-left: 1px solid rgba(34,34,34,0.08);
  padding: 18px 18px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.teacher-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(34,34,34,0.06);
}
.teacher-head .eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--neutral-500);
}
.teacher-section { display: flex; flex-direction: column; gap: 8px; }
.teacher-section .lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--neutral-500);
  display: flex; align-items: center; justify-content: space-between;
}
.objective {
  font-size: 14px; font-weight: 700; letter-spacing: -0.005em;
  line-height: 1.35;
  padding: 12px 14px;
  background: rgba(199,255,84,0.30);
  color: var(--rise-blue);
  border-radius: 12px;
}
.script {
  font-size: 13px; line-height: 1.5; color: var(--neutral-700);
  padding: 12px 14px;
  background: rgba(34,34,34,0.03);
  border-radius: 12px;
  border-left: 2px solid var(--rise-blue);
  font-style: italic;
}
.script::before { content: "\201C"; color: var(--neutral-400); font-size: 16px; margin-right: 2px; }
.script::after  { content: "\201D"; color: var(--neutral-400); font-size: 16px; margin-left: 2px; }

.timer-card {
  background: var(--rise-black); color: var(--rise-pure-white);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
}
.timer-card .clock {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.timer-card .meta {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.timer-actions { display: flex; gap: 6px; }
.timer-actions button {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: var(--rise-pure-white);
  display: grid; place-items: center;
  transition: all 150ms;
}
.timer-actions button:hover { background: rgba(255,255,255,0.18); }
.timer-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255,255,255,0.08);
}
.timer-bar > div {
  height: 100%; background: var(--rise-acid);
  transition: width 1000ms linear;
}

.tools-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.tool-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(34,34,34,0.04);
  font-size: 12.5px; font-weight: 700;
  color: var(--rise-black);
  transition: all 150ms;
  text-align: left;
}
.tool-btn:hover { background: rgba(34,34,34,0.08); transform: translateY(-1px); }
.tool-btn svg { color: var(--rise-blue); flex: none; }

.tips-list { display: flex; flex-direction: column; gap: 8px; }
.tip {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: rgba(34,34,34,0.025);
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.4;
}
.tip .corr {
  font-size: 10.5px; font-weight: 800;
  color: var(--danger); text-transform: uppercase; letter-spacing: 0.08em;
  display: block;
}
.tip .fix { font-weight: 700; color: var(--rise-black); }
.tip .why { color: var(--neutral-600); display: block; margin-top: 2px; font-size: 11.5px; }

/* ─── Student tracker (bottom) ───────────────────────────────── */
.tracker {
  background: var(--rise-pure-white);
  border-top: 1px solid rgba(34,34,34,0.08);
  padding: 12px 24px;
  display: flex; align-items: center; gap: 14px;
}
.tracker-head {
  display: flex; flex-direction: column; gap: 2px; flex: none; min-width: 130px;
}
.tracker-head .lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--neutral-500);
}
.tracker-head .stat {
  font-size: 16px; font-weight: 800; letter-spacing: -0.012em;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 6px;
}
.tracker-head .stat small {
  font-size: 11.5px; font-weight: 600; color: var(--neutral-500);
  letter-spacing: 0;
}

.student-strip {
  flex: 1; display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}
.s-card {
  background: rgba(34,34,34,0.035);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex; align-items: center; gap: 8px;
  transition: all 180ms cubic-bezier(0.2,0.8,0.2,1);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  position: relative;
}
.s-card:hover { background: rgba(34,34,34,0.06); }
.s-card .av {
  width: 28px; height: 28px; border-radius: 9px;
  flex: none;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800;
  background: var(--rise-pure-white);
  box-shadow: inset 0 0 0 1.5px rgba(34,34,34,0.18);
  position: relative;
}
.s-card .meta { flex: 1; min-width: 0; }
.s-card .name {
  font-size: 11.5px; font-weight: 700; letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-card .status {
  font-size: 10px; color: var(--neutral-500);
  font-weight: 600;
}
.s-card[data-status="spoken"] { background: rgba(31,174,92,0.08); border-color: rgba(31,174,92,0.20); }
.s-card[data-status="spoken"] .av { background: var(--success); color: white; box-shadow: none; }
.s-card[data-status="strong"] { background: var(--rise-acid); border-color: var(--acid-400); }
.s-card[data-status="strong"] .av { background: var(--rise-blue); color: var(--rise-acid); box-shadow: none; }
.s-card[data-status="strong"] .status { color: var(--rise-blue); font-weight: 700; }
.s-card[data-status="support"] { background: rgba(229,72,77,0.07); border-color: rgba(229,72,77,0.22); }
.s-card[data-status="support"] .av { background: var(--danger); color: white; box-shadow: none; }
.s-card[data-status="support"] .status { color: var(--danger); font-weight: 700; }

.s-card .dot-stack { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; }
.s-card .d {
  width: 5px; height: 5px; border-radius: 999px;
  background: rgba(34,34,34,0.20);
}
.s-card[data-status="spoken"] .d { background: var(--success); }
.s-card[data-status="strong"] .d { background: var(--rise-blue); }
.s-card[data-status="support"] .d { background: var(--danger); }

/* Scrollbar — quiet */
.main::-webkit-scrollbar, .teacher::-webkit-scrollbar, .stages::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb, .teacher::-webkit-scrollbar-thumb, .stages::-webkit-scrollbar-thumb { background: rgba(34,34,34,0.10); border-radius: 999px; }
.main::-webkit-scrollbar-thumb:hover, .teacher::-webkit-scrollbar-thumb:hover, .stages::-webkit-scrollbar-thumb:hover { background: rgba(34,34,34,0.20); }

/* Floating toast for randomization etc. */
.toast {
  position: fixed; bottom: 116px; left: 50%; transform: translateX(-50%);
  background: var(--rise-black); color: var(--rise-pure-white);
  padding: 10px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 12px 32px rgba(34,34,34,0.20);
  z-index: 50;
  animation: toastIn 240ms cubic-bezier(0.2,0.8,0.2,1);
}
.toast .ac { color: var(--rise-acid); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Tooltip-ish help row */
.tip-row {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--neutral-500);
}
