.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ai-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.ai-chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 14px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #fff;
  box-shadow: 0 16px 40px rgba(30, 38, 96, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-fab svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.ai-chat-fab-label {
  font-size: 0.92rem;
  font-weight: 700;
}

.ai-chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(30, 38, 96, 0.34);
}

.ai-chat.is-open .ai-chat-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

.ai-chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(480px, calc(100vw - 24px));
  max-height: min(680px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(26, 31, 54, 0.08);
  box-shadow: 0 28px 80px rgba(26, 31, 54, 0.18);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.ai-chat.is-open .ai-chat-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, rgba(45, 58, 140, 0.08), transparent);
  border-bottom: 1px solid var(--line);
}

.ai-chat-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
}

.ai-chat-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
}

.ai-chat-subtitle {
  margin: 6px 0 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.ai-chat-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(26, 31, 54, 0.06);
  color: var(--ink);
  cursor: pointer;
}

.ai-chat-close svg {
  width: 18px;
  height: 18px;
}

.ai-chat-messages {
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-chat-message {
  max-width: 92%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-chat-message--assistant {
  align-self: flex-start;
  background: #f2f4fa;
  color: var(--ink);
  border-bottom-left-radius: 6px;
}

.ai-chat-message--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.ai-chat-message--typing {
  color: var(--ink-soft);
  font-style: italic;
}

.ai-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
}

.ai-chat-chip {
  flex: 1 1 calc(50% - 3px);
  min-width: 0;
  border: 1px solid rgba(45, 58, 140, 0.14);
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
  color: var(--indigo);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ai-chat-chip:hover {
  background: rgba(45, 58, 140, 0.06);
  border-color: rgba(45, 58, 140, 0.24);
}

.ai-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 0 16px 10px;
}

.ai-chat-input {
  width: 100%;
  min-width: 0;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
}

.ai-chat-input:focus {
  outline: 2px solid rgba(45, 58, 140, 0.18);
  border-color: rgba(45, 58, 140, 0.28);
}

.ai-chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--coral);
  color: #fff;
  cursor: pointer;
}

.ai-chat-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-chat-send svg {
  width: 18px;
  height: 18px;
}

.ai-chat-note {
  margin: 0;
  padding: 0 16px 14px;
  font-size: 0.72rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.ai-chat.is-loading .ai-chat-send {
  opacity: 0.7;
}

.section.assistant-promo {
  padding-top: 0;
}

.assistant-promo-box {
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 24px;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 30px;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, rgba(45, 58, 140, 0.08), rgba(232, 93, 76, 0.08));
  border: 1px solid rgba(45, 58, 140, 0.1);
  box-shadow: var(--shadow-sm);
}

.assistant-promo-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.assistant-promo-copy p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 52ch;
}

.assistant-promo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.assistant-promo-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

@media (max-width: 768px) {
  .ai-chat {
    right: 14px;
    bottom: 14px;
  }

  .ai-chat-fab-label {
    display: none;
  }

  .ai-chat-fab {
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .assistant-promo-box {
    grid-template-columns: 1fr;
  }
}
