
  @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;
    --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-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); }

  /* ───────────── LAYOUT ───────────── */
  .app {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    overflow: hidden;
    position: relative;
    z-index: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
  }

  /* ───────────── SIDEBAR ───────────── */
  aside {
    border-right: 1px solid var(--line);
    background: var(--paper);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar-head {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 12px;
  }
  .new-chat-btn {
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    background: var(--navy);
    color: var(--cream);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s;
  }
  .new-chat-btn:hover { background: var(--navy-deep); }
  .new-chat-btn svg { width: 14px; height: 14px; }

  .conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
  }
  .conv-list::-webkit-scrollbar { width: 8px; }
  .conv-list::-webkit-scrollbar-track { background: transparent; }
  .conv-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

  .conv-empty {
    padding: 32px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-soft);
    font-style: italic;
  }

  .conv-item {
    padding: 12px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 2px;
  }
  .conv-item:hover { background: var(--cream); }
  .conv-item.active { background: var(--cream-warm); }
  .conv-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--navy);
    line-height: 1.35;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .conv-item-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
  }

  /* ───────────── MAIN CHAT ───────────── */
  main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--paper);
  }

  .chat-head {
    padding: 20px 32px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .coach-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 22px;
    font-weight: 500;
    position: relative;
  }
  .coach-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    border: 2px solid var(--paper);
  }
  .chat-head-meta { flex: 1; }
  .chat-head-name {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--navy);
    letter-spacing: -0.01em;
  }
  .chat-head-name em { font-style: italic; color: var(--gold); }
  .chat-head-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
    text-transform: uppercase;
  }

  .api-warn {
    background: var(--warn-bg);
    border-left: 3px solid var(--warn);
    padding: 12px 20px;
    font-size: 13px;
    color: var(--ink-mid);
    display: none;
  }
  .api-warn.show { display: block; }
  .api-warn strong { color: var(--ink); }
  .api-warn code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--paper);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
  }

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

  .message {
    display: flex;
    gap: 14px;
    max-width: 720px;
    animation: msgIn 0.35s ease;
  }
  @keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .message.user { margin-left: auto; flex-direction: row-reverse; }
  .msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 14px;
    font-weight: 500;
  }
  .message.user .msg-avatar {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-deep);
  }
  .message.assistant .msg-avatar {
    background: var(--navy);
    color: var(--gold);
  }
  .msg-bubble {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.55;
    max-width: 100%;
  }
  .message.user .msg-bubble {
    background: var(--navy);
    color: var(--cream);
    border-radius: 12px 12px 4px 12px;
  }
  .message.assistant .msg-bubble {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 12px 12px 12px 4px;
  }
  .msg-bubble p { margin-bottom: 10px; }
  .msg-bubble p:last-child { margin-bottom: 0; }
  .msg-bubble strong { font-weight: 600; }
  .msg-bubble em { font-style: italic; }
  .msg-bubble ul, .msg-bubble ol { margin: 8px 0 8px 20px; }
  .msg-bubble code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    background: var(--cream-warm);
    padding: 1px 5px;
    border-radius: 3px;
  }
  .message.user .msg-bubble code {
    background: rgba(244, 239, 227, 0.15);
  }

  .typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
  }
  .typing span {
    width: 6px;
    height: 6px;
    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; }
  }

  /* ───────────── EMPTY STATE ───────────── */
  .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
  }
  .empty-state-mark {
    width: 64px;
    height: 64px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border-radius: 4px;
    margin-bottom: 32px;
    box-shadow: 0 4px 16px rgba(201, 162, 74, 0.3);
  }
  .empty-state h2 {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 36px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--navy);
    margin-bottom: 16px;
    max-width: 480px;
  }
  .empty-state h2 em { font-style: italic; color: var(--gold); }
  .empty-state p {
    font-size: 15px;
    color: var(--ink-mid);
    line-height: 1.55;
    max-width: 460px;
    margin-bottom: 32px;
  }
  .starter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 640px;
    width: 100%;
  }
  .starter {
    text-align: left;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-mid);
    transition: all 0.15s;
  }
  .starter:hover {
    border-color: var(--navy);
    color: var(--ink);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(10, 24, 64, 0.12);
  }
  .starter strong {
    display: block;
    color: var(--navy);
    font-family: 'Fraunces', serif;
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 4px;
  }

  /* ───────────── COMPOSER ───────────── */
  .composer {
    border-top: 1px solid var(--line);
    padding: 20px 32px 24px;
    background: var(--paper);
  }
  .composer-inner {
    max-width: 720px;
    margin: 0 auto;
    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: 8px;
    background: var(--paper);
    color: var(--ink);
    resize: none;
    min-height: 52px;
    max-height: 200px;
    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); }
  textarea:disabled {
    background: var(--cream);
    cursor: not-allowed;
  }
  .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;
  }
  .send-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(244, 239, 227, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
  }
  .send-btn.loading .spinner { display: inline-block; }
  .send-btn.loading svg { display: none; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .composer-hint {
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    text-align: center;
  }
  .composer-hint kbd {
    background: var(--cream-warm);
    padding: 1px 5px;
    border-radius: 2px;
    border: 1px solid var(--line);
    font-size: 9px;
  }

  .send-error {
    margin: 12px auto 0;
    max-width: 720px;
    padding: 10px 14px;
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #E8C8C0;
    border-radius: 4px;
    font-size: 13px;
    display: none;
  }
  .send-error.show { display: block; }

  /* ───────────── RESPONSIVE ───────────── */
  @media (max-width: 880px) {
    .app { grid-template-columns: 1fr; }
    aside { display: none; }
    .nav-links { display: none; }
    .messages { padding: 20px; }
    .composer { padding: 16px 20px 20px; }
    .chat-head { padding: 16px 20px; }
    .starter-grid { grid-template-columns: 1fr; }
    .empty-state h2 { font-size: 28px; }
  }

/* ═══════════════ 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;
  }
}



/* Coach page scroll fix - allow main to flow naturally */
main {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
  position: static !important;
}
body {
  overflow-y: auto !important;
  height: auto !important;
}
.chat-head {
  display: flex !important;
  visibility: visible !important;
  position: static !important;
}
