/* Виджет интервью Roboworks — стиль командной строки (как главная страница):
   JetBrains Mono, тёмный фон, зелёный акцент, плоско, минимум хрома. */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

.ishka-root {
  --t-green: #4ade80;
  --t-green-dim: #2f9e5a;
  --t-bg: #0b0c0f;
  --t-surface: #0e1013;
  --t-border: #1e2228;
  --t-ink: #d7dbe0;
  --t-dim: #7d848e;
  --t-faint: #565d66;
  --t-user: #6ee7a8;
  --t-danger: #f87171;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
}

/* ─── Кнопка-вход (терминальная) ───────────────────────────────────────── */
.ishka-launch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  background: transparent;
  color: var(--t-green);
  border: 1px solid var(--t-green-dim);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ishka-launch:hover { background: rgba(74, 222, 128, 0.08); border-color: var(--t-green); }
.ishka-launch svg { width: 18px; height: 18px; }

/* Состояние «продолжить»: кнопка-вход, когда есть сохранённый разговор. */
.ishka-launch-resume { border-color: var(--t-green); animation: ishka-resume-pulse 2s ease-out 2; }
@keyframes ishka-resume-pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.ishka-resume-hint {
  margin-top: 14px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--t-green);
  opacity: 0.92;
}
/* «начать новый разговор» под кнопкой-входом (прошлый при этом сохраняется) */
.ishka-newconv-link {
  display: inline-block; margin-top: 9px; padding: 2px 0;
  background: none; border: 0; cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.5;
  color: var(--t-dim, #8aa094);
  border-bottom: 1px dashed currentColor;
  transition: color 0.15s;
}
.ishka-newconv-link:hover { color: var(--t-green); }

/* ─── Оверлей ──────────────────────────────────────────────────────────── */
.ishka-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 8, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 24px;
}
.ishka-overlay.ishka-open { display: flex; animation: ishka-fade 0.18s ease; }
@keyframes ishka-fade { from { opacity: 0; } to { opacity: 1; } }

.ishka-window {
  display: flex;
  flex-direction: column;
  text-align: left;       /* терминал: всегда влево (не наследуем center со страницы) */
  width: 100%;
  max-width: 560px;       /* окно крупнее */
  height: 100%;
  max-height: 780px;
  background: var(--t-bg);
  border: 1px solid var(--t-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

/* ─── Шапка (строка терминала) ─────────────────────────────────────────── */
.ishka-header {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--t-border);
  background: var(--t-surface);
  font-size: 13.5px;
}
.ishka-prompt { color: var(--t-ink); font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.ishka-prompt::before { content: '>_ '; color: var(--t-green); }
.ishka-sub { color: var(--t-faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ishka-close {
  margin-left: auto;
  background: transparent; border: none; color: var(--t-dim);
  cursor: pointer; padding: 2px 4px; font-family: inherit; font-size: 12.5px;
  white-space: nowrap; flex-shrink: 0;
  transition: color 0.15s;
}
.ishka-close:hover { color: var(--t-green); }

/* ─── Поле вопроса (один вопрос, по центру) ────────────────────────────── */
.ishka-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox — скрыть полосу */
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;        /* единственный вопрос — по центру по вертикали */
  /* safe center: пока контент влезает — центрируем; когда перерос высоту (длинная
     финальная реплика + блок записи) — ведёт себя как flex-start, иначе верх
     обрезается и его невозможно доскроллить. Старые браузеры строку игнорируют. */
  justify-content: safe center;
  gap: 12px;
}
.ishka-feed::-webkit-scrollbar { width: 0; height: 0; } /* скрыть полосу, скролл работает */

/* Текущий вопрос — печатается посимвольно. Префикс «›», крупнее обычного. */
.ishka-q {
  font-size: 17px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding-left: 18px;
  position: relative;
  color: var(--t-ink);
  min-height: 1.6em;
  /* Лента — flex-колонка, а элементы в ней по умолчанию сжимаются. На длинной
     реплике блок ужимался по высоте, но текст (overflow visible) вылезал за его
     границы и ложился поверх блока записи. Запрещаем сжатие — тогда кнопка
     всегда оказывается НИЖЕ текста, а лишнее уходит в скролл. */
  flex-shrink: 0;
}
.ishka-q::before {
  content: '›';
  position: absolute; left: 0; top: 0;
  color: var(--t-green); font-weight: 700;
}
/* мигающий блок-курсор, пока печатает / пока ждём ответ */
.ishka-q.ishka-typing-on::after {
  content: '';
  display: inline-block;
  width: 9px; height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--t-green);
  animation: ishka-blink 1s steps(1) infinite;
}
@keyframes ishka-blink { 50% { opacity: 0; } }

.ishka-error, .ishka-note {
  font-size: 13px; line-height: 1.5; padding-left: 16px; position: relative;
  flex-shrink: 0;
}
.ishka-error { color: var(--t-dim);   flex-shrink: 0;
}
.ishka-error::before { content: '!'; position: absolute; left: 0; color: var(--t-danger); font-weight: 700; }
.ishka-error button {
  margin-left: 8px; background: transparent; border: none; color: var(--t-green);
  font-family: inherit; cursor: pointer; font-size: 13px; text-decoration: underline;
}
.ishka-note { color: #d8b25e; }
.ishka-note::before { content: '#'; position: absolute; left: 0; color: var(--t-faint); font-weight: 700; }

/* ─── Нижняя строка ввода (как команда) ────────────────────────────────── */
.ishka-inputbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--t-border);
  background: var(--t-surface);
}
.ishka-textwrap {
  flex: 1; min-width: 0;
  display: flex; align-items: flex-start;
}
.ishka-textwrap::before {
  content: '>';
  color: var(--t-green); font-weight: 700;
  margin-right: 8px; line-height: 1.5; font-size: 14px;
}
.ishka-input {
  flex: 1; min-width: 0;
  resize: none;
  overflow-y: auto;            /* длинный текст — вертикальная прокрутка */
  max-height: 120px;
  min-height: 21px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--t-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  caret-color: var(--t-green);
}
.ishka-input::placeholder { color: var(--t-faint); }

/* кнопки-иконки: плоские, зелёные, без фона (терминальный минимализм) */
.ishka-tbtn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--t-green);
  cursor: pointer;
  padding: 6px;
  line-height: 0;
  transition: color 0.15s, opacity 0.15s, transform 0.1s;
}
.ishka-tbtn svg { width: 22px; height: 22px; }
.ishka-tbtn:hover { color: #86efac; }
.ishka-tbtn:active { transform: scale(0.92); }
.ishka-tbtn:disabled { opacity: 0.35; cursor: default; }
.ishka-tbtn.ishka-btn-danger { color: var(--t-dim); }
.ishka-tbtn.ishka-btn-danger:hover { color: var(--t-danger); }
.ishka-tbtn.ishka-btn-ok { color: var(--t-green); }

/* транзиентное «отправленное сообщение»: видно, что ушло, но в чате не остаётся */
.ishka-sent {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--t-user);
  white-space: pre-wrap;
  word-wrap: break-word;
  align-self: stretch;
  animation: ishka-sent-fly 1.25s ease forwards;
  flex-shrink: 0;
}
.ishka-sent::before { content: '$'; position: absolute; left: 0; top: 0; color: var(--t-dim); font-weight: 700; }
@keyframes ishka-sent-fly {
  0%   { opacity: 0; transform: translateY(6px); }
  18%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}
/* Голосовой ввод: появление/исчезновение те же по времени, а читаемая (полностью
   видимая) фаза вдвое дольше — 0.65с → 1.3с. Общая длительность 1.9с. */
.ishka-sent--voice { animation: ishka-sent-fly-voice 1.9s ease forwards; }
@keyframes ishka-sent-fly-voice {
  0%   { opacity: 0; transform: translateY(6px); }
  12%  { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* ─── Запись (терминальная строка) ─────────────────────────────────────── */
.ishka-recording {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  background: transparent; border: none; padding: 0;
  font-family: inherit;
}
.ishka-rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--t-danger);
  animation: ishka-pulse 1s infinite; flex-shrink: 0;
}
@keyframes ishka-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.ishka-rec-time { color: var(--t-ink); font-variant-numeric: tabular-nums; font-size: 13px; min-width: 38px; }
.ishka-wave { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; height: 16px; max-width: 90px; overflow: hidden; }
.ishka-wave i { display: block; width: 2px; border-radius: 0; background: var(--t-green); height: 20%; }
.ishka-rec-live { flex: 1 1 0; min-width: 0; color: var(--t-dim); font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Кнопка «мои ответы» в шапке ──────────────────────────────────────── */
.ishka-hbtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: var(--t-dim);
  cursor: pointer; padding: 2px 4px; font-family: inherit; font-size: 12.5px;
  white-space: nowrap; flex-shrink: 0; transition: color 0.15s;
}
.ishka-hbtn:hover { color: var(--t-green); }
.ishka-hbtn svg { width: 14px; height: 14px; }
.ishka-newint-btn { margin-left: auto; align-self: center; padding: 2px; }
.ishka-newint-btn svg { width: 17px; height: 17px; }
.ishka-answers-btn { align-self: center; }

/* ─── Диалог-подтверждение (новое интервью и т.п.) ─────────────────────── */
.ishka-confirm-dialog {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 8, 0.7); padding: 24px;
  animation: ishka-fade 0.15s ease;
}
.ishka-confirm-card {
  width: 100%; max-width: 340px;
  background: var(--t-surface); border: 1px solid var(--t-border);
  border-radius: 8px; padding: 18px;
}
.ishka-confirm-msg { color: var(--t-ink); font-size: 14.5px; line-height: 1.5; }
.ishka-confirm-subnote { color: var(--t-faint); font-size: 12.5px; line-height: 1.5; margin-top: 7px; }
.ishka-confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.ishka-confirm-actions .ishka-pbtn { flex: 1; margin-top: 0; }

/* ─── Панель «мои ответы» (поверх всего окна) ──────────────────────────── */
.ishka-panel {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column;
  background: var(--t-bg);
  animation: ishka-panel-in 0.16s ease;
}
@keyframes ishka-panel-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.ishka-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--t-border);
  background: var(--t-surface); font-size: 13.5px;
}
.ishka-panel-title { color: var(--t-ink); font-weight: 700; flex: 1; text-align: center; }
.ishka-panel-title::before { content: '>_ '; color: var(--t-green); }
.ishka-phbtn {
  background: transparent; border: none; color: var(--t-dim);
  cursor: pointer; padding: 2px 4px; font-family: inherit; font-size: 12.5px;
  white-space: nowrap; flex-shrink: 0; transition: color 0.15s;
}
.ishka-phbtn:hover { color: var(--t-green); }
.ishka-panel-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.ishka-panel-body::-webkit-scrollbar { width: 0; height: 0; }
.ishka-panel-empty, .ishka-panel-intro { color: var(--t-dim); font-size: 13px; line-height: 1.5; }
.ishka-panel-intro { margin-bottom: 4px; }
/* заголовок раздела «прошлые разговоры» в панели ответов */
.ishka-arch-head {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--t-border);
  color: var(--t-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
}

/* строка вопроса в списке */
.ishka-qrow {
  display: block; width: 100%; text-align: left;
  background: var(--t-surface); border: 1px solid var(--t-border);
  border-radius: 6px; padding: 11px 13px; cursor: pointer;
  font-family: inherit; transition: border-color 0.15s, background 0.15s;
}
.ishka-qrow:hover { border-color: var(--t-green-dim); background: rgba(74, 222, 128, 0.04); }
.ishka-qrow-q { color: var(--t-ink); font-size: 13.5px; line-height: 1.45; margin-bottom: 5px; }
.ishka-qrow-a { color: var(--t-user); font-size: 12.5px; line-height: 1.4; opacity: 0.85; }
.ishka-qrow-a::before { content: '$ '; color: var(--t-faint); }

/* деталь вопрос/ответ */
.ishka-d-label { color: var(--t-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }
.ishka-d-q {
  color: var(--t-ink); font-size: 15px; line-height: 1.55; white-space: pre-wrap;
  word-wrap: break-word; padding-left: 16px; position: relative;
}
.ishka-d-q::before { content: '›'; position: absolute; left: 0; top: 0; color: var(--t-green); font-weight: 700; }
.ishka-d-a {
  color: var(--t-user); font-size: 14px; line-height: 1.55; white-space: pre-wrap;
  word-wrap: break-word; padding-left: 16px; position: relative;
}
.ishka-d-a::before { content: '$'; position: absolute; left: 0; top: 0; color: var(--t-dim); font-weight: 700; }

/* кнопки в панели */
.ishka-pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; background: transparent; color: var(--t-dim);
  border: 1px solid var(--t-border); border-radius: 6px;
  font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ishka-pbtn:hover { color: var(--t-ink); border-color: var(--t-dim); }
.ishka-pbtn:disabled { opacity: 0.4; cursor: default; }
.ishka-pbtn svg { width: 16px; height: 16px; }
.ishka-pbtn-primary { color: var(--t-green); border-color: var(--t-green-dim); margin-top: 8px; }
.ishka-pbtn-primary:hover { color: var(--t-green); border-color: var(--t-green); background: rgba(74, 222, 128, 0.08); }

/* режим правки */
.ishka-edit-input {
  width: 100%; resize: vertical; min-height: 80px;
  background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 6px;
  color: var(--t-ink); font-family: inherit; font-size: 14px; line-height: 1.5;
  padding: 10px 12px; outline: none; caret-color: var(--t-green);
}
.ishka-edit-input:focus { border-color: var(--t-green-dim); }
.ishka-edit-status { color: var(--t-dim); font-size: 12.5px; line-height: 1.4; min-height: 1em; }
.ishka-edit-status.ishka-edit-busy { color: #d8b25e; }
.ishka-edit-actions { display: flex; gap: 10px; margin-top: 4px; }
.ishka-edit-actions .ishka-pbtn { flex: 1; margin-top: 0; }

/* подтверждение «другие вопросы поплывут» */
.ishka-confirm-lead { color: var(--t-ink); font-size: 14px; line-height: 1.5; }
.ishka-confirm-list { display: flex; flex-direction: column; gap: 6px; }
.ishka-confirm-item {
  color: var(--t-dim); font-size: 13px; line-height: 1.45;
  padding: 8px 11px; background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 6px;
}
.ishka-confirm-note { color: var(--t-faint); font-size: 12.5px; line-height: 1.5; }

/* временное уведомление в панели */
.ishka-ptoast {
  color: var(--t-green); font-size: 13px; line-height: 1.4;
  padding: 8px 11px; border: 1px solid var(--t-green-dim); border-radius: 6px;
  background: rgba(74, 222, 128, 0.06);
  animation: ishka-fade 0.18s ease;
}

.ishka-hidden { display: none !important; }

/* ─── Мобильный (приоритет) ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .ishka-overlay { padding: 0; }
  .ishka-window {
    max-width: 100%; max-height: 100%;
    height: 100%; height: 100dvh;
    border-radius: 0; border: none;
  }
  .ishka-input { font-size: 16px; } /* iOS не зумит при фокусе */
  .ishka-header { font-size: 13px; padding: 12px 14px; }
  .ishka-sub { display: none; }    /* на узком экране подзаголовок прячем — шапка не едет */
  .ishka-feed { padding: 20px 16px; }
  .ishka-q { font-size: 16px; }
  .ishka-answers-btn span { display: none; } /* узкий экран — только иконка */
  .ishka-panel-body { padding: 16px; }
}

/* ─── Полоса прогресса интервью («сколько осталось») ───────────────────── */
/* Сидит под шапкой; заполняется по оценке модели с каждым ходом. Красится
   переменными темы — на каждом лендинге своя (A фиолет, B оранж). */
.ishka-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--t-surface);
  border-bottom: 1px solid var(--t-border);
}
.ishka-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--t-border);
  border-radius: 2px;
  overflow: hidden;
}
.ishka-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--t-green);
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.ishka-progress-pct {
  color: var(--t-dim);
  font-size: 11.5px;
  min-width: 58px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ishka-progress.is-done .ishka-progress-pct { color: var(--t-green); font-weight: 700; }

/* ─── Форма-гейт: контакт перед началом разговора ──────────────────────── */
/* Когда показываем гейт — прячем ленту, поле ввода, кнопки шапки и прогресс. */
.ishka-window.ishka-gating .ishka-feed,
.ishka-window.ishka-gating .ishka-inputbar,
.ishka-window.ishka-gating .ishka-progress,
.ishka-window.ishka-gating .ishka-newint-btn,
.ishka-window.ishka-gating .ishka-answers-btn { display: none !important; }

.ishka-gate {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.ishka-gate-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
}
.ishka-gate-title {
  color: var(--t-ink);
  font-size: 18px;
  font-weight: 700;
}
.ishka-gate-title::before { content: '>_ '; color: var(--t-green); }
.ishka-gate-sub {
  color: var(--t-dim);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 10px 0 20px;
}
.ishka-gate-flabel {
  color: var(--t-ink);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}
/* Переключатель типа контакта: [ Телефон | Почта ] — сегмент-контрол. */
.ishka-gate-tabs {
  display: flex;
  border: 1px solid var(--t-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.ishka-gate-tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  color: var(--t-dim);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ishka-gate-tab + .ishka-gate-tab { border-left: 1px solid var(--t-border); }
.ishka-gate-tab:hover { color: var(--t-ink); }
.ishka-gate-tab.is-active {
  background: var(--t-surface);
  color: var(--t-green);
  font-weight: 700;
}
.ishka-gate-phone {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 6px;
  color: var(--t-ink);
  font-family: inherit;
  font-size: 16px; /* iOS не зумит при фокусе */
  outline: none;
  transition: border-color 0.15s;
}
.ishka-gate-phone:focus { border-color: var(--t-green-dim); }
.ishka-gate-phone::placeholder { color: var(--t-faint); }
.ishka-gate-err {
  color: var(--t-danger);
  font-size: 12.5px;
  min-height: 16px;
  margin-top: 6px;
}
.ishka-gate-go {
  margin-top: 22px;
  padding: 13px 16px;
  background: var(--t-green);
  border: 1px solid var(--t-green);
  border-radius: 6px;
  color: #06120d;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.ishka-gate-go:hover { opacity: 0.92; }
.ishka-gate-go:active { transform: scale(0.98); }
.ishka-gate-go:disabled {
  background: var(--t-surface);
  border-color: var(--t-border);
  color: var(--t-faint);
  cursor: default;
  opacity: 1;
}
.ishka-gate-hint {
  text-align: center;
  color: var(--t-faint);
  font-size: 12px;
  margin-top: 10px;
}

/* Скриншоты (режимы с CFG.allowImages, напр. herbies): превью прикреплённой
   картинки над строкой ввода. */
.ishka-imgprev {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 6px 8px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 8px;
}
.ishka-imgprev.ishka-hidden { display: none; }
.ishka-imgprev-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--t-border);
  flex-shrink: 0;
}
.ishka-imgprev-label {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--t-dim);
}
.ishka-imgprev-x {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--t-border);
  border-radius: 6px;
  color: var(--t-dim);
  cursor: pointer;
}
.ishka-imgprev-x:hover { color: var(--t-danger); border-color: var(--t-danger); }
.ishka-imgprev-x svg { width: 14px; height: 14px; }

/* ── Запись на созвон в чате ────────────────────────────────────────────
   Два состояния. Под репликой — одна спокойная кнопка «Выбрать время»
   (таблица поверх текста наезжала бы: лента — flex с justify-content:center,
   и блок без flex-shrink:0 сжимался, а содержимое вылезало на текст).
   По клику открывается отдельный экран: реплика прячется, остаются только окна.
   Красится переменными темы (--t-*), поэтому на A блок фиолетовый, на B оранжевый. */
.ishka-booking {
  flex-shrink: 0;              /* критично: иначе блок сожмётся и наедет на текст */
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--t-surface);
  border: 1px solid var(--t-green-dim);
  border-radius: 10px;
  animation: ishka-booking-in .18s ease-out;
}
@keyframes ishka-booking-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
/* Приглашение под репликой — не карточка, а одна кнопка. Селектор без
   зависимости от базового класса: подстраховка, чтобы блок не сжимался,
   даже если класс проставлен в одиночку. */
.ishka-booking-cta {
  flex-shrink: 0;
}
.ishka-booking.ishka-booking-cta, .ishka-booking-cta {
  background: none;
  border: none;
  padding: 0;
  margin-top: 18px;
}
.ishka-booking-open {
  align-self: flex-start;
  padding: 10px 16px;
  background: none;
  border: 1px solid var(--t-green-dim);
  border-radius: 8px;
  color: var(--t-green);
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ishka-booking-open:hover { border-color: var(--t-green); background: rgba(255, 255, 255, .04); }

.ishka-booking-head {
  font-size: 13.5px;
  color: var(--t-dim);
  margin-bottom: 2px;
}
.ishka-booking-slot {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  background: none;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  color: var(--t-ink);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.ishka-booking-slot:hover:not(:disabled) {
  border-color: var(--t-green);
  color: var(--t-green);
  background: rgba(255, 255, 255, .03);
}
.ishka-booking-slot:disabled { opacity: .5; cursor: default; }

.ishka-booking-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}
.ishka-booking-skip {
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--t-faint);
  font-size: 12.5px;
  font-family: inherit;
  text-decoration: underline dotted;
  cursor: pointer;
}
.ishka-booking-skip:hover:not(:disabled) { color: var(--t-dim); }

.ishka-booking-done { font-size: 14.5px; color: var(--t-green); font-weight: 600; }
.ishka-booking-sub { font-size: 13px; color: var(--t-dim); }
.ishka-booking-err { font-size: 12.5px; color: var(--t-danger); }

/* Ссылка на Meet в подтверждении записи: главное, что лид должен сохранить. */
.ishka-booking-meet {
  font-size: 14px;
  font-weight: 600;
  color: var(--t-green);
  text-decoration: underline;
  word-break: break-all;
}
.ishka-booking-meet:hover { opacity: .85; }
.ishka-booking-cal {
  font-size: 12.5px;
  color: var(--t-dim);
  text-decoration: underline dotted;
}
.ishka-booking-cal:hover { color: var(--t-green); }

/* ═══ Встроенное окно на лендинге (.ishka-embed) ════════════════════════════
   Виджет живёт не оверлеем поверх страницы, а окном-«приложением» прямо в hero
   (/ishka/embed/ в iframe). Здесь он выглядит как привычный чат-ассистент, а не
   как терминал: обычный шрифт, тёмно-серый фон, реплика человека — пузырём
   справа, ответ — простым текстом слева. Терминальные префиксы ('>_', '›', '$',
   '>') прячем. Всё заскоплено под .ishka-embed — обычный оверлей не меняется.
   ВАЖНО: каждый прямой потомок .ishka-feed обязан иметь flex-shrink:0, иначе
   длинная реплика сожмётся и текст ляжет поверх соседнего блока. */
.ishka-overlay.ishka-embed {
  /* Палитра ChatGPT-подобная. Инлайновые стили в разметке (баннер доверия)
     тоже ходят через эти переменные, поэтому перекрашиваются сами. */
  --t-bg: #212121;
  --t-surface: #2a2a2a;
  --t-border: #3a3a3a;
  --t-ink: #ececec;
  --t-dim: #b4b4b4;
  --t-faint: #8f8f8f;
  --t-user: #ececec;
  /* Цвета «хрома» окна отдельно от палитры разговора: их переопределяет
     светлая тема (см. /ishka/embed/b/ под оранжевый лендинг B). */
  --e-bar: #1a1a1a;                        /* шапка окна */
  --e-line: #313131;                       /* её нижняя граница */
  --e-bubble: #303030;                     /* пузырь человека и строка ввода */
  --e-bubble-line: rgba(255, 255, 255, 0.07);
  --e-hover: rgba(255, 255, 255, 0.08);    /* подсветка кнопок-иконок */
  --e-scroll: #4a4a4a;
  --e-send-bg: var(--t-ink);               /* круглая кнопка «отправить» */
  --e-send-ink: #1c1c1c;
  --e-send-bg-hover: #fff;
  --e-send-off-bg: #4a4a4a;                /* она же, пока писать нечего */
  --e-send-off-ink: #8f8f8f;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Helvetica, 'Helvetica Neue', Arial, sans-serif;
  position: absolute;          /* окно — это вся страница iframe, не оверлей */
  padding: 0;
  background: var(--t-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ishka-overlay.ishka-embed .ishka-window {
  max-width: none;
  max-height: none;
  height: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* ─── Шапка: ОДНА строка на всё окно ─────────────────────────────────────
   Титульная планка и шапка виджета раньше шли двумя полосами подряд — окно
   выглядело сплюснутым. Теперь «светофор» рисуется прямо в шапке виджета
   (один псевдоэлемент, три кружка через box-shadow), а рамка снаружи —
   только скруглённые углы и тень. */
.ishka-overlay.ishka-embed .ishka-header {
  align-items: center;          /* baseline увёл бы кружки вверх */
  padding: 0 16px;
  height: 42px;
  background: var(--e-bar);
  border-bottom: 1px solid var(--e-line);
  font-size: 12.5px;
}
.ishka-overlay.ishka-embed .ishka-header::before {
  content: '';
  flex-shrink: 0;
  width: 11px; height: 11px;
  margin-right: 42px;           /* место под второй и третий кружок */
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 18px 0 0 #febc2e, 36px 0 0 #28c840;
}
.ishka-overlay.ishka-embed .ishka-prompt { font-weight: 600; letter-spacing: -0.01em; }
.ishka-overlay.ishka-embed .ishka-prompt::before { content: none; }
.ishka-overlay.ishka-embed .ishka-sub { font-size: 12px; }
.ishka-overlay.ishka-embed .ishka-hbtn { color: var(--t-faint); }

/* Баннер доверия — ещё одна полоса поперёк небольшого окна. Во встроенном
   режиме его место под окном, на самом лендинге (см. #rw-appnote в /lp/ax/). */
.ishka-overlay.ishka-embed .ishka-trust { display: none !important; }

/* Полоса прогресса — тонкая линия под шапкой, без своей плашки. Пустую (0%)
   не показываем: до первого хода это просто лишняя черта поперёк окна. */
.ishka-overlay.ishka-embed .ishka-progress {
  padding: 7px 16px;
  background: var(--t-bg);
  border-bottom: none;
}
.ishka-overlay.ishka-embed .ishka-progress.is-empty { display: none; }
.ishka-overlay.ishka-embed .ishka-progress-bar { height: 3px; }

/* ─── Лента переписки ────────────────────────────────────────────────────── */
/* Колонка читаемой ширины по центру — как в привычных чатах. Ширину держим
   боковыми отступами (а не max-width у детей), иначе пузырь человека не сможет
   прижаться вправо внутри колонки. */
.ishka-overlay.ishka-embed .ishka-feed {
  justify-content: flex-start;
  padding: 26px max(20px, calc((100% - 700px) / 2)) 24px;
  gap: 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--e-scroll) transparent;
}
.ishka-overlay.ishka-embed .ishka-feed::-webkit-scrollbar { width: 8px; }
.ishka-overlay.ishka-embed .ishka-feed::-webkit-scrollbar-thumb {
  background: var(--e-scroll);
  border-radius: 4px;
}

/* Ответ Ишки — обычный текст слева, без пузыря и без префикса '›'. */
.ishka-overlay.ishka-embed .ishka-q {
  flex-shrink: 0;
  align-self: stretch;
  padding-left: 34px;   /* место под аватар */
  font-size: 14px;
  line-height: 1.62;
  color: var(--t-ink);
}
/* Аватары. Иконка рисуется МАСКОЙ, а цвет берётся из переменной темы — поэтому
   один и тот же значок подходит и фиолетовому лендингу A, и оранжевому B.
   У Ишки робот, у человека силуэт; обводка тонкая, как у иконок на лендингах. */
.ishka-overlay.ishka-embed .ishka-q::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  background-color: var(--t-green);
  -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='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.6' y='8.4' width='16.8' height='11.6' rx='3.2'/%3E%3Cpath d='M12 8.4V5.2'/%3E%3Ccircle cx='12' cy='3.7' r='1.5' fill='%23000' stroke='none'/%3E%3Ccircle cx='9' cy='13.4' r='1.2' fill='%23000' stroke='none'/%3E%3Ccircle cx='15' cy='13.4' r='1.2' fill='%23000' stroke='none'/%3E%3Cpath d='M9.7 17h4.6'/%3E%3Cpath d='M3.6 12.6H1.9M20.4 12.6h1.7'/%3E%3C/svg%3E") no-repeat center / contain;
  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='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.6' y='8.4' width='16.8' height='11.6' rx='3.2'/%3E%3Cpath d='M12 8.4V5.2'/%3E%3Ccircle cx='12' cy='3.7' r='1.5' fill='%23000' stroke='none'/%3E%3Ccircle cx='9' cy='13.4' r='1.2' fill='%23000' stroke='none'/%3E%3Ccircle cx='15' cy='13.4' r='1.2' fill='%23000' stroke='none'/%3E%3Cpath d='M9.7 17h4.6'/%3E%3Cpath d='M3.6 12.6H1.9M20.4 12.6h1.7'/%3E%3C/svg%3E") no-repeat center / contain;
}
.ishka-overlay.ishka-embed .ishka-sent::after {
  content: '';
  position: absolute;
  right: -32px;
  top: 6px;
  width: 22px;
  height: 22px;
  background-color: var(--t-faint);
  -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='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.7'/%3E%3Cpath d='M4.9 20.2c0-4 3.2-6.4 7.1-6.4s7.1 2.4 7.1 6.4'/%3E%3C/svg%3E") no-repeat center / contain;
  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='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.7'/%3E%3Cpath d='M4.9 20.2c0-4 3.2-6.4 7.1-6.4s7.1 2.4 7.1 6.4'/%3E%3C/svg%3E") no-repeat center / contain;
}
.ishka-overlay.ishka-embed .ishka-q.ishka-typing-on::after {
  width: 8px;
  background: var(--t-ink);
}

/* Реплика человека — пузырём справа. Остаётся в переписке навсегда: анимацию
   «улетает» (ishka-sent-fly) снимаем, вместо неё короткое появление. */
.ishka-overlay.ishka-embed .ishka-sent,
.ishka-overlay.ishka-embed .ishka-sent--voice {
  flex-shrink: 0;
  align-self: flex-end;
  max-width: 82%;
  padding: 9px 15px;
  background: var(--e-bubble);
  border-radius: 18px;
  color: var(--t-ink);
  font-size: 14px;
  line-height: 1.5;
  margin-right: 32px;   /* место под аватар */
  animation: ishka-embed-in 0.16s ease-out;
}
.ishka-overlay.ishka-embed .ishka-sent::before { content: none; }
@keyframes ishka-embed-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.ishka-overlay.ishka-embed .ishka-error,
.ishka-overlay.ishka-embed .ishka-note { align-self: stretch; }

/* Блок записи на созвон — та же лента, чуть мягче углы. */
.ishka-overlay.ishka-embed .ishka-booking { align-self: stretch; border-radius: 14px; }
.ishka-overlay.ishka-embed .ishka-booking-open { border-radius: 20px; }
.ishka-overlay.ishka-embed .ishka-booking-slot { border-radius: 12px; }

/* ─── Строка ввода: скруглённая «таблетка», как в ChatGPT ────────────────── */
.ishka-overlay.ishka-embed .ishka-inputbar {
  align-items: flex-end;
  gap: 6px;
  margin: 0 max(20px, calc((100% - 700px) / 2)) calc(16px + env(safe-area-inset-bottom));
  padding: 7px 7px 7px 15px;
  background: var(--e-bubble);
  border: 1px solid var(--e-bubble-line);
  border-radius: 26px;
}
.ishka-overlay.ishka-embed .ishka-textwrap { align-items: center; padding: 6px 0; }
.ishka-overlay.ishka-embed .ishka-textwrap::before { content: none; }
.ishka-overlay.ishka-embed .ishka-input { font-size: 14px; line-height: 1.5; }

.ishka-overlay.ishka-embed .ishka-tbtn {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 50%;
  color: var(--t-dim);
  transition: color 0.15s, background 0.15s, opacity 0.15s;
}
.ishka-overlay.ishka-embed .ishka-tbtn svg { width: 18px; height: 18px; }
.ishka-overlay.ishka-embed .ishka-tbtn:hover { color: var(--t-ink); background: var(--e-hover); }
.ishka-overlay.ishka-embed .ishka-tbtn:active { transform: none; }
/* «Отправить» — круглая светлая кнопка (главное действие). */
.ishka-overlay.ishka-embed [data-send] { background: var(--e-send-bg); color: var(--e-send-ink); }
.ishka-overlay.ishka-embed [data-send]:hover { background: var(--e-send-bg-hover); color: var(--e-send-ink); }
.ishka-overlay.ishka-embed [data-send]:disabled { background: var(--e-send-off-bg); color: var(--e-send-off-ink); opacity: 1; }
.ishka-overlay.ishka-embed [data-rec-confirm] { background: var(--t-green); color: #10231a; }
.ishka-overlay.ishka-embed [data-rec-confirm]:hover { background: #86efac; color: #10231a; }

/* ─── Панели поверх окна: те же переменные, без терминальных префиксов ───── */
.ishka-overlay.ishka-embed .ishka-panel-title::before,
.ishka-overlay.ishka-embed .ishka-gate-title::before,
.ishka-overlay.ishka-embed .ishka-qrow-a::before,
.ishka-overlay.ishka-embed .ishka-d-q::before,
.ishka-overlay.ishka-embed .ishka-d-a::before { content: none; }
.ishka-overlay.ishka-embed .ishka-d-q,
.ishka-overlay.ishka-embed .ishka-d-a,
.ishka-overlay.ishka-embed .ishka-qrow-a { padding-left: 0; }
.ishka-overlay.ishka-embed .ishka-pbtn,
.ishka-overlay.ishka-embed .ishka-qrow { border-radius: 12px; }

@media (max-width: 600px) {
  .ishka-overlay.ishka-embed .ishka-feed { padding: 18px 14px 16px; gap: 16px; }
  .ishka-overlay.ishka-embed .ishka-inputbar { margin: 0 12px calc(12px + env(safe-area-inset-bottom)); }
  .ishka-overlay.ishka-embed .ishka-q { font-size: 14px; padding-left: 30px; }
  .ishka-overlay.ishka-embed .ishka-q::before { width: 20px; height: 20px; }
  .ishka-overlay.ishka-embed .ishka-sent,
  .ishka-overlay.ishka-embed .ishka-sent--voice { font-size: 14px; max-width: 80%; margin-right: 28px; }
  .ishka-overlay.ishka-embed .ishka-sent::after { right: -28px; width: 20px; height: 20px; }
}
