/* Floating assistant only; shared page header/footer geometry is untouched. */
.portal-chat-widget-panel[hidden] { display:none !important; }
.portal-chat-widget-header > div:first-child { min-width:0; }
.portal-chat-widget-header [data-portal-chat-scope] { overflow-wrap:anywhere; }
.portal-chat-widget-messages,.chat-assistant-messages { overflow-wrap:anywhere; }
.portal-chat-widget-messages { min-height:60px; flex:1 1 auto; overflow-y:auto; overscroll-behavior:contain; }
.portal-chat-widget-message p,.chat-assistant-message p { white-space:pre-wrap; }
.portal-chat-widget-examples { display:flex; flex-wrap:wrap; gap:6px; flex-shrink:0; max-height:108px; overflow-y:auto; overscroll-behavior:contain; }
.portal-chat-widget-examples:empty { display:none; }
.portal-chat-widget-examples button { white-space:normal; text-align:left; line-height:1.35; padding:7px 10px; }
.portal-chat-widget-form { display:grid; grid-template-columns:minmax(0,1fr) 40px 44px; gap:6px; flex-shrink:0; }
.portal-chat-widget-form input { width:100%; min-width:0; font-size:16px; }
.portal-chat-widget-footer { flex-shrink:0; }
.chat-assistant-page [data-chat-suggestions] { display:flex; flex-wrap:wrap; gap:6px; }
.chat-assistant-page [data-chat-suggestions] button { white-space:normal; }
.chat-assistant-page [data-chat-question] { font-size:16px; }
@media(max-width:767.98px) {
  .portal-chat-widget { right:max(12px,env(safe-area-inset-right)) !important; max-width:calc(100vw - 24px) !important; }
  .portal-chat-widget-panel {
    position:fixed !important;
    left:max(12px,env(safe-area-inset-left)) !important;
    right:max(12px,env(safe-area-inset-right)) !important;
    width:auto !important;
    max-width:410px;
    margin-left:auto;
    max-height:min(620px,calc(var(--assistant-visible-height,100dvh) - var(--school-footer-height,0px) - 90px)) !important;
    bottom:calc(var(--school-footer-height,0px) + 68px) !important;
  }
  .portal-chat-widget-examples { max-height:108px; overflow-y:auto; }
  .portal-chat-widget-examples button { min-height:36px; font-size:12px; }
  .portal-chat-widget[data-keyboard-open="true"] .portal-chat-widget-panel {
    top:calc(var(--assistant-visible-top,0px) + 8px) !important;
    bottom:auto !important;
    max-height:calc(var(--assistant-visible-height,100dvh) - 16px) !important;
  }
}
