/* Homepage AI Search - Moonrise Maldives */
.ai-search-wrap {
  position: relative;
  z-index: 20;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.ai-search-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.ai-search-label .spark {
  color: #7ef0e0;
}

.ai-search-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  min-height: 64px;
  padding: 16px 24px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: #0b6b6b;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-search-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.32);
}

.ai-search-open-btn .fa-arrow-right {
  margin-left: auto;
  color: #00a2a2;
}

.ai-search-open-btn .fa-search {
  color: #008080;
}

/* Fixed popup above header / page */
.ai-search-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px 24px;
  overflow-y: auto;
}

.ai-search-modal.open {
  display: flex;
}

.ai-search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(8, 20, 24, 0.72);
  backdrop-filter: blur(4px);
}

.ai-search-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  overflow: visible;
  animation: aiPanelIn 0.22s ease;
}

@keyframes aiPanelIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-search-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #008080, #00a2a2);
  color: #fff;
  border-radius: 20px 20px 0 0;
}

.ai-search-panel-head .title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.ai-search-panel-close {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}

.ai-search-panel-body {
  padding: 16px 16px 18px;
  max-height: min(78vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.ai-search-panel-foot {
  margin: 14px 4px 0;
  text-align: center;
  font-size: 13px;
  color: #707070;
}

.ai-search-panel-foot a {
  color: #008080;
  font-weight: 600;
}

.ai-search-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10040;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #008080, #00a2a2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 128, 128, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.ai-search-fab:hover {
  transform: scale(1.06);
}

.ai-search-fab:active {
  transform: scale(0.96);
}

.ai-search-modal.open ~ .ai-search-fab,
body.ai-search-lock .ai-search-fab {
  display: none;
}

body.ai-search-lock {
  overflow: hidden;
}

.ai-search-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.65);
  overflow: visible;
}

.ai-search-form {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 8px;
}

.ai-search-input-wrap {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-width: 0;
}

.ai-search-input-wrap .lead-icon {
  position: absolute;
  left: 16px;
  color: #008080;
  font-size: 18px;
  pointer-events: none;
  z-index: 2;
}

#aiSearchInput {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 18px 52px 18px 48px;
  font-size: 17px;
  line-height: 1.4;
  color: #1b1b1b;
  font-family: Avenir, Felis, "Segoe UI", sans-serif;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 12px;
}

#aiSearchInput:focus {
  background: rgba(0, 128, 128, 0.04);
}

#aiSearchInput::placeholder {
  color: #8a939b;
}

.ai-mic-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 42px;
  height: 42px;
  border: 2px solid #008080;
  border-radius: 50%;
  background: #ffffff;
  color: #008080;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 128, 128, 0.18);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.ai-mic-btn:hover {
  background: #e0f3f3;
}

.ai-mic-fallback {
  display: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.ai-mic-btn.listening {
  background: #e53935;
  border-color: #e53935;
  color: #fff;
  box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.45);
  animation: aiMicPulse 1.2s ease-out infinite;
}

.ai-mic-btn[hidden],
.ai-mic-btn[hidden='hidden'] {
  display: none !important;
}

@keyframes aiMicPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(229, 57, 53, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);
  }
}

.ai-voice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff5f5;
  border: 1px solid #ffd0d0;
  color: #8a1f1f;
  font-size: 13px;
  font-weight: 600;
}

.ai-voice-status[hidden] {
  display: none !important;
}

.ai-voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53935;
  flex: 0 0 auto;
  animation: aiVoiceBlink 1s ease infinite;
}

@keyframes aiVoiceBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.ai-search-submit {
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #008080 0%, #00a2a2 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 0 28px;
  min-width: 120px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 10px 24px rgba(0, 128, 128, 0.28);
}

.ai-search-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 128, 128, 0.35);
}

.ai-search-submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.ai-search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

.ai-search-chip {
  border: 1px solid #d8e5e5;
  background: #f4fbfb;
  color: #0b6b6b;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ai-search-chip:hover {
  background: #e5f7f7;
  border-color: #008080;
}

/* Autocomplete dropdown - disabled (AI answer only) */
.ai-suggest,
.ai-suggest.open {
  display: none !important;
}

.ai-suggest-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f3f4;
}

.ai-suggest-item:last-child {
  border-bottom: 0;
}

.ai-suggest-item:hover,
.ai-suggest-item.active {
  background: #f2faf9;
}

.ai-suggest-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  background: #eef3f4;
  flex: 0 0 auto;
}

.ai-suggest-item .meta {
  min-width: 0;
}

.ai-suggest-item .name {
  font-weight: 600;
  color: #1b1b1b;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-suggest-item .sub {
  color: #707070;
  font-size: 12px;
  margin-top: 2px;
}

.ai-suggest-item .stars {
  color: #ffcc33;
  font-size: 11px;
  letter-spacing: 1px;
}

.ai-suggest-empty {
  padding: 14px 16px;
  color: #707070;
  font-size: 13px;
}

/* Answer / results panel */
.ai-answer {
  display: none;
  margin-top: 16px;
  background: #f7fbfb;
  border-radius: 16px;
  border: 1px solid #e6ecee;
  overflow: hidden;
}

.ai-answer.open {
  display: block;
  animation: aiFadeUp 0.28s ease;
}

@keyframes aiFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #008080, #00a2a2);
  color: #fff;
}

.ai-answer-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ai-conf {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.ai-conf.medium {
  background: rgba(255, 196, 0, 0.28);
}

.ai-conf.low {
  background: rgba(255, 90, 90, 0.32);
}

.ai-answer-head .title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.ai-answer-close {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.ai-answer-body {
  padding: 18px 20px 8px;
  color: #2b3136;
  font-size: 15px;
  line-height: 1.65;
}

.ai-answer-body a {
  color: #008080;
  font-weight: 600;
}

.ai-answer-body code {
  background: #f2f4f5;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.ai-answer-intro {
  margin: 0 0 18px;
  color: #3d474e;
}

.ai-answer-block {
  margin: 0 0 22px;
  padding: 0 0 18px;
  border-bottom: 1px solid #e8eef0;
}

.ai-answer-block:last-child {
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 0;
}

.ai-answer-block .ai-resort-title {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #008080;
  text-decoration: none;
}

a.ai-resort-title:hover {
  color: #006666;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ai-answer-block .ai-resort-blurb {
  margin: 0 0 10px;
  color: #3d474e;
}

.ai-answer-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-answer-block li {
  position: relative;
  margin: 0 0 8px;
  padding-left: 16px;
  color: #2b3136;
}

.ai-answer-block li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00a2a2;
}

.ai-answer-body > p {
  margin: 0 0 14px;
}

.ai-answer-lowconf {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7e6;
  border: 1px solid #ffe0a3;
  color: #6b5200;
  font-size: 13px;
  line-height: 1.5;
}

.ai-answer-toc,
.ai-answer-toc-slot .ai-answer-toc {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #f3faf9;
  border: 1px solid #d7efed;
  border-radius: 12px;
}

.ai-answer-toc .toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b6b6b;
  margin-bottom: 8px;
}

.ai-answer-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-answer-toc a {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cfe8e6;
  color: #0b6b6b;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.ai-answer-toc a:hover {
  background: #e5f7f7;
}

.ai-answer-followups {
  padding: 4px 16px 12px;
}

.ai-answer-followups .fu-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5b6b73;
  margin-bottom: 8px;
}

.ai-followup-chip {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #cfe8e6;
  background: #fff;
  color: #0b6b6b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ai-followup-chip:hover {
  background: #e5f7f7;
}

.ai-answer-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid #e8eef0;
  font-size: 13px;
  color: #5b6b73;
}

.ai-answer-feedback .fb-label {
  font-weight: 600;
}

.ai-fb-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #cfe8e6;
  background: #fff;
  color: #0b6b6b;
  cursor: pointer;
}

.ai-fb-btn:hover {
  background: #e5f7f7;
}

.ai-fb-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.ai-answer-feedback .fb-thanks {
  color: #0b6b6b;
  font-weight: 600;
}

.ai-answer.loading .ai-answer-followups,
.ai-answer.loading .ai-answer-feedback {
  display: none;
}

.ai-answer-loading {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  color: #0b6b6b;
  font-size: 14px;
}

.ai-answer.loading .ai-answer-loading {
  display: flex;
}

.ai-answer.loading .ai-answer-body,
.ai-answer.loading .ai-answer-resorts {
  display: none;
}

.ai-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #b7e0e0;
  border-top-color: #008080;
  border-radius: 50%;
  animation: aiSpin 0.7s linear infinite;
}

@keyframes aiSpin {
  to {
    transform: rotate(360deg);
  }
}

.ai-answer-resorts {
  padding: 4px 16px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.ai-result-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e7eef0;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.ai-result-card .thumb {
  height: 110px;
  background: #eef3f4 center/cover no-repeat;
}

.ai-result-card .body {
  padding: 10px 12px 12px;
}

.ai-result-card .name {
  font-weight: 600;
  font-size: 14px;
  color: #1b1b1b;
  line-height: 1.3;
}

.ai-result-card .sub {
  margin-top: 4px;
  font-size: 12px;
  color: #707070;
}

.ai-result-card .stars {
  color: #ffcc33;
  font-size: 11px;
}

.ai-search-alt {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.ai-search-alt a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Answer CTA: booking + WhatsApp (specificity must beat .ai-answer-body a) */
.ai-answer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 6px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 128, 128, 0.3);
}

.ai-answer-body a.ai-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  min-height: 42px;
  transition: background 0.15s ease, color 0.15s ease;
}

.ai-answer-body a.ai-cta-book {
  background: #008080;
  color: #ffffff;
  border: 1px solid #008080;
}

.ai-answer-body a.ai-cta-book:hover,
.ai-answer-body a.ai-cta-book:focus {
  background: #006868;
  color: #ffffff;
}

.ai-answer-body a.ai-cta-wa {
  background: #e9f8f1;
  color: #0f6b60;
  border: 1px solid #128c7e;
}

.ai-answer-body a.ai-cta-wa:hover,
.ai-answer-body a.ai-cta-wa:focus {
  background: #128c7e;
  color: #ffffff;
}

@media (max-width: 767px) {
  .ai-search-modal {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
  }

  .ai-search-panel {
    border-radius: 0;
    max-width: none;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    margin: 0;
    width: 100%;
    animation: aiSheetIn 0.2s ease;
  }

  @keyframes aiSheetIn {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .ai-search-panel-head {
    border-radius: 0;
    padding: 12px 14px;
    position: sticky;
    top: 0;
    z-index: 5;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .ai-search-panel-head .title {
    font-size: 12px;
    letter-spacing: 0.04em;
  }

  .ai-search-panel-close {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .ai-search-panel-body {
    flex: 1 1 auto;
    max-height: none;
    overflow-y: auto;
    padding: 14px 12px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .ai-search-form {
    flex-direction: column;
    gap: 8px;
    padding: 0;
  }

  .ai-search-input-wrap {
    background: #f4f8f9;
    border: 1px solid #e2ecec;
    border-radius: 14px;
  }

  .ai-search-input-wrap .lead-icon {
    left: 14px;
  }

  .ai-search-submit {
    width: 100%;
    min-height: 52px;
    padding: 12px;
    font-size: 16px;
    border-radius: 14px;
  }

  #aiSearchInput {
    font-size: 16px;
    padding: 16px 50px 16px 44px;
    background: transparent;
  }

  #aiSearchInput:focus {
    background: transparent;
  }

  .ai-mic-btn {
    width: 38px;
    height: 38px;
    right: 6px;
    font-size: 15px;
  }

  .ai-voice-status {
    margin: 0 0 12px;
  }

  .ai-search-hints {
    padding: 0 0 14px;
    gap: 8px;
  }

  .ai-search-chip {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    justify-content: center;
    min-height: 40px;
    font-size: 12px;
    line-height: 1.3;
    padding: 8px 10px;
  }

  .ai-answer {
    margin-top: 12px;
    border-radius: 14px;
  }

  .ai-answer-body {
    padding: 14px 14px 6px;
    font-size: 15px;
    line-height: 1.6;
  }

  .ai-answer-cta {
    gap: 8px;
    margin: 12px 0 4px;
  }

  .ai-answer-body a.ai-cta-btn {
    flex: 1 1 calc(50% - 4px);
    font-size: 13px;
    padding: 10px 12px;
  }

  .ai-answer-loading {
    padding: 14px;
  }

  .ai-answer-toc {
    margin-bottom: 12px;
  }

  .ai-answer-toc ul {
    gap: 6px;
  }

  .ai-answer-followups {
    padding: 4px 12px 12px;
  }

  .ai-answer-feedback {
    padding: 10px 12px 14px;
    flex-wrap: wrap;
  }

  .ai-answer-resorts {
    grid-template-columns: 1fr 1fr;
    padding: 4px 12px 14px;
    gap: 10px;
  }

  .ai-result-card .thumb {
    height: 96px;
  }

  .ai-answer-block .ai-resort-title {
    font-size: 15px;
  }

  .ai-search-panel-foot {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.5;
    padding: 0 4px;
  }

  .ai-search-fab {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 54px;
    height: 54px;
    box-shadow: 0 10px 24px rgba(0, 128, 128, 0.45);
  }

  .ai-search-open-btn {
    font-size: 15px;
    min-height: 56px;
    max-width: 100%;
    padding: 14px 18px;
    gap: 10px;
  }

  .ai-search-label {
    font-size: 11px;
    margin-bottom: 12px;
  }

  .ai-search-alt {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 12px;
    padding: 0 8px;
  }
}

@media (max-width: 480px) {
  .ai-answer-resorts {
    grid-template-columns: 1fr;
  }

  .ai-search-chip {
    flex: 1 1 100%;
  }

  .ai-result-card .thumb {
    height: 120px;
  }
}

@media (max-width: 360px) {
  .ai-search-panel-head .title {
    max-width: calc(100% - 52px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #aiSearchInput {
    font-size: 16px;
    padding: 16px 48px 16px 40px;
  }

  .ai-search-input-wrap .lead-icon {
    left: 12px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-search-panel,
  .ai-answer.open {
    animation: none;
  }
}

/* Chat thread log (multi-turn conversation) */
.ai-chat-log {
  display: block;
  margin-top: 16px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 10px 12px;
  background: #f7fbfb;
  border: 1px solid #e6ecee;
  border-radius: 16px;
}

.ai-chat-log[hidden] {
  display: none;
}

.ai-thread-item {
  padding: 10px 0;
  border-bottom: 1px solid #e8eef0;
}

.ai-thread-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.ai-thread-q {
  margin: 0 0 4px auto;
  max-width: 92%;
  text-align: right;
  background: #008080;
  color: #fff;
  padding: 8px 12px;
  border-radius: 14px 14px 4px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ai-thread-q .fas {
  font-size: 11px;
  opacity: 0.8;
}

.ai-thread-a.ai-answer-body {
  padding: 8px 2px 2px;
  font-size: 14px;
  line-height: 1.6;
}

.ai-thread-fu {
  padding: 4px 2px 6px;
}

.ai-thread-fu .fu-title {
  display: none;
}

.ai-thread-resorts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 4px 2px 8px;
}

/* Live streaming answer (tokens arrive before final HTML) */
.ai-answer.streaming .ai-answer-body {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.ai-answer.streaming .ai-answer-loading {
  display: none;
}

.ai-stream-caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  background: #008080;
  vertical-align: -2px;
  margin-left: 2px;
  animation: aiBlink 0.9s steps(1) infinite;
}

@keyframes aiBlink {
  50% {
    opacity: 0;
  }
}

.ai-stream-note {
  color: #707070;
  font-style: italic;
  font-size: 13px;
}

/* Stop / regenerate buttons in the answer head */
.ai-answer-mini {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  height: 30px;
  min-width: 30px;
  padding: 0 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ai-answer-mini[hidden] {
  display: none;
}

.ai-answer-mini:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 767px) {
  .ai-chat-log {
    max-height: 40vh;
    margin-top: 12px;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .ai-thread-q {
    font-size: 13px;
  }

  .ai-thread-resorts {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
