:root {
  color-scheme: light;
  font-family: 'Poppins', 'Hind Siliguri', 'Segoe UI', Arial, sans-serif;
  color: #1c2432;
  background: transparent;
  /* Luna brand palette (Figma) */
  --brand: #8157A1;
  --brand-strong: #6b4587;
  --brand-tint: #f3eef8;
  --grad-blue: #48b8e8;
  --panel-bg: #f5f6fb;
  --bot-bubble: #ffffff;
  --ink: #1c2432;
  --ink-soft: #64708a;
  --line: #e7e9f2;
  --header-grad: linear-gradient(118deg, #7b4f9e 0%, #6a5cb4 42%, #4f8fcf 74%, #46b6e6 100%);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
}

button, input { font: inherit; }
button { border: 0; cursor: pointer; }

.widget { position: relative; width: 100%; height: 100%; }

/* ──────────────  Launcher (closed state — living AI agent)  ────────────── */
.launcher {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  background: transparent;
  transition: transform .2s ease, opacity .2s ease;
}
.launcher:hover { transform: scale(1.04); }

/* Rotating capability-prompt bubble ("Book an appointment?" → "Find a doctor?"…) */
.launcher-invite {
  max-width: 215px;
  padding: 9px 15px;
  border-radius: 16px 16px 4px 16px;
  background: #fff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 12px 30px rgba(60, 40, 90, .22);
}
.launcher-invite-text {
  display: inline-block;
  transition: opacity .3s ease, transform .3s ease;
}
.launcher-invite-text.is-swapping { opacity: 0; transform: translateY(-5px); }

/* Avatar: floats, a rotating+pulsing gradient aura + an expanding ping ring make
   it read unmistakably as a live agent (not a static icon). */
.launcher-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 12px 30px rgba(60, 40, 90, .30);
  animation: lunaFloat 3.2s ease-in-out infinite;
}
.launcher-avatar img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
/* Expanding "live" ping ring pulsing out of the avatar. */
.launcher-avatar::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 2;
  border-radius: 50%;
  border: 2px solid rgba(129, 87, 161, .6);
  animation: lunaPing 2.2s cubic-bezier(0, 0, .2, 1) infinite;
  pointer-events: none;
}
.launcher-aura {
  position: absolute;
  inset: -5px;
  z-index: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #8157a1, #48b8e8, #b07fd0, #6a5cb4, #48b8e8, #8157a1);
  filter: blur(4px);
  opacity: .85;
  animation: lunaSpin 3.5s linear infinite, lunaGlow 2.2s ease-in-out infinite;
}
.launcher:hover .launcher-aura { opacity: 1; }

@keyframes lunaFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes lunaSpin { to { transform: rotate(360deg); } }
/* Opacity-only pulse (kept off `transform` so it composes with lunaSpin). */
@keyframes lunaGlow {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}
@keyframes lunaPing {
  0% { transform: scale(1); opacity: .7; }
  70%, 100% { transform: scale(1.45); opacity: 0; }
}

/* ─────────────────────────  Panel (open state)  ───────────────────────── */
.panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  background: var(--panel-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(28, 20, 56, .28);
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: right bottom;
  transition: opacity .22s ease, transform .24s ease;
}

.is-collapsed .panel {
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px) scale(.96);
}
.is-expanded .launcher {
  pointer-events: none;
  opacity: 0;
  transform: scale(.9);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--header-grad);
  color: #fff;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, .7);
}
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text { min-width: 0; }
.header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .3px;
}
.brand-status {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, .92);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34d17a;
  box-shadow: 0 0 0 0 rgba(52, 209, 122, .6);
  animation: lunaPing 2.4s ease-out infinite;
}

.header-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.header-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: background .16s ease;
}
.header-btn:hover { background: rgba(255, 255, 255, .3); }
.header-close { width: 28px; padding: 0; font-size: 18px; line-height: 1; }

/* Two-tab language control — both visible, active one highlighted (source of truth) */
.lang-tabs {
  display: inline-flex;
  height: 28px;
  padding: 2px;
  gap: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
}
.lang-tab {
  min-width: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.lang-tab:hover { color: #fff; }
.lang-tab.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

/* Messages */
.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px 14px;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: var(--panel-bg);
}

.message-row.luna {
  align-self: flex-start;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
  animation: messageIn .2s ease both;
}
.msg-avatar {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: #ece4f6;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.message {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  animation: messageIn .2s ease both;
}
.message-row.luna .message.luna { max-width: 100%; animation: none; }

.message.user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.message.luna {
  background: var(--bot-bubble);
  color: var(--ink);
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 2px 10px rgba(28, 20, 56, .06);
}

.message.typing { padding: 12px 14px; }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #b3aecb;
  animation: lunaTyping 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .18s; }
.typing-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes lunaTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes messageIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ───────────  Service cards ("Choose fast service") + response actions  ─────────── */
.quick-actions, .response-actions {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: messageIn .2s ease both;
}
.quick-actions > p, .response-actions > p {
  flex: 0 0 100%;
  margin: 2px 0 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.quick-grid {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.service-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 2px 10px rgba(28, 20, 56, .05);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.service-tile:hover, .service-tile:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(129, 87, 161, .16);
  transform: translateY(-1px);
  outline: none;
}
.service-tile-icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-tint), #e6f2fb);
  color: var(--brand);
}
.service-tile-icon svg { width: 19px; height: 19px; display: block; }
.service-tile:hover .service-tile-icon { background: var(--brand); color: #fff; }
.service-tile-label { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }

/* Pill options / support type */
.option-actions button {
  min-height: 34px;
  border: 1px solid #d9dcec;
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.option-actions button:hover { border-color: var(--brand); background: var(--brand-tint); transform: translateY(-1px); }

/* Confirm */
.confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.confirm-yes, .confirm-no { flex: 1 1 0; min-height: 42px; border-radius: 10px; font-size: 13px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .12s ease; }
.confirm-yes { background: var(--brand); color: #fff; }
.confirm-yes:hover { background: var(--brand-strong); }
.confirm-no { flex: 0 0 auto; padding: 0 16px; background: #fff; color: var(--ink-soft); border: 1px solid #d9dcec; }
.confirm-no:hover { border-color: #b9bfd4; background: #f4f5fb; }

/* Cards (doctors/packages) */
.card-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
/* Sectioned service catalog: each group ("Departments", "Tests & Screening",
   "Other services") is its own .card-actions block; give the header a branded
   accent and add breathing room between stacked sections. */
.card-actions + .card-actions { margin-top: 4px; }
.card-actions > p {
  color: var(--brand-strong, var(--brand));
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.select-card {
  display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 58px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 11px; background: #fff; color: var(--ink);
  text-align: left; box-shadow: 0 2px 10px rgba(28, 20, 56, .05);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.select-card:hover, .select-card:focus-visible { border-color: var(--brand); box-shadow: 0 10px 24px rgba(129, 87, 161, .16); transform: translateY(-1px); outline: none; }
.select-card-media { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-strong); font-size: 14px; font-weight: 700; border: 1px solid #e6dcf0; }
.select-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.select-card-media.is-icon svg { width: 22px; height: 22px; display: block; }
.select-card-body { flex: 1 1 auto; min-width: 0; }
.select-card-body strong { display: block; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.select-card-body span { display: block; margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--ink-soft); overflow-wrap: anywhere; }
.select-card-chevron { flex: 0 0 auto; width: 18px; height: 18px; color: #c2c8dc; transition: transform .16s ease, color .16s ease; }
.select-card-chevron svg { width: 100%; height: 100%; display: block; }
.select-card:hover .select-card-chevron { color: var(--brand); transform: translateX(2px); }

/* Searchable options + checkboxes */
.searchable-options, .checkbox-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.option-search { width: 100%; min-width: 0; height: 40px; border: 1px solid #d3d7e6; border-radius: 10px; padding: 0 12px; font-size: 13px; background: #fff; color: var(--ink); }
.option-search:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(129, 87, 161, .14); }
.option-list { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; padding-right: 2px; }
.option-row { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 2px 8px rgba(28, 20, 56, .04); }
.option-row:hover, .option-row:focus-visible { border-color: var(--brand); background: var(--brand-tint); outline: none; }
.option-row strong { display: block; font-size: 13px; line-height: 1.25; }
.option-row span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 12px; line-height: 1.25; }
.option-empty { min-height: 36px; display: grid; place-items: center start; color: var(--ink-soft); font-size: 12px; }
.checkbox-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; min-height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; font-size: 13px; line-height: 1.3; }
.checkbox-row input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--brand); }
.checkbox-submit { justify-self: start; min-height: 36px; border-radius: 10px; padding: 0 14px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }

/* Forms */
.form-actions { display: grid; grid-template-columns: 1fr; gap: 11px; }
.form-row { display: grid; gap: 4px; }
.form-label { font-size: 12px; font-weight: 600; color: #475569; }
.form-control { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; color: var(--ink); font-size: 13px; }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(129, 87, 161, .12); }
.form-invalid { border-color: #dc2626; background: #fef2f2; }
.form-error { font-size: 11px; font-weight: 600; color: #dc2626; line-height: 1.3; }
.form-submit { justify-self: start; min-height: 42px; border-radius: 10px; padding: 0 18px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; }
.form-submit:hover { background: var(--brand-strong); }

/* Location picker */
.location-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.location-current { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 1px solid var(--brand); border-radius: 10px; padding: 0 12px; background: var(--brand-tint); color: var(--brand-strong); font-size: 12.5px; font-weight: 700; }
.location-current svg { width: 17px; height: 17px; }
.location-search { width: 100%; height: 40px; border: 1px solid #d3d7e6; border-radius: 10px; padding: 0 12px; font-size: 13px; }
.location-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(129, 87, 161, .14); }
.location-suggestions { display: grid; gap: 5px; }
.location-suggestion { width: 100%; border: 1px solid #e2e5f0; border-radius: 9px; padding: 8px 11px; background: #fff; text-align: left; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.location-suggestion:hover { border-color: var(--brand); background: var(--brand-tint); }
.location-map { width: 100%; height: 190px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; z-index: 0; }
.location-hint { margin: 0 !important; color: #8b93a8 !important; font-size: 11px !important; font-weight: 500 !important; }
.location-selected { display: grid; gap: 2px; border: 1px solid #cfe6d6; border-radius: 10px; padding: 8px 11px; background: #f1faf4; }
.location-selected-label { font-size: 11px; font-weight: 700; color: #1f8a4c; text-transform: uppercase; letter-spacing: .3px; }
.location-selected-addr { font-size: 12.5px; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.location-confirm { min-height: 42px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; }
.location-confirm:hover { background: var(--brand-strong); }
.location-confirm:disabled { opacity: .5; cursor: default; }

/* Composer */
.composer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.field-hint { color: var(--ink-soft); font-size: 12px; font-weight: 600; line-height: 1.2; }
.composer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.composer input {
  min-width: 0;
  height: 46px;
  border: 1px solid #d9dcec;
  border-radius: 24px;
  padding: 0 16px;
  font-size: 13.5px;
  background: #f7f8fc;
  color: var(--ink);
}
.composer input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(129, 87, 161, .12); }
#sendButton {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  transition: background .16s ease, transform .12s ease;
}
#sendButton:hover { background: var(--brand-strong); }
#sendButton:disabled { opacity: .5; cursor: default; }
#sendButton svg { width: 20px; height: 20px; }

/* Press feedback */
.service-tile:active, .select-card:active, .option-actions button:active,
.confirm-yes:active, .confirm-no:active, .form-submit:active,
.location-confirm:active, #sendButton:active { transform: translateY(1px) scale(.98); }

@media (max-width: 460px) {
  .panel { border-radius: 16px 16px 0 0; }
  .message { max-width: 92%; }
}

/* ── LabaidCancer info card (primary-model information answers) ─────────────── */
.luna-infocard {
  --ic: var(--brand);
  --ic-tint: var(--brand-tint);
  max-width: 100%;
  border: 1px solid #ece6f4;
  border-left: 4px solid var(--ic);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fcfbfe);
  box-shadow: 0 8px 22px rgba(70, 40, 100, .08);
  padding: 13px 15px;
  animation: lunaCardIn .28s ease both;
}
@keyframes lunaCardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.luna-infocard.accent-teal   { --ic: #0f9d8f; --ic-tint: #e6f6f4; }
.luna-infocard.accent-violet { --ic: #8157A1; --ic-tint: #f3eef8; }
.luna-infocard.accent-amber  { --ic: #d9822b; --ic-tint: #fdf1e3; }
.luna-infocard.accent-green  { --ic: #2f9e44; --ic-tint: #e9f7ec; }
.luna-infocard.accent-red    { --ic: #d64545; --ic-tint: #fbecec; }
.luna-infocard.accent-blue   { --ic: #2b6cb0; --ic-tint: #e7f0fa; }

.luna-infocard .ic-head { display: flex; align-items: flex-start; gap: 10px; }
.luna-infocard .ic-icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--ic-tint); border: 1px solid rgba(0,0,0,.04);
}
.luna-infocard .ic-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.luna-infocard .ic-brand {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ic);
}
.luna-infocard .ic-title { margin: 0; font-size: 15px; font-weight: 800; color: #241a30; line-height: 1.25; }
.luna-infocard .ic-summary { margin: 9px 0 0; font-size: 13px; line-height: 1.55; color: #3a3143; }
.luna-infocard .ic-points { margin: 9px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.luna-infocard .ic-points li {
  position: relative; padding-left: 18px; font-size: 12.5px; line-height: 1.45; color: #4a4256;
}
.luna-infocard .ic-points li::before {
  content: ""; position: absolute; left: 4px; top: 7px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--ic);
}
.luna-infocard .ic-source {
  margin: 10px 0 0; font-size: 10.5px; color: #8b8397; font-style: italic;
}
.luna-infocard .ic-actions { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 7px; }
.luna-infocard .ic-chip {
  border: 1px solid var(--ic); border-radius: 999px; padding: 6px 13px;
  background: var(--ic-tint); color: var(--ic); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: transform .12s, background .12s, color .12s;
}
.luna-infocard .ic-chip:hover { background: var(--ic); color: #fff; transform: translateY(-1px); }
.luna-infocard .ic-chip:active { transform: translateY(0) scale(.98); }

/* --- Body-map picker (type-free doctor discovery) --- */
.body-map-offer { display: flex; justify-content: flex-start; padding: 4px 0; }
.body-map-open {
  border: 1px solid #7c3aed; background: #f6f2ff; color: #5b21b6;
  border-radius: 18px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.body-map-open:hover { background: #ede7ff; }
.body-map-overlay {
  position: absolute; inset: 0; z-index: 60;
  background: rgba(20, 12, 46, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.body-map-panel {
  background: #fff; border-radius: 14px; width: min(92%, 340px);
  max-height: 94%; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.body-map-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; font-size: 13px; font-weight: 600; color: #3b2b6b;
  border-bottom: 1px solid #eee;
}
.body-map-close {
  border: 0; background: transparent; font-size: 16px; cursor: pointer; color: #666;
}
.body-map-tabs { display: flex; gap: 6px; padding: 8px 12px 0; }
.body-map-tabs button {
  flex: 1; border: 1px solid #d8cef5; background: #faf8ff; color: #5b21b6;
  border-radius: 10px; padding: 7px 0; font-size: 13px; cursor: pointer;
}
.body-map-tabs button.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.body-map-figure {
  position: relative; margin: 8px auto 0; width: 100%; max-width: 300px;
  flex: 1 1 auto; overflow-y: auto;
}
.body-map-figure img { width: 100%; display: block; }
.body-map-region {
  position: absolute; border: 0; background: transparent; cursor: pointer;
  border-radius: 8px; padding: 0;
}
.body-map-region:hover, .body-map-region:focus {
  background: rgba(124, 58, 237, 0.22); outline: 2px solid rgba(124, 58, 237, 0.7);
}
.body-map-label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #4c1d95; color: #fff; font-size: 11px; padding: 3px 8px;
  border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .12s;
}
.body-map-region:hover .body-map-label,
.body-map-region:focus .body-map-label { opacity: 1; }
.body-map-chips {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px;
  border-top: 1px solid #eee;
}
.body-map-chips button {
  border: 1px solid #d8cef5; background: #faf8ff; color: #5b21b6;
  border-radius: 14px; padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.body-map-chips button:hover { background: #ede7ff; }

/* --- Body-map picker (type-free doctor discovery) --- */
.body-map-offer { display: flex; justify-content: flex-start; padding: 4px 0; }
.body-map-open {
  border: 1px solid #7c3aed; background: #f6f2ff; color: #5b21b6;
  border-radius: 18px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.body-map-open:hover { background: #ede7ff; }
.body-map-overlay {
  position: absolute; inset: 0; z-index: 60;
  background: rgba(20, 12, 46, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.body-map-panel {
  background: #fff; border-radius: 14px; width: min(92%, 340px);
  max-height: 94%; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.body-map-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; font-size: 13px; font-weight: 600; color: #3b2b6b;
  border-bottom: 1px solid #eee;
}
.body-map-close {
  border: 0; background: transparent; font-size: 16px; cursor: pointer; color: #666;
}
.body-map-tabs { display: flex; gap: 6px; padding: 8px 12px 0; }
.body-map-tabs button {
  flex: 1; border: 1px solid #d8cef5; background: #faf8ff; color: #5b21b6;
  border-radius: 10px; padding: 7px 0; font-size: 13px; cursor: pointer;
}
.body-map-tabs button.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.body-map-figure {
  position: relative; margin: 8px auto 0; width: 100%; max-width: 300px;
  flex: 1 1 auto; overflow-y: auto;
}
.body-map-figure img { width: 100%; display: block; }
.body-map-region {
  position: absolute; border: 0; background: transparent; cursor: pointer;
  border-radius: 8px; padding: 0;
}
.body-map-region:hover, .body-map-region:focus {
  background: rgba(124, 58, 237, 0.22); outline: 2px solid rgba(124, 58, 237, 0.7);
}
.body-map-label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #4c1d95; color: #fff; font-size: 11px; padding: 3px 8px;
  border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .12s;
}
.body-map-region:hover .body-map-label,
.body-map-region:focus .body-map-label { opacity: 1; }
.body-map-chips {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px;
  border-top: 1px solid #eee;
}
.body-map-chips button {
  border: 1px solid #d8cef5; background: #faf8ff; color: #5b21b6;
  border-radius: 14px; padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.body-map-chips button:hover { background: #ede7ff; }

/* --- Body-map v2: hitmap selection, zoom, touch confirm --- */
.body-map-zoom { display: inline-flex; gap: 4px; margin-left: auto; margin-right: 8px; }
.body-map-zoom button {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid #d8cef5;
  background: #faf8ff; color: #5b21b6; font-size: 14px; cursor: pointer; line-height: 1;
}
.body-map-zoom button:hover { background: #ede7ff; }
.body-map-viewport {
  position: relative; overflow: hidden; margin: 8px auto 0; width: 100%;
  max-width: 300px; flex: 1 1 auto; min-height: 240px; touch-action: none;
  border-radius: 10px; background: #fbfaff;
}
.body-map-stage { position: relative; transform-origin: 0 0; will-change: transform; }
.body-map-stage img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.body-map-glow {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; image-rendering: auto;
}
.body-map-tip {
  position: absolute; z-index: 5; background: #4c1d95; color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 8px; pointer-events: none;
  white-space: nowrap;
}
.body-map-confirm {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 6px 12px 0; padding: 8px 10px; background: #f6f2ff;
  border: 1px solid #d8cef5; border-radius: 10px; font-size: 13px; color: #3b2b6b;
}
.body-map-confirm button {
  border: 0; background: #7c3aed; color: #fff; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}

/* body-map sub-part picker chips */
.body-map-confirm { flex-wrap: wrap; }
.body-map-subchips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 100%; }
.body-map-subchips button {
  border: 1px solid #d8cef5; background: #fff; color: #5b21b6;
  border-radius: 12px; padding: 5px 9px; font-size: 12px; cursor: pointer;
}
.body-map-subchips button:hover { background: #ede7ff; }

/* body-map v4: on-image zones + labels */
.body-map-zones { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.body-map-labels { position: absolute; inset: 0; pointer-events: none; }
.body-map-tag {
  position: absolute; transform: translate(-50%, -50%);
  background: rgba(40, 20, 80, 0.82); color: #fff; font-size: 8px;
  padding: 1px 4px; border-radius: 6px; white-space: nowrap; line-height: 1.4;
}
.body-map-zoom button.active { background: #7c3aed; color: #fff; }

/* labels keep constant size while zooming; dense head labels appear when zoomed */
.body-map-stage { --bm-inv: 1; }
.body-map-tag { transform: translate(-50%, -50%) scale(var(--bm-inv)); }
.body-map-tag.tiny { display: none; }
.body-map-stage.zoomed .body-map-tag.tiny { display: inline-block; }
