/* Чат-виджет eno.kz (подключается в includes/head.twig) в фирменном стиле сайта.
   widget.js вставляет свой <style> в конец <head> уже ПОСЛЕ загрузки этого файла, а его
   правила — одноклассовые, поэтому здесь все селекторы начинаются с `html` (+1 к
   специфичности), иначе порядок в каскаде проиграем. Геометрию (ширина панели,
   right: max(25%,340px) у ярлыка в открытом состоянии) не трогаем — widget.js
   рассчитывает положение ярлыка от неё. Цвета берём из токенов theme.css/app.css,
   поэтому тёмная тема подхватывается сама по data-theme на <html>. */

html .eno-w-root,
html .eno-w-panel {
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Ярлык у края экрана ---------- */
html .eno-w-launcher {
  width: 48px;
  height: 64px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px 0 0 999px;
  box-shadow: -6px 0 22px rgba(10, 10, 13, .18);
  transition: width .22s var(--ease), box-shadow .22s var(--ease), background-color .22s var(--ease);
}
html .eno-w-launcher:hover {
  width: 56px;
  background: var(--ink-2);
  box-shadow: -8px 0 30px rgba(10, 10, 13, .26);
}
html .eno-w-launcher:active { width: 52px; }
html .eno-w-launcher:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
html .eno-w-launcher::after { background: var(--ink); }
html .eno-w-ico svg { width: 26px; height: 26px; }

/* ---------- Панель: токены виджета → токены сайта ---------- */
html .eno-w-panel,
html .eno-w-panel.eno-w-dark {
  --eno-surface: var(--surface);
  --eno-canvas: var(--bg-soft);
  --eno-text: var(--text);
  --eno-line: var(--border);
  --eno-field: var(--border-2);
  --eno-op-bg: rgba(58, 75, 240, .08);
  --eno-op-text: var(--text);
  --eno-op-line: rgba(58, 75, 240, .22);
  --eno-shadow: rgba(10, 10, 13, .16);
  box-shadow: -24px 0 64px var(--eno-shadow);
  border-left: 1px solid var(--border);
}
html .eno-w-panel.eno-w-dark {
  --eno-op-bg: rgba(124, 134, 248, .14);
  --eno-op-line: rgba(124, 134, 248, .30);
  --eno-shadow: rgba(0, 0, 0, .55);
}

/* Шапка — как карточки сайта: светлая, с разделителем, без цветной плашки */
html .eno-w-head {
  background: var(--surface);
  color: var(--text);
  padding: 18px 18px 18px 22px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  border-bottom: 1px solid var(--border);
}
html .eno-w-head-title::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .16);
}
html .eno-w-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-2);
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
html .eno-w-close:hover {
  background: var(--bg-soft-2);
  color: var(--text);
}

/* ---------- Лента сообщений ---------- */
html .eno-w-body {
  padding: 20px 18px;
  gap: 10px;
  scrollbar-width: thin;
}
html .eno-w-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
}
html .eno-w-user {
  background: var(--ink);
  color: var(--bg);
  border-bottom-right-radius: 6px;
}
html .eno-w-assistant,
html .eno-w-operator {
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-sm);
}
html .eno-w-who {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  opacity: 1;
  margin-bottom: 3px;
}

/* ---------- Поле ввода ---------- */
html .eno-w-foot {
  padding: 14px 16px;
  gap: 8px;
  align-items: center;
}
html .eno-w-input {
  height: 46px;
  padding: 0 18px;
  border: 1.5px solid var(--eno-field);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 15px;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
html .eno-w-input::placeholder { color: var(--muted); }
html .eno-w-input:focus {
  border-color: var(--text);
  background: var(--surface);
}

/* Кнопка «Отпр.» → круглая кнопка со стрелкой (текст скрыт, но остаётся для скринридеров) */
html .eno-w-send {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  background: var(--ink);
  color: transparent;
  font-size: 0;
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
html .eno-w-send::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
html .eno-w-send:not(:disabled):hover {
  background: var(--ink-2);
  transform: translateY(-1px);
}
html .eno-w-send:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  html .eno-w-launcher { width: 42px; height: 56px; }
  html .eno-w-launcher:hover { width: 42px; }
  html .eno-w-panel,
  html .eno-w-panel.eno-w-dark { border-left: 0; }
  /* 16px — чтобы iOS Safari не зумил страницу при фокусе на поле */
  html .eno-w-input { font-size: 16px; }
}
