/* Legacy FAB kept for debug only; presentation shell is primary (not mounted by boot). */
.tcs-live-help-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 99999;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font: 600 0.95rem/1.2 system-ui, sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #0b5fff, #1a8cff);
  box-shadow: 0 8px 24px rgba(11, 95, 255, 0.35);
  cursor: pointer;
  display: none;
}

.tcs-live-help-btn.is-live {
  background: linear-gradient(135deg, #b00020, #e53935);
  box-shadow: 0 8px 24px rgba(176, 0, 32, 0.35);
}

.tcs-live-help-status {
  display: none;
}

/*
 * Live booking help subsumes the old static "How booking works ?" CTA.
 * Hide that trigger whenever Live Help is present on the page.
 */
html.tcs-lh-present .rbs-landing-booking-help,
body.tcs-lh-present .rbs-landing-booking-help,
.rbs-ride-booking-shell-card:has(#tcs-lh-entry) .rbs-landing-booking-help,
body:has(#tcs-lh-entry) .rbs-landing-booking-help {
  display: none !important;
}

/* ——— In-page entry ——— */
.tcs-lh-entry {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.4rem;
  width: 100%;
}

.tcs-lh-entry--after-intro {
  justify-content: flex-start;
  margin: 0 0 0.75rem;
}

.tcs-lh-entry__trigger {
  border: 0;
  background: transparent;
  color: #1f6feb;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.15rem 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.tcs-lh-entry__trigger:hover,
.tcs-lh-entry__trigger:focus-visible {
  color: #17212b;
  outline: none;
}

/* ——— Trust modal (sibling to landing pattern; owned by tcs-voice) ——— */
.tcs-lh-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tcs-lh-modal[hidden] {
  display: none !important;
}

.tcs-lh-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
}

.tcs-lh-modal__sheet {
  position: relative;
  width: min(100%, 420px);
  max-height: min(80vh, 560px);
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.22);
  padding: 18px 18px 16px;
  color: #17212b;
}

.tcs-lh-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tcs-lh-modal__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
}

.tcs-lh-modal__close {
  border: 0;
  background: transparent;
  color: #5b6775;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.tcs-lh-modal__trust {
  margin: 0 0 12px;
  color: #5b6775;
  font-size: 0.95rem;
  line-height: 1.5;
}

.tcs-lh-modal__trust p {
  margin: 0 0 0.45rem;
}

.tcs-lh-modal__trust p:last-child {
  margin-bottom: 0;
}

.tcs-lh-modal__steps {
  margin: 0 0 14px;
  padding-left: 1.15rem;
  color: #17212b;
  font-size: 0.92rem;
  line-height: 1.45;
}

.tcs-lh-modal__steps li + li {
  margin-top: 8px;
}

.tcs-lh-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tcs-lh-btn {
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: 1px solid rgba(23, 33, 43, 0.14);
  background: #fff;
  color: #17212b;
}

.tcs-lh-btn--primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #0b5fff, #1a8cff);
  box-shadow: 0 6px 16px rgba(11, 95, 255, 0.28);
}

.tcs-lh-btn--primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tcs-lh-btn--secondary {
  background: #fff;
}

.tcs-lh-btn--link {
  border: 0;
  background: transparent;
  color: #1f6feb;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  padding: 0.35rem 0.25rem;
  font-weight: 600;
}

.tcs-lh-modal__error {
  margin: 0 0 12px;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 0.88rem;
  line-height: 1.4;
}

.tcs-lh-modal__error[hidden] {
  display: none !important;
}

.tcs-lh-is-hidden,
.tcs-lh-modal__actions.tcs-lh-is-hidden,
[data-tcs-lh-fail-actions][hidden],
.tcs-lh-modal__actions[hidden] {
  display: none !important;
}

/* ——— Active voice dock ——— */
.tcs-lh-dock {
  position: fixed;
  left: 50%;
  bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10040;
  width: min(26rem, calc(100vw - 1.5rem));
  max-height: min(42vh, 220px);
  overflow: auto;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font: 0.9rem/1.4 system-ui, sans-serif;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.tcs-lh-dock[hidden] {
  display: none !important;
}

.tcs-lh-dock__status {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.tcs-lh-dock__status-dot {
  color: #4ade80;
}

/* Brief flash when speech is detected, then soft "hearing you" hold */
.tcs-lh-dock__status--flash {
  color: #86efac;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.65);
}

.tcs-lh-dock__status--hearing {
  color: #4ade80;
  animation: tcs-lh-listen-soft 1.6s ease-in-out infinite;
}

@keyframes tcs-lh-listen-soft {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tcs-lh-dock__status--hearing {
    animation: none;
    opacity: 1;
  }
}

.tcs-lh-dock__copy {
  margin: 0 0 0.75rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.4;
}

.tcs-lh-dock__copy p {
  margin: 0 0 0.3rem;
}

.tcs-lh-dock__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
}

/* Gentle text-only pulse: how to pause Live Help without a big UI chrome */
.tcs-lh-dock__standby-hint {
  margin: 0.15rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  animation: tcs-lh-standby-pulse 2.8s ease-in-out infinite;
}

.tcs-lh-dock__standby-hint strong {
  color: #cbd5e1;
  font-weight: 650;
}

@keyframes tcs-lh-standby-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tcs-lh-dock__standby-hint {
    animation: none;
    opacity: 0.85;
  }
}

.tcs-lh-dock .tcs-lh-btn--primary {
  background: #e53935;
  box-shadow: none;
}

.tcs-lh-dock .tcs-lh-btn--secondary {
  background: transparent;
  color: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.35);
}

/* Reserve space so dock does not cover form submit on mobile */
body.tcs-lh-dock-open {
  padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
}

.rbs-voice-highlight {
  outline: 3px solid #0b5fff !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(11, 95, 255, 0.2);
  transition: outline 0.2s ease, box-shadow 0.2s ease;
}

.rbs-voice-tip {
  position: fixed;
  left: 50%;
  top: 1rem;
  transform: translateX(-50%);
  z-index: 100000;
  background: #0f172a;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font: 0.9rem/1.3 system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.rbs-voice-tip[hidden] {
  display: none !important;
}

.tcs-voice-handoff {
  position: fixed;
  left: 50%;
  bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 100001;
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 0.85rem 1.1rem;
  border-radius: 0.65rem;
  background: #0f172a;
  color: #f8fafc;
  font: 0.9rem/1.4 system-ui, sans-serif;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}

.tcs-voice-handoff .muted {
  color: #94a3b8;
  font-size: 0.8rem;
}

.tcs-voice-handoff[hidden] {
  display: none !important;
}

.tcs-lh-handoff-link {
  color: #93c5fd;
  font-weight: 600;
  text-decoration: underline;
}

a.tcs-lh-btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

/* Author display must not defeat the hidden attribute on handoff CTAs. */
a.tcs-lh-btn[hidden],
.tcs-lh-btn[hidden],
[data-tcs-lh-text-help][hidden],
[data-tcs-lh-email-help][hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .tcs-lh-dock {
    bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 1rem);
    max-height: 38vh;
  }

  body.tcs-lh-dock-open {
    padding-bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ——— Stage 2 Type mode entry + panel ——— */
.tcs-lh-entry__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
  width: 100%;
}

.tcs-lh-entry__modes {
  display: inline-flex;
  border: 1px solid rgba(23, 33, 43, 0.14);
  border-radius: 999px;
  overflow: hidden;
  background: #f8fafc;
}

.tcs-lh-entry__mode {
  border: 0;
  background: transparent;
  color: #5b6775;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}

.tcs-lh-entry__mode.is-active {
  background: #0b5fff;
  color: #fff;
}

.tcs-lh-entry__mode:focus-visible {
  outline: 2px solid #1a8cff;
  outline-offset: 1px;
}

/* Detached from form: lower-right corner once Type mode is open */
.tcs-lh-type-panel,
.tcs-lh-type-panel--corner {
  position: fixed;
  right: max(0.85rem, env(safe-area-inset-right, 0px));
  bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  z-index: 10045;
  width: min(22.5rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border: 1px solid rgba(23, 33, 43, 0.12);
  border-radius: 14px;
  background: #0f172a;
  color: #f8fafc;
  padding: 0.75rem 0.85rem 0.85rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
  margin: 0;
}

.tcs-lh-type-panel[hidden] {
  display: none !important;
}

.tcs-lh-type-panel__head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
}

.tcs-lh-type-panel__title {
  margin: 0;
  font-weight: 700;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.tcs-lh-type-panel__status {
  margin: 0;
  font-weight: 650;
  font-size: 0.78rem;
  color: #86efac;
  white-space: nowrap;
}

.tcs-lh-type-panel__close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.tcs-lh-type-panel__log {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: min(42vh, 280px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding-right: 0.15rem;
}

.tcs-lh-type-panel__msg {
  max-width: 95%;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.tcs-lh-type-panel__msg--bot {
  align-self: flex-start;
  background: #1e293b;
  color: #e2e8f0;
}

.tcs-lh-type-panel__msg--user {
  align-self: flex-end;
  background: #1d4ed8;
  color: #fff;
}

.tcs-lh-type-panel__compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: end;
}

.tcs-lh-type-panel__input {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.6rem;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #1e293b;
  color: #f8fafc;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
}

.tcs-lh-type-panel__input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.tcs-lh-type-panel__send {
  white-space: nowrap;
}

.tcs-lh-type-panel__actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tcs-lh-type-panel__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 899px) {
  .tcs-lh-entry__row {
    justify-content: flex-start;
  }
}
