/* --- the chat panel ------------------------------------------------------- */
.chat {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  width: min(420px, calc(100vw - 32px));
  height: min(660px, calc(100vh - 44px));
  display: flex; flex-direction: column;
  border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(247, 201, 72, 0.34);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(247, 201, 72, 0.12), transparent 60%),
    linear-gradient(180deg, #0b1424, #05080f 70%);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(247, 201, 72, 0.06) inset;
}
.chat[hidden] { display: none; }

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid rgba(244, 241, 232, 0.1);
  background: rgba(4, 7, 14, 0.5);
}
.chat-head img { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(247, 201, 72, 0.35); }
.chat-head .who { line-height: 1.25; }
.chat-head strong { font-family: var(--display); font-size: 15px; letter-spacing: 0.01em; }
.chat-head .state {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em;
}
.chat-head .state i {
  width: 6px; height: 6px; border-radius: 50%; background: #62e6a0;
  box-shadow: 0 0 0 3px rgba(98, 230, 160, 0.18);
}
.chat-close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(244, 241, 232, 0.18); background: transparent;
  color: var(--ivory); font-size: 18px; line-height: 1; cursor: pointer;
}
.chat-close:hover { border-color: var(--gold); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 18px 16px 8px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
}
.msg {
  max-width: 86%; padding: 11px 14px; border-radius: 16px;
  font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.msg.from-gabriel {
  align-self: flex-start; color: var(--ivory);
  background: rgba(244, 241, 232, 0.06);
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-bottom-left-radius: 6px;
}
.msg.from-visitor {
  align-self: flex-end; color: #1a1200;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  border-bottom-right-radius: 6px;
}
.msg.typing { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.msg.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: chatDot 1.1s infinite ease-in-out;
}
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatDot { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-form {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 14px; border-top: 1px solid rgba(244, 241, 232, 0.1);
  background: rgba(4, 7, 14, 0.55);
}
.chat-form input {
  flex: 1; min-width: 0;
  background: rgba(244, 241, 232, 0.05); color: var(--ivory);
  border: 1px solid rgba(244, 241, 232, 0.14); border-radius: 999px;
  padding: 12px 16px; font-size: 15px; font-family: var(--body);
}
.chat-form input:focus { outline: none; border-color: rgba(247, 201, 72, 0.6); }
.chat-form input::placeholder { color: var(--muted-2); }
.chat-form button {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  color: #1a1200; font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.chat-form button:disabled { opacity: 0.5; cursor: default; }

.chat-foot {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 10px 16px 12px; font-size: 11px; color: var(--muted-2);
  border-top: 1px solid rgba(244, 241, 232, 0.06);
}
.chat-foot button {
  background: none; border: 0; color: var(--gold); font-size: 11.5px;
  letter-spacing: 0.04em; cursor: pointer; padding: 0;
  border-bottom: 1px solid rgba(247, 201, 72, 0.35);
}
.chat-foot button:hover { color: var(--gold-bright); }
.chat-foot a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(247, 201, 72, 0.35); }
.chat-foot a:hover { color: var(--gold-bright); }

/* the pill that opens it, for people who scroll past Begin */
.chat-pill {
  position: fixed; right: 22px; bottom: 22px; z-index: 65;
  display: none; align-items: center; gap: 10px;
  padding: 12px 20px 12px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(247, 201, 72, 0.4);
  background: linear-gradient(135deg, #101a2c, #070d18);
  color: var(--ivory); font-family: var(--display); font-size: 14px;
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.9);
}
.chat-pill img { width: 28px; height: 28px; border-radius: 50%; }
.chat-pill:hover { border-color: var(--gold); }
body.chat-open .chat-pill { display: none; }
body.show-chat-pill .chat-pill { display: inline-flex; }

@media (max-width: 560px) {
  .chat {
    right: 0; left: 0; bottom: 0; width: 100%;
    height: min(82vh, 640px);
    border-radius: 20px 20px 0 0;
  }
  .chat-pill { right: 16px; bottom: 16px; }
}

/* --- the choice card ------------------------------------------------------ */
.chat-foot-btns { display: inline-flex; gap: 14px; }

.choice {
  align-self: stretch; margin: 6px 0 14px;
  padding: 16px 16px 14px; border-radius: 16px;
  border: 1px solid rgba(247, 201, 72, 0.4);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(247, 201, 72, 0.14), transparent 65%),
    linear-gradient(180deg, #0d1728, #070d18);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}
.choice-k {
  font-family: var(--display); font-size: 10.5px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 8px;
}
.choice-t { font-family: var(--display); font-size: 19px; letter-spacing: -0.01em; margin: 0 0 6px; color: var(--ivory); }
.choice-s { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
.choice form { display: grid; gap: 7px; }
.choice input:not([type="checkbox"]) {
  width: 100%; background: rgba(244, 241, 232, 0.06); color: var(--ivory);
  border: 1px solid rgba(244, 241, 232, 0.16); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: var(--body);
}
.choice input:focus { outline: none; border-color: rgba(247, 201, 72, 0.65); }
.choice input::placeholder { color: var(--muted-2); }
.choice-consent {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 12.5px; color: var(--muted); line-height: 1.4; margin: 2px 0 4px;
}
.choice-consent input { flex: none; width: 16px; height: 16px; margin-top: 1px; accent-color: var(--gold); }
.choice-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.choice-yes {
  flex: 1 1 auto; padding: 11px 14px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--display); font-size: 13.5px; color: #1a1200;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
}
.choice-yes:disabled { opacity: 0.6; cursor: default; }
.choice-no {
  flex: 1 1 auto; padding: 11px 14px; border-radius: 999px; cursor: pointer;
  font-family: var(--display); font-size: 13.5px; color: var(--ivory);
  border: 1px solid rgba(244, 241, 232, 0.22); background: transparent;
}
.choice-no:hover { border-color: rgba(244, 241, 232, 0.45); }
.choice-err { margin: 6px 0 0; font-size: 12px; color: #ff9a8b; min-height: 1em; }
