/* ETL AI Chat v3 — Linear/Notion-style + tool result cards */

/* ────────────── FAB Trigger — Anki Vector robot as button ────────────── */
.etl-chat-fab {
  position: fixed;
  left: 22px;
  bottom: 110px; /* clear of cta-sticky bar */
  z-index: 9990;
  height: 92px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0;
  box-shadow: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease, gap 0.3s ease;
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
  overflow: visible;
  max-width: 320px;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18));
}
.etl-chat-fab::before, .etl-chat-fab::after { display: none; }
.etl-chat-fab:hover {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 12px rgba(92, 241, 138, 0.45));
  gap: 12px;
}
.etl-chat-fab:active { transform: translateY(-1px) scale(1.0); }
.etl-chat-fab.is-hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.etl-chat-fab:focus-visible { outline: 2px solid #4ade80; outline-offset: 4px; border-radius: 22px; }
.etl-chat-fab__avatar {
  width: 92px; height: 92px;
  border-radius: 0;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: none;
  overflow: visible;
}
.etl-chat-fab__avatar .etl-bot-img,
.etl-chat-fab__avatar svg.etl-bot-avatar {
  width: 92px; height: 92px;
  filter: none;
}
/* Sketchfab 3D iframe embed */
.etl-bot-3d {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  pointer-events: none; /* clicks go to FAB button */
  border-radius: 16px;
  overflow: hidden;
}
.etl-chat-fab__avatar--3d {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}
/* SVG fallback hidden when 3D works; shows underneath if iframe blocked */
.etl-chat-fab__avatar--3d .etl-bot-3d-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: -1;
}
.etl-chat-fab__avatar svg:not(.etl-bot-avatar) {
  width: 32px; height: 32px;
  color: #fff;
}
/* Idle bob — pure vertical, no tilt */
.etl-chat-fab .etl-bot-avatar,
.etl-chat-fab .etl-bot-img {
  animation: etl-bot-bob 3.4s ease-in-out infinite;
  transform-origin: center bottom;
}
@keyframes etl-bot-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.etl-chat-fab:hover .etl-bot-avatar,
.etl-chat-fab:hover .etl-bot-img {
  animation: etl-bot-bob-hover 0.55s ease both;
}
@keyframes etl-bot-bob-hover {
  0%   { transform: translateY(0)  scale(1); }
  50%  { transform: translateY(-3px) scale(1.05); }
  100% { transform: translateY(0)  scale(1); }
}
.etl-chat-fab__label {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  letter-spacing: 0.005em;
  color: #fff;
  background: linear-gradient(180deg, #232327 0%, #131316 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0 0;
  margin-left: 2px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  display: inline-flex;
  align-items: center;
  height: 36px;
  transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease 0.05s;
}
.etl-chat-fab:hover .etl-chat-fab__label {
  max-width: 220px;
  opacity: 1;
  padding: 0 16px;
}
.etl-chat-fab__label small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1px;
  letter-spacing: 0.02em;
}
html[data-theme="dark"] .etl-chat-fab__label {
  background: linear-gradient(180deg, #2a2a2c 0%, #18181a 100%);
  border-color: rgba(255,255,255,0.12);
}
@media (max-width: 640px) {
  .etl-chat-fab {
    padding: 0 6px;
    gap: 0;
    max-width: 92px;
    bottom: 96px;
  }
  .etl-chat-fab:hover { padding: 0 6px; gap: 0; }
  .etl-chat-fab__label { display: none; }
}

/* ────────────── Click bonk — happy reaction ────────────── */
.etl-chat-fab.is-bonking .etl-bot-avatar,
.etl-chat-fab.is-bonking .etl-bot-img {
  animation: etl-bot-bonk 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}
@keyframes etl-bot-bonk {
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(-9px) scale(1.12); }
  60%  { transform: translateY(0) scale(0.96); }
  100% { transform: translateY(0) scale(1); }
}
.etl-chat-fab.is-bonking .etl-bot-eye {
  animation: etl-bot-bonk-eye 0.5s ease both !important;
}
@keyframes etl-bot-bonk-eye {
  0%   { transform: scale(1); }
  40%  { transform: scaleY(0.45) translateY(-1px); } /* happy squint */
  100% { transform: scale(1); }
}

/* ────────────── Sleep mode ────────────── */
.etl-chat-fab.is-sleeping .etl-bot-eye {
  animation: none !important;
  transform: scaleY(0.08);
}
.etl-chat-fab.is-sleeping .etl-bot-zzz {
  animation: etl-bot-zzz-float 3s ease-in-out infinite;
  opacity: 1 !important;
}
@keyframes etl-bot-zzz-float {
  0%, 100% { opacity: 0.3; transform: translate(0,0); }
  50%      { opacity: 1;   transform: translate(2px,-3px); }
}
.etl-chat-fab.is-sleeping .etl-bot-avatar,
.etl-chat-fab.is-sleeping .etl-bot-img {
  animation: etl-bot-breathe 4.5s ease-in-out infinite !important;
}
@keyframes etl-bot-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(0.5px) scale(1.01); }
}

/* ────────────── Panel ────────────── */
.etl-chat-panel {
  position: fixed;
  left: 130px;          /* sit to the right of the Vector FAB */
  bottom: 22px;
  z-index: 9991;
  transform-origin: bottom left;
  width: 420px;
  max-width: calc(100vw - 150px);
  height: 620px;
  max-height: calc(100vh - 60px);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(252,252,254,0.96) 100%);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.85) inset,
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 8px 22px -4px rgba(0, 0, 0, 0.10),
    0 28px 64px -8px rgba(0, 0, 0, 0.28),
    0 48px 96px -16px rgba(229, 38, 41, 0.18);
  display: none;
  flex-direction: column;
  overflow: visible; /* allow speech-bubble tail to extend past left edge */
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
  animation: etl-chat-open 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
  border: 1px solid rgba(0, 0, 0, 0.04);
}
/* keep inner head + msgs visually clipped to rounded corners */
.etl-chat-head { border-top-left-radius: 22px; border-top-right-radius: 22px; }
.etl-chat-input-wrap { border-bottom-left-radius: 22px; border-bottom-right-radius: 22px; }
/* subtle red brand accent line at top */
.etl-chat-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(229,38,41,0.7) 30%, rgba(229,38,41,0.7) 70%, transparent);
  z-index: 2;
  pointer-events: none;
}
/* speech-bubble tail pointing toward Vector FAB (lower-left) */
.etl-chat-panel::after {
  content: "";
  position: absolute;
  left: -8px;
  /* FAB center ~ viewport bottom + 156. Panel bottom: 22 → tail at bottom: 125 to align */
  bottom: 120px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(252,252,254,0.97) 100%);
  border-left: 1px solid rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transform: rotate(45deg);
  border-radius: 4px;
  box-shadow: -4px 4px 10px -3px rgba(0,0,0,0.18);
  pointer-events: none;
  z-index: 1;
}
html[data-theme="dark"] .etl-chat-panel::after {
  background: linear-gradient(135deg, #1a1a1c, #1a1a1c);
  border-color: rgba(255,255,255,0.08);
}

/* Quick-reply chips after bot message */
.etl-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 12px 8px 52px;
  animation: etl-chat-msg-in 0.3s ease-out both;
}
.etl-chat-chip {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(229,38,41,0.06);
  color: #1D1D1B;
  border: 1px solid rgba(229,38,41,0.18);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.etl-chat-chip:hover {
  background: rgba(229,38,41,0.14);
  border-color: rgba(229,38,41,0.36);
  transform: translateY(-1px);
}

/* Streaming text cursor */
.etl-chat-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: currentColor;
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: etl-chat-blink 0.8s steps(2) infinite;
}
@keyframes etl-chat-blink { 50% { opacity: 0; } }

/* Typing v2 — dots + status text */
.etl-chat-typing__dots { display: inline-flex; gap: 4px; }
.etl-chat-typing__status {
  margin-left: 8px;
  font-size: 12px;
  color: #6b6b69;
  font-weight: 500;
}
html[data-theme="dark"] .etl-chat-typing__status { color: rgba(255,255,255,0.55); }

/* Drag-to-resize grip (bottom-right corner of panel) */
.etl-chat-resize {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 5;
  background:
    linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.18) 50%, rgba(0,0,0,0.18) 60%, transparent 60%, transparent 70%, rgba(0,0,0,0.18) 70%, rgba(0,0,0,0.18) 80%, transparent 80%);
  border-bottom-right-radius: 18px;
  opacity: 0.45;
  transition: opacity 0.15s;
}
.etl-chat-resize:hover { opacity: 0.85; }
html[data-theme="dark"] .etl-chat-resize {
  background:
    linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.22) 60%, transparent 60%, transparent 70%, rgba(255,255,255,0.22) 70%, rgba(255,255,255,0.22) 80%, transparent 80%);
}

/* Drop-zone state */
.etl-chat-input-wrap {
  position: relative;
  transition: background 0.15s, box-shadow 0.15s;
}
.etl-chat-input-wrap.is-dragging {
  background: rgba(229,38,41,0.06);
  box-shadow: inset 0 0 0 2px rgba(229,38,41,0.4);
  border-radius: 12px;
}
.etl-chat-input-wrap.is-dragging::after {
  content: "Отпустите файл — отправлю менеджеру";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #E52629;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  pointer-events: none;
}
html[data-theme="dark"] .etl-chat-input-wrap.is-dragging::after {
  background: rgba(20,20,22,0.95);
}

/* Markdown styles inside messages */
.etl-chat-msg ul {
  margin: 6px 0 6px 0;
  padding-left: 18px;
  list-style: disc;
}
.etl-chat-msg ul li { margin: 2px 0; }
.etl-chat-msg code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
  background: rgba(0,0,0,0.05);
  padding: 1px 5px;
  border-radius: 4px;
}
html[data-theme="dark"] .etl-chat-msg code { background: rgba(255,255,255,0.08); }
.etl-chat-msg strong { font-weight: 700; }
.etl-chat-msg em { font-style: italic; }
.etl-chat-panel.is-open { display: flex; }
.etl-chat-panel.is-leaving { animation: etl-chat-close 0.2s ease-in forwards; }
@keyframes etl-chat-open {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes etl-chat-close {
  to { opacity: 0; transform: translateY(20px) scale(0.95); }
}

/* Head — clean light theme with brand accents */
.etl-chat-head {
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafb 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
  color: #1D1D1B;
}
.etl-chat-head::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15,184,74,0.35), rgba(229,38,41,0.45), transparent);
}
.etl-chat-head__avatar {
  background: linear-gradient(135deg, #1D1D1B 0%, #0f0f0f 100%);
  color: #5cf18a;
  box-shadow: 0 0 0 1px rgba(92,241,138,0.18), 0 2px 6px -1px rgba(15,184,74,0.25);
}
.etl-chat-beta {
  background: rgba(15,184,74,0.10) !important;
  color: #0fb84a !important;
}

/* Dark theme — glossy Vector-helmet head */
html[data-theme="dark"] .etl-chat-head {
  background:
    radial-gradient(circle at 20% 30%, rgba(92,241,138,0.08), transparent 60%),
    linear-gradient(180deg, #1f2126 0%, #15171b 100%);
  border-bottom-color: rgba(0,0,0,0.4);
  color: #fff;
}
html[data-theme="dark"] .etl-chat-head__avatar {
  background: linear-gradient(135deg, #5cf18a 0%, #0fb84a 100%);
  color: #08221a;
  box-shadow: 0 0 0 2px rgba(92,241,138,0.18), 0 2px 8px -1px rgba(15,184,74,0.5);
}
html[data-theme="dark"] .etl-chat-beta {
  background: rgba(92,241,138,0.18) !important;
  color: #5cf18a !important;
}
.etl-chat-head__avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #E52629 0%, #c41f22 100%);
  border-radius: 8px;
  box-shadow: 0 2px 6px -1px rgba(229,38,41,0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.etl-chat-head__avatar svg { width: 16px; height: 16px; }
.etl-chat-head__avatar::before { content: none; }
.etl-chat-head__avatar .etl-bot-img,
.etl-chat-head__avatar svg.etl-bot-avatar { width: 30px; height: 30px; }
.etl-chat-head__avatar svg:not(.etl-bot-avatar) { width: 16px; height: 16px; color: #fff; }

/* Vector lift-arm slight bounce on hover (symmetric arm) */
.etl-bot-lift {
  transform-box: fill-box;
  transform-origin: center bottom;
}
.etl-chat-fab:hover .etl-bot-lift,
.etl-chat-head__avatar:hover .etl-bot-lift {
  animation: etl-bot-wave 0.9s ease both;
}
@keyframes etl-bot-wave {
  0%   { transform: translateY(0)   scale(1); }
  35%  { transform: translateY(-2px) scale(1.04); }
  60%  { transform: translateY(0)   scale(1); }
  100% { transform: translateY(0)   scale(1); }
}

/* Wheels rotate on hover (rolling forward feel) */
.v-wheel-grp {
  transform-box: fill-box;
  transform-origin: center;
}
.etl-chat-fab:hover .v-wheel-grp {
  animation: etl-bot-wheel 0.7s linear infinite;
}
@keyframes etl-bot-wheel { to { transform: rotate(360deg); } }

/* Cursor-following eyes — group transform set by JS via translate(...).
   Smooth out the change so jumps look natural. */
.etl-bot-look {
  transition: transform 0.18s ease-out;
}

/* (lid/brow removed in restored 18:31 version) */

/* (extended emote keyframes removed; restored 18:31 simple loop) */

/* Sleep — both lids fully closed, brows hidden */
.etl-chat-fab.is-sleeping .etl-bot-lid--top,
.etl-chat-fab.is-sleeping .etl-bot-lid--bot {
  animation: none !important;
  transform: scaleY(0.55) !important;
}

/* Robot avatar — Anki Vector style. img-first with SVG fallback. */
.etl-bot-img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.etl-bot-avatar.etl-bot-fallback {
  display: none; /* shown only on img onerror */
  width: 100%; height: 100%;
  transform-origin: center;
}
.etl-bot-avatar { display: block; transform-origin: center; }
/* Vector-style emote loop — blink, look-around, happy squint, surprise, skeptic.
   ~14s cycle. Both eyes share base emote; right eye picks up skeptic variant. */
.etl-bot-avatar .etl-bot-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: etl-vec-emote 14s infinite ease-in-out;
}
.etl-bot-avatar .etl-bot-eye--r {
  animation-name: etl-vec-emote-r;
  animation-delay: 0.05s;
}

/* Left eye (and base for both) */
@keyframes etl-vec-emote {
  /* idle */
  0%, 6%    { transform: none; }
  /* blink #1 */
  7%, 8%    { transform: scaleY(0.08); }
  9%, 17%   { transform: none; }
  /* look left */
  19%, 25%  { transform: translateX(-1.2px); }
  /* look right */
  28%, 34%  { transform: translateX(1.2px); }
  36%, 41%  { transform: none; }
  /* blink #2 */
  42%, 43%  { transform: scaleY(0.08); }
  /* happy squint — eyes flatten, slight upward curve mimic via scaleY+translateY */
  46%, 54%  { transform: scaleY(0.55) translateY(-0.6px); }
  /* return idle */
  56%, 63%  { transform: none; }
  /* surprise — eyes widen */
  65%, 70%  { transform: scale(1.18); }
  72%, 76%  { transform: none; }
  /* skeptic — left lowers a bit (right eye uses different keyframes) */
  78%, 83%  { transform: scaleY(0.7) translateY(0.6px); }
  85%, 90%  { transform: none; }
  /* blink #3 */
  91%, 92%  { transform: scaleY(0.08); }
  94%, 100% { transform: none; }
}

/* Right eye — same sequence but skeptic raises right eye-brow instead */
@keyframes etl-vec-emote-r {
  0%, 6%    { transform: none; }
  7%, 8%    { transform: scaleY(0.08); }
  9%, 17%   { transform: none; }
  19%, 25%  { transform: translateX(-1.2px); }
  28%, 34%  { transform: translateX(1.2px); }
  36%, 41%  { transform: none; }
  42%, 43%  { transform: scaleY(0.08); }
  46%, 54%  { transform: scaleY(0.55) translateY(-0.6px); }
  56%, 63%  { transform: none; }
  65%, 70%  { transform: scale(1.18); }
  72%, 76%  { transform: none; }
  /* skeptic — right stays normal (mismatched with left = expression) */
  78%, 83%  { transform: scaleY(1.05) translateY(-0.4px); }
  85%, 90%  { transform: none; }
  91%, 92%  { transform: scaleY(0.08); }
  94%, 100% { transform: none; }
}
.etl-chat-head__avatar:hover .etl-bot-avatar,
.etl-chat-fab:hover .etl-bot-avatar,
.etl-chat-head__avatar:hover .etl-bot-img,
.etl-chat-fab:hover .etl-bot-img { animation: etl-bot-tilt 0.55s ease both; }
@keyframes etl-bot-tilt {
  0%   { transform: rotate(0) translateY(0); }
  40%  { transform: rotate(-6deg) translateY(-1px); }
  70%  { transform: rotate(4deg) translateY(0); }
  100% { transform: rotate(0) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .etl-bot-avatar .etl-bot-eye,
  .etl-chat-head__avatar:hover .etl-bot-avatar,
  .etl-chat-fab:hover .etl-bot-avatar,
  .etl-chat-head__avatar:hover .etl-bot-img,
  .etl-chat-fab:hover .etl-bot-img { animation: none !important; }
}
.etl-chat-head__info { flex: 1; min-width: 0; }
.etl-chat-head__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: #1D1D1B;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.etl-chat-beta {
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(229, 38, 41, 0.1);
  color: #E52629;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.etl-chat-head__status {
  font-size: 11px;
  color: #6b6b69;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.etl-chat-head__status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.5);
}

.etl-chat-icon-btn {
  background: transparent;
  border: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  color: #6b6b69;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.etl-chat-icon-btn:hover { background: rgba(0,0,0,0.05); color: #1D1D1B; }
.etl-chat-icon-btn svg { width: 14px; height: 14px; }

/* Messages */
.etl-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafaf9;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.etl-chat-msgs::-webkit-scrollbar { width: 6px; }
.etl-chat-msgs::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

/* Empty state */
.etl-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  margin: auto 0;
}
.etl-chat-empty__avatar { display: none; }
.etl-chat-empty__greeting {
  font-size: 14px;
  line-height: 1.5;
  color: #2a2a28;
  margin-bottom: 18px;
  max-width: 280px;
}
.etl-chat-empty__suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 320px;
}
.etl-chat-suggestion {
  padding: 9px 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  font-size: 12.5px;
  color: #1D1D1B;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.etl-chat-suggestion:hover {
  background: #1D1D1B;
  border-color: #1D1D1B;
  color: #fff;
  transform: translateY(-1px);
}

/* Message bubbles */
.etl-chat-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: etl-chat-msg-in 0.22s ease-out both;
}
@keyframes etl-chat-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.etl-chat-msg--user {
  background: linear-gradient(135deg, #E52629 0%, #c41f22 100%);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px -3px rgba(229,38,41,0.45);
}
.etl-chat-msg--bot {
  background: linear-gradient(180deg, #ffffff 0%, #fafafb 100%);
  color: #1D1D1B;
  align-self: flex-start;
  border: 1px solid rgba(0,0,0,0.06);
  border-left: 3px solid #5cf18a;
  border-bottom-left-radius: 4px;
  max-width: 95%;
  position: relative;
  padding-left: 14px;
}
.etl-chat-msg--error {
  background: rgba(229, 38, 41, 0.06);
  color: #c41f22;
  border-color: rgba(229, 38, 41, 0.2);
}
.etl-chat-msg a:not(.etl-chat-action) {
  color: #E52629;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(229, 38, 41, 0.3);
}
.etl-chat-msg a:not(.etl-chat-action):hover { border-bottom-color: #E52629; }
.etl-chat-msg--user a:not(.etl-chat-action) { color: #fff; border-bottom-color: rgba(255,255,255,0.4); }
.etl-chat-msg strong { font-weight: 600; }

/* Tool result cards */
.etl-chat-card {
  margin-top: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.etl-chat-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b6b69;
  margin-bottom: 10px;
}
.etl-chat-card__head svg { width: 14px; height: 14px; }
.etl-chat-card--tariff .etl-chat-card__head svg { color: #E52629; }
.etl-chat-card--success {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.04), rgba(22, 163, 74, 0.02));
  border-color: rgba(22, 163, 74, 0.25);
}
.etl-chat-card--success .etl-chat-card__head { color: #16a34a; }
.etl-chat-card__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
}
.etl-chat-card__check svg { width: 11px; height: 11px; }
.etl-chat-card--error {
  background: rgba(229, 38, 41, 0.04);
  border-color: rgba(229, 38, 41, 0.2);
}
.etl-chat-card--error .etl-chat-card__head { color: #c41f22; }

.etl-chat-card__route {
  font-size: 14px;
  font-weight: 600;
  color: #1D1D1B;
  margin-bottom: 6px;
}
.etl-chat-card__params {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.etl-chat-card__params span {
  font-size: 11.5px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
  color: #4a4a48;
  font-weight: 500;
}
.etl-chat-card__eta {
  background: rgba(229, 38, 41, 0.08) !important;
  color: #E52629 !important;
  font-weight: 600 !important;
}
html[data-theme="dark"] .etl-chat-card__eta {
  background: rgba(229, 38, 41, 0.18) !important;
  color: #ff6063 !important;
}
.etl-chat-card__prices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.02);
  border-radius: 10px;
}
.etl-chat-card__price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.etl-chat-card__price-row:last-child { border-bottom: 0; }
.etl-chat-card__price-row--accent {
  background: linear-gradient(135deg, rgba(229,38,41,0.08), rgba(229,38,41,0.02));
  margin: 0 -12px;
  padding: 8px 12px;
  border-radius: 6px;
  border-bottom: 0;
}
.etl-chat-card__price-row--accent .etl-chat-card__price-num {
  color: #E52629;
  font-size: 17px;
}
.etl-chat-card__price-tag {
  font-size: 12px;
  color: #6b6b69;
  font-weight: 500;
}
.etl-chat-card__price-num {
  font-size: 14px;
  font-weight: 700;
  color: #1D1D1B;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
html[data-theme="dark"] .etl-chat-card__prices { background: rgba(255,255,255,0.04); }
html[data-theme="dark"] .etl-chat-card__price-row { border-bottom-color: rgba(255,255,255,0.06); }
html[data-theme="dark"] .etl-chat-card__price-tag { color: rgba(255,255,255,0.65); }
html[data-theme="dark"] .etl-chat-card__price-num { color: #fff; }
.etl-chat-card__note {
  font-size: 11.5px;
  color: #6b6b69;
  line-height: 1.4;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.02);
  border-radius: 6px;
}
.etl-chat-card__body {
  font-size: 13px;
  line-height: 1.5;
  color: #2a2a28;
  margin-bottom: 10px;
}
.etl-chat-card__body code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 11px;
}
.etl-chat-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.etl-chat-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1D1D1B;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.etl-chat-action:hover {
  background: #1D1D1B;
  border-color: #1D1D1B;
  color: #fff;
}
.etl-chat-action--primary {
  background: #E52629;
  border-color: #E52629;
  color: #fff;
}
.etl-chat-action--primary:hover {
  background: #c41f22;
  border-color: #c41f22;
}
.etl-chat-action svg { width: 13px; height: 13px; }

/* Typing indicator */
.etl-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}
.etl-chat-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #8a8a88;
  animation: etl-chat-bounce 1.2s ease-in-out infinite;
}
.etl-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.etl-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes etl-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* Input */
.etl-chat-input-wrap {
  padding: 10px 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.etl-chat-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #1D1D1B;
  background: #fafaf9;
}
.etl-chat-input:focus {
  border-color: #E52629;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(229, 38, 41, 0.08);
}
.etl-chat-send {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #E52629;
  border: 0;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.etl-chat-send:hover:not(:disabled) {
  background: #c41f22;
  transform: scale(1.05);
}
.etl-chat-send:active:not(:disabled) { transform: scale(0.96); }
.etl-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.etl-chat-send svg { width: 16px; height: 16px; }

/* Footer */
.etl-chat-foot {
  padding: 8px 14px 9px;
  background: #fff;
  font-size: 10.5px;
  color: #8a8a88;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.04);
}
.etl-chat-foot kbd {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 10px;
  color: #1D1D1B;
  margin: 0 2px;
}

/* ─────────── New components ─────────── */
/* Handoff button — red accent in head */
.etl-chat-icon-btn.etl-chat-handoff-btn {
  background: rgba(229, 38, 41, 0.10);
  color: #E52629;
}
.etl-chat-icon-btn.etl-chat-handoff-btn:hover { background: rgba(229, 38, 41, 0.18); color: #E52629; }
.etl-chat-handoff {
  position: absolute;
  top: 60px; right: 14px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px -4px rgba(0,0,0,0.22);
  padding: 6px;
  z-index: 10;
  min-width: 220px;
  animation: etl-chat-msg-in 0.18s ease-out both;
}
.etl-chat-handoff__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1D1D1B;
  background: transparent; border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
.etl-chat-handoff__item:hover { background: rgba(0,0,0,0.05); }
html[data-theme="dark"] .etl-chat-handoff { background: #1f1f22; box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
html[data-theme="dark"] .etl-chat-handoff__item { color: #fff; }
html[data-theme="dark"] .etl-chat-handoff__item:hover { background: rgba(255,255,255,0.08); }

/* Poke easter-egg speech bubble — fixed, always above chat panel */
.etl-chat-poke {
  position: fixed;
  /* JS sets left + top; we shift to anchor center-bottom on those coords */
  transform: translate(-50%, -100%);
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
  color: #1D1D1B;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 18px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 99999;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 0 0 1px rgba(0,0,0,0.05),
    0 12px 28px -6px rgba(0,0,0,0.25),
    0 4px 10px -2px rgba(229,38,41,0.15);
  animation: etl-poke-pop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.etl-chat-poke::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: #f5f5f7;
  margin-top: -6px;
  border-right: 1px solid rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  border-radius: 2px;
}
.etl-chat-poke.is-leaving {
  animation: etl-poke-out 0.5s ease forwards;
}
@keyframes etl-poke-pop {
  0%   { opacity: 0; transform: translate(-50%, -90%) scale(0.7); }
  100% { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}
@keyframes etl-poke-out {
  to { opacity: 0; transform: translate(-50%, -110%) scale(0.92); }
}
html[data-theme="dark"] .etl-chat-poke {
  background: linear-gradient(180deg, #2a2a2c 0%, #18181a 100%);
  color: #fff;
  box-shadow: 0 12px 28px -6px rgba(0,0,0,0.6);
}
html[data-theme="dark"] .etl-chat-poke::after { background: #18181a; border-color: rgba(255,255,255,0.08); }

/* Status offline state */
.etl-chat-head__status.is-offline::before { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }

/* Voice input mic button */
.etl-chat-mic {
  background: transparent;
  border: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b6b69;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-right: 4px;
}
.etl-chat-mic:hover { background: rgba(0,0,0,0.05); color: #1D1D1B; }
.etl-chat-mic svg { width: 18px; height: 18px; }
.etl-chat-mic.is-listening {
  color: #E52629;
  background: rgba(229,38,41,0.1);
  animation: etl-mic-pulse 1.2s ease-in-out infinite;
}
@keyframes etl-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,38,41,0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(229,38,41,0); }
}
html[data-theme="dark"] .etl-chat-mic { color: rgba(255,255,255,0.55); }
html[data-theme="dark"] .etl-chat-mic:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* 👍 / 👎 feedback */
.etl-chat-feedback {
  display: flex; gap: 4px;
  padding: 0 12px 4px 52px;
  margin-top: -4px;
  animation: etl-chat-msg-in 0.3s ease-out both;
}
.etl-chat-fb-btn {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.06);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: #6b6b69;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.15s, border-color 0.15s;
}
.etl-chat-fb-btn:hover { background: rgba(0,0,0,0.05); color: #1D1D1B; transform: scale(1.08); }
.etl-chat-fb-btn svg { width: 13px; height: 13px; }
.etl-chat-fb-btn[data-fb="up"].is-active { background: rgba(34, 197, 94, 0.15); color: #16a34a; border-color: #16a34a; }
.etl-chat-fb-btn[data-fb="down"].is-active { background: rgba(229, 38, 41, 0.15); color: #E52629; border-color: #E52629; }
.etl-chat-feedback.is-rated .etl-chat-fb-btn:not(.is-active) { opacity: 0.3; pointer-events: none; }
html[data-theme="dark"] .etl-chat-fb-btn { border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.55); }
html[data-theme="dark"] .etl-chat-fb-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* Inline calculator widget */
.etl-chat-calc {
  background: linear-gradient(180deg, #fff 0%, #fafafb 100%);
  border: 1px solid rgba(229, 38, 41, 0.18);
  border-radius: 12px;
  padding: 14px;
  margin: 0 12px 8px 52px;
  display: flex; flex-direction: column; gap: 10px;
  animation: etl-chat-msg-in 0.3s ease-out both;
  box-shadow: 0 4px 12px -2px rgba(229,38,41,0.10);
}
.etl-chat-calc__head {
  font-size: 13px; font-weight: 700; color: #1D1D1B;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 2px;
}
.etl-chat-calc__row {
  display: flex; flex-direction: column; gap: 4px;
}
.etl-chat-calc__row label { font-size: 11px; font-weight: 600; color: #6b6b69; }
.etl-chat-calc__row select,
.etl-chat-calc__row input {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  background: #fff;
  color: #1D1D1B;
  outline: none;
  width: 100%;
}
.etl-chat-calc__row select:focus,
.etl-chat-calc__row input:focus { border-color: #E52629; }
.etl-chat-calc__row--split { flex-direction: row; gap: 8px; }
.etl-chat-calc__row--split label { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.etl-chat-calc__btn {
  font-family: inherit;
  background: linear-gradient(135deg, #E52629 0%, #c41f22 100%);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.etl-chat-calc__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -3px rgba(229,38,41,0.45);
}
html[data-theme="dark"] .etl-chat-calc {
  background: linear-gradient(180deg, #1f1f22 0%, #18181a 100%);
  border-color: rgba(229,38,41,0.22);
}
html[data-theme="dark"] .etl-chat-calc__row select,
html[data-theme="dark"] .etl-chat-calc__row input {
  background: #2a2a2c; color: #fff; border-color: rgba(255,255,255,0.12);
}

/* Geolocation hint */
.etl-chat-geo {
  background: rgba(229, 38, 41, 0.06);
  border: 1px dashed rgba(229, 38, 41, 0.32);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0 12px 8px 12px;
  font-size: 12px;
  color: #1D1D1B;
}
html[data-theme="dark"] .etl-chat-geo { color: rgba(255,255,255,0.85); border-color: rgba(229,38,41,0.4); }

/* Page-context suggestion accent */
.etl-chat-suggestion--ctx {
  background: linear-gradient(135deg, rgba(229,38,41,0.08), rgba(229,38,41,0.04)) !important;
  border-color: rgba(229,38,41,0.25) !important;
  color: #1D1D1B !important;
  font-weight: 700 !important;
}

/* ─────────── Mobile adaptation ─────────── */
@media (max-width: 640px) {
  .etl-chat-fab {
    left: 12px;
    bottom: 90px; /* clear of cta */
    height: 72px;
    max-width: 240px;
  }
  .etl-chat-fab__avatar { width: 72px; height: 72px; }
  .etl-chat-fab__avatar .etl-bot-avatar,
  .etl-chat-fab__avatar .etl-bot-img { width: 72px; height: 72px; }
  .etl-chat-fab__label { display: none; }

  .etl-chat-panel {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 90vh !important;
    max-height: 90vh !important;
    border-radius: 22px 22px 0 0 !important;
  }
  .etl-chat-panel::after { display: none; } /* hide tail on mobile */
  .etl-chat-resize { display: none; }
  .etl-chat-handoff { right: 6px; min-width: 200px; }

  .etl-chat-msg { font-size: 14px; }
  .etl-chat-chip { padding: 9px 14px; font-size: 13px; }
  .etl-chat-chips, .etl-chat-feedback, .etl-chat-calc { padding-left: 16px; margin-left: 0; }

  .etl-chat-empty__suggestions { gap: 6px; }
  .etl-chat-suggestion { padding: 10px 14px; font-size: 13px; }

  .etl-chat-input { font-size: 16px; } /* prevent iOS zoom */
  .etl-chat-icon-btn { width: 36px; height: 36px; }
}

@media (max-width: 480px) {
  .etl-chat-fab {
    left: 10px;
    bottom: 80px;
    height: 64px;
    max-width: 64px;
    padding: 0;
  }
  .etl-chat-fab__avatar { width: 64px; height: 64px; }
  .etl-chat-fab__avatar .etl-bot-avatar,
  .etl-chat-fab__avatar .etl-bot-img { width: 64px; height: 64px; }
  .etl-chat-panel {
    height: 92vh !important;
    max-height: 92vh !important;
  }
  .etl-chat-head { padding: 12px 12px; }
  .etl-chat-msgs { padding: 12px; }
  .etl-chat-input-wrap { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .etl-chat-fab, .etl-chat-panel, .etl-chat-msg, .etl-chat-fab__avatar::after { animation: none !important; transition: none !important; }
}

/* Dark theme */
html[data-theme="dark"] .etl-chat-panel { background: #1a1a1c; border-color: rgba(255,255,255,0.08); }
html[data-theme="dark"] .etl-chat-head { background: #1a1a1c; border-bottom-color: rgba(255,255,255,0.06); }
html[data-theme="dark"] .etl-chat-head__title { color: #fff; }
html[data-theme="dark"] .etl-chat-head__status { color: rgba(255,255,255,0.55); }
html[data-theme="dark"] .etl-chat-icon-btn { color: rgba(255,255,255,0.55); }
html[data-theme="dark"] .etl-chat-icon-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
html[data-theme="dark"] .etl-chat-msgs { background: #131316; }
html[data-theme="dark"] .etl-chat-msg--bot { background: #2a2a2c; color: rgba(255,255,255,0.94); border-color: rgba(255,255,255,0.06); }
html[data-theme="dark"] .etl-chat-msg--user { background: #E52629; }
html[data-theme="dark"] .etl-chat-empty__greeting { color: rgba(255,255,255,0.78); }
html[data-theme="dark"] .etl-chat-suggestion { background: #2a2a2c; color: rgba(255,255,255,0.94); border-color: rgba(255,255,255,0.08); }
html[data-theme="dark"] .etl-chat-suggestion:hover { background: #fff; color: #1D1D1B; border-color: #fff; }
html[data-theme="dark"] .etl-chat-card { background: #2a2a2c; border-color: rgba(255,255,255,0.06); }
html[data-theme="dark"] .etl-chat-card__route { color: #fff; }
html[data-theme="dark"] .etl-chat-card__params span { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.78); }
html[data-theme="dark"] .etl-chat-card__price { background: linear-gradient(135deg, rgba(229,38,41,0.16), rgba(229,38,41,0.08)); }
html[data-theme="dark"] .etl-chat-action { background: #2a2a2c; color: #fff; border-color: rgba(255,255,255,0.12); }
html[data-theme="dark"] .etl-chat-action:hover { background: #fff; color: #1D1D1B; border-color: #fff; }
html[data-theme="dark"] .etl-chat-input-wrap, html[data-theme="dark"] .etl-chat-foot { background: #1a1a1c; border-color: rgba(255,255,255,0.06); }
html[data-theme="dark"] .etl-chat-input { background: #2a2a2c; color: #fff; border-color: rgba(255,255,255,0.1); }
html[data-theme="dark"] .etl-chat-input:focus { background: #1a1a1c; }
html[data-theme="dark"] .etl-chat-typing { background: #2a2a2c; border-color: rgba(255,255,255,0.06); }
html[data-theme="dark"] .etl-chat-foot { color: rgba(255,255,255,0.45); }
html[data-theme="dark"] .etl-chat-foot kbd { background: rgba(255,255,255,0.08); color: #fff; }

/* ───────────────── PREMIUM POLISH v25-04 ───────────────── */
.etl-chat-panel {
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 18px 44px rgba(15, 15, 20, 0.16),
    0 36px 80px -18px rgba(15, 15, 20, 0.30),
    0 -1px 0 rgba(0,0,0,0.04) inset;
}
.etl-chat-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 22%);
  pointer-events: none;
  mix-blend-mode: overlay;
}
.etl-chat-head {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
  border-bottom-color: rgba(0,0,0,0.04);
}
.etl-chat-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229,38,41,0.18), transparent);
}
.etl-chat-msgs {
  background:
    radial-gradient(1200px 320px at 50% -100px, rgba(229,38,41,0.05), transparent 60%),
    linear-gradient(180deg, #fafafa 0%, #f6f6f7 100%);
}
.etl-chat-msg--user {
  background: linear-gradient(135deg, #1D1D1B 0%, #2c2c29 100%);
  box-shadow: 0 6px 14px -6px rgba(0,0,0,0.35);
}
.etl-chat-msg--bot {
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px -16px rgba(0,0,0,0.18);
}
.etl-chat-card {
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -20px rgba(0,0,0,0.18);
}
.etl-chat-card--tariff {
  position: relative;
  overflow: hidden;
}
.etl-chat-card--tariff::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #E52629, #ff6063, #E52629);
}
.etl-chat-card__price-row--accent {
  border-radius: 8px;
  padding-left: 8px; padding-right: 8px;
  margin: 4px -4px;
  background: linear-gradient(135deg, rgba(229,38,41,0.10), rgba(229,38,41,0.04));
  border: 1px solid rgba(229,38,41,0.18);
}
/* Action buttons — premium feel + fix invisible text.
   Force opacity 1 so msg-in fade-in never hides button label. */
.etl-chat-action,
.etl-chat-msg .etl-chat-action,
.etl-chat-msg a.etl-chat-action,
.etl-chat-msg button.etl-chat-action {
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  letter-spacing: 0.005em;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.2s;
  opacity: 1 !important;
  animation: none !important;
}
.etl-chat-action:hover { transform: translateY(-1px); }
.etl-chat-action--primary,
.etl-chat-msg .etl-chat-action--primary,
.etl-chat-msg a.etl-chat-action--primary {
  background: linear-gradient(135deg, #E52629 0%, #c41f22 100%);
  color: #fff !important;
  border-color: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: 0 4px 10px -2px rgba(229,38,41,0.45), 0 1px 0 rgba(255,255,255,0.18) inset;
}
.etl-chat-action--primary:hover,
.etl-chat-msg .etl-chat-action--primary:hover,
.etl-chat-msg a.etl-chat-action--primary:hover {
  background: linear-gradient(135deg, #ff3438 0%, #d8252a 100%);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 8px 18px -4px rgba(229,38,41,0.55), 0 1px 0 rgba(255,255,255,0.22) inset;
}
.etl-chat-msg .etl-chat-action,
.etl-chat-msg a.etl-chat-action {
  color: #1D1D1B;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.etl-chat-msg .etl-chat-action:hover,
.etl-chat-msg a.etl-chat-action:hover {
  color: #fff;
}
.etl-chat-input:focus {
  border-color: rgba(229,38,41,0.35);
  box-shadow: 0 0 0 4px rgba(229,38,41,0.10);
}
.etl-chat-suggest {
  transition: transform 0.15s ease, background 0.15s, border-color 0.15s;
}
.etl-chat-suggest:hover {
  transform: translateY(-1px);
  border-color: rgba(229,38,41,0.45);
}

/* Dark theme — premium */
html[data-theme="dark"] .etl-chat-panel {
  background: linear-gradient(180deg, #1c1c1e 0%, #161618 100%);
  border-color: rgba(255,255,255,0.06);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 24px 60px rgba(0,0,0,0.55),
    0 36px 80px -18px rgba(0,0,0,0.6);
}
html[data-theme="dark"] .etl-chat-head {
  background: linear-gradient(180deg, #1c1c1e 0%, #18181a 100%);
}
html[data-theme="dark"] .etl-chat-msgs {
  background:
    radial-gradient(1200px 320px at 50% -100px, rgba(229,38,41,0.10), transparent 60%),
    linear-gradient(180deg, #131315 0%, #0f0f11 100%);
}
html[data-theme="dark"] .etl-chat-card {
  background: linear-gradient(180deg, #2a2a2c 0%, #232325 100%);
}
html[data-theme="dark"] .etl-chat-action--primary {
  background: linear-gradient(135deg, #E52629 0%, #c41f22 100%);
  border-color: transparent;
  color: #fff;
}

/* ─────── Inline Lead Stepper (пошаговая заявка) ─────── */
.etl-chat-stepper-wrap { padding: 0 !important; background: transparent !important; }
.etl-chat-stepper {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border: 1px solid rgba(0,0,0,0.06);
  border-left: 3px solid #5cf18a;
  border-radius: 14px;
  box-shadow: 0 4px 14px -6px rgba(0,0,0,0.10);
  font-size: 14px;
  color: #1D1D1B;
}
.etl-chat-stepper__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.etl-chat-stepper__title { font-weight: 600; font-size: 14px; }
.etl-chat-stepper__count {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: rgba(29,29,27,0.55); text-transform: uppercase;
}
.etl-chat-stepper__progress {
  height: 4px; background: rgba(0,0,0,0.07); border-radius: 2px; overflow: hidden;
}
.etl-chat-stepper__bar {
  height: 100%; background: linear-gradient(90deg, #5cf18a 0%, #34c759 100%);
  border-radius: 2px; transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.etl-chat-stepper__label {
  font-weight: 500; font-size: 13px; color: #1D1D1B; margin-top: 2px;
}
.etl-chat-stepper__req { color: #E52629; }
.etl-chat-stepper__input {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; font: inherit; font-size: 15px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12); border-radius: 10px;
  color: #1D1D1B;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.etl-chat-stepper__input:focus {
  outline: none;
  border-color: rgba(229,38,41,0.45);
  box-shadow: 0 0 0 3px rgba(229,38,41,0.12);
}
textarea.etl-chat-stepper__input { resize: vertical; min-height: 60px; }
.etl-chat-stepper__hint { font-size: 12px; color: rgba(29,29,27,0.55); }
.etl-chat-stepper__err { font-size: 12px; color: #E52629; font-weight: 500; }
.etl-chat-stepper__actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px;
}
.etl-chat-stepper__btn {
  appearance: none; cursor: pointer; font: inherit;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  border-radius: 10px; border: 1px solid rgba(0,0,0,0.10);
  background: #fff; color: #1D1D1B;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.etl-chat-stepper__btn:hover { transform: translateY(-1px); border-color: rgba(0,0,0,0.20); }
.etl-chat-stepper__btn--primary {
  background: linear-gradient(135deg, #E52629 0%, #c41f22 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 14px -4px rgba(229,38,41,0.45);
  margin-left: auto;
}
.etl-chat-stepper__btn--primary:hover { box-shadow: 0 8px 18px -4px rgba(229,38,41,0.55); }
.etl-chat-stepper__btn--ghost { background: transparent; }
.etl-chat-stepper__btn--text {
  background: transparent; border-color: transparent; color: rgba(29,29,27,0.55);
  padding: 9px 8px;
}
.etl-chat-stepper__btn--text:hover { color: #1D1D1B; transform: none; }

/* Dark theme stepper */
html[data-theme="dark"] .etl-chat-stepper {
  background: linear-gradient(180deg, #2a2a2c 0%, #232325 100%);
  border-color: rgba(255,255,255,0.06);
  border-left-color: #5cf18a;
  color: #f5f5f7;
}
html[data-theme="dark"] .etl-chat-stepper__label { color: #f5f5f7; }
html[data-theme="dark"] .etl-chat-stepper__count,
html[data-theme="dark"] .etl-chat-stepper__hint { color: rgba(245,245,247,0.55); }
html[data-theme="dark"] .etl-chat-stepper__progress { background: rgba(255,255,255,0.08); }
html[data-theme="dark"] .etl-chat-stepper__input {
  background: #1a1a1c; color: #f5f5f7;
  border-color: rgba(255,255,255,0.10);
}
html[data-theme="dark"] .etl-chat-stepper__btn {
  background: rgba(255,255,255,0.06); color: #f5f5f7;
  border-color: rgba(255,255,255,0.10);
}
html[data-theme="dark"] .etl-chat-stepper__btn--text {
  background: transparent; border-color: transparent;
  color: rgba(245,245,247,0.55);
}
html[data-theme="dark"] .etl-chat-stepper__btn--text:hover { color: #f5f5f7; }

/* Stepper — city dropdowns + cargo grid + quote card */
.etl-chat-stepper__sublabel {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: rgba(29,29,27,0.55); text-transform: uppercase; margin-bottom: 4px;
}
.etl-chat-stepper__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.etl-chat-stepper__select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%231D1D1B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.etl-chat-stepper__quote {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(92,241,138,0.10) 0%, rgba(52,199,89,0.06) 100%);
  border: 1px solid rgba(52,199,89,0.25);
  border-radius: 10px;
  margin-top: 4px;
}
.etl-chat-stepper__quote--miss {
  background: rgba(229,38,41,0.06);
  border-color: rgba(229,38,41,0.20);
  color: rgba(29,29,27,0.75);
  font-size: 13px;
}
.etl-chat-stepper__quote-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px;
}
.etl-chat-stepper__quote-label {
  color: rgba(29,29,27,0.55); font-weight: 500;
}
.etl-chat-stepper__quote-val { font-weight: 600; text-align: right; }
.etl-chat-stepper__quote-price {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 6px; padding-top: 8px;
  border-top: 1px dashed rgba(52,199,89,0.30);
}
.etl-chat-stepper__quote-amount {
  font-size: 22px; font-weight: 700; color: #1D1D1B;
  letter-spacing: -0.01em;
}
.etl-chat-stepper__quote-vat {
  font-size: 11px; color: rgba(29,29,27,0.55); text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 500;
}
.etl-chat-stepper__quote-note {
  font-size: 12px; color: rgba(29,29,27,0.65); line-height: 1.45;
}
.etl-chat-stepper__summary {
  font-size: 13px; line-height: 1.55;
  padding: 10px 12px;
  background: rgba(0,0,0,0.03);
  border-radius: 8px;
  color: rgba(29,29,27,0.85);
}

/* Dark theme for new stepper bits */
html[data-theme="dark"] .etl-chat-stepper__sublabel { color: rgba(245,245,247,0.55); }
html[data-theme="dark"] .etl-chat-stepper__select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23f5f5f7' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
html[data-theme="dark"] .etl-chat-stepper__quote {
  background: linear-gradient(180deg, rgba(92,241,138,0.12) 0%, rgba(52,199,89,0.06) 100%);
  border-color: rgba(92,241,138,0.30);
}
html[data-theme="dark"] .etl-chat-stepper__quote-amount { color: #f5f5f7; }
html[data-theme="dark"] .etl-chat-stepper__quote-label,
html[data-theme="dark"] .etl-chat-stepper__quote-vat,
html[data-theme="dark"] .etl-chat-stepper__quote-note { color: rgba(245,245,247,0.55); }
html[data-theme="dark"] .etl-chat-stepper__summary {
  background: rgba(255,255,255,0.05); color: rgba(245,245,247,0.85);
}

/* Pretty lead number badge inside success card */
.etl-chat-leadno {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 12px; padding: 10px 14px;
  background: rgba(0,0,0,0.04);
  border: 1px dashed rgba(0,0,0,0.12);
  border-radius: 10px;
}
.etl-chat-leadno__label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(29,29,27,0.55);
}
.etl-chat-leadno__val {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
  color: #1D1D1B;
}
html[data-theme="dark"] .etl-chat-leadno {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.10);
}
html[data-theme="dark"] .etl-chat-leadno__label { color: rgba(245,245,247,0.55); }
html[data-theme="dark"] .etl-chat-leadno__val { color: #f5f5f7; }
