/* Retenra format identities, premium redesign experiment
   Phase 4. Each study format gets its own presentation while
   its mechanics stay exactly as they were: the question formats
   share a session frame (an objective line, an animated session
   bar, an end of session summary), flashcards become a tactile
   card object, hands on types carry their own header treatment
   and motif, matching pairs draw their connection, the written
   response reads as a documentation surface, and the final exam
   keeps a calm, quiet presentation. Tokens only, from the
   Phase 1 design system; gold stays on achievements, red stays
   on error and incorrect answers. */

/* ---------- the shared session frame ---------- */
.session-objective {
  font-size: var(--text-body);
  color: var(--muted);
  max-width: 62rem;
  margin: 0 0 var(--space-3);
}
.session-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
  margin: 0 0 var(--space-2);
}
.session-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--grad-progress);
  transition: width var(--dur-3) var(--ease-out);
}
.session-summary {
  border-top: 1px solid var(--line);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
}
.session-summary p { margin: var(--space-1) 0; }
.session-summary .session-door { margin-top: var(--space-2); }

/* ---------- sound control ---------- */
.sound-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-3) 0;
}
.sound-row .caption { margin: 0; }

/* ---------- flashcards as a card object ---------- */
#fc-card {
  box-shadow: var(--elev-3);
  border-radius: 18px;
  touch-action: pan-y;
}
#fc-card .fc-inner { transition: transform 0.45s var(--ease-inout); }
#fc-card.fc-dragging { cursor: grabbing; }
#fc-card.fc-dragging .fc-inner { transition: none; }
.fc-deck {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
}
.fc-deck-stack {
  flex: none;
  width: 22px;
  height: 16px;
  border-radius: 4px;
  background: var(--surface);
  border: 1.5px solid var(--navy);
  box-shadow: 3px 3px 0 var(--surface-2), 6px 6px 0 var(--line);
  margin: 0 6px 6px 0;
}
.fc-deck-bar {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.fc-deck-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--grad-progress);
  transition: width var(--dur-3) var(--ease-out);
}

/* ---------- hands on type identity ---------- */
.ho-card { border-top: 4px solid var(--navy); }
.ho-card.ho-type-hotspot, .ho-type-hotspot { --ho-accent: var(--blue); }
.ho-card.ho-type-calc, .ho-type-calc { --ho-accent: var(--teal); }
.ho-card.ho-type-matching, .ho-type-matching { --ho-accent: var(--navy-2); }
.ho-card.ho-type-ruleofnines, .ho-type-ruleofnines { --ho-accent: var(--blue-dark); }
.ho-card.ho-type-hotspot { border-top-color: var(--blue); }
.ho-card.ho-type-calc { border-top-color: var(--teal); }
.ho-card.ho-type-matching { border-top-color: var(--navy-2); }
.ho-card.ho-type-ruleofnines { border-top-color: var(--blue-dark); }
.ho-motif {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--ho-accent, var(--navy));
  vertical-align: -7px;
  margin-right: var(--space-2);
}
.ho-motif svg { display: block; }
.ho-tests {
  color: var(--muted);
  font-size: var(--text-small);
  margin: 0 0 var(--space-3);
}

/* ---------- matching connections ---------- */
.match-grid.ho-linked { position: relative; }
.match-grid .ho-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.match-grid .ho-links line {
  stroke: var(--teal);
  stroke-width: 2;
  opacity: 0.55;
}
.match-grid .option.matched::after {
  content: attr(data-pair);
  margin-left: auto;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
@keyframes ho-complete-ring {
  from { box-shadow: 0 0 0 0 var(--teal-soft); }
  to { box-shadow: 0 0 0 14px transparent; }
}
.match-grid.ho-linked-complete { animation: ho-complete-ring 0.6s var(--ease-out) 2; border-radius: 12px; }

/* ---------- written response as documentation ---------- */
.wr-grid { display: grid; gap: var(--space-4); }
@media (min-width: 920px) {
  .wr-grid { grid-template-columns: 1fr 1.25fr; align-items: start; }
}
.wr-ref {
  background: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-3) var(--space-4);
}
.wr-ref .caption { margin-top: 0; }
.wr-ref p { margin: var(--space-2) 0; }
.wr-edit textarea.answer {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--elev-1);
  font-size: var(--text-body);
  line-height: 1.55;
}
#panel-written .rubric li { align-items: flex-start; }
#panel-written .rubric .mark {
  border: 1.5px solid currentColor;
  border-radius: 6px;
  padding: 1px 6px;
  text-align: center;
  transform: rotate(-2deg);
  font-size: var(--text-small);
  letter-spacing: 0.02em;
}
#panel-written .feedback.show {
  border-left: 4px solid var(--navy);
}

/* ---------- final exam, calm and quiet ---------- */
#panel-exam #e-card { box-shadow: none; border-color: var(--surface-2); }
#panel-exam #e-stem { line-height: 1.5; }
#panel-exam #e-timer { font-variant-numeric: tabular-nums; color: var(--muted); }
#panel-exam .session-bar i { background: var(--navy-2); }
#panel-exam .quiz-actions { margin-top: var(--space-5); }

/* Phase 6 finishing pass on the same panel: the intro reads as
   a calm exam day brief (the panel's own facts, set out as
   quiet rows), and the results card takes the closing
   treatment: the shared score ring, the band line set in the
   type scale, the domain rows at the progress page measure,
   and the next step line under a hairline. Presentation only;
   the run, the counts, the timing, and the end screen facts
   are exactly as they were. */
#panel-exam #e-intro { box-shadow: none; border-color: var(--surface-2); }
.exam-facts { list-style: none; margin: 0 0 var(--space-5); padding: 0; }
.exam-facts li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-4); padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}
.exam-facts li:last-child { border-bottom: none; }
.exam-fact-name { color: var(--muted); font-size: var(--text-small); flex: none; }
.exam-facts strong { font-weight: 700; text-align: right; }
#panel-exam #e-results { box-shadow: none; border-color: var(--surface-2); }
#panel-exam #e-final { font-size: var(--text-h2); color: var(--navy); letter-spacing: -0.01em; }
#panel-exam #e-detail { max-width: 38rem; margin-left: auto; margin-right: auto; }
#panel-exam #e-domains { max-width: 34rem; margin: var(--space-5) auto 0; text-align: left; }
#panel-exam #e-next { max-width: 34rem; margin: var(--space-4) auto 0; border-top: 1px solid var(--line); padding-top: var(--space-4); text-align: left; }
#panel-exam .e-next-line { margin: 0; color: var(--muted); }
#panel-exam .e-next-line strong { color: var(--ink); }

/* ---------- sticky session header, Phase 5 ----------
   On small screens the session header (the objective line,
   the session bar, the progress line, and the domain line)
   sticks just under the site header while the answer options
   scroll beneath it, so position and progress stay visible
   for the whole question. Desktop keeps the static frame. */
@media (max-width: 760px) {
  .session-head {
    position: sticky;
    top: 56px;
    z-index: 5;
    background: var(--surface);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--line);
  }
}
