:root {
  --voice-blue: #2563eb;
  --voice-blue-hover: #1d4ed8;
  --voice-ink: #0f172a;
  --voice-muted: #64748b;
  --voice-line: #e2e8f0;
  --voice-soft: #f1f5f9;
  --voice-bg: #edf1f6;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.voice-page {
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--voice-ink);
  background: var(--voice-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.voice-topbar {
  display: flex;
  justify-content: center;
  padding: 18px 16px 12px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--voice-line);
}

.voice-topbar-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: min(760px, 100%);
}

.voice-topbar-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.voice-logo-link {
  display: flex;
  flex: 0 0 auto;
}

.voice-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 208px;
  object-fit: contain;
}

.voice-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.voice-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 650;
}

.voice-subtitle {
  margin: 4px 0 0;
  color: var(--voice-muted);
  font-size: 0.9rem;
}

.voice-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
  white-space: nowrap;
}

.voice-back-link {
  color: var(--voice-blue);
  text-decoration: none;
  font-weight: 600;
}

.voice-back-link:hover {
  text-decoration: underline;
}

.voice-main {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-height: 0;
  padding: 16px 16px 20px;
}

.voice-chat-card {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  height: 100%;
  background: #fff;
  border: 1px solid var(--voice-line);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.voice-chat-context {
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--voice-soft);
  color: var(--voice-muted);
  font-size: 12px;
}

.voice-chat-transcript {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px 18px 12px;
}

.voice-chat-transcript .cf-chat-message:not(.cf-chat-message-user) .cf-chat-bubble {
  width: calc(100% - 48px);
  max-width: calc(100% - 48px);
}

.voice-chat-footer {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--voice-soft);
}

.voice-progress-label {
  margin-bottom: 8px;
  color: var(--voice-muted);
  font-size: 12px;
}

.voice-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
}

.voice-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--voice-blue);
  transition: width 0.25s ease;
}

.cf-chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.cf-chat-message.cf-chat-rewindable.is-answered {
  cursor: pointer;
}

.cf-chat-message.cf-chat-rewindable.is-answered .cf-chat-bubble {
  transition: box-shadow 0.15s ease;
}

.cf-chat-message.cf-chat-rewindable.is-answered:hover .cf-chat-bubble {
  box-shadow: 0 0 0 2px var(--voice-blue);
}

.cf-chat-message.cf-chat-rewindable.is-answered button,
.cf-chat-message.cf-chat-rewindable.is-answered input,
.cf-chat-message.cf-chat-rewindable.is-answered select,
.cf-chat-message.cf-chat-rewindable.is-answered textarea {
  pointer-events: none;
}

.cf-chat-rewindable.is-answered + .cf-chat-message-user {
  cursor: pointer;
}

.cf-chat-message-user {
  justify-content: flex-end;
}

.cf-chat-message-user .cf-chat-bubble {
  margin-left: auto;
}

.cf-chat-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--voice-blue) 0%, #7aa6f1 100%);
  flex: 0 0 auto;
}

.cf-chat-avatar svg,
.cf-chat-avatar-bot {
  display: block;
  width: 18px;
  height: 18px;
}

.cf-chat-avatar-step {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.cf-chat-bubble {
  max-width: calc(100% - 48px);
  padding: 12px 14px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  background: #f3f6fb;
  color: #333;
  font-size: 14px;
  line-height: 1.45;
}

.cf-chat-bubble.user-response {
  border-radius: 12px;
  border-top-right-radius: 4px;
  background: var(--voice-blue);
  color: #fff;
}

.cf-chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cf-chat-option-btn,
.quote-chat-secondary-btn,
.cf-chat-submit-btn {
  cursor: pointer;
  box-sizing: border-box;
  height: 40px;
  max-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cf-chat-option-btn {
  flex: 0 0 auto;
  padding: 0 14px;
  border: 2px solid var(--voice-blue);
  border-radius: 999px;
  background: #fff;
  color: var(--voice-blue);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.cf-chat-option-btn.is-selected,
.cf-chat-option-btn:hover:not(.is-disabled) {
  background: rgba(37, 99, 235, 0.08);
}

.cf-chat-option-btn.is-selected {
  background: var(--voice-blue);
  color: #fff;
}

.cf-chat-option-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cf-chat-submit-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.cf-chat-submit-btn,
.quote-chat-secondary-btn {
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.cf-chat-submit-btn {
  background: var(--voice-blue);
  color: #fff;
}

.cf-chat-submit-btn:disabled,
.cf-chat-submit-btn.is-disabled,
.quote-chat-secondary-btn:disabled,
.quote-chat-secondary-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.quote-chat-secondary-btn {
  border: 1px solid #d0d7de;
  background: #fff;
  color: var(--voice-blue);
}

.quote-chat-inline-actions {
  margin-top: 10px;
}

.quote-chat-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: #555;
}

.quote-chat-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quote-chat-remove-btn {
  border: 0;
  background: transparent;
  color: #b42318;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.quote-chat-input,
.quote-chat-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

select.quote-chat-input {
  cursor: pointer;
}

.quote-chat-textarea {
  min-height: 84px;
  resize: vertical;
}

.quote-chat-hint {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 12px;
}

.quote-chat-link-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--voice-blue);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.quote-chat-link-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.quote-chat-contact-form,
.quote-chat-address-fields {
  margin-top: 4px;
}

.quote-chat-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.quote-chat-summary-row {
  display: grid;
  gap: 2px;
  font-size: 13px;
}

.quote-chat-summary-row span {
  color: #6b7280;
}

.quote-chat-tracking {
  margin: 12px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--voice-blue);
}

.cf-chat-typing-dots {
  display: flex;
  gap: 4px;
}

.cf-chat-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--voice-blue);
  animation: cfChatTyping 1.4s infinite ease-in-out;
}

.cf-chat-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.cf-chat-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes cfChatTyping {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

.voip-choice-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.voip-choice-card {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--voice-line);
  border-radius: 10px;
  background: #fff;
  color: var(--voice-ink);
  text-align: left;
  cursor: pointer;
}

.voip-choice-card strong {
  font-size: 14px;
}

.voip-choice-card span {
  color: var(--voice-muted);
  font-size: 12px;
  line-height: 1.35;
}

.voip-choice-card:hover:not(:disabled) {
  border-color: var(--voice-blue);
  background: #eff6ff;
}

.voip-choice-card.is-selected {
  border-color: var(--voice-blue);
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px var(--voice-blue);
}

.voip-choice-card:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

@media (max-width: 720px) {
  .voice-topbar {
    flex-direction: column;
    padding: 14px 16px 10px;
  }

  .voice-main {
    padding: 10px;
  }

  .voice-chat-card {
    border-radius: 12px;
  }
}
