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

/* ────────────── FAB Trigger (premium 3D) ────────────── */
.etl-chat-fab {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 9990;
  height: 60px;
  padding: 0 8px 0 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #232327 0%, #131316 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 -1px 0 rgba(0,0,0,0.4) inset,
    0 10px 22px rgba(0, 0, 0, 0.30),
    0 22px 50px -14px rgba(229, 38, 41, 0.55),
    0 0 0 1px rgba(229, 38, 41, 0.08);
  transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              gap 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease;
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  max-width: 320px;
}
.etl-chat-fab::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  background: conic-gradient(from 0deg, #E52629, #ff6063, #ff9092, #E52629, #c41f22, #E52629);
  z-index: -1;
  opacity: 0.85;
  filter: blur(2px);
  animation: etl-chat-ring 5s linear infinite;
}
.etl-chat-fab::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0) 35%);
  pointer-events: none;
}
@keyframes etl-chat-ring { to { transform: rotate(360deg); } }
.etl-chat-fab:hover {
  transform: translateY(-3px) scale(1.02);
  padding: 0 22px 0 8px;
  gap: 12px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.14) inset,
    0 -1px 0 rgba(0,0,0,0.4) inset,
    0 16px 36px rgba(0, 0, 0, 0.36),
    0 30px 64px -14px rgba(229, 38, 41, 0.7),
    0 0 0 1px rgba(229, 38, 41, 0.18);
}
.etl-chat-fab:active { transform: translateY(-1px) scale(0.99); }
.etl-chat-fab:focus-visible { outline: 2px solid #E52629; outline-offset: 4px; }
.etl-chat-fab__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.35), transparent 55%),
    linear-gradient(135deg, #ff3438 0%, #E52629 50%, #b51b1e 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35) inset,
    0 -1px 0 rgba(0,0,0,0.25) inset,
    0 4px 10px rgba(229,38,41,0.45),
    0 0 0 1px rgba(0,0,0,0.15);
}
.etl-chat-fab__avatar svg.etl-bot-avatar {
  width: 32px; height: 32px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
.etl-chat-fab__avatar svg:not(.etl-bot-avatar) {
  width: 22px; height: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35));
}
.etl-chat-fab__avatar::after {
  content: "";
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #16a34a;
  border: 2px solid rgba(20, 20, 22, 1);
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.7);
  animation: etl-chat-dot-pulse 2s ease-in-out infinite;
}
@keyframes etl-chat-dot-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
.etl-chat-fab__label {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  letter-spacing: 0.005em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  transition: max-width 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: 200px;
  opacity: 1;
}
.etl-chat-fab__label small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 1px;
  letter-spacing: 0.02em;
}
@media (max-width: 640px) {
  .etl-chat-fab {
    padding: 0 6px;
    gap: 0;
    max-width: 52px;
  }
  .etl-chat-fab:hover { padding: 0 6px; gap: 0; }
  .etl-chat-fab__label { display: none; }
}

/* ────────────── Panel ────────────── */
.etl-chat-panel {
  position: fixed;
  left: 20px;
  bottom: 88px;
  z-index: 9991;
  transform-origin: bottom left;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 18px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.18),
    0 28px 64px -12px rgba(0, 0, 0, 0.32);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
  animation: etl-chat-open 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.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 — minimal Linear style */
.etl-chat-head {
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.etl-chat-head__avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 25%, #2a2a2c 0%, #15151700 70%), linear-gradient(135deg, #1D1D1B, #0f0f0f);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 4px 10px -3px rgba(229,38,41,0.35);
}
.etl-chat-head__avatar svg.etl-bot-avatar { width: 26px; height: 26px; }
.etl-chat-head__avatar svg:not(.etl-bot-avatar) { width: 16px; height: 16px; color: #fff; }

/* Robot avatar — blink + idle hover float */
.etl-bot-avatar { display: block; transform-origin: center; }
.etl-bot-avatar .etl-bot-eye {
  transform-origin: center;
  animation: etl-bot-blink 4.6s infinite ease-in-out;
}
.etl-bot-avatar .etl-bot-eye--r { animation-delay: 0.04s; }
@keyframes etl-bot-blink {
  0%, 92%, 100% { transform: scaleY(1); opacity: 1; }
  94%, 96%      { transform: scaleY(0.1); opacity: 0.8; }
}
.etl-chat-head__avatar:hover .etl-bot-avatar { animation: etl-bot-tilt 0.5s ease both; }
@keyframes etl-bot-tilt {
  0%   { transform: rotate(0); }
  40%  { transform: rotate(-6deg); }
  70%  { transform: rotate(4deg); }
  100% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .etl-bot-avatar .etl-bot-eye, .etl-chat-head__avatar:hover .etl-bot-avatar { 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 {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1D1D1B, #2a2a28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px -8px rgba(229, 38, 41, 0.3);
}
.etl-chat-empty__avatar svg.etl-bot-avatar { width: 44px; height: 44px; }
.etl-chat-empty__avatar svg:not(.etl-bot-avatar) { width: 26px; height: 26px; color: #fff; }
.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: #1D1D1B;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.etl-chat-msg--bot {
  background: #fff;
  color: #1D1D1B;
  align-self: flex-start;
  border: 1px solid rgba(0,0,0,0.06);
  border-bottom-left-radius: 4px;
  max-width: 95%;
}
.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;
}

@media (max-width: 480px) {
  .etl-chat-fab { left: 14px; bottom: 14px; }
  .etl-chat-panel {
    left: 8px;
    right: 8px;
    bottom: 78px;
    width: auto;
    max-width: none;
    height: 75vh;
  }
}

@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;
}
