/* [2026-07-31][CLX][ONBOARDING] Центр помощи: кнопка, меню, значки «?», подсказки, чат.
   Цвета берутся из переменных темы с запасными значениями — файл должен выглядеть уместно
   и при смене темы (copper / slate / espresso), и если переменная вдруг не объявлена. */

.hh { position: relative; z-index: 2400; }

/* ── Кнопка ─────────────────────────────────────────────────────────────────── */
.hh-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 2401;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border, #e0ddd6);
  background: var(--accent, #c7a06a); color: #fff;
  font-size: 22px; font-weight: 500; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.hh-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .24); }
.hh-fab:active { transform: translateY(0); }

/* ── Меню ───────────────────────────────────────────────────────────────────── */
.hh-menu {
  position: fixed; right: 22px; bottom: 80px; z-index: 2401;
  width: 306px; padding: 6px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e0ddd6); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .18);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.hh-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.hh-menu__item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text, #232323);
  font: inherit; text-align: left; cursor: pointer;
}
.hh-menu__item:hover { background: var(--bg-hover, rgba(0, 0, 0, .04)); }
.hh-menu__item b { display: block; font-size: 13.5px; font-weight: 600; }
.hh-menu__item small { display: block; margin-top: 2px; font-size: 12px; opacity: .68; }
.hh-menu__icon { font-size: 16px; line-height: 1.35; }

/* ── Значок «?» у элемента ──────────────────────────────────────────────────── */
.hh-has-mark { position: relative; }
.hh-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; padding: 0;
  border: 1px solid var(--accent, #c7a06a); border-radius: 50%;
  background: transparent; color: var(--accent, #c7a06a);
  font-size: 10px; font-weight: 700; line-height: 1; cursor: pointer;
  vertical-align: middle; opacity: .62;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.hh-mark:hover { opacity: 1; background: var(--accent, #c7a06a); color: #fff; }

/* ── Всплывающая подсказка ──────────────────────────────────────────────────── */
.hh-tip {
  position: absolute; z-index: 2500; width: 320px; max-width: calc(100vw - 24px);
  padding: 12px 14px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e0ddd6); border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .2);
  color: var(--text, #232323);
}
.hh-tip__title { margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.hh-tip__body { font-size: 12.5px; line-height: 1.55; opacity: .88; }
.hh-tip__ask {
  margin-top: 10px; padding: 5px 10px;
  border: 1px solid var(--border, #e0ddd6); border-radius: 6px;
  background: transparent; color: var(--accent, #c7a06a);
  font: inherit; font-size: 12px; cursor: pointer;
}
.hh-tip__ask:hover { background: var(--bg-hover, rgba(0, 0, 0, .04)); }

/* ── Чат ────────────────────────────────────────────────────────────────────── */
.hh-chat {
  position: fixed; right: 22px; bottom: 80px; z-index: 2402;
  display: flex; flex-direction: column;
  width: 400px; max-width: calc(100vw - 30px); height: 520px; max-height: calc(100vh - 130px);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e0ddd6); border-radius: 14px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, .22);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.hh-chat.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.hh-chat__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border, #e0ddd6);
}
.hh-chat__title { font-size: 13.5px; font-weight: 600; }
.hh-chat__close {
  border: 0; background: transparent; color: inherit;
  font-size: 20px; line-height: 1; cursor: pointer; opacity: .6;
}
.hh-chat__close:hover { opacity: 1; }

/* min-height:0 обязателен: без него flex-ребёнок не даёт себя прокручивать. */
.hh-chat__body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }

.hh-msg { margin-bottom: 12px; }
.hh-msg__text {
  display: inline-block; max-width: 92%; padding: 9px 12px;
  border-radius: 10px; font-size: 13px; line-height: 1.55;
}
.hh-msg--manager { text-align: right; }
.hh-msg--manager .hh-msg__text {
  background: var(--accent, #c7a06a); color: #fff; text-align: left;
}
.hh-msg--assistant .hh-msg__text {
  background: var(--bg-hover, rgba(0, 0, 0, .05)); color: var(--text, #232323);
}
.hh-msg--system .hh-msg__text {
  background: transparent; border: 1px dashed var(--border, #e0ddd6);
  color: var(--text, #232323); opacity: .8; font-size: 12.5px;
}
.hh-msg--pending .hh-msg__text { opacity: .55; font-style: italic; }

.hh-msg__rate { margin-top: 6px; font-size: 11.5px; opacity: .75; }
.hh-msg__rate-label { margin-right: 6px; }
.hh-msg__rate button {
  margin-right: 4px; padding: 2px 9px;
  border: 1px solid var(--border, #e0ddd6); border-radius: 5px;
  background: transparent; color: inherit; font: inherit; font-size: 11.5px; cursor: pointer;
}
.hh-msg__rate button:hover { background: var(--bg-hover, rgba(0, 0, 0, .04)); }

/* [2026-07-31][CLX][ОБРАЩЕНИЯ] Подвал стал колонкой: над строкой ввода живут миниатюры
   приложенных снимков и строка отказа. */
.hh-chat__foot {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border, #e0ddd6);
}
.hh-chat__row { display: flex; gap: 8px; align-items: flex-end; }
.hh-chat__input {
  flex: 1; resize: none; padding: 8px 10px;
  border: 1px solid var(--border, #e0ddd6); border-radius: 8px;
  background: var(--bg, #fff); color: var(--text, #232323);
  font: inherit; font-size: 13px; line-height: 1.45;
}
.hh-chat__input:focus { outline: none; border-color: var(--accent, #c7a06a); }
.hh-chat__send {
  padding: 9px 14px; border: 0; border-radius: 8px;
  background: var(--accent, #c7a06a); color: #fff;
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.hh-chat__send:disabled { opacity: .55; cursor: default; }

/* ── Снимки экрана к вопросу ────────────────────────────────────────────────── */
/* [2026-07-31][CLX][ОБРАЩЕНИЯ] Скрепка нарочно тише кнопки «Спросить»: основной путь —
   Ctrl+V прямо в поле, скрепка нужна на телефоне и тем, кто про вставку не знает. */
.hh-chat__clip {
  flex: 0 0 auto; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border, #e0ddd6); border-radius: 8px;
  background: transparent; color: var(--text, #232323);
  font-size: 15px; line-height: 1; cursor: pointer; opacity: .75;
}
.hh-chat__clip:hover { opacity: 1; background: var(--bg-hover, rgba(0, 0, 0, .04)); }

.hh-shots { display: none; flex-wrap: wrap; gap: 8px; }

/* [2026-08-02][CLX][ЗАМЕЧАНИЯ-ОКСАНА] Чип снимка стал подписанным: миниатюра + имя файла +
   размер + значок состояния. Раньше состояние отличалось только прозрачностью картинки —
   по такому «сигналу» и не понять, ушёл снимок или нет. */
.hh-shot { width: 78px; }
.hh-shot__thumb {
  position: relative; width: 78px; height: 62px;
  border: 1px solid var(--border, #e0ddd6); border-radius: 8px; overflow: hidden;
  background: var(--bg-hover, rgba(0, 0, 0, .04));
}
.hh-shot__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hh-shot__name {
  margin-top: 3px; font-size: 10.5px; line-height: 1.25; opacity: .8;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hh-shot__size { font-size: 10px; line-height: 1.25; opacity: .55; }

.hh-shot--up .hh-shot__img { opacity: .45; }
.hh-shot--err .hh-shot__thumb { border-color: #c0563f; }
.hh-shot--err .hh-shot__img { opacity: .3; }
.hh-shot__state {
  position: absolute; left: 3px; bottom: 3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; background: rgba(0, 0, 0, .58); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.hh-shot--ok .hh-shot__state { background: #4c7a52; }
.hh-shot--err .hh-shot__state { background: #c0563f; }
.hh-shot__x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .58); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
}
.hh-shot__x:hover { background: rgba(0, 0, 0, .82); }

/* Состояние снимка — словами. Молчащая форма и была жалобой: «не вижу, ушли они или нет». */
.hh-shots__status {
  display: none; font-size: 11.5px; line-height: 1.45; opacity: .85;
}
.hh-shots__status.is-ok { color: #4c7a52; opacity: 1; }
.hh-shots__status.is-err { color: #c0563f; opacity: 1; }

/* Отказ пишем текстом рядом с полем, а не всплывашкой: её закрывают, не прочитав. */
.hh-shots__err {
  display: none; font-size: 12px; line-height: 1.45; color: #c0563f;
}

/* Перетаскивание файла в окно чата. */
.hh-chat--drop { outline: 2px dashed var(--accent, #c7a06a); outline-offset: -6px; }

/* Миниатюры уже отправленных снимков в переписке. */
.hh-msg__shots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hh-msg--manager .hh-msg__shots { justify-content: flex-end; }
.hh-msg__shot {
  display: block; width: 74px; height: 74px; overflow: hidden;
  border: 1px solid var(--border, #e0ddd6); border-radius: 8px;
}
.hh-msg__shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Подпись «отправлен / не отправлен» под миниатюрами в самом сообщении. */
.hh-msg__shots-cap { margin-top: 4px; font-size: 11px; line-height: 1.4; opacity: .75; }
.hh-msg--manager .hh-msg__shots-cap { text-align: right; }
.hh-msg__shots-cap.is-ok { color: #4c7a52; opacity: 1; }
.hh-msg__shots-cap.is-err { color: #c0563f; opacity: 1; }

/* На узком экране окно чата занимает почти всю ширину — иначе миниатюры и скрепка
   не помещаются рядом с полем ввода. Каталога это не касается. */
@media (max-width: 560px) {
  .hh-chat { right: 10px; left: 10px; width: auto; max-width: none; }
  .hh-shot { width: 68px; }
  .hh-shot__thumb { width: 68px; height: 54px; }
}

/* ── Сообщение-плашка ───────────────────────────────────────────────────────── */
.hh-toast {
  position: fixed; right: 22px; bottom: 82px; z-index: 2500;
  max-width: 340px; padding: 11px 14px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e0ddd6); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  color: var(--text, #232323); font-size: 12.5px; line-height: 1.5;
  transition: opacity .4s ease, transform .4s ease;
}
.hh-toast.is-out { opacity: 0; transform: translateY(8px); }

/* ── Справочник на странице «Обучение» ──────────────────────────────────────── */
.help-book { margin-bottom: 28px; }
.help-book__title { margin-bottom: 4px; font-size: 17px; font-weight: 600; }
.help-book__hint { margin-bottom: 14px; font-size: 13px; opacity: .7; }
.help-book__section { margin-bottom: 18px; }
.help-book__section-title {
  margin-bottom: 8px; font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; opacity: .6;
}
.help-book__item {
  border: 1px solid var(--border, #e0ddd6); border-radius: 10px;
  margin-bottom: 8px; overflow: hidden;
  background: var(--bg-card, #fff);
}
.help-book__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; cursor: pointer; font-size: 13.5px; font-weight: 500;
}
.help-book__head:hover { background: var(--bg-hover, rgba(0, 0, 0, .03)); }
.help-book__body { display: none; padding: 0 14px 14px; font-size: 13px; line-height: 1.62; }
.help-book__item.is-open .help-book__body { display: block; }
.help-book__body p { margin: 0 0 10px; }
.help-book__body p:last-child { margin-bottom: 0; }
