:root {
  --pte-orange: #e8692a;
  --pte-yellow: #f5c842;
  --pte-ink: #20242a;
  --pte-chat-shadow: 0 22px 60px rgba(25, 31, 38, 0.24);
}

.pte-brand-logo {
  width: 56px;
  height: 35px;
  object-fit: contain;
  flex: 0 0 auto;
}

.nav-brand > img:not(.pte-brand-logo),
.logo-row > img:not(.pte-brand-logo) {
  display: none !important;
}

.brand .pte-brand-logo {
  margin-right: 8px;
  vertical-align: middle;
}

.quote-sms-consent,
.quote-sms-disclosure {
  background: #fff;
  border: 1px solid rgba(32, 36, 42, 0.14);
  border-radius: 12px;
  color: #4b5563;
  font: 500 12px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.quote-sms-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 13px 14px;
}

.quote-sms-consent input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--pte-orange);
}

.quote-sms-consent a,
.quote-sms-disclosure a {
  color: var(--pte-orange);
  font-weight: 800;
  text-decoration: underline;
}

.quote-sms-disclosure {
  margin: 18px 0;
  padding: 16px;
}

.quote-sms-disclosure h2 {
  margin: 0 0 8px;
  color: var(--pte-ink);
  font-size: 16px;
  line-height: 1.25;
}

.quote-sms-disclosure p { margin: 0; }

.pte-chat-launcher {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 9998;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--pte-orange);
  color: #fff;
  box-shadow: 0 10px 28px rgba(232, 105, 42, 0.38);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.pte-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(232, 105, 42, 0.44);
}

.pte-chat-launcher:focus-visible,
.pte-chat-close:focus-visible,
.pte-chat-send:focus-visible,
.pte-chat-input:focus-visible {
  outline: 3px solid var(--pte-yellow);
  outline-offset: 2px;
}

.pte-chat-launcher svg {
  width: 28px;
  height: 28px;
}

.pte-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: min(360px, calc(100vw - 36px));
  height: min(590px, calc(100vh - 36px));
  background: #fff;
  border: 1px solid rgba(32, 36, 42, 0.12);
  border-radius: 20px;
  box-shadow: var(--pte-chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.pte-chat-panel[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.pte-chat-header {
  min-height: 72px;
  margin: 0;
  padding: 10px 12px;
  background: var(--pte-ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.pte-chat-header-logo {
  width: 58px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
}

.pte-chat-title {
  min-width: 0;
  flex: 1;
  font: 800 15px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pte-chat-status {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 600;
}

.pte-chat-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.pte-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px;
  background: linear-gradient(180deg, #fff 0%, #fffaf3 100%);
  scroll-behavior: smooth;
}

.pte-chat-message {
  max-width: 86%;
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 15px;
  font: 500 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pte-chat-message--assistant {
  margin-right: auto;
  color: var(--pte-ink);
  background: #fff;
  border: 1px solid rgba(32, 36, 42, 0.11);
  border-bottom-left-radius: 5px;
}

.pte-chat-message--user {
  margin-left: auto;
  color: #fff;
  background: var(--pte-orange);
  border-bottom-right-radius: 5px;
}

.pte-chat-message a {
  color: inherit;
  font-weight: 800;
}

.pte-chat-typing {
  display: none;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin: 0 14px 10px;
  padding: 10px 13px;
  border-radius: 14px 14px 14px 5px;
  background: #f4f1eb;
}

.pte-chat-typing[data-active="true"] {
  display: flex;
}

.pte-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pte-orange);
  animation: pteTyping 1s infinite ease-in-out;
}

.pte-chat-typing span:nth-child(2) { animation-delay: 120ms; }
.pte-chat-typing span:nth-child(3) { animation-delay: 240ms; }

@keyframes pteTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.pte-chat-form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(32, 36, 42, 0.1);
  background: #fff;
}

.pte-chat-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(32, 36, 42, 0.2);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--pte-ink);
  background: #fff;
  font: 500 14px/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pte-chat-input:focus {
  border-color: var(--pte-orange);
}

.pte-chat-send {
  min-width: 68px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: var(--pte-yellow);
  color: var(--pte-ink);
  font-weight: 900;
  cursor: pointer;
}

.pte-chat-send:disabled,
.pte-chat-input:disabled {
  cursor: wait;
  opacity: 0.65;
}

body.pte-chat-open #sticky-quote,
body.pte-chat-open .mquote {
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 600px) {
  .pte-chat-launcher {
    right: 14px;
    bottom: 84px;
    width: 54px;
    height: 54px;
  }

  .pte-chat-panel {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: min(78vh, 620px);
    max-height: calc(100dvh - 12px);
    border-radius: 20px 20px 0 0;
    transform-origin: bottom center;
  }
}

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