/* ============================================================
   HARVEST · COMPONENTS
   Buttons, forms, cards, badges, items, modals
   ============================================================ */

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-base);
  line-height: 1;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  min-height: 48px;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.btn-primary {
  background: var(--green-rich);
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--green);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--paper-cream);
  color: var(--green);
  border: 1.5px solid var(--paper-deep);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--paper-deep);
  border-color: var(--gold);
}

.btn-ghost {
  background: transparent;
  color: var(--green-rich);
  border: 1.5px solid var(--green-glaze);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--green-glaze);
  border-color: var(--green-mid);
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-warm), var(--gold-rich));
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}
.btn-gold:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--alert);
  color: var(--paper);
}
.btn-danger:hover:not(:disabled) { background: #9F2A45; }

.btn-large { padding: 16px 32px; font-size: var(--fs-lg); min-height: 56px; }
.btn-small { padding: 8px 16px; font-size: var(--fs-sm); min-height: 36px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.btn-row {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
}
.btn-row.justify-between { justify-content: space-between; }
.btn-row.justify-end { justify-content: flex-end; }
.btn-row.justify-center { justify-content: center; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
}
.form-label {
  font-weight: 600;
  color: var(--green);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.form-label .req {
  color: var(--alert);
  font-weight: 700;
}
.form-help {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  font-style: italic;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--paper-warm);
  border: 1.5px solid var(--paper-deep);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  color: var(--ink);
  transition: all var(--t-fast) var(--ease);
  min-height: 48px;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: var(--paper);
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 187, 114, 0.3);
}
.form-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.form-error {
  color: var(--alert);
  font-size: var(--fs-sm);
  margin-top: 4px;
  font-weight: 500;
}
.form-input.invalid, .form-select.invalid, .form-textarea.invalid {
  border-color: var(--alert);
  background: var(--alert-pale);
}

/* Radio and checkbox groups */
.choice-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.choice-group.horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--paper-warm);
  border: 1.5px solid var(--paper-deep);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  min-height: 48px;
}
.choice:hover { background: var(--paper-cream); border-color: var(--gold-warm); }
.choice input { margin-top: 4px; flex-shrink: 0; cursor: pointer; }
.choice input[type="radio"], .choice input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green-rich);
}
.choice-text {
  flex: 1;
  font-size: var(--fs-base);
  color: var(--ink);
  line-height: 1.4;
}
.choice.selected {
  background: var(--ok-pale);
  border-color: var(--green-rich);
  box-shadow: var(--shadow-sm);
}
.choice.correct { background: var(--ok-pale); border-color: var(--ok); }
.choice.incorrect { background: var(--alert-pale); border-color: var(--alert); }

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--paper-warm);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  border: 1px solid var(--paper-deep);
}
.card-elev {
  background: var(--paper);
  box-shadow: var(--shadow-md);
  border: none;
}
.card-soft {
  background: var(--green-glaze);
  border: 1px solid rgba(31, 53, 38, 0.12);
}
.card-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--green);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.card-meta {
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  margin-bottom: var(--sp-3);
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--green-glaze);
  color: var(--green);
}
.badge-gold { background: var(--gold-pale); color: var(--gold-rich); }
.badge-rose { background: var(--alert-pale); color: var(--alert); }
.badge-info { background: var(--info-pale); color: var(--info); }
.badge-ok { background: var(--ok-pale); color: var(--ok); }
.badge-warn { background: var(--warn-pale); color: var(--ink-warn); }

.badge-mastery-secure { background: var(--ok-pale); color: var(--mastery-secure); }
.badge-mastery-watch { background: var(--warn-pale); color: var(--ink-warn); }
.badge-mastery-needs { background: var(--alert-pale); color: var(--alert-soft); }
.badge-mastery-blocked { background: #FAD4DC; color: var(--mastery-blocked); }

/* ─── Item Display (assessment items) ────────────────────────── */
.item-container {
  position: relative;
  padding: var(--sp-4);
}
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.item-id {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-mute);
}
.item-progress {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  font-weight: 600;
}
.item-prompt {
  font-size: var(--fs-xl);
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: var(--sp-5);
  font-family: var(--font-heading);
}
.item-prompt-large {
  font-size: var(--fs-3xl);
  font-family: var(--font-child);
  text-align: center;
  margin: var(--sp-6) 0;
  color: var(--green);
  letter-spacing: 0.02em;
}
.item-prompt.child-text {
  font-family: var(--font-child);
  font-size: var(--fs-2xl);
  text-align: center;
}
.item-stem {
  background: var(--paper-warm);
  border-left: 4px solid var(--gold);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  line-height: 1.6;
}

.item-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.item-choices.col-1 { grid-template-columns: 1fr; }
.item-choices.col-2 { grid-template-columns: repeat(2, 1fr); }
.item-choices.col-4 { grid-template-columns: repeat(4, 1fr); }

.choice-btn {
  background: var(--paper);
  border: 2px solid var(--paper-deep);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  text-align: center;
  font-size: var(--fs-lg);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  position: relative;
}
.choice-btn:hover:not(:disabled) {
  background: var(--paper-cream);
  border-color: var(--gold-warm);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.choice-btn.selected {
  background: var(--ok-pale);
  border-color: var(--green-rich);
  color: var(--green);
}
.choice-btn.large { font-size: var(--fs-2xl); min-height: 100px; }
.choice-btn.huge {
  font-size: var(--fs-4xl);
  min-height: 140px;
  font-family: var(--font-child);
}
.choice-btn.image-btn {
  padding: var(--sp-2);
  min-height: 120px;
}
.choice-btn.image-btn img,
.choice-btn.image-btn svg {
  max-width: 100%;
  max-height: 100px;
}

.item-controls {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  flex-wrap: wrap;
}

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 42, 32, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn 200ms var(--ease);
}
.modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 300ms var(--ease-bounce);
}
.modal-title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--green);
  margin-bottom: var(--sp-3);
}
.modal-content {
  margin-bottom: var(--sp-5);
  color: var(--ink-soft);
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
  background: var(--green);
  color: var(--paper);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  max-width: 340px;
  font-size: var(--fs-sm);
  pointer-events: auto;
  animation: toastIn 250ms var(--ease);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}
.toast.toast-warn { background: var(--gold-rich); }
.toast.toast-alert { background: var(--alert); }
.toast.toast-info { background: var(--info); }
.toast-icon { flex-shrink: 0; }
.toast-icon svg { width: 18px; height: 18px; }
.toast-close { margin-left: auto; opacity: 0.7; }
.toast-close:hover { opacity: 1; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─── Loading ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--paper-deep);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Divider ────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--paper-deep), transparent);
  margin: var(--sp-5) 0;
  border: none;
}
.divider-thick { height: 2px; }

/* ─── Stat / Score Display ───────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}
.stat {
  background: var(--paper-warm);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  border-top: 3px solid var(--gold);
}
.stat-label {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  color: var(--green);
  font-weight: 600;
  line-height: 1;
}
.stat-meta {
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ─── Audio Recorder ─────────────────────────────────────────── */
.recorder {
  background: var(--paper-warm);
  border: 2px dashed var(--paper-deep);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-align: center;
}
.recorder.recording {
  border-color: var(--alert);
  background: var(--alert-pale);
  animation: recordPulse 1.5s ease-in-out infinite;
}
@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(181, 48, 78, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(181, 48, 78, 0); }
}
.recorder-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--alert);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--t-fast) var(--ease);
}
.recorder-btn:hover { transform: scale(1.05); }
.recorder-btn.recording { background: var(--green-rich); }
.recorder-btn svg { width: 32px; height: 32px; }
.recorder-time {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  color: var(--green);
  font-variant-numeric: tabular-nums;
  margin-top: var(--sp-3);
}
.recorder-status {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  margin-top: var(--sp-2);
}
.recorder-level {
  height: 6px;
  background: var(--paper-deep);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: var(--sp-3);
}
.recorder-level-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-rich), var(--gold), var(--alert));
  width: 0%;
  transition: width 60ms linear;
}

/* ─── Canvas / Drawing ───────────────────────────────────────── */
.drawing-pad {
  border: 2px solid var(--paper-deep);
  border-radius: var(--r-md);
  background: var(--paper);
  position: relative;
  cursor: crosshair;
  width: 100%;
  touch-action: none;
}
.drawing-controls {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}

/* ─── Timer / Countdown ──────────────────────────────────────── */
.timer-badge {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  background: var(--paper);
  border: 1px solid var(--paper-deep);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.timer-badge.warn { color: var(--ink-warn); border-color: var(--gold); }
.timer-badge.alert { color: var(--alert); border-color: var(--alert); }
.timer-badge svg { width: 14px; height: 14px; }

/* ─── Letter / Word Grid ─────────────────────────────────────── */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
}
.letter-tile {
  background: var(--paper-warm);
  border: 2px solid var(--paper-deep);
  border-radius: var(--r-md);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-child);
  font-size: var(--fs-3xl);
  color: var(--green);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  user-select: none;
}
.letter-tile:hover { background: var(--gold-pale); border-color: var(--gold); }
.letter-tile.selected { background: var(--green); color: var(--paper); border-color: var(--green); }
.letter-tile.correct { background: var(--ok-pale); border-color: var(--ok); color: var(--ok); }
.letter-tile.incorrect { background: var(--alert-pale); border-color: var(--alert); color: var(--alert); }

/* ─── Passage Display ────────────────────────────────────────── */
.passage {
  background: var(--paper-warm);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  border-left: 4px solid var(--green-rich);
  font-family: var(--font-child);
  font-size: var(--fs-xl);
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: var(--sp-5);
}
.passage h3 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--green);
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--paper-deep);
  padding-bottom: var(--sp-2);
}
.passage p { color: var(--ink); margin-bottom: var(--sp-3); }
.passage .meta {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  font-style: italic;
  margin-top: var(--sp-4);
  border-top: 1px solid var(--paper-deep);
  padding-top: var(--sp-3);
}

.passage-tracking-word {
  display: inline-block;
  padding: 0 2px;
  border-radius: 4px;
  transition: background var(--t-fast) var(--ease);
  cursor: pointer;
}
.passage-tracking-word.read { background: var(--ok-pale); }
.passage-tracking-word.error { background: var(--alert-pale); text-decoration: line-through; }
.passage-tracking-word.skipped { background: var(--warn-pale); }

/* ─── Section Intro ──────────────────────────────────────────── */
.section-intro {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
}
.section-intro h1 {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  color: var(--green);
  margin-bottom: var(--sp-3);
}
.section-intro .section-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: var(--fs-5xl);
  font-weight: 700;
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-md);
}
.section-intro .script {
  background: var(--paper-warm);
  border-left: 4px solid var(--gold);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: var(--fs-lg);
  line-height: 1.6;
  text-align: left;
  max-width: 600px;
  margin: var(--sp-5) auto;
  color: var(--ink-soft);
}
.section-intro .script::before { content: '"'; font-size: 2em; color: var(--gold); line-height: 0; vertical-align: -0.2em; }
.section-intro .script::after { content: '"'; font-size: 2em; color: var(--gold); line-height: 0; vertical-align: -0.5em; }

/* ─── Quick Start questionnaire (2026-10-19) ─────────────────────
   One screen of real questions before HARVEST starts (js/sections/intake.js,
   renderQuickStart). Each question is a card; the three required ones are the
   child, the grade and the promise. Built to fit a 390px phone without any
   sideways scroll: every grid uses minmax(0, 1fr) and fieldsets drop their
   default min-content width. */
.qs-form { max-width: 760px; margin: 0 auto; }
.qs-head { text-align: center; margin-bottom: var(--sp-5); }
.qs-eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fs-secondary);
  margin-bottom: var(--sp-2);
}
.qs-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, var(--fs-4xl));
  color: var(--green);
  margin-bottom: var(--sp-3);
}
.qs-title:focus { outline: none; }
.qs-lead {
  max-width: 56ch;
  margin: 0 auto var(--sp-4) auto;
  color: var(--ink-soft);
  font-size: var(--fs-lg);
  line-height: 1.6;
}
.qs-mode {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px var(--sp-1);
  padding: 6px var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--paper-cream);
  border: 1px solid var(--paper-deep);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.qs-mode strong { color: var(--green); }
.qs-mode-change { margin-left: var(--sp-2); padding: 2px 0; }

.qs-block {
  background: var(--paper-warm);
  border: 1px solid var(--paper-deep);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-3);
}
.qs-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.qs-fieldset > legend { float: left; width: 100%; padding: 0; }
.qs-fieldset-body { clear: both; }
.qs-q {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}
label.qs-q { cursor: pointer; }
/* The optional questions, folded away so the start form is just name and grade. */
.qs-more {
  border: 1px dashed var(--paper-deep);
  border-radius: var(--r-md, 12px);
  padding: 0 var(--sp-4);
  margin: var(--sp-2) 0 var(--sp-4);
}
.qs-more-summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
  padding: var(--sp-3) 0;
}
.qs-more[open] { padding-bottom: var(--sp-3); }
.qs-optional {
  font-family: var(--font-body);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--paper);
  border: 1px solid var(--paper-deep);
  border-radius: var(--r-pill);
  padding: 2px 8px;
}
.qs-help {
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  line-height: 1.5;
  margin: 0 0 var(--sp-3) 0;
}
.qs-block[data-q="name"] .qs-help,
.qs-promise-block .qs-help { margin: var(--sp-2) 0 0 0; }
.qs-name-input { max-width: 360px; font-size: var(--fs-lg); }
.qs-note {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--gold-pale);
  border: 1px solid var(--gold-warm);
  color: var(--ink-warn);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.qs-note[hidden] { display: none; }

/* auto-fit, so a question with three answers spreads them across the row instead of leaving an
   empty fourth slot. */
.qs-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-2);
}
.qs-options-tight { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.qs-choice { align-items: center; background: var(--paper); min-width: 0; }
.qs-choice input { margin-top: 0; }
.qs-choice .choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.qs-choice-main { font-weight: 600; color: var(--ink); }
.qs-choice-sub { font-size: var(--fs-xs); color: var(--ink-mute); font-weight: 400; }
.qs-choice:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Grades: six large buttons; the radio itself is kept for keyboards and screen readers. */
.qs-grades {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--sp-2);
}
.qs-grade {
  position: relative;
  justify-content: center;
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
}
.qs-grade input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
/* A grade name never breaks inside a word ("Kindergart-en"); the grid gives it room instead. */
.qs-grade .choice-text { align-items: center; flex: 1; overflow-wrap: normal; }
.qs-grade .qs-choice-main { font-size: var(--fs-sm); white-space: nowrap; }
.qs-grade.selected,
.qs-grade:has(input:checked) { background: var(--green-rich); border-color: var(--green-rich); box-shadow: var(--shadow-sm); }
.qs-grade.selected .qs-choice-main,
.qs-grade:has(input:checked) .qs-choice-main { color: var(--paper); }

.qs-promise-block { background: var(--ok-pale); border-color: var(--green-soft); }
.qs-promise {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  cursor: pointer;
  font-weight: 600;
  color: var(--green-rich);
  font-size: var(--fs-lg);
  line-height: 1.45;
}
.qs-promise input {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--green-rich);
  cursor: pointer;
}

.qs-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}
.qs-start { white-space: normal; text-align: center; line-height: 1.2; }
.qs-missing {
  margin-top: var(--sp-2);
  text-align: right;
  font-size: var(--fs-sm);
  color: var(--ink-mute);
}
.qs-missing.is-ready { color: var(--green-rich); font-weight: 600; }

@media (max-width: 560px) {
  .qs-head { margin-bottom: var(--sp-4); }
  .qs-lead { font-size: var(--fs-base); }
  .qs-block { padding: var(--sp-3) var(--sp-4); }
  .qs-grades { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qs-options,
  .qs-options-tight { grid-template-columns: minmax(0, 1fr); }
  .qs-block[data-q="concerns"] .qs-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qs-promise { font-size: var(--fs-base); }
  .qs-actions { flex-direction: column-reverse; align-items: stretch; }
  .qs-actions .btn { width: 100%; }
  .qs-missing { text-align: center; }
}
@media (max-width: 420px) {
  .qs-grades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Resume offer ─────────────────────────────────────────────── */
.resume-offer p { margin-bottom: var(--sp-3); }
.resume-offer p:last-child { margin-bottom: 0; }

/* ─── Prior Sessions: one group per child (2026-10-19) ─────────────
   Rows, not a table, so a phone gets every column without scrolling sideways. */
.roster-summary { font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: var(--sp-3); }
.roster-child {
  border: 1px solid var(--paper-deep);
  border-radius: var(--r-lg);
  background: var(--paper-warm);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.roster-child-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-2) var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-2);
}
.roster-child-names { min-width: 0; }
.roster-child-name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--green);
  margin: 0;
  overflow-wrap: anywhere;
}
.roster-child-meta { font-size: var(--fs-xs); color: var(--ink-mute); }
.roster-remove,
.roster-delete { color: var(--alert); font-size: var(--fs-xs); }
.roster-sessions {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.roster-session {
  background: var(--paper);
  border: 1px solid var(--paper-deep);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
}
.roster-session-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-3);
}
.roster-when { font-weight: 600; color: var(--ink); font-size: var(--fs-sm); }
.roster-what { font-size: var(--fs-sm); color: var(--ink-soft); flex: 1 1 auto; min-width: 0; }
.roster-points { font-size: var(--fs-sm); color: var(--green-rich); margin-top: 4px; }
.roster-note { font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 2px; }
.roster-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-2);
}
.status-pill.status-incomplete { background: var(--paper-deep); color: var(--ink-soft); }
