/* ИИ-чат на сайтах Ивана (29.11.2026). Источник: D:\VSCODE\_dispatch\tools\site-chat\sitechat.css
   Цвета задаются переменными на .sc-root, сайт переопределяет их у себя. Скругления не больше 8px у блоков. */
.sc-root {
  --sc-accent: #1b3fcb; --sc-accent-dark: #172e9b; --sc-ring: #ffda56; --sc-ink: #172137; --sc-sub: #505d73;
  --sc-line: #dce2ed; --sc-soft: #eff3fa; --sc-paper: #fff; --sc-online: #1fa456;
  position: fixed; right: 22px; bottom: 22px; z-index: 95; display: grid; justify-items: end; gap: 10px;
  max-width: calc(100% - 32px); font: inherit; color: var(--sc-ink); line-height: 1.4;
}
.sc-root[hidden], .sc-root [hidden] { display: none !important; }
.sc-root button { font: inherit; }

/* кнопка-мастер */
.sc-launcher { display: inline-flex; align-items: center; gap: 11px; padding: 6px 16px 6px 6px; border: 0; border-radius: 8px; background: var(--sc-paper); color: var(--sc-ink); text-align: left; cursor: pointer; box-shadow: 0 14px 34px -12px rgb(21 33 59 / .5), 0 0 0 1px var(--sc-line); animation: sc-in .6s cubic-bezier(.2, 1.3, .4, 1) both; }
.sc-launcher:hover { box-shadow: 0 14px 34px -12px rgb(21 33 59 / .55), 0 0 0 2px var(--sc-accent); }
.sc-ava { position: relative; flex: none; width: 52px; height: 52px; }
.sc-ava img { display: block; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.sc-ava::before { content: ""; position: absolute; inset: -4px; border: 3px solid var(--sc-ring); border-radius: 50%; animation: sc-ring 2.4s ease-out infinite; }
.sc-dot { position: absolute; right: 0; bottom: 1px; width: 13px; height: 13px; border: 2px solid var(--sc-paper); border-radius: 50%; background: var(--sc-online); }
.sc-label { display: grid; }
.sc-label strong { font-size: .95rem; font-weight: 800; }
.sc-label small { color: var(--sc-sub); font-size: .74rem; font-weight: 700; }

/* облачко над мастером */
.sc-bubble { position: relative; display: flex; align-items: center; gap: 10px; max-width: 270px; padding: 11px 12px 11px 15px; border: 0; border-radius: 8px; background: var(--sc-paper); color: var(--sc-ink); text-align: left; font-size: .9rem; font-weight: 700; cursor: pointer; box-shadow: 0 16px 36px -14px rgb(21 33 59 / .5), 0 0 0 1px var(--sc-line); animation: sc-pop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.sc-bubble::after { content: ""; position: absolute; right: 34px; bottom: -6px; width: 12px; height: 12px; background: var(--sc-paper); transform: rotate(45deg); box-shadow: 1px 1px 0 var(--sc-line); }
.sc-bubble-x { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 4px; color: var(--sc-sub); font-size: 1.1rem; line-height: 1; }
.sc-bubble-x:hover { background: var(--sc-soft); }

/* окно чата */
.sc-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; width: 370px; max-width: 100%; height: min(560px, calc(100vh - 120px)); overflow: hidden; border-radius: 8px; background: var(--sc-paper); box-shadow: 0 30px 70px -24px rgb(12 19 36 / .55), 0 0 0 1px var(--sc-line); animation: sc-pop .3s ease-out both; }
.sc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--sc-accent); color: #fff; }
.sc-head-ava { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgb(255 255 255 / .6); }
.sc-head-text { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.sc-head-text strong { font-size: .98rem; }
.sc-head-text span { font-size: .76rem; opacity: .85; }
.sc-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; }
.sc-close:hover { background: rgb(255 255 255 / .15); }
.sc-list { display: flex; flex-direction: column; gap: 8px; padding: 14px; overflow-y: auto; background: var(--sc-soft); overscroll-behavior: contain; }
.sc-msg { max-width: 85%; padding: 9px 12px; border-radius: 8px; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.sc-bot { align-self: flex-start; background: var(--sc-paper); box-shadow: 0 0 0 1px var(--sc-line); }
.sc-user { align-self: flex-end; background: var(--sc-accent); color: #fff; }
.sc-typing { display: inline-flex; align-items: center; gap: 6px; color: var(--sc-sub); font-size: .82rem; }
.sc-dots { display: inline-flex; gap: 3px; }
.sc-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: sc-dot 1.2s infinite ease-in-out; }
.sc-dots i:nth-child(2) { animation-delay: .15s; }
.sc-dots i:nth-child(3) { animation-delay: .3s; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; background: var(--sc-soft); }
.sc-chip { padding: 7px 11px; border: 1px solid var(--sc-line); border-radius: 6px; background: var(--sc-paper); color: var(--sc-accent-dark); font-size: .82rem; font-weight: 700; cursor: pointer; }
.sc-chip:hover { border-color: var(--sc-accent); }
.sc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--sc-line); background: var(--sc-paper); }
.sc-input { flex: 1; min-height: 42px; max-height: 110px; padding: 10px 12px; border: 1px solid var(--sc-line); border-radius: 6px; resize: none; color: var(--sc-ink); background: var(--sc-paper); font: inherit; font-size: 16px; line-height: 1.35; }
.sc-input:focus { outline: 2px solid var(--sc-accent); outline-offset: -1px; }
.sc-send { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 0; border-radius: 6px; background: var(--sc-accent); color: #fff; cursor: pointer; }
.sc-send:hover { background: var(--sc-accent-dark); }
.sc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 0 12px 10px; background: var(--sc-paper); font-size: .72rem; color: var(--sc-sub); }
.sc-phone-btn { padding: 0; border: 0; background: none; color: var(--sc-accent-dark); font-size: .8rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sc-consent a { color: inherit; }
.sc-phone-form { display: grid; gap: 7px; width: 85%; }
.sc-phone-hint { font-weight: 700; }
.sc-phone-row { display: flex; gap: 6px; }
.sc-phone-row input { flex: 1; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--sc-line); border-radius: 6px; font: inherit; font-size: 16px; }
.sc-phone-row input[aria-invalid="true"] { border-color: #c0362c; }
.sc-phone-send { padding: 0 12px; border: 0; border-radius: 6px; background: var(--sc-ring); color: #1b2234; font-weight: 800; cursor: pointer; }

@keyframes sc-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sc-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sc-ring { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.35); } }
@keyframes sc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 800px) {
  .sc-root { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sc-launcher { padding: 4px; border-radius: 50%; }
  .sc-label { display: none; }
  .sc-bubble { max-width: 230px; font-size: .86rem; }
  .sc-bubble::after { right: 22px; }
  .sc-root.is-open { inset: auto 0 0 0; max-width: none; }
  .sc-root.is-open .sc-launcher { display: none; }
  .sc-panel { width: 100%; height: min(78vh, 620px); border-radius: 8px 8px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
@media (prefers-reduced-motion: reduce) {
  .sc-launcher, .sc-bubble, .sc-panel, .sc-ava::before, .sc-dots i { animation: none; }
}
