#patient-preview { background: #edf6f8; scroll-margin-top: 88px; }
#patient-preview .app-preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr); align-items: center; gap: clamp(28px, 6vw, 96px); }
.app-preview-copy p { max-width: 46ch; }
.app-preview-controls, .app-chat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.app-preview-controls { margin: 24px 0 18px; }
.app-preview-tab { min-height: 42px; padding: 6px 13px; border-radius: 9px; border: 1px solid #becfda; background: #fff; color: #153454; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.app-preview-tab:hover, .app-preview-tab[aria-pressed="true"] { background: #d8f0ea; border-color: #428d80; color: #064c45; }
.app-preview-figure { margin: 0; text-align: center; }
.app-preview-figure figcaption { color: #4a6276; font-size: 13px; margin-top: 12px; }
.app-phone { width: min(100%, 319px); margin-inline: auto; padding: 9px; border: 1px solid #465669; border-radius: 36px; background: #10253b; box-shadow: 0 16px 40px #10253b30; }
.app-phone-screen { height: clamp(390px, 62vw, 565px); overflow: auto; overscroll-behavior-y: contain; background: #f5f5f5; border-radius: 27px; scrollbar-width: thin; }
.app-phone-screen img { display: block; width: 100%; height: auto; }
.app-phone-screen img[hidden] { display: none; }
.app-preview-chat { max-width: 710px; margin: 40px auto 0; padding: clamp(16px, 3vw, 25px); border: 1px solid #cadce6; border-radius: 17px; background: #fff; scroll-margin-top: 92px; }
.app-preview-chat p { margin: 7px 0 0; }
.app-preview-chat [hidden] { display: none; }
.app-chat-header { display: flex; gap: 12px; align-items: center; }
.app-chat-header img { object-fit: contain; }
.app-chat-header h3 { margin: 0; font-size: 22px; }
.app-chat-header p, .app-preview-chat [data-chat-offline] { margin-top: 3px; font-size: 14px; }
.app-preview-chat [data-chat-offline] { margin-top: 13px; }
.app-preview-chat [data-chat-offline] a { color: #005e59; font-weight: 700; }
.app-preview-chat [data-chat-offline] svg { width: 15px; height: 15px; vertical-align: middle; }
.app-chat-log { display: grid; gap: 9px; min-height: 72px; max-height: 270px; overflow: auto; padding: 12px; margin: 13px 0; border-radius: 9px; background: #edf4f8; }
.app-chat-bubble { justify-self: start; max-width: 92%; padding: 8px 12px; background: #fff; border-radius: 9px; overflow-wrap: anywhere; font-size: 14px; }
.app-chat-bubble.user { justify-self: end; background: #dff1ec; }
.app-chat-bubble p { white-space: pre-wrap; }
.app-chat-form { display: grid; gap: 7px; }
.app-chat-form label { font-weight: 650; font-size: 14px; }
.app-chat-form textarea { width: 100%; padding: 8px 11px; border: 1px solid #9cb3c1; border-radius: 8px; color: #153454; font: inherit; resize: vertical; }
.app-chat-form button[disabled] { opacity: .62; }
.app-chat-status { font-size: 13px; color: #21516b; }
.app-chat-status[data-error="true"] { color: #9c262d; }
.app-chat-status:empty { display: none; }
#patient-preview :is(a, button, textarea, [tabindex]):focus-visible { outline: 3px solid #167aab; outline-offset: 3px; }
@media (max-width: 730px) {
  #patient-preview .app-preview-grid { grid-template-columns: 1fr; gap: 28px; }
  .app-phone { width: min(100%, 295px); }
  .app-phone-screen { height: clamp(385px, 112vw, 505px); }
}
