body {
  font-family: Arial, sans-serif;

  margin: 0;

  overflow: auto;
}

body[data-app-mode="learner"] #app {
  box-sizing: border-box;
  width: 100%;
  padding-inline: clamp(16px, 3vw, 36px);
}

body[data-app-mode="learner"] #app.learner-progress-active {
  padding-right: clamp(210px, 23vw, 290px);
}
.learner-progress-rail {
  position: fixed; z-index: 20; top: 72px; right: clamp(12px, 2vw, 24px);
  width: clamp(170px, 19vw, 230px); max-height: calc(100vh - 96px); overflow-y: auto;
  box-sizing: border-box; padding: 14px 12px; border: 1px solid #cbd5e1;
  border-radius: 14px; background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.learner-tree-exit-control { display: flex; justify-content: flex-start; }
.learner-tree-exit-embedded { margin: -4px 0 8px; }
.learner-tree-exit-standalone {
  position: fixed; z-index: 21; top: 20px; right: clamp(12px, 2vw, 24px);
}
.learner-tree-exit-button {
  display: grid; place-items: center; width: 34px; height: 34px; margin: 0; padding: 0;
  border: 1px solid #cbd5e1; border-radius: 50%; background: rgba(255, 255, 255, 0.98);
  color: #475569; font: 700 1.35rem/1 Arial, sans-serif;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}
.learner-tree-exit-button:hover { border-color: #dc2626; color: #b91c1c; background: #fef2f2; }
.learner-tree-exit-button:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
.learner-tree-exit-dialog {
  width: min(92vw, 480px); padding: 0; border: 0; border-radius: 16px;
  color: #0f172a; box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}
.learner-tree-exit-dialog::backdrop { background: rgba(15, 23, 42, 0.55); }
.learner-tree-exit-dialog-content { padding: 24px; }
.learner-tree-exit-dialog-content h2 { margin: 0 0 10px; }
.learner-tree-exit-dialog-content p { margin: 0; line-height: 1.5; }
.learner-tree-exit-dialog-actions {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px;
}
.learner-tree-exit-dialog-actions button { margin: 0; }
.learner-tree-exit-confirm { border-color: #b91c1c; background: #b91c1c; color: white; }
.learner-progress-support { border-color: #f59e0b; background: rgba(255, 251, 235, 0.98); }
.learner-progress-extension { border-color: #a855f7; background: rgba(250, 245, 255, 0.98); }
.learner-progress-route-status {
  display: grid; gap: 4px; margin: 0 0 12px; padding: 9px 10px; border-radius: 9px;
  overflow-wrap: anywhere;
}
.learner-progress-route-status strong { font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; }
.learner-progress-route-status span { font-size: 0.86rem; font-weight: 700; line-height: 1.3; }
.learner-progress-support .learner-progress-route-status { background: #fef3c7; color: #92400e; }
.learner-progress-extension .learner-progress-route-status { background: #f3e8ff; color: #6b21a8; }
.learner-progress-toggle { display: none; }
.learner-progress-details { min-width: 0; }
body[data-start-mode="learner"] .learner-progress-rail { top: 20px; }
.learner-progress-count { display: block; margin-top: 3px; color: #64748b; font-size: 0.78rem; }
.learner-progress-score { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 10px 0 8px; padding: 8px 10px; border-radius: 9px; background: #eff6ff; color: #1e3a8a; }
.learner-progress-score span { font-size: 0.78rem; font-weight: 700; }
.learner-progress-score strong { font-size: 1.25rem; }
.learner-progress-rail ol { display: grid; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.learner-progress-rail li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; color: #64748b; font-size: 0.82rem; line-height: 1.25; }
.learner-progress-rail li > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.learner-progress-rail .checkpoint-circle {
  display: grid; place-items: center; width: 18px; height: 18px;
  border: 2px solid #94a3b8; border-radius: 50%; box-sizing: border-box;
  color: white; font-size: 0.68rem; font-weight: 900;
}
.learner-progress-rail .checkpoint-complete { color: #0f172a; font-weight: 700; }
.learner-progress-rail .checkpoint-complete .checkpoint-circle { border-color: #16a34a; background: #16a34a; }

@media (max-width: 1100px) and (min-width: 701px) {
  body[data-app-mode="learner"] #app.learner-progress-active { padding-right: 220px; }
  .learner-progress-rail { width: 185px; right: 12px; padding: 12px 10px; }
  .learner-progress-rail ol { gap: 10px; }
  .learner-progress-rail li { font-size: 0.76rem; }
}
@media (max-width: 700px) {
  body[data-app-mode="learner"] #app.learner-progress-active { padding-right: clamp(16px, 3vw, 36px); }
  .learner-progress-rail { position: static; width: 100%; max-height: none; overflow: visible; margin: 0 0 16px; padding: 0; border-radius: 12px; box-shadow: none; }
  .learner-tree-exit-embedded { padding: 10px 10px 0; margin: 0; }
  .learner-tree-exit-standalone { top: 12px; right: 12px; }
  .learner-progress-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; border: 0; border-radius: 11px; background: #eff6ff; color: #1e3a8a; text-align: left; font: inherit; }
  .learner-progress-support .learner-progress-toggle { background: #fef3c7; color: #92400e; }
  .learner-progress-extension .learner-progress-toggle { background: #f3e8ff; color: #6b21a8; }
  .learner-progress-compact-score { font-size: 0.82rem; font-weight: 700; text-align: right; }
  .learner-progress-chevron { grid-column: 3; font-size: 1.25rem; text-align: center; transition: transform 0.18s ease; }
  .learner-progress-expanded .learner-progress-chevron { transform: rotate(180deg); }
  .learner-progress-details { display: none; padding: 14px 12px; border-top: 1px solid #bfdbfe; }
  .learner-progress-expanded .learner-progress-details { display: block; }
  .learner-progress-rail ol { gap: 10px; }
  .learner-progress-rail li { font-size: 0.86rem; }
}
@media (max-width: 430px) {
  .learner-progress-toggle { grid-template-columns: minmax(0, 1fr) 24px; }
  .learner-progress-compact-score { grid-column: 1; text-align: left; }
  .learner-progress-chevron { grid-column: 2; grid-row: 1 / span 2; }
}

button {
  margin-top: 10px;

  padding: 10px 18px;

  cursor: pointer;
}

.question {
  margin: 25px 0;
}

body[data-start-mode="learner"] .question > h3 {
  font-size: clamp(1.28rem, 2.5vw, 1.72rem);
  line-height: 1.45;
}

.answerOptions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 12px 0;
  width: 100%;
}

.answerButton {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 48px;
  text-align: center;
}

.answerButton.answer-button-disabled,
.answerButton.answer-button-disabled:hover,
.answerButton.answer-button-disabled:focus {
  cursor: default;
  opacity: 0.42;
  filter: grayscale(1);
  transform: none;
  box-shadow: none;
}

.preview-answer-with-feedback {
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}

.preview-feedback-snippet {
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border-top: 1px solid rgba(71, 85, 105, 0.3);
  color: #334155;
  background: rgba(248, 250, 252, 0.9);
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.3;
}

.question-rich-text {
  white-space: normal;
}

.question-points {
  margin: -0.25rem 0 1rem;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
}

.activity-score-summary {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  margin: 0 0 18px; color: #334155;
}
.activity-score-summary p { margin: 0; line-height: 1.5; }

.question-paragraph {
  display: block;
  line-height: 1.35;
}

.question-paragraph + .question-paragraph {
  margin-top: 0.7em;
}

.question-align-center {
  text-align: center;
}

.question-align-justify {
  text-align: justify;
  text-justify: inter-word;
}

.question-text-highlight {
  background: #fff0a8;
  color: inherit;
  border-radius: 0.16em;
  padding: 0 0.12em;
}

.question-text-underline {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.question-text-box {
  display: inline-block;
  max-width: 100%;
  padding: 0.08em 0.35em;
  border: 2px solid currentColor;
  border-radius: 0.3em;
  box-sizing: border-box;
}

.question-text-small {
  font-size: 0.82em;
}

.question-text-large {
  font-size: 1.2em;
}

.question-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.35rem 0 0.45rem;
}

.question-format-toolbar button {
  min-height: 1.8rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.78rem;
}

.preview-feedback-label {
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preview-feedback-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.preview-feedback-media {
  overflow-wrap: anywhere;
  color: #475569;
}

@media (max-width: 650px) {
  .answerOptions {
    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));

    gap: 12px;

    width: 100%;
    margin: 12px 0;
  }

  .answerButton {
    width: 100%;
    min-width: 0;
    min-height: 48px;

    margin: 0;
    padding: 10px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 8px;

    text-align: center;
    overflow: hidden;
  }

  .answerImage {
    display: block;

    width: 100%;
    height: clamp(120px, 24vh, 220px);

    object-fit: contain;

    border-radius: 5px;
  }

  .answerText {
    display: block;

    line-height: 1.3;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 600px) {
  .answerOptions {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .answerImage {
    height: 150px;
  }
}

.feedback {
  margin-top: 20px;

  font-style: italic;
}

/*
=========================================================
Node images
=========================================================
*/

.nodeImage {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: calc(100vh - 260px);

  object-fit: contain;

  margin: 8px auto 12px;
}

@media (max-height: 700px) {
  .nodeImage {
    max-height: calc(100vh - 230px);
  }
}

.nodeMedia {
  text-align: center;
}

/* =========================================
   Graph View
========================================= */

.graphNode {
  position: absolute;

  width: 120px;
  min-height: 60px;

  box-sizing: border-box;

  padding: 10px;

  border: 1px solid #333;

  cursor: pointer;

  border-radius: 8px;

  text-align: center;

  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.15);
}

.graph-node-dot {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.graph-node-dot-unfinished {
  top: 6px;
  left: 6px;
  background: #e53935;
}

.graph-node-dot-termination {
  right: 6px;
  bottom: 6px;
  background: #2563eb;
}

/* Node types */

.graphNode.start {
  background: #d9f7d9;
}

.graphNode.question {
  background: #dfeeff;
}

.graphNode.info {
  background: #ffe8c9;
}

.graphNode.end {
  background: #ffd9d9;
}

.graphNode.selected {
  border: 3px solid #0066ff;

  box-shadow: 0 0 12px rgba(0, 102, 255, 0.6);
}

.graphNode.orphan {
  border: 2px solid red;
}

#inspector {
  width: 100%;

  flex: 1;
  min-height: 0;

  overflow-y: auto;
  overflow-x: hidden;

  padding-right: 4px;
  box-sizing: border-box;
}

#variablePanel {
  width: 100%;
  max-height: 230px;
  overflow-y: auto;

  background: white;

  border: 1px solid #999;
  border-radius: 6px;

  padding: 10px;
  box-sizing: border-box;

  font-size: 14px;
}

.variableName {
  font-weight: bold;
}

.variableHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.variableDeleteButton {
  flex: 0 0 auto;
  padding: 2px 7px;
  color: #9b1c1c;
  font-size: 12px;
}

.variableValue {
  margin-left: 15px;

  color: #555;
}

#sidebar {
  position: fixed;

  top: 90px;
  right: 20px;

  width: 320px;
  height: calc(100vh - 110px);

  background: white;

  border: 1px solid #999;
  border-radius: 8px;

  padding: 15px;
  box-sizing: border-box;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

  display: flex;
  flex-direction: column;

  overflow: hidden;
}

/* Keep the Editor viewport and scrollbar clear of the fixed Inspector. */
body[data-app-mode=editor] #app {
  margin-right: 350px;
}

.inspector-apply-bar {
  flex-shrink: 0;

  background: white;

  padding-top: 10px;
  margin-top: 10px;

  border-top: 1px solid #ccc;
}

.inspector-apply-bar button {
  width: 100%;
  margin-top: 0;
}

.variables-section {
  flex-shrink: 0;
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid #d8d8d8;
  margin: 12px 0 8px 0;
}

.variables-summary {
  font-size: 0.88em;
  font-weight: 600;
  color: #555;
}

.conditions-panel {
  border: 1px solid transparent;
  border-radius: 6px;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}

.conditions-panel[open] {
  background: #fafcff;
  border-color: #c6d8f7;
  padding: 8px;
}

.runtime-preview {
  margin-top: 24px;
  padding: 10px;
  border: 1px solid #b8cde8;
  border-radius: 6px;
  background: #f5f9ff;
  font-size: 0.9em;
}

.runtime-preview summary {
  cursor: pointer;
  font-weight: 600;
}

.runtime-preview-values {
  margin-top: 10px;
}

.runtime-preview-row {
  display: grid;
  grid-template-columns: minmax(80px, auto) 20px 1fr;
  gap: 6px;
  padding: 3px 0;
}

/* =====================================================
   Runtime debug panel
   ===================================================== */

.runtime-debug-grid {
  display: grid;

  grid-template-columns:
    minmax(220px, 1fr)
    minmax(220px, 1fr)
    minmax(0, 1fr);

  gap: 30px;

  margin-top: 12px;

  align-items: start;
}

.runtime-debug-variables,
.runtime-debug-node,
.runtime-debug-spare {
  min-width: 0;
}

.runtime-debug-heading {
  margin-bottom: 8px;

  font-weight: 700;
  color: #333;
}

.runtime-debug-node {
  padding-left: 10px;

  border-left: 1px solid #d7e1ee;
}

.runtime-node-row {
  display: grid;

  grid-template-columns: auto 1fr;

  gap: 8px;

  padding: 4px 0;
}

.runtime-node-row strong {
  white-space: nowrap;
}

.runtime-node-row span {
  overflow-wrap: anywhere;
}

@media (max-width: 750px) {
  .runtime-debug-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .runtime-debug-node {
    padding-left: 0;
    padding-top: 12px;

    border-left: none;
    border-top: 1px solid #d7e1ee;
  }

  .runtime-debug-spare {
    display: none;
  }
}

.learner-feedback {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #c9d7ea;
  border-radius: 8px;
  background: #f7faff;
}

.learner-feedback h3 {
  margin-top: 0;
}

.learner-feedback-text {
  margin: 14px 0 18px 0;
  line-height: 1.5;
  white-space: normal;
}

.learner-answer-review {
  margin-bottom: 18px; padding: clamp(18px, 3vw, 28px); border: 1px solid #cbd5e1;
  border-radius: 16px; background: white; text-align: center;
}
.learner-answer-review-label {
  margin: 0 0 8px; color: #64748b; font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.learner-answer-review > h3 { margin: 0 auto 16px; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.learner-answer-review .nodeImage { max-height: clamp(140px, 22vh, 230px); }
.learner-answer-review .youtube-media { max-width: 560px; margin-inline: auto; }
.learner-selected-answer {
  display: grid; gap: 8px; max-width: 760px; margin: 16px auto 0; padding: 12px 14px;
  border-left: 4px solid #2563eb; border-radius: 8px; background: #eff6ff; text-align: left;
}
.learner-selected-answer > strong { color: #1e3a8a; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.learner-selected-answer-content { display: flex; align-items: center; gap: 12px; }
.learner-selected-answer-content .answerImage { max-height: 110px; max-width: min(220px, 42%); object-fit: contain; }
.learner-feedback-primary {
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
  text-align: center;
}

.learner-feedback-primary.learner-feedback-neutral {
  border-color: #bfdbfe;
  background: #eff6ff;
  box-shadow: none;
}

.learner-feedback-primary.learner-feedback-correct {
  border-color: #16a34a;
  background: #f0fdf4;
}
.learner-feedback-primary.learner-feedback-incorrect {
  border-color: #b91c1c;
  background: #fee2e2;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.18);
}

.learner-feedback-primary h3,
.learner-feedback-placeholder {
  margin-top: 0;
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.learner-feedback-primary .learner-feedback-text {
  font-size: clamp(1.18rem, 2.2vw, 1.4rem);
  line-height: 1.65;
  text-align: center;
}

.continueButton {
  padding: 8px 18px;
  cursor: pointer;
}

.preview-back-row {
  margin: 0 0 12px 0;
}

.preview-back-button {
  padding: 8px 18px;
  cursor: pointer;
}

.graph-question-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.graphNodeQuestion {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid #ccc;
  font-size: 11px;
  line-height: 1.25;
  font-weight: normal;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.answerMediaError {
  padding: 16px;
  border: 1px dashed #b66;
  border-radius: 5px;
  font-size: 0.85rem;
}

/* =====================================================
   Learner answer cards
   ===================================================== */

.answerOptions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));

  gap: 12px;
  width: 100%;
  margin: 12px 0;

  align-items: stretch;
}

.answerButton {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  gap: 8px;

  width: 100%;
  min-width: 0;
  max-width: 100%;

  margin: 0;
  padding: 10px;

  box-sizing: border-box;
  overflow: hidden;

  white-space: normal;
  text-align: center;
}

.answerButton > .answerImage {
  display: block;

  width: 100%;
  max-width: 100%;

  height: clamp(130px, 22vh, 210px);
  max-height: 210px;

  object-fit: contain;
  object-position: center;

  flex: 0 0 auto;

  margin: 0;
}

.answerOptions.answer-options-large .answerButton > .answerImage {
  height: clamp(200px, 32vh, 340px);
  max-height: 340px;
}

.answerButton > .answerText {
  display: block;

  width: 100%;
  flex: 0 0 auto;

  margin: 0;
  padding: 2px 4px;

  box-sizing: border-box;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.answerButton > .answerMediaError {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 650px) {
  .answerOptions {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .answerButton > .answerImage {
    height: 150px;
  }

  .answerOptions.answer-options-large .answerButton > .answerImage {
    height: 200px;
    max-height: 200px;
  }
}

.sidebar-hidden {
  display: none !important;
}

body[data-app-mode="learner"] > hr,
body[data-app-mode="learner"] #sidebar {
  display: none !important;
}

.learner-start-shell {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
  background: linear-gradient(145deg, #eff6ff, #f8fafc 55%, #ecfdf5);
}

.learner-start-card {
  width: min(620px, 100%);
  padding: clamp(28px, 6vw, 56px);
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  box-sizing: border-box;
  background: white;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  text-align: center;
}

.learner-start-eyebrow {
  margin: 0 0 10px;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.learner-start-card h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
}

.learner-start-description {
  margin: 18px auto 28px;
  max-width: 46ch;
  color: #475569;
  line-height: 1.55;
}

.learner-start-button {
  min-width: 180px;
  padding: 13px 28px;
  border: 0;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.learner-start-button:hover {
  background: #1d4ed8;
}

.learner-start-button:disabled { background: #94a3b8; cursor: not-allowed; }

.learner-welcome-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 12% 12%, rgba(37, 99, 235, 0.10), transparent 24rem),
    radial-gradient(circle at 88% 30%, rgba(5, 150, 105, 0.10), transparent 28rem),
    #f8fafc;
  color: #0f172a;
}

.learner-welcome-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.learner-welcome-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.learner-welcome-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #2563eb, #0f766e);
  color: white;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.learner-welcome-brand strong,
.learner-welcome-brand small { display: block; }
.learner-welcome-brand strong { font-size: 1rem; }
.learner-welcome-brand small { margin-top: 2px; color: #64748b; font-size: 0.72rem; }

.learner-welcome-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex: 1 1 auto;
}

.learner-welcome-menu button,
.learner-welcome-footer button {
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.learner-welcome-menu button:hover,
.learner-welcome-footer button:hover { color: #1d4ed8; background: #eff6ff; }
.learner-welcome-menu button.learner-welcome-menu-active {
  color: #1d4ed8;
  background: #dbeafe;
}

.learner-welcome-menu-toggle {
  display: none;
  margin-left: auto;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: white;
  color: #334155;
  font: inherit;
  font-weight: 700;
}

.learner-welcome-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(48px, 7vw, 86px) 0 72px;
  box-sizing: border-box;
}

.learner-welcome-page-header {
  max-width: 820px;
  margin: 0 auto 38px;
  text-align: center;
}

.learner-welcome-page-header h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.learner-welcome-lead {
  max-width: 68ch;
  margin: 20px auto 0;
  color: #475569;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.learner-welcome-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.learner-welcome-info-card {
  position: relative;
  padding: 25px 26px;
  border: 1px solid #dbe3ed;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.learner-welcome-info-card h2 {
  margin: 0 0 9px;
  color: #0f172a;
  font-size: 1.12rem;
}

.learner-welcome-info-card p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}


/* Public introduction: an unscored example, separate from activity sessions. */
.learner-welcome-demo {
  max-width: 820px; margin: 38px auto 28px; padding: clamp(22px, 4vw, 38px);
  border: 1px solid #bfdbfe; border-radius: 20px; background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07); text-align: left;
}
.learner-welcome-demo h2 { margin: 0 0 16px; color: #0f172a; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.25; }
.learner-welcome-demo p { color: #475569; line-height: 1.65; }
.learner-welcome-demo .learner-welcome-demo-note { color: #64748b; font-size: 0.9rem; }
.learner-welcome-demo h3 { margin: 24px 0 14px; color: #5b21b6; }
.learner-welcome-demo fieldset { min-width: 0; padding: 0; margin: 22px 0 18px; border: 0; }
.learner-welcome-demo legend { margin-bottom: 14px; color: #0f172a; font-weight: 750; line-height: 1.5; }
.learner-welcome-demo-choice {
  display: flex; align-items: center; gap: 12px; min-height: 48px; box-sizing: border-box;
  margin: 8px 0; padding: 12px 15px; border: 1px solid #cbd5e1;
  border-radius: 10px; background: #f8fafc; color: #1e293b; cursor: pointer; line-height: 1.5;
}
.learner-welcome-demo-choice:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
.learner-welcome-demo-choice:focus-within { outline: 3px solid #93c5fd; outline-offset: 2px; }
.learner-welcome-demo-choice input { flex: 0 0 auto; margin: 0; accent-color: #2563eb; }
.learner-welcome-demo-feedback:empty { display: none; }
.learner-welcome-demo-feedback { margin-top: 22px; padding: 18px; border-left: 4px solid #7c3aed; border-radius: 8px; background: #f5f3ff; color: #312e81; line-height: 1.65; }
.learner-welcome-demo-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.learner-welcome-demo-actions:empty { display: none; }
.learner-welcome-philosophy { margin-top: 30px; }
.learner-welcome-philosophy > summary { padding: 20px 0; color: #1e3a5f; cursor: pointer; font-size: 1.15rem; font-weight: 750; }
.learner-welcome-philosophy[open] > summary { margin-bottom: 18px; }
.learner-welcome-info-card p + p { margin-top: 16px; }
.learner-welcome-about-grid .learner-welcome-info-card:first-child { grid-column: 1 / -1; }

.learner-welcome-quote {
  max-width: 820px;
  margin: 0 auto 34px;
  padding: 0 0 0 27px;
  border-left: 3px solid #60a5fa;
  color: #1e3a5f;
  font-size: clamp(1.12rem, 2.3vw, 1.42rem);
  font-weight: 650;
  line-height: 1.6;
}

.learner-welcome-action-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

.learner-welcome-secondary-button {
  padding: 13px 22px;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.learner-welcome-secondary-button:hover { background: #dbeafe; }

.learner-welcome-link-button {
  display: inline-block;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}

.learner-welcome-steps { counter-reset: welcome-step; }
.learner-welcome-steps .learner-welcome-info-card { padding-left: 76px; }
.learner-welcome-step-number {
  position: absolute;
  top: 25px;
  left: 24px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
}

.learner-welcome-method-steps .learner-welcome-info-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.learner-welcome-method-note {
  max-width: 880px;
  margin: 30px auto 0;
  padding: 22px 25px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}

.learner-welcome-expandable-steps {
  display: grid;
  gap: 14px;
  max-width: 1040px;
  margin: 0 auto;
}
.learner-welcome-step {
  overflow: hidden;
  border: 1px solid #dbe3ed;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.055);
}
.learner-welcome-step summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
}
.learner-welcome-step summary::-webkit-details-marker { display: none; }
.learner-welcome-step summary:hover { background: #f8fafc; }
.learner-welcome-step .learner-welcome-step-number {
  position: static;
  width: 38px;
  height: 38px;
}
.learner-welcome-step-heading strong {
  display: block;
  color: #0f172a;
  font-size: 1.08rem;
}
.learner-welcome-step-heading small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.5;
}
.learner-welcome-step[open] .learner-welcome-expand-label { font-size: 0; }
.learner-welcome-step[open] .learner-welcome-expand-label::before {
  content: "Hide";
  font-size: 0.78rem;
}
.learner-welcome-step-content {
  padding: 22px;
  border-top: 1px solid #e2e8f0;
}
.learner-welcome-step-content > p {
  max-width: 76ch;
  margin: 0 auto 20px;
  color: #475569;
  font-size: 1.02rem;
  line-height: 1.7;
  text-align: center;
}

.learner-welcome-composite {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #94a3b8;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  cursor: zoom-in;
}
.learner-welcome-composite-base {
  display: block;
  width: 100%;
  height: auto;
}
.learner-welcome-zoom-inset {
  position: absolute;
  right: 3%;
  bottom: 6%;
  width: 40%;
  padding: 8px;
  border: 5px solid #fff;
  border-radius: 12px;
  background: white;
  box-shadow: 0 9px 24px rgba(15, 23, 42, 0.32);
  transform: rotate(-1deg);
}
.learner-welcome-zoom-inset img { display: block; width: 100%; height: auto; border-radius: 6px; }
.learner-welcome-zoom-inset > span {
  display: block;
  padding: 6px 2px 1px;
  color: #334155;
  font-size: clamp(0.68rem, 1.4vw, 0.9rem);
  font-weight: 800;
}
.learner-welcome-zoom-inset-left {
  left: 3%;
  right: auto;
}
.learner-welcome-inset-marking {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.learner-welcome-inset-marking circle,
.learner-welcome-inset-marking path {
  fill: none;
  stroke: #dc2626;
  stroke-width: 4;
  stroke-linecap: round;
}
.learner-welcome-expand-image {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
}

.learner-welcome-route-label {
  position: absolute;
  left: 3%;
  top: 5%;
  padding: 8px 12px;
  border: 2px solid #dc2626;
  border-radius: 9px;
  background: rgba(255,255,255,0.94);
  color: #991b1b;
  font-size: clamp(0.7rem, 1.6vw, 1rem);
  font-weight: 900;
}
.learner-welcome-route-connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.learner-welcome-route-connectors > path {
  fill: none;
  stroke: #dc2626;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.learner-welcome-route-connectors marker path {
  fill: #dc2626;
  stroke: none;
}
.learner-welcome-route-callout {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: 25%;
  min-height: 17%;
  padding: 0 12px 11px;
  overflow: hidden;
  border: 3px solid #dc2626;
  border-radius: 10px;
  background: rgba(255,255,255,0.96);
  color: #7f1d1d;
  box-shadow: 0 5px 14px rgba(15,23,42,0.18);
  transform: rotate(-2deg);
  text-align: left;
}
.learner-welcome-route-screen-bar {
  margin: 0 -12px 8px;
  padding: 5px 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: clamp(0.56rem, 1vw, 0.76rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.learner-welcome-route-callout strong { font-size: clamp(0.72rem, 1.5vw, 1.05rem); }
.learner-welcome-route-callout small {
  margin-top: 4px;
  color: #334155;
  font-size: clamp(0.56rem, 1.1vw, 0.82rem);
  line-height: 1.35;
}
.learner-welcome-route-callout-1 { left: 3%; top: 49%; }
.learner-welcome-route-callout-2 { left: 37%; top: 63%; transform: rotate(1deg); }
.learner-welcome-route-callout-3 { right: 3%; top: 48%; }

.learner-welcome-lightbox {
  width: min(1400px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  padding: 48px 18px 18px;
  border: 0;
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 25px 80px rgba(0,0,0,0.45);
}
.learner-welcome-lightbox::backdrop { background: rgba(15,23,42,0.82); }
.learner-welcome-lightbox-close {
  position: absolute;
  top: 6px;
  right: 12px;
  margin: 0;
  padding: 3px 12px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 2rem;
  line-height: 1;
}
.learner-welcome-lightbox-content .learner-welcome-composite {
  max-height: calc(100vh - 110px);
  overflow: auto;
  cursor: default;
}
.learner-welcome-lightbox-content .learner-welcome-composite-base { min-width: 900px; }
.learner-welcome-lightbox-content .learner-welcome-expand-image { display: none; }
.learner-welcome-method-note h2,
.learner-welcome-media-copy h2 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 1.12rem;
}
.learner-welcome-method-note p,
.learner-welcome-media-copy p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}
.learner-welcome-media-stories {
  display: grid;
  gap: 22px;
  margin-top: 38px;
}
.learner-welcome-media-story {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1.3fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
  border: 1px solid #dbe3ed;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.learner-welcome-media-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.learner-welcome-media-pair.learner-welcome-media-single { grid-template-columns: 1fr; }
.learner-welcome-media-pair a {
  display: block;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.learner-welcome-media-pair img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: contain;
  background: white;
}
.learner-welcome-card-link { margin-top: 14px !important; }
.learner-welcome-card-link a { color: #1d4ed8; font-weight: 800; }

.learner-welcome-note {
  max-width: 76ch;
  margin: 28px auto 0;
  padding: 17px 20px;
  border-radius: 12px;
  background: #eef2ff;
  color: #3730a3;
  line-height: 1.6;
  text-align: center;
}

.learner-welcome-reading-list {
  display: grid;
  gap: 15px;
  max-width: 960px;
  margin: 0 auto;
}
.learner-welcome-reading-group {
  border: 1px solid #dbe3ed;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.learner-welcome-reading-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  cursor: pointer;
  list-style: none;
}
.learner-welcome-reading-group summary::-webkit-details-marker { display: none; }
.learner-welcome-reading-group summary:hover { background: #f8fafc; }
.learner-welcome-reading-group summary strong {
  display: block;
  color: #0f172a;
  font-size: 1.08rem;
}
.learner-welcome-reading-group summary small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.5;
}
.learner-welcome-expand-label {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
}
.learner-welcome-reading-group[open] .learner-welcome-expand-label::before { content: "Hide"; }
.learner-welcome-reading-group[open] .learner-welcome-expand-label { font-size: 0; }
.learner-welcome-reading-group[open] .learner-welcome-expand-label::before { font-size: 0.78rem; }
.learner-welcome-reading-content {
  padding: 0 24px 24px;
  border-top: 1px solid #e2e8f0;
  color: #475569;
  line-height: 1.65;
}
.learner-welcome-reading-content > p:first-child { margin-top: 20px; }
.learner-welcome-reference-list {
  display: grid;
  gap: 18px;
  margin: 20px 0 0;
  padding-left: 26px;
}
.learner-welcome-reference-list li { padding-left: 6px; }
.learner-welcome-citation { margin: 0; padding-left: 2em; text-indent: -2em; }
.learner-welcome-citation a,
.learner-welcome-reference-link a { color: #1d4ed8; overflow-wrap: anywhere; }
.learner-welcome-reference-link { margin: 8px 0 0; }
.learner-welcome-reference-note {
  margin: 10px 0 0;
  padding: 11px 13px;
  border-radius: 9px;
  background: #fff7ed;
  color: #9a3412;
}
.learner-welcome-reference-relevance {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-left: 4px solid #0f766e;
  border-radius: 4px 10px 10px 4px;
  background: #ecfdf5;
  color: #28544d;
}
.learner-welcome-empty-reference {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-style: italic;
}

.learner-welcome-draft-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.learner-welcome-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding: 18px clamp(18px, 4vw, 56px);
  border-top: 1px solid #dbe3ed;
  background: rgba(255, 255, 255, 0.72);
  color: #64748b;
  font-size: 0.85rem;
}

.learner-welcome-main .learner-catalogue-card { width: 100%; }
.learner-welcome-main .learner-catalogue-form {
  padding: 22px;
  border: 1px solid #dbe3ed;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.learner-welcome-main .learner-activity-grid { max-height: 620px; }

@media (max-width: 1080px) {
  .learner-welcome-topbar { flex-wrap: wrap; gap: 10px 18px; }
  .learner-welcome-menu-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
  .learner-welcome-menu {
    display: none;
    flex: 1 0 100%;
    align-items: stretch;
    flex-direction: column;
    padding: 8px 0 4px;
  }
  .learner-welcome-menu.learner-welcome-menu-open { display: flex; }
  .learner-welcome-menu button { text-align: left; }
  .learner-welcome-media-story { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .learner-welcome-main { width: min(100% - 26px, 1180px); padding: 38px 0 52px; }
  .learner-welcome-brand small { display: none; }
  .learner-welcome-card-grid { grid-template-columns: 1fr; }
  .learner-welcome-method-steps .learner-welcome-info-card:last-child:nth-child(odd) { grid-column: auto; }
  .learner-welcome-info-card { padding: 21px; }
  .learner-welcome-steps .learner-welcome-info-card { padding-left: 68px; }
  .learner-welcome-media-story { padding: 18px; }
  .learner-welcome-media-pair { grid-template-columns: 1fr; }
  .learner-welcome-media-pair img { height: auto; max-height: 320px; }
  .learner-welcome-step-number { top: 21px; left: 19px; }
  .learner-welcome-footer { align-items: flex-start; flex-direction: column; }
  .learner-welcome-reading-group summary { align-items: flex-start; padding: 19px; }
  .learner-welcome-reading-content { padding: 0 19px 20px; }
  .learner-welcome-citation { padding-left: 0; text-indent: 0; }
  .learner-welcome-step summary { grid-template-columns: 40px minmax(0, 1fr); padding: 17px; }
  .learner-welcome-step summary .learner-welcome-expand-label { display: none; }
  .learner-welcome-step-content { padding: 16px; }
  .learner-welcome-zoom-inset { width: 46%; right: 2%; bottom: 3%; padding: 4px; border-width: 3px; }
  .learner-welcome-route-callout { display: none; }
  .learner-welcome-lightbox { width: calc(100vw - 18px); max-height: calc(100vh - 18px); }
}

.learner-catalogue-card { width: min(1180px, 100%); text-align: left; }
.learner-catalogue-card > h1,
.learner-catalogue-card > .learner-start-eyebrow,
.learner-catalogue-card > .learner-start-description { text-align: center; }
.learner-catalogue-initial {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 18px; width: min(720px, 100%); margin: 0 auto 28px;
}
.learner-catalogue-stage-choice { display: grid; gap: 7px; min-width: 0; }
.learner-catalogue-choice-label { color: #334155; font-weight: 700; }
.learner-catalogue-initial .learner-key-stage-tabs { width: 100%; margin: 0; }
.learner-catalogue-initial .learner-catalogue-field { min-width: 0; }
.learner-catalogue-initial select { min-width: 0; box-sizing: border-box; }
@media (max-width: 850px) {
  .learner-catalogue-initial { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
.learner-key-stage-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  width: min(720px, 100%); margin: 0 auto 24px; padding: 5px; box-sizing: border-box;
  border: 1px solid #bfdbfe; border-radius: 13px; background: #eff6ff;
}
.learner-key-stage-tab {
  min-height: 46px; margin: 0; padding: 9px 14px; border: 1px solid transparent;
  border-radius: 9px; background: transparent; color: #1e3a8a; font: inherit; font-weight: 800;
  cursor: pointer;
}
.learner-key-stage-tab:hover { background: #dbeafe; }
.learner-key-stage-tab-active,
.learner-key-stage-tab-active:hover {
  border-color: #2563eb; background: #2563eb; color: white;
  box-shadow: 0 3px 9px rgba(37, 99, 235, 0.22);
}
.learner-key-stage-tab:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.learner-catalogue-layout { display: grid; grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); gap: 32px; align-items: start; }
.learner-catalogue-form { display: grid; grid-template-columns: 1fr; gap: 14px; }
.learner-catalogue-field { display: grid; gap: 7px; color: #334155; font-weight: 700; }
.learner-catalogue-field select {
  width: 100%; padding: 11px 12px; border: 1px solid #94a3b8; border-radius: 8px;
  background: white; color: #0f172a; font: inherit;
}
.learner-catalogue-field select:disabled { background: #f1f5f9; color: #64748b; }
.learner-catalogue-description,
.learner-catalogue-error,
.learner-catalogue-form .learner-start-button { grid-column: 1 / -1; }
.learner-catalogue-description {
  min-height: 1.5em; margin: 0; color: #475569; line-height: 1.5; text-align: center;
}
.tester-start-details {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.tester-start-details h2 { margin-top: 0; }
.tester-start-details p { line-height: 1.5; }
.tester-start-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.tester-start-fields label {
  display: grid;
  min-width: 0;
  gap: 7px;
}
.tester-start-fields label[hidden] { display: none; }
.tester-start-fields input,
.tester-start-fields select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
.tester-start-fields small { color: #475569; font-weight: 400; }
.tester-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  font-weight: 600;
}
.tester-consent input { margin-top: 3px; }
@media (max-width: 650px) {
  .learner-key-stage-tabs { gap: 4px; padding: 4px; }
  .learner-key-stage-tab { min-height: 44px; padding: 7px 5px; font-size: 0.88rem; }
  .tester-start-fields { grid-template-columns: 1fr; }
}
.learner-catalogue-error {
  min-height: 1.5em; margin: -10px 0 0; color: #b91c1c; font-weight: 700; text-align: center;
}
.learner-catalogue-form .learner-start-button { justify-self: center; }

.tree-activity-welcome-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: clamp(22px, 5vw, 64px);
  background:
    radial-gradient(circle at 12% 16%, rgba(37, 99, 235, 0.12), transparent 26rem),
    radial-gradient(circle at 88% 28%, rgba(15, 118, 110, 0.10), transparent 28rem),
    #f8fafc;
}
.tree-activity-welcome-card {
  width: min(960px, 100%);
  padding: clamp(26px, 5vw, 52px);
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
}
.tree-activity-welcome-card > h1 {
  margin: 8px 0 12px;
  color: #0f172a;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  text-align: center;
}
.tree-activity-welcome-card > .learner-start-eyebrow { text-align: center; }
.tree-activity-welcome-description {
  max-width: 68ch;
  margin: 0 auto 28px;
  color: #475569;
  font-size: 1.08rem;
  line-height: 1.65;
  text-align: center;
}
.tree-activity-welcome-grid,
.tree-activity-about-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.tree-activity-information-block {
  min-width: 0;
  padding: 17px 19px;
  border: 1px solid #dbe3ed;
  border-radius: 13px;
  background: #f8fafc;
}
.tree-activity-information-block h3 {
  margin: 0 0 7px;
  color: #1e3a5f;
  font-size: 0.92rem;
}
.tree-activity-information-collapsible summary {
  cursor: pointer;
  color: #1e3a5f;
  font-size: 0.92rem;
  font-weight: 700;
}
.tree-activity-information-collapsible[open] summary { margin-bottom: 7px; }
.tree-activity-information-block p {
  margin: 0;
  color: #475569;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.tree-activity-publication-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin: 22px 0;
  color: #64748b;
  font-size: 0.9rem;
}
.tree-activity-publication-meta strong { color: #334155; }
.tree-activity-about {
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}
.tree-activity-about summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  color: #1e3a8a;
  font-weight: 800;
}
.tree-activity-about summary small { color: #475569; font-weight: 500; }
.tree-activity-about-content {
  padding: 18px;
  border-top: 1px solid #bfdbfe;
  background: white;
}
.tree-activity-welcome-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.tree-activity-welcome-actions .learner-start-button { margin: 0; }

@media (max-width: 650px) {
  .tree-activity-welcome-grid,
  .tree-activity-about-content { grid-template-columns: 1fr; }
  .tree-activity-about summary { align-items: flex-start; flex-direction: column; gap: 3px; }
}

.learner-activity-overview { min-width: 0; }
.learner-activity-overview h2 { margin: 0 0 4px; color: #0f172a; text-align: center; }
.learner-activity-overview > p { margin: 0 0 18px; color: #64748b; text-align: center; }
.learner-activity-grid { display: grid; grid-template-columns: 1fr; gap: 8px; max-height: 520px; padding-right: 6px; overflow-y: auto; }
.learner-activity-card {
  display: grid; gap: 5px; padding: 11px 13px; border: 1px solid #93c5fd; border-radius: 10px;
  background: #eff6ff; color: #0f172a; font: inherit; text-align: left; cursor: pointer;
}
.learner-activity-card:hover:not(:disabled) { border-color: #2563eb; background: #dbeafe; }
.learner-activity-card:disabled { cursor: default; opacity: 0.42; }
.learner-activity-card-coming-soon:disabled { opacity: 0.62; background: #f1f5f9; border-color: #cbd5e1; }
.learner-activity-card-subtopic-badge {
  justify-self: start; max-width: 100%; box-sizing: border-box; padding: 4px 8px;
  border-radius: 6px; background: #e0e7ff; color: #312e81;
  font-size: 0.82rem; line-height: 1.35; font-weight: 800; overflow-wrap: anywhere;
}
.learner-selected-subtopic {
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: #eef2ff; color: #312e81; font-weight: 700; line-height: 1.4;
  overflow-wrap: anywhere;
}
.learner-activity-card-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.learner-activity-category {
  padding: 3px 8px; border-radius: 6px; background: #e2e8f0; color: #475569;
  font-size: 0.75rem; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.learner-catalogue-empty-results { color: #475569; line-height: 1.5; }
.learner-activity-card-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.04rem; font-weight: 800; }
.learner-activity-card-description {
  display: -webkit-box; overflow: hidden; color: #475569; line-height: 1.35;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.learner-activity-card-meta { display: grid; gap: 2px; color: #64748b; font-size: 0.8rem; line-height: 1.35; }
.learner-activity-card-topic {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 500;
}
.learner-activity-card-topic-text { min-width: 0; overflow-wrap: anywhere; }
.learner-activity-card-score {
  flex: 0 0 auto; font-size: 0.78rem; font-weight: 400; white-space: nowrap;
}
.learner-activity-card-subtopic { position: relative; padding-left: 18px; }
.learner-activity-card-subtopic::before { content: "↳"; position: absolute; left: 3px; color: #94a3b8; }
.learner-activity-badge {
  flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; background: #e2e8f0;
  color: #475569; font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
}

@media (max-width: 850px) {
  .learner-key-stage-tabs { margin-bottom: 18px; }
  .learner-catalogue-layout { grid-template-columns: 1fr; }
  .learner-activity-overview { margin-top: 16px; padding-top: 24px; border-top: 1px solid #cbd5e1; }
}

.tester-question-feedback {
  margin-top: 26px;
  text-align: left;
  width: min(720px, 100%); margin: 28px auto 0; padding-top: 24px;
  border-top: 1px solid #cbd5e1;
}

.tester-feedback-node-setting {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}
.learner-checkpoint-setting {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px;
  border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff;
}
.learner-checkpoint-setting input { margin-top: 3px; }
.learner-checkpoint-setting small { color: #475569; font-weight: 400; }
.learner-checkpoint-name-setting {
  display: grid; gap: 6px; margin: 9px 0 0 30px; font-weight: 700;
}
.learner-checkpoint-name-setting[hidden] { display: none; }
.learner-checkpoint-name-setting input { width: 100%; box-sizing: border-box; }
.learner-score-setting { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; }
.learner-score-setting > label { display: flex; align-items: flex-start; gap: 9px; }
.learner-score-setting > label input { margin-top: 3px; }
.learner-score-setting small { color: #475569; font-weight: 400; }
.learner-score-setting > div { display: grid; gap: 9px; margin: 10px 0 0 30px; }
.learner-score-setting > div[hidden] { display: none; }
.learner-score-setting > div label { display: grid; gap: 5px; font-weight: 700; }
.learner-score-setting > div input { width: 100%; box-sizing: border-box; }
.tester-feedback-node-setting input { margin-top: 3px; }
.tester-feedback-node-setting small { color: #475569; font-weight: 400; }
.tester-feedback-node-condition {
  margin: 8px 0 0 30px;
  color: #334155;
}
.tester-feedback-node-condition label { display: flex; gap: 7px; align-items: center; margin-top: 7px; }
.tester-review-question {
  display: grid;
  gap: 5px;
  margin: 12px 0 20px;
  padding: 12px 14px;
  border-left: 4px solid #64748b;
  background: #f8fafc;
  color: #1e293b;
}
.tester-rating {
  display: grid; grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr);
  gap: 12px; align-items: center; margin: 14px 0; padding: 12px;
  border: 1px solid #cbd5e1; border-radius: 10px;
}
.tester-rating legend { padding: 0 6px; color: #0f172a; font-weight: 700; }
.tester-rating > span:last-child { text-align: right; }
.tester-rating-options { display: flex; gap: 7px; }
.tester-rating-options label { cursor: pointer; }
.tester-rating-options input { position: absolute; opacity: 0; }
.tester-rating-options span {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid #94a3b8; border-radius: 50%; background: white;
}
.tester-rating-options input:checked + span { border-color: #2563eb; background: #2563eb; color: white; }
.tester-rating-options input:focus-visible + span { outline: 3px solid #93c5fd; outline-offset: 2px; }
.tester-issue-tags { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 18px 0; padding: 14px; border: 1px solid #cbd5e1; border-radius: 10px; }
.tester-issue-tags legend { padding: 0 6px; font-weight: 700; }
.tester-issue-tags label { display: flex; gap: 6px; align-items: center; }
.learner-completion-shell {
  min-height: 100vh; display: grid; place-items: center; box-sizing: border-box;
  padding: clamp(20px, 5vw, 56px); background: #f8fafc;
}
.learner-completion-card {
  width: min(760px, 100%); box-sizing: border-box; padding: clamp(26px, 5vw, 48px);
  border: 1px solid #cbd5e1; border-radius: 20px; background: white;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.11);
}
.learner-completion-card > h1,
.learner-completion-card > .learner-start-eyebrow { text-align: center; }
.learner-completion-card > h1 { margin: 8px 0 14px; color: #166534; font-size: clamp(2rem, 5vw, 3rem); }
.learner-completion-message { margin: 0 auto 22px; color: #475569; line-height: 1.6; text-align: center; }
.learner-completion-objectives,
.learner-completion-next { padding: 18px 20px; border-radius: 13px; }
.learner-completion-objectives { border: 1px solid #bbf7d0; background: #f0fdf4; }
.learner-completion-objectives h2 { margin: 0 0 8px; color: #166534; font-size: 1rem; }
.learner-completion-objectives p { margin: 0; color: #334155; line-height: 1.55; white-space: pre-line; }
.learner-completion-next { display: grid; gap: 5px; margin-top: 16px; border: 1px solid #bfdbfe; background: #eff6ff; }
.learner-completion-next > span { color: #1e3a8a; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.learner-completion-next > strong { color: #0f172a; font-size: 1.08rem; }
.learner-completion-next p, .learner-completion-next small { margin: 0; color: #475569; line-height: 1.45; }
.learner-completion-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.learner-completion-actions button { margin: 0; }
.learner-completion-card [data-completion-error] { margin-top: 14px; }
.tester-comment, .tester-final-card form > label { display: grid; gap: 7px; margin: 16px 0; font-weight: 700; }
.tester-final-card select, .tester-final-card input[type="email"] { padding: 10px; border: 1px solid #94a3b8; border-radius: 8px; background: white; font: inherit; }
.tester-final-card label small { font-weight: 400; color: #475569; }
.tester-close-report { padding: 9px 16px; border: 1px solid #94a3b8; border-radius: 8px; background: white; cursor: pointer; }
.tester-comment textarea, .tester-final-card textarea { width: 100%; padding: 10px; box-sizing: border-box; border: 1px solid #94a3b8; border-radius: 8px; font: inherit; }
.tester-final-shell { min-height: calc(100vh - 40px); display: grid; place-items: center; padding: 20px; background: #f8fafc; box-sizing: border-box; }
.tester-final-card { width: min(780px, 100%); padding: clamp(24px, 5vw, 48px); border: 1px solid #cbd5e1; border-radius: 18px; background: white; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1); }
.tester-final-card > h2, .tester-final-card > .learner-start-eyebrow { text-align: center; }
.tester-final-card .learner-start-button { display: block; margin: 28px auto 0; }
.tester-path-summary { max-height: 280px; overflow-y: auto; color: #475569; line-height: 1.6; }
.tester-report-actions { display: grid; justify-items: center; gap: 12px; margin-top: 28px; }
.tester-report-actions .learner-start-button { margin: 0; }
.tester-optional-backup { color: #475569; text-align: center; }
.tester-optional-backup summary { cursor: pointer; }
.tester-optional-backup .tester-json-download { display: block; margin: 10px auto 0; }
.tester-json-download { border: 0; background: transparent; color: #2563eb; text-decoration: underline; cursor: pointer; font: inherit; }

@media (max-width: 650px) {
  .tester-rating { grid-template-columns: 1fr; text-align: center; }
  .tester-rating > span:last-child { text-align: center; }
  .tester-rating-options { justify-content: center; }
}

/* =====================================================
   Inspector media controls
   ===================================================== */

.inspector-media-editor {
  width: 100%;
  margin-bottom: 10px;
}

.inspector-media-folder-editor {
  width: 100%;
  padding: 9px;
  box-sizing: border-box;
  border: 1px solid #d7dce2;
  border-radius: 5px;
  background: #f7f9fb;
}

.inspector-media-folder-editor summary {
  cursor: pointer;
  font-weight: 700;
}

.inspector-media-folder-editor[open] summary {
  margin-bottom: 8px;
}

.inspector-media-folder-editor label {
  display: block;
}

.inspector-media-folder-editor small {
  display: block;
  margin-top: 5px;
  color: #59636e;
  line-height: 1.35;
}

.inspector-media-path {
  width: 100%;
  margin-top: 6px;
  padding: 6px;

  box-sizing: border-box;
}

.inspector-media-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 6px;
  margin-top: 7px;
}

.inspector-media-controls select {
  flex: 1 1 110px;
  min-width: 0;
  padding: 5px;
}

.inspector-media-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 9px;

  border: 1px solid #888;
  border-radius: 4px;

  background: #f4f4f4;
  cursor: pointer;

  font-size: 0.85rem;
}

.inspector-media-file-button:hover {
  background: #e8e8e8;
}

.inspector-media-file-button input {
  display: none;
}

.inspector-media-remove {
  margin: 0;
  padding: 6px 9px;

  font-size: 0.85rem;
}

.inspector-media-preview-box {
  width: 100%;
  margin-top: 8px;

  text-align: center;
}

.inspector-media-preview {
  display: block;

  max-width: 100%;
  max-height: 150px;

  width: auto;
  height: auto;

  margin: 0 auto;

  object-fit: contain;

  border: 1px solid #ddd;
  border-radius: 4px;
}

.inspector-youtube-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: none;
  border: 0;
}

/* =====================================================
   Collapsible inspector sections
   ===================================================== */

.inspector-subpanel {
  width: 100%;

  margin: 8px 0 12px;
  padding: 0;

  border: 1px solid #d4d4d4;
  border-radius: 6px;

  background: #fafafa;
  box-sizing: border-box;
}

.inspector-subpanel > summary {
  padding: 8px 10px;

  cursor: pointer;
  user-select: none;

  border-radius: 6px;
}

.inspector-subpanel > summary:hover {
  background: #f0f0f0;
}

.inspector-subpanel[open] > summary {
  border-bottom: 1px solid #d4d4d4;
  border-radius: 6px 6px 0 0;

  background: #f4f7fb;
}

.inspector-subpanel-body {
  padding: 10px;
}

/* =====================================================
   Collapsible answer editor cards
   ===================================================== */

.answer-editor-card {
  width: 100%;

  margin: 12px 0;
  border: 1px solid #b8c5d6;
  border-radius: 7px;

  background: white;
  box-sizing: border-box;
}

.answer-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  padding: 11px 12px;

  cursor: pointer;
  user-select: none;

  font-size: 1rem;
  font-weight: 700;

  background: #f3f7fc;
  border-radius: 7px;
}

.answer-editor-summary:hover {
  background: #e8f0fa;
}

.answer-editor-card[open] > .answer-editor-summary {
  border-bottom: 1px solid #b8c5d6;
  border-radius: 7px 7px 0 0;
}

.answer-correct-setting {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
  border: 1px solid #bbf7d0; border-radius: 8px; background: #f0fdf4;
}
.answer-correct-setting input { margin-top: 3px; }
.answer-correct-setting small { color: #475569; font-weight: 400; }

.answer-editor-body {
  padding: 12px;
}

.answer-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.answer-unfinished-dot {
  background: #e53935;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.unfinished-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
  font-size: 0.92rem;
  color: #b42318;
}

.unfinished-toggle input {
  margin: 0;
}

.nodeVideo {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: calc(100vh - 260px);

  margin: 8px auto 12px;

  object-fit: contain;

  background: black;
}

.nodeYouTubeVideo {
  display: block;
  width: min(100%, 720px);
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 8px auto 12px;
  border: 0;
  background: black;
}

/* =====================================================
   Incoming-link badge and query panel
   ===================================================== */

.graph-node-incoming-badge {
  position: absolute;
  left: -13px;
  top: 50%;
  transform: translateY(-50%);

  min-width: 22px;
  height: 22px;
  padding: 0 5px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;
  border: 2px solid white;
  border-radius: 999px;

  background: #6d28d9;
  color: white;

  font-size: 11px;
  font-weight: 700;
  line-height: 1;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.incoming-links-panel {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 50;

  width: min(340px, calc(100vw - 40px));
  max-height: min(420px, calc(100vh - 120px));

  border: 1px solid #8f96a3;
  border-radius: 8px;

  background: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);

  overflow: hidden;
}

.incoming-links-panel > summary {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 10px 12px;
  cursor: pointer;
  user-select: none;

  background: #f5f3ff;
  font-weight: 700;
}

.incoming-links-panel > summary:hover {
  background: #ede9fe;
}

.incoming-links-summary-count {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;
  border-radius: 999px;
  background: #6d28d9;
  color: white;
  font-size: 12px;
}

.incoming-links-panel-body {
  max-height: 350px;
  padding: 10px;
  overflow-y: auto;
  box-sizing: border-box;
}

.incoming-links-target {
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
  font-size: 0.88rem;
  color: #555;
}

.incoming-links-empty {
  margin: 6px 2px;
  color: #666;
  font-size: 0.9rem;
}

.incoming-link-entry {
  width: 100%;
  margin: 0 0 8px;
  padding: 9px 10px;

  display: block;
  box-sizing: border-box;

  border: 1px solid #d1d5db;
  border-left: 4px solid #4b5563;
  border-radius: 6px;

  background: #fff;
  color: #222;
  text-align: left;
}

.incoming-link-entry:hover {
  background: #f8fafc;
}

.incoming-link-backlink {
  border-left-color: #d97706;
}

.incoming-link-detour {
  border-left-color: #2563eb;
}

.incoming-link-crosslink {
  border-left-color: #0891b2;
}

.incoming-link-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.incoming-link-type {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
}

.incoming-link-answer-label {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
}

.incoming-link-answer-text {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #555;
  overflow-wrap: anywhere;
}

.incoming-link-answer-empty {
  font-style: italic;
  color: #888;
}

/* =====================================================
   Teacher Studio command menus
   ===================================================== */

#teacherToolbar {
  position: sticky;
  top: 0;
  z-index: 1800;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 48px;
  padding: 6px 10px;
  box-sizing: border-box;
  border-bottom: 1px solid #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.teacher-toolbar-title {
  margin: 0 10px 0 2px;
  color: #0f172a;
  font-size: 0.95rem;
  white-space: nowrap;
}

.teacher-menu {
  position: relative;
}

.teacher-menu > summary {
  list-style: none;
  padding: 8px 11px;
  border-radius: 6px;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
}

.teacher-menu > summary::-webkit-details-marker {
  display: none;
}

.teacher-menu > summary::after {
  content: " �";
  color: #64748b;
  font-size: 0.75rem;
}

.teacher-menu[open] > summary,
.teacher-menu > summary:hover {
  background: #e2e8f0;
}

.teacher-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1900;
  display: grid;
  gap: 3px;
  min-width: 230px;
  padding: 7px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.2);
}

.teacher-menu-panel button {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #1e293b;
  font: inherit;
  text-align: left;
}

.teacher-menu-panel button:hover {
  background: #eff6ff;
}

.teacher-menu-panel .teacher-menu-item-active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}

.teacher-menu-status {
  display: block;
  margin: 3px 0;
  padding: 8px 10px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.teacher-menu-section-label {
  display: block;
  margin: 7px 10px 0;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.teacher-menu-quality {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  color: #334155;
  font-size: 0.85rem;
}

.teacher-menu-quality select {
  min-width: 64px;
  padding: 4px;
}

.teacher-recovery-panel {
  right: 0;
  left: auto;
  min-width: 250px;
}

#teacherToolbar #localRecoveryStatus {
  width: auto;
  min-height: 0;
  justify-content: flex-start;
  padding: 8px 10px;
  text-align: left;
}

#teacherToolbar .graph-question-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-left: auto;
  padding: 0 6px;
  color: #334155;
  font-size: 0.86rem;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .teacher-toolbar-title {
    width: 100%;
  }

  #teacherToolbar .graph-question-toggle {
    margin-left: 0;
  }

  .teacher-menu-panel {
    min-width: min(260px, calc(100vw - 24px));
  }
}

/* =====================================================
   Compact editor toolbar
   ===================================================== */

#editorToolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 6px;

  width: calc(100vw - 370px);
  min-height: 42px;

  padding: 6px 0;

  box-sizing: border-box;
}

#editorToolbar button {
  min-height: 34px;

  margin: 0;
  padding: 6px 10px;

  white-space: nowrap;
}

#editorToolbar #fileInput {
  width: 215px;
  max-width: 215px;

  font-size: 0.86rem;
}

#editorToolbar .graph-question-toggle {
  min-height: 34px;

  margin: 0;
  padding: 0 6px;

  box-sizing: border-box;
}

#clearLocalRecoveryButton {
  margin: 0;
}

#localRecoveryStatus {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 84px;
  min-height: 34px;

  padding: 3px 6px;

  border: 1px solid #b8c5d6;
  border-radius: 5px;

  box-sizing: border-box;

  background: #f5f9ff;
  color: #3f4d5f;

  font-size: 0.76rem;
  line-height: 1.1;
  text-align: center;

  white-space: pre-line;
}

@media (max-width: 850px) {
  #editorToolbar {
    width: 100%;
  }
}

/* =====================================================
   Preview from selected node
   ===================================================== */

.inspector-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.preview-from-node-button {
  font-weight: 600;
}

.preview-setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: grid;
  place-items: center;

  padding: 20px;
  box-sizing: border-box;

  background: rgba(0, 0, 0, 0.45);
}

.preview-setup-dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;

  padding: 22px;
  box-sizing: border-box;

  border-radius: 10px;
  background: white;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.25);
}

.preview-setup-dialog h2 {
  margin-top: 0;
}

.preview-setup-node {
  margin: 5px 0;
  overflow-wrap: anywhere;
}

.preview-setup-explanation {
  margin: 18px 0 8px;
  line-height: 1.45;
}

.preview-setup-warning {
  margin: 0 0 16px;
  font-size: 0.9rem;
  font-style: italic;
}

.preview-runtime-fields {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.preview-runtime-field {
  display: grid;
  grid-template-columns:
    minmax(130px, 1fr)
    minmax(180px, 2fr);

  align-items: center;
  gap: 12px;
}

.preview-runtime-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.preview-runtime-field input {
  width: 100%;
  box-sizing: border-box;
}

.preview-setup-empty {
  padding: 12px;
  border: 1px solid #d7e1ee;
  border-radius: 6px;
}

.preview-setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 600px) {
  .preview-runtime-field {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

.response-type-panel [hidden],
.short-answer-match-panel [hidden],
.short-answer-only[hidden],
.response-unit-toggle[hidden],
.short-answer-capture[hidden] {
  display: none !important;
}
.response-type-panel select,
.short-answer-match-panel select,
.short-answer-match-panel textarea,
.short-answer-match-panel input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.response-unit-toggle,
.short-answer-fallback-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.short-answer-capture {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.short-answer-capture input {
  width: 100%;
  box-sizing: border-box;
}

.short-answer-capture small {
  color: #59636e;
  line-height: 1.35;
}

.short-answer-match-panel {
  margin-bottom: 12px;
}

.short-answer-rule-criteria,
.numerical-response-only,
.text-response-only,
.short-answer-unit-only,
.match-value-fields,
.match-unit-alternatives {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.short-answer-range-row,
.short-answer-inclusive-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.short-answer-inclusive-row label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.short-answer-match-panel textarea {
  margin-top: 4px;
  resize: vertical;
}
.answer-assignments {
  margin: 8px 0 14px;
  padding: 10px;
  border: 1px solid #ccd4dd;
  border-radius: 6px;
  background: #f8fafc;
}

.answer-assignments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.node-variable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin: 7px 0;
}

.node-variable-row input {
  min-width: 0;
  box-sizing: border-box;
}

.answer-assignment-variable-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.answer-assignment-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
  gap: 6px;
  margin-top: 7px;
}

.answer-assignment-row input {
  min-width: 0;
  box-sizing: border-box;
}

.answer-assignments-empty {
  color: #666;
  font-style: italic;
}
.assignment-counter-help {
  margin-top: 6px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #555;
}
/* =====================================================
   Node tools panel and on-image ruler
   ===================================================== */

.node-tools-menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.node-tools-menu-row button {
  margin: 0;
}

.node-tools-menu-row span {
  color: #555;
  font-size: 0.85rem;
}

.node-tools-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.node-tools-panel {
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 10px;
  background: white;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.35);
}

.node-tools-panel-header,
.node-tools-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
}

.node-tools-panel-header {
  border-bottom: 1px solid #d7dce2;
}

.node-tools-panel-header h3 {
  margin: 0;
}

.node-tools-close {
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
}

.node-tools-panel-body {
  padding: 16px;
}

.node-tools-panel-actions {
  justify-content: flex-end;
  border-top: 1px solid #d7dce2;
}

.node-tools-panel-actions button {
  margin: 0;
}

.node-tools-enable-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ruler-tool-fields {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-left: 24px;
}

.ruler-tool-fields > label:not(.node-tools-enable-row) {
  display: grid;
  gap: 5px;
}

.ruler-tool-fields input[type="number"],
.ruler-tool-fields select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px;
}

.node-tools-fields-disabled {
  opacity: 0.5;
}

.node-tools-help {
  margin: 0;
  color: #555;
  font-size: 0.85rem;
  line-height: 1.4;
}

.node-media-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.node-media-stage > .nodeImage {
  margin: 0;
}

.screen-ruler {
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
  height: 44px;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.9);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.32);
  color: #111827;
  overflow: hidden;
  cursor: move;
  user-select: none;
  touch-action: none;
  transform-origin: center;
}

.screen-ruler-active {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.45);
}

.screen-ruler-scale {
  position: absolute;
  inset: 0 7px;
  pointer-events: none;
}

.screen-ruler-tick {
  position: absolute;
  top: 0;
  width: 1px;
  background: #111827;
  transform: translateX(-0.5px);
}

.ruler-tick-centimetre {
  height: 17px;
  width: 1.5px;
}

.ruler-tick-half-centimetre {
  height: 12px;
}

.ruler-tick-millimetre {
  height: 7px;
}

.screen-ruler-number {
  position: absolute;
  top: 19px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}

.screen-ruler-unit {
  position: absolute;
  bottom: 2px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.screen-ruler-rotate-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 1px solid #475569;
  border-radius: 50%;
  background: #f8fafc;
  color: #0f172a;
  font-size: 15px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.screen-ruler-rotate-handle:active {
  cursor: grabbing;
}
.short-answer-response {
  width: min(620px, 100%);
  margin: 24px auto;
}

.short-answer-response-fields {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(110px, 1fr);
  gap: 12px;
}

.short-answer-response-fields > label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-weight: 600;
}

.short-answer-response-fields input {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  font: inherit;
}

.short-answer-response-fields.short-answer-value-only {
  grid-template-columns: minmax(0, 1fr);
}

.short-answer-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.short-answer-value-row input {
  flex: 1;
  min-width: 0;
}

.short-answer-value-suffix {
  flex: none;
  white-space: nowrap;
}

.short-answer-response-fields input:focus {
  border-color: #2563eb;
  outline: 2px solid rgba(37, 99, 235, 0.2);
}

.short-answer-response-error {
  min-height: 1.5em;
  margin: 8px 0;
  color: #b91c1c;
  font-weight: 600;
}

.short-answer-submit {
  width: auto;
  min-width: 150px;
}

@media (max-width: 560px) {
  .short-answer-response-fields {
    grid-template-columns: 1fr;
  }
}

.editor-validation-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.editor-validation-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.editor-validation-report {
  padding: 28px 32px 12px;
}

.editor-validation-eyebrow {
  margin: 0;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.editor-validation-report h2 {
  margin: 6px 0 10px;
}

.editor-validation-status {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.validation-passed .editor-validation-status {
  background: #dcfce7;
  color: #166534;
}

.validation-failed .editor-validation-status {
  background: #fee2e2;
  color: #991b1b;
}

.editor-validation-section {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f8fafc;
}

.editor-validation-section h3,
.editor-validation-section p {
  margin: 0;
}

.editor-validation-section ol {
  margin-bottom: 0;
  padding-left: 24px;
}

.editor-validation-section li + li {
  margin-top: 8px;
}

.validation-errors {
  border-left: 4px solid #dc2626;
}

.validation-warnings {
  border-left: 4px solid #d97706;
}

.editor-validation-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 32px;
  border-top: 1px solid #e2e8f0;
  background: white;
}

.tester-reports-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 26px 30px 0;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}
.tester-reports-dialog::backdrop { background: rgba(15, 23, 42, 0.48); }
.tester-reports-dialog h2 { margin: 6px 0 18px; }
.tester-import-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tester-import-metrics > div { display: grid; gap: 3px; padding: 14px; border-radius: 9px; background: #eff6ff; text-align: center; }
.tester-import-metrics strong { color: #1d4ed8; font-size: 1.55rem; }
.tester-import-metrics span { color: #475569; font-size: 0.82rem; }
#testerReportsSummary section { margin-top: 24px; }
#testerReportsSummary h3 { margin-bottom: 9px; }
#testerReportsSummary table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
#testerReportsSummary th, #testerReportsSummary td { padding: 8px 10px; border: 1px solid #cbd5e1; text-align: left; }
#testerReportsSummary th { background: #f1f5f9; }
.tester-import-problems { padding: 12px 16px; border-left: 4px solid #dc2626; background: #fef2f2; }
.tester-import-problems h3 { margin-top: 0; color: #991b1b; }
.tester-import-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tester-issue-summary { margin: 0; padding: 0; list-style: none; }
.tester-issue-summary li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 9px; border-bottom: 1px solid #e2e8f0; }
.tester-reports-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; margin: 24px -30px 0; padding: 14px 30px; border-top: 1px solid #e2e8f0; background: white; }

@media (max-width: 700px) {
  .tester-import-metrics, .tester-import-split { grid-template-columns: 1fr; }
  #testerReportsSummary { overflow-x: auto; }
}

.publication-dialog {
  width: min(1500px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 28px 32px;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.new-tree-dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 28px 32px;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}
.new-tree-dialog::backdrop { background: rgba(15, 23, 42, 0.48); }
.new-tree-dialog label { display: grid; gap: 7px; margin: 18px 0; font-weight: 700; }
.new-tree-dialog input, .new-tree-dialog textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  font: inherit;
}

.publication-dialog::backdrop { background: rgba(15, 23, 42, 0.48); }
.publication-dialog h2 { margin: 6px 0 8px; }
.publication-introduction { margin: 0 0 20px; color: #475569; }

.publication-panel-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}
.publication-panel-section {
  min-width: 0;
  padding: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.publication-panel-section > h3 { margin: 0 0 16px; color: #0f172a; }
.publication-section-help {
  margin: -7px 0 16px;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.45;
}

.publication-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.publication-form-grid label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-weight: 600;
}

.publication-form-grid input,
.publication-form-grid select,
.publication-form-grid textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  box-sizing: border-box;
  font: inherit;
}

.publication-form-grid input[readonly] { background: #f1f5f9; color: #475569; }
.publication-wide-field { grid-column: 1 / -1; }
.publication-identity-help {
  margin: -4px 0 2px;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.45;
}

.publication-key-stages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 8px 10px 10px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
}

.publication-key-stages legend { padding: 0 4px; color: #334155; font-weight: 600; }
.publication-key-stages label { display: inline-flex; grid: none; align-items: center; gap: 5px; font-weight: 400; }
.publication-key-stages input { width: auto; margin: 0; }

.publication-message {
  min-height: 1.5em;
  margin: 18px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f1f5f9;
}

.publication-message-success { background: #dcfce7; color: #166534; }
.publication-message-warning { background: #fef3c7; color: #92400e; }
.publication-message-error { background: #fee2e2; color: #991b1b; }

.publication-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 650px) {
  .publication-panel-columns { grid-template-columns: 1fr; }
  .publication-form-grid { grid-template-columns: 1fr; }
  .publication-wide-field { grid-column: auto; }
}

/* Question arrivals own their scroll position, including while media loads. */
body:has(#app > .question-rich-text),
body:has(#app > .teaching-card) { overflow-anchor: none; }

.tester-quick-note{margin:14px 0;padding:10px 12px;border:1px solid #94a3b8;border-radius:6px;font-size:.9rem}.tester-quick-note summary{cursor:pointer}.tester-quick-note form{display:grid;gap:10px;margin-top:10px}.tester-quick-note label{display:grid;gap:5px}.tester-quick-note textarea,.tester-quick-note select{max-width:100%;box-sizing:border-box;font:inherit}.tester-quick-note button{justify-self:start;padding:8px 12px}.tester-quick-note [role="status"]:empty{display:none}

/* Optional select-before-submit choices. Selection carries no correctness colour. */
.answerButton.answer-choice-selected { border-color: #1d4ed8; box-shadow: 0 0 0 3px #bfdbfe; background: #eff6ff; }
.choice-submit-help { color: #475569; margin: 16px 0 10px; }
.choice-submit-button { display: block; margin: 18px 0; padding: 12px 24px; border: 2px solid #1d4ed8; border-radius: 8px; background: #1d4ed8; color: white; font: inherit; font-weight: 700; cursor: pointer; }
.choice-submit-button:disabled { opacity: .5; cursor: default; }
.choice-submit-button:focus-visible { outline: 3px solid #0f172a; outline-offset: 3px; }
.learner-score-setting > div .learner-score-visibility { display: flex; align-items: center; gap: 8px; }
.learner-score-setting > div .learner-score-visibility input { width: auto; }


/* Selective context titles and an automatically derived main-step count. */
.learner-node-heading { margin: 0 0 16px; }
.learner-node-title { margin: 0; color: #172554; font-size: 1.2rem; line-height: 1.3; }
.learner-node-subtitle { margin: 5px 0 0; color: #475569; font-size: 0.95rem; font-weight: 600; line-height: 1.35; }
.learner-progress-steps { display: grid; gap: 3px; margin: 10px 0; padding: 8px 10px; border: 1px solid #dbe3ef; border-radius: 9px; color: #334155; background: #f8fafc; font-size: 0.78rem; }
.learner-progress-steps strong { font-size: 1rem; }
@media (max-width: 700px) {
  .learner-progress-compact-steps { grid-column: 1 / span 2; font-size: 0.82rem; font-weight: 600; }
  .learner-progress-chevron { grid-row: 1 / span 2; }
}
@media (max-width: 430px) {
  .learner-progress-compact-steps { grid-column: 1; }
  .learner-progress-chevron { grid-row: 1 / span 3; }
}

/* Keep the shelf diagram compact while allowing it to shrink on phones. */
.nodeImage[src$="0625_m16_qp_12-q10-diagram.png"] {
  max-width: min(100%, 420px);
}

/* Teaching is a reading/activity card, with one navigation action. */
.teaching-card {
  box-sizing: border-box; width: 100%; max-width: 1050px; margin: 16px auto 24px;
  padding: clamp(18px, 3vw, 32px); border: 1px solid #99c7c0; border-top: 6px solid #257c70;
  border-radius: 16px; background: #f2f9f7; color: #183e38;
}
.teaching-card-label { margin: 0 0 14px; color: #226557; font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.teaching-card .question-rich-text { font-weight: 400; line-height: 1.6; }
.teaching-card .learner-node-title { color: #183e38; }
.teaching-card .nodeImage, .teaching-card .youtube-media { display: block; margin-inline: auto; max-width: 100%; }
.teaching-card-navigation { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid #c9e1dc; }
.teaching-continue { margin: 0; min-height: 46px; padding: 12px 22px; border: 1px solid #226557; border-radius: 9px; background: #226557; color: white; font: inherit; font-weight: 700; }
.teaching-continue:hover { background: #174d42; }
.teaching-continue:focus-visible { outline: 3px solid #0f172a; outline-offset: 3px; }
.teaching-continue:disabled { opacity: .5; cursor: default; }
.teaching-answer-content { margin: 16px 0; line-height: 1.6; }
.teaching-feedback .learner-answer-review, .teaching-feedback .learner-feedback-primary { border-color: #99c7c0; background: #f2f9f7; }
@media (max-width: 700px) { .teaching-card-navigation .teaching-continue { width: 100%; } }

/* Readable choices and read-only access to completed learning steps. */
.answerButton { font-size: 1rem; line-height: 1.45; min-height: 48px; }
.answerOptions.answer-options-long { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.answer-options-long .answerButton { width: 100%; margin: 0; }
@media (min-width: 701px) { .answerOptions.answer-options-three:not(.answer-options-navigation) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.skydiver-setup [data-skydiver-choice] { display: block; margin: 12px 0; padding: 12px; border: 2px solid #94a3b8; background: #f8fafc; font-weight: 700; }
.skydiver-setup[data-prediction-set="false"] [data-skydiver-slider] { opacity: .45; }
.learner-review-notes { margin: 22px 0; padding: 14px 18px; border: 1px solid #99c7c0; border-radius: 10px; background: #f2f9f7; }
.learner-review-notes summary { color: #165c58; font-weight: 700; cursor: pointer; }
.learner-review-step { margin-top: 18px; padding: 18px; border: 1px solid #c1dad5; border-radius: 8px; background: white; }
.learner-review-step h4 { margin: 0 0 12px; font-size: 1.1rem; }
.learner-review-label { margin: 0 0 5px; color: #436960; font-size: .85rem; }
.learner-review-feedback { margin-top: 16px; padding-top: 8px; border-top: 1px solid #c1dad5; }
@media (max-width: 700px) { .answerOptions.answer-options-long { grid-template-columns: 1fr; } .learner-review-step { padding: 12px; } }

.numerical-worked-answer { display: block; margin: 12px 0 20px; padding: 12px 18px; min-height: 48px; border: 1px solid #94a3b8; border-radius: 8px; background: #f1f5f9; color: #334155; font: inherit; cursor: pointer; }
.numerical-worked-answer:disabled { opacity: .5; cursor: default; }
.learner-feedback-primary.learner-feedback-worked { background: #f8fafc; border-color: #64748b; }
.video-replay-card { margin: 12px 0 22px; padding: 20px; border: 3px solid #a78bfa; border-radius: 12px; background: #f3e8ff; }
.video-replay-label { margin: 0 0 14px; color: #5b21b6; font-weight: 800; font-size: 1.05rem; }
@media (max-width: 700px) { .video-replay-card { padding: 12px; } .numerical-worked-answer { max-width: 100%; } }

/* Learner navigation menus: optional routes precede the distinct Continue/Finish action. */
.answerOptions.answer-options-navigation { grid-template-columns: minmax(0, 1fr); }
.answer-options-navigation .navigation-primary-action { grid-column: 1 / -1; margin-top: 12px; font-weight: 700; }
.answerButton.navigation-primary-action:not(:disabled) { border: 2px solid #42628d; border-radius: 8px; background: #edf3fc; color: #213d63; }
.answerButton.navigation-primary-action:not(:disabled):hover { background: #dfeafb; }
.answerButton.navigation-primary-action:focus-visible { outline: 3px solid #213d63; outline-offset: 3px; }
.answerButton.navigation-primary-action.answer-choice-selected:not(:disabled) { background: #dbeafe; }

/* Measurement stays beside the Planet X numerical input after both trials. */
.planet-x-answer-context { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 14px; padding: 12px 16px; border: 1px solid #b9cfdf; border-radius: 8px; background: #eef6fc; color: #183c50; }
.planet-x-answer-context p { margin: 0; }

.choice-purpose-panel { padding: 12px; }
.choice-purpose-panel select { width: 100%; margin: 8px 0; }
.choice-purpose-panel small { display: block; line-height: 1.4; }

/* Support routes keep the original question context visually distinct. */
#app.support-route-active { background: #f5f0ff; border: 2px solid #b9a2e8; border-radius: 12px; box-sizing: border-box; }
.support-route-banner { margin: 10px 0 18px; padding: 12px 16px; border-left: 5px solid #7c3aed; background: #ede4ff; color: #40226b; border-radius: 6px; }
.support-route-banner p { margin: 6px 0 0; }
.hint-route-button { display: block; margin: 16px 0; padding: 12px 20px; min-height: 48px; background: #f3eaff; border: 2px solid #8b5bb5; border-radius: 8px; color: #4d2876; font: inherit; font-weight: 700; cursor: pointer; }
.hint-route-button:disabled { opacity: .5; cursor: default; }
.hint-route-button:focus-visible { outline: 3px solid #5b21b6; outline-offset: 3px; }
.answer-hint-setting { display: flex; gap: 8px; align-items: start; padding: 10px; background: #f5f0ff; border-radius: 6px; }


/* Evidence and real classroom examples in How it works. */
.learner-welcome-visual { margin: 22px 0 0; min-width: 0; }
.learner-welcome-visual figcaption { margin: 11px 0 0; color: #475569; font-size: .92rem; line-height: 1.6; }
.learner-welcome-evidence-section { margin: 48px 0; }
.learner-welcome-evidence-section > h2 { color: #0f172a; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.learner-welcome-evidence-section > p { max-width: 82ch; color: #475569; line-height: 1.65; }
.learner-welcome-evidence-section .learner-welcome-card-grid { margin-top: 22px; }
.learner-welcome-info-card h3 { margin: 0 0 12px; color: #0f172a; font-size: 1.1rem; line-height: 1.4; }
.learner-welcome-info-card blockquote { margin: 10px 0 15px; padding-left: 15px; border-left: 3px solid #7c3aed; color: #4c1d95; font-size: 1.08rem; line-height: 1.6; }
.learner-welcome-info-card ul { margin: 0; padding-left: 22px; color: #475569; line-height: 1.8; }
.learner-welcome-demo [data-welcome-meter] { margin-top: 26px; }
.learner-welcome-demo [data-welcome-meter][hidden] { display: none; }
.learner-welcome-demo .node-simulation { box-sizing: border-box; width: 100%; margin: 0; padding: 18px; }
.learner-welcome-demo .node-simulation h3 { margin-top: 0; }

/* Account is a separate page so learner navigation and traversal stay independent. */
.learner-welcome-menu > .learner-welcome-account {
  display: inline-flex; align-items: center; padding: 9px 12px; border: 1px solid #bfdbfe;
  border-radius: 8px; background: #eff6ff; color: #1d4ed8; font: 700 0.9rem/1.4 Arial, sans-serif;
  text-decoration: none; white-space: nowrap;
}
.learner-welcome-menu > .learner-welcome-account:hover { background: #dbeafe; }
.learner-welcome-menu > .learner-welcome-account:focus-visible { outline: 3px solid #60a5fa; outline-offset: 3px; }

.learner-catalogue-initial > .learner-catalogue-field select { min-height:54px; border:2px solid #bfdbfe; background:#eff6ff; font-weight:700; }

.learner-classroom-examples { margin:30px 0; padding:24px; border:1px solid #cbd5e1; border-radius:16px; background:#fff; }
.classroom-example-buttons { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
.classroom-example-buttons button,.classroom-choices button,[data-classroom-video] { padding:10px 14px; border:1px solid #94a3b8; border-radius:8px; background:#fff; color:#17354a; cursor:pointer; font:inherit; }
.classroom-example-buttons button[aria-pressed=true] { background:#087f82; border-color:#087f82; color:#fff; }
.classroom-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:28px; align-items:start; }
.classroom-panel[hidden] { display:none; }
.classroom-panel h3 { margin-top:0; }
.classroom-panel p { line-height:1.65; }
.classroom-story img { display:block; width:100%; max-height:330px; object-fit:contain; border-radius:10px; background:#f1f5f9; }
.classroom-story iframe { display:block; border:0; width:100%; aspect-ratio:16/9; margin-top:12px; }
.classroom-interaction { padding:20px; background:#f0f7f7; border-radius:12px; }
.classroom-interaction label { display:grid; gap:8px; margin:0 0 20px; font-weight:700; }
.classroom-interaction input[type=range] { width:100%; margin:0; }
.classroom-interaction output { font-weight:400; }
.classroom-interaction .classroom-result { display:block; font-size:1.08rem; font-weight:700; line-height:1.6; margin-bottom:16px; }
.classroom-interaction svg { display:block; width:100%; height:auto; }
.classroom-choices { display:grid; gap:10px; }
.classroom-model-note { font-size:.82rem; color:#475569; }
.classroom-interaction [role=status]:empty { display:none; }
.classroom-example-buttons button:focus-visible,.classroom-choices button:focus-visible { outline:3px solid #60a5fa; outline-offset:3px; }
@media(max-width:750px){.classroom-panel{grid-template-columns:1fr;gap:18px}.learner-classroom-examples{padding:16px}.classroom-interaction{padding:14px}.classroom-example-buttons button{font-size:.85rem}}


.learner-classroom-examples { scroll-margin-top:110px; }
