:root {
  --teal: #0b6b63;
  --teal-dark: #08524c;
  --tint: #e4f3ef;
  --ink: #13302b;
  --text: #455651;
  --muted: #5b6b67;
  --line: #d6e1dd;
  --canvas: #f2f7f5;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--teal); }
:focus-visible { outline: 3px solid rgba(11, 107, 99, 0.4); outline-offset: 2px; }
/* Persistent link back to the portfolio. In normal flow, so it never covers content. */
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--teal); text-decoration: underline; }
.back-link:focus-visible { outline-offset: -3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hidden { display: none !important; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ----- The made-up clinic page around the widget ----- */
.demo-note { background: var(--ink); color: #fff; font-size: 13px; text-align: center; padding: 8px 16px; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 18px; }
.phone { font-weight: 600; text-decoration: none; }
.hero { padding-top: 96px; padding-bottom: 160px; max-width: 760px; margin-left: max(24px, calc((100vw - 1040px) / 2)); }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--teal); margin: 0 0 12px; }
.hero h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; letter-spacing: -0.03em; color: var(--ink); margin: 0 0 18px; }
.lede { font-size: 19px; margin: 0 0 28px; max-width: 32em; }
.cta { background: var(--teal); color: #fff; border: 0; border-radius: 12px; min-height: 48px; padding: 0 22px; font: inherit; font-weight: 600; cursor: pointer; }
.cta:hover { background: var(--teal-dark); }

/* ----- The chat widget ----- */
#chat-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 10; }

#chat-bubble-icon {
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--teal); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(11, 107, 99, 0.35);
}
#chat-bubble-icon:hover { background: var(--teal-dark); }

#chat-widget {
  width: min(360px, calc(100vw - 40px));
  background: #fff; border-radius: 18px; overflow: hidden; font-size: 14px;
  box-shadow: 0 12px 40px rgba(19, 48, 43, 0.2);
  display: flex; flex-direction: column; max-height: min(620px, calc(100vh - 40px));
}

#chat-header {
  background: var(--teal); color: #fff; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
#chat-header strong { display: block; font-size: 15px; }
#chat-header small { opacity: 0.8; font-size: 12px; }
#close-chat-btn { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
#close-chat-btn:hover { background: rgba(255, 255, 255, 0.15); }

#chat-body { padding: 16px; min-height: 80px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.message-wrapper { display: flex; flex-direction: column; }
.message-wrapper.me { align-items: flex-end; }
.message-wrapper.support { align-items: flex-start; }
.sender-label { font-size: 11px; color: var(--muted); margin-bottom: 2px; padding: 0 4px; }

.user-bubble, .bot-bubble { padding: 10px 14px; border-radius: 14px; max-width: 85%; overflow-wrap: anywhere; }
.user-bubble { background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.bot-bubble { background: var(--tint); color: var(--ink); border-bottom-left-radius: 4px; }
.bot-bubble a { font-weight: 600; }
.bot-bubble.urgent { background: #fdecea; color: #6b1410; border: 1px solid #f1b5ae; }
.bot-bubble.urgent a { color: #a3170f; }

.typing span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%;
  background: var(--muted); animation: bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }

#menu, .choice-row { display: flex; flex-direction: column; gap: 6px; }
#menu { padding: 0 16px 12px; }

#menu button, .submenu-button {
  background: #fff; border: 1px solid var(--teal); color: var(--teal);
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 13.5px; text-align: left;
}
#menu button:hover, .submenu-button:hover:not(:disabled) { background: var(--teal); color: #fff; }
.submenu-button:disabled { opacity: 0.5; cursor: default; }
.choice-row { align-self: stretch; }

#text-input-area { display: flex; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); }
#user-input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #7b8b87; border-radius: 10px; font: inherit; font-size: 14px; }
#text-input-area button { background: var(--teal); color: #fff; border: 0; padding: 0 16px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600; }
#text-input-area button:hover { background: var(--teal-dark); }

.system-message { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
#privacy-notice { font-size: 11px; color: var(--muted); padding: 0 16px 12px; margin: 0; }
