/* ==========================================================================
   Public pre-sales chat - landing + calculator.
   Lean sibling of the in-app widget (css/ai-chat.css): same 2026 look -
   rounded bubbles with tails, spring open/close, glass chrome - minus
   consent, drag and quota UI. Palette matches the landing (home.css).
   ========================================================================== */

.pc-fab {
  position: fixed;
  bottom: 18px;
  right: 18px;
  height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: #ff5a00;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(255, 90, 0, 0.35);
  z-index: 950;
}

.pc-fab:hover {
  transform: translateY(-1px);
}

@media (max-width: 560px) {
  .pc-fab {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .pc-fab-label {
    display: none;
  }
  .pc-fab {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
}

.pc-panel {
  position: fixed;
  bottom: 74px;
  right: 18px;
  width: min(372px, calc(100vw - 24px));
  height: min(1040px, calc(100vh - 140px));
  background: #f4f2ec;
  border: 1px solid rgba(25, 28, 33, 0.16);
  border-radius: 16px;
  box-shadow:
    0 2px 6px rgba(25, 28, 33, 0.06),
    0 12px 28px rgba(25, 28, 33, 0.14),
    0 28px 64px rgba(25, 28, 33, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 951;
  transform-origin: bottom right;
  animation: pc-in 0.26s cubic-bezier(0.3, 1.25, 0.4, 1) both;
  font-family: inherit;
}

@media (max-width: 560px) {
  .pc-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

@keyframes pc-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pc-panel.pc-closing {
  animation: pc-out 0.16s ease-in both;
}

@keyframes pc-out {
  to {
    opacity: 0;
    transform: translateY(14px) scale(0.95);
  }
}

.pc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(25, 28, 33, 0.12);
  background: #fff;
  font-weight: 700;
  font-size: 14px;
  color: #191c21;
}

@supports (backdrop-filter: blur(10px)) {
  .pc-head {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px) saturate(1.25);
    -webkit-backdrop-filter: blur(10px) saturate(1.25);
  }
}

.pc-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #4e545c;
  padding: 2px 6px;
}

.pc-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.pc-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.pc-msg-u {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff5a00, #e64f00);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 2px 8px rgba(255, 90, 0, 0.28);
}

.pc-msg-a {
  align-self: flex-start;
  background: #fff;
  color: #191c21;
  border: 1px solid rgba(25, 28, 33, 0.12);
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 3px rgba(25, 28, 33, 0.05);
}

.pc-link {
  color: #ff5a00;
  font-weight: 700;
  text-decoration: underline;
}

.pc-anim {
  animation: pc-pop 0.28s cubic-bezier(0.26, 1.2, 0.4, 1) both;
}

@keyframes pc-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pc-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: #4e545c;
  animation: pc-blink 1s infinite ease-in-out;
}

.pc-typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.pc-typing span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes pc-blink {
  0%,
  80%,
  100% {
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
}

.pc-sugs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.pc-sug {
  border: 1px solid rgba(25, 28, 33, 0.18);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: #191c21;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}

.pc-sug:hover {
  transform: translateY(-1px);
  border-color: #ff5a00;
}

.pc-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 4px;
}

.pc-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(25, 28, 33, 0.2);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  background: #fff;
  font-family: inherit;
}

.pc-form input:focus {
  outline: 2px solid #ff5a00;
  outline-offset: -1px;
}

.pc-send {
  border: none;
  border-radius: 10px;
  background: #ff5a00;
  color: #fff;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease;
}

.pc-send:hover {
  transform: scale(1.06);
}

.pc-hint {
  font-size: 10.5px;
  color: #4e545c;
  padding: 4px 14px 10px;
}

@media (prefers-reduced-motion: reduce) {
  .pc-panel,
  .pc-panel.pc-closing,
  .pc-anim {
    animation: none;
  }
}

/* Native shell only (body.is-native-app, js/native-app.js): keep the chat
   bubble and panel above the iOS home-indicator gesture bar. */
body.is-native-app .pc-fab {
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
body.is-native-app .pc-panel {
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}
