/* YardStubs FAQ chat widget — corner launcher + panel, shared by / and /faq/.
   Built by chat-widget.js, so visitors without JavaScript never see it.
   Sits above the landing nav (z-index 100), below the waitlist modal (300). */

.chatw {
  --faq-bg: #0C0A07; --faq-cream: #FBF3E2; --faq-yellow: #F5C400;
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  pointer-events: none;
}

.chatw *, .chatw *::before, .chatw *::after { box-sizing: border-box; margin: 0; }

.chatw-panel[hidden], .faq-chips[hidden] { display: none; }

.chatw > * { pointer-events: auto; }

.chatw-launcher {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--faq-yellow); color: var(--faq-bg); border: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  cursor: pointer; transition: transform 0.15s ease;
}

.chatw-launcher:hover { transform: translateY(-2px); }

.chatw-launcher svg { width: 26px; height: 26px; }

.chatw-launcher .icon-close,
.chatw-launcher[aria-expanded="true"] .icon-open { display: none; }

.chatw-launcher[aria-expanded="true"] .icon-close { display: block; }

.chatw-panel {
  width: 380px; max-height: min(600px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: var(--faq-bg); color: var(--faq-cream);
  border: 1px solid rgba(251,243,226,0.14); border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  overflow: hidden;
}

.chatw-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 6px 6px 18px; border-bottom: 1px solid rgba(251,243,226,0.1);
}

.chatw-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 26px; line-height: 1;
  letter-spacing: 0.02em; color: var(--faq-cream);
}

.chatw-title span { color: var(--faq-yellow); }

.chatw-close {
  width: 44px; height: 44px; background: none; border: none;
  color: var(--faq-cream); font-size: 28px; line-height: 1; cursor: pointer;
}

.chatw-body { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 16px 18px 18px; }

.chatw-launcher:focus-visible, .chatw-close:focus-visible {
  outline: 2px solid var(--faq-cream); outline-offset: 2px;
}

.faq-chat-log {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1; min-height: 120px; overflow-y: auto; margin-bottom: 14px;
}

.faq-msg {
  max-width: 88%; padding: 10px 14px; border-radius: 6px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.faq-msg-bot { align-self: flex-start; background: rgba(251,243,226,0.07); color: var(--faq-cream); }

.faq-msg-user { align-self: flex-end; background: var(--faq-yellow); color: var(--faq-bg); font-weight: 500; }

.faq-msg-pending { color: rgba(251,243,226,0.5); }

.faq-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.faq-chip {
  min-height: 44px; padding: 8px 14px;
  background: transparent; border: 1px solid rgba(245,196,0,0.4); border-radius: 22px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--faq-cream);
  cursor: pointer; text-align: left;
}

.faq-chip:hover { border-color: var(--faq-yellow); color: var(--faq-yellow); }

.faq-chat-form { display: flex; gap: 10px; }

.faq-chat-form input {
  flex: 1; min-width: 0; min-height: 48px; padding: 12px 14px;
  background: var(--faq-bg); border: 1px solid rgba(251,243,226,0.2); border-radius: 2px;
  font-family: 'DM Sans', sans-serif; font-size: 16px; color: var(--faq-cream);
}

.faq-chat-form input::placeholder { color: rgba(251,243,226,0.4); }

.faq-chat-form input:focus { outline: none; border-color: var(--faq-yellow); }

.faq-chat-form button {
  min-height: 48px; padding: 0 24px;
  background: var(--faq-yellow); color: var(--faq-bg); border: none; border-radius: 2px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
}

.faq-chat-form button:disabled { opacity: 0.6; }

.faq-chip:focus-visible, .faq-chat-form button:focus-visible {
  outline: 2px solid var(--faq-yellow); outline-offset: 2px;
}

.faq-chat-note {
  margin-top: 12px; font-family: 'DM Sans', sans-serif;
  font-size: 12px; line-height: 1.5; color: rgba(251,243,226,0.5);
}

/* Inline links: taller hit area without changing line spacing. */
.faq-chat-note a { color: var(--faq-yellow); padding: 14px 0; margin: -14px 0; }

.faq-note-link {
  background: none; border: none; padding: 14px 0; margin: -14px 0;
  font: inherit; color: var(--faq-yellow); text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}

.faq-note-link:focus-visible { outline: 2px solid var(--faq-yellow); outline-offset: 2px; }

/* "Message the founders" card inside the chat log */
.faq-contact {
  align-self: stretch; display: flex; flex-direction: column; gap: 12px;
  padding: 14px; border: 1px solid rgba(245,196,0,0.35); border-radius: 6px;
  background: rgba(245,196,0,0.05);
}

.faq-book {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  background: var(--faq-yellow); color: var(--faq-bg); border-radius: 2px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
}

.faq-contact-form { display: flex; flex-direction: column; gap: 10px; }

.faq-contact-title {
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; color: var(--faq-cream);
}

.faq-contact-field {
  display: flex; flex-direction: column; gap: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: rgba(251,243,226,0.6);
}

.faq-contact-field input, .faq-contact-field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--faq-bg); border: 1px solid rgba(251,243,226,0.2); border-radius: 2px;
  font-family: 'DM Sans', sans-serif; font-size: 16px; color: var(--faq-cream);
  resize: vertical;
}

.faq-contact-field input:focus, .faq-contact-field textarea:focus { outline: none; border-color: var(--faq-yellow); }

.faq-contact-form button {
  min-height: 44px; background: transparent; color: var(--faq-yellow);
  border: 1px solid var(--faq-yellow); border-radius: 2px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}

.faq-contact-form button:disabled { opacity: 0.6; }

.faq-book:focus-visible, .faq-contact-form button:focus-visible { outline: 2px solid var(--faq-cream); outline-offset: 2px; }

.faq-contact-error { font-family: 'DM Sans', sans-serif; font-size: 12px; color: #FF6B4A; min-height: 0; }

.faq-contact-error:empty { display: none; }

.faq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.faq-sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 600px) {
  .chatw { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .chatw-panel { width: 100%; max-height: calc(100dvh - 100px); }
  .chatw-launcher { width: 56px; height: 56px; }
}
