/* Современный вид чата по демо вступления (Игорь 23.09.2026: «в демо красиво по-современному, в чате по-деревянному»;
   патч 744). Грузится ПОСЛЕ assistant.css и assistant_win.css и меняет только вид: узлы и классы старые, скрипт чата
   работает как раньше. На компьютере окно широкое, на телефоне - во всю ширину. Цвет ответа - в настройках:
   серый (по умолчанию) или розовый, как в демо; выбор хранится в браузере (assistant_theme.js). */
.cw-win {
  --cw-ink: #1f2330; --cw-mute: #6b7280; --cw-line: #e6e8ef;
  --cw-bub: #f4f5f8; --cw-bub-line: #e3e6ee; --cw-acc: #1f2937; --cw-acc-ink: #fff; --cw-user: #eef0f5; --cw-user-ink: #1f2330;
  width: min(980px, 100%); border: 1px solid var(--cw-line); border-radius: 22px; margin-top: 10px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .08); color: var(--cw-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.cw-win[data-bubble="pink"] {
  --cw-bub: #fff7f2; --cw-bub-line: #f6d9c8; --cw-acc: #e0582a; --cw-acc-ink: #fff; --cw-user: #fdebe2; --cw-user-ink: #5b2a16;
}
@media (max-width: 640px) {
  .cw { padding: 0 6px 8px; }
  .cw-win { border-radius: 18px; margin-top: 6px; }
}

/* шапка: аватар и имя слева, кнопки мягче */
.cw-bar { border-bottom: 1px solid var(--cw-line); padding: 8px 12px; gap: 6px; }
.cw-brand { display: inline-flex; align-items: center; gap: 9px; margin-right: 6px; }
.cw-brand i { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; font-style: normal; font-weight: 700; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 35%, #ffd08a, #e0582a 70%); }
.cw-brand b { font-size: .95rem; line-height: 1.1; display: block; color: var(--cw-ink); }
.cw-brand small { font-size: .74rem; color: var(--cw-mute); display: block; }
@media (max-width: 860px) { .cw-brand small { display: none; } }
@media (max-width: 520px) { .cw-brand b { display: none; } }
.cw-ic { border-radius: 999px; color: var(--cw-ink); }
.cw-ic:hover { background: #f3f4f6; }
.cw-ic.is-on { background: var(--cw-acc); color: var(--cw-acc-ink); }
.cw-mod { border: 1px solid var(--cw-line); }
.cw-flags { border-bottom: 1px solid var(--cw-line); }

/* лента и сообщения */
.cw-win .as-log { padding: 18px 20px 22px; gap: 14px; background: #fff; }
.cw-win .as-msg--assistant .as-msg__bubble { background: var(--cw-bub); border: 1px solid var(--cw-bub-line);
  border-radius: 16px 16px 16px 4px; padding: 12px 15px; color: var(--cw-bub-ink, var(--cw-ink)); font-size: .95rem; line-height: 1.58; }
.cw-win .as-msg--assistant { max-width: min(760px, 100%); }
.cw-win .as-msg--user .as-msg__bubble { background: var(--cw-user); color: var(--cw-user-ink); border: 1px solid var(--cw-user-line, transparent); border-radius: 16px 16px 4px 16px;
  padding: 10px 14px; font-size: .95rem; }
.cw-win .as-msg--assistant .as-msg__bubble h2, .cw-win .as-msg--assistant .as-msg__bubble h3 { font-size: 1.02rem; margin: 14px 0 6px; }
@media (max-width: 640px) {
  .cw-win .as-log { padding: 12px 10px 16px; }
  .cw-win .as-msg--user { max-width: 88%; }
}

/* поле ввода и отправить */
.cw-win .as-form { border-top: 1px solid var(--cw-line); padding: 10px 14px 14px; }
.cw-win .as-form textarea { border: 1px solid var(--cw-line); border-radius: 12px; font-family: inherit; }
.cw-win .as-form textarea:focus { border-color: #c7cbd6; box-shadow: 0 0 0 3px rgba(148, 163, 184, .18); }
.cw-win .as-form button[type="submit"] { border-radius: 12px; background: var(--cw-acc); color: var(--cw-acc-ink); }
.cw-win .as-confirm { border-top: 1px solid var(--cw-line); }

/* шторки и панели - без чёрных рамок */
.cw-drawer { border-left: 1px solid var(--cw-line); border-radius: 0 22px 22px 0; }
.cw-win .as-history-panel { border-bottom: 1px solid var(--cw-line); }
.cw-addr.is-on { background: var(--cw-acc); border-color: var(--cw-acc); color: var(--cw-acc-ink); }
.cw-bubble .cw-addr[data-bubble="pink"] { border-color: #f0c3a8; }
/* ответ не шире ленты: на телефоне без горизонтальной прокрутки */
.cw-win .as-log { overflow-x: hidden; }
.cw-win .as-msg, .cw-win .as-msg__bubble { box-sizing: border-box; min-width: 0; }
.cw-win .as-msg__bubble { max-width: 100%; overflow-wrap: anywhere; }
.cw-win .as-msg__bubble img, .cw-win .as-msg__bubble iframe, .cw-win .as-msg__bubble table { max-width: 100%; }
/* шрифт как в демо: обычная толщина (на сайте основной шрифт жирнее - 550), 15px, свободная строка (патч 745) */
.cw-win { font-weight: 400; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.cw-win .as-msg__bubble, .cw-win .as-msg__bubble p, .cw-win .as-msg__bubble li, .cw-win .as-form textarea,
.cw-win .cw-ic, .cw-win .cw-drawer, .cw-win .as-links { font-weight: 400; }
.cw-win .as-msg__bubble strong, .cw-win .as-msg__bubble b, .cw-win .cw-brand b { font-weight: 700; }
.cw-win .as-msg__bubble h1, .cw-win .as-msg__bubble h2, .cw-win .as-msg__bubble h3, .cw-win .as-msg__bubble h4 { font-weight: 700; }
/* ширина окна - как у шапки сайта: края совпадают с логотипом и кнопками (880px контейнер, по 24px отступы; патч 746) */
@media (min-width: 641px) {
  .cw { padding-left: 24px; padding-right: 24px; }
  .cw-win { width: min(calc(var(--container-width, 880px) - 48px), 100%); }
}

/* «✨ Ответ дополнен» - ответ доработан после проверки (патч 768) */
.as-msg__improved {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 6px 2px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6d28d9;
  background: #f3e8ff;
  border: 1px solid #e9d5ff;
  cursor: help;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .as-msg__improved { color: #e9d5ff; background: #3b2a55; border-color: #5b4380; }
}
:root[data-theme="dark"] .as-msg__improved { color: #e9d5ff; background: #3b2a55; border-color: #5b4380; }

/* цвет ответа и вопроса - кружками (патч 804) */
.cw-dots { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #e6e8ef; padding: 0; cursor: pointer; position: relative;
  display: inline-flex; align-items: center; justify-content: center; transition: transform .12s, box-shadow .12s; }
.cw-dot i { width: 9px; height: 9px; border-radius: 50%; opacity: .85; }
.cw-dot:hover { transform: scale(1.08); }
.cw-dot.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cw-acc, #1f2937); }
.cw-dot:focus-visible { outline: 2px solid var(--cw-acc, #1f2937); outline-offset: 3px; }
.cw-win[data-bubble="night"] .as-msg--assistant .as-msg__bubble a { color: #c4b5fd; }


/* Колёса в ответе - свёрнутая полоса с миниатюрой (вариант B, Игорь 25.09; патч 844) */
details.as-wstrip { border: 1px solid #e6e8ef; border-radius: 12px; background: #fff; margin: 10px 0; }
details.as-wstrip > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 8px 12px; cursor: pointer; }
details.as-wstrip > summary::-webkit-details-marker { display: none; }
details.as-wstrip[open] { border-color: #8b6cf6; }
.as-wstrip__mini { width: 38px; height: 38px; flex: 0 0 38px; }
.as-wstrip__mini circle, .as-wstrip__mini line { fill: none; stroke: #c9cbd8; stroke-width: 1; }
.as-wstrip__mini circle.hit { fill: rgba(225, 29, 72, .12); stroke: #e11d48; stroke-width: 2.4; }
.as-wstrip__txt { display: flex; flex-direction: column; min-width: 0; }
.as-wstrip__t1 { font-weight: 600; font-size: .92rem; color: #1f2330; }
.as-wstrip__t2 { color: #6b7280; font-size: .82rem; }
.as-wstrip__go { margin-left: auto; color: #6d4ce0; font-size: .84rem; white-space: nowrap; }
details.as-wstrip:not([open]) .as-wstrip__lbl::after { content: "Показать схему"; }
details.as-wstrip[open] .as-wstrip__lbl::after { content: "Скрыть"; }
.as-wstrip__body { border-top: 1px dashed #e6e8ef; padding: 4px 8px 10px; }
@media (max-width: 480px) { details.as-wstrip:not([open]) .as-wstrip__lbl::after { content: "Схема"; } }
