.oltg-ai,
.oltg-ai * {
  box-sizing: border-box;
}

.oltg-ai {
  --oltg-gold: #ffad1f;
  --oltg-gold-dark: #d88900;
  --oltg-green: #52d273;
  --oltg-black: #080908;
  --oltg-panel: #111311;
  --oltg-surface: #1c1f1d;
  --oltg-line: #343936;
  --oltg-text: #f7f7f4;
  --oltg-muted: #b6bbb7;
  position: fixed;
  z-index: 2147483000;
  right: 22px;
  bottom: 22px;
  color: var(--oltg-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.oltg-ai__launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px 20px 10px 10px;
  border: 2px solid #ffc65d;
  border-radius: 8px;
  color: #090a09;
  background: var(--oltg-gold);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .46), 0 0 0 5px rgba(255, 173, 31, .13);
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: oltg-ai-attention 3.6s ease-in-out infinite;
}

.oltg-ai__launcher:hover,
.oltg-ai__launcher:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .55), 0 0 0 7px rgba(255, 173, 31, .2);
  outline: none;
}

.oltg-ai[data-open="true"] .oltg-ai__launcher {
  display: none;
}

.oltg-ai__launcher-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  color: var(--oltg-gold);
  background: #0a0b0a;
  border: 2px solid rgba(255, 255, 255, .2);
  font-size: 16px;
  font-weight: 900;
}

.oltg-ai__launcher-copy {
  display: grid;
  gap: 1px;
}

.oltg-ai__launcher-copy strong {
  font-size: 18px;
  line-height: 1.2;
}

.oltg-ai__launcher-copy small {
  max-width: 220px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 650;
}

.oltg-ai__panel {
  display: none;
  width: min(410px, calc(100vw - 32px));
  height: min(650px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid rgba(255, 173, 31, .6);
  border-radius: 8px;
  background: var(--oltg-panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .68);
}

.oltg-ai[data-open="true"] .oltg-ai__panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
}

.oltg-ai__header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 11px;
  min-height: 74px;
  padding: 12px 12px 12px 15px;
  border-bottom: 1px solid var(--oltg-line);
  background: #090a09;
}

.oltg-ai__brand {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--oltg-gold);
  border-radius: 50%;
  color: var(--oltg-gold);
  background: #11150f;
  font-size: 11px;
  font-weight: 900;
}

.oltg-ai__header strong {
  display: block;
  color: var(--oltg-text);
  font-size: 17px;
  line-height: 1.2;
}

.oltg-ai__header span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--oltg-muted);
  font-size: 12px;
}

.oltg-ai__header i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--oltg-green);
  box-shadow: 0 0 9px rgba(82, 210, 115, .7);
}

.oltg-ai__close {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #dadeda;
  background: transparent;
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
}

.oltg-ai__close:hover,
.oltg-ai__close:focus-visible {
  color: #080908;
  background: var(--oltg-gold);
  outline: none;
}

.oltg-ai__messages {
  min-height: 0;
  padding: 18px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--oltg-gold-dark) #151815;
}

.oltg-ai__message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--oltg-line);
  border-radius: 7px;
  color: var(--oltg-text);
  background: var(--oltg-surface);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.oltg-ai__message--user {
  margin-left: auto;
  border-color: var(--oltg-gold);
  color: #090a09;
  background: var(--oltg-gold);
}

.oltg-ai__message a {
  color: #ffc65d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.oltg-ai__message--user a {
  color: #090a09;
}

.oltg-ai__message.is-pending {
  color: var(--oltg-muted);
}

.oltg-ai__suggestions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  border-top: 1px solid var(--oltg-line);
  scrollbar-width: thin;
}

.oltg-ai__suggestions button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #9e690c;
  border-radius: 6px;
  color: #ffc65d;
  background: #18150f;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.oltg-ai__suggestions button:hover,
.oltg-ai__suggestions button:focus-visible {
  border-color: var(--oltg-gold);
  color: #090a09;
  background: var(--oltg-gold);
  outline: none;
}

.oltg-ai__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px 14px 8px;
  border-top: 1px solid var(--oltg-line);
}

.oltg-ai__form textarea {
  width: 100%;
  min-height: 46px;
  max-height: 112px;
  margin: 0;
  padding: 11px 12px;
  resize: none;
  border: 1px solid #454b47;
  border-radius: 6px;
  color: var(--oltg-text);
  background: #202321;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
}

.oltg-ai__form textarea:focus {
  border-color: var(--oltg-gold);
  box-shadow: 0 0 0 2px rgba(255, 173, 31, .18);
  outline: none;
}

.oltg-ai__form textarea::placeholder {
  color: #9da29e;
}

.oltg-ai__send {
  min-width: 68px;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #ffc65d;
  border-radius: 6px;
  color: #090a09;
  background: var(--oltg-gold);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.oltg-ai__send:hover,
.oltg-ai__send:focus-visible {
  background: #ffc052;
  outline: none;
}

.oltg-ai__send:disabled {
  cursor: wait;
  opacity: .62;
}

.oltg-ai__notice {
  margin: 0;
  padding: 0 14px 12px;
  color: #929792;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

@keyframes oltg-ai-attention {
  0%, 72%, 100% { box-shadow: 0 14px 40px rgba(0, 0, 0, .46), 0 0 0 5px rgba(255, 173, 31, .13); }
  82% { box-shadow: 0 16px 46px rgba(0, 0, 0, .5), 0 0 0 10px rgba(255, 173, 31, .04); }
}

@media (prefers-reduced-motion: reduce) {
  .oltg-ai__launcher { animation: none; transition: none; }
}

@media (max-width: 600px) {
  .oltg-ai {
    right: 12px;
    bottom: 12px;
  }

  .oltg-ai__launcher {
    min-height: 62px;
    padding-right: 14px;
  }

  .oltg-ai__launcher-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .oltg-ai__launcher-copy strong { font-size: 16px; }
  .oltg-ai__launcher-copy small { max-width: 175px; font-size: 11px; }

  .oltg-ai__panel {
    width: calc(100vw - 24px);
    height: min(680px, calc(100dvh - 24px));
  }

  .oltg-ai__message {
    max-width: 92%;
    font-size: 14px;
  }
}
