#suAiAssistant.suAi {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 99998;
  font-family: "Ubuntu", sans-serif;
}

.suAi * {
  box-sizing: border-box;
}

.suAi [hidden] {
  display: none !important;
}

.suAi__launcher {
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #043060;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(4, 48, 96, 0.22);
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.suAi__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(4, 48, 96, 0.26);
}

.suAi__launcherDot {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
  background: url("/wp-content/themes/astra-safariunion-child/assets/SafariUnion-AI-icon.svg") center/contain no-repeat;
}

.suAi__launcherText {
  white-space: nowrap;
}

.suAi__panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: min(96vw, 540px);
  height: min(86vh, 820px);
  max-height: min(86vh, 820px);
  border: 0;
  border-radius: 24px;
  background:
    linear-gradient(rgba(255,255,255,0.88), rgba(255,255,255,0.92)),
    url("/wp-content/plugins/safariunion-core/assets/ai-chat-bg.svg") center/cover no-repeat;
  box-shadow: 0 28px 60px rgba(4, 48, 96, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.suAi__panelHead {
  padding: 18px 18px 16px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(4, 48, 96, 0.08);
  flex: 0 0 auto;
}

.suAi__title {
  margin: 0 0 4px;
  color: #043060;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 800;
}

.suAi__subtitle {
  margin: 0;
  color: rgba(4, 48, 96, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.suAi__close {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(245, 246, 250, 0.96);
  color: #043060;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 38px;
  padding: 0;
}

.suAi__modeScreen,
.suAi__chatScreen {
  padding: 16px 16px 18px;
}

.suAi__modeScreen {
  display: grid;
  gap: 10px;
  background: rgba(255,255,255,0.16);
  min-height: 0;
}

.suAi__chatScreen {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.suAi__modeCard {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: rgba(245, 246, 250, 0.96);
  color: #043060;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.suAi__modeCard:hover {
  transform: translateY(-1px);
  background: #eef2f7;
  box-shadow: 0 10px 24px rgba(4, 48, 96, 0.08);
}

.suAi__modeCard::after {
  content: "→";
  color: #043060;
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  flex: 0 0 auto;
}

.suAi__modeTitle {
  color: #043060;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
}

.suAi__modeText {
  display: none;
}

.suAi__chatTop {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
}

.suAi__chatActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suAi__back,
.suAi__clear {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(245, 246, 250, 0.96);
  color: #043060;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.suAi__clear[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.suAi__modeBadge {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fdb200;
  color: #043060;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.suAi__messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  padding-right: 4px;
}

.suAi__message {
  max-width: 100%;
  padding: 13px 13px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.68;
}

.suAi__message p {
  margin: 0;
}

.suAi__message p + p {
  margin-top: 10px;
}

.suAi__message--assistant {
  background: rgba(245, 246, 250, 0.95);
  color: #043060;
}

.suAi__message--user {
  margin-left: auto;
  background: #043060;
  color: #fff;
}

.suAi__resultsWrap {
  margin-top: 12px;
}

.suAi__resultsTitle {
  margin-bottom: 8px;
  color: rgba(4, 48, 96, 0.72);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.suAi__results {
  display: grid;
  gap: 8px;
}

.suAi__resultCard {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(4, 48, 96, 0.08);
  backdrop-filter: blur(4px);
}

.suAi__resultHead {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.suAi__resultBadge {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fdb200;
  color: #043060;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.suAi__resultTitle {
  color: #043060;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
  text-decoration: none;
}

.suAi__resultTitle:hover {
  text-decoration: underline;
}

.suAi__resultMeta {
  margin-bottom: 8px;
  color: rgba(4, 48, 96, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.suAi__resultFacts {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.suAi__resultFact {
  color: #043060;
  font-size: 12px;
  line-height: 1.55;
}

.suAi__resultActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.suAi__resultLink {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  background: #043060;
  color: #fff;
}

.suAi__composer {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  flex: 0 0 auto;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.84);
  backdrop-filter: blur(8px);
}

.suAi__input {
  min-height: 46px;
  max-height: 140px;
  resize: none;
  border: 0;
  border-radius: 14px;
  background: #f5f6fa;
  color: #043060;
  padding: 12px 13px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.suAi__input:focus {
  outline: 2px solid rgba(253, 178, 0, 0.42);
  outline-offset: 0;
}

.suAi__send {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: #043060;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

.suAi__send[disabled],
.suAi__modeCard[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 1400px) {
  .suAi__panel {
    width: min(96vw, 500px);
    height: min(84vh, 780px);
    max-height: min(84vh, 780px);
  }
}

@media (max-width: 1200px) {
  .suAi__panel {
    width: min(96vw, 460px);
    height: min(82vh, 720px);
    max-height: min(82vh, 720px);
  }
}

@media (max-width: 920px) {
  #suAiAssistant.suAi {
    left: 12px;
    bottom: 88px;
  }

  .suAi__launcher {
    min-height: 52px;
    padding: 0 16px;
    font-size: 13px;
  }

  .suAi__panel {
    width: min(96vw, 420px);
    height: min(80vh, 680px);
    max-height: min(80vh, 680px);
  }
}

@media (max-width: 560px) {
  #suAiAssistant.suAi {
    left: 0;
    right: 0;
    bottom: 0;
  }

  .suAi__launcherText {
    display: none;
  }

  .suAi__launcher {
    position: fixed;
    left: 10px;
    bottom: 86px;
    width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 0;
    border-radius: 999px;
  }

  .suAi__launcherDot {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
  }

  .suAi__panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    background:
      linear-gradient(rgba(255,255,255,0.90), rgba(255,255,255,0.94)),
      url("/wp-content/plugins/safariunion-core/assets/ai-chat-bg.svg") center/cover no-repeat;
  }

  .suAi__panelHead {
    padding: 18px 16px 14px;
  }

  .suAi__chatScreen,
  .suAi__modeScreen {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .suAi__composer {
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 16px;
    margin-top: 10px;
  }

  .suAi__chatTop {
    align-items: flex-start;
    flex-direction: column;
  }

  .suAi__chatActions {
    width: 100%;
    justify-content: space-between;
  }

  .suAi__modeCard {
    min-height: 50px;
    padding: 0 14px;
    border-radius: 12px;
  }
}