/* Помощник, облегчённый режим (решение Михаила 07.10, макет утверждён): кнопка, панель
   «Что сделать дальше», строка-подсказка следующего шага. Токены «Графита», обе темы.
   Слои: под модалками портала (1000+) и туром — кнопка 900, панель 950. */
.asst-fab { position: fixed; right: 24px; bottom: 24px; z-index: 900; display: inline-flex; align-items: center;
  gap: 8px; padding: 11px 18px 11px 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--acent); color: var(--on-acent); font: 500 14px/1 var(--font, inherit);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.asst-fab:hover { background: var(--acent-2); }
.asst-fab i { font-size: 19px; }
.asst-fab:focus-visible, .asst-ibtn:focus-visible, .asst-step__go:focus-visible, .asst-hint a:focus-visible,
.asst-hint button:focus-visible, .asst-links a:focus-visible, .asst-links button:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px; }
html.asst-open .asst-fab { display: none; }

.asst-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw; z-index: 950;
  display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border-left: 1px solid var(--border); box-shadow: -16px 0 40px rgba(0, 0, 0, .14); font-size: 14px; }
.asst-panel[hidden] { display: none; }
.asst-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 18px; border-bottom: 1px solid var(--border); }
.asst-head__name { font-weight: 600; font-size: 15px; }
.asst-head__sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.asst-ibtn { margin-left: auto; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 0; padding: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 18px; }
.asst-ibtn:hover { background: var(--surface-2); color: var(--text); }
.asst-body { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.asst-sec { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 0 0 2px; line-height: 1.45; }
.asst-sec b { color: var(--text-2); font-weight: 500; }
.asst-step { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); }
.asst-step__n { font-variant-numeric: tabular-nums; color: var(--text-3); width: 14px; flex: none; line-height: 1.45; }
.asst-step__txt { flex: 1; line-height: 1.45; color: var(--text); }
.asst-step__go { flex: none; border: 0; background: transparent; padding: 0; font: inherit; font-size: 13px;
  font-weight: 500; color: var(--link); cursor: pointer; white-space: nowrap; line-height: 1.45; }
.asst-step__go:hover { text-decoration: underline; background: transparent; }   /* глобальный button:hover красит фон */
.asst-foot { border-top: 1px solid var(--border); padding: 12px 18px 16px; display: grid; gap: 10px; }
.asst-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.asst-links a, .asst-links button { color: var(--text-2); text-decoration: none; display: inline-flex; gap: 6px;
  align-items: center; border: 0; background: transparent; padding: 0; font: inherit; cursor: pointer; }
.asst-links a:hover, .asst-links button:hover { color: var(--text); background: transparent; }
.asst-links i { font-size: 16px; }
.asst-note { font-size: 12px; color: var(--text-3); line-height: 1.45; margin: 0; }

/* Строка-подсказка на экране: одна, закрывается крестиком. */
.asst-hint { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 10px 10px 14px;
  border: 1px solid color-mix(in srgb, var(--link) 30%, var(--border)); background: var(--link-bg);
  border-radius: 10px; font-size: 14px; line-height: 1.45; color: var(--text); }
.asst-hint > i { font-size: 18px; color: var(--link); flex: none; }
.asst-hint__txt { flex: 1; }
.asst-hint a { color: var(--link); font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; }
.asst-hint a:hover { text-decoration: underline; }
.asst-hint button { border: 0; background: transparent; color: var(--text-3); font-size: 16px; cursor: pointer;
  padding: 4px; border-radius: 6px; line-height: 1; }
.asst-hint button:hover { color: var(--text); background: var(--surface-2); }

/* «Показать»: рамка вокруг нужной кнопки на пару секунд. */
.asst-glow { outline: 3px solid var(--link) !important; outline-offset: 4px; border-radius: 10px;
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--link) 16%, transparent) !important;
  transition: outline-color .3s, box-shadow .3s; }

/* Окно «Ваши данные под защитой» — оболочка .cns-modal из app.css. */
.asst-data { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 12px; }
.asst-data li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.asst-data li i { font-size: 18px; color: var(--ok); margin-top: 1px; flex: none; }
.asst-data li b { color: var(--text); font-weight: 500; }

/* Большой монитор: панель пристыкована, страница сужается — подсказки не закрывают портал.
   Только от 1680 px: странице остаётся от 1280 px, и кнопки шапки стоят в ряд (уже — меню «☰»).
   На ноутбуке панель поверх страницы и закрывается после «Открыть / Показать».
   Порог повторён в assistant_lite.js (DOCK) — менять вместе. */
@media (min-width: 1680px) { html.asst-open body { margin-right: 400px; } }
@media (max-width: 600px) {
  .asst-panel { left: 0; right: auto; width: 100vw; border-left: 0; }
  .asst-fab { right: 16px; bottom: 16px; padding: 12px; }
  .asst-fab span { display: none; }
  .asst-hint { flex-wrap: wrap; row-gap: 4px; }
  .asst-hint__txt { flex: 1 1 calc(100% - 64px); }
  .asst-hint a { margin-left: 28px; }
}
@media (prefers-reduced-motion: reduce) { .asst-glow { transition: none; } }

/* === ИИ-режим (assistant_ai.js): приглашение, согласие, чат, цитаты, профиль === */
.asst-cta { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); margin-top: 6px; }
.asst-cta h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.asst-cta p { margin: 0 0 10px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.asst-consent h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.asst-consent > p { margin: 0 0 12px; line-height: 1.55; color: var(--text-2); }
.asst-consent .asst-sec { margin-top: 4px; }
.asst-consent__check { margin: 16px 0 4px; font-size: 13px; line-height: 1.5; }
.asst-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.asst-err { color: var(--err); font-size: 13px; margin: 8px 0 0; }
.asst-linkbtn { border: 0; background: transparent; padding: 0; font: inherit; font-size: 13px; color: var(--link);
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.asst-linkbtn:hover { background: transparent; text-decoration: underline; }

.asst-body.asst-body--chat { padding: 0; overflow: hidden; gap: 0; }
.asst-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.asst-chat__top { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px;
  border-bottom: 1px solid var(--border); }
.asst-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.asst-chat__log { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.asst-msg { line-height: 1.55; }
.asst-msg p { margin: 0 0 8px; }
.asst-msg p:last-child { margin-bottom: 0; }
.asst-msg ul { margin: 0 0 8px; padding-left: 18px; }
.asst-msg--user { align-self: flex-end; max-width: 86%; background: var(--surface-3); padding: 9px 13px;
  border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.asst-who { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.asst-chips { display: grid; gap: 8px; }
.asst-chip { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 10px 12px; border-radius: 10px; font: inherit; font-size: 14px; cursor: pointer; }
.asst-chip:hover { background: var(--surface-2); border-color: var(--border-2); }
.asst-chip i { font-size: 18px; color: var(--text-2); }
.asst-chip small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.asst-typing span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%;
  background: var(--text-3); animation: asst-dot 1s infinite ease-in-out; }
.asst-typing span:nth-of-type(2) { animation-delay: .15s; }
.asst-typing span:nth-of-type(3) { animation-delay: .3s; }
@keyframes asst-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.asst-limit { border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); background: var(--warn-bg);
  border-radius: 10px; padding: 10px 12px; line-height: 1.5; }
.asst-event { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); margin-top: 10px;
  padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; }
.asst-event i { font-size: 16px; color: var(--link); margin-top: 1px; }
.asst-cite { margin: 10px 0 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.asst-cite__quote { margin: 0; padding: 10px 12px 10px 14px; border-left: 3px solid var(--link); background: var(--link-bg);
  font-size: 13.5px; line-height: 1.5; }
.asst-cite__meta { padding: 8px 12px 9px; font-size: 12px; color: var(--text-2); display: grid; gap: 6px; }
.asst-cite__act { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 600; color: var(--text); }
.asst-cite__act a { color: var(--link); text-decoration: none; white-space: nowrap; font-weight: 500; }
.asst-cite__status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.asst-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.6; }
.asst-pill--ok { color: var(--ok); background: var(--ok-bg); }
.asst-pill--warn { color: var(--warn); background: var(--warn-bg); }
.asst-pill--muted { color: var(--text-2); background: var(--surface-2); }
.asst-chat__input { border-top: 1px solid var(--border); padding: 10px 14px 14px; display: grid; gap: 8px; }
.asst-input { display: flex; align-items: flex-end; gap: 6px; border: 1px solid var(--border); border-radius: 12px;
  padding: 6px 6px 6px 12px; background: var(--bg); }
.asst-input:focus-within { border-color: var(--border-2); outline: 2px solid color-mix(in srgb, var(--link) 35%, transparent); }
.asst-input textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; font: inherit; font-size: 14px;
  color: var(--text); padding: 6px 0; min-height: 22px; max-height: 120px; }
.asst-input textarea::placeholder { color: var(--text-3); }
.asst-input--off { opacity: .6; }
.asst-send { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 9px; flex: none; }
.asst-send i { font-size: 18px; }
.asst-hint2 { font-size: 11.5px; color: var(--text-3); margin: 0; line-height: 1.4; }

/* Профиль: блок «ИИ-помощник» с выключателем */
.asst-settings { display: grid; gap: 8px; }
.asst-settings__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.asst-settings p { margin: 0; color: var(--text-2); line-height: 1.5; font-size: 13.5px; }
.asst-settings .btn-sm { justify-self: start; }
.asst-switch { width: 44px; height: 24px; padding: 0; border-radius: 999px; background: var(--acent); position: relative;
  flex: none; border: 0; cursor: pointer; }
.asst-switch:hover { background: var(--acent-2); }
.asst-switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--on-acent); }
.asst-switch.asst-switch--off, .asst-switch.asst-switch--off:hover { background: var(--border-2); }
.asst-switch--off::after { right: auto; left: 3px; background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .asst-typing span { animation: none; opacity: .6; } }
/* В чате нижние ссылки панели прячем (как в макете) — место переписке; «Передать человеку» — над полем ввода. */
.asst-panel--chat .asst-foot { display: none; }
