/* =========================================================
   SMARTER.YACHTS GLOBAL AI ASSISTANT
   ========================================================= */

.sy-ai-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--color-brand-primary, #1e5aa8);
  color: #fff;
  box-shadow: 0 16px 38px rgba(13, 35, 69, .24);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.sy-ai-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(13, 35, 69, .30);
}

.sy-ai-launcher:focus-visible,
.sy-ai-drawer button:focus-visible,
.sy-ai-drawer textarea:focus-visible,
.sy-ai-notice-global button:focus-visible,
.sy-ai-notice-global a:focus-visible {
  outline: 3px solid rgba(74, 145, 235, .35);
  outline-offset: 3px;
}

.sy-ai-launcher__spark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  font-size: 18px;
  line-height: 1;
}

.sy-ai-launcher__label {
  white-space: nowrap;
}

.sy-ai-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9040;
  background: rgba(11, 27, 58, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.sy-ai-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sy-ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9050;
  width: min(440px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -20px 0 50px rgba(13, 35, 69, .20);
  transform: translateX(105%);
  transition: transform .24s ease;
}

.sy-ai-drawer.is-open {
  transform: translateX(0);
}

.sy-ai-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 14px 18px;
  border-bottom: 1px solid #dfe8f3;
  background: #fff;
}

.sy-ai-drawer__agent {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.sy-ai-drawer__logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}

.sy-ai-drawer__agent-copy {
  min-width: 0;
}

.sy-ai-drawer__agent-copy strong {
  display: block;
  color: #152d52;
  font-size: 15px;
  line-height: 1.25;
}

.sy-ai-drawer__status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: #71829c;
  font-size: 12px;
}

.sy-ai-drawer__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35a76f;
}

.sy-ai-drawer__status.is-busy .sy-ai-drawer__status-dot {
  animation: syAiPulse 1s ease-in-out infinite;
}

@keyframes syAiPulse {
  50% { opacity: .35; }
}

.sy-ai-drawer__header-actions {
  display: flex;
  gap: 6px;
}

.sy-ai-icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #dbe5f1;
  border-radius: 50%;
  background: #fff;
  color: #1e5aa8;
  cursor: pointer;
}

.sy-ai-icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sy-ai-drawer__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px 14px;
  background: #f7faff;
}

.sy-ai-message {
  display: flex;
  gap: 9px;
  margin: 0 0 16px;
}

.sy-ai-message--user {
  justify-content: flex-end;
}

.sy-ai-message__avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-top: 2px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #dbe5f1;
}

.sy-ai-message__avatar img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.sy-ai-message__content {
  max-width: 84%;
}

.sy-ai-message--user .sy-ai-message__content {
  max-width: 86%;
}

.sy-ai-message__meta {
  margin: 0 0 5px;
  color: #7b8ba2;
  font-size: 11px;
}

.sy-ai-message--user .sy-ai-message__meta {
  text-align: right;
}

.sy-ai-message__bubble {
  padding: 11px 13px;
  border: 1px solid #dbe5f1;
  border-radius: 15px;
  background: #fff;
  color: #243b5d;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sy-ai-message__bubble.sy-ai-markdown {
  white-space: normal;
}

.sy-ai-markdown p {
  margin: 0 0 9px;
}

.sy-ai-markdown p:last-child,
.sy-ai-markdown ul:last-child,
.sy-ai-markdown ol:last-child {
  margin-bottom: 0;
}

.sy-ai-markdown ul,
.sy-ai-markdown ol {
  margin: 0 0 9px;
  padding-left: 20px;
}

.sy-ai-markdown a {
  color: #1e5aa8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sy-ai-message--user .sy-ai-message__bubble {
  border-color: #1e5aa8;
  background: #1e5aa8;
  color: #fff;
}

.sy-ai-message--error .sy-ai-message__bubble {
  border-color: #e0a2a2;
  background: #fff7f7;
  color: #8b3030;
}

.sy-ai-sources {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #e5edf6;
  white-space: normal;
}

.sy-ai-sources strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.sy-ai-sources-list {
  display: grid;
  gap: 4px;
}

.sy-ai-sources a,
.sy-ai-sources span {
  color: #1e5aa8;
  font-size: 12px;
  text-decoration: none;
}

.sy-ai-sources a:hover {
  text-decoration: underline;
}

.sy-ai-quick {
  padding: 0 18px 12px;
  background: #f7faff;
}

.sy-ai-quick__title {
  margin: 0 0 8px;
  color: #6e7f98;
  font-size: 12px;
  font-weight: 700;
}

.sy-ai-quick__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sy-ai-quick__button {
  padding: 7px 10px;
  border: 1px solid #cbd9ea;
  border-radius: 999px;
  background: #fff;
  color: #1e5aa8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sy-ai-quick__button:hover {
  background: #edf5ff;
}

.sy-ai-drawer__composer {
  flex: 0 0 auto;
  padding: 12px 14px 14px;
  border-top: 1px solid #dfe8f3;
  background: #fff;
}

.sy-ai-form {
  overflow: hidden;
  border: 1px solid #bfd0e4;
  border-radius: 15px;
  background: #fff;
}

.sy-ai-form textarea {
  display: block;
  width: 100%;
  min-height: 70px;
  max-height: 160px;
  padding: 12px 13px 6px;
  box-sizing: border-box;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #243b5d;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.sy-ai-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px 9px 12px;
}

.sy-ai-form__hint {
  color: #8a98ac;
  font-size: 10px;
}

.sy-ai-form__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: #1e5aa8;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sy-ai-form__send:disabled,
.sy-ai-quick__button:disabled,
.sy-ai-icon-button:disabled {
  opacity: .55;
  cursor: default;
}

.sy-ai-drawer__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: #7c8aa0;
  font-size: 10px;
  line-height: 1.35;
}

.sy-ai-drawer__foot a {
  flex: 0 0 auto;
  color: #1e5aa8;
  text-decoration: none;
  font-weight: 700;
}

.sy-ai-drawer__foot a:hover {
  text-decoration: underline;
}

.sy-ai-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 16px;
}

.sy-ai-typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7890ad;
  animation: syAiTyping 1s infinite ease-in-out;
}

.sy-ai-typing-dots i:nth-child(2) { animation-delay: .12s; }
.sy-ai-typing-dots i:nth-child(3) { animation-delay: .24s; }

@keyframes syAiTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

body.sy-ai-drawer-open {
  overflow: hidden;
}

/* First-use AI notice for the global assistant. */
.sy-ai-notice-global[hidden] {
  display: none !important;
}

.sy-ai-notice-global {
  position: fixed;
  inset: 0;
  z-index: 9090;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 34, 61, .58);
  backdrop-filter: blur(4px);
}

.sy-ai-notice-global__panel {
  width: min(650px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 30px;
  box-sizing: border-box;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(11, 27, 58, .28);
}

.sy-ai-notice-global__eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #315a8c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

.sy-ai-notice-global h2 {
  margin: 0 0 18px;
  color: #183155;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.12;
}

.sy-ai-notice-global p {
  margin: 0 0 12px;
  color: #526987;
  font-size: 15px;
  line-height: 1.6;
}

.sy-ai-notice-global__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.sy-ai-notice-global__actions a {
  color: #1e5aa8;
  text-decoration: none;
}

.sy-ai-notice-global__actions button {
  min-width: 120px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #1e5aa8;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 700px) {
  .sy-ai-launcher {
    right: 16px;
    bottom: 16px;
    width: 54px;
    height: 54px;
    min-height: 54px;
    padding: 0;
    justify-content: center;
  }

  .sy-ai-launcher__label {
    display: none;
  }

  .sy-ai-launcher__spark {
    width: 32px;
    height: 32px;
  }

  .sy-ai-drawer {
    width: 100vw;
  }

  .sy-ai-drawer__foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .sy-ai-notice-global {
    padding: 14px;
  }

  .sy-ai-notice-global__panel {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .sy-ai-notice-global__actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .sy-ai-notice-global__actions button {
    width: 100%;
  }
}
