/* ─── DealerDMS — marketing landing + developer docs (bespoke) ───────────────
   Self-contained. Not themed by the app's token system on purpose: this is the
   public sell sheet and should read as a premium product site. Brand-consistent
   with the app (navy/blue + amber) but with its own richer palette + motion. */

:root {
  --ink: #0b1220;
  --ink-2: #131c2e;
  --navy: #0e1a30;
  --blue: #2f6fb0;
  --blue-2: #4f97e0;
  --blue-glow: rgba(79, 151, 224, .35);
  --amber: #e08a1e;
  --amber-2: #f4a83a;
  --paper: #ffffff;
  --mist: #f4f7fb;
  --line: #e4eaf2;
  --text: #1b2536;
  --muted: #5c6b82;
  --muted-2: #8493a8;
  --radius: 16px;
  --shadow: 0 10px 40px -12px rgba(14, 26, 48, .18);
  --shadow-lg: 0 30px 80px -24px rgba(14, 26, 48, .35);
  --maxw: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--paper);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px; font-weight: 700; color: var(--blue); }
h1, h2, h3 { color: var(--ink); line-height: 1.14; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
.lead { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: inherit; font-weight: 650; font-size: 15px; cursor: pointer;
  padding: 13px 22px; border-radius: 11px; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; box-shadow: 0 8px 24px -8px var(--blue-glow); }
.btn-primary:hover { box-shadow: 0 14px 34px -8px var(--blue-glow); }
.btn-amber { background: linear-gradient(135deg, var(--amber), var(--amber-2)); color: #241703; box-shadow: 0 8px 24px -8px rgba(224, 138, 30, .4); }
.btn-amber:hover { box-shadow: 0 14px 34px -8px rgba(224, 138, 30, .5); }
.btn-ghost { background: rgba(255, 255, 255, .06); color: #eaf1fb; border-color: rgba(255, 255, 255, .18); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-lg { padding: 16px 28px; font-size: 16px; }

/* ── Top nav ── */
.nav {
  position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(180%) blur(14px);
  background: rgba(255, 255, 255, .82); border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; color: var(--ink); font-size: 19px; letter-spacing: -.02em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; overflow: hidden; flex: none;
  background: #0d0d0d; /* icon tile is dark */
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-txt .by { font-size: 10.5px; font-weight: 600; color: var(--muted-2); letter-spacing: .01em; }
.brand-txt .by b { color: var(--blue); font-weight: 700; }
.foot .brand-txt .by { color: #93a6c2; } .foot .brand-txt .by b { color: var(--blue-2); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); font-weight: 550; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-burger { display: none; background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--ink); }

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden; color: #eaf1fb;
  background:
    radial-gradient(1100px 500px at 78% -8%, rgba(79, 151, 224, .28), transparent 60%),
    radial-gradient(760px 420px at 8% 12%, rgba(224, 138, 30, .18), transparent 60%),
    linear-gradient(160deg, var(--navy), var(--ink) 65%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(700px 500px at 70% 0%, #000, transparent 75%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 80px 0 92px; }
.hero h1 { color: #fff; }
.hero h1 .grad { background: linear-gradient(120deg, var(--blue-2), var(--amber-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: #b7c6dd; max-width: 34ch; margin-top: 18px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.hero-badges { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 34px; color: #93a6c2; font-size: 13.5px; }
.hero-badges span { display: inline-flex; align-items: center; gap: 7px; }
.hero-badges .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 12px var(--blue-glow); }

/* hero product mock */
.hero-mock {
  border-radius: 18px; background: linear-gradient(160deg, #16233c, #0e1626); border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: var(--shadow-lg); overflow: hidden; transform: perspective(1400px) rotateY(-9deg) rotateX(3deg); transform-origin: center;
}
.hero-mock-bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.hero-mock-bar i { width: 11px; height: 11px; border-radius: 50%; background: #33415c; }
.hero-mock-body { padding: 18px; display: grid; gap: 12px; }
.hm-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); border-radius: 12px; padding: 12px; }
.hm-thumb { width: 54px; height: 40px; border-radius: 7px; background: linear-gradient(135deg, var(--blue), var(--amber)); }
.hm-line { height: 9px; border-radius: 5px; background: rgba(255, 255, 255, .16); }
.hm-line.sm { width: 55%; height: 7px; margin-top: 7px; background: rgba(255, 255, 255, .09); }
.hm-tag { font-size: 11px; font-weight: 700; color: #0e1626; background: var(--amber-2); border-radius: 6px; padding: 3px 8px; }
.hm-tag.blue { background: var(--blue-2); color: #fff; }

/* ── Trust / logos strip ── */
.trust { border-bottom: 1px solid var(--line); background: var(--mist); }
.trust-inner { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; padding: 22px 0; color: var(--muted-2); font-weight: 700; letter-spacing: .02em; font-size: 14px; }
.trust-inner .k { color: var(--ink); font-weight: 800; }

/* ── Section scaffolding ── */
.section { padding: 92px 0; }
.section.alt { background: var(--mist); }
.section-head { max-width: 720px; margin: 0 auto 52px; text-align: center; }
.section-head .lead { margin-top: 14px; }

/* ── Feature grid ── */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feat {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.feat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d3ddec; }
.feat-ico {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px; background: linear-gradient(135deg, rgba(47, 111, 176, .12), rgba(224, 138, 30, .12));
}
.feat h3 { margin-bottom: 8px; }
.feat p { color: var(--muted); font-size: 15px; margin: 0; }

/* ── Split feature rows ── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split + .split { margin-top: 84px; }
.split.rev .split-media { order: -1; }
.split-media {
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--mist);
  min-height: 300px; box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.split ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.split li { display: flex; gap: 11px; align-items: flex-start; color: var(--text); }
.split li .tick { color: #12915f; font-weight: 800; margin-top: 1px; }

/* pseudo-screens inside split media */
.mock-pad { padding: 20px; display: grid; gap: 12px; }
.mock-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 4px 14px -8px rgba(14, 26, 48, .2); }
.mock-bar { height: 8px; border-radius: 5px; background: var(--line); }
.mock-bar.b { background: linear-gradient(90deg, var(--blue), var(--blue-2)); width: 70%; }
.mock-bar.a { background: linear-gradient(90deg, var(--amber), var(--amber-2)); width: 45%; }
.mock-pill { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: var(--blue); background: rgba(47, 111, 176, .1); border-radius: 20px; padding: 5px 11px; }
.mock-stages { display: flex; gap: 6px; flex-wrap: wrap; }
.mock-stage { font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 8px; background: var(--mist); color: var(--muted); border: 1px solid var(--line); }
.mock-stage.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Pricing ── */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; display: flex; flex-direction: column;
}
.price.feature { border: 2px solid var(--blue); box-shadow: var(--shadow); position: relative; }
.price.feature .ribbon {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 14px; border-radius: 20px; letter-spacing: .03em;
}
.price h3 { font-size: 1.05rem; }
.price .amt { font-size: 2.4rem; font-weight: 800; color: var(--ink); margin: 10px 0 2px; letter-spacing: -.03em; }
.price .amt small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.price .who { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.price ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; font-size: 14.5px; }
.price li { display: flex; gap: 9px; } .price li .tick { color: #12915f; font-weight: 800; }
.price .btn { margin-top: auto; }

/* ── Marketplace band (landing pitch for /marketplace) ── */
.mkt {
  position: relative; overflow: hidden; color: #eaf1fb; padding: 92px 0;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(79, 151, 224, .26), transparent 60%),
    radial-gradient(620px 380px at 5% 100%, rgba(224, 138, 30, .14), transparent 60%),
    linear-gradient(160deg, var(--navy), var(--ink) 70%);
}
.mkt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(700px 460px at 75% 0%, #000, transparent 75%);
}
.mkt .wrap { position: relative; z-index: 1; }
.mkt-grad { background: linear-gradient(120deg, var(--blue-2), var(--amber-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mkt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mkt-card {
  display: block; color: inherit; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius); padding: 24px;
  transition: transform .16s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.mkt-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .08); border-color: rgba(79, 151, 224, .5); box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .5); }
.mkt-ico {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 21px; margin-bottom: 14px; background: linear-gradient(135deg, rgba(79, 151, 224, .22), rgba(244, 168, 58, .18));
  border: 1px solid rgba(255, 255, 255, .1);
}
.mkt-card h3 { color: #fff; font-size: 1.08rem; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mkt-flag {
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #241703; background: linear-gradient(135deg, var(--amber), var(--amber-2));
  border-radius: 20px; padding: 3px 9px;
}
.mkt-card p { color: #9fb2cd; font-size: 14px; margin: 9px 0 0; }
.mkt-tag {
  display: inline-block; margin-top: 14px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; color: #8ce0b0; background: rgba(13, 22, 38, .8);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; padding: 5px 10px;
}
.mkt-foot { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; margin-top: 40px; }
.mkt-snip { color: #93a6c2; font-size: 13.5px; }
.mkt-snip code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; color: #cdd8ea; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px; padding: 2px 7px; }

/* ── CTA band ── */
.cta-band {
  color: #eaf1fb; text-align: center; border-radius: 22px; padding: 60px 28px; margin: 0 24px;
  background: radial-gradient(700px 300px at 50% 0%, rgba(79, 151, 224, .35), transparent 60%), linear-gradient(160deg, var(--navy), var(--ink));
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; } .cta-band p { color: #b7c6dd; max-width: 54ch; margin: 12px auto 26px; }

/* ── Demo form (modal + inline) ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(9, 15, 26, .58); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; width: 100%; max-width: 520px; border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 30px; transform: translateY(10px) scale(.98); transition: transform .2s ease; max-height: 92vh; overflow: auto;
}
.modal-backdrop.open .modal { transform: none; }
.modal-close { float: right; background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal h2 { font-size: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 650; color: var(--ink); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 176, .15); }
.field textarea { resize: vertical; min-height: 78px; }
.form-msg { grid-column: 1/-1; font-size: 14px; border-radius: 10px; padding: 11px 13px; display: none; }
.form-msg.err { display: block; background: #fdecec; color: #a12626; border: 1px solid #f6cccc; }
.form-msg.ok { display: block; background: #e7f6ee; color: #12724a; border: 1px solid #bfe6d0; }
.form-foot { grid-column: 1/-1; display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.form-foot .fine { font-size: 12.5px; color: var(--muted-2); }

/* ── Footer ── */
.foot { background: var(--ink); color: #93a6c2; padding: 56px 0 34px; }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot .brand { color: #fff; }
.foot h4 { color: #cdd8ea; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 14px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.foot a { color: #93a6c2; font-size: 14.5px; } .foot a:hover { color: #fff; }
.foot-bar { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #6f8098; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding: 56px 0 64px; }
  .hero-mock { transform: none; }
  .feat-grid, .price-grid { grid-template-columns: 1fr; }
  .split, .split.rev .split-media { grid-template-columns: 1fr; order: 0; }
  .split + .split { margin-top: 56px; }
  .mkt { padding: 64px 0; }
  .mkt-grid { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav.open .nav-links {
    display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 4px;
    background: #fff; border-bottom: 1px solid var(--line); padding: 14px 24px; align-items: flex-start;
  }
  .section { padding: 64px 0; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   SALES BOT WIDGET  (public AI assistant — talks to POST /api/kb/chat)
   Floating launcher + chat panel. Brand: CarSearch AI navy/blue + amber.
   ══════════════════════════════════════════════════════════════════════════ */

.sb-root {
  position: fixed; z-index: 300; right: 22px; bottom: 22px;
  font-family: var(--font); color: var(--text);
}

/* ── Launcher ── */
.sb-launcher {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font: inherit; font-weight: 650; font-size: 15px; color: #fff;
  padding: 11px 18px 11px 12px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--navy), var(--ink));
  box-shadow: 0 12px 34px -8px rgba(14, 26, 48, .5), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: transform .16s ease, box-shadow .2s ease;
}
.sb-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 44px -10px rgba(14, 26, 48, .58); }
.sb-launcher:active { transform: translateY(0); }
.sb-launcher-ico {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: none;
  background: #0d0d0d; box-shadow: 0 0 0 2px var(--amber-2);
  position: relative;
}
.sb-launcher-ico img { width: 100%; height: 100%; object-fit: cover; }
.sb-launcher-ico::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%; background: #37d67a;
  border: 2px solid var(--ink);
}
.sb-launcher-txt { white-space: nowrap; }
/* Hide the launcher while the panel is open (on mobile it goes full-screen). */
.sb-open .sb-launcher { opacity: 0; pointer-events: none; transform: scale(.9); transition: opacity .15s ease, transform .15s ease; }

/* ── Panel ── */
.sb-panel {
  position: fixed; right: 22px; bottom: 22px;
  width: 396px; max-width: calc(100vw - 32px); height: 640px; max-height: calc(100vh - 44px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  animation: sb-pop .22s cubic-bezier(.2, .8, .3, 1);
}
.sb-panel[hidden] { display: none; }
@keyframes sb-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Header ── */
.sb-head {
  display: flex; align-items: center; gap: 11px; padding: 14px 14px 14px 16px; flex: none;
  color: #eaf1fb;
  background:
    radial-gradient(420px 160px at 90% -30%, rgba(79, 151, 224, .4), transparent 60%),
    linear-gradient(150deg, var(--navy), var(--ink));
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.sb-head-ico {
  width: 38px; height: 38px; border-radius: 11px; overflow: hidden; flex: none;
  background: #0d0d0d; box-shadow: 0 0 0 1.5px rgba(244, 168, 58, .6);
}
.sb-head-ico img { width: 100%; height: 100%; object-fit: cover; }
.sb-head-txt { display: flex; flex-direction: column; line-height: 1.15; flex: 1 1 auto; }
.sb-head-txt b { color: #fff; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.sb-head-txt small { color: #93a6c2; font-size: 11.5px; font-weight: 600; }
.sb-head-status { width: 8px; height: 8px; border-radius: 50%; background: #37d67a; box-shadow: 0 0 10px rgba(55, 214, 122, .8); flex: none; }
.sb-close {
  background: rgba(255, 255, 255, .08); border: 0; color: #cdd8ea; cursor: pointer;
  width: 30px; height: 30px; border-radius: 9px; font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex: none;
  transition: background .15s ease, color .15s ease;
}
.sb-close:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* ── Message list ── */
.sb-msgs {
  flex: 1 1 auto; overflow-y: auto; padding: 18px 16px 8px;
  /* Keep scrolling INSIDE the chat — don't chain to the page behind it. */
  overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(79, 151, 224, .06), transparent 60%),
    var(--mist);
  scrollbar-width: thin; scrollbar-color: #cbd6e6 transparent;
}
/* Belt-and-braces: the whole panel contains overscroll so a wheel over any part
   of the open chat never scrolls the landing page underneath. */
.sb-panel { overscroll-behavior: contain; }
.sb-msgs::-webkit-scrollbar { width: 8px; }
.sb-msgs::-webkit-scrollbar-thumb { background: #cbd6e6; border-radius: 8px; }

.sb-row { display: flex; gap: 9px; align-items: flex-end; max-width: 100%; }
.sb-row-user { justify-content: flex-end; }
.sb-row-bot { justify-content: flex-start; }

.sb-avatar {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: none;
  background: #0d0d0d; box-shadow: 0 0 0 1.5px var(--line); align-self: flex-start; margin-top: 2px;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sb-bot-col { display: flex; flex-direction: column; gap: 9px; max-width: 84%; }

.sb-bubble {
  border-radius: 15px; padding: 11px 14px; font-size: 14.5px; line-height: 1.55;
  word-wrap: break-word; overflow-wrap: anywhere; max-width: 100%;
}
.sb-bubble-user {
  background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff;
  border-bottom-right-radius: 5px; max-width: 82%;
  box-shadow: 0 6px 18px -8px var(--blue-glow);
}
.sb-bubble-bot {
  background: var(--paper); color: var(--text); border: 1px solid var(--line);
  border-bottom-left-radius: 5px; box-shadow: 0 4px 16px -10px rgba(14, 26, 48, .3);
}

/* Rendered markdown inside a bot bubble */
.sb-bubble-bot p { margin: 0 0 9px; }
.sb-bubble-bot p:last-child { margin-bottom: 0; }
.sb-bubble-bot h3 { font-size: 1rem; margin: 4px 0 7px; color: var(--ink); }
.sb-bubble-bot h4 { font-size: .92rem; margin: 4px 0 6px; color: var(--ink); }
.sb-bubble-bot ul, .sb-bubble-bot ol { margin: 6px 0 9px; padding-left: 20px; }
.sb-bubble-bot li { margin: 3px 0; }
.sb-bubble-bot li::marker { color: var(--blue); }
.sb-bubble-bot a { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.sb-bubble-bot a:hover { color: var(--amber); }
.sb-bubble-bot code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em;
  background: var(--mist); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px;
}
.sb-bubble-bot pre { background: var(--mist); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.sb-bubble-bot pre code { background: none; border: 0; padding: 0; }
.sb-bubble-bot blockquote { margin: 8px 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--blue-2); color: var(--muted); }
.sb-bubble-bot img {
  max-width: 100%; height: auto; border-radius: 11px; margin: 8px 0 2px;
  border: 1px solid var(--line); box-shadow: 0 6px 20px -12px rgba(14, 26, 48, .4); display: block;
}

/* ── Follow-up + starter chips ── */
.sb-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.sb-chips-starter { padding-left: 37px; }
.sb-chip {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--blue); background: var(--paper);
  border: 1px solid #cfe0f2; border-radius: 999px; padding: 7px 13px;
  transition: background .14s ease, border-color .14s ease, transform .12s ease, color .14s ease;
  text-align: left; line-height: 1.3;
}
.sb-chip:hover { background: rgba(47, 111, 176, .08); border-color: var(--blue); transform: translateY(-1px); }
.sb-chip:active { transform: translateY(0); }

/* ── Typing indicator ── */
.sb-typing { display: inline-flex; gap: 4px; align-items: center; padding: 13px 15px; }
.sb-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2);
  animation: sb-bounce 1.1s infinite ease-in-out;
}
.sb-typing i:nth-child(2) { animation-delay: .16s; }
.sb-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes sb-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ── Reveal / typewriter-ish animation for a new reply ── */
.sb-reveal .sb-reveal-block { opacity: 0; transform: translateY(6px); }
.sb-reveal-on .sb-reveal-block { animation: sb-rise .34s ease forwards; }
@keyframes sb-rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sb-reveal .sb-reveal-block { opacity: 1 !important; transform: none !important; animation: none !important; }
  .sb-panel { animation: none; }
}

/* ── Input row ── */
.sb-input {
  flex: none; display: flex; gap: 8px; align-items: center; padding: 12px;
  border-top: 1px solid var(--line); background: var(--paper);
}
.sb-field {
  flex: 1 1 auto; font: inherit; font-size: 14.5px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--mist); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.sb-field:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(47, 111, 176, .13); }
.sb-field:disabled { opacity: .6; }
.sb-send {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 8px 20px -8px var(--blue-glow); transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
}
.sb-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px -8px var(--blue-glow); }
.sb-send:disabled { opacity: .45; cursor: default; }
.sb-send svg { transform: translateX(1px); }

/* ── Feature cards become clickable ("Ask AI →" affordance) ── */
.feat.sb-clickable { cursor: pointer; }
.feat.sb-clickable::after {
  content: "Ask AI →"; position: absolute; right: 18px; bottom: 16px;
  font-size: 12.5px; font-weight: 700; color: var(--blue);
  opacity: 0; transform: translateX(-4px); transition: opacity .18s ease, transform .18s ease;
}
.feat.sb-clickable { position: relative; padding-bottom: 40px; }
.feat.sb-clickable:hover::after, .feat.sb-clickable:focus-visible::after { opacity: 1; transform: none; }
.feat.sb-clickable:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Small phones: the header (brand + 2 CTAs + burger) overflows ~390px
   viewports. Hide the secondary "Sign in" button and surface it inside the
   burger menu instead (see .nav-link-mobile in landing.html). ── */
.nav-links .nav-link-mobile { display: none; }
@media (max-width: 620px) {
  .nav-cta .btn-outline { display: none; }
  .nav.open .nav-links .nav-link-mobile { display: block; }
  /* Tighten the row so brand + CTA + burger fit a 390px viewport. */
  .nav-inner { gap: 10px; }
  .nav .wrap { padding: 0 16px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .nav-cta .btn { padding: 9px 13px; font-size: 14px; white-space: nowrap; }
  /* The /developers + /marketplace pages add a brand badge ("Developers" /
     "Marketplace") after the logo — on a phone that + the CTA overflow the row.
     Hide the badge and let the brand text truncate so the header always fits. */
  .brand-dev, .brand-mkt { display: none; }
  .brand-txt { max-width: 40vw; overflow: hidden; }
  .brand-txt, .brand-txt * { white-space: nowrap; }
}
/* Very narrow (≤430px): drop the CTA label to just fit the primary action. */
@media (max-width: 430px) {
  .nav-cta .btn { padding: 8px 11px; font-size: 13px; }
  .brand { font-size: 16px; }
}

/* ── Mobile: panel goes (nearly) full-screen ── */
@media (max-width: 560px) {
  .sb-root { right: 16px; bottom: 16px; }
  .sb-panel {
    right: 0; bottom: 0; top: 0; left: 0;
    width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh;
    border-radius: 0; border: 0;
  }
  .sb-chips-starter { padding-left: 0; }
}
