/* Existing starter actions appear only in an empty conversation. */
@media (max-width: 1023px) {
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-prompts {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-prompt-label { display: none; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-prompt-chip {
    min-height: 44px; white-space: normal; text-align: left;
    font-size: 12px; line-height: 1.35; padding: 6px 8px;
  }
}

/* Use the existing chat drawer and controls at tablet widths too.
   This targets the reviewed ClinicChat release; portal navigation is unchanged. */
@media (min-width: 768px) and (max-width: 1023px) {
.portal-content :where(.clinic-chat-wrap) .clinic-chat[data-v-f8f6ef21]{flex-direction:column;width:100%;max-height:100dvh;position:relative;overflow:hidden;height:calc(100dvh - 200px)!important;min-height:0!important;display:flex!important}.portal-content :where(.clinic-chat-wrap) .cc-sidebar-backdrop[data-v-f8f6ef21]{z-index:30;background:#08182670;border:0;width:100%;height:100%;display:block;position:absolute;inset:0}.portal-content :where(.clinic-chat-wrap) .cc-sidebar[data-v-f8f6ef21]{z-index:31;border:0;border-right:1px solid var(--cc-line);background:var(--cc-surface);visibility:hidden;flex-direction:column;width:min(86%,320px);height:100%;min-height:0;padding:12px;transition:transform .18s,visibility .18s;inset:0 auto 0 0;transform:translate(-105%);box-shadow:12px 0 32px #05233a2e;max-height:none!important;display:flex!important;position:absolute!important}.portal-content :where(.clinic-chat-wrap) .cc-sidebar.is-mobile-open[data-v-f8f6ef21]{visibility:visible;transform:translate(0)}.portal-content :where(.clinic-chat-wrap) .cc-side-head[data-v-f8f6ef21]{grid-area:auto;justify-content:space-between;align-items:center;min-height:42px;display:flex}.portal-content :where(.clinic-chat-wrap) .cc-side-head h2[data-v-f8f6ef21]{font-size:16px}.portal-content :where(.clinic-chat-wrap) .cc-side-head .cc-eyebrow[data-v-f8f6ef21],.portal-content :where(.clinic-chat-wrap) .cc-local-tag[data-v-f8f6ef21]{display:none}.portal-content :where(.clinic-chat-wrap) .cc-sidebar-close[data-v-f8f6ef21]{border:1px solid var(--cc-line);background:var(--cc-raised);width:44px;height:44px;color:var(--cc-ink);border-radius:2px;flex:0 0 44px;place-items:center;display:grid}.portal-content :where(.clinic-chat-wrap) .cc-sidebar-close svg[data-v-f8f6ef21],.portal-content :where(.clinic-chat-wrap) .cc-history-toggle svg[data-v-f8f6ef21]{fill:none;stroke:currentColor;stroke-width:1.7px;stroke-linecap:round;width:20px;height:20px}.portal-content :where(.clinic-chat-wrap) .cc-new-chat[data-v-f8f6ef21]{grid-area:auto;width:100%;min-height:44px;font-size:12px}.portal-content :where(.clinic-chat-wrap) .cc-search[data-v-f8f6ef21]{grid-area:auto;min-height:42px}.portal-content :where(.clinic-chat-wrap) .cc-chat-list[data-v-f8f6ef21]{flex-direction:column;flex:auto;grid-area:auto;min-height:0;overflow:auto;max-height:none!important}.portal-content :where(.clinic-chat-wrap) .cc-chat-entry[data-v-f8f6ef21]{flex:none;width:100%;min-width:0;max-width:none}.portal-content :where(.clinic-chat-wrap) .cc-chat-row[data-v-f8f6ef21]{flex:auto;align-items:center;width:auto;min-width:0;max-width:none;min-height:48px}.portal-content :where(.clinic-chat-wrap) .cc-chat-delete[data-v-f8f6ef21]{min-height:44px}.portal-content :where(.clinic-chat-wrap) .cc-sidebar-footer[data-v-f8f6ef21]{margin-top:auto;display:flex}.portal-content :where(.clinic-chat-wrap) .cc-main[data-v-f8f6ef21]{width:100%;height:100%;padding:10px 12px max(10px, env(safe-area-inset-bottom));flex-direction:column;flex:auto;gap:0;overflow:visible;min-height:0!important;display:flex!important}.portal-content :where(.clinic-chat-wrap) .cc-header[data-v-f8f6ef21]{flex:none;grid-template-columns:44px 34px minmax(0,1fr);align-items:center;gap:7px;padding:0 0 8px;display:grid}.portal-content :where(.clinic-chat-wrap) .cc-header[data-v-f8f6ef21]:has(.cc-expand-chat){grid-template-columns:44px 34px minmax(0,1fr) auto}.portal-content :where(.clinic-chat-wrap) .cc-expand-chat[data-v-f8f6ef21]{grid-area:1/4;min-height:44px;padding-inline:6px;font-size:10px}.portal-content :where(.clinic-chat-wrap) .cc-history-toggle[data-v-f8f6ef21]{border:1px solid var(--cc-line);background:var(--cc-raised);width:44px;height:44px;color:var(--cc-ink);border-radius:2px;grid-area:1/1;place-items:center;display:grid}.portal-content :where(.clinic-chat-wrap) .cc-assistant-mark[data-v-f8f6ef21]{flex-basis:34px;grid-area:1/2;width:34px;height:34px}.portal-content :where(.clinic-chat-wrap) .cc-assistant-mark img[data-v-f8f6ef21]{width:32px;height:32px}.portal-content :where(.clinic-chat-wrap) .cc-heading[data-v-f8f6ef21]{grid-area:1/3}.portal-content :where(.clinic-chat-wrap) .cc-heading .cc-eyebrow[data-v-f8f6ef21],.portal-content :where(.clinic-chat-wrap) .cc-heading p[data-v-f8f6ef21]{display:none}.portal-content :where(.clinic-chat-wrap) .cc-heading h2[data-v-f8f6ef21]{margin:0;font-size:16px;line-height:1.25}.portal-content :where(.clinic-chat-wrap) .cc-provider-state[data-v-f8f6ef21]{grid-area:2/1/auto/-1;width:max-content;max-width:100%;margin:0;padding:4px 7px}.portal-content :where(.clinic-chat-wrap) .cc-provider-state strong[data-v-f8f6ef21]{white-space:normal;font-size:11px}.portal-content :where(.clinic-chat-wrap) .cc-provider-state small[data-v-f8f6ef21]{display:none}.portal-content :where(.clinic-chat-wrap) .cc-controls[data-v-f8f6ef21]{flex:none;grid-template-columns:minmax(0,1.15fr) minmax(118px,.85fr);align-items:start;gap:7px;padding:8px 0 6px;display:grid;overflow:visible}.portal-content :where(.clinic-chat-wrap) .cc-reports-desktop[data-v-f8f6ef21]{display:none}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context[data-v-f8f6ef21]{min-width:0;display:block;position:relative}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context summary[data-v-f8f6ef21]{border:1px solid rgb(var(--cc-cyan) / .3);background:var(--cc-raised);min-height:44px;color:var(--cc-ink);cursor:pointer;align-items:center;gap:6px;padding:5px 8px;list-style:none;display:flex}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context summary[data-v-f8f6ef21]::-webkit-details-marker{display:none}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context summary[data-v-f8f6ef21]:after{content:"";border-bottom:1.5px solid;border-right:1.5px solid;width:8px;height:8px;margin-left:auto;transform:rotate(45deg)translateY(-2px)}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context[open] summary[data-v-f8f6ef21]:after{transform:rotate(225deg)translate(-2px,-1px)}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context-title[data-v-f8f6ef21]{color:var(--cc-muted);flex:none;font-size:11px}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context summary strong[data-v-f8f6ef21]{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:12px;overflow:hidden}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context-count[data-v-f8f6ef21]{color:var(--cc-muted);flex:none;font-size:11px}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context fieldset[data-v-f8f6ef21]{z-index:12;border:1px solid var(--cc-line);background:var(--cc-surface);gap:2px;max-height:min(45dvh,320px);margin:0;padding:8px;display:grid;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow:auto;box-shadow:0 10px 28px #05233a33}.portal-content :where(.clinic-chat-wrap) .cc-mobile-context legend[data-v-f8f6ef21]{color:var(--cc-muted);padding:0 4px;font-size:11px}.portal-content :where(.clinic-chat-wrap) .cc-mobile-report-option[data-v-f8f6ef21]{min-height:44px;color:var(--cc-ink);cursor:pointer;border-radius:2px;align-items:center;gap:10px;padding:5px 7px;font-size:13px;display:flex}.portal-content :where(.clinic-chat-wrap) .cc-mobile-report-option[data-v-f8f6ef21]:hover{background:rgb(var(--cc-cyan) / .08)}.portal-content :where(.clinic-chat-wrap) .cc-mobile-report-option input[data-v-f8f6ef21]{width:20px;height:20px;accent-color:rgb(var(--cc-cyan));flex:0 0 20px}.portal-content :where(.clinic-chat-wrap) .cc-model-select[data-v-f8f6ef21]{grid-template-columns:1fr;gap:3px}.portal-content :where(.clinic-chat-wrap) .cc-model-select .cc-section-label[data-v-f8f6ef21]{font-size:10px}.portal-content :where(.clinic-chat-wrap) .cc-model-select select[data-v-f8f6ef21]{min-height:44px;font-size:12px}.portal-content :where(.clinic-chat-wrap) .cc-model-note[data-v-f8f6ef21]{display:none}.portal-content :where(.clinic-chat-wrap) .cc-conversation[data-v-f8f6ef21]{flex:auto;min-height:0;max-height:none}.portal-content :where(.clinic-chat-wrap) .cc-messages[data-v-f8f6ef21]{gap:8px;padding:8px 1px}.portal-content :where(.clinic-chat-wrap) .cc-welcome[data-v-f8f6ef21]{gap:8px;min-height:0;padding:6px}.portal-content :where(.clinic-chat-wrap) .cc-dragon-stage[data-v-f8f6ef21]{flex:0 0 62px;width:62px;height:62px;min-height:62px}.portal-content :where(.clinic-chat-wrap) .cc-welcome h2[data-v-f8f6ef21]{font-size:15px}.portal-content :where(.clinic-chat-wrap) .cc-welcome p[data-v-f8f6ef21]{font-size:12px}.portal-content :where(.clinic-chat-wrap) .cc-compose-area[data-v-f8f6ef21]{padding-top:6px;padding-bottom:env(safe-area-inset-bottom);flex:none;gap:6px}.portal-content :where(.clinic-chat-wrap) .cc-composer[data-v-f8f6ef21]{gap:5px;padding:7px}.portal-content :where(.clinic-chat-wrap) .cc-composer textarea[data-v-f8f6ef21]{resize:vertical;min-height:60px;max-height:108px;font-size:16px}.portal-content :where(.clinic-chat-wrap) .cc-composer-hint[data-v-f8f6ef21]{flex:auto;max-width:none;font-size:11px}.portal-content :where(.clinic-chat-wrap) .cc-composer-bottom[data-v-f8f6ef21]{flex-wrap:nowrap;gap:6px}.portal-content :where(.clinic-chat-wrap) .cc-send-button[data-v-f8f6ef21]{min-height:44px;padding-inline:12px;font-size:12px;max-width:none!important}.portal-content :where(.clinic-chat-wrap) .cc-send-button>span[data-v-f8f6ef21]{white-space:nowrap!important;max-width:none!important;overflow:visible!important}.portal-content :where(.clinic-chat-wrap) .cc-status-line[data-v-f8f6ef21]{flex-wrap:wrap;font-size:11px}.portal-content :where(.clinic-chat-wrap) .cc-provider-retry[data-v-f8f6ef21],.portal-content :where(.clinic-chat-wrap) .cc-export-download[data-v-f8f6ef21]{min-height:44px}

  .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; }

  .portal-content:has(.clinic-chat-wrap) { padding: 14px 20px !important; }
  .portal-content > .mx-auto > section:has(> .clinic-chat-wrap) {
    height: calc(100dvh - 28px); gap: 10px;
  }
  .portal-content > .mx-auto > section:has(> .clinic-chat-wrap) > header {
    min-height: 28px; padding-left: 0;
  }
  .clinic-topbar ~ .portal-content > .mx-auto > section:has(> .clinic-chat-wrap) {
    height: calc(100dvh - 90px);
  }
  .portal-content .clinic-chat-wrap .clinic-chat.is-expanded {
    height: calc(100dvh - 24px) !important; max-height: calc(100dvh - 24px);
  }
  /* Restoring focus from the drawer must not scroll the outer chat sideways. */
  .portal-content .clinic-chat-wrap .clinic-chat { overflow: clip; }
  .portal-content .clinic-chat-wrap .cc-trace > summary,
  .portal-content .clinic-chat-wrap .cc-trace-group > summary { min-height: 44px; }
}

/* Readable reply text; compact paragraph spacing retains the working area. */
@media (max-width: 1023px) {
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-composer textarea:placeholder-shown {
    white-space: nowrap;
  }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-markdown,
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-plain {
    font-size: 16px; line-height: 1.45;
  }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-markdown p { margin-bottom: 6px; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-markdown p:last-child { margin-bottom: 0; }
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-markdown ul,
  :is(.portal-content, .native-chat-root) .clinic-chat-wrap .cc-message-markdown ol {
    padding-left: 19px; margin: 5px 0 7px;
  }
}
