/* ==============================================
   Ask PostAI — chat widget (floating) and /ask/ page (embedded)
   Self-contained: own tokens, everything prefixed .ask-
   ============================================== */
.ask-root {
  --a-bg: #0f0f1a; --a-bg-2: #161624; --a-card: #1b1b2b; --a-border: rgba(139, 92, 246, .22);
  --a-accent: #8b5cf6; --a-accent-2: #a78bfa; --a-text: #f1f5f9; --a-text-2: #a3aec2; --a-text-3: #6b7689;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--a-text-2); line-height: 1.55;
}
.ask-root *, .ask-root *::before, .ask-root *::after { box-sizing: border-box; }
.ask-root [hidden] { display: none !important; }

/* ---------- Launcher ---------- */
.ask-launch { position: fixed; right: 20px; bottom: 20px; z-index: 10000; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; border: 0; border-radius: 999px; cursor: pointer; font: 700 15px/1 'Inter', sans-serif; color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6366f1); box-shadow: 0 12px 34px rgba(139, 92, 246, .45), 0 0 0 1px rgba(255, 255, 255, .08) inset;
  transition: transform .2s, bottom .3s; }
.ask-launch:hover { transform: translateY(-2px); }
.ask-launch__ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); font-size: 14px; }
.ask-launch__dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.ask-launch__tip { position: absolute; right: 0; bottom: calc(100% + 10px); white-space: nowrap; padding: 9px 13px; border-radius: 12px;
  font: 500 13.5px/1.3 'Inter', sans-serif; color: var(--a-text); background: var(--a-card); border: 1px solid var(--a-border); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.ask-open .ask-launch { display: none; }

/* ---------- Panel ---------- */
.ask-panel { display: flex; flex-direction: column; background: var(--a-bg); border: 1px solid var(--a-border); overflow: hidden; }
.ask-root--float .ask-panel { position: fixed; right: 20px; bottom: 20px; z-index: 10001; width: 400px; height: min(660px, calc(100vh - 40px));
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.ask-root--page .ask-panel { height: min(760px, calc(100vh - 140px)); min-height: 520px; border-radius: 20px; }
.ask-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--a-border); background: var(--a-bg-2); }
.ask-head__av { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.ask-head__t { flex: 1; min-width: 0; }
.ask-head__t b { display: block; color: var(--a-text); font-size: 15px; }
.ask-head__t span { font-size: 12px; color: var(--a-text-3); display: flex; align-items: center; gap: 6px; }
.ask-head__t span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34d399; }
.ask-icon-btn { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--a-text-2); cursor: pointer; font-size: 18px; display: grid; place-items: center; }
.ask-icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--a-text); }
.ask-root--page .ask-close { display: none; }

/* ---------- Log ---------- */
.ask-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; overscroll-behavior: contain; }
.ask-msg { max-width: 88%; font-size: 14.5px; }
.ask-root--page .ask-msg { max-width: 80%; }
.ask-msg--bot { align-self: flex-start; }
.ask-msg--user { align-self: flex-end; }
.ask-bubble { padding: 10px 14px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.ask-msg--bot .ask-bubble { background: var(--a-card); color: var(--a-text-2); border-top-left-radius: 6px; }
.ask-msg--user .ask-bubble { background: var(--a-accent); color: #fff; border-top-right-radius: 6px; white-space: pre-wrap; }
.ask-bubble p + p, .ask-bubble p + ul, .ask-bubble ul + p { margin-top: 8px; }
.ask-bubble ul { padding-left: 18px; margin: 0; }
.ask-bubble li + li { margin-top: 3px; }
.ask-bubble strong { color: var(--a-text); }
.ask-msg--user .ask-bubble strong { color: #fff; }
.ask-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ask-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-text-3); animation: ask-bounce 1s infinite; }
.ask-typing i:nth-child(2) { animation-delay: .15s; } .ask-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ask-bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Cards ---------- */
.ask-cards { display: grid; gap: 8px; margin-top: 8px; max-width: 320px; }
.ask-card { display: block; width: 100%; text-align: left; border-radius: 14px; background: var(--a-bg-2); border: 1px solid var(--a-border); overflow: hidden; color: inherit; font: inherit; cursor: pointer; text-decoration: none; transition: border-color .2s; }
.ask-card:hover { border-color: rgba(139, 92, 246, .55); }
.ask-card__media { position: relative; background: #000; }
.ask-card--video .ask-card__media { aspect-ratio: 9 / 12; max-height: 320px; }
.ask-card--youtube .ask-card__media { aspect-ratio: 16 / 9; }
.ask-card__media img, .ask-card__media video, .ask-card__media iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.ask-card--video video { object-fit: contain; }
.ask-card__play { position: absolute; inset: 0; display: grid; place-items: center; }
.ask-card__play span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: #fff; background: rgba(139, 92, 246, .9); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); padding-left: 3px; }
.ask-card__body { padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.ask-card__ic { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; background: rgba(139, 92, 246, .15); font-size: 16px; }
.ask-card__txt { flex: 1; min-width: 0; }
.ask-card__txt b { display: block; color: var(--a-text); font-size: 14px; line-height: 1.3; }
.ask-card__txt span { display: block; font-size: 12.5px; color: var(--a-text-3); line-height: 1.35; margin-top: 2px; }
.ask-card__go { color: var(--a-accent-2); font-weight: 700; }
.ask-cta { padding: 12px; border-radius: 14px; background: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(99, 102, 241, .1)); border: 1px solid rgba(139, 92, 246, .45); }
.ask-cta b { display: block; color: var(--a-text); font-size: 14.5px; }
.ask-cta > span { display: block; font-size: 12.5px; color: var(--a-text-2); margin: 2px 0 10px; }
.ask-cta form { display: flex; gap: 6px; }
.ask-cta input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--a-border); background: var(--a-bg); color: var(--a-text); font: 14px 'Inter', sans-serif; }
.ask-cta input:focus { outline: none; border-color: var(--a-accent); }
.ask-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border: 0; border-radius: 10px; cursor: pointer;
  font: 700 14px/1.1 'Inter', sans-serif; color: #fff; background: var(--a-accent); text-decoration: none; white-space: nowrap; }
.ask-btn:hover { background: #7c4dff; }
.ask-btn--full { width: 100%; }

/* ---------- Chips + input ---------- */
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.ask-chip { border: 1px solid var(--a-border); background: transparent; color: var(--a-accent-2); border-radius: 999px; padding: 7px 12px; font: 600 13px/1.2 'Inter', sans-serif; cursor: pointer; }
.ask-chip:hover { background: rgba(139, 92, 246, .12); color: var(--a-text); }
.ask-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--a-border); background: var(--a-bg-2); }
.ask-form textarea { flex: 1; resize: none; max-height: 120px; min-height: 42px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--a-border);
  background: var(--a-bg); color: var(--a-text); font: 15px/1.4 'Inter', sans-serif; }
.ask-form textarea:focus { outline: none; border-color: var(--a-accent); }
.ask-send { width: 42px; height: 42px; flex: none; border: 0; border-radius: 12px; cursor: pointer; background: var(--a-accent); color: #fff; font-size: 18px; display: grid; place-items: center; }
.ask-send:disabled { opacity: .45; cursor: default; }
.ask-note { padding: 0 14px 10px; font-size: 11px; color: var(--a-text-3); text-align: center; background: var(--a-bg-2); }

/* The site's bottom bar ("WhatsApp us / Try free", shown up to 968px wide) must never sit under the launcher */
.ask-launch { transition: bottom .25s ease; }
@media (max-width: 968px) {
  body:has(.mobile-cta.show) .ask-launch, body:has(.rsticky) .ask-launch, body:has(.floating-cta) .ask-launch { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .ask-launch { right: 14px; bottom: 14px; padding: 11px 15px 11px 12px; font-size: 14px; }
  .ask-launch__tip { display: none; }
  .ask-root--float .ask-panel { inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .ask-root--page .ask-panel { height: calc(100dvh - 120px); min-height: 460px; border-radius: 16px; }
  .ask-form textarea { font-size: 16px; } /* no iOS zoom */
}
@media (prefers-reduced-motion: reduce) { .ask-typing i { animation: none; } .ask-log { scroll-behavior: auto; } }
/* Wide (16:9) cards: keep the play button off the poster's headline */
.ask-card__media[style] .ask-card__play { place-items: end; padding: 10px; }
.ask-card__media[style] .ask-card__play span { width: 44px; height: 44px; font-size: 15px; }

/* Live demo chapter list */
.ask-chapters { cursor: default; }
.ask-chapters__list { list-style: none; margin: 0; padding: 0 8px 8px; display: grid; gap: 2px; counter-reset: ch; }
.ask-chapters__list li { counter-increment: ch; }
.ask-chapters__btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--a-text-2); font: 500 13px/1.3 'Inter', sans-serif; text-align: left; cursor: pointer; }
.ask-chapters__btn::before { content: counter(ch); flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: rgba(139, 92, 246, .15); color: var(--a-accent-2); }
.ask-chapters__btn span { flex: 1; }
.ask-chapters__btn i { font-style: normal; font-size: 11.5px; color: var(--a-text-3); }
.ask-chapters__btn:hover, .ask-chapters__list li.on .ask-chapters__btn { background: rgba(139, 92, 246, .14); color: var(--a-text); }
.ask-card__media[hidden] { display: none; }
@media (max-width: 560px) { .ask-chip { min-height: 40px; padding: 9px 14px; } .ask-icon-btn { width: 42px; height: 42px; } }
/* Phones: compact round launcher so it never covers content */
@media (max-width: 560px) {
  .ask-launch { width: 52px; height: 52px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .ask-launch__ic { width: 52px; height: 52px; background: transparent; font-size: 20px; }
  .ask-launch__dot { position: absolute; top: 6px; right: 6px; }
}

/* ---------- Live AI demo: "Jump to 08:12" buttons under an answer ---------- */
.ask-jumps { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-width: 100%; }
.ask-jump { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 8px 12px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font: 600 13px/1.3 'Inter', sans-serif; color: var(--a-text); background: rgba(139, 92, 246, .16); border: 1px solid var(--a-border); transition: background .15s, border-color .15s; }
.ask-jump:hover { background: rgba(139, 92, 246, .28); border-color: var(--a-accent-2); }
.ask-jump__ic { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--a-accent); color: #fff; font-size: 9px; padding-left: 1px; }
.ask-jump i { font-style: normal; font-weight: 500; color: var(--a-text-2); }
