/* ТЕСТОВЫЙ ИИ-консультант iron.esflutter.com (22.10.2026). Цвета дизайна №48: белый, чёрный, красный (переменные сайта). */
.aic-fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 900;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--acc, #d71a21); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(215, 26, 33, .32), 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.aic-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(215, 26, 33, .4), 0 2px 6px rgba(0, 0, 0, .18); }
.aic-fab:focus-visible { outline: 3px solid var(--text, #111); outline-offset: 3px; }
.aic-fab svg { width: 26px; height: 26px; }
.aic-fab .aic-dot {
  position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%;
  background: #2fbf63; border: 2px solid #fff;
}

.aic-panel {
  position: fixed; right: 20px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 901;
  width: 380px; max-width: calc(100vw - 24px); height: min(560px, calc(100vh - 120px));
  display: none; flex-direction: column; overflow: hidden;
  background: #fff; color: var(--text, #111);
  border: 1px solid var(--line, #e8e8e8); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
  font-family: var(--font, inherit);
}
.aic-panel.aic-open { display: flex; animation: aic-in .2s ease; }
@keyframes aic-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.aic-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; background: #111; color: #fff; }
.aic-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--acc, #d71a21); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.aic-avatar svg { width: 18px; height: 18px; }
.aic-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.aic-sub { font-size: 12px; color: rgba(255, 255, 255, .65); margin-top: 2px; }
.aic-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px;
  color: #fff; background: var(--acc, #d71a21); }
.aic-close { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: rgba(255, 255, 255, .75); font-size: 24px; line-height: 1; }
.aic-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.aic-note { margin: 10px 14px 0; padding: 8px 12px; font-size: 12.5px; line-height: 1.4; border-radius: 12px;
  color: var(--muted, #6b6b6b); background: var(--surf, #f6f6f6); }

.aic-log { flex: 1; overflow-y: auto; padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.aic-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.aic-bot { align-self: flex-start; background: var(--surf, #f6f6f6); border-bottom-left-radius: 6px; }
.aic-me { align-self: flex-end; background: #111; color: #fff; border-bottom-right-radius: 6px; }
.aic-err { align-self: flex-start; color: #a3141a; background: #fdeced; }
.aic-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.aic-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted, #6b6b6b); animation: aic-b 1s infinite ease-in-out; }
.aic-typing i:nth-child(2) { animation-delay: .15s; }
.aic-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aic-b { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.aic-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.aic-chip { font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--text, #111); border: 1px solid var(--line, #e8e8e8); }
.aic-chip:hover { border-color: #111; }

.aic-form { display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line, #e8e8e8); }
.aic-input { flex: 1; resize: none; font: inherit; font-size: 15px; line-height: 1.4; padding: 10px 13px; max-height: 110px;
  color: var(--text, #111); background: #fff; border: 1px solid var(--line, #e8e8e8); border-radius: 14px; outline: none; }
.aic-input:focus { border-color: #111; }
.aic-send { width: 44px; height: 44px; flex: none; align-self: flex-end; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--acc, #d71a21); color: #fff; display: flex; align-items: center; justify-content: center; }
.aic-send:disabled { opacity: .45; cursor: default; }
.aic-send svg { width: 20px; height: 20px; }

@media (max-width: 560px) {
  /* на телефоне над нижним меню сайта */
  .aic-fab { right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; }
  .aic-panel { left: 8px; right: 8px; width: auto; max-width: none; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    height: min(78vh, calc(100dvh - 24px)); border-radius: 20px; z-index: 1001; }
  .aic-input { font-size: 16px; }
  body.aic-chat-open .aic-fab { display: none; }
}
@media (prefers-reduced-motion: reduce) { .aic-panel.aic-open, .aic-typing i, .aic-fab { animation: none; transition: none; } }
