/* PulmoCrit family — shared tokens, chrome and components.
   Loaded by every page of pulmocrit.com and its centers (PC Lung Institute, PC Sleep Center,
   PC Health, TheraVi, hospital care). Page-specific styles live in their own files. */

:root {
  /* brand */
  --navy: #1b2c51;
  --violet: #7057a5;

  /* the five layers, inner → outer (hospital care at the core, home at the edge) */
  --c-hospital: #3b2a78;
  --c-lung: #553d9c;
  --c-sleep: #7057a5;
  --c-health: #9580c8;
  --c-theravi: #b8a6df;

  /* grounds: white alternating with a cool tint, so each section reads as its own band */
  --paper: #f1f3f8;
  --paper-2: #e6e9f1;
  --white: #ffffff;
  --or-deep: #0c1530;        /* operating-room blue, for procedures and hospital care */
  --or: #13204a;

  /* ink */
  --ink: var(--navy);
  --ink-2: #474e6e;
  --ink-inv: #f5f2ff;
  --ink-inv-2: #d9d1f2;
  --line: rgba(27, 44, 81, 0.12);
  --line-strong: rgba(27, 44, 81, 0.3);
  --line-inv: rgba(255, 255, 255, 0.18);

  /* the accent: a calm clinical blue (data figures, active states, routes, heading rules). Brand violet stays for links.
     On dark grounds it lightens to --signal; actions on dark are white buttons. */
  --blue: #2b61d1;
  --signal: #8db4ff;
  --signal-hi: #cddcff;

  /* portrait backdrop for the cut-out headshots */
  --portrait-bg: linear-gradient(180deg, #eef0f4 0%, #d7dbe5 100%);

  /* headlines in a text serif; Montserrat (the brand face) carries navigation, buttons and small heads */
  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 86px;          /* the header at the top of a page */
  --header-compact: 64px;    /* once the page scrolls */
  --header-now: var(--header-h);
  --facet-h: 48px;           /* a center's row of section links, under the header */
  --radius: 10px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-compact) + 20px);
  scrollbar-color: rgba(27, 44, 81, 0.35) var(--paper);
  background: var(--paper);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
sub { font-size: 0.62em; line-height: 0; vertical-align: -0.18em; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; }
h1, h2 { font-family: var(--font-serif); font-weight: 400; font-optical-sizing: auto; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
button { font: inherit; }

h2 {
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 22ch;
}
h3 { font-weight: 600; font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-weight: 600; }

::selection { background: #d6e2fb; color: var(--navy); }
:focus-visible { outline: 2px solid var(--focus, var(--violet)); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}
.skip-link:focus { transform: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.icon {
  width: 1.25em; height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0.7em 1.3em;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-lg { min-height: 54px; padding: 0.8em 1.55em; font-size: 1rem; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }   /* the action on dark grounds */
.btn-line { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
@media (hover: hover) {
  .btn-navy:hover { background: #26386a; }
  .btn-light:hover { background: #e9e7f2; }
  .btn-line:hover { background: rgba(27, 44, 81, 0.05); }
  .on-dark .btn-line:hover { background: rgba(255, 255, 255, 0.08); }
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding-block: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
}
.link-arrow .icon { transition: transform 200ms var(--ease-out); }
@media (hover: hover) { .link-arrow:hover .icon { transform: translateX(4px); } }

/* ---------- a center's key dot ---------- */

.glyph {
  display: inline-block;
  flex: none;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--tint, var(--violet));
}
[data-layer="hospital"] { --tint: var(--c-hospital); }
[data-layer="lung"] { --tint: var(--c-lung); }
[data-layer="sleep"] { --tint: var(--c-sleep); }
[data-layer="health"] { --tint: var(--c-health); }
[data-layer="theravi"] { --tint: var(--c-theravi); }

/* ---------- global header ---------- */

/* the header stays at the top of every page. It is fixed (the body keeps its full height free at the top), so
   it can slim down once the page scrolls (family.js sets html.is-scrolled) without moving the page under it */
html.is-scrolled { --header-now: var(--header-compact); }
body { padding-top: calc(var(--header-h) + env(safe-area-inset-top)); }
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;   /* the logo artwork sits on white */
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
  --focus: var(--violet);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  height: var(--header-now);
  transition: height 260ms var(--ease-out);
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
  color: var(--navy);
}
/* the PulmoCrit logo, exactly as supplied */
.lockup { flex: none; }
.lockup-logo { display: block; height: 74px; width: auto; max-width: none; flex: none; transition: height 260ms var(--ease-out); }
html.is-scrolled .lockup-logo { height: 52px; }   /* the same artwork, shown smaller */

/* the header's appointment button steps aside while one on the page is in view, so there are never two */
.header-cta { max-width: 260px; overflow: hidden; transition: max-width 300ms var(--ease-out), padding 300ms var(--ease-out), margin 300ms var(--ease-out), opacity 200ms ease, visibility 0s; }
html.cta-in-page .header-cta { max-width: 0; padding-inline: 0; margin-left: -8px; opacity: 0; visibility: hidden; transition: max-width 300ms var(--ease-out), padding 300ms var(--ease-out), margin 300ms var(--ease-out), opacity 160ms ease, visibility 0s linear 300ms; }
.nav-cta { display: none; }

.primary-nav > ul { display: flex; align-items: center; gap: clamp(4px, 1vw, 12px); }
.primary-nav > ul > li > a,
.primary-nav .nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.93rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease;
}
.primary-nav > ul > li > a[aria-current="page"] { color: var(--violet); }
@media (hover: hover) {
  .primary-nav > ul > li > a:hover,
  .primary-nav .nav-trigger:hover { color: var(--violet); }
}
.nav-trigger .chev { width: 14px; height: 14px; transition: transform 220ms var(--ease-out); }
.nav-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }

.header-actions { display: flex; align-items: center; gap: 8px; }
/* the language link (out of the menu, owner 2026-11-24): small, beside the phone icons */
.lang-link { padding: 10px 6px; font-family: var(--font-display); font-weight: 500; font-size: 0.85rem; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
@media (hover: hover) { .lang-link:hover { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; } }
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color 180ms ease;
}
@media (hover: hover) { .icon-link:hover { background: var(--paper-2); } }
/* computers: the phone and texting numbers, stacked and labelled (owner, 2026-11-26) */
.header-contact { display: grid; grid-template-columns: auto auto; column-gap: 8px; }
.header-contact a {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
  padding-block: 3px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.hc-label { justify-self: end; font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet); }
@media (hover: hover) { .header-contact a:hover { color: var(--violet); } }

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: pointer;
}
.menu-toggle .icon { width: 22px; height: 22px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* centers panel */
.centers-panel {
  position: absolute;
  inset: 100% 0 auto;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 40px -28px rgba(27, 44, 81, 0.35);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 320ms var(--ease-out), visibility 0s linear 320ms;
}
.centers-panel[data-open="true"] {
  clip-path: inset(0 0 -60px 0);
  visibility: visible;
  transition: clip-path 320ms var(--ease-out), visibility 0s;
}
.centers-inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding-block: 20px 28px;
}
.center-link {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 18px 18px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--navy);
  transition: background-color 180ms ease;
}
@media (hover: hover) { .center-link:hover { background: var(--paper); } }
.center-link .glyph { width: 9px; height: 9px; margin: 6px 0 8px 2px; }
.center-link strong { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.center-link span { font-size: 0.98rem; color: var(--ink-2); line-height: 1.4; }
.center-link .ext { font-size: 0.85rem; color: var(--violet); font-weight: 600; }

@media (max-width: 1040px) {
  .menu-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100dvh - var(--header-now));
    overflow-y: auto;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 50px -30px rgba(27, 44, 81, 0.45);
    padding: 8px max(var(--gutter), env(safe-area-inset-left)) 24px;
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path 300ms var(--ease-out), visibility 0s linear 300ms;
  }
  .primary-nav[data-open="true"] {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path 300ms var(--ease-out), visibility 0s;
  }
  .primary-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .primary-nav > ul > li > a,
  .primary-nav .nav-trigger { justify-content: space-between; width: 100%; min-height: 56px; padding: 0; border-radius: 0; font-size: 1.2rem; border-bottom: 1px solid var(--line); }
  .centers-panel { position: static; box-shadow: none; border: 0; clip-path: none; visibility: visible; display: none; }
  .centers-panel[data-open="true"] { display: block; clip-path: none; }
  .centers-inner { grid-template-columns: 1fr; padding: 4px 0 12px; gap: 0; }
  .center-link { grid-template-columns: 16px 1fr; column-gap: 14px; padding: 14px 0; border-radius: 0; }
  .center-link .glyph { grid-row: span 3; margin: 7px 0 0 2px; }
  .header-actions .btn { display: none; }
  /* on phones and tablets the appointment button leads the menu */
  .nav-cta { display: block; padding: 12px 0 8px; }
  .primary-nav > ul > li.nav-cta > a { justify-content: center; width: 100%; min-height: 52px; padding: 0.7em 1.3em; border: 0; border-radius: var(--radius-sm); background: var(--navy); color: #fff; font-weight: 600; font-size: 1rem; }
}
@media (max-width: 420px) {
  .lockup-logo { height: 58px; }
  html.is-scrolled .lockup-logo { height: 46px; }
}

/* ---------- a center's row of section links ----------
   it sits under the header and, once reached, stays attached to it (its top follows the header's height) */

.facet-bar {
  position: sticky;
  top: var(--header-now);
  z-index: 55;
  background: var(--navy);
  color: #fff;
  --focus: #fff;
  transition: top 260ms var(--ease-out);
}
.facet-bar-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  height: var(--facet-h);
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.facet-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.facet-name .glyph { width: 9px; height: 9px; margin-inline: 2px 0; }
.facet-links { display: flex; gap: clamp(4px, 1vw, 14px); overflow-x: auto; scrollbar-width: none; }
.facet-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink-inv-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease;
}
@media (hover: hover) { .facet-links a:hover { color: #fff; } }
@media (max-width: 900px) {
  /* one row that swipes sideways: the center's name, then its sections */
  :root { --facet-h: 44px; }
  .facet-bar-inner { gap: 10px; overflow-x: auto; scrollbar-width: none; }
  .facet-bar-inner::-webkit-scrollbar { display: none; }
  .facet-name { margin-right: 4px; padding-right: 14px; border-right: 1px solid var(--line-inv); }
  .facet-links { flex: none; overflow: visible; gap: 2px; }
  .facet-links a { font-size: 0.88rem; padding: 0 7px; }
}

/* ---------- section scaffolding ---------- */

.section { padding-block: clamp(80px, 10vw, 150px); position: relative; border-top: 1px solid var(--line); }
.section.on-dark { border-top: 0; }
.section-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); }
/* a short rule in the accent opens each section's heading */
.section-head::before { content: ""; width: 40px; height: 2px; background: var(--blue); }
.on-dark .section-head::before { background: var(--signal); }
.section-head .lede { max-width: 60ch; }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.3rem); color: var(--ink-2); }
.on-dark { color: var(--ink-inv); --focus: #fff; }
.on-dark .lede { color: var(--ink-inv-2); }

/* ---------- image slot: art-directed frame for a generated or supplied image ---------- */

.slot { position: relative; display: grid; gap: 10px; }
.slot-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: var(--ratio, 16 / 10);
  background: var(--paper-2);   /* empty: a quiet frame naming the image to place; a photo covers it */
  isolation: isolate;
}
.slot-frame img { width: 100%; height: 100%; object-fit: cover; }
.slot-frame .slot-note {
  position: absolute;
  inset: auto 18px 16px 18px;
  display: grid;
  gap: 4px;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.4;
}
.slot-note b {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--violet);
}
.slot-frame:has(img) .slot-note { display: none; }
.slot figcaption { font-size: 0.95rem; color: var(--ink-2); }
.on-dark .slot figcaption { color: var(--ink-inv-2); }

/* ---------- footer ---------- */

.site-footer {
  background: var(--navy);
  color: var(--ink-inv);
  --focus: #fff;
  padding-top: clamp(64px, 8vw, 110px);
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 40px clamp(24px, 4vw, 56px);
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-inv);
}
.footer-brand { display: grid; gap: 18px; align-content: start; }
.logo-tile { display: inline-block; justify-self: start; padding: 12px 14px; border-radius: var(--radius-sm); background: #fff; }
.logo-tile img { display: block; height: 92px; width: auto; }
.footer-brand p { color: var(--ink-inv-2); max-width: 36ch; }
.footer-col h3 { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-inv-2); margin-bottom: 12px; }
.footer-col ul { display: grid; }
.footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-block: 8px;
  color: var(--ink-inv-2);
  text-decoration: none;
}
.footer-col a .glyph { width: 10px; height: 10px; }
@media (hover: hover) { .footer-col a:hover { color: #fff; text-decoration: underline; } }
.footer-contact a { color: #fff; font-weight: 600; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 24px calc(24px + env(safe-area-inset-bottom));
  font-size: 0.95rem;
  color: var(--ink-inv-2);
}
.footer-bottom nav { display: flex; gap: 20px; }
.footer-bottom a { color: var(--ink-inv-2); padding-block: 8px; }
.footer-bottom .lang-link { padding: 8px 0; font-size: inherit; font-weight: inherit; font-family: inherit; color: var(--ink-inv-2); }
.emergency { color: #fff; font-weight: 700; }

@media (max-width: 960px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- front-desk chat (js/chatbot.js) — skin only; markup and behaviour are the script's ---------- */

#pulmocrit-chatbot { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 90; font-family: var(--font-body); }
#chat-launcher {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 14px 30px -14px rgba(12, 21, 48, 0.7);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
#chat-launcher svg { width: 26px; height: 26px; fill: currentColor; }
#chat-launcher:active { transform: scale(0.95); }
#chat-launcher:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
@media (hover: hover) { #chat-launcher:hover { background: #26386a; } }

#chat-bubble {
  position: absolute;
  right: 74px;
  bottom: 2px;
  width: min(310px, calc(100vw - 110px));
  padding: 16px 40px 16px 18px;
  border-radius: 10px 10px 3px 10px;  /* sits beside the launcher, below page content */
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 18px 40px -18px rgba(27, 44, 81, 0.55), 0 0 0 1px var(--line);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transform-origin: 100% 100%;
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms var(--ease-out);
}
#chat-bubble.bubble-visible { opacity: 1; transform: none; pointer-events: auto; }
#chat-bubble p { font-weight: 600; line-height: 1.35; }
#chat-bubble span { display: block; margin-top: 6px; color: var(--violet); font-weight: 600; font-size: 0.95rem; cursor: pointer; }
#chat-bubble-dismiss {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
#chat-bubble::after { display: none; }

#chat-window {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 120px));
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 30px 70px -30px rgba(12, 21, 48, 0.7), 0 0 0 1px var(--line);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: 100% 100%;
  visibility: hidden;
  transition: opacity 220ms ease, transform 260ms var(--ease-out), visibility 0s linear 260ms;
}
#chat-window.chat-open { opacity: 1; transform: none; visibility: visible; transition: opacity 220ms ease, transform 260ms var(--ease-out), visibility 0s; }

#chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 16px 18px;
  background: var(--navy);
  color: #fff;
}
#chat-header .chat-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #fff url("../img/pulmocrit-logo.png") 50% 5.5px / auto 50px no-repeat;  /* the lung mark only */
  flex: none;
}
#chat-header .chat-avatar i { display: none; }
#chat-header .chat-title { display: grid; line-height: 1.25; margin-right: auto; }
#chat-header .chat-title strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
#chat-header .chat-title span { font-size: 0.85rem; color: var(--ink-inv-2); }
#chat-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
#chat-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

#chat-disclaimer {
  position: relative;
  padding: 10px 44px 10px 18px;
  background: #fff6e6;
  color: #5a4210;
  font-size: 0.88rem;
  line-height: 1.4;
  border-bottom: 1px solid #f3dfb6;
}
#chat-disclaimer button {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #5a4210;
  cursor: pointer;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 16px;
  background: var(--paper);
  scrollbar-color: var(--c-health) transparent;
}
.chat-message { max-width: 86%; padding: 10px 14px; border-radius: 10px; font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; }
.chat-message.bot { align-self: flex-start; background: var(--white); color: var(--navy); border-bottom-left-radius: 3px; box-shadow: 0 0 0 1px var(--line); }
.chat-message.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 3px; }
.chat-message.bot ul, .chat-message.bot ol { padding-left: 1.2em; margin: 6px 0; list-style: revert; }
.chat-message.bot a { color: var(--violet); font-weight: 600; }
.chat-message.bot code { font-family: var(--font-mono); font-size: 0.9em; }

.chat-typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px; border-radius: 10px; background: var(--white); box-shadow: 0 0 0 1px var(--line); }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--c-health); animation: chat-dot 1.2s ease-in-out infinite; }
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chat-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-quick-chip {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.82rem;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: pointer;
}
.chat-quick-chip:hover, .chat-quick-chip:focus { background: var(--paper-2); }

#chat-input-area { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--white); }
#chat-input {
  flex: 1;
  min-height: 46px;
  max-height: 120px;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  color: var(--navy);
  font: 1rem/1.4 var(--font-body);
  resize: none;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
#chat-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--violet); }
#chat-send { display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 8px; background: var(--navy); color: #fff; cursor: pointer; flex: none; }
#chat-send svg { width: 20px; height: 20px; fill: currentColor; }
#chat-send:active { transform: scale(0.95); }
#chat-send:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
#chat-live-region { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 480px) {
  #chat-window { position: fixed; inset: auto 8px calc(84px + env(safe-area-inset-bottom)) 8px; width: auto; height: min(560px, calc(100dvh - 110px)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .centers-panel, .primary-nav, #chat-window, #chat-bubble, .header-bar, .lockup-logo, .facet-bar, .header-cta { transition-duration: 0ms !important; }
  .chat-typing span { animation: none; }
}
/* ---------- header contact (owner, 2026-11-26) ----------
   computers (a mouse or trackpad): the phone and texting numbers, no icons. Phones and tablets (a touch screen): labelled
   Call and Text buttons in its place, since a text-message link only opens on a phone. */
.header-actions .call-icon, .header-actions .text-link { display: none; }
@media (pointer: coarse) {
  .header-contact { display: none; }
  .header-actions .call-icon, .header-actions .text-link {
    display: inline-flex;
    width: auto;
    gap: 6px;
    padding: 0 13px 0 11px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
  }
  .header-actions .icon-link .icon { width: 18px; height: 18px; flex: none; }
}
@media (pointer: coarse) and (max-width: 360px) {
  .header-actions { gap: 5px; }
  .header-actions .call-icon, .header-actions .text-link { padding: 0 8px 0 7px; gap: 4px; font-size: 0.85rem; }
  .header-actions .icon-link .icon { width: 16px; height: 16px; }
  .menu-toggle { width: 44px; }
}
/* the full menu and the phone number share the bar on narrower computer screens (the Spanish labels are longer) */
@media (min-width: 1041px) and (max-width: 1240px) {
  .header-bar { gap: 10px; }
  .primary-nav > ul { gap: 2px; }
  .primary-nav > ul > li > a, .primary-nav .nav-trigger { padding: 0 6px; }
}
/* anchors on center pages land below the header and the center's row */
:root:has(body[data-facet]) { scroll-padding-top: calc(var(--header-compact) + var(--facet-h) + 20px); }
.footer-fax { display: inline-block; padding-block: 8px; color: #fff; font-weight: 600; }
.site-footer .glyph { background: color-mix(in srgb, var(--tint) 45%, white); }

/* a person without a supplied photo: their initials on the portrait backdrop */
.doc-ph {
  display: grid;
  place-items: center;
  width: 100%;
  background: var(--portrait-bg);
  color: var(--navy);
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.02em;
  user-select: none;
}
