:root {
  --bg: #f6f3fc;
  --panel: #ffffff;
  --primary: #7e57c2;
  --primary-dark: #5e35b1;
  --lavender: #ede7f6;
  --violet-soft: #f1e5fc;
  --text: #2e2147;
  --muted: #7a6f96;
  --crisis: #b3261e;
  --border: #e3dcf2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  /* Device backdrop — the app sits inside a phone frame (spec 011: web = mobile-app demo). */
  background: radial-gradient(circle at 50% 0%, #efe8fb 0%, #dfd6f2 55%, #cfc4e8 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
}

/* Phone frame: a centered ~390px device on desktop; full-bleed on a real phone. */
.app {
  width: 390px;
  max-width: 100%;
  height: calc(100vh - 48px);
  max-height: 860px;
  background: linear-gradient(180deg, #f9f6ff 0%, #f4eefc 100%);
  border-radius: 30px;
  box-shadow: 0 24px 70px rgba(60, 33, 120, .35), 0 0 0 10px #1c1533, 0 0 0 11px #2a2145;
  padding: 18px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.app::-webkit-scrollbar { display: none; }
@media (max-width: 460px) {
  body { padding: 0; }
  .app { width: 100%; height: 100vh; max-height: none; border-radius: 0; box-shadow: none; padding: 14px 14px 20px; }
}
/* The journey map was full-bleed (100vw); inside the phone frame it must stay contained. */
.journey.focused .journey-map, .journey-map { width: 100% !important; }

/* View switch (spec: single codebase, web <-> phone perspective). Always-visible corner toggle. */
.view-switch {
  position: fixed; top: 12px; right: 12px; z-index: 2000;
  background: #1c1533; color: #fff; border: none; border-radius: 999px;
  padding: 8px 14px; font-size: .8rem; font-family: inherit; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3); opacity: .82; transition: opacity .12s ease;
}
.view-switch:hover { opacity: 1; }

/* WEB perspective: undo the phone frame — a normal centered web layout. */
html[data-view="web"] body {
  background: linear-gradient(160deg, #f6f3fc 0%, #efe8fb 100%);
  display: block; padding: 0;
}
html[data-view="web"] .app {
  width: auto; max-width: 880px; height: auto; max-height: none;
  border-radius: 0; box-shadow: none; margin: 0 auto; padding: 24px 20px 64px;
  overflow: visible; background: transparent;
}
/* On desktop web, give the onboarding steps a comfortable centered column too. */
html[data-view="web"] .ob-screen { max-width: 560px; margin: 0 auto; }
html[data-view="web"] .ob-topic-grid { grid-template-columns: repeat(3, 1fr); }

/* PHONE (native) view: hide app features that are NOT in the mobile design — keep only the
   onboarding, chat, resources, sign-in, and the disclosure. (They remain available in web view.) */
html[data-view="phone"] #pref-btn,
html[data-view="phone"] #saved-btn,
html[data-view="phone"] #reset,
html[data-view="phone"] #audience-badge,
html[data-view="phone"] #pref-panel,
html[data-view="phone"] #saved-panel,
html[data-view="phone"] #journey,
html[data-view="phone"] #checkpoints { display: none !important; }

/* ---- Onboarding screens (spec 011): full-screen mobile steps matching the design ------------- */
/* While onboarding, hide the chat app chrome; the onboarding overlay owns the frame. */
.app.onboarding > .header,
.app.onboarding > #chat,
.app.onboarding > #quick,
.app.onboarding > #composer,
.app.onboarding > #checkpoints,
.app.onboarding > #journey,
.app.onboarding > #pref-panel,
.app.onboarding > #saved-panel { display: none !important; }
.app.onboarding { padding-top: 26px; }

/* The onboarding elements set `display`, which would otherwise beat the [hidden] attribute and leave
   invisible overlays intercepting clicks — force [hidden] to win inside the onboarding subtree. */
#onboarding[hidden], #onboarding [hidden] { display: none !important; }
#onboarding { flex: 1; display: flex; flex-direction: column; position: relative; }
.ob-screen { flex: 1; display: flex; flex-direction: column; }
.ob-brand { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 700; color: var(--primary-dark); letter-spacing: .5px; margin-bottom: 26px; }
.ob-brand-sub { font-size: .62rem; letter-spacing: 2px; color: var(--muted); font-weight: 600; }
.ob-title { font-size: 1.7rem; line-height: 1.2; color: #241a3d; margin: 0 0 10px; font-weight: 700; }
.ob-sub { font-size: .95rem; color: var(--muted); line-height: 1.5; margin: 0 0 18px; }
.ob-video { display: inline-block; font-size: .9rem; color: var(--primary); text-decoration: none; margin-bottom: 22px; font-weight: 600; }
.ob-video:hover { text-decoration: underline; }

.ob-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  text-align: left; background: #fff; border: 1.5px solid var(--border); border-radius: 16px;
  padding: 16px 18px; margin-bottom: 14px; cursor: pointer; font-family: inherit;
  transition: border-color .12s ease, box-shadow .12s ease, transform .06s ease;
}
.ob-card:hover { border-color: var(--primary); box-shadow: 0 8px 24px rgba(94, 53, 177, .12); }
.ob-card:active { transform: scale(.99); }
.ob-card-txt { display: flex; flex-direction: column; gap: 3px; }
.ob-card-txt strong { font-size: 1.05rem; color: #241a3d; }
.ob-card-txt small { font-size: .84rem; color: var(--muted); }
.ob-chev { font-size: 1.6rem; color: var(--primary); line-height: 1; }

.ob-back { align-self: flex-start; background: none; border: none; color: var(--muted); font-size: .95rem; cursor: pointer; padding: 0 0 14px; font-family: inherit; }
.ob-topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.ob-topic {
  background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 12px;
  font-size: .92rem; color: #3b3357; cursor: pointer; font-family: inherit; text-align: center;
  transition: all .12s ease;
}
.ob-topic:hover { border-color: var(--primary); }
.ob-topic.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ob-input {
  width: 100%; box-sizing: border-box; padding: 13px 15px; font-size: .95rem; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: 14px; background: #fff;
}
.ob-input:focus { outline: none; border-color: var(--primary); }
.ob-spacer { flex: 1; min-height: 14px; }
.ob-continue {
  width: 100%; padding: 15px; border: none; border-radius: 16px; background: var(--primary); color: #fff;
  font-size: 1rem; font-weight: 600; font-family: inherit; cursor: pointer; margin-top: 12px;
}
.ob-continue:hover { background: var(--primary-dark); }
.ob-continue:disabled { opacity: .5; cursor: default; }

/* Bottom-sheet drawer for the acknowledge + mood + go-to-signup. */
.ob-drawer-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; background: rgba(30, 20, 60, .28); border-radius: inherit; }
.ob-drawer {
  width: 100%; background: #fff; border-radius: 22px 22px 0 0; padding: 22px 20px 24px;
  box-shadow: 0 -12px 40px rgba(30, 20, 60, .25); animation: obUp .25s ease;
}
@keyframes obUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.ob-drawer-lead { font-size: 1.05rem; color: #241a3d; line-height: 1.45; margin: 0 0 8px; font-weight: 600; }
.ob-drawer-sub { font-size: .92rem; color: var(--muted); line-height: 1.5; margin: 0 0 16px; }
.ob-mood { display: flex; justify-content: space-between; gap: 6px; }
.ob-mood button {
  flex: 1; background: var(--violet-soft); border: 1.5px solid transparent; border-radius: 14px;
  padding: 10px 4px 8px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column;
  align-items: center; gap: 4px; font-size: .68rem; color: var(--muted);
}
.ob-mood button:hover { border-color: var(--primary); }
.ob-mood .ob-emoji { font-size: 1.5rem; }
.ob-drawer .ob-continue { margin-top: 18px; }
.ob-drawer-skip { display: block; width: 100%; text-align: center; background: none; border: none; color: var(--muted); font-size: .86rem; margin-top: 12px; cursor: pointer; font-family: inherit; }

/* Signup shown full-screen during onboarding. */
.app.onboarding #signup-panel { max-width: 100%; border: none; box-shadow: none; margin: 0; flex: 1; }

.header { text-align: center; position: relative; }
.topbar-right { position: absolute; top: 0; right: 0; display: flex; gap: 8px; align-items: center; }
.reset, .saved-btn, .pref-btn {
  background: #fff; border: 1px solid var(--border);
  color: var(--primary-dark); padding: 6px 12px; border-radius: 999px; font-size: .78rem;
  cursor: pointer; font-family: inherit;
}
.reset:hover, .saved-btn:hover, .pref-btn:hover { background: var(--violet-soft); }

/* Resource-type preference panel (spec 005). */
.pref-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 14px 18px;
  box-shadow: 0 8px 30px rgba(94, 53, 177, .08);
}
.pref-head { display: flex; align-items: center; justify-content: space-between; }
.pref-head h2 { margin: 0; font-size: 1rem; color: var(--primary-dark); }
.pref-close { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; }
.pref-intro { margin: 6px 0 12px; font-size: .86rem; color: var(--muted); }
.pref-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.pref-toggle {
  background: #fff; border: 1px solid var(--border); color: var(--primary-dark);
  padding: 8px 14px; border-radius: 999px; font-size: .9rem; cursor: pointer; font-family: inherit;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.pref-toggle:hover { background: var(--violet-soft); border-color: var(--primary); }
.pref-toggle.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pref-clear {
  margin: 12px 0 0; background: none; border: none; color: var(--muted); font-size: .82rem;
  cursor: pointer; text-decoration: underline; font-family: inherit;
}
.pref-clear:hover { color: var(--primary-dark); }

/* Sign up / sign in panel (spec 010). */
.signup-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 8px 30px rgba(94, 53, 177, .08); max-width: 380px; margin: 0 auto;
}
.signup-head { display: flex; align-items: center; justify-content: space-between; }
.signup-head h2 { margin: 0; font-size: 1.05rem; color: var(--primary-dark); }
.signup-lead { margin: 4px 0 12px; font-size: .9rem; color: #4a4560; }
.signup-input {
  width: 100%; box-sizing: border-box; margin: 8px 0; padding: 11px 14px; font-size: .95rem;
  border: 1px solid var(--border); border-radius: 10px; font-family: inherit;
}
.signup-input:focus { outline: none; border-color: var(--primary); }
.signup-btn { width: 100%; margin-top: 4px; }
.signup-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: .8rem; }
.signup-or::before, .signup-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-btn { display: flex; justify-content: center; min-height: 40px; }
.signup-oauth {
  width: 100%; margin-top: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); font-size: .92rem; font-family: inherit; cursor: not-allowed;
}
.signup-msg { margin: 10px 0 0; font-size: .84rem; color: var(--muted); }

/* Journey checkpoints (spec 006). */
.checkpoints {
  margin: 12px auto 4px; max-width: 560px; background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 12px 16px; box-shadow: 0 6px 22px rgba(94, 53, 177, .06);
}
.ck-head { display: flex; align-items: center; gap: 10px; }
.ck-titlewrap { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 8px; text-align: center; }
.ck-stage { margin: 0; font-size: .98rem; color: var(--primary-dark); }
.ck-progress {
  font-size: .74rem; color: var(--primary-dark); background: var(--violet-soft);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.ck-nav {
  background: #fff; border: 1px solid var(--border); color: var(--primary-dark); width: 30px;
  height: 30px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; flex: none;
}
.ck-nav:hover:not(:disabled) { background: var(--violet-soft); }
.ck-nav:disabled { opacity: .35; cursor: default; }
.ck-list { list-style: none; margin: 10px 0 0; padding: 0; }
.ck-list li { margin: 0; }
.ck-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 4px; font-size: .92rem;
  color: #2f2a3f; cursor: pointer; border-radius: 8px;
}
.ck-item:hover { background: var(--violet-soft); }
.ck-item input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex: none; }
.ck-item input:checked + span { color: var(--muted); text-decoration: line-through; }
.ck-all {
  margin: 10px 0 2px; width: 100%; background: var(--violet-soft); border: 1px solid var(--border);
  color: var(--primary-dark); padding: 8px 12px; border-radius: 999px; font-size: .84rem;
  cursor: pointer; font-family: inherit;
}
.ck-all:hover { background: #e7d6fb; }

/* Saved resources panel (spec 004). */
.saved-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 14px 18px;
  box-shadow: 0 8px 30px rgba(94, 53, 177, .08);
}
.saved-head { display: flex; align-items: center; justify-content: space-between; }
.saved-head h2 { margin: 0; font-size: 1rem; color: var(--primary-dark); }
.saved-close { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; }
.saved-list { margin: 8px 0 0; padding-left: 18px; }
.saved-list li { font-size: .92rem; margin-bottom: 6px; }
.saved-list a { color: var(--primary-dark); }
.saved-remove {
  margin-left: 8px; background: none; border: none; color: var(--muted); font-size: .78rem;
  cursor: pointer; text-decoration: underline; font-family: inherit;
}
.saved-remove:hover { color: var(--crisis); }
.saved-empty { margin: 8px 0 0; font-size: .86rem; color: var(--muted); }

/* Onboarding chips: relationship + feelings check-in (spec 004 Phase 3). */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.chip {
  background: #fff; border: 1px solid var(--border); color: var(--primary-dark);
  padding: 8px 14px; border-radius: 999px; font-size: .9rem; cursor: pointer; font-family: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.chip:hover { background: var(--violet-soft); border-color: var(--primary); }
/* Selected state for multi-select chips (resource-type prompt). */
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* One-time resource-type prompt: pick a few, then Submit (spec 005 refinement). */
.rt-prompt { margin-bottom: 12px; }
.rt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.rt-submit {
  background: var(--primary); border: 1px solid var(--primary); color: #fff; font-family: inherit;
  padding: 8px 16px; border-radius: 999px; font-size: .88rem; cursor: pointer;
}
.rt-submit:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.rt-all {
  background: none; border: none; color: var(--muted); font-size: .84rem; cursor: pointer;
  text-decoration: underline; font-family: inherit;
}
.rt-all:hover { color: var(--primary-dark); }

.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand h1 { margin: 0; font-size: 1.8rem; color: var(--primary-dark); letter-spacing: .5px; }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #b39ddb, var(--primary));
  box-shadow: 0 0 0 4px rgba(126, 87, 194, .15);
}
.disclosure { margin: 8px auto 0; max-width: 560px; font-size: .82rem; color: var(--muted); }

.notice {
  background: #fff4d6; border: 1px solid #e0a93b; color: #6b4a10;
  padding: 8px 12px; border-radius: 10px; font-size: .82rem; text-align: center;
}

.chat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  min-height: 340px;
  max-height: 56vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(94, 53, 177, .08);
}

.msg { max-width: 86%; padding: 11px 14px; border-radius: 14px; line-height: 1.45; font-size: .95rem; white-space: pre-wrap; }
.msg.lou { align-self: flex-start; background: var(--lavender); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.crisis { align-self: stretch; max-width: 100%; background: #fdecea; border: 1px solid var(--crisis); color: #5c1a16; }
.msg.typing { color: var(--muted); font-style: italic; }

.resources { margin-top: 10px; align-self: flex-start; max-width: 86%; width: 86%; }
.resources h3 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.resources ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

/* Stacked resource card (spec 007): type + bookmark top, title, short description, thumbs bottom. */
.rcard {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(94, 53, 177, .05);
}
.rcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rcard-title {
  display: block; margin-top: 2px; font-size: .95rem; font-weight: 600; color: var(--primary-dark);
  text-decoration: none; line-height: 1.3;
}
.rcard-title:hover { text-decoration: underline; }
.rcard-desc { margin: 4px 0 0; font-size: .85rem; color: #4a4560; line-height: 1.4; }
.rcard-acts { display: flex; gap: 4px; margin-top: 8px; }

/* Resource type badge (article / video / …). */
.resources .rtype {
  display: inline-block; font-size: .62rem; text-transform: uppercase; letter-spacing: .4px;
  background: var(--violet-soft); color: var(--primary-dark); border-radius: 999px; padding: 2px 8px;
}
.resources-showmore {
  margin-top: 10px; background: none; border: none; color: var(--primary-dark);
  font-size: .84rem; cursor: pointer; padding: 2px 0; text-decoration: underline; font-family: inherit;
}
.resources-showmore:hover { color: var(--primary); }
/* Per-resource actions: thumbs up/down + save. Subtle until hovered or active. */
.resources .ract {
  background: none; border: none; cursor: pointer; font-size: .95rem; padding: 2px 4px; line-height: 1;
  border-radius: 8px; opacity: .5; filter: grayscale(1); transition: opacity .1s ease, filter .1s ease, background .1s ease;
}
.rcard:hover .ract { opacity: .8; }
.resources .ract:hover { opacity: 1; filter: none; background: var(--violet-soft); }
.resources .ract.on { opacity: 1; filter: none; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button {
  background: var(--violet-soft); border: 1px solid var(--border); color: var(--primary-dark);
  padding: 8px 12px; border-radius: 999px; font-size: .85rem; cursor: pointer;
}
.quick button:hover { background: #e7d6fb; }

.composer { display: flex; gap: 8px; }
.composer input {
  flex: 1; padding: 13px 16px; border: 1px solid var(--border); border-radius: 999px;
  font-size: .95rem; outline: none; background: #fff;
}
.composer input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(126,87,194,.15); }
.composer button {
  background: var(--primary); color: #fff; border: none; border-radius: 999px;
  padding: 0 22px; font-size: .95rem; cursor: pointer;
}
.composer button:hover { background: var(--primary-dark); }
.composer button:disabled { opacity: .5; cursor: default; }

/* Inside the phone frame (spec 011) the map stays contained — no full-bleed. Tucked below the chat. */
.journey {
  position: static; width: auto; margin: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 14px;
}
.journey.focused { border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.journey.focused .road-svg { min-width: 0; max-width: 100%; }
.journey-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.journey h2 { margin: 0 0 8px; font-size: 1rem; color: var(--primary-dark); }
.journey-head h2 { margin: 0; }
.journey-toggle {
  background: #fff; border: 1px solid var(--border); color: var(--primary-dark);
  padding: 7px 14px; border-radius: 999px; font-size: .8rem; font-family: inherit; cursor: pointer;
  white-space: nowrap; transition: background .12s ease;
}
.journey-toggle:hover { background: var(--violet-soft); }

/* 2D "road-trip" journey map: scattered, phase-colored pins on a connected dashed road. */
.journey-map {
  margin-top: 6px; overflow-x: auto; border-radius: 14px; text-align: center;
  background: linear-gradient(160deg, #f3eefc 0%, #efe9fb 100%);
}
/* Fills the full-bleed panel (capped on huge screens); scrolls only on narrow ones. */
.road-svg { display: block; width: 100%; max-width: 1700px; min-width: 0; height: auto; margin: 0 auto; }
.road-svg .rdstop { transition: opacity .12s ease; cursor: pointer; }
.road-svg .rdstop:hover { opacity: 1 !important; }
/* No borders anywhere: click/hover/focus all use soft shadows, never an outline. */
.road-svg .rdstop:focus { outline: none; }
.road-svg .rdstop:hover .rdlabel { filter: drop-shadow(0 4px 10px rgba(126, 87, 194, .30)); }
.road-svg .rdstop:focus-visible .rdlabel { filter: drop-shadow(0 0 5px var(--primary)); }
.road-svg .rdlabel { filter: drop-shadow(0 2px 4px rgba(60, 40, 110, .14)); }
.road-svg .rdlabel.current { filter: drop-shadow(0 3px 8px rgba(47, 111, 237, .35)); }

.journey-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .76rem; color: var(--muted);
}
.journey-legend span { display: inline-flex; align-items: center; gap: 6px; }
.journey-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.journey-legend .dot.early { background: #2f6fed; }
.journey-legend .dot.skills { background: #34a853; }
.journey-legend .dot.advanced { background: #ea4335; }
.journey-legend .dot.ongoing { background: #f9ab00; }

.journey-note { margin: 10px 0 0; font-size: .76rem; color: var(--muted); }

/* ===========================================================================
   Audience mode (spec 002-patient-view): a selector, a header badge, and a
   more accessible "patient" theme (larger text, higher contrast, larger controls).
   =========================================================================== */

.audience-badge {
  position: absolute; top: 0; left: 0; background: #fff; border: 1px solid var(--border);
  color: var(--primary-dark); padding: 6px 12px; border-radius: 999px; font-size: .78rem;
  cursor: pointer; font-family: inherit;
}
.audience-badge:hover { background: var(--violet-soft); }

.audience-gate {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 26px 22px; text-align: center; box-shadow: 0 8px 30px rgba(94, 53, 177, .08);
}
.audience-gate h2 { margin: 0 0 6px; font-size: 1.2rem; color: var(--primary-dark); }
.audience-intro { margin: 0 auto 18px; max-width: 460px; font-size: .9rem; color: var(--muted); }
.audience-choices { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.audience-btn {
  flex: 1 1 220px; max-width: 280px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 20px 16px; border: 2px solid var(--border); border-radius: 16px;
  background: #faf7ff; color: var(--text); font-family: inherit; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.audience-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(126, 87, 194, .22); border-color: var(--primary); }
.audience-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.audience-emoji { font-size: 2rem; line-height: 1; }
.audience-title { font-size: 1.02rem; font-weight: 700; color: var(--primary-dark); }
.audience-sub { font-size: .82rem; color: var(--muted); }

/* --- Patient theme: bigger, calmer, higher-contrast (US3 / SC-006). --- */
body[data-audience="patient"] {
  --text: #1c1330;      /* darker text for higher contrast */
  --muted: #574c73;
  font-size: 18px;       /* larger base; rem-based sizes scale up */
}
body[data-audience="patient"] .app { gap: 18px; max-width: 720px; }
body[data-audience="patient"] .msg { font-size: 1.08rem; line-height: 1.6; padding: 14px 18px; max-width: 92%; }
body[data-audience="patient"] .disclosure { font-size: .9rem; color: var(--muted); }
body[data-audience="patient"] .composer input { font-size: 1.08rem; padding: 16px 18px; }
body[data-audience="patient"] .composer button { font-size: 1.05rem; padding: 0 26px; }
body[data-audience="patient"] .quick button { font-size: .95rem; padding: 10px 14px; }
body[data-audience="patient"] .brand h1 { font-size: 2rem; }
body[data-audience="patient"] .rcard-title { font-size: 1.02rem; }
body[data-audience="patient"] .rcard-desc { font-size: .95rem; }
/* Keyboard focus is always clearly visible in patient mode. */
body[data-audience="patient"] a:focus-visible,
body[data-audience="patient"] button:focus-visible,
body[data-audience="patient"] input:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
