/* ИИ-помощник — стиль darb: прямые углы, жёлтый акцент, компактно */
.aih-root{--aih-bg:#fff;--aih-fg:#1b1d20;--aih-muted:#6b6e72;--aih-line:#d9dadc;--aih-bot:#f3f3f1;--aih-me:#1b1d20;--aih-me-fg:#fff;--aih-accent:#f5c400;--aih-bottom:72px;font-size:14px;line-height:1.45}
html[data-bs-theme=dark] .aih-root,html[data-theme=dark] .aih-root,html.dark .aih-root,body.dark .aih-root,body.theme-dark .aih-root,html.theme-dark .aih-root{--aih-bg:#1b1d20;--aih-fg:#ecece8;--aih-muted:#9a9c98;--aih-line:#34373b;--aih-bot:#26292d;--aih-me:#f5c400;--aih-me-fg:#16181b}
.aih-root *{box-sizing:border-box;border-radius:0!important}

/* кнопка */
.aih-open{display:inline-flex;align-items:center;gap:8px;border:0;background:transparent;padding:0;cursor:pointer;color:inherit;font:inherit}
.aih-open-label{font-weight:600}
.aih-ava{display:inline-block;flex:0 0 auto;object-fit:cover}
.aih-ava-svg{display:inline-flex;align-items:center;justify-content:center;background:var(--aih-accent);color:#16181b}
.aih-ava-svg svg{width:64%;height:64%}
.aih-mode-float .aih-open{position:fixed;right:16px;bottom:var(--aih-bottom);z-index:1040;box-shadow:0 4px 14px rgba(0,0,0,.25)}
.aih-mode-float .aih-open .aih-ava{width:52px!important;height:52px!important}
.aih-mode-float .aih-open-label{display:none}

/* окно */
.aih-box{display:flex;flex-direction:column;background:var(--aih-bg);color:var(--aih-fg);border:1px solid var(--aih-line);border-top:3px solid var(--aih-accent)}
.aih-mode-button .aih-box,.aih-mode-float .aih-box{position:fixed;right:16px;bottom:calc(var(--aih-bottom) + 64px);width:380px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - var(--aih-bottom) - 96px);z-index:1050;box-shadow:0 10px 40px rgba(0,0,0,.25);display:none}
.aih-root.aih-on .aih-box{display:flex}
.aih-box-page{height:calc(100vh - 220px);min-height:420px;max-width:820px;margin:0 auto}
.aih-mode-inline .aih-box{height:460px}

.aih-head{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--aih-line)}
.aih-who{flex:1;min-width:0;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.aih-who b{font-size:15px}
.aih-badge{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:2px 6px;border:1px solid var(--aih-fg)}
.aih-icon{display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;border:0;background:transparent;color:var(--aih-muted);cursor:pointer;padding:0}
.aih-icon:hover{color:var(--aih-fg);background:var(--aih-bot)}
.aih-icon svg{width:18px;height:18px}

.aih-list{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px;overscroll-behavior:contain}
.aih-msg{max-width:88%;padding:8px 11px;word-wrap:break-word;overflow-wrap:anywhere}
.aih-bot{align-self:flex-start;background:var(--aih-bot);border-left:3px solid var(--aih-accent)}
.aih-me{align-self:flex-end;background:var(--aih-me);color:var(--aih-me-fg)}
.aih-msg p{margin:0 0 6px}.aih-msg p:last-child{margin:0}
.aih-msg ul{margin:4px 0 6px;padding-left:18px}
.aih-msg a{color:inherit;text-decoration:underline;text-decoration-color:var(--aih-accent);text-underline-offset:2px}
.aih-err{border-left-color:#d9534f;color:#d9534f}
.aih-wait{color:var(--aih-muted)}
.aih-dots i{display:inline-block;width:5px;height:5px;margin-right:3px;background:var(--aih-accent);animation:aihb 1s infinite}
.aih-dots i:nth-child(2){animation-delay:.15s}.aih-dots i:nth-child(3){animation-delay:.3s}
@keyframes aihb{0%,80%,100%{opacity:.25}40%{opacity:1}}

.aih-quick{display:flex;flex-wrap:wrap;gap:6px;padding:0 12px 8px}
.aih-quick[hidden]{display:none}
.aih-chip{border:1px solid var(--aih-line);background:transparent;color:var(--aih-fg);font:inherit;font-size:12.5px;padding:4px 9px;cursor:pointer}
.aih-chip:hover{border-color:var(--aih-accent);background:var(--aih-bot)}

.aih-form{display:flex;align-items:flex-end;border-top:1px solid var(--aih-line)}
.aih-form textarea{flex:1;border:0;resize:none;background:transparent;color:var(--aih-fg);font:inherit;padding:11px 12px;min-height:44px;max-height:120px;outline:none}
.aih-send{width:48px;height:44px;border:0;background:var(--aih-accent);color:#16181b;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.aih-send:disabled{opacity:.5;cursor:default}
.aih-send svg{width:20px;height:20px}
.aih-login{padding:12px;border-top:1px solid var(--aih-line);text-align:center}
.aih-note{font-size:11px;color:var(--aih-muted);padding:6px 12px 8px;border-top:1px dashed var(--aih-line)}

@media (max-width:640px){
  .aih-mode-button .aih-box,.aih-mode-float .aih-box{left:0;right:0;bottom:0;width:100%;max-width:none;height:85vh;max-height:none;border-left:0;border-right:0}
  .aih-box-page{height:calc(100vh - 160px)}
  .aih-form textarea{font-size:16px}
}
@media (prefers-reduced-motion:reduce){.aih-dots i{animation:none;opacity:1}}
