.topharm-ai { position: fixed; right: 18px; bottom: 20px; z-index: 2147482000; font-family: Arial, Helvetica, sans-serif; color: #222; line-height: 1.45; }
.topharm-ai *, .topharm-ai *::before, .topharm-ai *::after { box-sizing: border-box; }
.topharm-ai-launcher { width: 62px; height: 62px; border: 0; border-radius: 50%; background: #218542; color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.24); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 2px; transition: transform .18s ease, box-shadow .18s ease; }
.topharm-ai-launcher:hover, .topharm-ai-launcher:focus-visible { transform: translateY(-2px); box-shadow: 0 11px 32px rgba(0,0,0,.28); outline: 3px solid rgba(33,133,66,.25); }
.topharm-ai-launcher svg { width: 30px; height: 30px; fill: currentColor; }
.topharm-ai-launcher-label { font-size: 11px; font-weight: 700; }
.topharm-ai-panel { position: absolute; right: 0; bottom: 76px; width: min(390px, calc(100vw - 24px)); height: min(650px, calc(100vh - 112px)); background: #fff; border: 1px solid #d9dfdb; border-radius: 18px; box-shadow: 0 18px 55px rgba(0,0,0,.25); overflow: hidden; display: grid; grid-template-rows: auto 1fr auto auto auto; }
.topharm-ai-panel[hidden] { display: none; }
.topharm-ai-header { min-height: 64px; background: #218542; color: #fff; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topharm-ai-header strong { display: block; font-size: 18px; }
.topharm-ai-header small { display: block; color: rgba(255,255,255,.82); font-size: 12px; }
.topharm-ai-header-actions { display: flex; align-items: center; gap: 6px; }
.topharm-ai-language { max-width: 116px; height: 34px; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; background: #fff; background-image: none !important; color: #222; padding: 0 6px; font-size: 13px; -webkit-appearance: none; -moz-appearance: none; appearance: none; }
.topharm-ai-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 25px; line-height: 1; cursor: pointer; }
.topharm-ai-messages { overflow-y: auto; overscroll-behavior: contain; padding: 14px; background: #f6f9f7; }
.topharm-ai-message { max-width: 88%; margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.topharm-ai-message-user { margin-inline-start: auto; background: #218542; color: #fff; border-end-end-radius: 4px; }
.topharm-ai-message-assistant { margin-inline-end: auto; background: #fff; border: 1px solid #e0e6e2; border-end-start-radius: 4px; }
.topharm-ai-message-system { max-width: 100%; margin-inline: auto; background: #fff7df; border: 1px solid #f0dfac; text-align: center; font-size: 13px; }
.topharm-ai-sources, .topharm-ai-products, .topharm-ai-orders { margin: 8px 0 0; padding: 0; list-style: none; }
.topharm-ai-sources a, .topharm-ai-products a { color: #146b34; text-decoration: underline; }
.topharm-ai-product, .topharm-ai-order { border-top: 1px solid #e3e7e4; padding: 7px 0; }
.topharm-ai-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-top: 1px solid #e1e6e2; background: #fff; }
.topharm-ai-chip { border: 1px solid #218542; border-radius: 999px; background: #fff; color: #176b36; min-height: 34px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.topharm-ai-chip:hover, .topharm-ai-chip:focus-visible { background: #eef8f1; outline: 2px solid rgba(33,133,66,.2); }
.topharm-ai-rating { direction: ltr; display: flex; gap: 4px; margin-top: 8px; }
.topharm-ai-star { width: 34px; height: 34px; border: 1px solid #218542; border-radius: 50%; background: #fff; color: #218542; cursor: pointer; font-size: 21px; line-height: 1; }
.topharm-ai-star:hover, .topharm-ai-star:focus-visible { background: #218542; color: #fff; outline: 2px solid rgba(33,133,66,.22); }
.topharm-ai-composer { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; padding: 8px; border-top: 1px solid #e1e6e2; background: #fff; align-items: end; }
.topharm-ai-composer textarea { width: 100%; min-height: 42px; max-height: 110px; resize: none; border: 1px solid #cbd5ce; border-radius: 12px; padding: 10px; font: inherit; direction: inherit; }
.topharm-ai-send, .topharm-ai-mic { width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.topharm-ai-send { background: #218542; color: #fff; }
.topharm-ai-mic { background: #edf3ef; color: #176b36; }
.topharm-ai-send svg, .topharm-ai-mic svg { width: 21px; height: 21px; fill: currentColor; }
.topharm-ai-footer { min-height: 26px; padding: 5px 10px; background: #f7f7f7; color: #666; text-align: center; font-size: 11px; }
.topharm-ai-loading::after { content: '•••'; display: inline-block; color: #218542; font-size: 18px; line-height: 1; letter-spacing: 3px; animation: topharm-ai-typing 1s ease-in-out infinite; }
@keyframes topharm-ai-typing { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@media (max-width: 520px) {
  .topharm-ai { right: 12px; bottom: 12px; }
  .topharm-ai-launcher { width: 56px; height: 56px; }
  .topharm-ai-panel { position: fixed; top: max(var(--topharm-ai-viewport-top, 8px), env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); bottom: auto; left: max(8px, env(safe-area-inset-left)); width: auto; height: min(var(--topharm-ai-viewport-height, calc(100dvh - 16px)), calc(100dvh - 16px)); max-height: calc(100dvh - 16px); border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .topharm-ai-launcher { transition: none; } .topharm-ai-loading::after { animation: none; opacity: 1; } }
.header-search.topharm-ai-search-owner { position: relative; }
.header-search.topharm-ai-search-owner .search-input { padding-right: 44px; }
.topharm-ai-search-mic { position: absolute; right: 8px; left: auto; top: 50%; z-index: 20; width: 32px; height: 32px; margin: 0; padding: 5px; transform: translateY(-50%); border: 0; border-radius: 50%; background: transparent; color: #218542; cursor: pointer; display: grid; place-items: center; pointer-events: auto; }
.topharm-ai-search-mic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.topharm-ai-search-mic:hover, .topharm-ai-search-mic:focus-visible { background: rgba(33, 133, 66, .1); outline: 2px solid rgba(33, 133, 66, .22); }
.topharm-ai-search-mic.is-listening { background: #218542; color: #fff; animation: topharm-ai-voice-pulse 1.1s ease-in-out infinite; }
.topharm-ai-search-mic.has-error { color: #767676; }
@keyframes topharm-ai-voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(33, 133, 66, .32); } 50% { box-shadow: 0 0 0 5px rgba(33, 133, 66, 0); } }
@media (prefers-reduced-motion: reduce) { .topharm-ai-search-mic.is-listening { animation: none; } }
