/* Responsive adjustments */

@media (max-width: 720px) {
  :root {
    --assistant-logo-size: 26px;
  }
  .wrap {
    margin: 0;
    padding: 0;
    max-width: none;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .wrap.chat {
    margin: 0;
    min-height: 100vh;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  body:not(.widget-embed) {
    overflow-y: auto;
  }
  body:not(.widget-embed) .wrap.chat {
    min-height: 100dvh;
    height: auto;
    max-height: none;
  }
  .row {
    grid-template-columns: 1fr;
  }
  .rowi {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .chat-window {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 12px;
    gap: 12px;
    overflow-y: auto;
  }
  .chat-header {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 15px;
    padding-right: calc(120px + 15px);
  }
  .chat-header > div:first-child {
    width: 100%;
  }
  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .header-actions > .btn {
    width: 100%;
    justify-content: flex-start;
  }
  .header-icons {
    position: absolute;
    top: 15px;
    right: 15px;
    display: inline-flex;
    gap: 8px;
  }
  .header-icons .btn.icon-only {
    width: 44px;
    height: 44px;
    padding: 8px;
  }
  .header-icons .btn.icon-only img {
    width: 22px;
    height: 22px;
  }
  .composer {
    flex: 0 0 auto;
    margin-top: 10px;
    height: auto;
    padding: 14px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  }
  .composer textarea {
    font-size: 16px;
    min-height: 72px;
    max-height: 140px;
    height: auto;
    resize: none;
    overflow-y: auto;
  }
  body.widget-embed .composer-input textarea {
    width: calc(100% - 72px) !important;
    box-sizing: border-box !important;
    padding-right: 12px !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
  body.widget-embed .composer-input.widget-has-attach textarea,
  body.widget-embed .composer-input.widget-has-whatsapp textarea {
    width: calc(100% - 124px) !important;
    padding-right: 12px !important;
  }
  body.widget-embed .composer-input.widget-has-attach.widget-has-whatsapp textarea {
    width: calc(100% - 174px) !important;
    padding-right: 12px !important;
  }
  .message .bubble {
    max-width: 100%;
  }
  .message.assistant .bubble {
    padding: calc(16px + var(--assistant-logo-size, 26px)) 14px 14px 14px;
    min-height: auto;
    text-align: left;
  }
  .message.assistant .bubble::before {
    top: 14px;
    left: 14px;
    transform: none;
  }

  .message.assistant.pending .bubble {
    padding: 14px;
  }

  .header-actions .btn.admin-link {
    display: none;
  }

  /* Ajustes móviles del efecto Siri */
  .bubble.siri-loading { background-size: 320% 320%; }
  .bubble.siri-loading::after { background-size: 320% 320%; animation-duration: 3.5s; }

  .message-meta {
    display: none;
  }

  @supports (height: 100dvh) {
    .wrap.chat {
      min-height: 100dvh;
      height: auto;
      max-height: none;
    }
  }
}
