/* Ask Daddy GO — widget styles. Scoped to .adg- to avoid host-page collisions. */
.adg-root,
.adg-root * {
  box-sizing: border-box;
  font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.adg-root {
  --adg-emerald: #0f4d3a;
  --adg-emerald-deep: #083227;
  --adg-emerald-soft: #1c6b52;
  --adg-gold: #c9a128;
  --adg-gold-lt: #e8c84a;
  --adg-cream: #faf6ee;
  --adg-cream-deep: #f1ead7;
  --adg-ink: #0c1410;
  --adg-muted: #6e7268;
  --adg-line: rgba(15, 77, 58, 0.14);
  --adg-shadow: 0 24px 60px -18px rgba(8, 50, 39, 0.45),
                0 8px 22px -10px rgba(8, 50, 39, 0.28);
  position: fixed;
  z-index: 2147483000;
  bottom: 22px;
  right: 22px;
  color: var(--adg-ink);
}

/* ── Floating button ───────────────────────────────────────── */
.adg-fab {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--adg-gold);
  background: radial-gradient(circle at 30% 25%, var(--adg-emerald-soft), var(--adg-emerald-deep) 75%);
  color: var(--adg-cream);
  cursor: pointer;
  box-shadow: var(--adg-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  padding: 0;
}
.adg-fab:hover { transform: translateY(-2px) scale(1.04); }
.adg-fab:active { transform: translateY(0) scale(0.98); }
.adg-fab-inner {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
}
.adg-fab-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.adg-fab-mono {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-weight: 700; font-size: 22px; letter-spacing: 1.5px;
  color: var(--adg-gold-lt);
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.adg-fab-pulse {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--adg-gold);
  opacity: 0.6; animation: adg-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes adg-pulse {
  0%   { transform: scale(0.9); opacity: 0.6; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
.adg-fab-ring {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  pointer-events: none;
  overflow: visible;
  animation: adg-ring-spin 18s linear infinite;
}
.adg-fab-ring text {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 8.2px;
  letter-spacing: 1.4px;
  fill: var(--adg-gold-lt);
  text-transform: uppercase;
  paint-order: stroke;
  stroke: rgba(8, 50, 39, 0.6);
  stroke-width: 0.6px;
}
@keyframes adg-ring-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .adg-fab-ring { animation: none; }
}

/* ── Panel ─────────────────────────────────────────────────── */
.adg-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 620px;
  max-height: calc(100vh - 110px);
  background: var(--adg-cream);
  border-radius: 18px;
  border: 1px solid var(--adg-line);
  box-shadow: var(--adg-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: adg-pop 0.22s ease-out;
}
@keyframes adg-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ────────────────────────────────────────────────── */
.adg-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 10px;
  background: linear-gradient(135deg, var(--adg-emerald-deep), var(--adg-emerald));
  color: var(--adg-cream);
  border-bottom: 1px solid rgba(201,161,40,0.25);
}
.adg-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--adg-gold-lt), var(--adg-gold) 75%);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.4);
  flex-shrink: 0; overflow: hidden; position: relative;
}
.adg-avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.adg-avatar-mono {
  font-family: "Cinzel", serif; font-weight: 700;
  color: var(--adg-emerald-deep); font-size: 14px; letter-spacing: 1px;
}
.adg-title-wrap { flex: 1; min-width: 0; }
.adg-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600; font-size: 17px;
  color: var(--adg-cream);
}
.adg-sub {
  font-size: 10.5px; opacity: 0.78; letter-spacing: 0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adg-lang {
  background: rgba(0,0,0,0.25);
  color: var(--adg-cream);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  font-size: 11px;
  padding: 4px 6px;
  max-width: 110px;
  cursor: pointer;
}
.adg-lang option { background: var(--adg-emerald-deep); color: var(--adg-cream); }
.adg-icon-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--adg-cream);
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.adg-icon-btn:hover { background: rgba(255,255,255,0.18); }

/* ── Mode bar ──────────────────────────────────────────────── */
.adg-modes {
  display: flex; gap: 6px; padding: 8px 10px;
  background: var(--adg-cream-deep);
  border-bottom: 1px solid var(--adg-line);
  overflow-x: auto;
}
.adg-modes::-webkit-scrollbar { display: none; }
.adg-mode {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--adg-line);
  color: var(--adg-emerald-deep);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}
.adg-mode:hover { background: rgba(15,77,58,0.06); }
.adg-mode.on {
  background: var(--adg-emerald);
  color: var(--adg-cream);
  border-color: var(--adg-emerald);
}

/* ── Messages ──────────────────────────────────────────────── */
.adg-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background:
    radial-gradient(circle at 0% 0%, rgba(201,161,40,0.05), transparent 40%),
    var(--adg-cream);
  display: flex; flex-direction: column; gap: 10px;
}
.adg-msgs::-webkit-scrollbar { width: 6px; }
.adg-msgs::-webkit-scrollbar-thumb { background: rgba(15,77,58,0.25); border-radius: 3px; }

.adg-welcome { text-align: center; padding: 18px 6px 6px; }
.adg-welcome-mono {
  margin: 0 auto 10px;
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--adg-gold-lt), var(--adg-gold) 75%);
  display: flex; align-items: center; justify-content: center;
  font-family: "Cinzel", serif; font-weight: 700; font-size: 18px;
  color: var(--adg-emerald-deep); letter-spacing: 1px;
  border: 2px solid var(--adg-emerald);
}
.adg-welcome-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px; font-weight: 600; color: var(--adg-emerald-deep);
  margin-bottom: 4px;
}
.adg-welcome-msg {
  font-size: 13px; color: var(--adg-muted);
  line-height: 1.45; max-width: 280px; margin: 0 auto 14px;
}
.adg-prompts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-top: 8px;
}
.adg-prompt {
  background: #fff;
  border: 1px solid var(--adg-line);
  color: var(--adg-emerald-deep);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  line-height: 1.3;
  font-weight: 500;
  transition: all 0.15s;
}
.adg-prompt:hover {
  border-color: var(--adg-gold);
  background: var(--adg-cream-deep);
}

.adg-msg { display: flex; }
.adg-msg-user { justify-content: flex-end; }
.adg-msg-assistant { justify-content: flex-start; }
.adg-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.adg-msg-user .adg-bubble {
  background: var(--adg-emerald);
  color: var(--adg-cream);
  border-bottom-right-radius: 4px;
}
.adg-msg-assistant .adg-bubble {
  background: #fff;
  color: var(--adg-ink);
  border: 1px solid var(--adg-line);
  border-bottom-left-radius: 4px;
}

/* ── Input row ─────────────────────────────────────────────── */
.adg-input-row {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid var(--adg-line);
}
.adg-input {
  flex: 1;
  border: 1px solid var(--adg-line);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: var(--adg-cream);
  color: var(--adg-ink);
  max-height: 120px;
  line-height: 1.4;
  transition: border-color 0.15s;
}
.adg-input:focus { border-color: var(--adg-emerald); }
.adg-send, .adg-mic {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, opacity 0.15s;
}
.adg-send {
  background: var(--adg-emerald);
  color: var(--adg-cream);
}
.adg-send:hover { transform: scale(1.05); }
.adg-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.adg-mic {
  background: var(--adg-cream-deep);
  color: var(--adg-emerald-deep);
  border: 1px solid var(--adg-line);
}
.adg-mic:hover { background: var(--adg-gold-lt); }

.adg-disclaimer {
  padding: 6px 12px 8px;
  font-size: 9.5px;
  color: var(--adg-muted);
  background: var(--adg-cream-deep);
  text-align: center;
  line-height: 1.35;
  border-top: 1px solid var(--adg-line);
}

/* ── RTL support ───────────────────────────────────────────── */
.adg-panel[dir="rtl"] .adg-msg-user { justify-content: flex-start; }
.adg-panel[dir="rtl"] .adg-msg-assistant { justify-content: flex-end; }
.adg-panel[dir="rtl"] .adg-msg-user .adg-bubble {
  border-bottom-right-radius: 14px; border-bottom-left-radius: 4px;
}
.adg-panel[dir="rtl"] .adg-msg-assistant .adg-bubble {
  border-bottom-left-radius: 14px; border-bottom-right-radius: 4px;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .adg-root { bottom: 14px; right: 14px; }
  .adg-panel {
    width: calc(100vw - 28px);
    height: calc(100vh - 100px);
    bottom: 78px;
  }
}

/* Typing indicator */
.adg-typing { display: inline-flex; gap: 4px; align-items: center; padding: 10px 14px; }
.adg-typing .adg-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; opacity: 0.45;
  animation: adg-bounce 1.2s infinite ease-in-out;
}
.adg-typing .adg-dot:nth-child(2) { animation-delay: 0.15s; }
.adg-typing .adg-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes adg-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 0.9; }
}

/* ── Panel show/hide (close-button fix) ───────────────────── */
.adg-root:not(.adg-open) .adg-panel { display: none !important; }

/* ── Voice capture row (waveform + status) ────────────────── */
.adg-voice-row {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--adg-emerald-deep), var(--adg-emerald));
  color: var(--adg-cream);
  border-top: 1px solid rgba(201,161,40,0.3);
}
.adg-voice-row.on { display: flex; }
.adg-voice-canvas {
  flex: 1;
  height: 36px;
  background: rgba(0,0,0,0.22);
  border-radius: 8px;
  display: block;
}
.adg-voice-status {
  font-size: 11.5px;
  letter-spacing: 0.2px;
  opacity: 0.92;
  white-space: nowrap;
}

/* ── Mic button states ────────────────────────────────────── */
.adg-mic.listening {
  background: var(--adg-gold);
  color: var(--adg-emerald-deep);
  border-color: var(--adg-gold);
  box-shadow: 0 0 0 0 rgba(201,161,40,0.55);
  animation: adg-mic-pulse 1.2s ease-out infinite;
}
.adg-mic.your-turn {
  animation: adg-mic-cue 1.6s ease-out 2;
}
@keyframes adg-mic-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201,161,40,0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(201,161,40,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,161,40,0); }
}
@keyframes adg-mic-cue {
  0%   { box-shadow: 0 0 0 0 rgba(201,161,40,0.55); }
  50%  { box-shadow: 0 0 0 10px rgba(201,161,40,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,161,40,0); }
}

/* ── Inline status (errors / hints) ───────────────────────── */
.adg-inline-status {
  padding: 6px 12px;
  font-size: 11.5px;
  background: var(--adg-cream-deep);
  color: var(--adg-muted);
  border-top: 1px solid var(--adg-line);
  text-align: center;
}
.adg-inline-status.err { color: #9b2c2c; background: #fdecec; }
