:root {
  --chat-burgundy: #08713c;
  --chat-burgundy-dark: #044c29;
  --chat-green: #78051f;
  --chat-ink: #172024;
  --chat-muted: #66706c;
  --chat-line: #dde4e0;
  --chat-soft: #f4f7f5;
  --chat-white: #fff;
}

.tc-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 998;
  min-height: 58px;
  padding: 0 19px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--chat-burgundy-dark), var(--chat-burgundy));
  box-shadow: 0 16px 40px rgba(4,76,41,.3);
  cursor: pointer;
  font: 800 12px/1 "Inter", Arial, sans-serif;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tc-chat-launcher:hover { transform: translateY(-3px); box-shadow: 0 20px 48px rgba(4,76,41,.38); }
.tc-chat-launcher:focus-visible { outline: 3px solid rgba(8,113,60,.35); outline-offset: 3px; }
.tc-chat-launcher-icon { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--chat-burgundy); background: white; }
.tc-chat-launcher-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tc-chat-launcher-dot { position: absolute; top: 0; right: 0; width: 10px; height: 10px; border: 2px solid var(--chat-burgundy); border-radius: 50%; background: #42cf79; }

.tc-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 999;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 118px));
  min-height: 480px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid rgba(219,226,222,.95);
  border-radius: 20px;
  background: white;
  box-shadow: 0 26px 80px rgba(24,31,28,.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(.97);
  transform-origin: bottom right;
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
  font-family: "Inter", Arial, sans-serif;
}
.tc-chat-panel.tc-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.tc-chat-header { position: relative; overflow: hidden; padding: 18px 18px 17px; display: grid; grid-template-columns: 45px 1fr auto; gap: 11px; align-items: center; color: white; background: linear-gradient(120deg, var(--chat-burgundy-dark), var(--chat-burgundy) 72%, #0a8650); }
.tc-chat-header::after { content: ""; position: absolute; right: -35px; top: -60px; width: 145px; height: 145px; border: 28px solid rgba(255,255,255,.07); border-radius: 50%; }
.tc-chat-avatar { position: relative; z-index: 1; width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; background: white; }
.tc-chat-avatar svg { width: 31px; height: 36px; }
.tc-chat-heading { position: relative; z-index: 1; min-width: 0; }
.tc-chat-heading strong { display: block; font-size: 14px; line-height: 1.2; }
.tc-chat-status { margin-top: 4px; display: flex; align-items: center; gap: 6px; color: #f1dfe4; font-size: 10px; }
.tc-chat-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #53d887; box-shadow: 0 0 0 4px rgba(83,216,135,.12); }
.tc-chat-close { position: relative; z-index: 1; width: 36px; height: 36px; border: 0; border-radius: 50%; color: white; background: rgba(255,255,255,.1); cursor: pointer; font-size: 24px; font-weight: 400; line-height: 1; }
.tc-chat-close:hover { background: rgba(255,255,255,.2); }

.tc-chat-body { overflow-y: auto; padding: 18px 16px 14px; background: linear-gradient(180deg, #f8faf9, #f1f5f3); scroll-behavior: smooth; }
.tc-chat-date { margin: 0 0 14px; color: #8a938f; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.tc-message-row { margin: 0 0 11px; display: flex; align-items: flex-end; gap: 8px; }
.tc-message-row.tc-user { justify-content: flex-end; }
.tc-message-avatar { flex: 0 0 27px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--chat-burgundy); font-size: 9px; font-weight: 800; }
.tc-message { max-width: 82%; padding: 11px 13px; border: 1px solid var(--chat-line); border-radius: 5px 15px 15px 15px; color: var(--chat-ink); background: white; box-shadow: 0 4px 14px rgba(22,31,27,.04); font-size: 12px; line-height: 1.52; }
.tc-message-row.tc-user .tc-message { border-color: var(--chat-burgundy); border-radius: 15px 5px 15px 15px; color: white; background: var(--chat-burgundy); }
.tc-message p { margin: 0; }
.tc-message p + p { margin-top: 7px; }
.tc-message strong { color: var(--chat-burgundy-dark); }
.tc-message-row.tc-user strong { color: white; }

.tc-quick-actions { margin: 7px 0 15px 35px; display: flex; flex-wrap: wrap; gap: 7px; }
.tc-quick-action, .tc-action-link {
  min-height: 34px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7d2cc;
  border-radius: 999px;
  color: #34413b;
  background: white;
  cursor: pointer;
  font: 700 10px/1.25 "Inter", Arial, sans-serif;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.tc-quick-action:hover, .tc-quick-action:focus-visible { border-color: var(--chat-green); color: var(--chat-green); background: #f5fbf7; }
.tc-quick-action.tc-primary { border-color: var(--chat-burgundy); color: white; background: var(--chat-burgundy); }
.tc-action-link { border-radius: 6px; text-decoration: none; }
.tc-action-link.tc-whatsapp { border-color: #128c4e; color: white; background: #128c4e; }
.tc-action-link.tc-email { border-color: var(--chat-burgundy); color: var(--chat-burgundy); }
.tc-service-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: 100%; }
.tc-service-actions .tc-action-link, .tc-service-actions .tc-quick-action { border-radius: 7px; white-space: normal; text-align: center; }

.tc-chat-input-area { padding: 11px 12px 10px; border-top: 1px solid var(--chat-line); background: white; }
.tc-chat-form { display: grid; grid-template-columns: 1fr 42px; gap: 8px; }
.tc-chat-input { width: 100%; height: 42px; padding: 0 13px; border: 1px solid #cbd4cf; border-radius: 10px; color: var(--chat-ink); background: #f9fbfa; font: 500 12px "Inter", Arial, sans-serif; outline: none; }
.tc-chat-input:focus { border-color: var(--chat-green); box-shadow: 0 0 0 3px rgba(120,5,31,.1); }
.tc-chat-send { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 10px; color: white; background: var(--chat-burgundy); cursor: pointer; }
.tc-chat-send:disabled { opacity: .45; cursor: not-allowed; }
.tc-chat-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tc-chat-privacy { margin: 7px 2px 0; color: #8a928e; font-size: 8px; line-height: 1.35; text-align: center; }
.tc-chat-privacy a { color: var(--chat-burgundy); }

@media (max-width: 580px) {
  .tc-chat-launcher { right: 14px; bottom: 14px; min-height: 54px; }
  .tc-chat-panel { right: 14px; left: 14px; bottom: 78px; width: auto; height: min(680px, calc(100dvh - 96px)); min-height: 420px; border-radius: 17px; }
  .tc-chat-launcher-label { display: none; }
  .tc-chat-launcher { padding-right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-chat-panel, .tc-chat-launcher { transition: none; }
  .tc-chat-body { scroll-behavior: auto; }
}
