/* Stim Mode CSS — unified practice exam simulator (adapted from biol3020) */

#stimRoot { font-family: 'Inter', system-ui, sans-serif; color: var(--ink); }

.stim-shell { max-width: 880px; margin: 0 auto; padding: 30px 28px 120px; }
.stim-eyebrow {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--amber); font-weight: 600; margin-bottom: 8px;
}
.stim-title {
  font-family: 'Fraunces', serif;
  font-size: 38px; line-height: 1.1; margin: 0 0 12px;
}
.stim-subtitle { color: var(--ink-2); margin-bottom: 32px; font-size: 15px; }
.stim-card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.stim-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.stim-row label { font-size: 13px; letter-spacing: 0.04em; color: var(--ink-2); min-width: 110px; }
.stim-chip {
  background: var(--bg-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  transition: all .12s;
}
.stim-chip.active { background: var(--amber); color: #14110a; border-color: transparent; font-weight: 600; }
.stim-chip:hover:not(.active) { background: var(--bg-2); border-color: var(--amber); }
.stim-chip.disabled, .stim-chip[disabled] { opacity: 0.42; cursor: not-allowed; }

.stim-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
  margin: 6px 0 14px;
  padding: 14px;
  background: var(--bg-3);
  border: 1px dashed var(--rule);
  border-radius: 12px;
}
/* exam folders around the unit grid (23 Sep 2026) */
.stim-exam-folder { margin: 8px 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg-2); }
.stim-exam-folder > summary {
  list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 10px 14px; border-radius: 12px;
}
.stim-exam-folder > summary::-webkit-details-marker { display: none; }
.stim-exam-folder > summary::before { content: '▸'; opacity: .6; transition: transform .15s; }
.stim-exam-folder[open] > summary::before { transform: rotate(90deg); }
.stim-exam-name { font-weight: 600; }
.stim-exam-date { font-size: 13px; color: var(--ink-2); }
.stim-exam-next { border-color: var(--amber); }
.stim-exam-next .stim-exam-date { color: var(--amber); font-weight: 600; }
.stim-exam-done { opacity: .65; }
.stim-exam-count { font-size: 12px; color: var(--ink-2); margin-left: auto; }
.stim-exam-select { padding: 4px 12px; font-size: 12px; }
.stim-exam-folder > .stim-unit-grid { margin: 0 10px 10px; }
.stim-exam-sabox { margin: 0 10px 10px; padding: 10px 12px; border: 2px solid var(--accent, #a63c00); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.stim-exam-note { font-size: 12px; color: var(--ink-2); margin: 0 14px 10px; }
.stim-unit-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 6px 10px;
  text-align: left;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  border-radius: 14px;
}
/* the label wraps inside its own column and the count keeps its own, so they never overlap */
.stim-unit-chip > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.stim-unit-chip > span:last-child { flex: 0 0 auto; }
.stim-unit-note {
  font-size: 12px; color: var(--ink-2);
  background: rgba(230,168,92,0.08);
  border: 1px solid rgba(230,168,92,0.25);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 14px;
}

.stim-btn {
  background: var(--amber); color: #14110a; border: none;
  border-radius: 10px; padding: 12px 20px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.stim-btn:hover { filter: brightness(1.05); }
.stim-btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.stim-btn-ghost:hover { background: var(--bg-2); border-color: var(--amber); }
.stim-btn-danger { background: #c74e4e; color: white; }

/* Exam top bar */
.stim-exam-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; border-bottom: 1px solid var(--rule);
  position: sticky; top: 56px; background: var(--bg); z-index: 5;
  flex-wrap: wrap; gap: 12px;
}
.stim-progress { display: flex; gap: 14px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.stim-progress strong { font-family: 'JetBrains Mono', monospace; }
.stim-progress .hint { color: var(--ink-3); font-size: 12px; }
.stim-timer { font-family: 'JetBrains Mono', monospace; font-size: 16px; color: var(--amber); }
.stim-timer.urgent { color: #ff7a5c; animation: pulse 1s infinite; }
.stim-timer.paused { color: var(--ink-3); opacity: 0.7; }
@keyframes pulse { 50% { opacity: 0.5; } }

.stim-paused-shell { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 32px 16px; }
.stim-paused-card {
  text-align: center; background: var(--bg-2);
  border: 1px dashed var(--rule); border-radius: 16px;
  padding: 56px 40px; max-width: 480px; width: 100%;
}
.stim-paused-eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 11px; color: var(--ink-2); margin-bottom: 14px; }
.stim-paused-title { font-family: 'Fraunces', serif; font-size: 32px; margin: 0 0 12px; color: var(--ink); }
.stim-paused-msg { color: var(--ink-2); font-size: 14px; margin: 0 0 24px; line-height: 1.6; }

/* Question pager */
.stim-pager { display: flex; gap: 6px; flex-wrap: wrap; padding: 16px 28px 0; max-width: 880px; margin: 0 auto; }
.stim-pager button {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--rule);
  background: transparent; color: var(--ink); cursor: pointer; font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}
.stim-pager button:hover { border-color: var(--amber); }
.stim-pager button.answered { background: rgba(230,168,92,0.18); border-color: var(--amber); }
.stim-pager button.current { background: var(--amber); color: #14110a; }
.stim-pager button.flagged { box-shadow: inset 0 0 0 2px #ff7a5c; }

.stim-q-meta { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); margin-bottom: 16px; flex-wrap: wrap; }
.stim-q-meta span { background: var(--bg-3); padding: 3px 10px; border-radius: 999px; }

.stim-q-stem {
  font-family: 'Fraunces', serif;
  font-size: 22px; line-height: 1.4; margin-bottom: 24px;
  color: var(--ink);
}

.stim-choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.stim-choice {
  display: flex; gap: 14px; align-items: flex-start;
  /* The per-choice explanation is appended into this button after answering.
     Without wrapping it becomes a third item in this row and squeezes the
     choice text into a narrow column, so let it break onto its own line. */
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 10px; cursor: pointer; background: transparent;
  text-align: left; color: var(--ink); font-family: inherit; font-size: 14px;
  line-height: 1.5; transition: all .15s;
}
.stim-choice:hover:not(:disabled) { background: var(--bg-2); border-color: var(--amber); }
.stim-choice.selected { border-color: var(--amber); background: rgba(230,168,92,0.08); }
.stim-choice.correct-rev { border-color: #5fb87a; background: rgba(95,184,122,0.12); }
.stim-choice.wrong-rev { border-color: #c74e4e; background: rgba(199,78,78,0.12); }
.stim-choice:disabled { cursor: default; }
.stim-choice-key { width: 22px; flex-shrink: 0; font-weight: 600; color: var(--ink-3); font-family: 'JetBrains Mono', monospace; }
.stim-choice-text { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.stim-choice-why {
  display: block; flex: 1 0 100%; width: 100%; min-width: 0;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.12);
  font-size: 12.5px; color: var(--ink-2);
  line-height: 1.45; font-weight: 400;
}
.stim-choice.correct-rev .stim-choice-why { color: #b5e2c2; border-top-color: rgba(95,184,122,0.3); }
.stim-choice.wrong-rev .stim-choice-why { color: #ffb5b5; border-top-color: rgba(199,78,78,0.3); }

/* Practice-mode feedback panel */
.stim-feedback {
  margin: 18px 0 24px; padding: 14px 18px;
  border-radius: 10px; border-left: 4px solid;
  background: var(--bg-2); font-size: 14px; line-height: 1.5;
}
.stim-feedback.correct { border-left-color: #5fb87a; background: rgba(95,184,122,0.08); }
.stim-feedback.incorrect { border-left-color: #c74e4e; background: rgba(199,78,78,0.08); }
.stim-feedback .fb-verdict { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.stim-feedback.correct .fb-verdict { color: #5fb87a; }
.stim-feedback.incorrect .fb-verdict { color: #ff8b8b; }
.stim-feedback .fb-correct, .stim-feedback .fb-why, .stim-feedback .fb-user-why { margin-bottom: 6px; color: var(--ink); }
.stim-feedback strong { color: var(--amber-2); }
.stim-feedback .fb-source {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.15);
  font-size: 12.5px; color: var(--ink); line-height: 1.55;
}
.stim-feedback .fb-hint { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); font-style: italic; }
/* After-answer extras: takeaway, trap, terms */
.fb-takeaway, .fb-trap, .fb-terms { margin: 10px 0 6px; padding: 9px 12px; border-radius: 8px; background: var(--bg-3); color: var(--ink); border-left: 3px solid var(--amber); }
.fb-trap { border-left-color: #c74e4e; }
.fb-terms { border-left-color: #5b9bd5; }
.fb-terms dl { margin: 6px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; }
.fb-terms dt { font-weight: 600; color: var(--amber-2); }
.fb-terms dd { margin: 0; min-width: 0; }
.stim-feedback-extra .fb-takeaway:first-child { margin-top: 0; }
@media (max-width: 560px) { .fb-terms dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .fb-terms dd { margin-bottom: 6px; } }

/* SA textarea */
.stim-textarea {
  width: 100%; min-height: 140px; padding: 14px 16px;
  background: var(--bg-3); border: 1px solid var(--rule);
  border-radius: 10px; color: var(--ink); font-family: inherit; font-size: 14px;
  line-height: 1.5; resize: vertical;
}
.stim-textarea:focus { outline: none; border-color: var(--amber); }
.stim-char-count { text-align: right; font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.stim-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 24px; align-items: center; flex-wrap: wrap; }

/* Results view */
.stim-result-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.stim-stat { background: var(--bg-2); padding: 16px; border-radius: 10px; border: 1px solid var(--rule); }
.stim-stat-num { font-size: 28px; font-family: 'Fraunces', serif; color: var(--amber-2); }
.stim-stat-lbl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }

.stim-q-result { padding: 14px; margin-bottom: 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg-2); }
.stim-q-result.correct { border-left: 3px solid #5fb87a; }
.stim-q-result.wrong { border-left: 3px solid #c74e4e; }
.stim-q-result.ungraded { border-left: 3px solid var(--amber); }
.stim-q-result-stem { font-size: 14px; margin-bottom: 10px; line-height: 1.5; color: var(--ink); }
.stim-q-result-meta { font-size: 11px; color: var(--ink-3); margin-bottom: 8px; font-family: 'JetBrains Mono', monospace; }
.stim-q-result-why { font-size: 13px; color: var(--ink-2); padding: 10px 12px; background: var(--bg-3); border-radius: 6px; margin-top: 10px; }
.stim-q-result-user { font-size: 13px; padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.stim-q-result-user.correct { background: rgba(95,184,122,0.1); color: #b5e2c2; }
.stim-q-result-user.wrong { background: rgba(199,78,78,0.1); color: #ffb5b5; }

/* Heatmap */
.stim-heat-section { margin: 22px 0 6px; }
.stim-heat-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.stim-heat-legend { font-size: 11px; opacity: 0.7; letter-spacing: 0.04em; }
.stim-heatmap-units {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.stim-heat-cell {
  border-radius: 6px; padding: 10px 12px;
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  cursor: help; min-height: 48px;
  display: flex; flex-direction: column; gap: 3px;
  color: #1a1a1a; font-weight: 600;
}
.stim-heat-cell .pct { font-size: 16px; font-family: 'Fraunces', serif; }
.stim-heat-cell .label { font-size: 10px; opacity: 0.85; line-height: 1.2; word-break: break-word; }

/* Modal */
.stim-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100;
  display: none; align-items: center; justify-content: center;
}
.stim-modal-backdrop.show { display: flex; }
.stim-modal {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 12px; padding: 28px; max-width: 440px; width: 90%;
  color: var(--ink);
}
.stim-modal h3 { margin: 0 0 12px; font-family: 'Fraunces', serif; }
.stim-modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 600px) {
  .stim-shell { padding: 24px 16px 100px; }
  .stim-title { font-size: 26px; }
  .stim-q-stem { font-size: 18px; }
  .stim-exam-bar { padding: 10px 16px; }
  .stim-pager { padding: 12px 16px 0; }
  .stim-row label { min-width: 100%; }
}

/* source link on question feedback — added with deck-meta source resolution */
.fb-src-link{color:var(--amber-2);text-decoration:none;border-bottom:1px dotted currentColor}
.fb-src-link:hover{border-bottom-style:solid}

/* ---- v17: scheduler, recall-first, confidence, rubric, report, sync ---- */
.stim-due-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: -14px 0 22px; }
.stim-due-cell { flex: 1 1 120px; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; }
.stim-due-cell .n { font-family: 'Fraunces', serif; font-size: 26px; line-height: 1; }
.stim-due-cell .l { font-size: 12px; color: var(--ink-2); margin-top: 6px; letter-spacing: .03em; }
.stim-due-cell .l .sub { font-size: 10.5px; color: var(--ink-3); }
.stim-due-cell.warn { border-color: rgba(199,78,78,0.5); }
.stim-due-cell.warn .n { color: #ff8b8b; }
.stim-conf-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; font-size: 13px; color: var(--ink-2); }
.stim-conf-chip { padding: 5px 12px; font-size: 12px; }
.stim-recall { background: var(--bg-2); border: 1px dashed var(--amber); border-radius: 12px; padding: 14px 16px; margin: 10px 0 16px; }
.stim-recall label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.stim-recall-echo { font-size: 13.5px; color: var(--ink-2); background: var(--bg-2); border-left: 3px solid var(--amber); padding: 8px 12px; border-radius: 6px; margin: 6px 0 12px; }
.stim-kw { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid; margin: 2px 0; }
.stim-kw.hit { color: #b5e2c2; border-color: rgba(95,184,122,0.5); background: rgba(95,184,122,0.12); }
.stim-kw.miss { color: #ffb5b5; border-color: rgba(199,78,78,0.5); background: rgba(199,78,78,0.12); }
.fb-recall { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(255,255,255,0.12); font-size: 13.5px; line-height: 1.7; }
.fb-recall-score { font-weight: 600; margin-right: 6px; }
.fb-conf { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.stim-q-meta .stim-tier { color: var(--amber); font-weight: 600; }
.stim-badge-repeat { background: #b45309; color: white; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.stim-report-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.stim-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--bg-3); color: var(--ink); border: 1px solid var(--amber); border-radius: 10px; padding: 10px 16px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; }
.stim-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.stim-sync { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; }
.stim-sync label { color: var(--ink-2); }
.stim-input { background: var(--bg-3); border: 1px solid var(--rule); color: var(--ink); border-radius: 8px; padding: 8px 10px; font-family: 'JetBrains Mono', monospace; font-size: 13px; min-width: 200px; }
.stim-sync-status { color: var(--ink-3); font-size: 12px; }
.stim-weak { margin: 6px 0 0; padding-left: 20px; line-height: 1.7; font-size: 13.5px; }
.stim-weak .u { font-weight: 600; }
.stim-weak .acc { font-family: 'JetBrains Mono', monospace; color: var(--amber); margin: 0 4px; }
.stim-weak .n { color: var(--ink-3); font-size: 12px; }
.stim-weak .trend { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); }
.stim-weak .trend.improving { color: #b5e2c2; border-color: rgba(95,184,122,0.5); }
.stim-weak .trend.slipping { color: #ffb5b5; border-color: rgba(199,78,78,0.5); }

/* ---------- Exam view fits one window (2026-09-22) ----------
   During an exam the site nav scrolls away with the page, the bar and spacing are compact, and a question with a
   picture puts the picture beside the choices on wide windows. stim.js (fitExam) sizes the picture to the room left
   and re-fits on resize. */
body.stim-exam-active .topnav { position: static; }
body.stim-exam-active .stim-exam-bar { top: 0; padding: 8px 20px; gap: 8px; }
body.stim-exam-active .stim-exam-bar .stim-btn { padding: 7px 12px; font-size: 13px; }
.stim-shell.stim-exam-fit { padding-top: 12px; padding-bottom: 24px; }   /* stim.js sizeShell sets the exact height */
.stim-shell.stim-exam-fit.stim-has-fig { max-width: 1240px; }
.stim-exam-fit .stim-q-meta { margin-bottom: 8px; }
.stim-exam-fit .stim-q-stem { font-size: 20px; line-height: 1.35; margin-bottom: 12px; }
.stim-exam-fit .stim-conf-row { margin: 0 0 8px; }
.stim-exam-fit .stim-choices { gap: 8px; margin-bottom: 8px; }
.stim-exam-fit .stim-choice { padding: 10px 14px; }
.stim-exam-fit .stim-nav { margin-top: 8px; }
.stim-exam-fit .stim-nav .stim-btn { padding: 9px 16px; }
.stim-exam-fit .stim-textarea { min-height: 72px; }
.stim-qwrap.has-fig { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stim-qwrap .stim-qfig .stim-fig { margin: 0 !important; }
.stim-qwrap .stim-qfig img { max-width: 100%; width: auto; height: auto; object-fit: contain; }
@media (max-width: 899px) {
  .stim-qwrap.has-fig { display: block; }
  .stim-qwrap .stim-qfig { margin-bottom: 10px; }
  .stim-exam-fit .stim-q-stem { font-size: 18px; }
}
body.stim-exam-active .stim-pager { padding-top: 8px; padding-bottom: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
body.stim-exam-active .stim-pager button { flex: 0 0 auto; }
/* phones: the exam bar buttons show icons only so the bar takes one row (End / Submit keep their words) */
@media (max-width: 600px) {
  body.stim-exam-active .stim-bar-lbl { display: none; }
  body.stim-exam-active .stim-exam-bar { padding: 6px 12px; }
  body.stim-exam-active .stim-exam-bar .stim-btn { padding: 6px 10px; }
  .stim-shell.stim-exam-fit { padding-left: 16px; padding-right: 16px; }
}
/* after answering: his slide sits beside the explanations and the answer panel scrolls inside itself */
.stim-exam-fit.stim-answered .stim-fbscroll { overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; }
.stim-exam-fit.stim-answered .stim-nav { margin-top: 10px; border-top: 1px solid var(--rule); padding-top: 10px; }
.stim-exam-fit.stim-answered .stim-qfig { position: sticky; top: 0; }
@media (min-width: 900px) {
  .stim-exam-fit.stim-answered .stim-qwrap.has-fig { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}
/* the numbered row renders only the buttons near the current question; the pads keep its true width */
.stim-pager-win { display: flex; gap: 6px; flex: 0 0 auto; }
.stim-pager-pad { flex: 0 0 auto; height: 1px; }
/* Radial map link (Oct 3 2026) */
.stim-rm { display: inline-block; margin-top: 6px; padding: 6px 12px; min-height: 36px; border-radius: 999px; border: 1px solid var(--teal, #2dbeaa); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; line-height: 1.4; }
.stim-rm:hover, .stim-rm:focus-visible { background: color-mix(in srgb, var(--teal, #2dbeaa) 18%, transparent); outline: none; }
@media (max-width: 600px) { .stim-rm { min-height: 44px; display: flex; align-items: center; } }

/* Acronym from the printed sheets under each explanation (Oct 4 2026) */
.stim-acr { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border, #3a3a3a); }
.stim-acr-word { font-weight: 700; letter-spacing: .06em; font-size: 1.08em; }
.stim-acr-l { opacity: .5; padding: 0 1px; border-radius: 4px; }
.stim-acr-l.on { opacity: 1; background: #f2c14e; color: #1b1b1b; padding: 0 5px; }
.stim-acr-dot { opacity: .45; margin: 0 3px; }
.stim-acr-t { opacity: .85; }
.stim-acr-row { margin: 3px 0 0 1.6em; opacity: .62; font-size: .94em; }
.stim-acr-row.on { opacity: 1; font-size: 1em; margin-top: 5px; }
.stim-acr-l.on.rel { background: rgba(242,193,78,.18); color: inherit; box-shadow: inset 0 0 0 1.5px #f2c14e; }
.stim-acr-key { margin: 6px 0 0 1.6em; font-size: .85em; opacity: .75; }
.stim-acr-key .stim-acr-l { font-size: .9em; }

/* Oct 5 2026: the floating site-search pill covered the exam bar buttons (Submit/End) at the top right; during a session it sits bottom-left */
body.stim-exam-active .usw-launcher { top: auto; bottom: 14px; left: 14px; right: auto; }
/* Oct 14 2026: bottom-left it covered "← Prev" / "← Previous question" when the button row reached the bottom of the window.
   During a session it is a small round icon, and the button row keeps a gap on its left. */
body.stim-exam-active .usw-launcher { padding: 9px; border-radius: 50%; }
body.stim-exam-active .usw-launcher .usw-lbl, body.stim-exam-active .usw-launcher kbd { display: none; }
@media (min-width: 1001px) { body.stim-exam-active .stim-nav { padding-left: 54px; } }

/* Oct 5 2026 (50-profile sim): on phones and narrow windows the round AI-chat and search buttons sat on Next/Prev during a session */
@media (max-width: 1000px) { body.stim-exam-active #ai-chat-fab, body.stim-exam-active .usw-launcher { display: none !important; } }

/* Oct 6 2026 (5k sim): on phones the floating Study chat pill, AI button and search button covered "Start exam" and
   "New session" at the bottom of the page. Room below the last controls lets them scroll clear of the floating buttons. */
@media (max-width: 1000px) { #stimRoot { padding-bottom: 140px; } }
/* Answered: choices + every option's explanation beside the verdict / slide / acronym, each column scrolls on its own
   (Oct 7 2026, user: "so i dont have to scroll ... use the sides"). Narrow windows stack them, verdict first. */
.stim-fbscroll.stim-split { display: flex; flex-direction: column; }
.stim-fbscroll.stim-split > .stim-fbcol-b { order: -1; }
@media (min-width: 1200px) {
  .stim-shell.stim-exam-fit.stim-answered.stim-split-on { max-width: min(1760px, 97vw); }
  .stim-exam-fit.stim-answered.stim-split-on .stim-qwrap.has-fig { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
  .stim-fbscroll.stim-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: minmax(0, 1fr);
    gap: 18px; overflow: hidden; padding-right: 0; }
  .stim-fbscroll.stim-split > .stim-fbcol-b { order: 0; }
  .stim-fbscroll.stim-split > .stim-fbcol { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-right: 8px; }
  .stim-fbscroll.stim-split > .stim-fbcol-a .stim-choice { padding: 8px 12px; }
  .stim-fbscroll.stim-split > .stim-fbcol-a .stim-choice-why { font-size: 13px; line-height: 1.45; }
}
/* Heatmaps split by exam + click a square for its missed questions (Oct 7 2026) */
.stim-heat-exam { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 12px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 3px; }
.stim-heat-exam:first-child { margin-top: 2px; }
.stim-heat-exam-avg { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--amber); font-size: 12px; }
.stim-heat-cell[data-heat-unit] { cursor: pointer; transition: transform .08s, box-shadow .08s; }
.stim-heat-cell[data-heat-unit]:hover, .stim-heat-cell[data-heat-unit]:focus-visible { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--amber); outline: none; }
.stim-heat-cell.sel { box-shadow: 0 0 0 3px var(--amber); }
.stim-heat-detail { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--rule); border-left: 4px solid var(--amber); border-radius: 10px; background: var(--bg-3); font-size: 13.5px; }
.stim-heat-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.stim-heat-detail-head .stim-btn { padding: 4px 10px; font-size: 12px; }
.stim-heat-rec { margin-top: 10px; }
.stim-heat-q { margin-bottom: 8px; }
.stim-heat-q-ans { color: #b5e2c2; font-size: 12.5px; margin-top: 2px; }

/* Exam simulation (Oct 22 2026): blueprint table on setup, exam card + results file on the results page */
.stim-exsim-bp { margin: 6px 0 12px; }
.stim-exsim-bp > summary { cursor: pointer; color: var(--amber); font-size: 13.5px; padding: 4px 0; }
.stim-exsim-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.stim-exsim-table { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 8px; }
.stim-exsim-table th, .stim-exsim-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.stim-exsim-table th { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.stim-exsim-table td:not(:first-child) { white-space: nowrap; }
.stim-exsim-table tr.weak td:first-child { border-left: 3px solid #c74e4e; }
.stim-exsim-table tr.mid td:first-child { border-left: 3px solid #d6c84e; }
.stim-exsim-table tr.ok td:first-child { border-left: 3px solid #5fb87a; }
.stim-exsim-dim { color: var(--ink-3); }
.stim-exsim-run { padding: 12px 0; border-top: 1px solid var(--rule); }
.stim-exsim-card h3 { line-height: 1.35; }
@media (max-width: 560px) { .stim-exsim-table { font-size: 12px; } .stim-exsim-table th, .stim-exsim-table td { padding: 5px 6px; } }
.stim-exsim-quick { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-color: var(--amber); }
.stim-exsim-quick-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stim-exsim-quick-txt strong { font-family: 'Fraunces', serif; font-size: 18px; }

/* Oct 23 2026 manual pass: dialogs and toasts live outside .stim-shell and fell back to the browser serif font */
.stim-modal-backdrop, .stim-modal, .stim-toast { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }
.stim-modal h3 { font-family: 'Fraunces', serif; }
.stim-exsim-lede { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); margin: 4px 0 10px; }

/* Oct 24 2026: professor-style point rubric for short answers, Claude Code's graded file, study guide fixes */
.stim-q-result.partial { border-left: 3px solid #d6c84e; }
.stim-rub, .stim-claude-grade { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg-3); font-size: 14px; line-height: 1.5; }
.stim-claude-grade { border-color: var(--amber); }
.stim-rub-head { margin-bottom: 8px; color: var(--ink-2); font-size: 13.5px; }
.stim-rub-head strong { color: var(--ink); }
.stim-rub-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.stim-rub-row.full { box-shadow: inset 3px 0 0 #5fb87a; padding-left: 8px; }
.stim-rub-row.half { box-shadow: inset 3px 0 0 #d6c84e; padding-left: 8px; }
.stim-rub-row.none { box-shadow: inset 3px 0 0 #c74e4e; padding-left: 8px; }
.stim-rub-idea { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.stim-rub-pts { display: inline-block; font-size: 12px; font-weight: 600; color: var(--amber); margin-right: 4px; white-space: nowrap; }
.stim-rub-needs, .stim-rub-zero, .stim-rub-hint, .stim-rub-quote, .stim-rub-note { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.stim-rub-zero { color: #c74e4e; }
.stim-rub-hint { color: var(--amber); font-style: italic; }
.stim-rub-quote { font-style: italic; }
.stim-rub-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.stim-rub-b { font: inherit; font-size: 13px; padding: 6px 12px; min-height: 34px; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg-2); color: var(--ink); cursor: pointer; }
.stim-rub-b:hover { border-color: var(--amber); }
.stim-rub-b.on.ok { background: #5fb87a; border-color: #5fb87a; color: #fff; }
.stim-rub-b.on.mid { background: #d6c84e; border-color: #d6c84e; color: #222; }
.stim-rub-b.on.no { background: #c74e4e; border-color: #c74e4e; color: #fff; }
.stim-rub-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--rule); }
.stim-rub-foot .stim-btn[disabled] { opacity: .55; cursor: not-allowed; }
.stim-rub-list { list-style: none; padding: 0; margin: 6px 0 0; }
.stim-rub-list li { padding: 6px 0 6px 8px; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.stim-rub-list li.ok { box-shadow: inset 3px 0 0 #5fb87a; }
.stim-rub-list li.mid { box-shadow: inset 3px 0 0 #d6c84e; }
.stim-rub-list li.no { box-shadow: inset 3px 0 0 #c74e4e; }
.stim-rub-mark { font-weight: 600; margin-right: 4px; white-space: nowrap; }
.stim-rub-full { margin: 8px 0 0; }
.stim-rub-regrade { margin: 6px 0; }
.stim-rub-regrade > summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.stim-graded-load { display: inline-flex; }
.stim-graded-card { border-color: var(--amber); }
.stim-study-next { margin: 4px 0 8px 18px; padding: 0; }
.stim-guide-fix { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.stim-guide-before, .stim-guide-after { margin-top: 4px; }
.stim-guide-before span, .stim-guide-after span { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
.stim-guide-before span { background: var(--bg-3); color: var(--ink-2); border: 1px solid var(--rule); }
.stim-guide-after span { background: #5fb87a; color: #fff; }
@media (max-width: 560px) { .stim-rub-btns { width: 100%; } .stim-rub-b { flex: 1; } }

/* Oct 24 2026: live time on this question (click to hide; the ⏱ alone brings it back) */
.stim-qclock { background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.stim-qclock:hover { border-color: var(--amber); }
.stim-qclock.paused { opacity: .6; }
.stim-qclock-off { padding: 4px 9px; opacity: .7; }

/* Every objective, adaptive (Oct 24 2026): option chips on the one-click card */
.stim-sweep-quick { border-color: #5fb87a; }
.stim-sweep-quick .stim-sweep-opts { margin: 4px 0 0; gap: 6px; }
.stim-sweep-quick .stim-sweep-opts label { min-width: 0; margin-right: 4px; }
@media (max-width: 560px) { .stim-sweep-quick .stim-sweep-opts label { min-width: 100%; } }
