.lyndor-ai {
  --lyndor-ai-wine: #6f1727;
  --lyndor-ai-wine-dark: #4b0d19;
  --lyndor-ai-ink: #241b18;
  --lyndor-ai-paper: #fcf9f3;
  --lyndor-ai-cream: #f5efe5;
  --lyndor-ai-line: rgba(36, 27, 24, .16);
  --lyndor-ai-serif: "Cormorant Garamond", Georgia, serif;
  --lyndor-ai-sans: "Manrope", Arial, sans-serif;
  position: fixed;
  z-index: 99998;
  right: 24px;
  bottom: 24px;
  font-family: var(--lyndor-ai-sans);
  color: var(--lyndor-ai-ink);
  line-height: 1.5;
}

.lyndor-ai *, .lyndor-ai *::before, .lyndor-ai *::after { box-sizing: border-box; }
.lyndor-ai button, .lyndor-ai textarea { font: inherit; }
.lyndor-ai button { cursor: pointer; }
.lyndor-ai .screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.lyndor-ai-launcher {
  min-width: 156px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  float: right;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: var(--lyndor-ai-wine);
  color: #fff;
  box-shadow: 0 14px 38px rgba(36, 27, 24, .24);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: transform .2s ease, background .2s ease;
}
.lyndor-ai-launcher:hover { transform: translateY(-2px); background: var(--lyndor-ai-wine-dark); }
.lyndor-ai-launcher:focus-visible, .lyndor-ai button:focus-visible, .lyndor-ai textarea:focus-visible { outline: 3px solid rgba(111, 23, 39, .28); outline-offset: 3px; }
.lyndor-ai-launcher svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lyndor-ai.is-open .lyndor-ai-launcher { display: none; }

.lyndor-ai-panel {
  width: min(390px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 116px));
  min-height: 470px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid var(--lyndor-ai-line);
  border-radius: 20px;
  background: var(--lyndor-ai-paper);
  box-shadow: 0 28px 80px rgba(36, 27, 24, .3);
}
.lyndor-ai-panel[hidden] { display: none; }

.lyndor-ai-header {
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--lyndor-ai-wine-dark);
  color: #fff;
}
.lyndor-ai-monogram { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; font-family: var(--lyndor-ai-serif); font-size: 25px; font-style: italic; }
.lyndor-ai-header strong { display: block; font-family: var(--lyndor-ai-serif); font-size: 19px; font-weight: 500; line-height: 1.1; }
.lyndor-ai-header span { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: rgba(255,255,255,.68); font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.lyndor-ai-header span i { width: 7px; height: 7px; border-radius: 50%; background: #77d39b; box-shadow: 0 0 0 3px rgba(119,211,155,.13); }
.lyndor-ai-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 28px; font-weight: 300; line-height: 1; }
.lyndor-ai-close:hover { background: rgba(255,255,255,.1); }

.lyndor-ai-messages { min-height: 0; overflow-y: auto; padding: 19px 16px 12px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(111,23,39,.28) transparent; }
.lyndor-ai-message { width: 100%; display: flex; flex-direction: column; margin: 0 0 13px; }
.lyndor-ai-message-user { align-items: flex-end; }
.lyndor-ai-message-assistant { align-items: flex-start; }
.lyndor-ai-bubble { max-width: 87%; padding: 11px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.62; }
.lyndor-ai-message-assistant .lyndor-ai-bubble { border: 1px solid var(--lyndor-ai-line); border-bottom-left-radius: 4px; background: #fff; }
.lyndor-ai-message-user .lyndor-ai-bubble { border-bottom-right-radius: 4px; background: var(--lyndor-ai-wine); color: #fff; }
.lyndor-ai-message.is-loading .lyndor-ai-bubble { color: #82756e; font-style: italic; animation: lyndor-ai-pulse 1.2s ease-in-out infinite; }
.lyndor-ai-message-link { margin: 7px 0 0 4px; color: var(--lyndor-ai-wine); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.lyndor-ai-message-link:hover { text-decoration: underline; }

.lyndor-ai-suggestions { display: flex; gap: 7px; overflow-x: auto; padding: 5px 16px 12px; scrollbar-width: none; }
.lyndor-ai-suggestions::-webkit-scrollbar { display: none; }
.lyndor-ai-suggestions[hidden] { display: none; }
.lyndor-ai-suggestions button { flex: 0 0 auto; padding: 8px 11px; border: 1px solid rgba(111,23,39,.28); border-radius: 999px; background: transparent; color: var(--lyndor-ai-wine); font-size: 9px; font-weight: 700; white-space: nowrap; }
.lyndor-ai-suggestions button:hover { background: var(--lyndor-ai-cream); }

.lyndor-ai-form { display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: end; gap: 8px; margin: 0 12px; padding: 9px 9px 9px 14px; border: 1px solid var(--lyndor-ai-line); border-radius: 17px; background: #fff; }
.lyndor-ai-form textarea { width: 100%; min-height: 31px; max-height: 96px; resize: none; overflow-y: auto; border: 0; outline: 0; padding: 6px 0 3px; background: transparent; color: var(--lyndor-ai-ink); font-size: 12px; line-height: 1.5; }
.lyndor-ai-form textarea::placeholder { color: #93877f; }
.lyndor-ai-form button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--lyndor-ai-wine); color: #fff; }
.lyndor-ai-form button:disabled { cursor: wait; opacity: .58; }
.lyndor-ai-form button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.lyndor-ai-footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; color: #8b7e76; font-size: 8px; line-height: 1.35; }
.lyndor-ai-footer a { flex: 0 0 auto; color: var(--lyndor-ai-wine); font-weight: 800; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }

@keyframes lyndor-ai-pulse { 0%, 100% { opacity: .52; } 50% { opacity: 1; } }

@media (max-width: 620px) {
  .lyndor-ai { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .lyndor-ai-launcher { min-width: 54px; width: 54px; padding: 0; }
  .lyndor-ai-launcher span { display: none; }
  .lyndor-ai-panel { width: calc(100vw - 24px); height: min(680px, calc(100dvh - 80px)); min-height: 420px; border-radius: 18px; }
  .admin-bar .lyndor-ai-panel { height: min(650px, calc(100dvh - 116px)); }
}

@media (prefers-reduced-motion: reduce) {
  .lyndor-ai *, .lyndor-ai *::before, .lyndor-ai *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

