/* Every rule starts with .nbd-root so theme/page-builder styles
   (e.g. ".elementor-kit-11 button") cannot restyle the widget. */
.nbd-root {
  --nbd-accent: #1f8fbf; /* replaced by the site's brand colour (Widget.php) */
  --nbd-accent-ink: #fff;
  --nbd-bg: #fff;
  --nbd-ink: #1d2733;
  --nbd-muted: #6b7785;
  --nbd-bubble: #f1f3f6;
  --nbd-bubble: color-mix(in srgb, var(--nbd-accent) 9%, #fff);
  --nbd-line: #dfe3e8;
  --nbd-err: #b3261e;
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px)); /* above the iPhone home bar */
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--nbd-ink);
  text-align: left;
}
.nbd-root *, .nbd-root *::before, .nbd-root *::after { box-sizing: border-box; }
.nbd-root button, .nbd-root textarea, .nbd-root input {
  margin: 0; min-height: 0; min-width: 0; box-shadow: none; text-transform: none; letter-spacing: normal;
  font-family: inherit; font-size: inherit; font-weight: normal; line-height: 1.3; text-decoration: none;
}
.nbd-root button:focus-visible, .nbd-root a:focus-visible { outline: 2px solid var(--nbd-accent); outline-offset: 2px; }

.nbd-root .nbd-toggle {
  width: 58px; height: 58px; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--nbd-accent); color: var(--nbd-accent-ink);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
}
.nbd-root .nbd-toggle:hover { filter: brightness(1.08); background: var(--nbd-accent); color: var(--nbd-accent-ink); }
/* teaser bubble left of the chat button */
.nbd-root .nbd-launcher { position: relative; display: flex; }
.nbd-root .nbd-teaser {
  position: absolute; right: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) translateX(8px) scale(.9); transform-origin: right center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s, transform .25s, visibility 0s .25s;
  display: flex; align-items: center; white-space: nowrap; max-width: calc(100vw - 110px); overflow: hidden;
  padding: 9px 16px; min-height: 40px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--nbd-ink); border: 1px solid var(--nbd-line);
  box-shadow: 0 6px 20px rgba(0,0,0,.15); font-size: 15px;
}
.nbd-root .nbd-teaser:hover { background: #fff; color: var(--nbd-ink); border-color: var(--nbd-accent); }
.nbd-root .nbd-teaser.nbd-teaser-on {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1); transition: opacity .25s, transform .25s;
}
.nbd-root.nbd-open .nbd-teaser { display: none; }
.nbd-root .nbd-teaser-text { overflow: hidden; text-overflow: ellipsis; }
.nbd-root .nbd-teaser-caret {
  width: 2px; height: 1.1em; margin-left: 2px; flex: none; background: var(--nbd-accent);
  animation: nbd-caret 1s steps(1) infinite;
}
@keyframes nbd-caret { 50% { opacity: 0; } }

.nbd-root .nbd-panel {
  width: 520px; max-width: calc(100vw - 32px);
  height: 720px; max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px); /* the visible height on phones, without the address bar */
  margin-bottom: 12px; background: var(--nbd-bg);
  border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.2);
  display: flex; flex-direction: column; overflow: hidden;
}
.nbd-root .nbd-panel[hidden] { display: none; }
.nbd-root .nbd-head {
  background: var(--nbd-accent); color: var(--nbd-accent-ink);
  padding: 10px 12px 10px 14px; display: flex; align-items: center; gap: 10px;
}
.nbd-root .nbd-logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; object-fit: contain; padding: 3px; flex: none; }
.nbd-root .nbd-who { flex: 1; min-width: 0; }
.nbd-root .nbd-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbd-root .nbd-status { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 5px; }
.nbd-root .nbd-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.nbd-root .nbd-icon {
  background: none; border: 0; padding: 6px; border-radius: 8px; color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.nbd-root .nbd-icon:hover { background: rgba(255,255,255,.15); color: inherit; }
.nbd-root .nbd-close { font-size: 24px; padding: 2px 8px 4px; }
.nbd-root .nbd-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.nbd-root .nbd-log > * { flex-shrink: 0; }
.nbd-root .nbd-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.nbd-root .nbd-msg a { color: inherit; text-decoration: underline; }
.nbd-root .nbd-bot { background: var(--nbd-bubble); align-self: flex-start; border-bottom-left-radius: 4px; }
.nbd-root .nbd-user { background: var(--nbd-accent); color: var(--nbd-accent-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.nbd-root .nbd-err { color: var(--nbd-err); }
.nbd-root .nbd-typing { display: flex; align-items: center; gap: 5px; padding: 13px 14px; }
.nbd-root .nbd-typing-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--nbd-muted); opacity: .45;
  animation: nbd-typing 1.2s infinite ease-in-out;
}
.nbd-root .nbd-typing-dot:nth-child(2) { animation-delay: .15s; }
.nbd-root .nbd-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes nbd-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.nbd-root .nbd-form { display: flex; gap: 8px; padding: 10px; margin: 0; border-top: 1px solid var(--nbd-line); }
.nbd-root .nbd-input {
  flex: 1; resize: none; border: 1px solid var(--nbd-line); border-radius: 12px;
  padding: 9px 12px; color: var(--nbd-ink); background: var(--nbd-bg); height: auto;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
/* One clean focus ring instead of the theme's border + outline. */
.nbd-root .nbd-input:focus, .nbd-root .nbd-input:focus-visible {
  outline: none; border-color: var(--nbd-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nbd-accent) 15%, transparent);
}
.nbd-root .nbd-send, .nbd-root .nbd-confirm {
  border: 0; border-radius: 10px; padding: 8px 14px; cursor: pointer;
  background: var(--nbd-accent); color: var(--nbd-accent-ink);
}
.nbd-root .nbd-send { width: 40px; padding: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.nbd-root .nbd-send:hover, .nbd-root .nbd-confirm:hover { background: var(--nbd-accent); color: var(--nbd-accent-ink); filter: brightness(1.08); }
.nbd-root .nbd-send:disabled, .nbd-root .nbd-confirm:disabled { opacity: .5; cursor: default; filter: none; }

/* reply buttons */
.nbd-root .nbd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.nbd-root .nbd-chip {
  border: 1px solid color-mix(in srgb, var(--nbd-accent) 35%, #fff); background: var(--nbd-bg); color: var(--nbd-accent);
  border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 14px; text-align: left;
}
.nbd-root .nbd-chip:hover { background: var(--nbd-bubble); color: var(--nbd-accent); }

/* Google Maps buttons */
.nbd-root .nbd-maps { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.nbd-root .nbd-map {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--nbd-accent) 28%, var(--nbd-line)); background: var(--nbd-bg);
  color: var(--nbd-ink); text-decoration: none;
}
.nbd-root .nbd-map:hover { border-color: var(--nbd-accent); background: var(--nbd-bubble); color: var(--nbd-ink); }
.nbd-root .nbd-map-pin {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--nbd-accent) 12%, #fff); color: var(--nbd-accent);
}
.nbd-root .nbd-map-words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nbd-root .nbd-map-label { font-weight: 600; font-size: 14px; line-height: 1.3; }
.nbd-root .nbd-map-text { font-size: 12.5px; color: var(--nbd-muted); line-height: 1.3; }
.nbd-root .nbd-map-go { flex: none; font-size: 13px; font-weight: 600; color: var(--nbd-accent); white-space: nowrap; }

/* page / doctor cards */
.nbd-root .nbd-cards { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x mandatory; align-self: stretch; }
.nbd-root .nbd-pcard {
  flex: 0 0 200px; scroll-snap-align: start; display: flex; flex-direction: column;
  border: 1px solid var(--nbd-line); border-radius: 12px; overflow: hidden; background: var(--nbd-bg);
  color: var(--nbd-ink); text-decoration: none;
}
.nbd-root a.nbd-pcard:hover { border-color: var(--nbd-accent); color: var(--nbd-ink); }
.nbd-root .nbd-pcard-img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--nbd-bubble); }
.nbd-root .nbd-doctor .nbd-pcard-img { height: 150px; object-position: top; }
.nbd-root .nbd-pcard-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nbd-root .nbd-pcard-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.nbd-root .nbd-pcard-text {
  font-size: 12.5px; color: var(--nbd-muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.nbd-root .nbd-pcard-link { margin-top: auto; font-size: 13px; color: var(--nbd-accent); font-weight: 600; }

.nbd-root .nbd-disclaimer { font-size: 11px; color: var(--nbd-muted); padding: 0 12px 8px; }

/* visit request form */
.nbd-root .nbd-card {
  border: 1px solid color-mix(in srgb, var(--nbd-accent) 22%, var(--nbd-line)); border-radius: 14px; background: var(--nbd-bg);
  align-self: stretch; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.nbd-root .nbd-card-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: color-mix(in srgb, var(--nbd-accent) 8%, #fff); border-bottom: 1px solid color-mix(in srgb, var(--nbd-accent) 14%, #fff);
}
.nbd-root .nbd-card-icon {
  width: 32px; height: 32px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--nbd-accent); color: var(--nbd-accent-ink);
}
.nbd-root .nbd-card-title { font-weight: 600; font-size: 15px; }
.nbd-root .nbd-card-body { padding: 12px 14px 14px; }
.nbd-root .nbd-card-hint { font-size: 13px; color: var(--nbd-muted); margin-bottom: 10px; line-height: 1.4; }
.nbd-root .nbd-card dl { display: grid; grid-template-columns: auto 1fr; margin: 0 0 12px; border-radius: 10px; background: #f7f8fa; padding: 4px 12px; }
.nbd-root .nbd-card dt, .nbd-root .nbd-card dd { padding: 7px 0; border-bottom: 1px solid var(--nbd-line); font-size: 14px; }
.nbd-root .nbd-card dt { color: var(--nbd-muted); font-weight: normal; padding-right: 14px; }
.nbd-root .nbd-card dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.nbd-root .nbd-card dt:last-of-type, .nbd-root .nbd-card dd:last-of-type { border-bottom: 0; }
.nbd-root .nbd-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; margin-bottom: 12px; cursor: pointer; }
.nbd-root .nbd-consent input { width: 17px; height: 17px; margin: 1px 0 0; flex: none; accent-color: var(--nbd-accent); cursor: pointer; }
.nbd-root .nbd-consent a { color: var(--nbd-accent); }
.nbd-root .nbd-confirm { width: 100%; padding: 11px 14px; border-radius: 11px; font-weight: 600; font-size: 15px; }
.nbd-root .nbd-card-note { margin-top: 10px; font-size: 14px; padding: 9px 12px; border-radius: 10px; }
.nbd-root .nbd-card-note.ok { color: #1b7f3b; background: #e9f7ee; }
.nbd-root .nbd-card-note.err { color: var(--nbd-err); background: #fdecea; }
@media (max-width: 480px) {
  .nbd-root { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .nbd-root.nbd-open .nbd-panel { height: calc(100vh - 100px); height: calc(100dvh - 100px); }
  .nbd-root .nbd-input { font-size: 16px; } /* under 16px iPhones zoom the page in on focus */
}
@media (prefers-reduced-motion: reduce) {
  .nbd-root .nbd-teaser-caret { display: none; }
  .nbd-root .nbd-teaser { transition: none; }
  .nbd-root .nbd-typing-dot { animation: none; }
}
