/*
 * Hostinger-proportioned AURA support panels.
 *
 * Desktop: a 460px right-hand workspace that uses the available viewport height.
 * Mobile: a true full-screen support sheet with no floating controls over it.
 * Rules remain scoped to the two AURA panel implementations used across IETA.
 */

.ieta-ari-live-chat,
.ieta-aura-panel {
  box-sizing: border-box;
}

/* RideOS live-context panel. */
.ieta-ari-live-chat {
  top: max(16px, env(safe-area-inset-top)) !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  bottom: max(16px, env(safe-area-inset-bottom)) !important;
  left: auto !important;
  width: min(460px, calc(100vw - 32px)) !important;
  height: auto !important;
  max-height: none !important;
}

.ieta-ari-live-chat > header,
.ieta-ari-live-chat__suggestions,
.ieta-ari-live-chat__form,
.ieta-ari-live-chat > footer {
  flex: 0 0 auto;
}

.ieta-ari-live-chat > header {
  padding: 15px 16px;
}

.ieta-ari-live-chat__mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.ieta-ari-live-chat > header button {
  width: 44px;
  height: 44px;
  min-width: 44px;
}

.ieta-ari-live-chat__log {
  min-height: 0 !important;
  flex: 1 1 auto;
  padding: 16px 16px 10px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ieta-ari-live-chat__suggestions {
  min-height: 56px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 9px 14px 11px;
  scrollbar-width: none;
}

.ieta-ari-live-chat__suggestions::-webkit-scrollbar,
.ieta-aura-suggestions::-webkit-scrollbar {
  display: none;
}

.ieta-aura-suggestions {
  scrollbar-width: none;
}

.ieta-ari-live-chat__suggestions button {
  min-height: 36px;
}

.ieta-ari-live-chat__form {
  padding: 0 14px 12px;
}

.ieta-ari-live-chat__form > div {
  grid-template-columns: minmax(0, 1fr) auto !important;
}

.ieta-ari-live-chat__form textarea {
  min-height: 52px;
  max-height: 132px;
}

.ieta-ari-live-chat__form button {
  min-width: 68px;
  min-height: 52px;
}

.ieta-ari-live-chat > footer {
  padding: 9px 14px 12px;
}

/* The Core embed already uses a right-hand sheet. Give it the same proportions. */
html body .ieta-aura-panel {
  width: min(460px, calc(100vw - 32px)) !important;
  height: calc(100vh - 36px) !important;
  height: calc(100dvh - 36px) !important;
  max-height: none !important;
  margin: 0 !important;
  align-self: center !important;
}

.ieta-aura-panel__head,
.ieta-aura-context,
.ieta-aura-suggestions,
.ieta-aura-compose {
  flex: 0 0 auto;
}

.ieta-aura-chat {
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* Do not let either launcher cover the composer while RideOS chat is open. */
body:has(.ieta-ari-live-chat:not([hidden])) .ieta-ari-launcher,
body:has(.ieta-ari-live-chat:not([hidden])) .aura-g-entry[data-floating="true"] {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-height: 560px) and (min-width: 761px) {
  .ieta-ari-live-chat {
    top: 8px !important;
    bottom: 8px !important;
  }

  .ieta-ari-live-chat > header {
    padding-block: 10px;
  }

  .ieta-ari-live-chat__suggestions {
    min-height: 50px;
    padding-block: 6px 8px;
  }

  .ieta-ari-live-chat > footer {
    display: none;
  }
}

@media (max-width: 760px) {
  .ieta-ari-live-chat {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
  }

  .ieta-ari-live-chat > header {
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
  }

  .ieta-ari-live-chat__log {
    padding: 14px 12px 10px;
  }

  .ieta-ari-live-chat__suggestions {
    min-height: 59px;
    padding: 7px 12px 9px;
    scroll-snap-type: x proximity;
  }

  .ieta-ari-live-chat__suggestions button {
    min-height: 44px;
    scroll-snap-align: start;
  }

  .ieta-ari-live-chat__form {
    padding: 0 12px 11px;
  }

  .ieta-ari-live-chat__form textarea,
  .ieta-ari-live-chat__form button {
    min-height: 52px;
  }

  .ieta-ari-live-chat > footer {
    padding: 9px 12px max(10px, env(safe-area-inset-bottom));
  }

  html body .ieta-aura-sheet {
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 0 !important;
  }

  html body .ieta-aura-panel {
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    align-self: stretch !important;
  }
}

@media (max-height: 470px) {
  .ieta-ari-live-chat > footer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ieta-ari-live-chat,
  .ieta-ari-live-chat *,
  .ieta-aura-panel,
  .ieta-aura-panel * {
    scroll-behavior: auto !important;
  }
}
