/* Front Door demo layer. Everything is scoped to .fd-* elements or to
   html.fd-demo, so the practice site is unchanged until the demo is opened. */

:root {
  --fd-bg: #F6F3EC;
  --fd-surface: #FFFFFF;
  --fd-panel: #F1EDE4;
  --fd-ink: #1B2626;
  --fd-muted: #4A5654;
  --fd-faint: #8A9391;
  --fd-line: #D5CEBF;
  --fd-line-soft: #E6E0D4;
  --fd-teal: #1F5C5A;
  --fd-teal-soft: #E3EEEC;
  --fd-teal-mid: #7FA9A6;
  --fd-amber: #7A3C0C;
  --fd-amber-soft: #FBEEDD;
  --fd-red: #B5452F;
  --fd-bar: #1B2626;
  --fd-code: #E8E3D8;
  --fd-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fd-serif: "Newsreader", Georgia, serif;
  --fd-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fd-bar-h: 48px;
  --fd-panel-w: 460px;
  --fd-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- page offsets in demo mode ---------- */
html.fd-demo body { padding-top: var(--fd-bar-h); }
html.fd-demo header.nav { top: var(--fd-bar-h); }
html.fd-demo .mobile-menu { inset: calc(74px + var(--fd-bar-h)) 0 0; }
@media (min-width: 1100px) {
  html.fd-panel-open body { margin-right: var(--fd-panel-w); }
  /* The practice header gets ~460px narrower while the panel is docked. */
  html.fd-panel-open header.nav .brand { flex: none; }
  html.fd-panel-open header.nav .nav-phone { display: none; }
  html.fd-panel-open header.nav .nav-links a { padding-inline: 10px; }
}
@media (min-width: 1100px) and (max-width: 1599px) {
  html.fd-panel-open header.nav .nav-links a[href$="#reviews"] { display: none; }
}
@media (min-width: 1100px) and (max-width: 1279px) {
  html.fd-panel-open header.nav .nav-links { display: none; }
}

.fd-root, .fd-root * { box-sizing: border-box; }
.fd-root { font-family: var(--fd-sans); color: var(--fd-ink); font-size: 14px; line-height: 1.45; }
.fd-root button { font: inherit; cursor: pointer; }
.fd-root :focus-visible { outline: 2px solid var(--fd-teal); outline-offset: 2px; }
.fd-root [hidden] { display: none !important; }
.fd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- chips ---------- */
.fd-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 3px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; line-height: 1.3; }
.fd-chip.ai { background: var(--fd-teal); color: #fff; }
.fd-chip.code { background: var(--fd-code); color: var(--fd-ink); }
.fd-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--fd-teal-soft); color: var(--fd-teal); font-size: 12px; font-weight: 600; white-space: nowrap; }
.fd-flag { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--fd-amber-soft); color: var(--fd-amber); font-size: 12.5px; font-weight: 600; }

/* ---------- demo bar ---------- */
.fd-bar {
  position: fixed; inset: 0 0 auto 0; height: var(--fd-bar-h); z-index: 90;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--fd-bar); color: #fff; font-size: 14px;
}
.fd-bar .fd-brand b { font-weight: 700; }
.fd-bar .fd-brand span { color: rgba(255, 255, 255, .82); }
.fd-tabs { display: flex; gap: 4px; }
.fd-tabs a { color: #fff; text-decoration: none; padding: 6px 14px; border-radius: 999px; font-weight: 500; }
.fd-tabs a[aria-current="page"] { background: var(--fd-bg); color: var(--fd-ink); }
.fd-bar-right { justify-self: end; display: flex; align-items: center; gap: 16px; color: rgba(255, 255, 255, .82); }
.fd-switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; padding: 4px 0; }
.fd-switch .fd-track { width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .25); position: relative; transition: background .2s; }
.fd-switch .fd-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--fd-ease); }
.fd-switch[aria-checked="true"] .fd-track { background: var(--fd-teal-mid); }
.fd-switch[aria-checked="true"] .fd-track::after { transform: translateX(16px); }
.fd-exit { color: rgba(255, 255, 255, .7); background: none; border: 0; text-decoration: underline; padding: 4px 0; }
/* Tabs have a long and a short label; phones get the short one. */
.fd-tabs .ts { display: none; }
.fd-bar .fd-brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 1440px) { .fd-bar .fd-brand span { display: none; } }
@media (max-width: 1023px) { .fd-switch .fd-sw-l { display: none; } .fd-exit { white-space: nowrap; } }
@media (max-width: 760px) {
  .fd-bar { grid-template-columns: 1fr auto; padding: 0 10px; gap: 6px; }
  .fd-bar .fd-brand, .fd-switch .fd-sw-l { display: none; }
  .fd-tabs a { padding: 5px 10px; font-size: 13px; }
  .fd-tabs .tl { display: none; }
  .fd-tabs .ts { display: inline; }
  .fd-bar-right { gap: 10px; font-size: 13px; }
}

/* ---------- entry pill (practice site, demo off) ---------- */
.fd-pill {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px;
  border: 0; border-radius: 999px; background: var(--fd-teal); color: #fff; font-weight: 600; font-size: 14.5px;
  box-shadow: 0 6px 24px rgba(20, 38, 45, .22);
}
.fd-pill .fd-dot { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.fd-pill:hover { background: #184b49; }

/* ---------- drawer ---------- */
.fd-scrim { position: fixed; inset: var(--fd-bar-h) 0 0 0; z-index: 84; background: rgba(27, 38, 38, .38); }
.fd-drawer {
  position: fixed; top: var(--fd-bar-h); right: 0; bottom: 0; z-index: 85; width: min(480px, 100%);
  background: var(--fd-bg); display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(20, 38, 45, .18);
}
.fd-drawer-head { padding: 18px 24px 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.fd-drawer-head h2 { margin: 0; font: 500 28px/1.1 var(--fd-serif); color: var(--fd-ink); letter-spacing: -.01em; }
.fd-drawer-head p { margin: 0; grid-column: 1; color: var(--fd-muted); font-size: 14px; }
.fd-close { grid-row: 1 / span 2; grid-column: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--fd-line); background: var(--fd-surface); color: var(--fd-ink); font-size: 18px; line-height: 1; }
.fd-drawer-body { overflow-y: auto; padding: 2px 24px 12px; display: grid; gap: 6px; align-content: start; flex: 1; }
.fd-persona {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 10px; width: 100%;
  padding: 7px 14px; border-radius: 10px; border: 1px solid var(--fd-line-soft); background: var(--fd-surface); text-align: left; color: var(--fd-ink);
}
.fd-persona b { font-weight: 600; }
.fd-persona span { color: var(--fd-muted); }
.fd-random { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border-radius: 10px; border: 1.5px dashed var(--fd-teal-mid); background: transparent; color: var(--fd-teal); font-weight: 600; }
.fd-btn { padding: 12px 20px; border-radius: 999px; border: 0; font-weight: 600; font-size: 15.5px; }
.fd-root button.fd-btn { font-weight: 600; } /* `.fd-root button { font: inherit }` would reset it */
.fd-btn.primary { background: var(--fd-teal); color: #fff; }
.fd-btn.primary:hover { background: #184b49; }
.fd-btn.ghost { background: transparent; border: 1.5px solid var(--fd-teal); color: var(--fd-teal); }
.fd-btn:disabled { opacity: .55; cursor: progress; }
.fd-note { font-size: 12px; color: var(--fd-muted); margin: 0; }
.fd-error { font-size: 13.5px; color: var(--fd-red); margin: 0; }

/* ---------- bottom dock: patient card + call card ---------- */
.fd-dock {
  position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 83;
  display: flex; flex-wrap: wrap-reverse; align-items: flex-end; justify-content: space-between; gap: 16px;
  pointer-events: none;
}
.fd-dock > * { pointer-events: auto; }
@media (min-width: 1100px) { html.fd-panel-open .fd-dock { right: calc(var(--fd-panel-w) + 20px); } }

/* ---------- patient card (during a call) ---------- */
.fd-patient {
  width: min(400px, 100%);
  background: var(--fd-bg); border: 1px solid var(--fd-line); border-radius: 16px;
  box-shadow: 0 14px 40px rgba(20, 38, 45, .18); display: flex; flex-direction: column;
  max-height: calc(100vh - var(--fd-bar-h) - 40px); font-size: 15px;
}
.fd-p-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.fd-p-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fd-teal); }
.fd-p-head h2 { margin: 2px 0 0; font: 500 26px/1.15 var(--fd-serif); color: var(--fd-ink); letter-spacing: -.01em; }
.fd-root .fd-p-toggle { flex: none; background: none; border: 1px solid var(--fd-line); border-radius: 999px; padding: 6px 12px; color: var(--fd-teal); font-weight: 600; font-size: 13px; }
.fd-patient.min { width: min(460px, 100%); }
.fd-patient.min .fd-p-head { padding-bottom: 4px; }
.fd-patient.min .fd-p-head h2 { font-size: 20px; }
.fd-p-strip { padding: 0 18px 14px; font-size: 15px; }

/* ---------- call card ---------- */
.fd-call {
  width: min(400px, 100%); margin-left: auto;
  background: var(--fd-bar); color: #fff; border-radius: 18px; padding: 16px 18px 18px;
  box-shadow: 0 16px 44px rgba(10, 20, 20, .35); display: grid; gap: 12px;
}
.fd-call-head { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.fd-call-head .fd-live { width: 9px; height: 9px; border-radius: 50%; background: #62C1B4; }
.fd-call-head .fd-live.connecting { background: #E0B34E; }
.fd-call-head .fd-timer { margin-left: auto; font: 500 13px var(--fd-mono); color: rgba(255, 255, 255, .75); }
.fd-wave { display: inline-flex; gap: 3px; align-items: center; height: 18px; margin-left: 4px; }
.fd-wave i { width: 3px; border-radius: 2px; background: #62C1B4; height: 4px; transition: height .12s; }
.fd-call.speaking .fd-wave i { animation: fd-wave 0.9s ease-in-out infinite; }
.fd-wave i:nth-child(2) { animation-delay: .1s !important; } .fd-wave i:nth-child(3) { animation-delay: .25s !important; }
.fd-wave i:nth-child(4) { animation-delay: .05s !important; } .fd-wave i:nth-child(5) { animation-delay: .3s !important; }
.fd-wave i:nth-child(6) { animation-delay: .15s !important; }
@keyframes fd-wave { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@media (prefers-reduced-motion: reduce) { .fd-call.speaking .fd-wave i { animation: none; height: 16px; } }
.fd-chat { display: grid; gap: 8px; align-content: start; max-height: min(340px, 42vh); min-height: 120px; overflow-y: auto; padding-right: 4px; }
.fd-msg { padding: 8px 12px; border-radius: 12px; max-width: 88%; font-size: 14px; line-height: 1.4; }
.fd-msg.agent { background: rgba(255, 255, 255, .1); justify-self: start; }
.fd-msg.user { background: #2F6E6A; justify-self: end; }
.fd-compose { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.fd-compose input { min-width: 0; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #fff; padding: 10px 14px; font: inherit; }
.fd-compose button { border-radius: 999px; border: 0; background: #62C1B4; color: var(--fd-bar); font-weight: 700; padding: 0 16px; }
.fd-compose input:disabled, .fd-compose button:disabled { opacity: .55; cursor: wait; }
.fd-call-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fd-call-actions button { padding: 12px; border-radius: 999px; font-weight: 600; font-size: 15px; }
.fd-mute { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.fd-mute[aria-pressed="true"] { background: rgba(255, 255, 255, .14); }
.fd-end { background: var(--fd-red); color: #fff; border: 0; }
.fd-ended { display: grid; gap: 10px; }
.fd-ended p { margin: 0; color: rgba(255, 255, 255, .85); }
.fd-ended button { justify-self: start; padding: 10px 16px; border-radius: 999px; border: 0; background: #fff; color: var(--fd-bar); font-weight: 600; }

/* ---------- behind-the-scenes panel ---------- */
.fd-panel {
  position: fixed; top: var(--fd-bar-h); right: 0; bottom: 0; z-index: 81; width: min(var(--fd-panel-w), 100vw);
  background: var(--fd-panel); border-left: 1px solid var(--fd-line); display: flex; flex-direction: column;
}
@media (max-width: 1099px) {
  .fd-panel { box-shadow: -12px 0 40px rgba(20, 38, 45, .2); z-index: 86; }
  .fd-panel:not(.fd-sheet-open) { display: none; }
}
.fd-panel-tab {
  position: fixed; right: 0; top: calc(var(--fd-bar-h) + 90px); z-index: 81; writing-mode: vertical-rl; transform: rotate(180deg);
  padding: 14px 8px; border: 0; border-radius: 0 10px 10px 0; background: var(--fd-teal); color: #fff; font-weight: 600; font-size: 13px;
}
@media (min-width: 1100px) { .fd-panel-tab { display: none; } }
.fd-panel-head { padding: 20px 24px 10px; display: flex; align-items: center; gap: 12px; }
.fd-panel-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fd-muted); }
.fd-panel-head .fd-state { margin-left: auto; font-size: 13px; color: var(--fd-muted); }
.fd-panel-head .fd-state.live { color: var(--fd-teal); font-weight: 600; }
.fd-panel-close { background: none; border: 0; font-size: 18px; color: var(--fd-muted); }
@media (min-width: 1100px) { .fd-panel-close { display: none; } }
.fd-legend { padding: 0 24px 8px; display: flex; gap: 14px; font-size: 12.5px; color: var(--fd-muted); align-items: center; }
.fd-legend span { display: inline-flex; gap: 6px; align-items: center; }
.fd-legend .fd-chip { min-width: 0; padding: 2px 7px; font-size: 11px; }
.fd-steps { list-style: none; margin: 0; padding: 6px 24px 20px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.fd-step { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start; }
.fd-step.pending { opacity: .45; }
.fd-step h3 { margin: 1px 0 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.fd-step h3 small { font-weight: 500; color: var(--fd-muted); font-size: 13px; }
.fd-step .fd-detail { margin-top: 4px; color: var(--fd-muted); font-size: 13.5px; display: grid; gap: 6px; }
.fd-step.error h3 { color: var(--fd-red); }
.fd-kv { display: grid; grid-template-columns: 110px 1fr; gap: 3px 12px; font-size: 13.5px; }
.fd-kv dt { color: var(--fd-muted); }
.fd-kv dd { margin: 0; color: var(--fd-ink); font-variant-numeric: tabular-nums; }
.fd-raw summary { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--fd-line); background: var(--fd-surface); color: var(--fd-ink); font-weight: 600; font-size: 12.5px; cursor: pointer; list-style: none; }
.fd-raw pre { margin: 8px 0 0; max-height: 260px; overflow: auto; background: var(--fd-surface); border: 1px solid var(--fd-line); border-radius: 8px; padding: 10px; font: 11.5px/1.5 var(--fd-mono); color: var(--fd-ink); white-space: pre; }
.fd-panel-foot { padding: 14px 24px 18px; font-size: 12.5px; color: var(--fd-muted); border-top: 1px solid var(--fd-line-soft); }
.fd-panel-empty { color: var(--fd-muted); font-size: 14px; padding: 4px 0; }

/* ---------- the patient card (drawer step 2 and in-call dock) ---------- */
.fd-drawer-head.nav { display: flex; align-items: center; gap: 16px; padding-bottom: 4px; }
.fd-drawer-head.nav .fd-close { margin-left: auto; }
.fd-root .fd-back { background: none; border: 0; padding: 8px 0; color: var(--fd-teal); font-weight: 600; font-size: 14px; }
.fd-back:disabled { opacity: .5; }
.fd-drawer-body.fd-pc { gap: 14px; padding-top: 6px; padding-bottom: 20px; }
.fd-pc-name { margin: -8px 0 0; font: 500 32px/1.1 var(--fd-serif); letter-spacing: -.01em; color: var(--fd-ink); }
.fd-root .fd-copy { flex: none; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--fd-line); background: var(--fd-surface); color: var(--fd-teal); }
.fd-drawer-foot { padding: 14px 24px 18px; border-top: 1px solid var(--fd-line-soft); background: var(--fd-bg); display: grid; gap: 6px; }
.fd-btn.big { width: 100%; padding: 15px 20px; font-size: 16.5px; }
.fd-root .fd-link { justify-self: center; background: none; border: 0; padding: 6px; color: var(--fd-teal); font-weight: 600; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }
.fd-link:disabled { opacity: .5; }
.fd-drawer-foot .fd-note { text-align: center; line-height: 1.5; }
.fd-history { color: var(--fd-faint); }

/* in-call dock variant */
.fd-p-body { overflow-y: auto; padding: 2px 18px 16px; display: grid; gap: 12px; }

/* ---------- movable cards ---------- */
.fd-root [data-drag] { cursor: grab; user-select: none; touch-action: none; }
html.fd-dragging, html.fd-dragging * { cursor: grabbing !important; user-select: none !important; }
.fd-floating { position: fixed; z-index: 87; margin: 0; }
.fd-call-head::after, .fd-p-head::before {
  content: ""; width: 14px; height: 14px; flex: none; opacity: .5;
  background: radial-gradient(circle, currentColor 1.2px, transparent 1.6px) 0 0 / 5px 5px;
}
.fd-p-head::before { order: -1; align-self: center; color: var(--fd-muted); }
.fd-call-head::after { order: 99; color: #fff; }
@media (max-width: 900px) { .fd-call-head::after, .fd-p-head::before { display: none; } .fd-root [data-drag] { cursor: auto; } }

/* ---------- call card chat ---------- */
.fd-chat-empty { margin: 0; color: rgba(255, 255, 255, .7); font-size: 14.5px; }
.fd-msg.system { justify-self: start; background: transparent; color: rgba(255, 255, 255, .72); font-size: 13.5px; padding: 2px 4px; display: flex; align-items: center; gap: 8px; }
.fd-dots { display: inline-flex; gap: 3px; }
.fd-dots i { width: 5px; height: 5px; border-radius: 50%; background: #62C1B4; animation: fd-dot 1.2s infinite ease-in-out; }
.fd-dots i:nth-child(2) { animation-delay: .15s; } .fd-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes fd-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.fd-ended { padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, .12); }

/* ---------- live panel step (insurer check in progress) ---------- */
.fd-step.live .fd-chip { animation: fd-pulse 1.1s ease-in-out infinite; }
.fd-step.live h3 { color: var(--fd-teal); }
@keyframes fd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .fd-step.live .fd-chip, .fd-dots i { animation: none; } }

/* ---------- patient card v3: three parts, one insurance card ---------- */
.fd-pc-k { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--fd-muted); margin-bottom: 4px; }
.fd-pc-why { margin: 0; font-size: 16px; line-height: 1.5; color: var(--fd-ink); }
.fd-ins {
  padding: 14px 16px 12px; border-radius: 14px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F2F6F5 100%); border: 1px solid var(--fd-line);
  box-shadow: 0 2px 12px rgba(20, 38, 45, .06);
}
.fd-ins.none { background: var(--fd-surface); box-shadow: none; }
.fd-ins-top { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; color: #2A4E8A; text-transform: uppercase; margin-bottom: 8px; }
.fd-ins.none .fd-ins-top { color: var(--fd-muted); }
.fd-ins-rows { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; align-items: center; }
.fd-ins-rows dt { font-size: 13px; color: var(--fd-muted); }
.fd-ins-rows dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; font-weight: 600; color: var(--fd-ink); min-width: 0; }
.fd-ins-rows dd em { display: block; font-style: normal; font-weight: 500; font-size: 13px; color: var(--fd-muted); margin-top: 1px; }
.fd-ins-rows dt { align-self: start; padding-top: 3px; }
.fd-ins-num { font: 600 20px/1.2 var(--fd-mono); letter-spacing: .03em; }
.fd-ins-lines { margin-top: 8px; font-size: 12.5px; color: var(--fd-muted); }
.fd-pc-block { display: block; }
.fd-pc-story ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 15px; line-height: 1.4; }
.fd-pc-else { margin: 6px 0 0; font-size: 13px; color: var(--fd-muted); line-height: 1.4; }
.fd-drawer-body.fd-pc, .fd-p-body { gap: 16px; }

/* ---------- results sheet ---------- */
.fd-sheet-scrim { position: fixed; inset: var(--fd-bar-h) 0 0 0; z-index: 94; background: rgba(27, 38, 38, .45); }
.fd-sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 95;
  width: min(1160px, 100vw); max-height: calc(100vh - var(--fd-bar-h) - 24px); max-height: calc(100dvh - var(--fd-bar-h) - 24px); overflow-y: auto;
  background: var(--fd-bg); border-radius: 22px 22px 0 0; box-shadow: 0 -12px 50px rgba(10, 20, 20, .28);
  padding: 10px clamp(16px, 3vw, 32px) 28px; display: grid; gap: 16px; align-content: start;
  animation: fd-sheet-in .28s var(--fd-ease);
}
@keyframes fd-sheet-in { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fd-sheet { animation: none; } }
.fd-sheet-grip { width: 48px; height: 5px; border-radius: 3px; background: var(--fd-line); justify-self: center; }
.fd-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fd-sheet-head h2 { margin: 4px 0 0; font: 500 clamp(28px, 3.4vw, 38px)/1.1 var(--fd-serif); color: var(--fd-ink); letter-spacing: -.01em; }
.fd-sheet-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fd-sheet-badges .fd-sheet-meta { margin-right: auto; }
.fd-badge { padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.fd-badge.ok { background: var(--fd-teal); color: #fff; }
.fd-badge.bad { background: var(--fd-red); color: #fff; }
.fd-badge.soft { background: var(--fd-teal-soft); color: var(--fd-teal); }
.fd-badge.warn { background: var(--fd-amber-soft); color: var(--fd-amber); }
.fd-sheet-meta { font-size: 13px; color: var(--fd-muted); }
.fd-sheet-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fd-sheet-grid.notes { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .fd-sheet-grid, .fd-sheet-grid.notes { grid-template-columns: 1fr; } }
.fd-sheet-col { display: grid; gap: 16px; }
.fd-sheet-card { background: var(--fd-surface); border: 1px solid var(--fd-line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.fd-sheet-card header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fd-sheet-card header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.fd-sheet-card header .fd-sheet-meta { margin-left: auto; }
.fd-sheet-card .fd-chip { min-width: 0; }
.fd-table-wrap { overflow-x: auto; }
.fd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fd-table th, .fd-table td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--fd-line-soft); vertical-align: middle; }
.fd-table thead th { border-top: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fd-muted); background: var(--fd-bg); }
.fd-table tbody th { font-weight: 600; white-space: nowrap; }
.fd-table tr.excluded td, .fd-table tr.excluded th { color: var(--fd-faint); }
.fd-res { font-weight: 700; white-space: nowrap; }
.fd-res.ok { color: var(--fd-teal); }
.fd-res.bad { color: var(--fd-red); }
.fd-res.na { color: var(--fd-faint); font-weight: 500; }
.fd-res em { font-style: normal; font-size: 12.5px; color: var(--fd-amber); }
.fd-said { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fd-muted); white-space: nowrap; cursor: pointer; }
.fd-said input { accent-color: var(--fd-teal); }
.fd-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-check { padding: 5px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 500; }
.fd-check.ok { background: var(--fd-teal-soft); color: var(--fd-teal); }
.fd-check.bad { background: #F6E0DB; color: var(--fd-red); }
.fd-check.warn { background: var(--fd-amber-soft); color: var(--fd-amber); }
.fd-check em { font-style: normal; opacity: .75; }
.fd-fail-note { margin: 0; font-size: 13.5px; color: var(--fd-red); }
.fd-sheet-empty { margin: 0; color: var(--fd-muted); font-size: 14px; }
.fd-sheet-note { border-radius: 14px; padding: 14px 16px; }
.fd-sheet-note.why { background: var(--fd-teal-soft); }
.fd-sheet-note.staff { background: var(--fd-surface); border: 1px solid var(--fd-line); }
.fd-sheet-note h4 { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fd-muted); }
.fd-sheet-note p { margin: 0; font-size: 15px; line-height: 1.5; }
.fd-transcript p { margin: 0; font-size: 14px; line-height: 1.45; }
.fd-transcript p.agent b { color: var(--fd-teal); }
.fd-sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.fd-sheet-actions .fd-sheet-foot { margin: 0 0 0 auto; font-size: 12.5px; color: var(--fd-muted); max-width: 46ch; }
.fd-sheet-wait { margin: 8px 0 16px; display: flex; align-items: center; gap: 10px; color: var(--fd-muted); font-size: 15px; }
.fd-ended-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fd-root .fd-link-light { background: none; border: 0; color: rgba(255, 255, 255, .85); text-decoration: underline; padding: 6px 2px; font-weight: 600; }
.fd-table tr.f-member_id td, .fd-table tr.f-dob td { white-space: nowrap; }

/* ---------- first-visit welcome ---------- */
.fd-welcome-scrim { position: fixed; inset: 0; z-index: 95; background: rgba(27, 38, 38, .5); }
.fd-welcome {
  position: fixed; z-index: 96; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 30px 30px 22px; border-radius: 20px; background: var(--fd-bg); color: var(--fd-ink);
  font-family: var(--fd-sans); box-shadow: 0 24px 80px rgba(20, 38, 45, .35);
}
.fd-welcome .fd-close { position: absolute; top: 12px; right: 12px; }
.fd-welcome-eyebrow { margin: 0 0 6px; color: var(--fd-teal); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.fd-welcome h2 { margin: 0 0 10px; font: 500 32px/1.1 var(--fd-serif); }
.fd-welcome p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.55; color: var(--fd-muted); }
.fd-welcome .fd-welcome-note { font-size: 13.5px; }
.fd-welcome-actions { display: grid; gap: 8px; margin: 18px 0 10px; }
.fd-welcome-actions .fd-btn { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; }
.fd-welcome-actions .fd-btn:not(.primary) { background: #fff; color: var(--fd-teal); border: 1.5px solid var(--fd-line); }
.fd-welcome-actions .fd-btn:not(.primary):hover { border-color: var(--fd-teal); }
.fd-btn span { font-size: 12.5px; font-weight: 500; opacity: .85; }
.fd-welcome > .fd-link { display: block; margin: 4px auto 0; }

/* ---------- patient list and call modes ---------- */
.fd-persona.start { border-color: var(--fd-teal); box-shadow: 0 0 0 1px var(--fd-teal) inset; }
.fd-start { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--fd-teal); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.fd-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fd-modes .fd-btn { display: flex; flex-direction: column; align-items: center; padding: 12px 10px; }
.fd-modes .fd-btn:not(.primary) { background: #fff; color: var(--fd-teal); border: 1.5px solid var(--fd-teal); }

/* ---------- results sheet summary and actions ---------- */
.fd-sheet-summary { margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; font-size: 16px; line-height: 1.45; }
.fd-sheet-summary.ok { background: #E3F0E8; color: #1E5A3C; }
.fd-sheet-summary.bad { background: var(--fd-amber-soft); color: var(--fd-amber); }
.fd-sheet-actions a.fd-btn { text-decoration: none; background: #fff; color: var(--fd-teal); border: 1.5px solid var(--fd-teal); display: inline-block; }

/* ---------- focus during a call ----------
   The practice site is dimmed and blurred behind the call, and stops
   scrolling, so only the patient card and the conversation compete for
   attention. The demo bar and the behind-the-scenes panel stay above it. */
html.fd-in-call body { overflow: hidden; }
.fd-focus {
  position: fixed; inset: var(--fd-bar-h) 0 0 0; z-index: 79;
  background: rgba(27, 38, 38, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* Desktop: the two cards side by side, centered in the space left of the panel. */
@media (min-width: 901px) {
  html.fd-in-call .fd-dock {
    top: calc(var(--fd-bar-h) + 24px); bottom: 24px; left: 24px; right: 24px;
    flex-wrap: nowrap; align-items: center; justify-content: center; gap: 24px;
  }
  html.fd-in-call.fd-panel-open .fd-dock { right: calc(var(--fd-panel-w) + 24px); }
  .fd-dock .fd-patient { flex: 0 1 400px; min-width: 0; max-height: 100%; }
  .fd-dock .fd-call { flex: 0 1 440px; min-width: 0; margin-left: 0; max-height: 100%; }
  .fd-dock .fd-chat { max-height: min(460px, 52vh); }
}
@media (min-width: 901px) and (max-width: 1099px) { html.fd-in-call.fd-panel-open .fd-dock { right: 24px; } }
/* With the panel docked, under 1280px there's no room side by side: card above the conversation. */
@media (min-width: 1100px) and (max-width: 1279px) {
  html.fd-in-call.fd-panel-open .fd-dock { flex-direction: column; gap: 12px; }
  html.fd-in-call.fd-panel-open .fd-dock .fd-patient { flex: none; width: min(520px, 100%); max-height: 45%; }
  html.fd-in-call.fd-panel-open .fd-dock .fd-call { flex: 0 1 auto; width: min(520px, 100%); min-height: 0; display: flex; flex-direction: column; }
  html.fd-in-call.fd-panel-open .fd-dock .fd-chat { flex: 1 1 auto; max-height: none; min-height: 80px; }
}

/* ---------- phones and tablets: the call takes the whole screen ----------
   Patient card on top (capped, scrolls on its own), conversation below it
   filling the rest, controls at the bottom. Sized to the visible viewport
   (--fd-vv-*, set by demo-layer.js) so the keyboard never covers the
   message box. */
.fd-root .fd-scenes { display: none; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); font-size: 13.5px; line-height: 1.2; }
@media (max-width: 900px) {
  html.fd-in-call .fd-dock {
    left: 0; right: 0; bottom: auto;
    padding-inline: max(8px, calc((100% - 600px) / 2));
    top: max(var(--fd-bar-h), var(--fd-vv-top, 0px));
    height: calc(100vh - var(--fd-bar-h));
    height: calc(var(--fd-vv-top, 0px) + var(--fd-vv-h, 100dvh) - max(var(--fd-bar-h), var(--fd-vv-top, 0px)));
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start;
    gap: 8px; padding-block: 8px; background: var(--fd-bg);
  }
  .fd-dock .fd-patient, .fd-dock .fd-patient.min { width: 100%; max-height: 45%; flex: none; box-shadow: none; border-radius: 14px; font-size: 14px; }
  html.fd-kb .fd-dock .fd-patient { max-height: 30%; }
  .fd-dock .fd-p-head { padding: 10px 14px 6px; align-items: center; }
  .fd-dock .fd-p-head h2 { font-size: 19px; }
  .fd-dock .fd-patient.min .fd-p-head h2 { font-size: 17px; }
  .fd-dock .fd-p-strip { padding: 0 14px 10px; font-size: 14px; }
  .fd-dock .fd-p-body { padding: 0 14px 12px; gap: 10px; min-height: 0; }
  .fd-dock .fd-pc-why { font-size: 14.5px; line-height: 1.4; }
  .fd-dock .fd-ins { padding: 10px 12px; }
  .fd-dock .fd-ins-top { margin-bottom: 6px; }
  .fd-dock .fd-ins-rows { gap: 4px 12px; }
  .fd-dock .fd-ins-rows dd { font-size: 15px; }
  .fd-dock .fd-ins-num { font-size: 17px; }
  .fd-dock .fd-pc-story ul { font-size: 14px; }

  .fd-dock .fd-call { width: 100%; margin: 0; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border-radius: 14px; box-shadow: none; }
  .fd-dock .fd-chat { flex: 1 1 auto; max-height: none; min-height: 60px; }
  .fd-compose input { font-size: 16px; } /* under 16px, iOS zooms in on focus */
  /* Behind the scenes sizes to its label (one line); the rest share what's left. */
  .fd-call-actions { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
  html.fd-panel-open .fd-call-actions { grid-template-columns: auto; }
  .fd-dock .fd-call-actions button { padding: 12px 10px; white-space: nowrap; }
  .fd-call-actions .fd-spacer { display: none; }
  /* Typing: give the chat the room; the header and End chat come back when the keyboard closes. */
  html.fd-kb .fd-call-actions, html.fd-kb .fd-dock .fd-call-head { display: none; }
  html.fd-kb .fd-dock .fd-call { padding: 10px 12px; }
  html.fd-kb .fd-dock .fd-chat { min-height: 48px; }
  html.fd-panel-open .fd-root .fd-scenes { display: block; }
  .fd-ended-actions .fd-scenes { padding: 8px 14px; border-radius: 999px; }
  .fd-panel-tab { display: none; }
}
