/*
 * Module 3 · M3 Calendar Close · module-specific overlays
 * ---------------------------------------------------------------------------
 * Inherits ../scorm-shell/styles/shell.css tokens (--ftc-*) + apps.css.
 * This file adds: narrative-overlay panel, event-log timeline visual,
 * disabled-dial-button affordance, completion-problem card, quiz UI,
 * key-takeaway card. WCAG 2.1 AA verified (see ux-design-system.md §9).
 */

/* ===== Module palette extension (token-only, no overrides) ============== */
:root {
  --m3-overlay-bg:        rgba(15, 20, 25, 0.06);
  --m3-overlay-shadow:    0 14px 38px rgba(15, 20, 25, 0.18);
  --m3-pill-radius:       999px;
  --m3-card-radius:       12px;
  --m3-gate-stripe:       repeating-linear-gradient(
                            45deg,
                            rgba(180, 35, 24, 0.08) 0 6px,
                            rgba(180, 35, 24, 0.16) 6px 12px
                          );
}

/* ===== Welcome intro card · module load ================================ */
.welcome-card {
  position: fixed;
  inset: 0;
  background: rgba(10, 26, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 9500;
  animation: welcome-card-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.welcome-card--out { animation: welcome-card-out 220ms ease-in forwards; }
.welcome-card__panel {
  background: var(--ftc-paper, #ffffff);
  padding: 36px 40px 32px;
  border-radius: 14px;
  max-width: 460px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 60px rgba(10, 26, 16, 0.28);
  text-align: center;
  font-family: var(--ftc-font-sans);
}
.welcome-card__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--brand-green, #0a8754);
  color: #fff;
  border-radius: 6px;
  font-family: var(--ftc-font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.welcome-card__kicker {
  font-family: var(--ftc-font-mono);
  font-size: 11px;
  color: var(--brand-green, #0a8754);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.welcome-card__title {
  font-family: var(--ftc-font-sans);
  font-size: 32px;
  font-weight: 700;
  color: var(--ftc-ink, #0a1a10);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.welcome-card__meta {
  font-family: var(--ftc-font-mono);
  font-size: 11px;
  color: var(--ftc-ink-2, #4d5a51);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 22px;
}
.welcome-card__lede {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ftc-ink-2, #4d5a51);
  margin: 0 0 28px;
}
.welcome-card__start {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 28px;
  background: var(--brand-green, #0a8754);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: var(--ftc-font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.06s;
}
.welcome-card__start:hover { background: var(--brand-green-deep, #07683f); }
.welcome-card__start:active { transform: translateY(1px); }
.welcome-card__start:focus-visible {
  outline: 3px solid var(--brand-green-deep, #07683f);
  outline-offset: 3px;
}
@keyframes welcome-card-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes welcome-card-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.96); }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-card,
  .welcome-card--out { animation: none; }
}

/* ===== End-of-module summary card ====================================== */
.summary-card {
  position: fixed;
  inset: 0;
  background: rgba(10, 26, 16, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 9500;
  animation: welcome-card-in 280ms cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
  overflow-y: auto;
}
.summary-card__panel {
  background: var(--ftc-paper, #ffffff);
  padding: 36px 40px;
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(10, 26, 16, 0.32);
  text-align: center;
  font-family: var(--ftc-font-sans);
}
.summary-card__check {
  width: 56px; height: 56px;
  display: inline-grid; place-items: center;
  background: var(--brand-green, #0a8754);
  color: #fff;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  animation: summary-check-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* not passed yet: a retry mark instead of a green tick */
.summary-card__check.is-retry { background: var(--accent-warn, #f5b800); color: #1a1a1a; }
@keyframes summary-check-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.summary-card__kicker {
  font-family: var(--ftc-font-mono);
  font-size: 11px;
  color: var(--brand-green, #0a8754);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.summary-card__title {
  font-family: var(--ftc-font-sans);
  font-size: 26px;
  font-weight: 700;
  color: var(--ftc-ink, #0a1a10);
  margin: 0 0 24px;
  letter-spacing: -0.015em;
}
.summary-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.summary-card__stat {
  padding: 14px 12px;
  background: var(--ftc-surface, #fafbf6);
  border: 1px solid var(--ftc-border, #e6e8e4);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.summary-card__stat-k {
  font-family: var(--ftc-font-mono);
  font-size: 10px;
  color: var(--ftc-ink-2, #4d5a51);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.summary-card__stat-v {
  font-family: var(--ftc-font-mono);
  font-size: 22px;
  color: var(--brand-green-deep, #07683f);
  font-weight: 700;
  line-height: 1.1;
}
.summary-card__stat-sub {
  font-size: 11px;
  color: var(--ftc-ink-2);
}
.summary-card__recap {
  text-align: left;
  margin-bottom: 24px;
  border: 1px solid var(--ftc-border);
  border-radius: 8px;
  padding: 4px 0;
}
.summary-card__recap summary {
  padding: 10px 14px;
  font-family: var(--ftc-font-mono);
  font-size: 11px;
  color: var(--brand-green-deep, #07683f);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
}
.summary-card__list {
  list-style: none;
  margin: 0; padding: 0 0 6px;
  display: grid;
  gap: 2px;
}
.summary-card__list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 14px;
  font-size: 12.5px;
}
.summary-card__list-n {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  background: var(--ftc-green-tint, #ecf9e7);
  color: var(--brand-green-deep, #07683f);
  border-radius: 50%;
  font-family: var(--ftc-font-mono);
  font-size: 11px;
  font-weight: 700;
}
.summary-card__list-label {
  color: var(--ftc-ink);
  line-height: 1.35;
}
.summary-card__list-ts {
  font-family: var(--ftc-font-mono);
  font-size: 10px;
  color: var(--ftc-ink-2);
}
.summary-card__actions {
  display: flex; gap: 12px; justify-content: center;
}
.summary-card__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px;
  border-radius: 8px;
  font-family: var(--ftc-font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  border: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.06s;
}
.summary-card__btn--ghost {
  background: transparent;
  color: var(--ftc-ink-2);
  border: 1px solid var(--rule-strong, #c9cec9);
}
.summary-card__btn--ghost:hover {
  border-color: var(--brand-green);
  color: var(--brand-green-deep);
}
.summary-card__btn--primary {
  background: var(--brand-green);
  color: #fff;
}
.summary-card__btn--primary:hover { background: var(--brand-green-deep); }
.summary-card__btn--primary:active { transform: translateY(1px); }
@media (max-width: 600px) {
  .summary-card__stats { grid-template-columns: 1fr; }
  .summary-card__actions { flex-direction: column; }
  .summary-card__btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .summary-card,
  .summary-card__check { animation: none; }
}

/* ===== Step-progress bar in topbar ===================================== */
.step-progress {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 12px;
  padding: 0;
}
.step-progress__seg {
  display: block;
  width: 22px;
  height: 5px;
  border-radius: 3px;
  background: var(--ftc-border, #e6e8e4);
  transition: background 0.18s ease, transform 0.18s ease;
}
.step-progress__seg[data-state="done"]    { background: var(--brand-green, #0a8754); }
.step-progress__seg[data-state="current"] {
  background: var(--brand-green, #0a8754);
  transform: scaleY(1.6);
  box-shadow: 0 0 0 0 rgba(10, 135, 84, 0.5);
  animation: step-current-pulse 1.8s ease-out infinite;
}
@keyframes step-current-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 135, 84, 0.55); }
  60%      { box-shadow: 0 0 0 4px rgba(10, 135, 84, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .step-progress__seg[data-state="current"] {
    animation: none;
    box-shadow: none;
  }
}
@media (max-width: 720px) {
  .step-progress__seg { width: 14px; height: 4px; }
}

/* ===== Mobile layout (narrative overlay → bottom sheet) ================ */
@media (max-width: 720px) {
  /* Topbar: shrink module title + truncate */
  #module-title {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
  }
  /* Hide back-link text label on small screens, keep the ← arrow */
  .topbar-back { font-size: 0; padding: 4px 8px; }
  .topbar-back::before { content: "←"; font-size: 14px; }
  /* Narrative overlay becomes a bottom sheet so it doesn't cover apps */
  .narrative-overlay {
    right: 0 !important;
    left: 0 !important;
    bottom: 44px !important;        /* clear taskbar */
    width: 100% !important;
    max-width: 100% !important;
    max-height: 40vh !important;
    border-radius: 12px 12px 0 0 !important;
    border-bottom-width: 0 !important;
  }
  /* Apps respect the narrative bottom-sheet height */
  #desktop { padding-bottom: 40vh; }
}

/* ===== M3 step-1 / step-2 decorations injected into Outreach ============ */
.is-warm-highlight {
  outline: 2px solid var(--brand-green, #0a8754);
  outline-offset: -2px;
  background: linear-gradient(180deg, #f6fdf3 0%, #ffffff 80%);
  border-radius: 6px;
}
.open-signal-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 9px;
  background: #d4f1c4;
  color: #054d2f;
  border-radius: 999px;
  font-family: var(--ftc-font-mono, ui-monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.open-signal-chip strong { font-weight: 700; }
.open-signal-chip.is-pulsing {
  animation: open-chip-pulse 1.4s ease-in-out infinite;
}
@keyframes open-chip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10,135,84,0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(10,135,84,0); }
}
@media (prefers-reduced-motion: reduce) {
  .open-signal-chip.is-pulsing { animation: none; }
}

/* ===== M3 step-5 · Tom drawer (in-Outreach completion problem) ========== */
.tom-drawer {
  margin: 6px 0 12px;
  padding: 14px 16px;
  background: var(--ftc-paper, #ffffff);
  border: 1px solid var(--ftc-border, #e6e8e4);
  border-left: 3px solid var(--brand-green, #0a8754);
  border-radius: 8px;
  box-shadow: 0 6px 16px -8px rgba(10,26,16,0.12);
  font-family: var(--ftc-font-sans);
  animation: tom-drawer-in 220ms ease-out;
}
.tom-drawer__head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--ftc-ink-2);
  margin-bottom: 6px;
}
.tom-drawer__cue {
  font-family: var(--ftc-font-mono);
  font-size: 11px;
  color: var(--brand-green);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.tom-drawer__stem {
  font-size: 14px; color: var(--ftc-ink);
  margin: 4px 0 10px;
}
.tom-drawer__opts {
  display: grid; gap: 8px;
}
.tom-drawer__opt {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 10px;
  align-items: start;
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-3, #f4f5f1);
  border: 1px solid var(--ftc-border);
  border-radius: 6px;
  font-family: var(--ftc-font-sans);
  font-size: 13.5px;
  color: var(--ftc-ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.tom-drawer__opt:hover:not(:disabled):not(.is-correct):not(.is-incorrect) { background: #f0f7ee; border-color: var(--brand-green); }
.tom-drawer__opt:active { transform: scale(0.99); }
.tom-drawer__label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: var(--ftc-ink); color: #fff;
  border-radius: 50%;
  font-family: var(--ftc-font-mono); font-weight: 700; font-size: 12px;
}
.tom-drawer__text { line-height: 1.4; }
.tom-drawer__opt.is-correct {
  background: #d4f1c4; border-color: var(--brand-green);
}
.tom-drawer__opt.is-correct .tom-drawer__label { background: var(--brand-green); }
.tom-drawer__opt.is-incorrect {
  background: #fde7e3; border-color: var(--coral-700, #c33d22);
}
.tom-drawer__opt.is-incorrect .tom-drawer__label { background: var(--coral-700, #c33d22); }
/* On wrong pick the correct option flashes green so the rep sees the gap. */
.tom-drawer__opt.is-reveal:not(.is-correct):not(.is-incorrect) {
  background: #f0f7ee;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 2px rgba(10, 135, 84, 0.35);
  animation: tom-reveal-pulse 0.9s ease-out 2;
}
.tom-drawer__opt.is-reveal:not(.is-correct):not(.is-incorrect)::after {
  content: " ← correct answer";
  font-family: var(--ftc-font-mono, ui-monospace);
  font-size: 10.5px;
  color: var(--brand-green, #0a8754);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-left: 6px;
  white-space: nowrap;
}
@keyframes tom-reveal-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(10, 135, 84, 0.15); }
  50%      { box-shadow: 0 0 0 6px rgba(10, 135, 84, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .tom-drawer__opt.is-reveal { animation: none; }
}
.tom-drawer__fb {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff8e0;
  border-left: 3px solid var(--sun-500, #f5b800);
  border-radius: 4px;
  font-size: 13px;
  color: var(--ftc-ink);
  line-height: 1.5;
}
@keyframes tom-drawer-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tom-drawer { animation: none; }
}

/* ===== Narrative overlay (Gagné event presenter) ======================== */
.narrative-overlay {
  position: fixed;
  right: 24px;
  bottom: 64px;                 /* clear the taskbar */
  width: min(420px, calc(100vw - 48px));
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  background: var(--ftc-paper, #ffffff);
  border: 1px solid var(--ftc-border, #d0d5dd);
  border-radius: var(--m3-card-radius);
  box-shadow: var(--m3-overlay-shadow);
  z-index: 9000;                /* above mini-OS windows, below modals */
  font-family: var(--ftc-font-sans);
  color: var(--ftc-ink, #0f1419);
}

.narrative-overlay__head {
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--ftc-border, #d0d5dd);
}

.narrative-overlay__step {
  display: inline-block;
  font-family: var(--ftc-font-mono);
  font-size: 12px;
  color: var(--ftc-ink-2, #475467);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.narrative-overlay__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.narrative-overlay__body {
  padding: 12px 20px 16px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.55;
}

.narrative-overlay__body p   { margin: 0 0 10px; }
.narrative-overlay__body p:last-child { margin-bottom: 0; }

.narrative-overlay__body .peer-quote {
  border-left: 3px solid var(--ftc-green-primary, #00b67a);
  background: var(--ftc-green-tint, #e6f7f0);
  padding: 10px 14px;
  border-radius: 6px;
  font-style: italic;
  margin: 10px 0;
}

.narrative-overlay__body .peer-quote cite {
  display: block;
  font-style: normal;
  font-size: 13px;
  color: var(--ftc-ink-2, #475467);
  margin-top: 6px;
}

.narrative-overlay__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--ftc-border, #d0d5dd);
}
.narrative-overlay__foot-spacer { flex: 1; }
.narrative-icon-btn {
  background: transparent;
  border: 1px solid var(--ftc-border, #e6e8e4);
  border-radius: 6px;
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  font-size: 15px;
  color: var(--ftc-ink-2, #4d5a51);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.narrative-icon-btn:hover {
  background: var(--ftc-green-tint, #ecf9e7);
  border-color: var(--brand-green, #0a8754);
  color: var(--brand-green-deep, #07683f);
}
.narrative-icon-btn:focus-visible {
  outline: 2px solid var(--brand-green, #0a8754);
  outline-offset: 2px;
}

/* ===== Buttons ========================================================== */
.btn {
  font-family: var(--ftc-font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease-out, border-color 120ms ease-out;
}

.btn:focus-visible {
  outline: 2px solid var(--ftc-green-dark, #00875f);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--ftc-green-primary, #00b67a);
  color: #ffffff;
}
.btn--primary:hover { background: var(--ftc-green-dark, #00875f); }

.btn--ghost {
  background: transparent;
  color: var(--ftc-ink, #0f1419);
  border-color: var(--ftc-border, #d0d5dd);
}
.btn--ghost:hover { background: var(--ftc-surface, #f6f8fa); }

.btn[disabled],
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: var(--ftc-surface, #f6f8fa);
  color: var(--ftc-ink-2, #475467);
  border-color: var(--ftc-border, #d0d5dd);
}

/* ===== Disabled-dial-button affordance (habit gate) ======================
 * Per design-log.md: button stays focusable (no `disabled` attribute) so the
 * screen-reader reads aria-describedby. The diagonal-stripe overlay signals
 * the gate state visually without obscuring the focus indicator.
 */
.dial-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--m3-pill-radius);
  background: var(--ftc-green-primary, #00b67a);
  color: #ffffff;
  border: 1px solid transparent;
  font-family: var(--ftc-font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease-out;
}

.dial-button:hover  { background: var(--ftc-green-dark, #00875f); }
.dial-button:focus-visible {
  outline: 3px solid var(--ftc-green-dark, #00875f);
  outline-offset: 3px;
}

.dial-button[aria-disabled="true"] {
  background: var(--ftc-surface, #f6f8fa);
  color: var(--ftc-ink-2, #475467);
  border-color: var(--ftc-border, #d0d5dd);
  cursor: not-allowed;
  background-image: var(--m3-gate-stripe);
}

.dial-button[aria-disabled="true"]::after {
  content: "Calendar required";
  margin-left: 4px;
  font-family: var(--ftc-font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(180, 35, 24, 0.12);
  color: var(--ftc-danger-muted, #b42318);
  border-radius: 4px;
}

/* Coach-mark for the habit gate (positioned by JS) */
.gate-coach-mark {
  position: absolute;
  background: var(--ftc-ink, #0f1419);
  color: #ffffff;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 280px;
  box-shadow: var(--m3-overlay-shadow);
  z-index: 9500;
}

.gate-coach-mark::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 24px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--ftc-ink, #0f1419);
}

/* ===== Worked-example side-by-side layout =============================== */
.worked-example {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  padding: 20px;
  background: var(--ftc-surface, #f6f8fa);
  border-radius: var(--m3-card-radius);
}

@media (max-width: 768px) {
  .worked-example { grid-template-columns: 1fr; }
}

.worked-example__pane {
  background: var(--ftc-paper, #ffffff);
  border: 1px solid var(--ftc-border, #d0d5dd);
  border-radius: 8px;
  padding: 14px 16px;
}

.worked-example__pane h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ftc-ink-2, #475467);
  margin: 0 0 10px;
}

.transcript-line {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.55;
}

.transcript-line .ts {
  font-family: var(--ftc-font-mono);
  color: var(--ftc-ink-2, #475467);
  font-size: 12px;
  padding-top: 3px;
}

.transcript-line.is-m3 {
  background: var(--ftc-green-tint, #e6f7f0);
  border-left: 3px solid var(--ftc-green-primary, #00b67a);
  padding-left: 8px;
  margin-left: -11px;
  border-radius: 0 6px 6px 0;
}

.transcript-line__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--ftc-green-primary, #00b67a);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--m3-pill-radius);
  margin-left: 6px;
}

.transcript-line .speaker {
  font-weight: 600;
  color: var(--ftc-ink, #0f1419);
}

/* ===== Completion-problem card ========================================== */
.completion-problem {
  background: var(--ftc-paper, #ffffff);
  border: 1px solid var(--ftc-border, #d0d5dd);
  border-radius: var(--m3-card-radius);
  padding: 18px 20px;
}

.completion-problem__stem {
  font-size: 15px;
  margin: 0 0 14px;
}

.completion-option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--ftc-paper, #ffffff);
  border: 1.5px solid var(--ftc-border, #d0d5dd);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ftc-ink, #0f1419);
  transition: border-color 120ms, background 120ms;
}

.completion-option:hover { border-color: var(--ftc-ink-2, #475467); }
.completion-option:focus-visible {
  outline: 2px solid var(--ftc-green-dark, #00875f);
  outline-offset: 2px;
}

.completion-option.is-correct {
  border-color: var(--ftc-green-primary, #00b67a);
  background: var(--ftc-green-tint, #e6f7f0);
}

.completion-option.is-incorrect {
  border-color: var(--ftc-danger-muted, #b42318);
  background: rgba(180, 35, 24, 0.06);
}

.completion-option .opt-label {
  font-family: var(--ftc-font-mono);
  font-weight: 600;
  margin-right: 8px;
}

.completion-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 6px;
  background: var(--ftc-surface, #f6f8fa);
  color: var(--ftc-ink-2, #475467);
}

/* ===== Event-log timeline (Gagné event 7 · feedback) ==================== */
.event-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  position: relative;
}

.event-timeline::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 15px;
  width: 2px;
  background: var(--ftc-border, #d0d5dd);
}

.event-timeline__item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  padding: 10px 4px;
  align-items: start;
  position: relative;
}

.event-timeline__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ftc-green-primary, #00b67a);
  border: 3px solid var(--ftc-paper, #ffffff);
  box-shadow: 0 0 0 1px var(--ftc-green-primary, #00b67a);
  margin-top: 4px;
  margin-left: 9px;
}

.event-timeline__item[data-state="anti"] .event-timeline__dot {
  background: var(--ftc-danger-muted, #b42318);
  box-shadow: 0 0 0 1px var(--ftc-danger-muted, #b42318);
}

.event-timeline__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ftc-ink, #0f1419);
}

.event-timeline__detail {
  display: block;
  font-size: 12px;
  color: var(--ftc-ink-2, #475467);
  margin-top: 2px;
}

.event-timeline__ts {
  font-family: var(--ftc-font-mono);
  font-size: 11px;
  color: var(--ftc-ink-2, #475467);
  padding-top: 4px;
}

/* ===== Quiz UI ========================================================== */
.quiz {
  background: var(--ftc-paper, #ffffff);
  border: 1px solid var(--ftc-border, #d0d5dd);
  border-radius: var(--m3-card-radius);
  padding: 18px 20px;
}

.quiz__progress {
  font-family: var(--ftc-font-mono);
  font-size: 12px;
  color: var(--ftc-ink-2, #475467);
  margin-bottom: 6px;
}

.quiz__stem {
  font-size: 15px;
  margin: 0 0 14px;
  line-height: 1.5;
}

/* ===== Key-takeaway + retention card ==================================== */
.takeaway {
  background: var(--ftc-green-tint, #e6f7f0);
  border-left: 4px solid var(--ftc-green-primary, #00b67a);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.takeaway cite {
  display: block;
  font-style: normal;
  font-size: 13px;
  color: var(--ftc-ink-2, #475467);
  margin-top: 8px;
}

.retention-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ftc-ink-2, #475467);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Slot picker (solo problem) ======================================= */
.slot-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.slot-picker__btn {
  font-family: var(--ftc-font-mono);
  background: var(--ftc-paper, #ffffff);
  border: 1.5px solid var(--ftc-border, #d0d5dd);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ftc-ink, #0f1419);
  transition: border-color 120ms, background 120ms;
}

.slot-picker__btn:hover { border-color: var(--ftc-ink-2, #475467); }
.slot-picker__btn:focus-visible {
  outline: 2px solid var(--ftc-green-dark, #00875f);
  outline-offset: 2px;
}

.slot-picker__btn[aria-pressed="true"] {
  border-color: var(--ftc-green-primary, #00b67a);
  background: var(--ftc-green-tint, #e6f7f0);
  color: var(--ftc-green-dark, #00875f);
  font-weight: 600;
}

/* ===== Top-bar progress indicator ======================================= */
.module-progress {
  margin-left: auto;
  margin-right: 12px;
  font-family: var(--ftc-font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.78); /* sits on the dark top bar */
}

/* ===== Reduced-motion override ========================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ===== Narrow viewport · stack overlay ================================== */
@media (max-width: 768px) {
  .narrative-overlay {
    right: 12px;
    left: 12px;
    bottom: 56px;
    width: auto;
    max-height: 60vh;
  }
}

/* ===== In-app task pieces shared by M1-M4 (bars, stages, checklists) ===== */
.mx-bar {
  /* sticks to the bottom of the app window, so the action is visible without scrolling */
  position: sticky; bottom: 8px; z-index: 3; box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  margin: 14px 10px 0; padding: 10px 14px;
  background: var(--ftc-green-tint, #ecf9e7);
  border: 1px dashed var(--brand-green, #0a8754); border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--ftc-ink-2);
}
.mx-btn {
  flex: none; background: var(--brand-green, #0a8754); color: #fff;
  padding: 8px 14px; border: 0; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.mx-btn:disabled, .mx-btn[aria-disabled="true"] { background: #ccc; color: #666; cursor: not-allowed; }
/* a committed verdict keeps showing which one was chosen */
.mx-btn[aria-checked="true"]:disabled { background: var(--brand-green, #0a8754); color: #fff; opacity: 0.75; }
.mx-btn--ghost { background: transparent; color: var(--brand-green-deep, #07683f); border: 1px solid var(--brand-green, #0a8754); }
.mx-btn--small { padding: 6px 12px; font-size: 12px; }
.mx-stage {
  margin-top: 14px; padding: 14px; background: #fff;
  border: 1px solid var(--ftc-border, #e4e7ec); border-radius: 8px;
}
.mx-stage label { display: block; font-size: 12.5px; color: var(--ftc-ink-2); margin: 10px 0 4px; }
.mx-stage textarea {
  width: 100%; box-sizing: border-box; padding: 8px;
  border: 1px solid var(--ftc-border, #e4e7ec); border-radius: 4px;
  font-family: var(--ftc-font-sans); font-size: 13px; resize: vertical;
}
.mx-signal {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; padding: 10px 12px;
  background: var(--ftc-green-tint, #ecf9e7); border-left: 3px solid var(--brand-green, #0a8754);
  border-radius: 6px; font-size: 13px; color: var(--ftc-ink);
}
.mx-signal--objection { background: #fde7e3; border-left-color: var(--coral-700, #c33d22); }
.mx-k {
  flex: none; font-family: var(--ftc-font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--brand-green-deep, #07683f);
}
.mx-signal--objection .mx-k { color: var(--coral-700, #c33d22); }
.mx-checks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ftc-ink-2); }
.mx-checks li::before { content: "·"; display: inline-block; width: 14px; font-weight: 700; }
.mx-checks li[data-ok="true"] { color: var(--brand-green-deep, #07683f); }
.mx-checks li[data-ok="true"]::before { content: "✓"; }
.mx-checks li[data-ok="warn"] { color: var(--coral-700, #c33d22); }
.mx-checks li[data-ok="warn"]::before { content: "!"; }
.mx-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.mx-status { font-size: 12px; color: var(--ftc-ink-2); }
.mx-fb { margin-top: 10px; padding: 10px 12px; border-radius: 6px; background: #f6f8fa; font-size: 12.5px; line-height: 1.5; color: var(--ftc-ink); }
.mx-fb[hidden] { display: none; }
.mx-fb[data-tone="ok"] { background: var(--ftc-green-tint, #ecf9e7); }
.mx-fb[data-tone="warn"] { background: #fff4e5; }
.mx-callbar {
  margin: 10px; padding: 10px 14px; background: rgba(245,184,0,0.95); color: #1a1a1a;
  border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--ftc-font-mono); font-size: 12px;
}
.mx-callbar[hidden] { display: none; }
.mx-thread { margin: 14px 0 0; padding: 14px 16px; background: #fff8e0; border-left: 3px solid var(--sun-500, #f5b800); border-radius: 6px; font-family: var(--ftc-font-sans); }
.mx-thread__k, .mx-pinned__k {
  font-family: var(--ftc-font-mono); font-size: 11px; color: var(--ftc-ink-2);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.mx-pinned {
  margin: 14px 0 0; padding: 16px 18px;
  background: linear-gradient(180deg, var(--ftc-green-tint, #ecf9e7) 0%, #ffffff 100%);
  border: 1px solid var(--brand-green); border-left: 4px solid var(--brand-green); border-radius: 8px;
  font-family: var(--ftc-font-sans); box-shadow: 0 6px 16px -8px rgba(10,26,16,0.12);
}
.mx-pinned__k { color: var(--brand-green); font-size: 10px; letter-spacing: 0.08em; }
.mx-pinned__quote { font-size: 15px; font-style: italic; line-height: 1.55; color: var(--ftc-ink); margin: 0 0 10px; }
.mx-pinned__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ftc-border); font-size: 12.5px; color: var(--ftc-ink-2);
}
.mx-quiz-next { margin-top: 10px; text-align: right; }

/* Plain labels: no uppercase or monospace tag lines */
.narrative-overlay__step, .summary-card__stat-k, .summary-card__recap summary,
.mx-thread__k, .mx-pinned__k,
.tom-drawer__opt.is-reveal:not(.is-correct):not(.is-incorrect)::after,
.m5-map dt, .m5-propcard__label, .m5-tag, .m5-solo__head, .m5-quiz__label, .m5-pinned__label,
.reg-aid__k, .reg-mini > summary, .m6-chip, .m6-quiz__kicker, .m6-pinned__kicker {
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--ftc-font-sans);
}
