/* ============================================================
   LegacyRealm — Cinematic Light Design System
   Warm ivory primary (~70% light / 30% navy).
   Navy reserved for: hero, opening sequence, footer, emphasis.
   ============================================================ */

:root {
  /* Light palette */
  --ivory: #F7F5EF;
  --ivory-deep: #F1EDE3;
  --white: #FFFFFF;
  --navy: #101B2D;
  --navy-950: #0B1322;
  --navy-900: #101B2D;
  --slate: #526071;
  --slate-light: #6B7A8D;
  --gold: #D4AA46;
  --gold-deep: #B8942F;
  --gold-soft: #F5ECD4;
  --stone: #E4E0D7;
  --stone-dark: #D5CFC0;

  /* Dark-context tokens (hero, footer) */
  --d-ivory: #F5F1E8;
  --d-ivory-dim: rgba(245,241,232,0.72);
  --d-ivory-faint: rgba(245,241,232,0.42);
  --d-line: rgba(245,241,232,0.14);

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 18px;
  --radius-lg: 26px;
  --shadow-card: 0 2px 12px rgba(16,27,45,0.06), 0 12px 32px rgba(16,27,45,0.06);
  --shadow-lift: 0 6px 20px rgba(16,27,45,0.08), 0 20px 48px rgba(16,27,45,0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--ivory);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Typography roles ----------
   Serif: major statements, page headlines.
   Sans: product names, nav, controls, explanatory text. */

h1, h2, .serif { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
h3, h4 { font-family: var(--font-body); font-weight: 650; line-height: 1.3; letter-spacing: -0.005em; }

.kicker {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-block;
  margin-bottom: 1rem;
}
.on-dark .kicker { color: var(--gold); }

.lede { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--slate); max-width: 38rem; line-height: 1.65; }
.on-dark .lede { color: var(--d-ivory-dim); }

.gold { color: var(--gold-deep); }
.on-dark .gold { color: var(--gold); }

a { color: inherit; }

::selection { background: var(--gold-soft); color: var(--navy); }

/* ---------- Layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
section.block { padding: clamp(4rem, 9vw, 7.5rem) 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--ivory);
  padding: 0.8rem 1.4rem; z-index: 200; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--navy-950);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { text-decoration: none; font-size: 0.92rem; font-weight: 500; opacity: 0.85; transition: opacity 0.25s; }
.nav-links a:hover { opacity: 1; }

/* Nav over dark hero */
.nav.on-dark .brand, .nav.on-dark .nav-links a { color: var(--d-ivory); }
/* Nav over light */
.nav.on-light { background: rgba(247,245,239,0.88); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--stone); }
.nav.on-light .brand, .nav.on-light .nav-links a { color: var(--navy); }
.nav.scrolled.on-dark { background: rgba(11,19,34,0.82); backdrop-filter: blur(14px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  padding: 0.95rem 2rem; border-radius: 999px;
  border: none; cursor: pointer; text-decoration: none;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s;
  white-space: nowrap;
}
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: var(--navy-950); box-shadow: 0 8px 24px rgba(212,170,70,0.32); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(212,170,70,0.42); }
.btn-outline { background: transparent; border: 1.5px solid var(--stone-dark); color: var(--navy); }
.btn-outline:hover { border-color: var(--gold-deep); color: var(--gold-deep); transform: translateY(-2px); }
.on-dark .btn-outline { border-color: var(--d-line); color: var(--d-ivory); }
.on-dark .btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-navy { background: var(--navy); color: var(--ivory); }
.btn-navy:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-sm { padding: 0.62rem 1.3rem; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.5; cursor: default; transform: none !important; }

/* ---------- Hero (navy, cinematic) ---------- */
.hero {
  background: var(--navy-950);
  color: var(--d-ivory);
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  padding: 7rem 0 5rem;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(212,170,70,0.10), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 90%, rgba(212,170,70,0.05), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5.4rem); margin: 1.2rem 0 1.6rem; }
.hero .lede { margin: 0 auto 2.6rem; text-align: center; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Opening sequence overlay */
.opening {
  position: fixed; inset: 0; z-index: 300;
  background: var(--navy-950); color: var(--d-ivory);
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: opacity 1.1s var(--ease-out), visibility 1.1s;
}
.opening.done { opacity: 0; visibility: hidden; pointer-events: none; }
.opening-statement {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.2rem);
  max-width: 20ch; line-height: 1.25;
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  padding: 0 2rem;
}
.opening-statement.show { opacity: 1; transform: none; }
.opening-statement em { color: var(--gold); font-style: italic; }
.opening-skip {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  background: none; border: 1px solid var(--d-line); color: var(--d-ivory-dim);
  border-radius: 999px; padding: 0.6rem 1.6rem; font-size: 0.85rem; cursor: pointer;
  font-family: var(--font-body);
}
.opening-skip:hover { border-color: var(--gold); color: var(--gold); }
.opening-progress { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--gold); width: 0; transition: width 0.5s linear; }

/* ---------- Gold thread (scroll progress) ---------- */
.thread { position: fixed; top: 0; left: 0; bottom: 0; width: 3px; z-index: 90; pointer-events: none; }
.thread-track { position: absolute; inset: 0; background: transparent; }
.thread-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 100%;
  background: linear-gradient(to bottom, var(--gold), var(--gold-deep));
  transform-origin: top; transform: scaleY(0);
}

/* ---------- Cards (light) ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--stone-dark); }

.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 1rem; }

/* ---------- Goal selection ---------- */
.goal-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .goal-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .goal-grid { grid-template-columns: 1fr 1fr 1fr; } }
.goal-card { cursor: pointer; text-align: left; font-family: var(--font-body); width: 100%; }
.goal-card h3 { font-size: 1.12rem; margin-bottom: 0.45rem; }
.goal-card p { color: var(--slate); font-size: 0.92rem; }
.goal-card.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,170,70,0.18), var(--shadow-card); }
.goal-card .goal-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--stone-dark);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 0.9rem; font-size: 0.8rem; color: transparent;
  transition: all 0.25s;
}
.goal-card.selected .goal-check { background: var(--gold); border-color: var(--gold); color: var(--navy-950); }

/* ---------- Steps / how it works ---------- */
.steps { display: grid; grid-template-columns: 1fr; gap: 1.2rem; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; padding-top: 0.5rem; }
.step-num {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 600;
  color: var(--gold); line-height: 1; margin-bottom: 0.8rem;
}
.step h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.step p { color: var(--slate); font-size: 0.93rem; }

/* ---------- Agents (compact, human) ---------- */
.agent-list { display: flex; flex-direction: column; gap: 1rem; max-width: 860px; }
.agent-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 1.3rem; align-items: start;
  background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius);
  padding: 1.5rem 1.7rem; box-shadow: var(--shadow-card);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.agent-row:hover { border-color: rgba(212,170,70,0.55); box-shadow: var(--shadow-lift); }
.agent-emblem {
  width: 64px; height: 64px; border-radius: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-950));
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  border: 1px solid rgba(212,170,70,0.3);
}
.agent-emblem img { width: 100%; height: 100%; object-fit: cover; border-radius: 17px; }
.agent-body h3 { font-size: 1.18rem; display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.agent-realm { font-size: 0.82rem; font-weight: 500; color: var(--gold-deep); }
.agent-specialty { color: var(--slate); font-size: 0.94rem; margin: 0.35rem 0 0.7rem; }
.agent-example {
  font-size: 0.9rem; color: var(--slate); font-style: italic;
  border-left: 2px solid var(--gold); padding-left: 0.9rem; margin-bottom: 0.9rem;
  line-height: 1.55;
}
.agent-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; max-width: 980px; }
@media (min-width: 860px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border: 1.5px solid var(--gold); position: relative; }
.price-flag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--navy-950);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.3rem 1rem; border-radius: 999px; white-space: nowrap;
}
.price-name { font-size: 1.05rem; font-weight: 650; margin-bottom: 0.4rem; }
.price-amount { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; margin-bottom: 0.2rem; }
.price-amount span { font-family: var(--font-body); font-size: 0.95rem; font-weight: 400; color: var(--slate); }
.price-desc { color: var(--slate); font-size: 0.92rem; margin-bottom: 1.4rem; }
.price-list { list-style: none; margin-bottom: 1.8rem; display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }
.price-list li { font-size: 0.92rem; color: var(--slate); padding-left: 1.6rem; position: relative; }
.price-list li::before { content: "✓"; position: absolute; left: 0; color: var(--gold-deep); font-weight: 700; }

/* ---------- Testimonial / quote ---------- */
.quote-block { max-width: 760px; margin: 0 auto; text-align: center; }
.quote-block blockquote { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.4; margin-bottom: 1.4rem; }
.quote-block blockquote em { color: var(--gold-deep); }
.quote-block cite { font-style: normal; color: var(--slate); font-size: 0.92rem; }

/* ---------- Footer (navy) ---------- */
footer { background: var(--navy-950); color: var(--d-ivory-dim); padding: 4rem 0 2.5rem; }
.foot-inner { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.foot-inner .brand { color: var(--d-ivory); margin-bottom: 1rem; }
.foot-inner p { font-size: 0.92rem; max-width: 34rem; margin-bottom: 1.8rem; }
.foot-links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.foot-links a { color: var(--d-ivory-dim); text-decoration: none; font-size: 0.9rem; }
.foot-links a:hover { color: var(--gold); }
.foot-base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--d-line); font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Forms (light) ---------- */
.field { margin-bottom: 1.3rem; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.5rem; }
.input, input[type="text"], input[type="email"], input[type="search"], textarea, select {
  width: 100%; background: var(--white); border: 1.5px solid var(--stone);
  border-radius: 14px; padding: 0.95rem 1.2rem; color: var(--navy);
  font-size: 1rem; font-family: var(--font-body);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,170,70,0.16);
}
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--slate-light); }

/* ---------- Assessment ---------- */
.assess-shell { max-width: 720px; margin: 0 auto; }
.assess-progress { height: 6px; background: var(--stone); border-radius: 999px; overflow: hidden; margin-bottom: 2.5rem; }
.assess-progress > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); border-radius: 999px; transition: width 0.5s var(--ease-out); }
.assess-q { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 0.8rem; }
.assess-count { color: var(--slate); font-size: 0.9rem; margin-bottom: 2rem; }
.assess-opts { display: flex; flex-direction: column; gap: 0.9rem; }
.assess-opt {
  background: var(--white); border: 1.5px solid var(--stone); border-radius: var(--radius);
  padding: 1.2rem 1.5rem; cursor: pointer; text-align: left; width: 100%;
  font-family: var(--font-body); font-size: 1rem; color: var(--navy);
  transition: all 0.25s var(--ease-out);
}
.assess-opt:hover { border-color: var(--gold); transform: translateX(4px); }
.assess-opt.selected { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(212,170,70,0.15); }
.assess-nav { display: flex; justify-content: space-between; margin-top: 2.5rem; }

/* ---------- Chat (light workspace) ---------- */
.chat-shell { display: grid; grid-template-columns: 1fr; height: calc(100svh - 76px); margin-top: 76px; }
@media (min-width: 900px) { .chat-shell { grid-template-columns: 300px 1fr; } }
.chat-side {
  background: var(--white); border-right: 1px solid var(--stone);
  padding: 1.5rem; overflow-y: auto; display: none;
}
@media (min-width: 900px) { .chat-side { display: block; } }
.chat-agent-btn {
  display: flex; align-items: center; gap: 0.9rem; width: 100%;
  background: none; border: 1px solid transparent; border-radius: 14px;
  padding: 0.85rem 1rem; cursor: pointer; text-align: left;
  font-family: var(--font-body); transition: all 0.25s;
}
.chat-agent-btn:hover { background: var(--ivory-deep); }
.chat-agent-btn.active { background: var(--gold-soft); border-color: rgba(212,170,70,0.4); }
.chat-agent-btn .agent-emblem { width: 44px; height: 44px; border-radius: 13px; font-size: 1.15rem; }
.chat-agent-btn strong { display: block; font-size: 0.94rem; }
.chat-agent-btn span { font-size: 0.8rem; color: var(--slate); }
.chat-main { display: flex; flex-direction: column; background: var(--ivory); min-width: 0; }
.chat-head {
  padding: 1.1rem 1.6rem; background: var(--white); border-bottom: 1px solid var(--stone);
  display: flex; align-items: center; gap: 1rem;
}
.chat-head .agent-emblem { width: 46px; height: 46px; border-radius: 14px; font-size: 1.2rem; }
.chat-head h2 { font-size: 1.15rem; font-family: var(--font-body); font-weight: 650; }
.chat-head p { font-size: 0.84rem; color: var(--slate); margin: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 1.8rem clamp(1.2rem, 4vw, 2.5rem); display: flex; flex-direction: column; gap: 1.1rem; }
.msg { max-width: 78%; padding: 1rem 1.3rem; border-radius: 18px; font-size: 0.96rem; line-height: 1.6; }
.msg.agent { background: var(--white); border: 1px solid var(--stone); border-bottom-left-radius: 6px; align-self: flex-start; box-shadow: var(--shadow-card); }
.msg.user { background: var(--navy); color: var(--ivory); border-bottom-right-radius: 6px; align-self: flex-end; }
.msg.typing { color: var(--slate); font-style: italic; }
.typing-label { margin-right: 0.4rem; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--slate-light); animation: typing-bounce 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-input {
  padding: 1.2rem clamp(1.2rem, 4vw, 2.5rem) 1.6rem;
  background: var(--white); border-top: 1px solid var(--stone);
  display: flex; gap: 0.8rem;
}
.chat-input input { flex: 1; border-radius: 999px; }

/* ---------- Connections page ---------- */
.conn-logo {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: var(--white); border: 1px solid var(--stone);
  display: flex; align-items: center; justify-content: center;
  padding: 10px; box-shadow: var(--shadow-card);
}
.conn-logo img { width: 100%; height: 100%; object-fit: contain; }
.conn-status {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.35rem 0.85rem; border-radius: 999px; white-space: nowrap;
}
.conn-status.native { background: var(--gold-soft); color: var(--gold-deep); border: 1px solid rgba(212,170,70,0.4); }
.conn-status.planned { background: var(--ivory-deep); color: var(--slate); border: 1px solid var(--stone); }
.conn-status.beta { background: var(--ivory-deep); color: var(--slate); border: 1px dashed var(--stone-dark); }
.conn-details { border-top: 1px solid var(--stone); margin-top: 0.4rem; }
.conn-details summary {
  cursor: pointer; padding: 0.9rem 0 0; font-size: 0.88rem; font-weight: 600; color: var(--gold-deep);
  list-style: none; display: flex; align-items: center; gap: 0.5rem;
}
.conn-details summary::-webkit-details-marker { display: none; }
.conn-details summary::before { content: "+"; font-size: 1.1rem; line-height: 1; transition: transform 0.25s; }
.conn-details[open] summary::before { transform: rotate(45deg); }
.conn-details .conn-detail-body { padding: 0.8rem 0 0.4rem; font-size: 0.9rem; color: var(--slate); }
.conn-detail-body .ex-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); display: block; margin: 0.9rem 0 0.35rem; }
.conn-detail-body p { font-style: italic; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.12s; }
.reveal-d2 { transition-delay: 0.24s; }
.reveal-d3 { transition-delay: 0.36s; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.6rem; } .mt-4 { margin-top: 2.4rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.6rem; }
.hidden { display: none !important; }
.offset-left { margin-left: 0; }
@media (min-width: 900px) { .offset-left { margin-left: 8%; } }

/* Page top spacing (below fixed nav) */
.page-top { padding-top: 8rem; }

/* Light section dividers */
.hairline { border: none; border-top: 1px solid var(--stone); margin: 0; }

@media (max-width: 720px) {
  .nav-links a:not(:last-child) { display: none; }
  .agent-row { grid-template-columns: 52px 1fr; padding: 1.2rem; gap: 1rem; }
  .agent-emblem { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 15px; }
}

/* ---------- Legacy page compatibility (light theme) ---------- */
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.mt-1 { margin-top: 0.6rem; }

.diag { min-height: 100svh; padding: 7rem 0 4rem; background: var(--ivory); }
.diag-stage { max-width: 720px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2rem); }
.diag-progress { margin-bottom: 2.5rem; }
.diag-track { height: 6px; background: var(--stone); border-radius: 999px; overflow: hidden; }
.diag-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); border-radius: 999px; transition: width 0.5s var(--ease-out); }
.diag-count { color: var(--slate); font-size: 0.9rem; margin-bottom: 1.2rem; }
.diag-q { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 2rem; line-height: 1.25; }
.diag-options { display: flex; flex-direction: column; gap: 0.9rem; }
.diag-options button {
  background: var(--white); border: 1.5px solid var(--stone); border-radius: var(--radius);
  padding: 1.15rem 1.5rem; cursor: pointer; text-align: left; width: 100%;
  font-family: var(--font-body); font-size: 1rem; color: var(--navy);
  transition: all 0.25s var(--ease-out);
}
.diag-options button:hover { border-color: var(--gold); transform: translateX(4px); }
.diag-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2.5rem; }
.diag-back, .diag-skip {
  background: none; border: none; color: var(--slate); font-size: 0.92rem; cursor: pointer;
  font-family: var(--font-body); padding: 0.6rem 0;
}
.diag-back:hover, .diag-skip:hover { color: var(--gold-deep); }

.roadmap-card {
  background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 4vw, 2.8rem); box-shadow: var(--shadow-card); margin-bottom: 1.5rem;
}
.roadmap-card h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: 0.8rem; }
.roadmap-card p { color: var(--slate); }
.result-sequence { display: flex; flex-direction: column; gap: 1rem; }
.next-step {
  border-left: 3px solid var(--gold); padding: 1rem 1.3rem;
  background: var(--gold-soft); border-radius: 0 var(--radius) var(--radius) 0;
}
.next-step strong { display: block; margin-bottom: 0.3rem; }
.next-step p { font-size: 0.93rem; }
.msg .who { display: block; font-size: 0.8rem; color: var(--slate-light); font-style: italic; margin-bottom: 0.4rem; }

.chat-input-row { display: flex; gap: 0.8rem; width: 100%; }
.chat-input-row input { flex: 1; border-radius: 999px; }
.typing { color: var(--slate); font-style: italic; }

/* ---------- Mobile nav ---------- */
.nav-toggle {
  display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: inherit; padding: 0.4rem 0.6rem; line-height: 1;
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 85vw);
    background: var(--white); flex-direction: column; align-items: stretch;
    padding: 5rem 2rem 2rem; gap: 0.4rem; z-index: 99;
    transform: translateX(100%); transition: transform 0.35s var(--ease-out);
    box-shadow: -12px 0 40px rgba(16,27,45,0.15);
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 0.85rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--stone); color: var(--navy) !important; opacity: 1; }
  .nav-links [data-auth-nav] { margin-top: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
