/* Tableside AI chat style lead capture. Pairs with /chat-capture.js.
   Premium dark green theme matched to tablesideai.com brand styles.
   All classes use the tsc prefix so nothing collides with site styles. */

.tsc-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0a4530, #063826);
  color: #eafff5;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(2, 18, 12, 0.45), inset 0 0 0 1px rgba(95, 240, 194, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.tsc-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(2, 18, 12, 0.5), inset 0 0 0 1px rgba(95, 240, 194, 0.55);
}
.tsc-button:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 3px;
}
.tsc-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.tsc-hidden {
  display: none !important;
}

.tsc-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  /* --tsc-vvo is the on-screen keyboard height in px, set from the
     visualViewport API in chat-capture.js; 0 when no keyboard is open. */
  bottom: calc(20px + var(--tsc-vvo, 0px));
  z-index: 99991;
  width: 372px;
  max-width: calc(100vw - 24px);
  height: min(604px, calc(100vh - 40px));
  height: min(604px, calc(100dvh - 40px));
  /* --tsc-vvh is the live visual viewport height in px (JS set); it
     shrinks when the mobile keyboard opens so the panel shrinks too. */
  height: min(604px, calc(var(--tsc-vvh, 100dvh) - 40px));
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, #063826 0%, #04231a 55%, #02120c 100%);
  border: 1px solid rgba(95, 240, 194, 0.28);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color: #eaf5ef;
}
.tsc-panel.tsc-open {
  display: flex;
}

.tsc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid rgba(95, 240, 194, 0.16);
  background: rgba(255, 255, 255, 0.03);
}
.tsc-head-text {
  flex: 1 1 auto;
  min-width: 0;
}
.tsc-title {
  font-family: 'Playfair Display', 'Fraunces', Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
}
.tsc-subtitle {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #bfd0c4;
}
.tsc-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(95, 240, 194, 0.3);
  border-radius: 999px;
  background: transparent;
  color: #bfd0c4;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.tsc-close:hover {
  color: #ffffff;
  border-color: rgba(95, 240, 194, 0.6);
}

.tsc-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: rgba(95, 240, 194, 0.35) transparent;
}
.tsc-row {
  display: flex;
}
.tsc-row.tsc-user {
  justify-content: flex-end;
}
.tsc-bubble {
  max-width: 82%;
  padding: 10px 13px;
  font-size: 14.5px;
  line-height: 1.5;
  border-radius: 16px;
  overflow-wrap: break-word;
}
.tsc-bubble.tsc-bot {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom-left-radius: 5px;
  color: #eaf5ef;
}
.tsc-bubble.tsc-user {
  background: #0d4d33;
  border: 1px solid rgba(95, 240, 194, 0.35);
  border-bottom-right-radius: 5px;
  color: #eafff5;
}

.tsc-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  border-bottom-left-radius: 5px;
}
.tsc-typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #5eead4;
  opacity: 0.35;
  animation: tscBlink 1.1s infinite;
}
.tsc-typing span:nth-child(2) { animation-delay: 0.18s; }
.tsc-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes tscBlink {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.tsc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 0 4px;
}
.tsc-chip {
  padding: 8px 13px;
  border: 1px solid rgba(95, 240, 194, 0.5);
  border-radius: 999px;
  background: transparent;
  color: #5eead4;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tsc-chip:hover {
  background: rgba(31, 223, 161, 0.16);
  color: #d9ffee;
}
.tsc-chip:disabled {
  opacity: 0.45;
  cursor: default;
}

.tsc-foot {
  border-top: 1px solid rgba(95, 240, 194, 0.16);
  padding: 11px 12px;
  background: rgba(2, 18, 12, 0.55);
}
.tsc-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tsc-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-family: inherit;
  /* 16px stops iOS Safari auto zooming the page when the input is focused */
  font-size: 16px;
}
.tsc-input::placeholder {
  color: #8fa89a;
}
.tsc-input:focus {
  outline: none;
  border-color: rgba(95, 240, 194, 0.65);
}
.tsc-input:disabled {
  opacity: 0.5;
}
.tsc-send {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: #1fdfa1;
  color: #02120c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.tsc-send:hover {
  background: #5ff0c2;
}
.tsc-send:disabled {
  opacity: 0.5;
  cursor: default;
}
.tsc-send svg {
  width: 18px;
  height: 18px;
}
.tsc-brand {
  margin-top: 9px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #7d968a;
}

@media (max-width: 480px) {
  .tsc-button {
    right: 14px;
    bottom: 14px;
    padding: 12px 17px;
    font-size: 14px;
  }
  .tsc-panel {
    right: 8px;
    left: 8px;
    bottom: 8px;
    bottom: calc(8px + var(--tsc-vvo, 0px));
    width: auto;
    max-width: none;
    height: min(604px, calc(100dvh - 16px));
    height: min(604px, calc(var(--tsc-vvh, 100dvh) - 16px));
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tsc-button, .tsc-chip, .tsc-send { transition: none; }
  .tsc-typing span { animation: none; opacity: 0.7; }
}
