/* Messages page — dashboard patient conversations. */
.msgs { display: flex; flex-direction: column; }
.msgs__bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.msgs__search { position: relative; flex: 0 1 22rem; min-width: 12rem; }
.msgs__search svg { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); width: 1.05rem; height: 1.05rem; fill: none; stroke: #94a3b8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msgs__search input { width: 100%; padding: 0.6rem 0.8rem 0.6rem 2.4rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--surface); font: inherit; font-size: 0.9375rem; color: var(--ink); }
.msgs__search input:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(82,94,245,0.12); }
.msgs__tabs { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--surface); }
.msgs__tab { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border: 0; border-radius: 0.55rem; background: none; font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.msgs__tab.is-active { background: var(--ui-accent); color: #fff; }
.msgs__tabn { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 999px; background: var(--ui-accent); color: #fff; font-size: 0.75rem; font-weight: 700; }
.msgs__tab.is-active .msgs__tabn { background: rgba(255,255,255,0.28); color: #fff; }
.msgs__tabn--muted { background: #e2e8f0; color: var(--muted); }
.msgs__new { margin-left: auto; }

.msgs__grid { display: grid; grid-template-columns: 19.96rem minmax(0, 1fr) 22.08rem; gap: 1.1rem; height: calc(100vh - 12.5rem); min-height: 34rem; }
.msgs .card { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; display: flex; flex-direction: column; min-height: 0; }

.msgs__listhead { flex: none; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.msgs__convos { flex: 1 1 auto; overflow-y: auto; }
.msgs__empty { padding: 1.5rem 1rem; color: var(--muted); font-size: 0.875rem; text-align: center; }
.convo { display: flex; align-items: flex-start; gap: 0.7rem; width: 100%; padding: 0.85rem 1rem; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; transition: background-color 0.12s; }
.convo:hover { background: #f8fafc; }
.convo.is-active { background: color-mix(in srgb, var(--ui-accent) 8%, #fff); box-shadow: inset 3px 0 0 var(--ui-accent); }
.convo__mid { flex: 1 1 auto; min-width: 0; }
.convo__top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.convo__name { font-size: 0.9375rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo__time { flex: none; font-size: 0.75rem; color: #94a3b8; }
.convo__prev { margin-top: 0.15rem; font-size: 0.8125rem; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.convo__unread { flex: none; align-self: center; display: grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 0.35rem; border-radius: 999px; background: var(--ui-accent); color: #fff; font-size: 0.75rem; font-weight: 700; }

.mav { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; font-size: 0.8125rem; font-weight: 700; }
.mav--lg { width: 4rem; height: 4rem; font-size: 1.25rem; }

.thread__empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; color: var(--muted); }
.thread__emptyic { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: #eef2ff; }
.thread__emptyic svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: var(--ui-accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.thread__head { flex: none; display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.thread__who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.thread__who strong { font-size: 0.9375rem; color: var(--ink); }
.thread__who span { font-size: 0.75rem; color: var(--muted); }
.thread__view { display: inline-flex; align-items: center; gap: 0.3rem; border: 0; background: none; font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--ui-accent); cursor: pointer; }
.thread__view svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.thread__actions { flex: none; display: flex; align-items: center; gap: 0.6rem; }
.thread__outwrap { position: relative; }
.thread__outbtn { padding: 0.32rem 0.6rem; background: var(--surface); }
.thread__outwrap .status-menu { left: auto; right: 0; transform: none; min-width: 12rem; }
.thread__log { flex: 1 1 auto; overflow-y: auto; padding: 1.25rem 1.1rem; display: flex; flex-direction: column; gap: 0.9rem; background: #f8fafc; }
.thread__none { margin: auto; color: var(--muted); font-size: 0.875rem; }
/* Messaging off: the reason, where the invitation to write would have been. */
.thread__none--off { display: grid; gap: 0.35rem; max-width: 30rem; margin: auto;
  padding: 0.875rem 1rem; border: 1px solid var(--line); border-radius: 0.75rem;
  background: #f8fafc; text-align: left; line-height: 1.5; }
.thread__none--off strong { color: var(--ink); }
.thread__input:disabled, .thread__clip:disabled, .thread__send:disabled {
  opacity: 0.55; cursor: not-allowed; }
/* Avatar at the TOP of the bubble, not the bottom. The row also holds the timestamp under
   the text, so flex-end pushed the initials down past the message they belong to -- on a
   long message they ended up level with its last line. */
.mbub { display: flex; align-items: flex-start; gap: 0.55rem; max-width: 78%; }
.mbub--in { align-self: flex-start; }
.mbub--out { align-self: flex-end; }
.mbub__av { width: 2rem; height: 2rem; font-size: 0.6875rem; }
.mbub__av--clinic { background: var(--ui-accent); color: #fff; }
.mbub__body { min-width: 0; }
.mbub__text { padding: 0.6rem 0.85rem; border-radius: 1rem; font-size: 0.9375rem; line-height: 1.4; color: var(--ink); }
.mbub--in .mbub__text { background: #eef1f6; border-bottom-left-radius: 0.3rem; }
.mbub--out .mbub__text { background: color-mix(in srgb, var(--ui-accent) 14%, #fff); border-bottom-right-radius: 0.3rem; }
.mbub__time { display: block; margin-top: 0.25rem; font-size: 0.6875rem; color: #94a3b8; }
.mbub--out .mbub__time { text-align: right; }
.mbub__tick { width: 0.8rem; height: 0.8rem; vertical-align: -1px; fill: none; stroke: var(--ui-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mbub__seen { font-weight: 600; color: var(--ui-accent); }
.thread__bar { flex: none; display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.9rem; border-top: 1px solid var(--line); }
.thread__clip { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; background: none; color: #94a3b8; cursor: pointer; }
.thread__clip svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.thread__input { flex: 1 1 auto; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--surface); font: inherit; font-size: 0.9375rem; color: var(--ink); }
.thread__input:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(82,94,245,0.12); }
.thread__send { flex: none; }

/* Higher specificity than `.msgs .card { overflow: hidden }` so the taller lead panel scrolls
   internally instead of clipping. */
.msgs .msgs__details { overflow-y: auto; overscroll-behavior: contain; position: relative; }
.det__hero { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 1.5rem 1.1rem 1.25rem; border-bottom: 1px solid var(--line); text-align: center; }
.det__name { margin-top: 0.5rem; font-size: 1.0625rem; color: var(--ink); }
.det__contact { font-size: 0.875rem; color: var(--muted); }
.det__sec { padding: 1.1rem; border-bottom: 1px solid var(--line); }
.det__sec h4 { margin: 0 0 0.75rem; font-size: 0.9375rem; color: var(--ink); }
/* Wraps rather than squeezes. A value too long to sit beside its label -- two or three
   recommended treatments, say -- used to be crushed into whatever column was left, turning
   one row into five stacked lines. It now drops onto its own full-width line beneath the
   label, and short values still sit inline. */
.det__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; row-gap: 0.1rem; padding: 0.4rem 0; font-size: 0.875rem; }
.det__row > span { color: var(--muted); flex: none; }
.det__row b { color: var(--ink); font-weight: 600; flex: 0 1 auto; min-width: 0; }
.det__ctl { display: inline-flex; }
.det__select { border: 0; background: none; font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--ink); cursor: pointer; padding: 0.15rem 0.2rem; border-radius: 0.4rem; }
.det__select:hover { background: #f1f5f9; }
.det__notehead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.det__notehead h4 { margin: 0; }
.det__addnote { display: inline-flex; align-items: center; gap: 0.3rem; border: 0; background: none; font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--ui-accent); cursor: pointer; }
.det__addnote svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dnote { padding: 0.75rem 0.85rem; border-radius: 0.7rem; background: #f8fafc; border: 1px solid var(--line); margin-top: 0.5rem; }
.dnote p { margin: 0 0 0.4rem; font-size: 0.875rem; color: var(--ink); line-height: 1.4; }
.dnote span { font-size: 0.75rem; color: var(--muted); }
.dnote__empty { font-size: 0.8125rem; color: var(--muted); }
/* A consult version note (app/consult_versions.py): written by the system, not deletable, its
   facts on hover. Set apart from a typed note by the tag and the accent edge. */
.dnote--version { background: #eef2ff; border-color: #c7d2fe; border-left: 3px solid #6366f1; cursor: help; }
.dnote--version .dnote__tag { display: inline-block; margin-bottom: 0.3rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: #4338ca; }
/* Delete, tucked into the note's top-right. Faint until the note is hovered: a bin on every
   note, at full strength, reads as the primary thing to do with a note. */
.dnote { position: relative; }
.dnote__del { position: absolute; top: 0.45rem; right: 0.45rem; width: 1.4rem; height: 1.4rem;
  display: grid; place-items: center; border: 0; border-radius: 0.35rem; background: none;
  color: var(--muted); cursor: pointer; opacity: 0; transition: opacity 0.12s, color 0.12s; }
.dnote:hover .dnote__del, .dnote__del:focus-visible { opacity: 1; }
.dnote__del:hover { color: var(--danger); background: #fef2f2; }
.dnote__del svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dnote p { padding-right: 1.4rem; }

/* --- lead detail panel (rebuilt side panel) --- */
.det__actions { position: relative; display: flex; justify-content: flex-end; padding: 0.6rem 0.65rem 0; }
.det__outbtn { width: auto; padding: 0.32rem 0.6rem; background: var(--surface); }
.det__actions .status-menu { left: auto; right: 0.65rem; transform: none; min-width: 12rem; }
.det__id { position: relative; padding-top: calc(0.4rem + 50px); }
.det__concern { margin: 0; padding: 0.7rem 0.85rem; border-radius: 0.7rem; background: #f5f3ff; border: 1px solid var(--line); font-size: 0.875rem; color: var(--ink); line-height: 1.45; }
.det__photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.det__photo { padding: 0; border: 0; border-radius: 0.6rem; overflow: hidden; background: #eef1f6; cursor: zoom-in; aspect-ratio: 4 / 3; }
.det__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.12s; }
.det__photo:hover img { opacity: 0.86; }
.det__viewsub { display: flex; width: calc(100% - 2.2rem); margin: 1.1rem; justify-content: center; }

.msgmodal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1.5rem; background: rgba(15,23,42,0.5); }
.msgmodal__panel { width: min(30rem, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 1rem; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.3); }
.msgmodal__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.msgmodal__head h3 { margin: 0; font-size: 1rem; }
.msgmodal__search { position: relative; margin: 0.9rem 1.1rem; }
.msgmodal__search svg { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); width: 1.05rem; height: 1.05rem; fill: none; stroke: #94a3b8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msgmodal__search input { width: 100%; padding: 0.6rem 0.8rem 0.6rem 2.4rem; border: 1px solid var(--line); border-radius: 0.7rem; font: inherit; font-size: 0.9375rem; }
.msgmodal__list { flex: 1 1 auto; overflow-y: auto; padding: 0 0.6rem 0.8rem; }
.msgmodal__row { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.6rem 0.6rem; border: 0; border-radius: 0.6rem; background: none; text-align: left; cursor: pointer; }
.msgmodal__row:hover { background: #f1f5f9; }
.msgmodal__row strong { display: block; font-size: 0.9375rem; color: var(--ink); }
.msgmodal__row span { display: block; font-size: 0.8125rem; color: var(--muted); }
.msgmodal__empty { padding: 1.5rem; text-align: center; color: var(--muted); font-size: 0.875rem; }

/* Match the standard dashboard save-button size (not the oversized default .btn). */
.msgs__new, .thread__send { padding: 0.5625rem 1.125rem; font-size: 0.9375rem; }
/* Details-panel "View submission" — pinned to the top-right of the patient info panel.
   Size + stroke the icon so it doesn't render as a giant filled square, and keep the
   label on one line. */
.det__view { position: absolute; top: 0.7rem; right: 1.1rem; display: inline-flex; align-items: center; gap: 0.3rem; border: 0; background: none; font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--ui-accent); cursor: pointer; white-space: nowrap; }
.det__view svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Consult Preview (temporary testing page) */
.plnk.card { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.plnk__head, .plnk__row { display: grid; grid-template-columns: 1.4fr 2.4fr 0.8fr 1fr; gap: 1rem; align-items: center; padding: 0.85rem 1.1rem; }
.plnk__head { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.plnk__row { border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.plnk__row:last-child { border-bottom: 0; }
.plnk__patient { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.plnk__av { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #e0e7ff; color: #4338ca; font-size: 0.75rem; font-weight: 700; }
.plnk__name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plnk__link { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.plnk__link a { color: var(--ui-accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; }
.plnk__link a:hover { text-decoration: underline; }
.plnk__copy { flex: none; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border: 1px solid var(--line); border-radius: 0.4rem; background: #fff; color: var(--muted); cursor: pointer; }
.plnk__copy:hover { border-color: #cbd5e1; }
.plnk__copy.is-copied { border-color: #16a34a; color: #16a34a; }
.plnk__copy svg { width: 0.9rem; height: 0.9rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.plnk__time { color: var(--muted); }
.plnk__empty { padding: 1.5rem; color: var(--muted); font-size: 0.875rem; }
.plnk__note { margin: 0.75rem 0.25rem 0; font-size: 0.75rem; color: #94a3b8; }
.vst { display: inline-flex; align-items: center; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.vst--pending { background: #fef3c7; color: #b45309; }
.vst--rendering { background: #dbeafe; color: #1d4ed8; }
.vst--ready { background: #dcfce7; color: #15803d; }
.vst--failed { background: #fee2e2; color: #b91c1c; }

/* AI smile-sim strip inside a Consult-Preview row (spans all columns of the .plnk__row grid). */
.psim { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.45rem; padding-top: 0.65rem; border-top: 1px dashed var(--line); }
.psim--wait { color: var(--muted); font-size: 0.8rem; font-style: italic; }
.psim__label { align-self: center; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-right: 0.25rem; }
.psim__cell { display: block; text-decoration: none; border: 2px solid var(--line); border-radius: 0.6rem; overflow: hidden; background: #f1f5f9; width: 118px; }
.psim__cell img { width: 100%; height: 84px; object-fit: cover; display: block; }
.psim__cap { display: block; font-size: 0.68rem; font-weight: 600; color: var(--muted); text-align: center; padding: 0.2rem 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psim__cell--after.is-chosen { border-color: var(--ui-accent); }
.psim__cell--after.is-chosen .psim__cap { color: var(--ui-accent); background: #eef4ff; }
.psim__cell { cursor: zoom-in; }

/* Enlarged before/after viewer (lightbox) opened from a Consult-Preview strip. */
.pbox[hidden] { display: none; }
.pbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 3rem 4.5rem; }
.pbox__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.82); backdrop-filter: blur(2px); }
.pbox__fig { position: relative; z-index: 1; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; max-width: 100%; max-height: 100%; }
.pbox__img { max-width: min(760px, 90vw); max-height: 78vh; width: auto; height: auto; object-fit: contain; border-radius: 0.8rem; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); background: #0b1220; }
.pbox__cap { color: #fff; font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em; text-align: center; }
.pbox__cap .pbox__pick { color: #8ab4ff; }
.pbox__btn { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, 0.12); transition: background 0.15s ease; }
.pbox__btn:hover { background: rgba(255, 255, 255, 0.24); }
.pbox__nav { top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.8rem; line-height: 1; }
.pbox__prev { left: 1rem; }
.pbox__next { right: 1rem; }
.pbox__close { top: 1rem; right: 1rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.5rem; line-height: 1; }
body.pbox-open { overflow: hidden; }

/* ── Booking requests: the message panel ──
   The patient's thread over the queue, in the shape of the chat they see on their own plan
   page. No launcher of its own: "Message" on a request opens it, the X closes it for good. */
/* A fixed height, not a max: one message left the panel barely taller than its own header,
   and a long thread ran most of the screen. 85% of the old ceiling. */
.brqchat { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 300; display: flex;
  flex-direction: column; width: min(23.75rem, calc(100vw - 2rem)); height: min(61vh, 33rem);
  overflow: hidden; border: 1px solid var(--line); border-radius: 1.25rem; background: var(--surface);
  box-shadow: 0 1.5rem 3.5rem rgba(15, 23, 42, 0.22); }
.brqchat__head { display: flex; align-items: center; gap: 0.625rem; padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line); }
.brqchat__av { flex: none; }   /* colour comes from the stage class, like every other avatar */
.brqchat__who { min-width: 0; line-height: 1.25; }
.brqchat__who strong { display: block; font-size: 0.9375rem; color: var(--ink); }
.brqchat__x { margin-left: auto; width: 1.875rem; height: 1.875rem; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.brqchat__x:hover { background: #f1f5f9; color: var(--ink); }
.brqchat__log { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.625rem;
  padding: 1rem; overflow-y: auto; }
.brqchat__none { margin: auto; font-size: 0.8125rem; color: var(--muted); text-align: center; }
.brqchat__files { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: 0 0.75rem 0.5rem; }
.brqchat__bar { display: flex; align-items: center; gap: 0.375rem; padding: 0.75rem;
  border-top: 1px solid var(--line); }
.brqchat__clip { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem;
  border: 0; border-radius: 50%; background: none; color: #94a3b8; cursor: pointer; }
.brqchat__clip:hover { background: #f1f5f9; color: var(--ink-2); }
.brqchat__clip svg { width: 1.0625rem; height: 1.0625rem; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brqchat__input { flex: 1 1 auto; min-width: 0; padding: 0.625rem 0.875rem; border: 1px solid var(--line);
  border-radius: 999px; background: #f8fafc; font: inherit; font-size: 0.875rem; color: var(--ink); }
.brqchat__input:focus { outline: none; border-color: var(--ui-accent); background: var(--surface); }
.brqchat__send { flex: none; width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--ui-accent); color: #fff; cursor: pointer; }
.brqchat__send svg { width: 1.0625rem; height: 1.0625rem; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brqchat__send:hover { filter: brightness(0.95); }
@media (max-width: 640px) {
  .brqchat { right: 0.75rem; left: 0.75rem; bottom: 0.75rem; width: auto; height: 68vh; }
}

/* A consult version note (subdata.js noteHtml): a heading, one line, and on hover or focus a card
   with what that version told the patient. */
.dnote--version { cursor: default; outline: none; }
.dnote--version .dnote__head { margin: 0; font-weight: 600; }
.dnote--version .dnote__sub { margin: 0.125rem 0 0.4rem; font-size: 0.8125rem; color: var(--ink-2); }
.vpop { display: none; position: absolute; left: 0; top: calc(100% + 0.375rem); z-index: 30;
  width: max(100%, 24rem); max-width: 28rem; padding: 0.875rem 1rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 0.75rem; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); }
.dnote--version:hover .vpop, .dnote--version:focus .vpop, .dnote--version:focus-within .vpop { display: block; }
.vpop .vpop__title { margin: 0; font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.vpop .vpop__meta { margin: 0.125rem 0 0.625rem; font-size: 0.75rem; color: var(--muted); }
.vpop__rows { display: grid; grid-template-columns: auto 1fr; gap: 0.375rem 0.875rem; margin: 0; font-size: 0.8125rem; }
.vpop__rows dt { color: var(--muted); }
.vpop__rows dd { margin: 0; color: var(--ink); }
.vpop__line { display: flex; justify-content: space-between; gap: 0.75rem; }
.vpop__line + .vpop__line { margin-top: 0.1875rem; }
.vpop__line b { font-weight: 600; white-space: nowrap; }
.vpop .vpop__note { margin: 0.625rem 0 0; font-size: 0.75rem; color: var(--muted); }
.dnote .vpop span { font-size: inherit; color: inherit; }
