/* ── Support chat widget ─────────────────────────────────────
   Self-contained (own tokens, all selectors prefixed .tsc-) so it drops
   onto any consumer page, including the static marketing site. */
.tsc-root {
  --tsc-navy:   #0D1B2A;
  --tsc-navy-2: #1a2f45;
  --tsc-gold:   #FFB703;
  --tsc-bg:     #ffffff;
  --tsc-soft:   #f1f5f9;
  --tsc-line:   #e2e8f0;
  --tsc-text:   #0D1B2A;
  --tsc-muted:  #64748b;
  --tsc-red:    #dc2626;
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--tsc-text);
  -webkit-font-smoothing: antialiased;
}
.tsc-root *, .tsc-root *::before, .tsc-root *::after { box-sizing: border-box; margin: 0; padding: 0; }
.tsc-root svg { display: block; }

/* Launcher */
.tsc-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--tsc-gold); color: var(--tsc-navy);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.18);
  transition: transform .2s ease, background .2s ease;
}
.tsc-launcher:hover { transform: translateY(-2px); background: #ffc533; }
.tsc-launcher:focus-visible { outline: 3px solid var(--tsc-navy); outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }
.tsc-launcher .tsc-ico-close { display: none; }
.tsc-root.tsc-open .tsc-launcher .tsc-ico-open { display: none; }
.tsc-root.tsc-open .tsc-launcher .tsc-ico-close { display: block; }
.tsc-badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--tsc-red); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  border: 2px solid #fff; display: none;
}
.tsc-badge.tsc-show { display: block; }

/* Panel */
.tsc-panel {
  position: fixed; right: 20px; bottom: 90px; z-index: 2147483000;
  width: 370px; height: min(580px, calc(100vh - 120px));
  background: var(--tsc-bg); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(13,27,42,.25), 0 4px 14px rgba(13,27,42,.12);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none; visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.tsc-root.tsc-open .tsc-panel {
  opacity: 1; transform: none; pointer-events: auto; visibility: visible;
  transition: opacity .18s ease, transform .18s ease;
}

.tsc-head {
  background: var(--tsc-navy); color: #fff; padding: 16px 16px 14px 18px;
  display: flex; align-items: flex-start; gap: 12px; flex-shrink: 0;
}
.tsc-head-text { flex: 1; min-width: 0; }
.tsc-title { font-size: 16px; font-weight: 500; letter-spacing: .01em; }
.tsc-sub { font-size: 12.5px; color: rgba(255,255,255,.7); margin-top: 2px; }
.tsc-close {
  border: 0; background: transparent; color: rgba(255,255,255,.75); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.tsc-close:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Contact strip */
.tsc-contact { border-bottom: 1px solid var(--tsc-line); background: #fbfcfe; flex-shrink: 0; }
.tsc-contact-toggle {
  width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left;
  padding: 10px 16px; display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13px; color: var(--tsc-muted);
}
.tsc-contact-toggle:hover { color: var(--tsc-text); }
.tsc-contact-toggle strong { color: var(--tsc-text); font-weight: 500; }
.tsc-contact-toggle .tsc-chev { margin-left: auto; transition: transform .15s ease; }
.tsc-contact.tsc-expanded .tsc-chev { transform: rotate(180deg); }
.tsc-contact-form { display: none; padding: 0 16px 14px; }
.tsc-contact.tsc-expanded .tsc-contact-form { display: block; }
.tsc-contact-note { font-size: 12.5px; color: var(--tsc-muted); margin-bottom: 10px; }
.tsc-field {
  width: 100%; height: 38px; padding: 0 12px; margin-bottom: 8px;
  border: 1px solid var(--tsc-line); border-radius: 9px; background: #fff;
  font: inherit; font-size: 14px; color: var(--tsc-text);
}
.tsc-field:focus { outline: none; border-color: var(--tsc-navy); box-shadow: 0 0 0 3px rgba(13,27,42,.08); }
.tsc-contact-actions { display: flex; align-items: center; gap: 10px; }
.tsc-btn {
  height: 36px; padding: 0 16px; border-radius: 9px; border: 0; cursor: pointer;
  background: var(--tsc-navy); color: #fff; font: inherit; font-size: 13.5px; font-weight: 500;
}
.tsc-btn:hover { background: var(--tsc-navy-2); }
.tsc-btn[disabled] { opacity: .55; cursor: default; }
.tsc-err { font-size: 12.5px; color: var(--tsc-red); }
.tsc-ok  { font-size: 12.5px; color: #15803d; }

/* Thread */
.tsc-thread {
  flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--tsc-bg);
  display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain;
}
.tsc-msg { max-width: 82%; display: flex; flex-direction: column; }
.tsc-msg.tsc-me   { align-self: flex-end; align-items: flex-end; }
.tsc-msg.tsc-them { align-self: flex-start; align-items: flex-start; }
.tsc-bubble {
  padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  font-size: 14.5px;
}
.tsc-me .tsc-bubble   { background: var(--tsc-navy); color: #fff; border-bottom-right-radius: 5px; }
.tsc-them .tsc-bubble { background: var(--tsc-soft); color: var(--tsc-text); border-bottom-left-radius: 5px; }
.tsc-meta { font-size: 11px; color: var(--tsc-muted); margin: 3px 6px 6px; }
.tsc-msg.tsc-pending .tsc-bubble { opacity: .6; }
.tsc-day { align-self: center; font-size: 11px; color: var(--tsc-muted); margin: 8px 0 4px; }

/* Composer */
.tsc-compose {
  flex-shrink: 0; border-top: 1px solid var(--tsc-line); padding: 10px 10px 10px 14px;
  display: flex; align-items: flex-end; gap: 8px; background: #fff;
}
.tsc-input {
  flex: 1; resize: none; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 15px; color: var(--tsc-text);
  max-height: 120px; min-height: 22px; padding: 7px 0; line-height: 1.4;
}
.tsc-send {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
  background: var(--tsc-gold); color: var(--tsc-navy);
  display: flex; align-items: center; justify-content: center; transition: opacity .15s ease;
}
.tsc-send[disabled] { opacity: .4; cursor: default; }
.tsc-compose-err { padding: 0 14px 8px; font-size: 12.5px; color: var(--tsc-red); display: none; }
.tsc-compose-err.tsc-show { display: block; }

@media (max-width: 480px) {
  .tsc-launcher { right: 16px; bottom: 16px; }
  .tsc-panel {
    right: 0; left: 0; bottom: 0; width: 100%; height: 100%;
    height: 100dvh; border-radius: 0;
  }
  .tsc-root.tsc-open .tsc-launcher { display: none; }
  .tsc-input { font-size: 16px; } /* stops iOS zooming into the field */
}
@media (prefers-reduced-motion: reduce) {
  .tsc-panel, .tsc-launcher { transition: none; }
}
