/* ───────────────────────────────────────────────────────────────────
   Ask the Handbook — Claude widget styles
   ─────────────────────────────────────────────────────────────────── */

.ask-launcher {
  position: fixed;
  right: 22px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 14px 14px;
  border-radius: 100px;
  border: none;
  background: linear-gradient(135deg, var(--pink) 0%, var(--orange) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(227,34,92,0.35), 0 4px 12px rgba(46,5,77,0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ask-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(227,34,92,0.42), 0 6px 16px rgba(46,5,77,0.2);
}
.ask-launcher svg { display: block; }

@media (min-width: 920px) {
  .ask-launcher { bottom: 32px; right: 32px; }
}

body.ask-open .ask-launcher {
  display: none;
}

.ask-panel {
  position: fixed;
  z-index: 70;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 22px;
  top: 80px;
  display: none;
  flex-direction: column;
  background: var(--page-bg);
  border: 1.5px solid var(--border-strong);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(46,5,77,0.25);
}
body.ask-open .ask-panel { display: flex; }

@media (min-width: 920px) {
  .ask-panel {
    left: auto;
    top: auto;
    right: 32px;
    bottom: 32px;
    width: 440px;
    height: 640px;
    max-height: calc(100vh - 64px);
  }
}

.ask-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-mid) 100%);
  color: #fff;
  flex: 0 0 auto;
}
.ask-panel-head-left { display: flex; align-items: center; gap: 12px; }
.ask-panel-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.ask-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.ask-panel-sub {
  font-weight: 600;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 1px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ask-panel-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ask-panel-close:hover { background: rgba(255,255,255,0.28); }

.ask-panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ask-welcome {
  text-align: center;
  padding: 22px 8px 8px;
}
.ask-welcome-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.ask-welcome-sub {
  margin-top: 8px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--mute);
  line-height: 1.5;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.ask-suggestions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.ask-suggestion {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.ask-suggestion:hover {
  border-color: var(--pink);
  background: color-mix(in srgb, var(--pink) 6%, var(--card));
}

.ask-msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
}
.ask-msg-user { justify-content: flex-end; }
.ask-msg-user .ask-bubble {
  background: var(--purple);
  color: #fff;
  border-bottom-right-radius: 6px;
  max-width: 80%;
}
.ask-msg-bot { align-items: flex-start; }
.ask-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.ask-msg-body { flex: 1; min-width: 0; }
.ask-bubble {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--ink);
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.55;
  border-bottom-left-radius: 6px;
}
.ask-bubble p { margin: 0 0 8px; }
.ask-bubble p:last-child { margin-bottom: 0; }
.ask-bubble ul { margin: 6px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.ask-bubble li { font-size: 13px; }
.ask-bubble strong { color: var(--ink); font-weight: 700; }
.ask-bubble-loading {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 16px 16px;
}
.ask-bubble-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  opacity: 0.4;
  animation: ask-dot 1.2s ease-in-out infinite;
}
.ask-bubble-loading span:nth-child(2) { animation-delay: 0.15s; }
.ask-bubble-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ask-dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.ask-citation {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--pink) 8%, var(--card));
  border: 1.5px solid color-mix(in srgb, var(--pink) 24%, var(--border));
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.ask-citation:hover {
  background: color-mix(in srgb, var(--pink) 14%, var(--card));
  border-color: var(--pink);
}
.ask-citation-bullet { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ask-citation-text { display: flex; flex-direction: column; gap: 2px; }
.ask-citation-label {
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.ask-citation-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--pink);
  letter-spacing: -0.01em;
}

.ask-panel-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--card);
  border-top: 1.5px solid var(--border);
  flex: 0 0 auto;
}
.ask-panel-input {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  outline: none;
}
.ask-panel-input:focus {
  border-color: var(--pink);
}
.ask-panel-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.ask-panel-send:hover { background: color-mix(in srgb, var(--pink) 80%, black); transform: scale(1.05); }

.ask-panel-disclaimer {
  flex: 0 0 auto;
  padding: 10px 18px 14px;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--mute);
  line-height: 1.4;
  text-align: center;
  background: var(--card);
  border-top: 1px solid var(--border);
}

/* Dark mode */
[data-theme="dark"] .ask-citation {
  background: color-mix(in srgb, var(--pink) 16%, var(--card));
}
[data-theme="dark"] .ask-launcher {
  box-shadow: 0 10px 30px rgba(227,34,92,0.4), 0 4px 12px rgba(0,0,0,0.4);
}
