/* ═══════════════════════════════════════════════════════════════════
   COHORT.RUN — SHARED STYLESHEET
   Covers: teacher_create.html · teacher.html · student.html
   All dynamic classes from: render.js · score.js · revealQ.js ·
   highlight.js · teacher.js · student.js
═══════════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────────
   0. DESIGN TOKENS
─────────────────────────────────────────────────────────────────── */
:root {
	--ink:    #37352F;
	--paper:  #FFFFFF;
	--cream:  #F7F7F5;
	--rule:   #E9E9E7;
	--muted:  #787774;
	--faint:  #9B9A97;
    --dark:   #1A1A1A;
    --accent:     #2B4C3F;
    --gold:       #B8914A;
    --error:      #8B3A3A;
  --green:  #2E7D32;
  --red:    #C0392B;
  --amber:  #D4860A;

  --bg: var(--paper);
  --bg-secondary: var(--cream);
  --bg-hover: rgba(55,53,47,.06);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);

  --ff-d: 'Inter', system-ui, sans-serif;
  --ff-m: 'DM Mono', 'Courier New', monospace;
  --ff-u: 'Inter', system-ui, sans-serif;
}


/* ───────────────────────────────────────────────────────────────────
   1. RESET & BASE
─────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-u);
}

body {
  display: flex;
  flex-direction: column;
}

b{
	font-weight:600;
}

s, strike, u{
text-decoration-thickness: 2px;	
}

::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc8c0; border-radius: var(--radius-sm); }

/* ───────────────────────────────────────────────────────────────────
   2. ANIMATIONS
─────────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}
@keyframes flash-in {
  0%   { background: #e8c200; }
  100% { background: #ebd102; }
}
@keyframes studentModalFadeIn {
  from { transform: scale(.93); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ───────────────────────────────────────────────────────────────────
   3. HEADER  (all three views)
─────────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--ink);
  height: 52px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid #1e1e1e;
  z-index: 100;
  position: relative;
}

.header-left  { display: flex; align-items: center; min-width: 100px; }
.header-center { flex: 1; text-align: center; padding: 0 12px; }
.header-right { display: flex; align-items: center; gap: 10px; min-width: 100px; justify-content: flex-end; }

.header-logo {
  height: 26px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .9;
}

/* Text logo fallback — shown when no img src or img fails to load */
.header-wordmark {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  line-height: 1;
}
.header-wordmark-rule {
  width: 2px;
  height: 22px;
  background: var(--paper);
  opacity: .9;
  margin-right: 10px;
  flex-shrink: 0;
}
.header-wordmark-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--paper);
  letter-spacing: -.01em;
  opacity: .95;
}
.header-wordmark-text span {
  font-family: var(--ff-m);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: .04em;
  margin-left: 1px;
}

.app-title {
   font-family: var(--ff-d);
   font-size: 15px;
   font-weight: 400;
   font-style: italic;
   color: #fff;  
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ───────────────────────────────────────────────────────────────────
   4. GLOBAL BUTTON BASE
   All buttons start transparent/mono — overridden per-context below.
─────────────────────────────────────────────────────────────────── */
button {
  font-family: var(--ff-u);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .01em;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  transition: background .15s, border-color .15s;
}
.btn-new{
	display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 22px 20px;
    font-size: 20px;
    text-decoration: none;
    flex-shrink: 0;
}
button:hover  { background: var(--bg-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .38; cursor: not-allowed; pointer-events: none; }


/* Named button classes */
.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  border: 1px solid var(--accent);
  padding: 10px 24px;
  border-radius: var(--radius-md);
}
.btn-primary:hover   { background: #234034; border-color: #234034; }
.btn-primary:disabled{ opacity: .38; }

.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 10px 24px;
  border-radius: var(--radius-md);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-success {
  background: var(--green);
  color: #FFFFFF;
  border: 1px solid var(--green);
  padding: 10px 24px;
  border-radius: var(--radius-md);
}
.btn-success:hover { background: #245f27; border-color: #245f27; }

.btn-info {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 6px 14px;
  border-radius: var(--radius-md);
}
.btn-info:hover { background: var(--bg-hover); color: var(--ink); }

/* Header-specific buttons */
.timer-btn {
  border-color: var(--rule);
  color: var(--muted);
}
.timer-btn:hover { background: var(--bg-hover); color: var(--ink); }

.end-session-btn {
  border-color: var(--red);
  color: var(--red);
  white-space: nowrap;
}
.end-session-btn:hover { background: var(--red); color: #FFFFFF; }

/* ───────────────────────────────────────────────────────────────────
   5. FORM ELEMENTS
─────────────────────────────────────────────────────────────────── */
input[type="text"]:not(.gap-input),
input[type="email"],
input[type="password"],
.student-input {
  width: 100%;

  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--ff-u);
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus,
.student-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,76,63,.15); }

.lesson-select,
select {
  width: 100%;
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--ff-u);
    background: var(--bg);
    color: var(--ink);
    outline: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    min-width: 120px;
}
.lesson-select:focus,
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,76,63,.15); }

/* Inline selects (matching question type) */
.match-row select {
  border: none;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  width: auto;
  padding: 4px 2px;
 
}
.match-row select:focus { border-bottom-width: 2px; }

label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  
  cursor: pointer;
  font-size: 14px;
  font-family: var(--ff-u);
  color: var(--ink);
}

/* Custom radio + checkbox */
input[type="radio"],
input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--ink);
  width: 16px;
  height: 16px;
}
input[type="radio"] { border-radius: 50%; }



/* Gap fill */
.gap-input {
  border: none;
  border-bottom: 1.5px solid var(--ink);
  outline: none;
  width: 120px;
  padding: 2px 4px;
  font-size: 14px;
  font-family: var(--ff-u);
  background: transparent;
  color: var(--ink);
  transition: border-bottom-width .15s;
}
.gap-input:focus { border-bottom-width: 2px; }
.gap-input:disabled,
.gap-input[disabled] {
  -webkit-text-fill-color: var(--ink);
  opacity: 1;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.gap-input.correct:disabled  { -webkit-text-fill-color: var(--green); border-bottom-color: var(--green); background: transparent; }
.gap-input.incorrect:disabled { -webkit-text-fill-color: var(--red);   border-bottom-color: var(--red);   background: transparent; }

/* Short answer textarea */
.short-answer {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  resize: none;
  font-family: var(--ff-u);
  font-size: 14px;
  padding: 6px 0;
  min-height: 80px;
  outline: none;
  background: transparent;
  color: var(--ink);
}
.short-answer:focus { border-bottom-width: 2px; }

/* ───────────────────────────────────────────────────────────────────
   6. TEACHER CREATE — layout
─────────────────────────────────────────────────────────────────── */
.content-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 40px 48px;
}

.new-session-container {
  max-width: 700px;
}

.new-session-container h2 {
  font-family: var(--ff-d);
  font-size: 28px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}

.top-form {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  flex: 1;
}

.form-group label {
  display: block;
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  cursor: default;
}

/* Lesson preview card */
.lesson-preview {
  background: var(--cream);
  border: 1.5px solid var(--rule);
  border-left: 3px solid var(--ink);
  padding: 20px 24px;
  margin-bottom: 24px;
  animation: fadeUp .2s ease both;
}

.lesson-preview h3 {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
  font-weight: 500;
}

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

.preview-content p {
  font-family: var(--ff-u);
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.preview-content strong {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.preview-content span {
  font-family: var(--ff-d);
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
}

/* ───────────────────────────────────────────────────────────────────
   7. SESSION MODAL / WAITING ROOM  (teacher_create)
─────────────────────────────────────────────────────────────────── */
.start-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.start-modal[style*="flex"] { display: flex !important; }

.start-modal-content {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 36px 40px;
  width: 90%;
  max-width: 800px;
  animation: fadeUp .3s ease both;
}

.session-info {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

/* QR panel */
.start-qr-container {
  background: var(--cream);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.start-qr-container h3 {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 500;
}

#qrcode { display: flex; justify-content: center; }
#qrcode img { border: 4px solid var(--paper); }

#studentUrlDisplay {
  font-family: var(--ff-m);
  font-size: 10px;
  color: var(--muted);
  word-break: break-all;
  text-align: center;
  max-width: 220px;
}

/* Waiting room */
.student-status-container {
  flex: 1;
  min-width: 0;
}

.student-status-container h3 {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 16px;
}

.student-status-list {
  min-height: 80px;
  margin-bottom: 20px;
}

.student-status-list > p {
  font-family: var(--ff-mono, var(--ff-m));
  font-size: 12px;
  color: var(--faint);
  font-style: italic;
}

/* Student grid (injected by updateStudentStatusDisplay) */
.student-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.student-status-item {
  font-family: var(--ff-m);
  font-size: 11px;
  padding: 7px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  color: var(--ink);
  transition: border-color .15s, background .15s;
  padding-right: 22px; /* room for dot */
}
.student-status-item:hover { border-color: var(--ink); }

/* Status dots */
.student-connected::before,
.student-disconnected::before {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
}
.student-connected::before    { background: #4CAF50; box-shadow: 0 0 5px #4CAF50; }
.student-disconnected::before { background: var(--red); }

.student-name { font-weight: 500; }

/* Start button group */
.start-button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  min-width: 140px;
}

/* ───────────────────────────────────────────────────────────────────
   8. TEACHER BOARD — shell layout
─────────────────────────────────────────────────────────────────── */
.content-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* Review bar */
.review-section {
  background: var(--dark);
  border-bottom: 1px solid #1e1e1e;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.review-header h3 {
  font-family: var(--ff-m);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 500;
}

.question-nav { display: flex; gap: 6px; flex-wrap: wrap; }

.question-number-btn {
  font-family: var(--ff-m);
  font-size: 11px;
  padding: 5px 13px;
  background: transparent;
  border: 1.5px solid #2e2e2e;
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
}
.question-number-btn:hover  { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.question-number-btn.active { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* Timer pill */
#timerDisplay {
  font-family: var(--ff-m);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 5px 12px;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ── Left panel (passage + question) ────────────────────────────── */
.left-panel {
  flex: 0 0 44%;
  border-right: 1px solid var(--rule);
  padding: 28px 32px;
  overflow-y: auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 0;
}

#passageTitle,
#currentT{
	font-family: var(--ff-d);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 20px;
}
/* Passage text */
#currentP {
  font-family: 'Inter', sans-serif;
    font-size: 17px;
    line-height: 1.9;
    color: var(--ink);
}
#currentP img, 
#passageText img {
   max-width:100%;
}
#currentP mark{
    background: #ebd1029c;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 1px;
    color: inherit;
}
#currentP ul{
	padding-left:40px;
}
/* Question number + text */
#qNum {
  font-family: var(--ff-d);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

#currentQ { font-size: 14px; color: var(--ink); line-height: 1.6; margin-bottom: 12px; }
#choices   { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; margin-top: 20px;}

/* Correct answer reveal box (teacher left panel) */
#showcorrect {
  font-family: var(--ff-d);
  font-size: 14px;
  line-height: 1.7;
  color: var(--paper);  
  border-radius: var(--radius-sm);
  background:rgba(0,0,0,.2);
  padding: 16px 20px;
  animation: fadeUp .3s ease both;
}
#showcorrect:empty { display: none; }

/* hide-children toggle */
.hide-children > * { display: none; }

/* ── Right panel (responses) ─────────────────────────────────────── */
.right-panel {
  flex: 1;
  background: var(--cream);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.button-container {
  background: var(--ink);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid #1e1e1e;
}

.right-panel > h3 {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 14px 20px 8px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

#responses {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ───────────────────────────────────────────────────────────────────
   9. STUDENT BOARD — layout
─────────────────────────────────────────────────────────────────── */
.layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  position: relative;
}

/* Left — passage */
.student-left-panel {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  background: #fff;
  border-right: 1px solid var(--rule);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}




.passage p, #passageText p { margin-bottom: 1.2em; }
.passage p:last-child, #passageText p:last-child { margin-bottom: 0; }

.hint {
  font-family: var(--ff-m);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: .06em;
  margin-top: 16px;
  padding-left: 20px;
}

/* Layout modes ── card / empty collapse the left panel */
.layout--card .student-left-panel,
.layout--empty .student-left-panel {
  flex: 0 0 0;
  width: 0;
  padding: 0;
  opacity: 0;
  border-right: none;
  overflow: hidden;
  pointer-events: none;
}

.layout--card .student-right-panel,
.layout--empty .student-right-panel {
  flex: 1;
  width: auto;
}

/* Passage card — visible only in card mode */
.passage-card {
  display: none;

  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--cream);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  flex-shrink: 0;
  max-height: 40vh;
  overflow-y: auto;
}
.passage-card img,
.passage-card video {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}
.passage-card audio { width: 100%; }

.layout--card .passage-card {
  display: block;
}

/* Right — question panel */
.student-right-panel {
  width: 380px;
  flex-shrink: 0;
  background:var(--paper);
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.student-header {
  background: var(--ink);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}

#studentInfo {
  font-family: var(--ff-m);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
}
#studentInfo strong { color: var(--paper); font-weight: 500; }

#questionText {
  font-family: var(--ff-d);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  padding: 20px 0px 14px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

 #question-body {
      flex: 1;
      overflow-y: auto;
      padding: 0px 20px;
	  background: var(--paper);
    }

/* Submit button */
#submitBtn {
  font-family: var(--ff-m);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, opacity .15s;
  border-top: 1px solid #1e1e1e;
  margin: 0;
  width: 100%;
}
#submitBtn:hover:not(:disabled) { background: #2a2a2a; }
#submitBtn:disabled { opacity: .38; cursor: not-allowed; }

/* ───────────────────────────────────────────────────────────────────
   10. MOBILE DRAWER  (student)
─────────────────────────────────────────────────────────────────── */
#drawerHandle {
  position: fixed;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 52px;
  background: var(--ink);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  transition: right .3s ease;
  user-select: none;
  touch-action: manipulation;
}

#drawerHandle svg {
  width: 12px; height: 12px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s;
}
#drawerHandle.open svg { transform: rotate(180deg); }

/* Question number label on drawer handle */
#drawerLabel {
  font-family: var(--ff-m);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .06em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  user-select: none;
}

/* New-question badge dot */
#drawerHandle::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #e53935;
  border: 1.5px solid var(--ink);
  opacity: 0;
  transform: scale(0);
  transition: opacity .2s, transform .2s;
}
#drawerHandle.has-new::after {
  opacity: 1;
  transform: scale(1);
}

/* Lock overlay (student) */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,.65);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
/* JS flips to display:flex or display:block for the backdrop */
#overlay { display: none; }
#overlay.active { display: block; background: rgba(0,0,0,.2); z-index: 99; }

.overlay-message {
  font-family: var(--ff-m);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--paper);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.overlay-message::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--faint);
  animation: pulse 1.6s infinite;
  display: inline-block;
}

/* ───────────────────────────────────────────────────────────────────
   11. QUESTION TYPE COMPONENTS  (render.js)
─────────────────────────────────────────────────────────────────── */
.question { max-width: 760px; }
.question + .question { border-top: 1px solid var(--rule); padding-top: 32px; }

/* Match row */
.match-row {
  display: flex;
  align-items: center;
  gap: 20px;

}

/* Ordering list */
.order-list { list-style: none; padding: 0; margin: 0; }


.order-list li:active      { cursor: grabbing; }
.order-list li.dragging    { opacity: .4; }
.order-list li.correct     { background: #d4edda; }
.order-list li.incorrect   { background: #f8d7da; }

.drag-handle { font-size: 14px; opacity: .5; }

/* Letter badge on each ordering item */
.order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--ff-m);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

/* Ordering reveal — correct column + student list side by side */
.ordering-reveal-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.ordering-correct-col {
  display: flex;
  flex-direction: column;
  gap: 10px; /* matches .order-list li margin-bottom */
  flex-shrink: 0;
  align-self: stretch;
}
.order-correct-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--ff-m);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  animation: fadeUp .2s ease both;
}

.ordering-reveal-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* correct col centers each badge with its li */
.ordering-reveal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px; /* matches li margin-bottom */
  background: transparent;
}
.ordering-badge-cell {
  width: 32px;
  text-align: center;
  vertical-align: middle;
  padding-right: 8px;
  background: transparent;
  border: none;
}
.ordering-item-cell {
  vertical-align: middle;
  background: transparent;
  border: none;
  padding: 0;
}
/* the li inside still carries all the visual styling */


audio { display: block; margin-top: 16px; width: 100%; }

/* ───────────────────────────────────────────────────────────────────
   12. REVEAL STATES  (revealQ.js — adds .correct / .incorrect)
─────────────────────────────────────────────────────────────────── */
.correct   { background: #d4edda; border-radius: var(--radius-sm); }
.incorrect { background: #2e2e2e !important;
    border-radius: var(--radius-sm);
    text-decoration: line-through;
    color: #fff !important;}
/* line-through only on MCQ/TF labels, not gap inputs */
label.incorrect { text-decoration: line-through; }

/* correct-answer pill — appears inline after incorrect gap/match */
.dropdown-reveal-hint {
  font-family: var(--ff-u, 'Inter', sans-serif);
  font-size: 13px;
  color: var(--green, #5a9e6f);
  margin-top: 8px;
}
.reveal-correct-label {
  font-family: var(--ff-m, 'DM Mono', monospace);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-right: 4px;
}

.correct-answer-pill {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  font-family: var(--ff-m);
  font-size: 11px;
  font-weight: 500;
  color: #e8f5e8;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: #1a2e1a;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  animation: fadeUp .2s ease both;
}

/* matching correct answer — same pill, sits after the select */
.match-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }



/* Correct answer box (teacher reveal panel) */
.correct-answer-box {
  background: #f0f7f0;
  border-left: 3px solid var(--green);
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  animation: fadeUp .25s ease both;
}
.correct-answer-box strong {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.correct-answer-text {
  font-family: var(--ff-d);  
  color: #000;
}

/* Correct highlight box */
.correct-highlight-box {
  background: #f0f7f0;
  border-left: 3px solid var(--green);
  padding: 14px 18px;
  margin-top: 16px;
  border-radius: var(--radius-sm);
}
.correct-highlight-box h4 {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}

/* ───────────────────────────────────────────────────────────────────
   13. STUDENT RESPONSE CARDS  (teacher reveal right panel)
─────────────────────────────────────────────────────────────────── */
.student-response {
  border: 1px solid var(--rule);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  margin-bottom: 10px;
  transition: border-color .15s;
  animation: slideIn .25s ease both;
}
.student-response:hover { border-color: var(--ink); }

.student-name {
  font-family: var(--ff-m);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.student-answer {
  padding: 6px 10px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  margin: 6px 0;
  font-family: var(--ff-m);
  font-size: 12px;
}

.student-highlight {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fffbe6;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--amber);
  font-size: 13px;
  font-style: italic;
}

.student-answer-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  margin: 4px 0;
  background: var(--paper);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--faint);
  font-family: var(--ff-m);
  font-size: 12px;
}

/* Submitted / waiting rows (teacher.js → renderSubmittedBoard2) */
.submitted-student {
  font-family: var(--ff-m);
  font-size: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  letter-spacing: .02em;
  animation: slideIn .25s ease both;
  transition: background .15s;
}
.submitted-student.green   { background: rgba(13,13,13,.04); border-color: var(--rule); color: var(--ink); }
.submitted-student.red     { background: rgba(192,57,43,.05); border-color: rgba(192,57,43,.2); color: var(--ink); }
.submitted-student.pending { background: transparent; border-color: var(--rule); color: var(--muted); cursor: pointer; }
.submitted-student.pending:hover { border-color: var(--ink); color: var(--ink); }

/* waiting-student (same treatment as pending) */
.waiting-student {
  font-family: var(--ff-m);
  font-size: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  color: var(--muted);
  letter-spacing: .02em;
}

.session-ended-message {
  font-family: var(--ff-m);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 12px 0;
}

.waiting {
  font-family: var(--ff-m);
  font-size: 12px;
  color: var(--faint);
  text-align: center;
  padding: 24px 0;
}

/* colour util classes */
.red   { color: var(--red); }
.green { color: var(--green); }

/* ───────────────────────────────────────────────────────────────────
   14. TEXT HIGHLIGHT  (highlight.js)
─────────────────────────────────────────────────────────────────── */
.highlighted {
  background: #ebd102;
  border-bottom: 2px solid #d6a305;  
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.highlighted:hover,
.highlighted.active  { background: #f5d800; border-color: #e0a800; }
.highlighted.removing{ background: #f8b4b4; border-color: var(--red); }
.highlighted.new     { animation: flash-in .35s ease-out forwards; }

/* Teacher / reveal highlights */
.highlighted-correct { background: #90EE90; font-weight: bold; padding: 0 2px; border-radius: var(--radius-sm); }
.highlighted-student { background: #ebd102; font-weight: bold; padding: 0 2px; border-radius: var(--radius-sm); }
.highlight-green     { background: #8cff8c; }
.highlight-red       { background: #ffb3b3; }

/* Highlight popover */
#hl-popover {
  position: fixed;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translateX(-50%);
}
#hl-popover.visible { display: flex; pointer-events: auto; }

#hl-popover-btn {
  font-family: var(--ff-m);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: background .1s;
}
#hl-popover-btn:hover { background: #2a2a2a; }

#hl-popover-arrow {
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--ink);
}

/* ───────────────────────────────────────────────────────────────────
   15. SCORING OVERLAY  (score.js)
─────────────────────────────────────────────────────────────────── */
.scoring-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.scoring-overlay.hidden { display: none; }

.scoring-pad {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 420px;
  padding: 28px;
  animation: fadeUp .25s ease both;
}

.scoring-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.student-info { display: flex; align-items: center; gap: 10px; }

#scoringStudentName {
  font-family: var(--ff-d);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

/* Close × button inside scoring pad */
.scoring-header > button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--muted);
  line-height: 1;
  padding: 4px;
  transition: color .15s;
  margin: 0;
  letter-spacing: 0;
}
.scoring-header > button:hover { color: var(--ink); }

/* Score grid */
.score-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-bottom: 20px;
}

.score-btn,
.score-grid button {
  width: 100%;
  height: 38px;
  border: 1.5px solid var(--ink);
  background: transparent;
  font-family: var(--ff-m);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  transition: all .15s;
  margin: 0;
  letter-spacing: 0;
}
.score-btn:hover,
.score-grid button:hover,
.score-btn.active,
.score-grid button.active {
  background: var(--ink);
  color: var(--paper);
}

.comment-section { margin-bottom: 20px; }

.comment-section label {
  display: block;
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  cursor: default;
}

#scoreComment {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--ff-m);
  font-size: 12px;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--faint);
  border-radius: var(--radius-sm);
  resize: none;
  outline: none;
  transition: border-color .15s;
}
#scoreComment:focus { border-color: var(--ink); }

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

.submit-btn {
  flex: 1;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 11px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--ff-m);
  font-size: 12px;
  letter-spacing: .08em;
  margin: 0;
  transition: background .15s;
}
.submit-btn:hover { background: #2a2a2a; }

.cancel-btn {
  flex: 1;
  background: transparent;
  border: 1.5px solid var(--rule);
  color: var(--muted);
  padding: 11px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--ff-m);
  font-size: 12px;
  letter-spacing: .08em;
  margin: 0;
  transition: all .15s;
}
.cancel-btn:hover { border-color: var(--ink); color: var(--ink); }

/* ───────────────────────────────────────────────────────────────────
   16. MODALS — shared base
─────────────────────────────────────────────────────────────────── */
.modal,
.student-ended-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,.72);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.modal[style*="flex"],
.student-ended-modal[style*="flex"],
.modal[style*="block"] { display: flex !important; }

.modal-content,
.student-ended-modal-content {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 40px 48px;
  width: 90%;
  text-align: center;
  animation: fadeUp .25s ease both;
}
.modal-content { max-width: 400px; }
.student-ended-modal-content { max-width: 380px; animation: studentModalFadeIn .4s ease both; }

.modal-content h2,
.student-ended-modal-content h2 {
  font-family: var(--ff-d);
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 10px;
}
.modal-content h3 {
  font-family: var(--ff-d);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.modal-content p,
.student-ended-modal-content p {
  font-family: var(--ff-m);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  letter-spacing: .03em;
  margin-bottom: 24px;
}

.modal-buttons { display: flex; justify-content: center; gap:20px;}

.modal-buttons button,
.modal-content > button {
  font-family: var(--ff-m);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 12px 32px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  margin: 0;
}
.modal-buttons button:hover,
.modal-content > button:hover { background: #2a2a2a; }

/* Close X button inside modal */
.modal-close-x {
  position: absolute !important;
  top: 12px !important;
  right: 14px !important;
  background: none !important;
  border: none !important;
  font-size: 20px !important;
  line-height: 1 !important;
  padding: 0 !important;
  color: var(--muted) !important;
  cursor: pointer !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.modal-close-x:hover { color: var(--ink) !important; background: none !important; }

/* Waiting modal pulse underline */
#waitingModal h3::after {
  content: '';
  display: block;
  width: 32px; height: 2px;
  background: var(--faint);
  margin: 12px auto 0;
  animation: pulse 1.6s infinite;
}

/* Student name input (join modal) */
#studentNameInput {
  width: 100%;
  max-width: 240px;
  padding: 12px 14px;
  font-family: var(--ff-u);
  font-size: 15px;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  outline: none;
  margin: 0 auto 20px;
  display: block;
  transition: border-color .15s;
  text-align: center;
}
#studentNameInput:focus { border-color: var(--muted); }
#studentNameInput::placeholder { color: var(--faint); }

/* ───────────────────────────────────────────────────────────────────
   17. SESSION SUMMARY MODAL  (teacher.js → showSessionSummary)
─────────────────────────────────────────────────────────────────── */
#sessionSummaryModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 16px;
}
#sessionSummaryModal[style*="block"] { display: flex !important; }

.summary-modal {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 920px;
  overflow: hidden;
  animation: fadeUp .3s ease both;
}

.summary-header {
  background: var(--ink);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.summary-header h2 {
  font-family: var(--ff-d);
  font-size: 20px;
  font-weight: 700;
  color: var(--paper);
}
.session-id {
  font-family: var(--ff-m);
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: .06em;
}
.button-group { display: flex; gap: 8px; }

.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--rule);
}
.stat-card {
  padding: 20px 24px;
  border-right: 1px solid var(--rule);
  text-align: center;
}
.stat-card:last-child { border-right: none; }

.stat-value {
  font-family: var(--ff-d);
  font-size: 32px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}

.summary-columns { display: flex; }
.summary-section {
  flex: 1;
  padding: 24px 28px;
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.summary-section:last-child { border-right: none; }
.summary-section h3 {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 500;
}

/* Question / student stat rows */
.question-stat,
.student-stat {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.question-stat:last-child,
.student-stat:last-child { border-bottom: none; margin-bottom: 0; }

.question-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.question-number {
  font-family: var(--ff-m);
  font-size: 11px;
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.question-text,
.student-name {
  font-family: var(--ff-u);
  font-size: 13px;
  color: var(--ink);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.question-accuracy,
.student-score {
  font-family: var(--ff-m);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.progress-bar {
  height: 3px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width .6s ease;
}

.question-details,
.student-details {
  display: flex;
  gap: 16px;
  font-family: var(--ff-m);
  font-size: 11px;
  color: var(--muted);
}

#studentPerformance {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* ───────────────────────────────────────────────────────────────────
   18. UTILITY
─────────────────────────────────────────────────────────────────── */
.hidden          { display: none !important; }
.hide-children > * { display: none; }
.divider         { height: 1px; background: var(--rule); margin: 14px 0; }

body.session-ended .content-container {
  opacity: .4;
  pointer-events: none;
}

/* ───────────────────────────────────────────────────────────────────
   19. RESPONSIVE
─────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Teacher board */
  .content-container { flex-direction: column; }
  .left-panel, .right-panel { flex: none; height: 50vh; }

  /* Summary modal */
  .summary-stats   { grid-template-columns: repeat(2, 1fr); }
  .summary-columns { flex-direction: column; }
  .summary-section { border-right: none; border-bottom: 1px solid var(--rule); }
  .summary-section:last-child { border-bottom: none; }

  /* Student layout — drawer mode */
  .student-left-panel {
    width: 100%;
    border-right: none;
    padding: 16px;
  }
  
  
  
  .student-right-panel {
    position: fixed;
    top: 52px; right: 0; bottom: 0;
    width: 80%;
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 1000;
  }
  .student-right-panel.open { transform: translateX(0); }

  #drawerHandle { display: flex; }

  /* Create page */
  .session-info { flex-direction: column; }
  .content-wrapper { padding: 24px 20px; }
  .top-form { flex-direction: column; align-items: stretch; }
}

@media (max-width: 520px) {
  .passage-wrap { padding: 24px 18px; }
  .summary-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .app-title { font-size: 14px; display:none;}
  .start-modal-content { padding: 24px 20px; }
}

/* Media viewer */
.passage-image { display: block; max-width: 100%; margin: 1.4em 0; cursor: zoom-in; border: 1.5px solid var(--rule); transition: opacity 0.15s; }
.passage-image:hover { opacity: 0.88; }
#lightbox { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.88); align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox.open { display: flex; }
#lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; box-shadow: var(--shadow-lg); animation: lb-in 0.18s ease; }
@keyframes lb-in { from { transform: scale(0.93); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#lightbox-close { position: absolute; top: 16px; right: 20px; font-family: var(--mono); font-size: 0.72rem; color: rgba(255,255,255,0.6); letter-spacing: 0.08em; cursor: pointer; user-select: none; touch-action: manipulation; }
#SessionID {color:#fff; font-size:14px;  width: 100%;  text-align: right;}
.header-wordmark:focus {
    outline: none;
}

.gap-blank:empty::after{
  content: "?";
  color: red;
  display: inline-block;
}

/* ── Choice items (MCQ / True-False / Multiple-select) ── */
.choice-item {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.13s;
  user-select: none;
}
.choice-item:hover {
  border-color: var(--ink);
}
.choice-item input[type="radio"],
.choice-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-item.selected {
  border-color: var(--accent);
  background: rgba(43, 76, 63, 0.05);
}
.choice-badge {
  width: 36px;
  min-width: 36px;
  min-height: 42px;
  height: stretch;
  background: var(--paper-dark);
  border-right: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.choice-item.selected .choice-badge {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.choice-text {
  padding: 10px 14px;
  flex: 1;
}

/* ── Gap fill ── */
.gap-display {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 14px;
}
.gap-input {
  border: none;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  min-width: 80px;
  padding: 0 4px;
  color: inherit;
  outline: none;
}

/* ── Matching ── */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.match-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
}
.match-left {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-right: none;
}
.match-arrow {
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}
.match-row select {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  cursor: pointer;
}

/* ── Ordering ── */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.order-list li {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  cursor: grab;
  user-select: none;
  transition: opacity 0.13s;
}
.order-list li.dragging {
  opacity: 0.4;
}
.order-num {
  width: 36px;
  min-height: 42px;
  background: var(--paper-dark);
  border-right: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  flex-shrink: 0;
}
.order-text {
  flex: 1;
  padding: 10px 14px;

}
.drag-handle {
  margin-right: 8px;
  opacity: 0.35;
}

/* ── Short answer ── */
.short-answer {
  width: 100%;
  min-height: 120px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 12px 14px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.short-answer:focus {
  border-color: var(--ink);
}

/* Remove the absolute/pointer-events approach entirely */
.choice-item {
  position: relative;
  cursor: pointer;
}

.choice-item input[type="radio"],
.choice-item input[type="checkbox"] {
  /* visually hidden but fully interactive */
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

/* radio: only one can be selected */
.choice-item:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: rgba(43, 76, 63, 0.05);
}
.choice-item:has(input[type="radio"]:checked) .choice-badge {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* checkbox: multiple can be selected */
.choice-item:has(input[type="checkbox"]:checked) {
  border-color: var(--accent);
  background: rgba(43, 76, 63, 0.05);
}
.choice-item:has(input[type="checkbox"]:checked) .choice-badge {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.choice-item.correct::after {
  content: '✓';
  padding: 0 12px;
  color: var(--accent);
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ordering-item-cell li.correct::after{
  content: '✓';
  padding: 0 12px;
  color: var(--accent);
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Matching ── */
.match-pairs-section {
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}
.match-pairs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.match-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 4px 0 16px;
}
.match-btn {
  padding: 10px 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  text-align: left;
  width: 100%;
  transition: border-color 0.13s;
}
.match-btn:hover { border-color: var(--ink); }
.match-btn.selecting {
  border-color: var(--ink);
  background: var(--paper-dark);
  color: var(--ink);
}
.match-btn.paired {
  opacity: 0.4;
  cursor: default;
  font-style: italic;
}

/* pair stack */
.pair-stack { display: flex; flex-direction: column; }
.pair-top {
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-bottom: none;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  display: flex; align-items: center; justify-content: space-between;
}
.pair-bottom {
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.pair-bottom:hover { background: var(--paper-dark); }
.pair-unpair { font-size: 11px; color: var(--muted); flex-shrink: 0; }

/* reveal states */
.pair-correct .pair-top { background: var(--accent); border-color: var(--accent); }
.pair-correct .pair-bottom { border-color: var(--accent); color: var(--accent); }

.pair-wrong .pair-top { background: var(--error); border-color: var(--error); }
.pair-wrong .pair-bottom { border-color: var(--error); color: var(--error); text-decoration: line-through; }

.pair-answer {
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-top: none;
  background: rgba(43, 76, 63, 0.06);
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-style: italic;
  display: flex; align-items: center; gap: 8px;
}

#passageText {    
	font-family: 'Inter', sans-serif;
    font-size: 17px;
    line-height: 1.9;
    color: var(--ink);
  }
  
  .font-btn{
	  
	  background: none;
    border: 1px solid #333;
    color: #aaa;
    cursor: pointer;
    padding: 4px 10px;
    font-size: 12px;
    transition: all 0.13s;
    font-family: 'Inter', sans-serif;
  }
#timerDisplay, #SessionID {
      font-family: 'DM Mono', monospace;
      font-size: 12px;
      color: var(--muted);
      padding: 4px 8px;      
      border-radius: var(--radius-sm);
	  line-height: 20px;
}

#guidanceText ol, .guidance-text ol{
	padding-left:25px;
}

/* ── Answer guidance block (student, ls/cs, preview, review) ── */
.guidance-block {
  display: none;
  margin-bottom: 14px;
  border-left: 3px solid var(--gold, #b8914a);
  padding: 10px 14px;
  background: rgba(184,145,74,0.06);
}
.guidance-block.visible { display: block; }
.guidance-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold, #b8914a);
  margin-bottom: 5px;
  font-family: var(--ff-m, 'DM Mono', monospace);
}


.sub-list-answer{
	font-size: 14px;
    line-height: 24px;
}
.sub-list-cat-label{
font-weight: 600;
    padding-top: 10px;
}

/* ── Passage image viewport cap ───────────────────────────────────── */
/* Any image inside a passage area (teacher, student, LS/CS scoring,
   lesson preview/review) must never exceed the viewport. Lightbox
   handles zoom if the image ends up visually small. Placed before
   .img-grid-item so grid thumbnails keep their aspect-ratio sizing. */
.passage-img-fit,
.passage img,
.passage-text img,
#passageText img,
.passage-wrap img,
.passage-card img,
.passage-area img,
.col-passage img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ── Passage image grid ───────────────────────────────────────────── */
.img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.img-grid-item { display: flex; flex-direction: column; }
.img-grid-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  display: block;
}
.img-grid-item .img-caption {
  font-size: 12px;
  color: var(--muted, #9A9488);
  line-height: 1.3;
  margin-top: 5px;
  font-style: italic;
}

/* ── Lightbox ─────────────────────────────────────────────────────── */
.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: zoom-out;
}
.img-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  box-shadow: var(--shadow-lg);
}
.img-lightbox .img-lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #f5f5f5;
  font-size: 14px;
  font-style: italic;
  background: rgba(0,0,0,0.5);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  max-width: 80vw;
  text-align: center;
}

.ql-table-embed table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}

.ql-table-embed td,
.ql-table-embed th {
  border: 1px solid #C4BEB0;  /* matches your --rule variable */
  padding: 8px 12px;
  vertical-align: top;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.ql-table-embed tr:first-child td {
  font-weight: 500;
  background: #E8E4D9;  /* matches --paper-dark */
}
#questionGuidanceText ol{
	margin-left:10px;
}

/* ────────────────────────────────────────────────────
   CLUSTER SLIDER  (shared base; teacher copies subset)
──────────────────────────────────────────────────── */
.cluster-slider-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.cluster-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--rule);
}

.cluster-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background 0.15s;
}
.cluster-dot.active { background: var(--ink); }

.cluster-arrow {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.13s;
}
.cluster-arrow:hover:not(:disabled) { color: var(--ink); }
.cluster-arrow:disabled { opacity: 0.25; cursor: default; }

.cluster-slides-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.cluster-slide {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 16px 20px;
}
.cluster-slide.active { display: block; }

.cluster-q-counter {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Custom audio player (.cap) — shared across editor, student, teacher ── */
.cap { background:var(--ink); border-radius:var(--radius-md); display:flex; align-items:center; gap:10px; padding:9px 13px; box-sizing:border-box; width:100%; user-select:none; }
.cap audio { display:none !important; }
.cap-btn { background:none; border:none; padding:0; cursor:pointer; color:var(--paper); display:flex; align-items:center; justify-content:center; flex-shrink:0; line-height:1; }
.cap-pp { width:24px; height:24px; border-radius:50%; border:1.5px solid rgba(245,240,232,.25) !important; font-size:9px; opacity:.85; }
.cap-pp:hover { opacity:1; }
.cap-jmp { font-size:12px; opacity:.4; }
.cap-jmp:hover { opacity:.85; }
.cap-tw { flex:1; height:20px; display:flex; align-items:center; cursor:pointer; }
.cap-track { width:100%; height:3px; background:rgba(245,240,232,.14); border-radius:var(--radius-sm); position:relative; }
.cap-fill { height:100%; background:var(--gold); border-radius:var(--radius-sm); width:0; pointer-events:none; }
.cap-thumb { width:8px; height:8px; background:var(--paper); border-radius:50%; position:absolute; top:50%; left:0; transform:translate(-50%,-50%); pointer-events:none; }
.cap-time { font-family:var(--ff-m); font-size:10px; color:rgba(245,240,232,.38); white-space:nowrap; letter-spacing:.02em; }
.cap-edit { font-size:11px; opacity:.3; }
.cap-edit:hover { opacity:.8; }
