/* ═══════════════════════════════════════════════════════════════════
   curveTeaser.css — chat preview for the LA Curve product.
   Visual language is deliberately the SAME as the next_la chat (see
   next_la/src/exchange.css and the inline styles in LAexchange.jsx),
   even where it diverges from the rest of laready.co.uk. The whole
   block is scoped under .curve-chat-root so it doesn't leak.

   Step 3 (now): minimal scaffold styles only. Bubbles, chips, typing
   indicator and chart styles arrive in Step 4.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens (verbatim from next_la chat theme) ──────────────────── */
.curve-chat-root {
  --ex-navy:      #0f172a;
  --ex-navy-mid:  #1e293b;
  --ex-card:      #1e293b;
  --ex-border:    #334155;
  --ex-text:      #f1f5f9;
  --ex-sub:       #cbd5e1;
  --ex-muted:     #94a3b8;
  --ex-mint:      #2dd4a8;
  --ex-mint-soft: rgba(45, 212, 168, 0.10);
  --ex-mint-dark: #0c9a6d;
  --ex-orange:    #e67e22;
  --ex-blue-text: #34d399;

  display: block;
  width: 100%;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ex-text);
}

/* The outer panel — uses the standard laready navy gradient so the
   chat sits inside the same visual language as the rest of the site
   (gradient: --pt-navy-grad in site.css), while the cards/bubbles
   inside still come from the next_la chat palette.
   Height is LOCKED to the viewport (less header + padding) so the
   page itself never scrolls; the internal `.curve-chat-scroll`
   handles overflow. */
/* Chat-page rule: the page must NEVER scroll vertically. Chain of
   heights is: window → body → site-main-wrap (has its own padding)
   → main.curve-main (our padding) → .curve-chat-root → .curve-chat-panel.
   Each link is locked to fit the parent so the only scroll happens
   inside the inner `.curve-chat-scroll`. */

/* On the chat pages, lock the wrap to the viewport so only the inner
   .curve-chat-scroll handles overflow. Top padding is zeroed (vs the
   16px on data pages) so the chat panel's dark-blue header lines up
   with the sidebar's navy gradient edge — gives the page a single
   unbroken navigator-to-chat top line. Sides/bottom keep the canonical
   gap. */
body[data-page="curve"] .site-main-wrap,
body[data-page="tms-mirror-chat"] .site-main-wrap,
body[data-page="academy-chat"] .site-main-wrap {
  height: 100vh;
  max-height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
  padding-top: 0;
}
/* Mobile keeps the header visible to host the hamburger; subtract it. */
@media (max-width: 900px) {
  body[data-page="curve"] .site-main-wrap,
  body[data-page="tms-mirror-chat"] .site-main-wrap,
  body[data-page="academy-chat"] .site-main-wrap {
    height: calc(100vh - var(--shell-header-h, 60px));
    max-height: calc(100vh - var(--shell-header-h, 60px));
  }
}

.curve-main {
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.curve-chat-root {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.curve-chat-root .curve-chat-panel {
  background: linear-gradient(120deg, #0a2540 0%, #143659 60%, #1a4775 100%);
  border: 1px solid var(--ex-border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ── Header ─────────────────────────────────────────────────────── */
.curve-chat-root .curve-chat-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  /* Transparent so the panel's navy gradient shows through cleanly. */
  background: rgba(10, 37, 64, 0.20);
  flex-shrink: 0;
}
.curve-chat-root .curve-chat-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.curve-chat-root .curve-chat-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ex-mint);
  color: var(--ex-navy);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.curve-chat-root .curve-chat-brand-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--ex-text);
  letter-spacing: -0.01em;
}
/* The brand is now the two-tone "PWLBacademy" wordmark (matching the rest of
   the site) and is a button that returns to the hub — strip the button chrome
   and colour the "academy" half orange. */
.curve-chat-root button.curve-chat-brand-name {
  background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; font-family: inherit; line-height: 1;
}
.curve-chat-root .curve-chat-brand-accent { color: var(--ac-orange, #fd7e14); }
.curve-chat-root .curve-chat-brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ex-mint);
  background: var(--ex-mint-soft);
  border: 1px solid rgba(45, 212, 168, 0.35);
  border-radius: 4px;
}
.curve-chat-root .curve-chat-tagline {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ex-muted);
  max-width: 640px;
  line-height: 1.5;
}

/* ── Scroll region ──────────────────────────────────────────────── */
.curve-chat-root .curve-chat-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  /* Generous bottom padding so the latest message never sits flush
     against the bottom of the panel — leaves breathing room and a
     hint that you're at "the bottom" rather than mid-cut. */
  padding: 24px 24px 120px;
}
.curve-chat-root .curve-chat-bubbles {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 850px;
  margin: 0 auto;
  /* Extra bottom margin compounds with .curve-chat-scroll's bottom
     padding when the latest bubble has interactive chips — gives the
     chip rail room to breathe too. */
  padding-bottom: 24px;
}

/* ── Scrollbar polish (matches exchange.css) ────────────────────── */
.curve-chat-root .curve-chat-scroll::-webkit-scrollbar {
  width: 6px;
}
.curve-chat-root .curve-chat-scroll::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 3px;
}

/* ── Animations (cribbed verbatim from LAexchange.jsx inline <style>)
      so the chat opens with the same feel: fade-in bubbles, staggered
      chip cascade, gentle pulsing typing dot. ───────────────────── */
@keyframes curveChatBubbleIn {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes curveChatChipIn {
  0%   { opacity: 0; transform: translateY(6px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes curveChatThinkingPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ── Message row (one per bubble pair: bubble + chips below it) ── */
.curve-chat-root .curve-msg-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  animation: curveChatBubbleIn 220ms ease-out both;
}
.curve-chat-root .curve-msg-row.is-user {
  align-items: flex-end;
}

/* ── Bubble — assistant (default) and user variants ─────────────── */
.curve-chat-root .curve-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  background: var(--ex-card);
  color: var(--ex-text);
  border: 1px solid var(--ex-border);
}
.curve-chat-root .curve-bubble.is-user {
  background: var(--ex-mint);
  color: var(--ex-navy);
  border: none;
  font-weight: 500;
}

/* Markdown-ish formatting inside bubbles */
.curve-chat-root .curve-bubble strong { font-weight: 700; color: var(--ex-text); }
.curve-chat-root .curve-bubble.is-user strong { color: var(--ex-navy); }
.curve-chat-root .curve-bubble p { margin: 0 0 8px; }
.curve-chat-root .curve-bubble p:last-child { margin-bottom: 0; }

/* ── Typing indicator (assistant is "thinking") ─────────────────── */
.curve-chat-root .curve-thinking {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  max-width: 85%;
  background: var(--ex-card);
  border: 1px solid var(--ex-border);
  border-radius: 14px;
  font-size: 13px;
  color: var(--ex-muted);
  align-self: flex-start;
  animation: curveChatBubbleIn 220ms ease-out both;
}
.curve-chat-root .curve-thinking-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ex-mint);
  animation: curveChatThinkingPulse 1.4s ease-in-out infinite;
}

/* ── Chip rail under the most recent assistant bubble ───────────── */
.curve-chat-root .curve-chip-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  align-self: flex-start;
}
.curve-chat-root .curve-chip {
  display: inline-flex;
  align-items: center;
  background: var(--ex-card);
  border: 1px solid var(--ex-border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ex-text);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.10s ease;
  /* Stagger handled inline (animation-delay: i * 50ms) */
  animation: curveChatChipIn 260ms ease-out both;
}
.curve-chat-root .curve-chip:hover {
  background: #253347;
  border-color: var(--ex-mint);
}
.curve-chat-root .curve-chip:active {
  transform: scale(0.98);
}

/* Primary chip variant — used for the conversion-to-product CTA
   ("Add your deals →" on Curve). Filled accent colour so it reads
   as the dominant action even when sitting alongside three or four
   secondary chips. Slightly larger + bolder + subtle glow. */
.curve-chat-root .curve-chip.is-primary {
  background: var(--ex-mint);
  border-color: var(--ex-mint);
  color: var(--ex-navy);
  font-weight: 700;
  padding: 9px 18px;
  font-size: 13.5px;
  box-shadow: 0 4px 14px rgba(45, 212, 168, 0.28);
  letter-spacing: 0.01em;
}
.curve-chat-root .curve-chip.is-primary:hover {
  background: #5eead4;
  border-color: #5eead4;
  color: var(--ex-navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(45, 212, 168, 0.40);
}
.curve-chat-root .curve-chip.is-primary:disabled,
.curve-chat-root .curve-chip.is-primary[aria-disabled="true"] {
  background: rgba(45, 212, 168, 0.18) !important;
  border-color: rgba(45, 212, 168, 0.18) !important;
  color: rgba(10, 37, 64, 0.55) !important;
  box-shadow: none !important;
}
/* Animation `both` keeps opacity:1 even after settling, so use a
   filter + colour shift for the disabled state — and `!important` to
   trump any inline animation final state. */
.curve-chat-root .curve-chip:disabled,
.curve-chat-root .curve-chip[aria-disabled="true"] {
  background: transparent !important;
  border-color: rgba(51, 65, 85, 0.55) !important;
  color: rgba(241, 245, 249, 0.40) !important;
  cursor: default !important;
}
.curve-chat-root .curve-chip:disabled:hover,
.curve-chat-root .curve-chip[aria-disabled="true"]:hover {
  background: transparent !important;
  border-color: rgba(51, 65, 85, 0.55) !important;
}

/* Selected state — the chip the user clicked at this fork in the
   conversation. Mint outline + faint mint glow signals "this is the
   path you took". The other chips in the same rail remain fully
   clickable: tapping one of them rewinds the chat back to this
   bubble and takes the alternative branch from here. */
.curve-chat-root .curve-chip.is-selected {
  border-color: var(--ex-mint);
  color: var(--ex-mint);
  background: rgba(45, 212, 168, 0.10);
  font-weight: 600;
}
.curve-chat-root .curve-chip.is-selected::before {
  content: "✓";
  margin-right: 6px;
  font-size: 12px;
  color: var(--ex-mint);
  font-weight: 700;
}
.curve-chat-root .curve-chip.is-selected:hover {
  background: rgba(45, 212, 168, 0.16);
  border-color: var(--ex-mint);
  color: var(--ex-mint);
}
/* Primary chip in selected state — keep the filled mint look but
   add the check glyph so the selection is still clear. */
.curve-chat-root .curve-chip.is-primary.is-selected {
  background: var(--ex-mint);
  border-color: var(--ex-mint);
  color: var(--ex-navy);
}
.curve-chat-root .curve-chip.is-primary.is-selected::before {
  color: var(--ex-navy);
}

/* Academy variant — chips use orange accent, so the selected state
   carries the brand colour instead of Curve's mint. */
body[data-page="academy-chat"] .curve-chat-root .curve-chip.is-selected {
  border-color: #fd7e14;
  color: #fd7e14;
  background: rgba(253, 126, 20, 0.10);
}
body[data-page="academy-chat"] .curve-chat-root .curve-chip.is-selected::before {
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .curve-chip.is-selected:hover {
  background: rgba(253, 126, 20, 0.18);
  border-color: #fd7e14;
  color: #fd7e14;
}
body[data-page="academy-chat"] .curve-chat-root .curve-chip.is-primary.is-selected {
  background: #fd7e14;
  border-color: #fd7e14;
  color: #ffffff;
}
body[data-page="academy-chat"] .curve-chat-root .curve-chip.is-primary.is-selected::before {
  color: #ffffff;
}

/* ── Chart frame inside a bubble ────────────────────────────────── */
/* Visual idiom mirrors the production LA Curve `.dash-card`: dark
   slate surface, faint border, top strip / chrome / canvas. */
.curve-chat-root .curve-bubble-chart {
  width: 100%;
  margin: 12px 0 4px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--ex-border);
  border-radius: 10px;
  padding: 14px 16px 12px;
}

/* ── Curve view (.is-fullCurve) — top strip with legend pills + Hide
       deals toggle, then the canvas. ─────────────────────────────── */
.curve-chat-root .curve-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.curve-chat-root .curve-chart-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--ex-sub);
  flex-wrap: wrap;
  margin: 0;
}
.curve-chat-root .curve-chart-legend-item {
  display: inline-flex;
  align-items: center;
}
.curve-chat-root .curve-chart-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  vertical-align: middle;
}
.curve-chat-root .curve-chart-legend-dot.is-square {
  border-radius: 2px;
  width: 12px;
  height: 8px;
}

/* ── Toggle pill buttons (Rate / Spread / ?Explain / Hide deals /
       tenor pills). Mirrors `.toggle-btn` from lacurve-scoped.css. ── */
.curve-chat-root .curve-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ex-sub);
  background: transparent;
  border: 1px solid var(--ex-border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.curve-chat-root .curve-toggle-btn:hover {
  border-color: var(--ex-mint);
  color: var(--ex-text);
}
.curve-chat-root .curve-toggle-btn.active {
  background: var(--ex-mint);
  color: var(--ex-navy);
  border-color: var(--ex-mint);
}
.curve-chat-root .curve-toggle-btn.ghost {
  border-style: solid;
  color: var(--ex-muted);
}
.curve-chat-root .curve-toggle-btn.is-pill {
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
}

/* ── History view (.is-history) — outer "CURVE HISTORY" card + tenor
       row + inner dash-card with title + chart + caption. ────────── */
.curve-chat-root .curve-hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.curve-chat-root .curve-hist-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ex-muted);
}
.curve-chat-root .curve-hist-toggles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.curve-chat-root .curve-tenor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.curve-chat-root .curve-tenor-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ex-muted);
  margin-right: 6px;
}
.curve-chat-root .curve-tenor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ex-sub);
  background: transparent;
  border: 1px solid var(--ex-border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.curve-chat-root .curve-tenor-btn:hover {
  border-color: var(--ex-mint);
  color: var(--ex-text);
}
.curve-chat-root .curve-tenor-btn.active {
  background: var(--ex-mint);
  color: var(--ex-navy);
  border-color: var(--ex-mint);
}

/* Inner card-in-card frame for the history chart. */
.curve-chat-root .curve-hist-inner {
  background: rgba(15, 23, 42, 0.40);
  border: 1px solid var(--ex-border);
  border-radius: 10px;
  padding: 16px 18px 14px;
}
.curve-chat-root .curve-hist-inner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ex-text);
  letter-spacing: -0.01em;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1.5px solid var(--ex-mint);
}
.curve-chat-root .curve-hist-caption {
  font-size: 12px;
  color: var(--ex-muted);
  line-height: 1.5;
  margin-top: 8px;
}

/* The canvas frame — common to both chart types. */
.curve-chat-root .curve-bubble-chart-host {
  position: relative;
  width: 100%;
  height: 260px;
}
.curve-chat-root .curve-bubble-chart-host canvas {
  width: 100% !important;
  height: 100% !important;
}

/* The history view's inner card carries its own padding, so the
   canvas can run a touch shorter and let the legend breathe. */
.curve-chat-root .curve-bubble-chart.is-history .curve-bubble-chart-host {
  height: 240px;
}

/* The chart bubble can be wider since it carries a chart not text */
.curve-chat-root .curve-bubble.has-chart {
  max-width: 95%;
  width: min(760px, 95%);
}

/* ═══════════════════════════════════════════════════════════════════
   "Add your deal" chooser — four-card entry-method selector and its
   sub-panels (email / form / paste / bulk). All scoped under
   .curve-chat-root and uses the LA Curve mint/navy palette
   (--ex-mint, --ex-navy etc) — deliberately NOT the pwlbtoday orange.
   ═══════════════════════════════════════════════════════════════════ */
.curve-chat-root .curve-deal-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.curve-chat-root .curve-deal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) {
  .curve-chat-root .curve-deal-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* Primary card — full-width, visually dominant. Forwarding a broker
   email is the "right answer" so the card screams it. */
.curve-chat-root .curve-deal-card-primary {
  position: relative;
  width: 100%;
  text-align: left;
  background: linear-gradient(135deg, rgba(45, 212, 168, 0.18) 0%, rgba(45, 212, 168, 0.06) 100%);
  border: 1.5px solid var(--ex-mint);
  border-radius: 14px;
  padding: 18px 22px;
  display: block;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(45, 212, 168, 0.18);
}
.curve-chat-root .curve-deal-card-primary:hover {
  background: linear-gradient(135deg, rgba(45, 212, 168, 0.28) 0%, rgba(45, 212, 168, 0.12) 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(45, 212, 168, 0.32);
  border-color: var(--ex-mint);
}
.curve-chat-root .curve-deal-card-primary.is-active {
  background: var(--ex-mint);
  color: var(--ex-navy);
}
.curve-chat-root .curve-deal-primary-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--ex-mint);
  color: var(--ex-navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.curve-chat-root .curve-deal-card-primary.is-active .curve-deal-primary-badge {
  background: var(--ex-navy);
  color: var(--ex-mint);
}
.curve-chat-root .curve-deal-primary-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}
.curve-chat-root .curve-deal-primary-icon {
  font-size: 32px;
  line-height: 1;
  color: var(--ex-mint);
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 212, 168, 0.18);
  border-radius: 50%;
}
.curve-chat-root .curve-deal-card-primary.is-active .curve-deal-primary-icon {
  color: var(--ex-navy);
  background: rgba(15, 23, 42, 0.18);
}
.curve-chat-root .curve-deal-primary-body { flex: 1; }
.curve-chat-root .curve-deal-card-primary .curve-deal-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.curve-chat-root .curve-deal-card-primary .curve-deal-card-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ex-sub);
}
.curve-chat-root .curve-deal-card-primary.is-active .curve-deal-card-desc {
  color: rgba(15, 23, 42, 0.78);
}

/* On narrow viewports the absolute-positioned badge overlaps the wrapped
   title. Pull the badge out of the corner so it sits above the content. */
@media (max-width: 540px) {
  .curve-chat-root .curve-deal-card-primary {
    padding: 14px 16px 16px;
  }
  .curve-chat-root .curve-deal-primary-badge {
    position: static;
    display: inline-block;
    margin-bottom: 10px;
  }
}

/* "Or another way →" divider sits between the primary and secondary
   options, communicating the priority. */
.curve-chat-root .curve-deal-or {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ex-muted);
  margin: 6px 0 -4px;
  position: relative;
}
.curve-chat-root .curve-deal-or::before,
.curve-chat-root .curve-deal-or::after {
  content: "";
  display: inline-block;
  width: 60px;
  height: 1px;
  background: var(--ex-border);
  vertical-align: middle;
  margin: 0 12px;
}

.curve-chat-root .curve-deal-card {
  background: rgba(45, 212, 168, 0.05);
  border: 1px solid rgba(45, 212, 168, 0.25);
  border-radius: 10px;
  padding: 14px 12px 12px;
  color: var(--ex-text);
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.curve-chat-root .curve-deal-card:hover {
  background: rgba(45, 212, 168, 0.12);
  border-color: var(--ex-mint);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(45, 212, 168, 0.18);
}
.curve-chat-root .curve-deal-card.is-active {
  background: var(--ex-mint);
  border-color: var(--ex-mint);
  color: var(--ex-navy);
  box-shadow: 0 8px 22px rgba(45, 212, 168, 0.35);
}
/* Static / summary mode — cards describe upload paths but aren't
   clickable. Drop cursor + hover transforms so they read as info
   blocks rather than buttons. */
.curve-chat-root .curve-deal-card.is-static,
.curve-chat-root .curve-deal-card-primary.is-static {
  cursor: default;
}
.curve-chat-root .curve-deal-card.is-static:hover,
.curve-chat-root .curve-deal-card-primary.is-static:hover {
  background: rgba(45, 212, 168, 0.05);
  border-color: rgba(45, 212, 168, 0.25);
  transform: none;
  box-shadow: none;
}
.curve-chat-root .curve-deal-card-icon {
  font-size: 22px;
  line-height: 1;
  color: var(--ex-mint);
  margin-bottom: 2px;
}
.curve-chat-root .curve-deal-card.is-active .curve-deal-card-icon {
  color: var(--ex-navy);
}
.curve-chat-root .curve-deal-card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.curve-chat-root .curve-deal-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ex-sub);
}
.curve-chat-root .curve-deal-card.is-active .curve-deal-card-desc {
  color: rgba(15, 23, 42, 0.78);
}

.curve-chat-root .curve-deal-panel {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--ex-border);
  border-radius: 10px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease, padding .15s ease;
}
.curve-chat-root .curve-deal-panel.is-open {
  max-height: 1600px;
  padding: 16px;
}

.curve-chat-root .curve-deal-pane-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ex-mint);
  margin-bottom: 8px;
}
.curve-chat-root .curve-deal-pane-lead {
  font-size: 13px;
  color: var(--ex-sub);
  line-height: 1.55;
  margin: 0 0 12px;
}
.curve-chat-root .curve-deal-pane-lead code {
  background: rgba(45, 212, 168, 0.12);
  color: var(--ex-mint);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.curve-chat-root .curve-deal-pane-note {
  font-size: 12px;
  color: var(--ex-muted);
  margin: 10px 0 0;
  line-height: 1.5;
}

.curve-chat-root .curve-deal-btn-primary {
  background: var(--ex-mint);
  color: var(--ex-navy);
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background .12s, transform .12s, box-shadow .12s;
}
.curve-chat-root .curve-deal-btn-primary:hover:not(:disabled) {
  background: #3de1bb;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(45, 212, 168, 0.4);
}
.curve-chat-root .curve-deal-btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}
.curve-chat-root .curve-deal-btn-icon { font-size: 14px; }
.curve-chat-root .curve-deal-btn-success { background: var(--ex-mint-dark); color: #fff; }

/* Form */
.curve-chat-root .curve-deal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.curve-chat-root .curve-deal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 540px) {
  .curve-chat-root .curve-deal-row { grid-template-columns: 1fr; }
}
.curve-chat-root .curve-deal-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ex-muted);
}
.curve-chat-root .curve-deal-form input,
.curve-chat-root .curve-deal-form select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ex-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ex-text);
  font-family: inherit;
  outline: none;
  transition: border-color .12s, background .12s;
}
.curve-chat-root .curve-deal-form input:focus,
.curve-chat-root .curve-deal-form select:focus {
  border-color: var(--ex-mint);
  background: rgba(45, 212, 168, 0.06);
}

/* Textarea (paste + bulk) */
.curve-chat-root .curve-deal-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--ex-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ex-text);
  font-family: inherit;
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: border-color .12s;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.curve-chat-root .curve-deal-textarea:focus { border-color: var(--ex-mint); }
.curve-chat-root .curve-deal-textarea-mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

/* Parsed-fields preview */
.curve-chat-root .curve-deal-parse-results {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(45, 212, 168, 0.06);
  border: 1px solid rgba(45, 212, 168, 0.3);
  border-radius: 8px;
}
.curve-chat-root .curve-deal-parsed-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ex-mint);
  margin-bottom: 8px;
}
.curve-chat-root .curve-deal-parsed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(45, 212, 168, 0.1);
}
.curve-chat-root .curve-deal-parsed-row:last-of-type { border-bottom: 0; }
.curve-chat-root .curve-deal-parsed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.curve-chat-root .curve-deal-parsed-dot.dot-high { background: var(--ex-mint); box-shadow: 0 0 6px var(--ex-mint); }
.curve-chat-root .curve-deal-parsed-dot.dot-med  { background: #facc15; }
.curve-chat-root .curve-deal-parsed-dot.dot-low  { background: var(--ex-muted); }
.curve-chat-root .curve-deal-parsed-lbl {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ex-muted);
  width: 110px;
  flex-shrink: 0;
}
.curve-chat-root .curve-deal-parsed-val {
  color: var(--ex-text);
  font-weight: 600;
}
.curve-chat-root .curve-deal-parsed-empty {
  font-size: 12.5px;
  color: var(--ex-muted);
  font-style: italic;
}
.curve-chat-root .curve-deal-parse-results .curve-deal-btn-primary {
  margin-top: 10px;
}

/* Bulk row counter */
.curve-chat-root .curve-deal-row-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ex-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Success bubble inside a panel */
.curve-chat-root .curve-deal-success {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(45, 212, 168, 0.1);
  border: 1px solid rgba(45, 212, 168, 0.35);
  border-radius: 8px;
  padding: 12px 14px;
}
.curve-chat-root .curve-deal-success-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ex-mint);
  color: var(--ex-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.curve-chat-root .curve-deal-success-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ex-text);
}
.curve-chat-root .curve-deal-success-text strong { color: var(--ex-mint); }

/* Spinner — used in paste/bulk while "analysing" */
.curve-chat-root .curve-deal-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.3);
  border-top-color: var(--ex-navy);
  animation: curve-deal-spin 0.7s linear infinite;
}
@keyframes curve-deal-spin {
  to { transform: rotate(360deg); }
}

/* Reduced-motion respect */
@media (prefers-reduced-motion: reduce) {
  .curve-chat-root .curve-msg-row,
  .curve-chat-root .curve-thinking,
  .curve-chat-root .curve-chip,
  .curve-chat-root .curve-deal-spinner {
    animation: none !important;
  }
}

/* ── LHS history / progress rail (stepper) ───────────────────────
   A persistent vertical step indicator that sits to the LEFT of the
   chat panel inside .curve-chat-root. The rail is a flex sibling of
   .curve-chat-panel — kept on the same navy gradient as the panel
   (brand consistency) with a subtle border + outdent so it still
   reads as a separate component. The stepper line + numbered
   circles do the heavy visual work. */
.curve-chat-root .curve-side-rail {
  flex: 0 0 220px;
  margin-right: 14px;
  padding: 22px 16px 22px 20px;
  background: linear-gradient(120deg, #0a2540 0%, #143659 60%, #1a4775 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.curve-chat-root .curve-side-rail-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ex-mint);
  font-weight: 700;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.curve-chat-root .curve-side-rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
/* Connector line — drawn behind the markers, the spine of the
   stepper. Centred behind the 24px circles. */
.curve-chat-root .curve-side-rail-list::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 2px;
  z-index: 0;
}
.curve-chat-root .curve-side-rail-item {
  position: relative;
  padding: 8px 0 8px 38px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
  cursor: default;
  transition: color .12s;
  z-index: 1;
}
.curve-chat-root .curve-side-rail-item .curve-side-rail-marker {
  position: absolute;
  left: 0;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(10, 37, 64, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  box-sizing: border-box;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.curve-chat-root .curve-side-rail-item.is-visited {
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}
.curve-chat-root .curve-side-rail-item.is-visited .curve-side-rail-marker {
  background: var(--ex-mint);
  border-color: var(--ex-mint);
  color: var(--ex-navy);
  font-size: 13px; /* tick a touch larger than the digits */
}
.curve-chat-root .curve-side-rail-item.is-visited:hover {
  color: var(--ex-mint);
}
.curve-chat-root .curve-side-rail-item.is-visited:hover .curve-side-rail-marker {
  box-shadow: 0 0 0 3px rgba(45, 212, 168, 0.22);
}
.curve-chat-root .curve-side-rail-item.is-current {
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}
.curve-chat-root .curve-side-rail-item.is-current:hover .curve-side-rail-marker {
  box-shadow: 0 0 0 5px rgba(45, 212, 168, 0.30);
}
.curve-chat-root .curve-side-rail-item.is-current .curve-side-rail-marker {
  background: var(--ex-mint);
  border-color: rgba(255, 255, 255, 0.95);
  color: var(--ex-navy);
  box-shadow: 0 0 0 4px rgba(45, 212, 168, 0.22);
}
/* Future state — greyed but clickable. The whole sequence is
   pre-populated in the rail so the user can see the journey; future
   entries lift toward mint on hover to advertise the jump-ahead
   affordance. */
.curve-chat-root .curve-side-rail-item.is-future {
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}
.curve-chat-root .curve-side-rail-item.is-future:hover {
  color: rgba(255, 255, 255, 0.85);
}
.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.30);
}
.curve-chat-root .curve-side-rail-item.is-future:hover .curve-side-rail-marker {
  color: var(--ex-mint);
  border-color: rgba(45, 212, 168, 0.55);
}

/* Hide the rail on narrow viewports — under ~720px there's no room
   for it alongside the chat panel; the in-chat chips remain as the
   navigation. */
@media (max-width: 900px) {
  .curve-chat-root .curve-side-rail { display: none; }
}

/* Academy variant — same scaffold but the accent colour shifts from
   mint (Curve) to orange to match the rest of the Academy chrome.
   Applied via .academy-rail on the aside. */
.curve-chat-root .curve-side-rail.academy-rail .curve-side-rail-eyebrow { color: #fd7e14; }
.curve-chat-root .curve-side-rail.academy-rail .curve-side-rail-item.is-visited .curve-side-rail-marker {
  background: #fd7e14;
  border-color: #fd7e14;
  color: #0a2540;
}
.curve-chat-root .curve-side-rail.academy-rail .curve-side-rail-item.is-current .curve-side-rail-marker {
  background: #fd7e14;
  border-color: rgba(255, 255, 255, 0.85);
  color: #0a2540;
  box-shadow: 0 0 0 4px rgba(253, 126, 20, 0.22);
}
.curve-chat-root .curve-side-rail.academy-rail .curve-side-rail-item.is-visited:hover {
  color: #fd7e14;
}
/* Two-line eyebrow on the academy rail: "Module X of Y" sub-line
   above the module title, so the user has course-level context
   without needing a separate module list in the rail. */
.curve-chat-root .curve-side-rail.academy-rail .curve-side-rail-eyebrow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12px;
}
.curve-chat-root .curve-side-rail.academy-rail .academy-rail-module {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fd7e14;
}
.curve-chat-root .curve-side-rail.academy-rail .academy-rail-modtitle {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

/* ── Return-to-current floating button ────────────────────────────
   Anchored bottom-right of the chat panel (which is positioned
   relative so the button can stick to its edge). Hidden by default
   via the `hidden` attribute; .is-visible toggled by JS based on
   how far above the bottom the user has scrolled. */
.curve-chat-root .curve-chat-stage,
.curve-chat-root .curve-chat-panel {
  position: relative;
}
.curve-chat-root .curve-return-to-current {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  background: var(--ex-mint);
  color: var(--ex-navy);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .16s, transform .16s, background .14s;
  pointer-events: none;
}
.curve-chat-root .curve-return-to-current[hidden] { display: none; }
.curve-chat-root .curve-return-to-current.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.curve-chat-root .curve-return-to-current:hover {
  background: #5eead4;
}
.curve-chat-root .curve-return-to-current-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(10, 37, 64, 0.18);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* Academy variant — orange to match the .academy-rail accent. */
.curve-chat-root .curve-return-to-current.academy-rtc {
  background: #fd7e14;
  color: #ffffff;
}
.curve-chat-root .curve-return-to-current.academy-rtc:hover {
  background: #ff9637;
}
.curve-chat-root .curve-return-to-current.academy-rtc .curve-return-to-current-glyph {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
