/* ═══════════════════════════════════════════════════════════════════
   academyConcierge.css — Academy Chat overrides on top of curveTeaser.css.

   The chat scaffold (bubbles, chips, scroll panel, doc panel, etc.)
   lives in curveTeaser.css. This file:
     - swaps the accent colour to the laready brand orange so it
       reads like a sibling of TMS Mirror Chat;
     - introduces the LESSON CARD pattern — a richer "bubble" used
       to render course modules with eyebrow, heading, body prose,
       inline widget slot, inline quiz chips, and continue chip;
     - adds the pathway-progress card pattern used on the hub bubble.

   Loaded AFTER curveTeaser.css so these rules win cascade ties.
   ═══════════════════════════════════════════════════════════════════ */

/* Body-scoped overrides — accent the chat with laready brand orange. */
body[data-page="academy-chat"] .curve-chat-root {
  --ex-mint:      #fd7e14;
  --ex-mint-soft: rgba(253, 126, 20, 0.10);
  --ex-mint-dark: #b75f0c;
}

/* ── Split-pane scaffold (chat + on-demand catalogue panel).
       Mirrors the TMS Mirror Chat layout pattern but scoped to
       `body[data-page="academy-chat"]`. */
body[data-page="academy-chat"] .curve-chat-panel {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
}
body[data-page="academy-chat"] .curve-chat-stage {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: inherit;
  transition: flex-basis 0.22s ease;
}
body[data-page="academy-chat"] .curve-chat-panel.has-doc .curve-chat-stage {
  flex: 0 1 40%;
  min-width: 340px;
}
body[data-page="academy-chat"] .curve-doc-panel {
  flex: 0 1 60%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f7f8fa;
  border-left: 1px solid var(--ex-border);
}
body[data-page="academy-chat"] .curve-doc-panel[hidden] {
  display: none !important;
}
body[data-page="academy-chat"] .curve-doc-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: var(--ex-navy);
  color: var(--ex-text);
  border-bottom: 1px solid var(--ex-border);
  flex-shrink: 0;
}
body[data-page="academy-chat"] .curve-doc-panel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ex-sub);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-page="academy-chat"] .curve-doc-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
body[data-page="academy-chat"] .curve-doc-panel-action,
body[data-page="academy-chat"] .curve-doc-panel-close {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ex-border);
  background: transparent;
  color: var(--ex-sub);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
body[data-page="academy-chat"] .curve-doc-panel-action:hover {
  color: var(--ex-text);
  border-color: var(--ex-text);
}
body[data-page="academy-chat"] .curve-doc-panel-close:hover {
  background: rgba(253, 126, 20, 0.10);
  border-color: #fd7e14;
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-doc-panel-iframe {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  background: #f7f8fa;
}

/* Tablet / mobile fallback — doc takes the full panel. */
@media (max-width: 1024px) {
  body[data-page="academy-chat"] .curve-chat-panel.has-doc .curve-chat-stage {
    display: none;
  }
  body[data-page="academy-chat"] .curve-chat-panel.has-doc .curve-doc-panel {
    position: fixed;
    inset: 0;
    z-index: 100;
    flex: 1 1 100%;
    border-left: none;
  }
  body[data-page="academy-chat"]:has(.curve-chat-panel.has-doc) {
    overflow: hidden;
  }
  body[data-page="academy-chat"] .curve-chat-panel.has-doc .curve-doc-panel-close {
    background: #fd7e14;
    color: #ffffff;
    border-color: #fd7e14;
    height: 32px;
    padding: 0 14px;
  }
  body[data-page="academy-chat"] .curve-chat-panel.has-doc .curve-doc-panel-close-glyph {
    display: none;
  }
  body[data-page="academy-chat"] .curve-chat-panel.has-doc .curve-doc-panel-close-label::before {
    content: "← ";
  }
  body[data-page="academy-chat"] .curve-chat-panel.has-doc .curve-doc-panel-close-label::after {
    content: " to chat";
  }
}

/* Brand mark — orange tile with mortarboard icon. */
body[data-page="academy-chat"] .curve-chat-brand-mark.academy {
  background: #fd7e14;
  color: #fff;
  font-size: 18px;
}
body[data-page="academy-chat"] .curve-chat-brand-mark.academy i {
  line-height: 1;
}
body[data-page="academy-chat"] .curve-chat-brand-badge.academy {
  color: #fd7e14;
  background: rgba(253, 126, 20, 0.10);
  border-color: rgba(253, 126, 20, 0.35);
}

/* User bubble + typing dot + chip hover use orange. */
body[data-page="academy-chat"] .curve-chat-root .curve-bubble.is-user {
  background: #fd7e14;
  color: #ffffff;
}
body[data-page="academy-chat"] .curve-chat-root .curve-bubble.is-user strong {
  color: #ffffff;
}
body[data-page="academy-chat"] .curve-chat-root .curve-thinking-dot {
  background: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .curve-chip:hover {
  border-color: #fd7e14;
}

/* ── Pathway / course card grid — flows into 1-3 columns based on
       chat panel width. Each card stays narrow (~260-360px) so
       multiple fit on screen at once. */
body[data-page="academy-chat"] .curve-chat-root .ac-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}
/* Force 3 in a row on desktop (used for pathway / course-preview
   rails). Drops to 2 on tablet, 1 on phones. */
body[data-page="academy-chat"] .curve-chat-root .ac-card-grid.is-three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  body[data-page="academy-chat"] .curve-chat-root .ac-card-grid.is-three-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  body[data-page="academy-chat"] .curve-chat-root .ac-card-grid.is-three-up {
    grid-template-columns: 1fr;
  }
}

body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card {
  /* Inside the grid: cards size from grid columns. The vertical
     margin used to be the inter-card gap when cards were stacked;
     the grid gap handles spacing now, so reset to 0. */
  margin: 0;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--ex-border);
  border-left: 3px solid #fd7e14;
  border-radius: 10px;
  /* Card content lays out in a column so the action row sticks to
     the bottom of each card regardless of sub-text height. */
  display: flex;
  flex-direction: column;
  min-width: 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card .ac-pathway-card-actions {
  margin-top: auto;  /* push actions to the bottom of the card */
  padding-top: 8px;
}
/* Sub-text inside a grid card can wrap — let it. */
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card .ac-pathway-card-sub {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Allow the chat-bubbles column to widen on Academy chat so 3
   columns of cards fit comfortably (~3 × 280 + 2 × gap = ~880). */
body[data-page="academy-chat"] .curve-chat-root .curve-chat-bubbles {
  max-width: 1080px;
}
/* Chat bubbles inside the wider column stay readable — clamp the
   ones that are pure prose (without grids) to a comfy reading
   width. The lesson-card / has-lesson bubble already takes 100%. */
body[data-page="academy-chat"] .curve-chat-root .curve-bubble:not(.has-lesson) {
  max-width: 880px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ex-text);
  letter-spacing: -0.01em;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--ex-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card-sub {
  font-size: 12px;
  color: var(--ex-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-progress-bar {
  height: 4px;
  background: rgba(148, 163, 184, 0.20);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-progress-bar-fill {
  height: 100%;
  background: #fd7e14;
  transition: width 0.25s ease;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-action {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ex-text);
  background: transparent;
  border: 1px solid var(--ex-border);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-action:hover {
  border-color: #fd7e14;
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-action.is-primary {
  background: #fd7e14;
  border-color: #fd7e14;
  color: #fff;
  /* Make the primary action visually louder so it earns the
     "obvious CTA" the colleague feedback flagged as missing. */
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(253, 126, 20, 0.32);
  transition: background .12s, border-color .12s, color .12s, transform .10s, box-shadow .12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-action.is-primary:hover {
  background: #b75f0c;
  border-color: #b75f0c;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(253, 126, 20, 0.40);
}

/* ── Lesson card — used to deliver each course module. Anatomy:
       - eyebrow: "Module 1 of 7 · Foundations"
       - heading: module title
       - objective: 1-line "by the end you'll know"
       - body: prose / lists / callouts (HTML)
       - widget slot (optional, function renders into the slot)
       - quiz block (optional, multi-choice chips with feedback)
       - footer: continue chip + secondary actions ─────────────────── */
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--ex-border);
  border-left: 3px solid #fd7e14;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0;
  /* Lesson cards are wider than a normal chat bubble — reading is the
     primary job, not conversational density. */
  max-width: 100%;
  width: 100%;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ex-sub);
}
body[data-page="academy-chat"] .curve-chat-root .curve-bubble.has-lesson {
  background: transparent;
  border: none;
  padding: 0;
  max-width: 100%;
  width: 100%;
}

body[data-page="academy-chat"] .curve-chat-root .ac-lesson-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #fd7e14;
  margin-bottom: 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-eyebrow .ac-lesson-progress {
  color: var(--ex-muted);
  letter-spacing: 0.04em;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ex-text);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  line-height: 1.3;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-objective {
  font-size: 13px;
  color: var(--ex-muted);
  line-height: 1.55;
  padding: 8px 12px;
  background: rgba(253, 126, 20, 0.06);
  border-left: 2px solid rgba(253, 126, 20, 0.40);
  border-radius: 4px;
  margin-bottom: 14px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-objective b {
  color: #fd7e14;
  font-weight: 700;
}

/* ── Module-jump list — sits at the bottom of every module's intro
       lesson card. Lets the user jump straight to any module in
       the course without leaving chat. */
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-head {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ex-sub);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ex-border);
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ex-text);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-item:hover:not(:disabled) {
  background: rgba(253, 126, 20, 0.08);
  border-color: rgba(253, 126, 20, 0.30);
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-item:disabled {
  cursor: default;
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-item.is-current {
  background: rgba(45, 212, 168, 0.10);
  border-color: rgba(45, 212, 168, 0.40);
  color: #2dd4a8;
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-item.is-done {
  color: var(--ex-sub);
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  font-size: 12px;
  font-weight: 700;
  color: var(--ex-sub);
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-item.is-current .ac-modjump-num {
  background: #2dd4a8;
  color: #0f172a;
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-item.is-done .ac-modjump-num {
  background: rgba(45, 212, 168, 0.18);
  color: #2dd4a8;
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-page="academy-chat"] .curve-chat-root .ac-modjump-here {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: #2dd4a8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Body prose — h2 headings, paragraphs, lists, callouts inherited
   from the existing course content. We restyle them for the
   dark-on-navy chat surface. */
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body {
  font-size: 14px;
  color: var(--ex-sub);
  line-height: 1.65;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body p {
  margin: 0 0 12px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body p:last-child {
  margin-bottom: 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ex-text);
  letter-spacing: -0.01em;
  margin: 18px 0 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ex-text);
  margin: 14px 0 6px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body ul,
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body li {
  margin: 4px 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body strong,
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body b {
  color: var(--ex-text);
  font-weight: 700;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body em {
  color: var(--ex-text);
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  background: rgba(148, 163, 184, 0.10);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ex-text);
}
/* Course glossary terms (rendered by `term()` in original course-*.js)
   come through with class .pt-term — we underline-on-hover with the
   accent colour. */
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body .pt-term {
  /* Defined/clickable glossary terms need to stand out from the bright body
     text on the dark chat surface — a warm accent colour + a clearer
     underline makes the affordance obvious without shouting. */
  border-bottom: 1px solid rgba(253, 126, 20, 0.85);
  cursor: help;
  color: #fdba74;
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body .pt-term:hover {
  color: #fd7e14;
  border-bottom-color: #fd7e14;
}
/* Course callouts (`.pt-callout`) rendered as embedded panels. */
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body .pt-callout {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.50);
  border: 1px solid var(--ex-border);
  border-left: 2px solid rgba(148, 163, 184, 0.55);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ex-sub);
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body .pt-callout.example {
  border-left-color: rgba(45, 212, 168, 0.55);
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body .pt-callout.takeaway {
  border-left-color: rgba(253, 126, 20, 0.65);
  background: rgba(253, 126, 20, 0.06);
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-body .pt-callout-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ex-muted);
  margin-bottom: 6px;
}

/* ── Widget slot — the existing course widgets are JS functions that
       inject HTML into a container. We give them a styled box with
       max-width: 100% so they don't break out of the chat panel. ── */
body[data-page="academy-chat"] .curve-chat-root .ac-widget {
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ex-border);
  border-radius: 8px;
  /* Widgets are interactive — give them their own contrast. */
  color: var(--ex-sub);
  max-width: 100%;
  overflow-x: auto;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget * {
  max-width: 100%;
  box-sizing: border-box;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget th,
body[data-page="academy-chat"] .curve-chat-root .ac-widget td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  text-align: left;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget input[type="number"],
body[data-page="academy-chat"] .curve-chat-root .ac-widget input[type="text"] {
  background: rgba(15, 23, 42, 0.50);
  border: 1px solid var(--ex-border);
  color: var(--ex-text);
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  font-family: inherit;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget label {
  font-size: 12px;
  color: var(--ex-sub);
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget button {
  background: rgba(253, 126, 20, 0.12);
  border: 1px solid #fd7e14;
  color: #fd7e14;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget button:hover {
  background: #fd7e14;
  color: #fff;
}

/* ── Quiz block — "Quick check" with chip-style options. Click an
       option, it locks; correct + wrong highlights with feedback;
       "why" explanation appears below. ───────────────────────────── */
body[data-page="academy-chat"] .curve-chat-root .ac-quiz {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: rgba(253, 126, 20, 0.04);
  border: 1px solid rgba(253, 126, 20, 0.25);
  border-radius: 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #fd7e14;
  margin-bottom: 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--ex-text);
  margin-bottom: 10px;
  line-height: 1.5;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.50);
  border: 1px solid var(--ex-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ex-text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  width: 100%;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-option:hover:not([disabled]) {
  border-color: #fd7e14;
  background: rgba(253, 126, 20, 0.06);
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-option-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--ex-muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-option.is-correct {
  background: rgba(45, 212, 168, 0.12);
  border-color: #2dd4a8;
  color: var(--ex-text);
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-option.is-correct .ac-quiz-option-glyph {
  background: #2dd4a8;
  border-color: #2dd4a8;
  color: #0f172a;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-option.is-wrong {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.55);
  color: var(--ex-text);
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-option.is-wrong .ac-quiz-option-glyph {
  background: rgb(239, 68, 68);
  border-color: rgb(239, 68, 68);
  color: #fff;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-option[disabled] {
  cursor: default;
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-why {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.50);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ex-sub);
  line-height: 1.55;
  border-left: 2px solid rgba(45, 212, 168, 0.55);
}
body[data-page="academy-chat"] .curve-chat-root .ac-quiz-why strong {
  color: #2dd4a8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

/* ── Lesson footer — continue + secondary actions. */
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.20);
}
body[data-page="academy-chat"] .curve-chat-root .ac-lesson-footer .ac-pathway-action {
  /* re-use pathway action styling */
}

/* ── Chat scroll polish — lesson cards sit edge-to-edge in the
       bubble container, so widen the column they live in. */
body[data-page="academy-chat"] .curve-chat-root .curve-chat-bubbles {
  max-width: 880px;
}

/* ── Chunk renderers — paced delivery. Each chunk is its own
       bubble (regular conversational width), with a heading where
       relevant + body prose. The intro chunk keeps the lesson-card
       treatment (orange-accent border, eyebrow, big title). Other
       chunks are conversationally-styled. */
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ex-sub);
}
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--ex-text);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  /* Tiny orange accent dot before the heading so chunks read as
     "lesson-marker" not "regular chat message". */
  display: flex;
  align-items: center;
  gap: 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-heading::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fd7e14;
  flex-shrink: 0;
}

/* Callout chunk — emphasised panel within a bubble. Flavours:
   `is-example` (mint-bordered), `is-takeaway` (orange-bordered). */
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-callout {
  margin: 0;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.50);
  border: 1px solid var(--ex-border);
  border-left: 3px solid rgba(148, 163, 184, 0.55);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ex-sub);
  line-height: 1.6;
}
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-callout.is-example {
  border-left-color: rgba(45, 212, 168, 0.65);
  background: rgba(45, 212, 168, 0.04);
}
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-callout.is-takeaway {
  border-left-color: #fd7e14;
  background: rgba(253, 126, 20, 0.06);
}
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-callout-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ex-muted);
  margin-bottom: 6px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-callout.is-example .ac-chunk-callout-title {
  color: #2dd4a8;
}
body[data-page="academy-chat"] .curve-chat-root .ac-chunk-callout.is-takeaway .ac-chunk-callout-title {
  color: #fd7e14;
}

/* ── Glossary popover — surfaces the term definition + "why it
       matters" line when a `.pt-term` is clicked. Positioned via
       JS (top/left), themed to read on top of any background. */
.ac-glossary-popover {
  position: fixed;
  z-index: 200;
  width: min(320px, 90vw);
  padding: 12px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-left: 3px solid #fd7e14;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color: #f1f5f9;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  /* Fade in. */
  animation: acGlossaryPopIn 140ms ease-out both;
}
@keyframes acGlossaryPopIn {
  0%   { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.ac-glossary-popover-term {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.ac-glossary-popover-defn {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.55;
}
.ac-glossary-popover-why {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.20);
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}
.ac-glossary-popover-why strong {
  color: #fd7e14;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 4px;
}

/* Make the term span clearly clickable. */
body[data-page="academy-chat"] .curve-chat-root .pt-term {
  cursor: pointer;
}
body[data-page="academy-chat"] .curve-chat-root .pt-term:focus-visible {
  outline: 2px solid #fd7e14;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Header row layout — brand on the left, "Back to hub" pill on
       the right. The header gets a flex row above the tagline. */
body[data-page="academy-chat"] .curve-chat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Header pills — three levels of navigation context, each with a
   distinct fill so the user can see at a glance where they can go.
   Order in DOM is right→left of the row (flex-wrap), so the
   highest-level pill (Hub) sits at the right edge and module-level
   appears closest to the brand. */
body[data-page="academy-chat"] .ac-header-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
body[data-page="academy-chat"] .ac-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  flex-shrink: 0;
  border: 1px solid transparent;
}
body[data-page="academy-chat"] .ac-pill[hidden] { display: none; }
body[data-page="academy-chat"] .ac-pill i {
  font-size: 13px;
  line-height: 1;
}

/* Hub-level: orange ghost pill. */
body[data-page="academy-chat"] .ac-pill.is-hub-nav {
  color: var(--ex-sub);
  background: transparent;
  border-color: rgba(148, 163, 184, 0.40);
}
body[data-page="academy-chat"] .ac-pill.is-hub-nav:hover {
  color: #fd7e14;
  border-color: #fd7e14;
  background: rgba(253, 126, 20, 0.08);
}

/* Course-modules pill — same ghost treatment as the Hub pill so the
   two read as a pair of navigation affordances. Only visible while a
   course is active. */
body[data-page="academy-chat"] .ac-pill.is-modules-nav {
  color: var(--ex-sub);
  background: transparent;
  border-color: rgba(148, 163, 184, 0.40);
}
body[data-page="academy-chat"] .ac-pill.is-modules-nav:hover {
  color: #fd7e14;
  border-color: #fd7e14;
  background: rgba(253, 126, 20, 0.08);
}

/* Dev-export pill — dashed outline so it's visibly a dev-only
   shortcut. Same shape and footprint as the other inline pills. */
body[data-page="academy-chat"] .ac-pill.is-dev-nav {
  color: rgba(148, 163, 184, 0.85);
  background: transparent;
  border-color: rgba(148, 163, 184, 0.40);
  border-style: dashed;
  text-decoration: none;
}
body[data-page="academy-chat"] .ac-pill.is-dev-nav:hover {
  color: #fd7e14;
  border-color: #fd7e14;
  background: rgba(253, 126, 20, 0.08);
}

/* "View as slides" pill — the experimental deck view. Branded orange so
   it reads as a distinct, premium way to take the lesson. */
body[data-page="academy-chat"] .ac-pill.is-slides-nav {
  color: #fd7e14;
  background: rgba(253, 126, 20, 0.08);
  border-color: rgba(253, 126, 20, 0.45);
  text-decoration: none;
}
body[data-page="academy-chat"] .ac-pill.is-slides-nav:hover {
  color: #fff;
  background: #fd7e14;
  border-color: #fd7e14;
}

/* Inline variant — sits next to the Academy logo (inside the brand
   group) rather than far-right with the other header pills. Gives a
   small gap from the wordmark so it reads as a navigation pill rather
   than a label. */
body[data-page="academy-chat"] .ac-pill.ac-pill-inline {
  margin-left: 4px;
}

/* Progress comment — non-interactive in-chat status surfaced when a
   course starts. Reads like a quiet system note rather than a chat
   bubble; lets the user know they're saved + where they are. */
body[data-page="academy-chat"] .curve-chat-root .curve-bubble.ac-progress-comment {
  background: rgba(253, 126, 20, 0.06);
  border: 1px solid rgba(253, 126, 20, 0.30);
  border-left: 3px solid #fd7e14;
  color: var(--ex-sub);
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
}
body[data-page="academy-chat"] .curve-chat-root .ac-progress-comment-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ex-text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-progress-comment-icon {
  font-size: 14px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-progress-comment-status {
  font-size: 12px;
  color: var(--ex-sub);
}
body[data-page="academy-chat"] .curve-chat-root .ac-progress-comment-status strong {
  color: #fd7e14;
  font-weight: 700;
}

/* "Continue where I left off" card on the hub — most prominent
   single action when returning. Mint accent + brighter background,
   a "Resume" pill in the top-right corner, and the primary button
   takes the card's mint accent so it stands clearly apart from the
   orange "Take this course" buttons on the sibling cards. */
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-continue {
  border-left-color: #2dd4a8;
  border-left-width: 4px;
  background: linear-gradient(135deg, rgba(45, 212, 168, 0.14), rgba(15, 23, 42, 0.55));
  box-shadow: 0 6px 22px rgba(45, 212, 168, 0.18);
  position: relative;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-continue::after {
  content: "RESUME";
  position: absolute;
  top: -9px;
  right: 12px;
  background: #2dd4a8;
  color: #0a2540;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(45, 212, 168, 0.35);
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-continue .ac-pathway-card-title {
  color: #2dd4a8;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-continue .ac-pathway-action.is-primary {
  background: #2dd4a8;
  border-color: #2dd4a8;
  color: #0a2540;
  box-shadow: 0 4px 14px rgba(45, 212, 168, 0.34);
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-continue .ac-pathway-action.is-primary:hover {
  background: #5eead4;
  border-color: #5eead4;
  color: #0a2540;
  box-shadow: 0 6px 18px rgba(45, 212, 168, 0.44);
}

/* ── Embedded predictor widget overrides ───────────────────────────
   The predictor markup is mirrored from predictor.html into the
   Predictor-course chat widget. Two things need to flex to the
   narrower bubble width:
     1. The "Curve shape & move" card header wraps to 2-3 lines at the
        col-md-4 inside-a-chat-bubble width, eating into the chart
        area and clipping the X-axis tenor labels. Compact the header
        and remove overflow:hidden on the chart card so labels can
        breathe.
     2. The commentary card's near-transparent orange background sits
        on the dark navy chat panel and renders the dark-text body
        unreadable. Lift it to a white card while keeping the orange
        accent border. */
body[data-page="academy-chat"] .curve-chat-root .pt-commentary {
  background: #ffffff;
  border-color: rgba(253, 126, 20, 0.35);
  color: #1a1a1a;
}
body[data-page="academy-chat"] .curve-chat-root .pt-commentary-eyebrow {
  color: #c84a00;
}
body[data-page="academy-chat"] .curve-chat-root .pt-commentary-body strong {
  color: #1a1a1a;
}

/* Tighten the bars card header so it stays on a single visual line
   even at the narrow chat column. */
body[data-page="academy-chat"] .curve-chat-root .pt-bars-card .card-header {
  padding: 8px 12px;
  gap: 6px;
  flex-wrap: nowrap;
}
body[data-page="academy-chat"] .curve-chat-root .pt-bars-card .card-header > span:first-child {
  font-size: 13px;
}
body[data-page="academy-chat"] .curve-chat-root #pt-bars-subtitle {
  display: none; /* the "bps · maturity" subtitle is already implied by the chart */
}

/* Drop overflow:hidden on the chart + bars containers in chat so the
   axis labels can render fully even if the cards are slightly
   undersized at narrow widths. */
body[data-page="academy-chat"] .curve-chat-root .pt-chart-card,
body[data-page="academy-chat"] .curve-chat-root .pt-bars-card,
body[data-page="academy-chat"] .curve-chat-root #pt-bars-container {
  overflow: visible !important;
}

/* "Next in pathway" card — same mint family as Continue (both
   are about the user's own journey) but a softer fill so the
   in-progress card stays the loudest of the three. */
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-pathway-next {
  border-left-color: #4fbfa5;
  background: linear-gradient(135deg, rgba(45, 212, 168, 0.05), rgba(15, 23, 42, 0.55));
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-pathway-next .ac-pathway-card-title {
  color: #4fbfa5;
}

/* The hub recommendation grid sits at the top of the welcome
   bubble. A bit more breathing room than a generic card grid. */
body[data-page="academy-chat"] .curve-chat-root .ac-recommendations {
  margin-top: 14px;
  margin-bottom: 4px;
}

/* "Recommended starter" card — orange accent + subtle glow.
   Surfaced on the hub for first-time users to lower the bar to
   starting their first course. */
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-starter {
  border-left-color: #fd7e14;
  background: linear-gradient(135deg, rgba(253, 126, 20, 0.12), rgba(15, 23, 42, 0.55));
  box-shadow: 0 0 20px rgba(253, 126, 20, 0.10);
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-starter .ac-pathway-card-title {
  color: #fd7e14;
}

/* "Now reading" highlight on the current module's card in the
   in-chat course-modules menu. Mint accent flips the orange edge to
   the course-level colour, signalling "this is where you are". */
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-current {
  border-left-color: #2dd4a8;
  background: rgba(45, 212, 168, 0.06);
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.is-current .ac-pathway-card-pct {
  color: #2dd4a8;
  font-weight: 700;
}

/* Secondary chip rail — slightly lighter weight than the primary
   tracks rail, with a tiny top margin so it reads as "less
   important" while still being chips. */
body[data-page="academy-chat"] .curve-chat-root .ac-secondary-rail {
  margin-top: 8px;
  align-items: center;
}

/* Inline navigation pills — chip rail mounted INSIDE a bubble so
   the whole hub reads as one continuous chat message instead of a
   floating page-nav. The label sits above to give the chips
   conversational context. */
body[data-page="academy-chat"] .curve-chat-root .ac-inline-pills-label {
  margin: 14px 0 6px;
  font-size: 12px;
  color: var(--ex-sub);
  font-weight: 600;
  letter-spacing: 0.01em;
}
body[data-page="academy-chat"] .curve-chat-root .ac-inline-pills {
  /* Inside a bubble — drop the rail's outer margin so it hugs the
     label above. */
  margin: 0;
}

/* Pagination controls — surfaced under any card grid that exceeds
   PAGE_SIZE (9). Counter on the left, prev/next on the right. */
body[data-page="academy-chat"] .curve-chat-root .ac-paginated-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--ex-border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ex-muted);
}
body[data-page="academy-chat"] .curve-chat-root .ac-pagination-count {
  font-size: 12px;
  letter-spacing: 0.04em;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pagination-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pagination-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ex-text);
  background: transparent;
  border: 1px solid var(--ex-border);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pagination-btn:hover:not(:disabled) {
  background: rgba(253, 126, 20, 0.10);
  border-color: #fd7e14;
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pagination-page {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ex-sub);
  letter-spacing: 0.04em;
}

/* ── Category tab bar ────────────────────────────────────────────────
   Used by the "Courses" view to switch between course categories
   without leaving the bubble. Each tab shows its course count so
   users can see at a glance how deep each track is. */
body[data-page="academy-chat"] .curve-chat-root .ac-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ex-border);
}
body[data-page="academy-chat"] .curve-chat-root .ac-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--ex-border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ex-sub);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-tab:hover {
  border-color: rgba(253, 126, 20, 0.50);
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-tab.is-active {
  background: linear-gradient(135deg, #fd7e14 0%, #f06a00 100%);
  border-color: #fd7e14;
  color: #fff;
  box-shadow: 0 2px 8px rgba(253, 126, 20, 0.35);
}
body[data-page="academy-chat"] .curve-chat-root .ac-tab .ac-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.50);
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  letter-spacing: 0.02em;
}
body[data-page="academy-chat"] .curve-chat-root .ac-tab.is-active .ac-tab-count {
  background: rgba(255, 255, 255, 0.20);
  color: #fff;
}

/* Tab panel — content area swapped on tab click. The is-swapping
   class is applied for one rAF tick while the content is replaced,
   so the swap reads as a brief fade rather than a hard pop. The
   tab bar itself doesn't move (it's a sibling). */
body[data-page="academy-chat"] .curve-chat-root .ac-tab-panel {
  opacity: 1;
  transition: opacity 0.18s ease;
  /* min-height stops the bubble collapsing momentarily while the
     panel is empty during a swap. */
  min-height: 100px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-tab-panel.is-swapping {
  opacity: 0;
}

/* ── Persona vignette card — kept so course authors can opt in to a
       `pt-cast` block mid-body when one earns its place (e.g. the
       running TMSS storyline in course-tmss-lessons.js). No longer
       auto-injected at the top of every module. */
body[data-page="academy-chat"] .curve-chat-root .pt-cast {
  background: linear-gradient(135deg, rgba(253, 126, 20, 0.10) 0%, rgba(45, 212, 168, 0.06) 100%);
  border: 1px solid rgba(253, 126, 20, 0.30);
  border-left: 3px solid #fd7e14;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ex-sub);
}
body[data-page="academy-chat"] .curve-chat-root .pt-cast-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ex-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
body[data-page="academy-chat"] .curve-chat-root .pt-cast-tag {
  display: inline-flex;
  padding: 2px 8px;
  background: #fd7e14;
  color: #ffffff;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.10em;
  font-weight: 700;
}
body[data-page="academy-chat"] .curve-chat-root .pt-cast p {
  margin: 0 0 10px;
  color: var(--ex-text);
}
body[data-page="academy-chat"] .curve-chat-root .pt-cast p:last-child {
  margin-bottom: 0;
}
body[data-page="academy-chat"] .curve-chat-root .pt-cast em {
  color: var(--ex-text);
  font-style: italic;
}
body[data-page="academy-chat"] .curve-chat-root .pt-cast-attrib {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.20);
  font-size: 12px;
  font-style: italic;
  color: var(--ex-muted);
  line-height: 1.55;
}

/* ── Typewriter cursor — blinks at the end of a typing bubble so
       the user can see the text is still streaming. Removed once
       the bubble class flips off `is-typing`. Bubble itself becomes
       click-skip-able so impatient readers can fast-forward. */
body[data-page="academy-chat"] .curve-chat-root .curve-bubble.is-typing {
  cursor: text;   /* signal the bubble is "alive" */
}
body[data-page="academy-chat"] .curve-chat-root .curve-bubble.is-typing .ac-lesson-body::after {
  content: "▍";
  display: inline-block;
  margin-left: 1px;
  color: #fd7e14;
  font-weight: 400;
  animation: acTypingCursor 0.9s steps(1) infinite;
}
@keyframes acTypingCursor {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="academy-chat"] .curve-chat-root .curve-bubble.is-typing .ac-lesson-body::after {
    animation: none;
    opacity: 0;
  }
}

/* Primary continue-chip styling — solid orange instead of the
   default outline. Re-uses .curve-chip + .is-primary modifier. */
body[data-page="academy-chat"] .curve-chat-root .curve-chip.is-primary {
  background: #fd7e14;
  color: #ffffff;
  border-color: #fd7e14;
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .curve-chip.is-primary:hover {
  background: #b75f0c;
  border-color: #b75f0c;
}

/* ── Feedback strip ──────────────────────────────────────────────────
   Drop-in like/dislike + free-text panel surfaced at the end of every
   module/course/pathway. */
body[data-page="academy-chat"] .curve-chat-root .ac-feedback {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--ex-border);
  border-radius: 10px;
}
/* The PER-MODULE feedback strip ("Was this module useful?", shown after every
   module) is hidden per request. The course-completion strip still shows.
   Both are built by buildFeedbackStrip() in academyConcierge.js — delete this
   rule to bring the per-module strip back. */
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-module { display: none; }
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-ask {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--ex-sub);
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-btns {
  display: inline-flex;
  gap: 6px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.50);
  border: 1px solid var(--ex-border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ex-sub);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-btn:hover {
  border-color: rgba(253, 126, 20, 0.40);
  color: #fff;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-btn-like.is-active {
  background: rgba(45, 212, 168, 0.15);
  border-color: #2dd4a8;
  color: #2dd4a8;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-btn-dislike.is-active {
  background: rgba(248, 113, 113, 0.12);
  border-color: #f87171;
  color: #f87171;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-glyph { font-size: 14px; }
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-note-toggle {
  background: transparent;
  border: none;
  color: var(--ex-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(148, 163, 184, 0.40);
  padding: 4px 6px;
  transition: color 0.12s, text-decoration-color 0.12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-note-toggle:hover {
  color: #fd7e14;
  text-decoration-color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-text {
  display: none;
  margin-top: 10px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-text.is-open { display: block; }
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-textarea {
  width: 100%;
  resize: vertical;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.60);
  border: 1px solid var(--ex-border);
  border-radius: 8px;
  color: var(--ex-text);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  box-sizing: border-box;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-textarea:focus {
  outline: none;
  border-color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-feedback-saved {
  margin-top: 4px;
  font-size: 12px;
  color: #2dd4a8;
  height: 14px;
}

/* ── Favourite star ─────────────────────────────────────────────────
   Reusable button used both in widget chunks (during a course) and
   on widget cards (in the library). Toggles localStorage on click. */
body[data-page="academy-chat"] .curve-chat-root .ac-fav-star {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.50);
  border: 1px solid var(--ex-border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ex-sub);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-fav-star:hover {
  border-color: #fd7e14;
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-fav-star.is-on {
  background: rgba(253, 126, 20, 0.18);
  border-color: #fd7e14;
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-fav-glyph { font-size: 13px; }
body[data-page="academy-chat"] .curve-chat-root .ac-fav-star-card {
  /* Inside a widget card's actions row: smaller, secondary, sits to
     the right of the primary Open button. */
  font-size: 12px;
  padding: 5px 9px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget-fav-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 8px;
}

/* ── "Popular" badge ────────────────────────────────────────────────
   Tiny pill we drop next to a card title to flag a popular course
   or pathway. Seeded for now (POPULAR_COURSES / POPULAR_PATHWAYS in
   academyConcierge.js); swap to real aggregate later. */
body[data-page="academy-chat"] .curve-chat-root .ac-popular-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(253, 126, 20, 0.18);
  color: #fd7e14;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* Empty-state copy inside a tab panel (used by the Favourites tab
   when the user hasn't starred anything yet). */
body[data-page="academy-chat"] .curve-chat-root .ac-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ex-sub);
  background: rgba(15, 23, 42, 0.30);
  border: 1px dashed var(--ex-border);
  border-radius: 10px;
  line-height: 1.55;
}
/* Sub-note (e.g. "3 widgets saved across 2 courses") that sits
   under a bubble's headline paragraph. */
body[data-page="academy-chat"] .curve-chat-root .ac-subnote {
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--ex-sub);
}

/* ════════════════════════════════════════════════════════════════════
   Widget chrome — every interactive course widget renders inside an
   .ac-widget container. The course-*.js files were originally written
   for the dedicated white-page course shell, so their forms / tables /
   buttons fall through to browser defaults (white inputs, bare tables,
   gray buttons) which break against the dark chat background. The
   rules below give them sensible dark-theme defaults so any widget
   author can write to the bare HTML pattern and have it look right.
   ════════════════════════════════════════════════════════════════════ */

/* Inputs / selects / textareas inside any widget — dark base, brand
   focus ring. Caps prevent them from blowing out the bubble. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget input[type="text"],
body[data-page="academy-chat"] .curve-chat-root .ac-widget input[type="number"],
body[data-page="academy-chat"] .curve-chat-root .ac-widget input[type="search"],
body[data-page="academy-chat"] .curve-chat-root .ac-widget select,
body[data-page="academy-chat"] .curve-chat-root .ac-widget textarea {
  padding: 6px 9px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--ex-border);
  border-radius: 6px;
  color: var(--ex-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  box-sizing: border-box;
  max-width: 100%;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget input:focus,
body[data-page="academy-chat"] .curve-chat-root .ac-widget select:focus,
body[data-page="academy-chat"] .curve-chat-root .ac-widget textarea:focus {
  outline: none;
  border-color: #fd7e14;
  box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.20);
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget input[type="range"] {
  accent-color: #fd7e14;
  background: transparent;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget label {
  color: var(--ex-text);
  font-size: 13px;
}

/* Generic button styling (covers anonymous <button> calls inside
   widget DOM — chart range buttons, tenor toggles, accordion heads).
   Per-widget classes can still override. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--ex-border);
  border-radius: 999px;
  color: var(--ex-sub);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget button:hover:not(:disabled) {
  border-color: #fd7e14;
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget button.is-active,
body[data-page="academy-chat"] .curve-chat-root .ac-widget button.active {
  background: rgba(253, 126, 20, 0.18);
  border-color: #fd7e14;
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Tables — every <table> inside a widget gets a dark, padded look
   with a clear header row, subtle row dividers, and zebra striping
   on tbody so the eye can track across columns. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget table th {
  text-align: left;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.50);
  color: var(--ex-sub);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(148, 163, 184, 0.30);
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  color: var(--ex-text);
  vertical-align: top;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.25);
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget table tbody tr:hover td {
  background: rgba(253, 126, 20, 0.06);
}

/* Common chart-toolbar patterns from PWLB widgets (.ph-controls,
   .ph-toggles) and elsewhere. The base button rule above mostly
   covers them; this just tightens the layout. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .ph-controls,
body[data-page="academy-chat"] .curve-chat-root .ac-widget .ph-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

/* Summary "rate today" card grids that some widgets emit as a
   sibling block under the chart (.ph-cards in PWLB, .pa-kpis in
   activity). Force a 2-4-up grid so they read as cards, not a
   stacked list. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .ph-cards,
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pa-kpis,
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .ph-card,
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pa-kpi,
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-kpi {
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--ex-border);
  border-left: 3px solid #fd7e14;
  border-radius: 6px;
}

/* Loading pill — surfaced inside .ac-widget while a course's
   __bootstrap() promise is pending. Tells the user the chat is
   waiting on a live data feed. Removed when the widget re-renders
   on bootstrap resolve. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(253, 126, 20, 0.10);
  border: 1px solid rgba(253, 126, 20, 0.35);
  border-radius: 6px;
  color: #fd7e14;
  font-size: 12px;
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget-loading-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(253, 126, 20, 0.30);
  border-top-color: #fd7e14;
  border-radius: 50%;
  animation: ac-widget-loading-spin 0.7s linear infinite;
}
@keyframes ac-widget-loading-spin {
  to { transform: rotate(360deg); }
}

/* Widget warning / unavailable text — keep the "Loading…" /
   "feed unavailable" sentinels readable. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-warn {
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.30);
  border: 1px dashed var(--ex-border);
  border-radius: 6px;
  color: var(--ex-sub);
  font-size: 12px;
  font-style: italic;
}
/* Loading variant — same box but with a spinner glyph. Course code
   detects a "Loading" message and adds the modifier class.
   `:not([hidden])` so JS that sets `el.hidden = true` actually hides
   the box (otherwise inline-flex overrides the UA `display:none`). */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-warn.is-loading:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(253, 126, 20, 0.10);
  border: 1px solid rgba(253, 126, 20, 0.35);
  border-style: solid;
  color: #fd7e14;
  font-style: normal;
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-warn.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(253, 126, 20, 0.30);
  border-top-color: #fd7e14;
  border-radius: 50%;
  animation: ac-widget-loading-spin 0.7s linear infinite;
  flex-shrink: 0;
}
/* Widget head + intro — the small label and intro line many widgets
   emit at the top. Already styled inline by some widgets, but the
   rules below give a sane dark default. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ex-sub);
  margin-bottom: 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-intro {
  margin: 0 0 10px;
  color: var(--ex-sub);
  font-size: 12.5px;
  line-height: 1.55;
}
/* Range buttons (.ph-range-btn etc. classes that already exist in the
   widget DOM but rely on the base button rules above for theming) —
   nothing extra needed; the .ac-widget button rule covers them. */

/* ════════════════════════════════════════════════════════════════════
   pt-* component classes — every course widget was originally written
   for the dedicated white-page course shell, where pwlb-training.css
   styles the pt-card / pt-callout / pt-grid etc. components. The chat
   doesn't load that stylesheet (it's a 2000-line light-theme shell);
   instead, the rules below re-implement just the COMPONENT layer in
   dark theme so widgets that emit pt-card-mini / pt-grid-3 / pt-callout
   etc. look right inside .ac-widget without per-widget changes.
   ════════════════════════════════════════════════════════════════════ */

/* ── pt-grid-2 / pt-grid-3 — card grid containers used to lay out
       KPI cards (Maturity / EIP / Annuity totals etc.). */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-grid-2,
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-grid-3 {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-grid-2 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-grid-3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ── pt-card-mini — KPI / summary card used inside pt-grid-* */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-card-mini {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--ex-border);
  border-left: 3px solid #fd7e14;
  border-radius: 6px;
  padding: 10px 12px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-card-k {
  color: var(--ex-sub);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 4px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-card-v {
  font-size: 20px;
  font-weight: 700;
  color: var(--ex-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-card-v.pt-emph { color: #fd7e14; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-card-v.pt-up   { color: #2dd4a8; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-card-v.pt-down { color: #f87171; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-card-meta {
  font-size: 12px;
  color: var(--ex-sub);
  margin-top: 4px;
  line-height: 1.4;
}

/* ── pt-callout — boxed note with a coloured left rail. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-callout {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--ex-border);
  border-left: 3px solid #fd7e14;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 12px 0;
  color: var(--ex-text);
  font-size: 13px;
  line-height: 1.55;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-callout p { margin: 0 0 8px; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-callout p:last-child { margin-bottom: 0; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-callout-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fd7e14;
  font-weight: 700;
  margin-bottom: 6px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-callout.example {
  border-left-color: #5fa9e8;
  background: rgba(95, 169, 232, 0.08);
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-callout.example .pt-callout-title { color: #5fa9e8; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-callout.takeaway {
  border-left-color: #2dd4a8;
  background: rgba(45, 212, 168, 0.08);
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-callout.takeaway .pt-callout-title { color: #2dd4a8; }

/* ── pt-widget-controls — input row at the top of many widgets.
       Inputs / selects already styled by the generic .ac-widget rule;
       this just lays out the labels in a flex row. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ex-border);
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ex-sub);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 1 1 140px;
  min-width: 120px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-output {
  margin-top: 4px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-widget-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ex-border);
  font-size: 12px;
  color: var(--ex-sub);
  line-height: 1.5;
}

/* ── pt-figure — boxed diagram / illustration. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-figure {
  margin: 14px 0;
  padding: 14px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--ex-border);
  border-radius: 6px;
  text-align: center;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-figure-caption {
  font-size: 12px;
  color: var(--ex-sub);
  margin-top: 8px;
  font-style: italic;
}

/* ── pt-flow — inline-flex diagram of node → arrow → node. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-flow {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: var(--ex-text);
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-flow-node {
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--ex-border);
  border-radius: 4px;
  color: var(--ex-text);
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-flow-arrow {
  display: inline-flex;
  align-items: center;
  margin: 0 4px;
  color: #fd7e14;
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-flow-arrow span {
  font-size: 12px;
  padding: 0 6px;
}

/* ── pt-table — wider data table some widgets use (different from
       the bare <table> rules above). */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-table th,
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  vertical-align: top;
  text-align: left;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-table th {
  background: rgba(15, 23, 42, 0.50);
  color: var(--ex-sub);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom-color: rgba(148, 163, 184, 0.30);
}

/* ── Color modifier utilities (some widgets put these on plain text). */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-emph   { color: #fd7e14; font-weight: 700; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-up     { color: #2dd4a8; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-down   { color: #f87171; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-muted  { color: var(--ex-sub); }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-navy   { color: var(--ex-text); font-weight: 700; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-orange { color: #fd7e14; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-funded { color: #2dd4a8; font-weight: 700; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-in     { color: #5fa9e8; font-weight: 700; }

/* ── pt-scenario-btns — preset-scenario picker rail. Re-uses the
       generic .ac-widget button rule for the pills; this just
       handles spacing. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-scenario-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ── pt-slider-row — slider + value-readout pair (some widgets). */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-slider-row input[type="range"] { flex: 1 1 auto; }
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-slider-val {
  flex: 0 0 auto;
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #fd7e14;
}

/* ── pt-line — small horizontal divider used in some widgets. */
body[data-page="academy-chat"] .curve-chat-root .ac-widget .pt-line {
  height: 1px;
  background: var(--ex-border);
  margin: 12px 0;
}

/* ────────────────────────────────────────────────────────────────
   COURSE NAVIGATION POLISH — May 2026
   Three additions, grounded in pedagogy research:
   A) Persistent context bar in the chat header (cognitive load).
   B) Full-timeline rail with progress bar (adult agency, Duolingo).
   C) Pace popover next to Hub (individual rhythm).
   ──────────────────────────────────────────────────────────────── */

/* ── A. Course context bar ────────────────────────────────────── */
body[data-page="academy-chat"] .curve-chat-root .ac-course-context {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 10px;
  margin: 0 12px;
  border-radius: 999px;
  background: rgba(253, 126, 20, 0.10);
  border: 1px solid rgba(253, 126, 20, 0.32);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
}
body[data-page="academy-chat"] .curve-chat-root .ac-course-context-title {
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-page="academy-chat"] .curve-chat-root .ac-course-context-sep {
  opacity: 0.55;
}
body[data-page="academy-chat"] .curve-chat-root .ac-course-context-module {
  color: #fd7e14;
  font-variant-numeric: tabular-nums;
}

/* ── B. Full-timeline rail ─────────────────────────────────────── */
body[data-page="academy-chat"] .curve-chat-root .academy-rail-coursetitle {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
body[data-page="academy-chat"] .curve-chat-root .academy-rail-modulesub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
  line-height: 1.3;
}
/* Step counter — granular signal that ticks every step within the
   current module, so the learner sees movement even when the macro
   "modules done" bar isn't shifting yet. */
body[data-page="academy-chat"] .curve-chat-root .academy-rail-stepsub {
  font-size: 12px;
  font-weight: 700;
  color: #fd7e14;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
body[data-page="academy-chat"] .curve-chat-root .academy-rail-modtitle {
  color: #ffffff;
  font-weight: 600;
}
body[data-page="academy-chat"] .curve-chat-root .academy-rail-progress {
  margin-bottom: 14px;
}
body[data-page="academy-chat"] .curve-chat-root .academy-rail-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  overflow: hidden;
}
body[data-page="academy-chat"] .curve-chat-root .academy-rail-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fd7e14 0%, #ffb35a 100%);
  border-radius: 999px;
  transition: width 0.32s ease;
}
body[data-page="academy-chat"] .curve-chat-root .academy-rail-progress-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}
body[data-page="academy-chat"] .curve-chat-root .academy-rail-progress-pct {
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .curve-side-rail-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
body[data-page="academy-chat"] .curve-chat-root .curve-side-rail-duration {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}
/* Done state — green check marker, brighter label. */
body[data-page="academy-chat"] .curve-chat-root .curve-side-rail-item.is-done .curve-side-rail-marker {
  background: rgba(45, 212, 168, 0.22);
  color: #2dd4a8;
  border: 1px solid rgba(45, 212, 168, 0.55);
}
body[data-page="academy-chat"] .curve-chat-root .curve-side-rail-item.is-done .curve-side-rail-label {
  color: rgba(255, 255, 255, 0.88);
}
/* Future state — greyed but visible, clickable so learners can skip
   ahead to any step (adult agency). Hover lifts the opacity and
   nudges the marker toward orange so the affordance reads. */
body[data-page="academy-chat"] .curve-chat-root .curve-side-rail-item.is-future {
  opacity: 0.55;
  cursor: pointer;
}
body[data-page="academy-chat"] .curve-chat-root .curve-side-rail-item.is-future:hover {
  opacity: 0.95;
}
body[data-page="academy-chat"] .curve-chat-root .curve-side-rail-item.is-future .curve-side-rail-marker {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.20);
}
body[data-page="academy-chat"] .curve-chat-root .curve-side-rail-item.is-future:hover .curve-side-rail-marker {
  color: #fd7e14;
  border-color: rgba(253, 126, 20, 0.55);
}

/* ── C. Pace control ───────────────────────────────────────────── */
/* Anchor the popover to the pills container — the pace button and the
   popover are siblings, so the parent needs position:relative to be
   the offset parent. */
body[data-page="academy-chat"] .curve-chat-root .ac-header-pills {
  position: relative;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pace-label {
  font-variant-numeric: tabular-nums;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pace-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(253, 126, 20, 0.30);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.40);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pace-popover-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  padding: 4px 8px 6px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pace-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pace-option:hover {
  background: rgba(253, 126, 20, 0.12);
  border-color: rgba(253, 126, 20, 0.30);
}
body[data-page="academy-chat"] .curve-chat-root .ac-pace-option.is-selected {
  background: rgba(253, 126, 20, 0.18);
  border-color: rgba(253, 126, 20, 0.55);
}
body[data-page="academy-chat"] .curve-chat-root .ac-pace-option-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pace-option-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Academy gating ──────────────────────────────────────────────
   Locked courses (those behind the expert-panel review gate) are
   shown in the catalogue with a muted visual treatment and a small
   lock icon. The three flagship taster courses (PWLB Explained,
   SONIA, PWLB Predictions Guide) carry a green "Free taster" badge
   to read as the open doors. */
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.ac-card-locked {
  opacity: 0.66;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-card.ac-card-locked:hover {
  opacity: 0.85;
  border-color: rgba(253, 126, 20, 0.30);
}
body[data-page="academy-chat"] .curve-chat-root .ac-lock-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: rgba(255, 255, 255, 0.50);
  font-size: 12px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-free-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(45, 212, 168, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(45, 212, 168, 0.45);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-action.is-locked {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.55) !important;
  border: 1px dashed rgba(255, 255, 255, 0.18) !important;
  cursor: pointer;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-action.is-locked:hover {
  background: rgba(253, 126, 20, 0.10) !important;
  color: #fd7e14 !important;
  border-color: rgba(253, 126, 20, 0.45) !important;
}

/* "X of Y open now" inline tag on pathway cards — quiet, monospace-ish,
   reads as a status note rather than chrome. */
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-availline {
  display: inline;
  color: #6ee7b7;
  font-size: 12px;
  letter-spacing: 0.01em;
}
body[data-page="academy-chat"] .curve-chat-root .ac-pathway-availline strong {
  color: #fff;
  font-weight: 700;
}

/* Taster row inside the locked-course gate bubble — three pills, each
   pointing to a free flagship course. Each button shows the course
   title bold + a small "pairs with X" hint underneath. */
body[data-page="academy-chat"] .curve-chat-root .ac-taster-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-taster-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(253, 126, 20, 0.08);
  border: 1px solid rgba(253, 126, 20, 0.35);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-taster-btn:hover {
  background: rgba(253, 126, 20, 0.18);
  border-color: #fd7e14;
  transform: translateY(-1px);
}
body[data-page="academy-chat"] .curve-chat-root .ac-taster-btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #fd7e14 0%, #c95800 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-taster-btn-body {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
body[data-page="academy-chat"] .curve-chat-root .ac-taster-btn-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}
body[data-page="academy-chat"] .curve-chat-root .ac-taster-btn-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

/* Expert-access-code form on the locked-course gate bubble. */
body[data-page="academy-chat"] .curve-chat-root .ac-expert-gate {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
body[data-page="academy-chat"] .curve-chat-root .ac-expert-gate-lead {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 8px;
}
body[data-page="academy-chat"] .curve-chat-root .ac-expert-gate-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
body[data-page="academy-chat"] .curve-chat-root .ac-expert-input {
  flex: 1 1 auto;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  outline: none;
  transition: border-color .12s, background .12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-expert-input:focus {
  border-color: rgba(253, 126, 20, 0.65);
  background: rgba(255, 255, 255, 0.12);
}
body[data-page="academy-chat"] .curve-chat-root .ac-expert-input.is-error {
  border-color: #c0392b;
  background: rgba(192, 57, 43, 0.18);
}
body[data-page="academy-chat"] .curve-chat-root .ac-expert-submit {
  background: #fd7e14;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter .12s;
}
body[data-page="academy-chat"] .curve-chat-root .ac-expert-submit:hover {
  filter: brightness(1.08);
}

/* ── Mobile: concierge-only ─────────────────────────────────────────
   The slide deck is a wide presentation format (charts, dashboards,
   multi-column tables) that doesn't read on a phone. On small screens
   hide the "View as slides" launcher so the guided chat is the single
   path; the hub hides its Slides buttons too, and deck.html nudges any
   mobile visitor back here. */
@media (max-width: 640px) {
  #academyCourseSlides,
  .ac-pill.is-slides-nav { display: none !important; }
}
