/* Compact layout for the current ClinicChat release; clinic tokens stay authoritative. */
@media (max-width: 767px) {
  .portal-content:has(.clinic-chat-wrap) { padding: 8px 10px 6px !important; }
  .portal-content > .mx-auto > section:has(> .clinic-chat-wrap) {
    display: flex; flex-direction: column; gap: 6px;
    height: calc(100dvh - 14px); min-height: 0;
  }
  .portal-content > .mx-auto > section:has(> .clinic-chat-wrap) > header {
    display: flex; align-items: center; min-height: 44px;
    padding-left: 54px; flex: none;
  }
  .portal-content > .mx-auto > section:has(> .clinic-chat-wrap) > header > p { display: none; }
  .portal-content > .mx-auto > section:has(> .clinic-chat-wrap) > header > h1 {
    margin: 0; font-size: 20px !important; line-height: 1.3;
  }
  .portal-content > .mx-auto > section:has(> .clinic-chat-wrap) + div { display: none; }
  .portal-content .clinic-chat-wrap { margin-top: 0 !important; flex: 1 1 0; min-height: 0; display: flex; }
  .portal-content .clinic-chat-wrap .clinic-chat:not(.is-expanded) { height: 100% !important; max-height: 100%; min-height: 0 !important; }
  .portal-content .clinic-chat-wrap .cc-main { padding: 6px 10px max(4px, env(safe-area-inset-bottom)); }
  .portal-content .clinic-chat-wrap .cc-header,
  .portal-content .clinic-chat-wrap .cc-header:has(.cc-expand-chat) {
    grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px; padding-bottom: 4px;
  }
  .portal-content .clinic-chat-wrap .cc-assistant-mark,
  .portal-content .clinic-chat-wrap .cc-provider-state { display: none; }
  .portal-content .clinic-chat-wrap .cc-heading { grid-area: 1 / 2; }
  .portal-content .clinic-chat-wrap .cc-heading h2 { font-size: 14px !important; line-height: 1.3; }
  .portal-content .clinic-chat-wrap .cc-expand-chat { grid-area: 1 / 3; min-height: 44px; }
  .portal-content .clinic-chat-wrap .cc-controls { gap: 6px; padding: 4px 0; align-items: stretch; }
  .portal-content .clinic-chat-wrap .cc-model-select { gap: 0; }
  .portal-content .clinic-chat-wrap .cc-model-select .cc-section-label,
  .portal-content .clinic-chat-wrap .cc-mobile-context-title { display: none; }
  .portal-content .clinic-chat-wrap .cc-model-select select,
  .portal-content .clinic-chat-wrap .cc-mobile-context summary { box-sizing: border-box; height: 44px; font-size: 12px; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-conversation { flex: 1 1 0; min-height: 0; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-compose-area { gap: 4px; padding-top: 4px; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-composer {
    display: grid; grid-template-columns: minmax(0, 1fr) 44px;
    align-items: end; gap: 6px; padding: 6px;
  }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-composer textarea {
    grid-area: 1 / 1; field-sizing: content; resize: none;
    min-height: 44px; max-height: 108px; padding: 10px 2px;
    font-size: 16px; line-height: 1.4; overflow-y: auto;
  }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-composer textarea:placeholder-shown { height: 44px; field-sizing: fixed; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-composer-bottom { display: contents; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-composer-hint { display: none; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-composer .cc-send-button {
    grid-area: 1 / 2; width: 44px; height: 44px; min-height: 44px;
    padding: 0; gap: 0; justify-content: center; position: relative;
  }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-composer .cc-send-button > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-status-line { font-size: 10px; line-height: 1.35; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message { max-width: 100%; width: 100%; gap: 0; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-avatar { display: none; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-body { min-width: 0; width: 100%; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-markdown { font-size: 14px; line-height: 1.5; }
}
