@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;1,9..144,400&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

  :root {
    --navy: #0A1840;
    --navy-deep: #050D26;
    --navy-mid: #142658;
    --gold: #C9A24A;
    --gold-light: #E8D08F;
    --cream: #F4EFE3;
    --cream-warm: #EDE5D1;
    --paper: #FAF6EC;
    --ink: #1A1814;
    --ink-mid: #4A463E;
    --ink-soft: #8A8478;
    --line: #D8CFB8;
    --healthcare: #2D6B47;
    --it: #1E5B7A;
    --entrepreneurship: #A04A2C;
    --error: #B23A2C;
    --error-bg: #FBEAE6;
    --warn: #B89337;
    --warn-bg: #FBF3DD;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  ::selection { background: var(--navy); color: var(--gold-light); }

  html, body { height: 100%; }

  body {
    font-family: 'Inter', sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body::before {
    content: '';
    position: fixed; inset: 0; pointer-events: none;
    opacity: 0.4; z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.06 0 0 0 0 0.05 0 0 0 0 0.04 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* ───────── NAV ───────── */
  nav {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    position: relative;
    z-index: 50;
  }
  .nav-inner {
    max-width: 1280px; margin: 0 auto; padding: 16px 32px;
    display: flex; align-items: center; justify-content: space-between; gap: 32px;
  }
  .logo {
    font-family: 'Fraunces', serif; font-weight: 400;
    font-size: 20px; color: var(--navy);
    display: flex; align-items: center; gap: 10px; text-decoration: none;
  }
  .logo-mark {
    width: 22px; height: 22px; transform: rotate(45deg);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border-radius: 2px;
  }
  .logo em { font-style: italic; font-weight: 500; color: var(--gold); }
  .nav-step {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--ink-soft);
    display: flex; align-items: center; gap: 12px;
  }
  .nav-step-dots { display: flex; gap: 4px; }
  .nav-step-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--line); transition: all 0.2s;
  }
  .nav-step-dot.done { background: var(--gold); }
  .nav-step-dot.active {
    background: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.25);
  }
  .nav-skip {
    font-family: inherit; font-size: 13px;
    color: var(--ink-soft); text-decoration: none;
  }
  .nav-skip:hover { color: var(--navy); }

  /* ───────── LAYOUT ───────── */
  .stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
  }

  /* ───────── MESSAGES ───────── */
  .messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .messages::-webkit-scrollbar { width: 8px; }
  .messages::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

  .message {
    display: flex;
    gap: 14px;
    max-width: 100%;
    animation: msgIn 0.4s ease;
  }
  @keyframes msgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .message.user { margin-left: 56px; flex-direction: row-reverse; }
  .msg-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fraunces', serif; font-style: italic;
    font-size: 16px; font-weight: 500;
  }
  .message.user .msg-avatar {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-deep);
  }
  .message.coach .msg-avatar {
    background: var(--navy);
    color: var(--gold);
  }
  .msg-bubble {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.55;
    max-width: 540px;
  }
  .message.user .msg-bubble {
    background: var(--navy);
    color: var(--cream);
    border-radius: 14px 14px 4px 14px;
  }
  .message.coach .msg-bubble {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 14px 14px 14px 4px;
  }
  .msg-bubble strong { font-weight: 600; }
  .msg-bubble em {
    font-family: 'Fraunces', serif;
    font-style: italic;
    color: var(--gold);
    font-weight: 400;
  }

  .typing {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 0;
  }
  .typing span {
    width: 7px; height: 7px;
    background: var(--ink-soft);
    border-radius: 50%;
    animation: bounce 1.3s infinite;
  }
  .typing span:nth-child(2) { animation-delay: 0.15s; }
  .typing span:nth-child(3) { animation-delay: 0.3s; }
  @keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
  }

  /* ───────── ANSWER OPTIONS (multiple choice) ───────── */
  .options {
    display: flex; flex-direction: column;
    gap: 10px;
    margin-left: 50px;
    animation: msgIn 0.4s ease 0.1s both;
  }
  .option-btn {
    text-align: left;
    padding: 14px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }
  .option-btn:hover {
    border-color: var(--navy);
    background: var(--cream);
    transform: translateX(2px);
  }
  .option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .option-btn:disabled:hover { transform: none; background: var(--paper); border-color: var(--line); }
  .option-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ink-soft);
    flex-shrink: 0;
    margin-top: 1px;
  }
  .option-btn strong {
    display: block;
    color: var(--navy);
    font-weight: 600;
    margin-bottom: 2px;
  }
  .option-btn span.hint {
    font-size: 12px;
    color: var(--ink-soft);
  }

  /* ───────── COMPOSER (free text) ───────── */
  .composer {
    border-top: 1px solid var(--line);
    padding: 16px 0 24px;
    background: var(--paper);
    flex-shrink: 0;
    transition: opacity 0.2s;
  }
  .composer.hidden { display: none; }
  .composer-inner {
    position: relative;
  }
  textarea {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    padding: 14px 56px 14px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    resize: none;
    min-height: 52px;
    max-height: 160px;
    transition: all 0.15s;
  }
  textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(10, 24, 64, 0.06);
  }
  textarea::placeholder { color: var(--ink-soft); }
  .send-btn {
    position: absolute;
    right: 8px; bottom: 8px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--cream);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
  }
  .send-btn:hover:not(:disabled) {
    background: var(--gold);
    color: var(--navy-deep);
  }
  .send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .composer-hint {
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    text-align: center;
  }

  /* ───────── FINAL VIEW (programme recommendations) ───────── */
  .final {
    padding: 48px 0;
    animation: msgIn 0.5s ease;
  }
  .final-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .final-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--gold); }

  .final h2 {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(32px, 4.5vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--navy);
    margin-bottom: 20px;
  }
  .final h2 em { font-style: italic; color: var(--gold); }

  .final-summary {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-mid);
    margin-bottom: 32px;
    max-width: 580px;
  }

  .final-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--ink-mid);
    margin-bottom: 32px;
  }
  .final-stat .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--gold);
  }

  .recs-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }
  .recs-title {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: 22px;
    color: var(--navy);
    letter-spacing: -0.01em;
  }
  .recs-title em { font-style: italic; color: var(--gold); }
  .recs-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ink-soft);
    letter-spacing: 0.05em;
  }

  .rec-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
  }
  .rec-card {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 18px;
    padding: 20px 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
    align-items: center;
  }
  .rec-card:hover {
    border-color: var(--navy);
    background: var(--cream);
    transform: translateX(2px);
  }
  .rec-mark {
    width: 36px; height: 36px;
    border-radius: 4px;
    background: var(--navy); color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fraunces', serif; font-style: italic;
    font-weight: 500; font-size: 16px;
  }
  .rec-title {
    font-family: 'Fraunces', serif;
    font-size: 17px;
    color: var(--navy);
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 3px;
  }
  .rec-summary {
    font-size: 13px;
    color: var(--ink-mid);
    line-height: 1.45;
  }
  .rec-meta {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
  }
  .rec-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-weight: 500;
  }
  .rec-arrow {
    color: var(--ink-soft);
    transition: all 0.2s;
  }
  .rec-card:hover .rec-arrow {
    color: var(--gold);
    transform: translateX(3px);
  }

  .final-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--line);
  }
  .btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .btn-primary {
    background: var(--navy);
    color: var(--cream);
    border: none;
  }
  .btn-primary:hover { background: var(--navy-deep); }
  .btn-ghost {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--navy);
  }
  .btn-ghost:hover { background: var(--navy); color: var(--cream); }

  .final-warn {
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--warn-bg);
    border-left: 3px solid var(--warn);
    border-radius: 4px;
    font-size: 13px;
    color: var(--ink-mid);
    line-height: 1.5;
  }
  .final-warn strong { color: var(--ink); }
  .final-warn code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: var(--paper);
    padding: 2px 5px;
    border-radius: 3px;
  }

  @media (max-width: 720px) {
    .stage { padding: 0 20px; }
    .nav-inner { padding: 14px 20px; }
    .nav-skip { display: none; }
    .options { margin-left: 0; }
    .message.user { margin-left: 0; }
    .rec-card { grid-template-columns: auto 1fr; }
    .rec-arrow { display: none; }
    .final-actions { flex-direction: column; }
    .final-actions .btn { width: 100%; justify-content: center; }
  }

  /* ───────── Standard nav extensions for onboarding ───────── */
  .nav-links {
    display: flex; gap: 28px; list-style: none;
    flex: 1; margin-left: 32px;
  }
  .nav-links a {
    color: var(--ink-mid); text-decoration: none;
    font-size: 14px; font-weight: 500; position: relative;
  }
  .nav-links a.active { color: var(--navy); }
  .nav-links a.active::after {
    content: ''; position: absolute; left: 0; right: 0;
    bottom: -22px; height: 2px; background: var(--gold);
  }
  .nav-user { display: flex; align-items: center; gap: 12px; }
  .user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-deep);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fraunces', serif; font-style: italic;
    font-weight: 500; font-size: 16px;
  }
  .nav-user-meta { line-height: 1.2; }
  .nav-user-name { font-size: 13px; font-weight: 600; color: var(--ink); }
  .nav-user-role {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--ink-soft);
  }
  .signout {
    margin-left: 8px; background: transparent;
    border: 1px solid var(--line); color: var(--ink-mid);
    font-family: inherit; font-size: 12px;
    padding: 7px 14px; border-radius: 999px; cursor: pointer;
    transition: all 0.15s;
  }
  .signout:hover { border-color: var(--navy); color: var(--navy); }

  .step-progress {
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    position: relative;
    z-index: 49;
  }
  .step-progress-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .step-progress-inner #step-label {
    color: var(--navy);
    font-weight: 500;
  }
  .step-progress-inner .nav-skip {
    margin-left: auto;
    color: var(--ink-soft);
    text-decoration: none;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
  }
  .step-progress-inner .nav-skip:hover { color: var(--navy); }
  @media (max-width: 720px) {
    .nav-links { display: none; }
    .step-progress-inner { padding: 8px 20px; font-size: 10px; }
  }

/* ═══════════════ Site footer ═══════════════ */
.site-footer {
  background: var(--navy, #0A1840);
  color: var(--cream, #F4EFE3);
  padding: 56px 32px 40px;
  margin-top: 80px;
  position: relative;
  z-index: 1;
}
.site-footer * { box-sizing: border-box; }
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}
.footer-brand {
  text-align: left;
}
.footer-tagline {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 400;
  color: var(--gold-light, #E8D08F);
  margin: 0 0 12px 0;
  line-height: 1.4;
  max-width: 520px;
}
.footer-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(244, 239, 227, 0.55);
}
.footer-social {
  text-align: left;
}
.footer-social-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold, #C9A24A);
  margin-bottom: 14px;
  font-weight: 500;
}
.footer-social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-social-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cream, #F4EFE3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  padding: 4px 0;
  transition: color 0.15s;
}
.footer-social-list a:hover,
.footer-social-list a:focus-visible {
  color: var(--gold, #C9A24A);
}
.footer-social-list svg {
  flex-shrink: 0;
  opacity: 0.85;
}
@media (max-width: 720px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .site-footer {
    padding: 40px 24px 32px;
  }
}

/* Hero social row (landing pages only) */
.hero-social {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-social-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep, #A8852D);
  font-weight: 500;
}
.hero-social-icons {
  display: flex;
  gap: 10px;
  align-items: center;
}
.hero-social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 24, 64, 0.06);
  color: var(--navy, #0A1840);
  text-decoration: none;
  transition: all 0.15s;
}
.hero-social-icons a:hover,
.hero-social-icons a:focus-visible {
  background: var(--navy, #0A1840);
  color: var(--gold, #C9A24A);
  transform: translateY(-1px);
}
.hero-social-icons svg {
  width: 16px;
  height: 16px;
}
/* Brand alignment fix - keeps The Diamond Bridge on one line */
.platform-nav .brand-name,
.brand-name {
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
}
.platform-nav .nav-inner {
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
}
.platform-nav .nav-links {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.platform-nav .nav-links a {
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .platform-nav .nav-links {
    gap: 14px;
    font-size: 13px;
  }
}


/* Whole-page scroll override */
body {
  overflow: auto !important;
  height: auto !important;
  min-height: 100vh !important;
}
.stage {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}
.chat-body, .chat-thread, .conversation-thread, [class*="chat-body"] {
  overflow-y: visible !important;
  max-height: none !important;
}