/* Model Explorer: a learning tool, not the product. HealthID type and palette
   (Poppins, Inter, flat colour); its own structure: the model map across the top,
   a reading canvas, notebook worksheets, teal for members and purple for the insurer. */
:root {
  --canvas: #F7F7FB; --surface: #FFFFFF; --inset: #EEEFF6;
  --ink: #131A33; --ink-2: #4E5570; --muted: #69718F;
  --border: #DDDFEC; --border-strong: #C2C6DA; --line: #DDDFEC; --panel: #F7F7FB; --paper: #FFFFFF;
  --blue: #3B6EF0; --blue-deep: #2C56D4; --blue-tint: #DBE6FD;
  --member: #0F9487; --member-ink: #0C766D; --member-tint: #CCF5EC;
  --insurer: #7C3AED; --insurer-ink: #6427C9; --insurer-tint: #EDE9FE;
  --positive: #189E4B; --danger: #E5484D;
  --e2: 0 4px 12px rgba(19,26,51,.08); --e3: 0 12px 32px rgba(19,26,51,.12);
  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --ruled: radial-gradient(circle at 1px 1px, #D3D6E6 1px, transparent 1.4px) 0 0 / 18px 18px;
}
html, body { background: var(--canvas); color: var(--ink); font-family: var(--font-body); }
body { font-variant-numeric: tabular-nums; }
h1, h2, .detail-head h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; color: var(--ink); text-wrap: balance; }
h1 em, h1 span { font-style: normal; color: var(--blue); }
.kicker, .eyebrow { font-size: 12px !important; line-height: 16px; letter-spacing: .2em !important; text-transform: uppercase; font-weight: 600 !important; color: var(--blue-deep) !important; }
.btn, .primary, button[type="submit"] { background: var(--blue); border: 1px solid var(--blue); color: #fff; border-radius: 10px; font-weight: 500; }
.btn:hover, .primary:hover, button[type="submit"]:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.secondary, .btn.light { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 10px; font-weight: 500; }
.secondary:hover, .btn.light:hover { background: var(--canvas); }
:focus-visible { outline: 2px solid var(--blue) !important; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- the model map ---------- */
.mapbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.mapbar__top { max-width: 1120px; margin: 0 auto; padding: 12px 24px 4px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { height: 22px; width: auto; display: block; }
.brand span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 2px 0 0 12px; border-left: 1px solid var(--border); }
.mapbar__nav { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.mapbar__nav a, .mapbar__nav button { border: 0; background: none; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.mapbar__nav a:hover, .mapbar__nav button:hover { color: var(--ink); background: var(--canvas); }
.mapbar__nav [aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }
.mapbar__nav .talk { color: var(--blue-deep); }
.modelmap { position: relative; max-width: 1120px; margin: 0 auto; padding: 6px 24px 10px; }
.chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.chain li { position: relative; display: flex; justify-content: center; }
.chain li + li::before { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; height: 2px; background: var(--border-strong); }
.chain li:has(.is-lit) + li:has(.is-lit)::before { background: var(--blue); }
.node { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 0 2px; font: inherit; cursor: pointer; color: var(--muted); }
.node .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); font-size: 12px; font-weight: 600; transition: background 180ms, border-color 180ms, color 180ms; }
.node .name { font-size: 12px; line-height: 16px; white-space: nowrap; }
.node:hover .dot, .node[aria-expanded="true"] .dot { border-color: var(--blue); color: var(--blue-deep); }
.node.is-lit .dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.node.is-lit .name, .node[aria-expanded="true"] .name { color: var(--ink); font-weight: 600; }
.morse { display: block; width: 100%; height: 4px; margin-top: 8px; }
.morse line { stroke: var(--blue); stroke-width: 4; opacity: .35; }
.map-card { position: absolute; z-index: 40; left: 50%; transform: translateX(-50%); top: calc(100% - 4px); width: min(440px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--e3); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.map-card h2 { margin: 0; font-size: 20px; line-height: 28px; }
.map-card p { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-2); }
.map-card .map-card__n { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.map-card__acts { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.map-card__acts .btn { padding: 8px 14px; font-size: 14px; cursor: pointer; }
.map-card__x { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
@media (max-width: 760px) {
  .mapbar__top { padding: 10px 16px 2px; }
  .brand span, .mapbar__nav .talk { display: none; }
  .mapbar__nav { font-size: 13px; }
  .mapbar__nav a, .mapbar__nav button { padding: 6px 7px; }
  .modelmap { padding: 4px 8px 8px; }
  .node .name { display: none; }
  .node.is-lit .name, .node[aria-expanded="true"] .name { display: none; }
  .node .dot { width: 26px; height: 26px; }
  .chain li + li::before { top: 13px; }
}

/* ---------- ask page ---------- */
body[data-page="ask"] { display: flex; flex-direction: column; height: 100dvh; }
body[data-page="ask"] .app { flex: 1; min-height: 0; height: auto; }
.app:not(.chatting) #newChat { display: none; }
.mapbar:has(~ .app:not(.chatting)) #newChat { display: none; }
.col { max-width: 760px; }
.landing { gap: 28px; padding: 40px 0 32px; }
.hero { display: flex; flex-direction: column; gap: 14px; }
.hero h1 { margin: 0; font-size: 39px; line-height: 48px; }
.hero .sub { margin: 0; max-width: 62ch; font-size: 17px; line-height: 27px; color: var(--ink-2); }
.hero-note { margin: 0; font-size: 13px; color: var(--muted); }
@media (max-width: 700px) { .landing { padding-top: 24px; } .hero h1 { font-size: 30px; line-height: 38px; } .hero .sub { font-size: 16px; line-height: 25px; } }
.bluebox { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 12px 10px; box-shadow: var(--e2); gap: 8px; }
#heroSlot.bluebox { background: none; border: 0; box-shadow: none; padding: 0; }
.bluebox:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,110,240,.14), var(--e2); }
.bluebox textarea:focus-visible { outline: none !important; }
.inputrow { background: var(--surface); box-shadow: none; border-radius: 12px; padding: 4px 4px 4px 12px; }
.inputrow:focus-within { box-shadow: none; }
.send { background: var(--blue); border-radius: 10px; }
.send:hover { background: var(--blue-deep); }
.seg { border: 1px solid var(--border); background: var(--canvas); }
.seg button { color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--blue-tint); color: var(--blue-deep); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.persona { color: var(--ink-2); }
.persona select { border: 1px solid var(--border); background: var(--canvas); color: var(--ink); }
.hint { color: var(--muted); }
.unlock { border: 0; padding: 6px 6px 4px; }
@media (max-width: 700px) { .bluebox { padding: 10px 10px 8px; } .inputrow { padding-left: 8px; } }

/* the guided demo invitation is a page from the notebook */
.demo-invitation { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 24px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--ruled), var(--inset); text-decoration: none; color: var(--ink); }
.demo-invitation > span:first-child { font-size: 12px; letter-spacing: .2em; font-weight: 600; color: var(--member-ink); }
.demo-invitation strong { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 30px; color: var(--ink); }
.demo-invitation > span:nth-child(3) { font-size: 15px; line-height: 24px; color: var(--ink-2); max-width: 58ch; }
.demo-invitation .demo-start { align-self: flex-start; margin-top: 8px; padding: 10px 16px; border-radius: 10px; background: var(--blue); color: #fff !important; font-size: 14px; font-weight: 500; }
.demo-invitation:hover .demo-start { background: var(--blue-deep); }
.entry-points { gap: 12px; }
.entry-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 16px; }
.entry-card strong { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.entry-card:hover { border-color: var(--blue); }
.starts .l { font-size: 16px; letter-spacing: 0; text-transform: none; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 14px; color: var(--ink); }
.chip:hover { border-color: var(--blue); box-shadow: none; }
.chip.lead { background: var(--surface); font-family: var(--font-body); font-weight: 500; }
.chip:hover svg { color: var(--blue); }
.foot { border-top: 1px solid var(--border); color: var(--muted); }

/* conversation: answers read like notes, and say where they sit */
.msg.user .bubble { background: var(--blue-tint); color: var(--ink); }
.msg.ai .bubble { border: 1px solid var(--border); box-shadow: none; }
.avatar { background: var(--ink); }
.where { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.where > span { margin-right: 6px; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; font-weight: 600; }
.where b { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-weight: 500; background: var(--inset); color: var(--muted); }
.where b i { font-style: normal; display: none; }
.where b.on { background: var(--blue-tint); color: var(--blue-deep); }
.where b.on i { display: inline; }
.conversation-bar .linkbtn { color: var(--ink-2); }
.demo-return { background: var(--surface); color: var(--ink); border: 1px solid var(--blue); box-shadow: var(--e2); }
.demo-return:hover { background: var(--canvas); }
.demo-return strong { color: var(--ink); }
.demo-return small { color: var(--ink-2); }
.demo-return-arrow, .demo-return > span:last-child { color: var(--blue); }
dialog { border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--e3); }

/* ---------- guided demo: notebook worksheets ---------- */
body.guided { background: var(--canvas); }
.guided main { max-width: 1000px; margin: 0 auto; padding: 28px 24px 56px; }
@media (max-width: 700px) { .guided main { padding: 16px 16px 48px; } }
.guided .example-notice { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.guided .example-notice > span { color: var(--member-ink); letter-spacing: .2em; }
.guided .walk-track, .guided #walkSteps { display: none; }
.guided .walk-progress { margin: 0 0 4px; }
.guided #walkPosition { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.guided .chapter { border: 1px solid var(--border); border-radius: 16px; box-shadow: none; background: var(--surface); }
.guided .chapter h2, .guided #welcome h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; }
.guided .step-instruction, .guided .lead { color: var(--ink-2); }
.guided .eyebrow { color: var(--blue-deep) !important; }
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 28px; align-items: start; }
.sheet-grid > .notes { position: sticky; top: 150px; }
@media (max-width: 860px) { .sheet-grid { grid-template-columns: minmax(0, 1fr); } .sheet-grid > .notes { position: static; } }
.notes { display: flex; flex-direction: column; gap: 14px; font-size: 13px; line-height: 20px; color: var(--ink-2); }
.notes p { margin: 0; padding-left: 12px; border-left: 2px solid var(--blue); }
.notes p.member { border-color: var(--member); }
.notes p.insurer { border-color: var(--insurer); }
.notes p b { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.notes p.member b { color: var(--member-ink); }
.notes p.insurer b { color: var(--insurer-ink); }
.ws { background: var(--ruled), var(--inset); border-radius: 14px; padding: 18px 20px; margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.ws__label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--member-ink); margin: 0; }
.ws__q { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 26px; margin: 0; color: var(--ink); }
.ws__options { display: flex; gap: 8px; flex-wrap: wrap; }
.ws__options button { font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.ws__options button:hover { border-color: var(--blue); }
.ws__options button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-deep); font-weight: 600; }
.ws__options button.is-answer { border-color: var(--member); box-shadow: inset 0 0 0 1px var(--member); }
.ws__skip { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.ws__verdict { margin: 0; padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: 15px; line-height: 24px; color: var(--ink-2); }
.ws__verdict b { color: var(--ink); }
.reveal[data-locked="true"] { display: none; }
.guided .profile, .guided .research-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.guided .profile .initial { background: var(--blue-tint); color: var(--blue-deep); }
.guided .profile.selected-group { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.guided .table-choice { border: 1px solid var(--border-strong); border-radius: 8px; color: var(--ink); background: var(--surface); font-size: 12.5px; }
.guided .table-choice[aria-pressed="true"] { background: var(--blue-tint); border-color: var(--blue-tint); color: var(--blue-deep); }
.guided .offer-summary strong, .guided .funnel strong, .guided .module strong { font-family: var(--font-display); font-weight: 600; }
.guided .module { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; border-top-width: 1px; }
.guided .module.medical h3 { color: var(--member-ink); }
.guided .module.life h3 { color: var(--member-ink); }
.guided .module.retention h3 { color: var(--insurer-ink); }
.guided .value-hero { background: var(--ink); border-radius: 16px; }
.guided .value-hero .amount { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; }
.guided .scroll-table { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.guided table th { background: var(--canvas); color: var(--muted); font-weight: 500; font-size: 12.5px; }
.guided .selected-row { background: var(--blue-tint); }
.guided .best-pill { background: var(--member-tint); color: var(--member-ink); }
.guided .confidence-note { background: var(--canvas); border: 1px solid var(--border); }
.guided .callout { border-left-color: var(--insurer); background: var(--insurer-tint); }
.guided .ask-link { color: var(--blue-deep); font-weight: 500; }
.guided .walk-navigation { background: rgba(247,247,251,.96); border-top: 1px solid var(--border); }
.guided footer { color: var(--muted); }

/* two futures: the same members twice, drawn so the gap can be counted */
.futures { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 8px; }
.future { border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.future.without { background: var(--inset); }
.future.with { background: var(--member-tint); }
.future small { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.future.with small { color: var(--member-ink); }
.future strong { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 34px; }
.future span { font-size: 13px; color: var(--ink-2); }
.dots { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; margin-top: 6px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-strong); }
.dots i.c { background: var(--muted); border-color: var(--muted); }
.future.with .dots i.c { background: var(--muted); border-color: var(--muted); }
.future.with .dots i.x { background: #5EDBC5; border-color: #5EDBC5; }
.future.with .dots i.p { background: var(--member); border-color: var(--member); }
.dots-key { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin: 0 0 6px; }
.dots-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
@media (max-width: 560px) { .futures { grid-template-columns: 1fr; } }
.guided #funnel { display: none; }
.guided .callout strong { color: var(--insurer-ink); }
@media (max-width: 760px) {
  .mapbar__top { flex-wrap: wrap; row-gap: 2px; }
  .mapbar__nav { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 420px) {
  .brand img { height: 18px; }
  #newChat { font-size: 0 !important; }
  #newChat::after { content: "New"; font-size: 13px; }
}
