/* =====================================================================
 * aichat-agent.css - chat surface for HomeNew.html
 * ---------------------------------------------------------------------
 * Snapshot of the legacy VedAstro chat stylesheet (Website/js/
 * VedAstroChatUI.js, the <style> block inside generateHtmlBody) so that
 * HomeNew.html matches Home.html visually. The only transform applied is
 * the scope id: ${this.ElementID} -> AIChatAgent.
 *
 * Everything here is scoped under #AIChatAgent, so it cannot leak into
 * other pages. Styles for features the new agent does not have yet
 * (history, settings, subscription, tool cards) are kept intact on
 * purpose: pruning them risks silent visual drift.
 *
 * Do not hand-edit above the "HomeNew additions" section.
 * =================================================================== */
/* VedAstroChat scoped styles - prefix: ved-chat */
#AIChatAgent { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }

#AIChatAgent,
.ved-chat-modal[data-ved-owner="AIChatAgent"],
.ved-toast[data-ved-owner="AIChatAgent"] {
  --ved-bg-app: #f3f6fb;
  --ved-bg-surface: #ffffff;
  --ved-bg-elevated: #eef2ff;
  --ved-bg-input: #ffffff;
  --ved-bg-assistant: #ffffff;
  --ved-bg-user: #e0f2fe;
  --ved-chat-user-bg: rgb(217 253 211);
  --ved-chat-user-border: #b7e7a9;
  --ved-chat-user-btn-bg: transparent;
  --ved-chat-user-btn-border: #000000;
  --ved-chat-user-divider: rgba(113, 164, 92, 0.28);
  --ved-chat-assistant-divider: rgba(148, 163, 184, 0.38);
  --ved-chat-card-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  --ved-chat-speaker: #2563eb;
  --ved-chat-speaker-bg: rgba(37, 99, 235, 0.08);
  --ved-bg-code: #f8fafc;
  --ved-bg-tool-call: #f5f3ff;
  --ved-bg-tool-params: #eef2ff;
  --ved-bg-tool-result: #ecfdf5;
  --ved-bg-approval: #fffbeb;
  --ved-bg-approval-approved: #ecfdf5;
  --ved-bg-approval-denied: #fef2f2;
  --ved-bg-toast: #ffffff;
  --ved-bg-plan-card: #f5f3ff;
  --ved-bg-plan-panel: #ffffff;
  --ved-text-primary: #0f172a;
  --ved-text-secondary: #475569;
  --ved-text-muted: #64748b;
  --ved-text-subtle: #94a3b8;
  --ved-text-inverse: #ffffff;
  --ved-border: #dbe2ea;
  --ved-border-strong: #cbd5e1;
  --ved-shadow: 0 20px 60px rgba(15, 23, 42, 0.16);
  --ved-overlay: rgba(15, 23, 42, 0.48);
  --ved-accent: #7c3aed;
  --ved-accent-hover: #6d28d9;
  --ved-accent-text: #7c3aed;
  --ved-accent-soft: rgba(124, 58, 237, 0.1);
  --ved-info: #0369a1;
  --ved-info-border: #bae6fd;
  --ved-success: #16a34a;
  --ved-success-border: #bbf7d0;
  --ved-warning: #d97706;
  --ved-warning-border: #fcd34d;
  --ved-danger: #dc2626;
  --ved-danger-border: #fecaca;
  --ved-scrollbar: #cbd5e1;
  --ved-surface-gradient:
    radial-gradient(circle at top, rgba(99, 102, 241, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(240,244,251,0.95));
  --ved-shell-gradient: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(250,250,250,0.92));
  --ved-glass-surface: rgba(255, 255, 255, 0.78);
  --ved-glass-surface-strong: rgba(255, 255, 255, 0.92);
  --ved-glass-border: rgba(226, 232, 240, 0.9);
  --ved-hero-gradient: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 100%);
  --ved-card-title: #1e293b;
  --ved-card-question: #64748b;
  --ved-input-text: #1e293b;
  --ved-input-placeholder: #94a3b8;
  --ved-input-icon: #6366f1;
  --ved-input-icon-muted: #94a3b8;
  --ved-send-bg: #4f46e5;
  --ved-send-bg-hover: #6366f1;
  --ved-send-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  --ved-mic-hover-bg: rgba(99, 102, 241, 0.08);
}

body.darkmode--activated #AIChatAgent,
body.darkmode--activated .ved-chat-modal[data-ved-owner="AIChatAgent"],
body.darkmode--activated .ved-toast[data-ved-owner="AIChatAgent"] {
  --ved-bg-app: #0d0d14;
  --ved-bg-surface: #12121e;
  --ved-bg-elevated: #1a1a2e;
  --ved-bg-input: #0d0d14;
  --ved-bg-assistant: #15151f;
  --ved-bg-user: #0e2a3e;
  --ved-chat-user-bg: #16311f;
  --ved-chat-user-border: #2d6b37;
  --ved-chat-user-btn-bg: transparent;
  --ved-chat-user-btn-border: rgba(255, 255, 255, 0.82);
  --ved-chat-user-divider: rgba(74, 222, 128, 0.24);
  --ved-chat-assistant-divider: rgba(148, 163, 184, 0.18);
  --ved-chat-card-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  --ved-chat-speaker: #60a5fa;
  --ved-chat-speaker-bg: rgba(96, 165, 250, 0.14);
  --ved-bg-code: #0a0a12;
  --ved-bg-tool-call: #0f0f1e;
  --ved-bg-tool-params: #070710;
  --ved-bg-tool-result: #091a12;
  --ved-bg-approval: #1a1a10;
  --ved-bg-approval-approved: #0f1a12;
  --ved-bg-approval-denied: #1a0f0f;
  --ved-bg-toast: #1a1a2e;
  --ved-bg-plan-card: #1a1a2e;
  --ved-bg-plan-panel: #12121f;
  --ved-text-primary: #e8e8f0;
  --ved-text-secondary: #a0a0c0;
  --ved-text-muted: #808090;
  --ved-text-subtle: #555580;
  --ved-text-inverse: #ffffff;
  --ved-border: #1e1e30;
  --ved-border-strong: #2a2a45;
  --ved-shadow: 0 20px 60px rgba(0,0,0,0.6);
  --ved-overlay: rgba(0,0,0,0.85);
  --ved-accent: #7c3aed;
  --ved-accent-hover: #6d28d9;
  --ved-accent-text: #c4b5fd;
  --ved-accent-soft: rgba(124, 58, 237, 0.1);
  --ved-info: #7dd3fc;
  --ved-info-border: #1e4a70;
  --ved-success: #86efac;
  --ved-success-border: #14391e;
  --ved-warning: #fbbf24;
  --ved-warning-border: #4a3d0a;
  --ved-danger: #f87171;
  --ved-danger-border: #3a2030;
  --ved-scrollbar: #2a2a40;
  --ved-surface-gradient:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(13,13,20,0.98), rgba(20,20,32,0.96));
  --ved-shell-gradient: linear-gradient(180deg, rgba(20,20,32,0.94), rgba(14,14,24,0.94));
  --ved-glass-surface: rgba(19, 19, 31, 0.82);
  --ved-glass-surface-strong: rgba(18, 18, 30, 0.92);
  --ved-glass-border: rgba(63, 63, 96, 0.78);
  --ved-hero-gradient: linear-gradient(135deg, #f5f3ff 0%, #c4b5fd 40%, #93c5fd 100%);
  --ved-card-title: #eef2ff;
  --ved-card-question: #b6c0d4;
  --ved-input-text: #eef2ff;
  --ved-input-placeholder: #7c89a0;
  --ved-input-icon: #a78bfa;
  --ved-input-icon-muted: #8ea1c0;
  --ved-send-bg: #7c3aed;
  --ved-send-bg-hover: #8b5cf6;
  --ved-send-shadow: 0 10px 24px rgba(76, 29, 149, 0.42);
  --ved-mic-hover-bg: rgba(124, 58, 237, 0.18);
}

body.darkmode--activated #AIChatAgent .darkmode-ignore,
body.darkmode--activated #AIChatAgent .darkmode-ignore *,
body.darkmode--activated .ved-chat-modal[data-ved-owner="AIChatAgent"].darkmode-ignore,
body.darkmode--activated .ved-chat-modal[data-ved-owner="AIChatAgent"].darkmode-ignore *,
body.darkmode--activated .ved-toast[data-ved-owner="AIChatAgent"].darkmode-ignore,
body.darkmode--activated .ved-toast[data-ved-owner="AIChatAgent"].darkmode-ignore * {
  filter: none !important;
}

#AIChatAgent .ved-chat-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: clamp(32rem, 82vh, 56rem);
  background: var(--ved-surface-gradient);
  color: var(--ved-text-primary);
  border-radius: 24px;
  overflow: visible;
  box-shadow: none;
  padding: 16px 12px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#AIChatAgent .ved-chat-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: transparent;
  border: none;
  border-radius: 0;
  /* soft bottom-only shadow line separating header from chat bubbles */
  box-shadow: 0 6px 8px -6px rgba(15, 23, 42, 0.18);
}

/* fade strip under the header: chat messages scrolling up dissolve into the background */
#AIChatAgent .ved-chat-header::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--ved-bg-app), transparent);
}

#AIChatAgent .ved-chat-header-title {
  display: none;
}

#AIChatAgent .ved-chat-header-subtitle {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ved-glass-surface);
  border: 1px solid var(--ved-glass-border);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  color: var(--ved-text-secondary);
  font-size: 11px;
}

#AIChatAgent .ved-chat-header-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--ved-glass-border);
  background: rgba(148, 163, 184, 0.12);
  color: var(--ved-text-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

#AIChatAgent .ved-chat-header-state-badge[data-state="accept-edits"] {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.22);
  color: var(--ved-info);
}

#AIChatAgent .ved-chat-header-state-badge[data-state="active"] {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--ved-text-secondary);
}

#AIChatAgent .ved-chat-header-state-badge[data-state="ready"] {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--ved-text-secondary);
}

#AIChatAgent .ved-chat-header-btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

#AIChatAgent .ved-chat-hero {
  position: relative;
  text-align: center;
  padding: 28px 8px 10px;
  overflow: visible;
}

/* active chat: hero title is hidden, so drop its reserved top padding —
   otherwise a big empty band sits between the header and the first bubble */
#AIChatAgent .ved-chat-has-active-session .ved-chat-hero {
  padding-top: 0;
}

#AIChatAgent .vedastro-hero-title {
  display: block;
  width: fit-content;
  max-width: 100%;
  font-size: clamp(2.15rem, 4.2vw, 3.35rem);
  font-weight: var(--bs-font-weight-semibold, 600);
  letter-spacing: -0.03em;
  line-height: 1.12;
  white-space: nowrap;
  margin: 0 auto 30px;
  padding: 0.05em 0.08em 0.12em;
  background: var(--ved-hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  overflow: visible;
  word-break: normal;
  animation: vedastroFadeInUp 0.8s ease-out both;
}

@keyframes vedastroFadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#AIChatAgent .vedastro-fade-delay-1 { animation: vedastroFadeInUp 0.8s ease-out 0.15s both; }
#AIChatAgent .vedastro-fade-delay-2 { animation: vedastroFadeInUp 0.8s ease-out 0.3s both; }

#AIChatAgent .vedastro-chat-shell {
  position: relative;
  width: 100%;
  max-width: min(100%, 1100px);
  margin: 0 auto 1rem;
  background: transparent;
  border: none;
  border-radius: 1.5rem;
  padding: 0.25rem 0.25rem 0.25rem;
  box-shadow: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#AIChatAgent .vedastro-chat-shell.is-hidden {
  display: none;
}

#AIChatAgent .ved-chat-messages,
#AIChatAgent .vedastro-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: max(10rem, calc(100vh - 220px));
  max-height: max(10rem, calc(100dvh - 220px));
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: auto;
  overflow-anchor: none;
  scrollbar-width: thin;
  scrollbar-color: var(--ved-scrollbar) transparent;
  background: transparent;
  border: none;
  border-radius: 0;
}

#AIChatAgent .ved-chat-messages::-webkit-scrollbar,
#AIChatAgent .vedastro-chat-messages::-webkit-scrollbar { width: 6px; }
#AIChatAgent .ved-chat-messages::-webkit-scrollbar-track,
#AIChatAgent .vedastro-chat-messages::-webkit-scrollbar-track { background: transparent; }
#AIChatAgent .ved-chat-messages::-webkit-scrollbar-thumb,
#AIChatAgent .vedastro-chat-messages::-webkit-scrollbar-thumb { background: var(--ved-scrollbar); border-radius: 999px; }

#AIChatAgent .ved-encryption-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 2px auto 10px;
  padding: 4px 12px;
  max-width: fit-content;
  border-radius: 999px;
  background: var(--ved-glass-surface);
  border: 1px solid var(--ved-glass-border);
  color: var(--ved-text-subtle);
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.85;
}

#AIChatAgent .ved-encryption-notice iconify-icon {
  flex: 0 0 auto;
  color: var(--ved-success);
  display: block;
}

#AIChatAgent .vedastro-scroll-bottom-btn {
  position: absolute;
  bottom: 16px;
  right: 24px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ved-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: vedastroScrollBounce 2s ease-in-out infinite;
}

#AIChatAgent .vedastro-scroll-bottom-btn:hover {
  transform: scale(1.08);
  animation: none;
}

@keyframes vedastroScrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  #AIChatAgent .vedastro-scroll-bottom-btn {
    animation: none;
  }
}

#AIChatAgent .vedastro-cards-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  margin: 0 auto 1.25rem;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  /* Scrollbar hidden: the strip is JS auto-scrolled and touch-draggable, so the
     scrollbar would be visual noise. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#AIChatAgent .vedastro-cards-wrapper::-webkit-scrollbar {
  display: none;
}

#AIChatAgent .vedastro-cards-wrapper.is-hidden {
  display: none;
}

/* Auto-scroll + drag is driven by JS (SuggestionCardsController) via the wrapper's
   scrollLeft — see VedAstroChat.js. The track is just a horizontal flex row rendered
   twice for the seamless loop. */
#AIChatAgent .vedastro-cards-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding: 0.5rem 0;
}

#AIChatAgent .vedastro-suggestion-card {
  flex-shrink: 0;
  width: 230px;
  background: var(--ved-glass-surface-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.25rem;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--ved-glass-border);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: left;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

#AIChatAgent .vedastro-suggestion-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 25px -10px rgba(0,0,0,0.15);
}

#AIChatAgent .vedastro-card-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  /* Progressive loading: the box (aspect-ratio) is reserved before the image
     exists, so there is no reflow. While the image is still pending, the element
     shows an animated placeholder; once decoded the bitmap fades in on top —
     see SuggestionCardsController's lazy loader. */
  background-color: var(--ved-glass-surface-strong);
}

/* Un-loaded: visible shimmer placeholder (element is opaque so the gradient shows,
   unlike the loaded fade-in which relies on the decoded bitmap). */
#AIChatAgent .vedastro-card-image.is-loading {
  background-image: linear-gradient(
    100deg,
    rgba(255,255,255,0.02) 30%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.02) 70%
  );
  background-size: 200% 100%;
  animation: vedastroCardShimmer 1.4s ease-in-out infinite;
}

/* Loaded: gently fade the decoded bitmap in over the placeholder background. */
/* A card image that failed all retries: hide the browser's broken-image icon
   but keep the card's image box so the marquee stays aligned. */
#AIChatAgent .vedastro-card-image.is-broken { visibility: hidden; }

#AIChatAgent .vedastro-card-image.is-loaded {
  animation: vedastroCardImageFadeIn 0.4s ease both;
}

@keyframes vedastroCardShimmer {
  0%   { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

@keyframes vedastroCardImageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#AIChatAgent .vedastro-card-question {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ved-card-title);
  line-height: 1.35;
  margin: 0;
  padding: 0.6rem 0.875rem;
  /* Reserve a consistent 2-line area and vertically center the text so 1-line
     questions sit balanced (no lopsided gap below) while all cards stay equal
     height. Questions are worded to fit within 2 lines. */
  min-height: calc(1.35em * 2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#AIChatAgentPersonMenu {
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(30rem, 70vh);
}

#AIChatAgent .ved-chat-person-chip-name {
  max-width: 6.5rem;
}

/* "Add person" Swal wizard — mounted on body, so NOT ElementID-scoped */
.swal2-popup.ved-add-person-swal {
  width: min(92vw, 26rem);
  padding: 0.5rem 0.5rem 1.1rem;
  border-radius: 1.1rem;
  overflow: visible;
}

.ved-add-person-swal .swal2-title {
  font-size: 1.15rem;
  padding-top: 0.7rem;
}

.ved-add-person-swal .swal2-html-container {
  overflow: visible;
  margin: 0.4rem 0.8rem 0;
  min-height: 64px;
  text-align: left;
}

.ved-add-person-swal .ved-add-person-hint {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 10px;
}

.ved-add-person-swal .btn-group.w-auto {
  min-width: 0 !important;
}

.ved-add-person-swal .btn-group .btn:first-child {
  max-width: 100%;
}

/* Person-list dropdown behaves as a normal overlay (Popper-positioned) that may
   cover the wizard's custom Next/Cancel buttons — they share the html-container's
   stacking context, so the menu's z-index: 1000 correctly paints above them.
   Only tame its size: beat the inline height: 412.5px / overflow: clip scroll
   and keep it within the popup width. */
.ved-add-person-swal .btn-group.w-auto > .dropdown-menu {
  min-width: 100%;
  max-width: min(84vw, 22rem);
  height: auto !important;
  max-height: 340px;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.ved-add-person-swal .ved-add-person-error {
  margin-top: 8px;
  text-align: left;
}

#AIChatAgent .ved-chat-memory-dialog :focus-visible,
#AIChatAgent .ved-chat-camera-dialog :focus-visible {
  outline: 2px solid var(--ved-accent);
  outline-offset: -2px;
}

#AIChatAgent .ved-chat-memory-dialog,
#AIChatAgent .ved-chat-camera-dialog {
  width: min(38rem, calc(100% - 2rem));
  max-height: min(36rem, calc(100% - 2rem));
  padding: 1.25rem;
  overflow: auto;
  border: 1px solid var(--ved-border);
  border-radius: 1rem;
  background: var(--ved-bg-toast);
  color: var(--ved-text-primary);
  box-shadow: var(--ved-shadow);
}

#AIChatAgent .ved-chat-memory-dialog::backdrop,
#AIChatAgent .ved-chat-camera-dialog::backdrop {
  background: var(--ved-overlay);
}

#AIChatAgent .ved-chat-memory-header,
#AIChatAgent .ved-chat-camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

#AIChatAgent .ved-chat-memory-header h2,
#AIChatAgent .ved-chat-camera-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

#AIChatAgent .ved-chat-memory-close,
#AIChatAgent .ved-chat-camera-button {
  min-height: 2.5rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--ved-border-strong);
  border-radius: 0.6rem;
  background: var(--ved-bg-code);
  color: var(--ved-text-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

#AIChatAgent .ved-chat-memory-dialog p,
#AIChatAgent .ved-chat-camera-status {
  color: var(--ved-text-secondary);
  font-size: 0.9rem;
}

#AIChatAgent .ved-chat-camera-dialog video {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 0.65rem;
  background: var(--ved-bg-code);
}

#AIChatAgent .ved-chat-camera-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

#AIChatAgent .ved-chat-camera-shutter:not(:disabled) {
  background: var(--ved-accent);
  border-color: var(--ved-accent);
  color: #fff;
}

#AIChatAgent .ved-chat-camera-shutter:disabled {
  opacity: 0.6;
  cursor: default;
}

#AIChatAgent .ved-chat-memory-text {
  max-height: min(20rem, 50vh);
  margin: 0;
  padding: 0.8rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--ved-border);
  border-radius: 0.6rem;
  background: var(--ved-bg-code);
  color: var(--ved-text-primary);
  font: inherit;
}

@media (max-width: 991.98px) {
  #AIChatAgent .ved-chat-container {
    min-height: clamp(30rem, 78vh, 48rem);
    padding: 12px 8px 10px;
  }
  #AIChatAgent .vedastro-chat-shell,
  #AIChatAgent .ved-chat-input-wrap {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  #AIChatAgent .ved-chat-container {
    min-height: clamp(28rem, 85vh, 44rem);
    border-radius: 0;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 14px 12px 12px;
  }

  #AIChatAgent .ved-chat-container.ved-chat-has-active-session {
    min-height: auto;
  }

  #AIChatAgent .ved-chat-hero {
    padding: 18px 0 8px;
  }

  #AIChatAgent .ved-chat-header {
    position: relative; /* keep ::after fade strip anchored (was static) */
    top: auto;
    right: auto;
    gap: 6px;
    padding: 8px 4px 4px;
    margin-bottom: 4px;
  }

  #AIChatAgent .ved-chat-header-btns {
    gap: 6px;
  }

  #AIChatAgent .ved-chat-header-subtitle {
    padding: 4px 8px;
    font-size: 10px;
  }

  #AIChatAgent .vedastro-hero-title {
    width: auto;
    max-width: 100%;
    white-space: normal;
    text-wrap: balance;
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin-top: 16px;
    margin-bottom: 24px;
    padding-inline: 0.04em;
  }

  #AIChatAgent .vedastro-suggestion-card {
    width: 180px;
  }

  #AIChatAgent .vedastro-card-question {
    font-size: 0.8125rem;
    padding: 0.6rem 0.7rem 0.7rem;
  }

  #AIChatAgent .ved-chat-messages,
  #AIChatAgent .vedastro-chat-messages {
    padding-left: 0;
    padding-right: 0;
  }

  #AIChatAgent .vedastro-chat-shell {
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  #AIChatAgent .vedastro-scroll-bottom-btn {
    width: 44px;
    height: 44px;
    bottom: 12px;
    right: 16px;
  }
}

#AIChatAgent .ved-msg-wrap {
  width: 100%;
  margin: 0 auto 14px;
  display: flex;
  flex-direction: column;
}

#AIChatAgent .ved-msg-wrap.is-assistant {
  align-items: flex-start;
}

#AIChatAgent .ved-msg-wrap.is-user {
  align-items: flex-end;
}

/* Queued user messages are already sent from the user's point of view. */
#AIChatAgent .ved-msg-wrap.is-queued {
  opacity: 1;
}

#AIChatAgent .ved-msg-wrap.is-queued .ved-chat-card {
  border-style: solid;
}

/* Side-question fork: tangential, non-astrology, single-shot, not in main transcript. */
#AIChatAgent .ved-msg-wrap.is-side {
  opacity: 0.78;
}

#AIChatAgent .ved-msg-wrap.is-side .ved-chat-card {
  border-left: 3px solid var(--ved-accent, #8a6dff);
}

#AIChatAgent .ved-queued-spinner {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
  color: var(--ved-text-muted);
}

/* Direct answer messages — compact, decisive verdict bubbles */
#AIChatAgent .ved-direct-answer-message .ved-chat-card {
  max-width: min(70%, 420px);
  border-left: 4px solid var(--ved-accent, #7c3aed);
  background: var(--ved-bg-elevated);
}

#AIChatAgent .ved-direct-answer-message .ved-msg-body {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-chat-message {
  display: flex;
  flex-direction: column;
  width: 100%;
}

#AIChatAgent .ved-chat-message.assistant {
  align-items: flex-start;
}

#AIChatAgent .ved-chat-message.user {
  align-items: flex-end;
}

#AIChatAgent .ved-chat-card {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--ved-border);
  background: var(--ved-bg-assistant);
  color: var(--ved-text-primary);
  box-shadow: var(--ved-chat-card-shadow);
}

#AIChatAgent .ved-chat-message.assistant .ved-chat-card {
  max-width: min(92%, 860px);
}

#AIChatAgent .ved-chat-message.user .ved-chat-card {
  width: fit-content;
  max-width: min(82%, 560px);
  background: var(--ved-chat-user-bg);
  border-color: var(--ved-chat-user-border);
}

#AIChatAgent .ved-chat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 14px 3px;
}

#AIChatAgent .ved-chat-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ved-text-primary);
  margin: 0;
}

#AIChatAgent .ved-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#AIChatAgent .ved-astrologer-profile-image {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Astrologer "Connecting…" first-message popup (SweetAlert, appended to body so NOT scoped to ElementID) ── */
.ved-astrologer-connect-popup {
  width: min(90vw, 300px) !important;
  padding: 0.85rem 0.85rem 0.95rem !important;
  border-radius: 16px !important;
}
.ved-connect-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ved-connect-avatar-frame {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Two staggered expanding "sonar" rings for a pronounced, lively connecting pulse */
.ved-connect-avatar-frame::before,
.ved-connect-avatar-frame::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 16px;
  border: 3px solid #7b61ff;
  animation: vedConnectPulse 1.4s ease-out infinite;
  pointer-events: none;
}
.ved-connect-avatar-frame::after {
  animation-delay: 0.7s;
}
.ved-connect-avatar {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 3px 14px rgba(0,0,0,0.20);
  animation: vedConnectGlow 1.6s ease-in-out infinite;
}
@keyframes vedConnectPulse {
  0%   { transform: scale(0.9);  opacity: 1; }
  100% { transform: scale(1.45); opacity: 0; }
}
@keyframes vedConnectGlow {
  0%, 100% { transform: scale(1);    box-shadow: 0 3px 14px rgba(0,0,0,0.20), 0 0 0 0 rgba(123,97,255,0.55); }
  50%      { transform: scale(1.04); box-shadow: 0 3px 14px rgba(0,0,0,0.20), 0 0 22px 7px rgba(123,97,255,0.12); }
}
/* Settle calmly once connected — stop pulsing/glowing, show a green success ring */
.ved-connect-box.is-connected .ved-connect-avatar-frame::before,
.ved-connect-box.is-connected .ved-connect-avatar-frame::after {
  animation: none;
  opacity: 0;
}
.ved-connect-box.is-connected .ved-connect-avatar {
  animation: none;
  transform: scale(1);
  box-shadow: 0 3px 14px rgba(0,0,0,0.20), 0 0 0 3px rgba(30,158,90,0.85);
}
#ved-connect-status {
  font-size: 15px;
  font-weight: 600;
  color: #4a4a6a;
  text-align: center;
  letter-spacing: 0.2px;
}
#ved-connect-status .ved-connect-dots::after {
  content: "";
  animation: vedConnectDots 1.2s steps(4, end) infinite;
}
@keyframes vedConnectDots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}
#ved-connect-status.is-connected {
  color: #1e9e5a;
  transition: color 0.25s ease;
}

#AIChatAgent .ved-user-profile-image {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
}

#AIChatAgent .ved-astrologer-emoji {
  font-size: 18px;
  line-height: 1;
}

/* Profile Popup - exact modern tooltip style */
:root {
  --veda-ivory: #fffdf8;
  --veda-cream: #fbf4e7;
  --veda-ink: #101827;
  --veda-muted: #6b7280;
  --veda-soft: rgba(255, 255, 255, 0.74);
  --veda-gold: #b98322;
  --veda-gold-2: #e9c56d;
  --veda-gold-soft: #fff4d9;
  --veda-green: #128246;
  --veda-green-soft: #eaf8ef;
  --veda-border: rgba(38, 33, 24, 0.08);
  --veda-shadow: 0 34px 90px rgba(41, 29, 7, 0.16), 0 10px 28px rgba(41, 29, 7, 0.08);
  --veda-radius: 28px;
}

.swal2-popup:has(.vedastro-profile-wrap) {
  width: min(300px, 92vw) !important;
  padding: 0 !important;
  border-radius: 1rem !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.swal2-html-container:has(.vedastro-profile-wrap) {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

#AIChatAgent .vedastro-profile-wrap {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.vedastro-profile-card .profile-image {
  width: 100%;
  height: clamp(230px, 42vh, 285px);
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.vedastro-profile-card .profile-avatar-fallback {
  height: clamp(230px, 42vh, 285px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff8e8, #f8edd3);
  font-size: 4rem;
}

.vedastro-profile-card .profile-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: rgba(255,255,255,0.9);
  color: #444;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 160ms ease, transform 160ms ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  padding: 0;
}

.vedastro-profile-card .profile-close:hover {
  background: #fff;
  transform: rotate(6deg);
}

#AIChatAgent .ved-chat-profile-button {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#AIChatAgent .ved-chat-profile-button:hover {
  opacity: 0.82;
}

#AIChatAgent .ved-chat-card-divider {
  height: 1px;
  background: var(--ved-chat-assistant-divider);
}

#AIChatAgent .ved-chat-message.user .ved-chat-card-divider {
  background: var(--ved-chat-user-divider);
}

#AIChatAgent .ved-chat-card-body {
  padding: 12px 14px;
  line-height: 1.55;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  text-align: left;
}

/* Keep assistant bubble spacing balanced around rendered Markdown blocks. */
#AIChatAgent .ved-chat-message.assistant .ved-chat-card-body.ved-content > :first-child {
  margin-top: 0;
}

#AIChatAgent .ved-chat-message.assistant .ved-chat-card-body.ved-content > :last-child {
  margin-bottom: 0;
}

#AIChatAgent .ved-assistant-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 3px 14px;
  border-top: 1px solid var(--ved-border);
  background: var(--ved-bg-code);
}

#AIChatAgent .ved-assistant-quick-reply {
  position: relative;
  min-height: 26px;
  padding: 2px 6px 2px 19px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ved-accent-text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

#AIChatAgent .ved-assistant-quick-reply::before,
#AIChatAgent .ved-assistant-quick-reply::after {
  content: "";
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
}

#AIChatAgent .ved-assistant-quick-reply::before {
  top: calc(50% - 5px);
  left: 2px;
  width: 10px;
  height: 8px;
  border-left: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  border-bottom-left-radius: 3px;
}

#AIChatAgent .ved-assistant-quick-reply::after {
  top: calc(50% - 1px);
  left: 7px;
  width: 6px;
  height: 6px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(-45deg);
}

#AIChatAgent .ved-assistant-quick-reply:hover:not(:disabled) {
  background: var(--ved-accent-soft);
}

#AIChatAgent .ved-assistant-quick-reply:focus-visible {
  outline: 2px solid var(--ved-accent);
  outline-offset: 1px;
}

#AIChatAgent .ved-assistant-quick-reply:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (pointer: coarse) {
  #AIChatAgent .ved-assistant-quick-replies { padding-block: 0; }
  #AIChatAgent .ved-assistant-quick-reply { min-height: 44px; }
}

#AIChatAgent .ved-plugin-list { display: grid; gap: 10px; }
#AIChatAgent .ved-plugin-row,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-plugin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid var(--ved-chat-border);
  border-radius: 12px;
}
#AIChatAgent .ved-plugin-copy,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-plugin-copy { display: grid; gap: 3px; }
#AIChatAgent .ved-plugin-copy small,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-plugin-copy small { opacity: .72; }
#AIChatAgent .ved-plugin-heading,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-plugin-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
#AIChatAgent .ved-plugin-timing,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-plugin-timing {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .12);
  color: #4f46e5;
  font-size: 10px;
  font-weight: 700;
}
#AIChatAgent .ved-plugin-hooks,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-plugin-hooks {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

#AIChatAgent .ved-chat-speak-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  /* Outline / ghost button — matches the user-bubble action buttons. */
  border: 1.5px solid var(--ved-chat-user-btn-border);
  border-radius: 999px;
  background: var(--ved-chat-user-btn-bg);
  color: var(--ved-chat-user-btn-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

#AIChatAgent .ved-chat-speak-btn:hover {
  background: color-mix(in srgb, var(--ved-chat-user-btn-border) 12%, transparent);
  transform: translateY(-1px);
}

#AIChatAgent .ved-chat-speak-btn.is-active {
  background: color-mix(in srgb, var(--ved-chat-user-btn-border) 18%, transparent);
}

#AIChatAgent .ved-chat-speak-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* Subscription gate: the pseudo answer streams normally, but remains behind
   frosted/lens glass until the original question is replayed after payment. */
#AIChatAgent .ved-chat-card-body.ved-subscription-locked-answer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 180px;
  border-radius: 0 0 15px 15px;
  transition: min-height 180ms ease;
}

#AIChatAgent .ved-chat-card-body.ved-subscription-locked-answer > :not(.ved-subscription-payment-panel) {
  filter: blur(5px);
  opacity: 0.78;
  user-select: none;
  pointer-events: none;
  transform: translateZ(0);
}

#AIChatAgent .ved-chat-card-body.ved-subscription-locked-answer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
      radial-gradient(circle at 22% 12%, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.10) 42%, rgba(255,255,255,0.03) 68%, transparent 82%),
      linear-gradient(145deg, rgba(255,255,255,0.16), rgba(241,245,249,0.08));
  -webkit-backdrop-filter: blur(3px) saturate(110%);
  backdrop-filter: blur(3px) saturate(110%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
}

body.darkmode--activated #AIChatAgent .ved-chat-card-body.ved-subscription-locked-answer::after {
  background:
      radial-gradient(circle at 22% 12%, rgba(255,255,255,0.10) 0%, rgba(148,163,184,0.06) 42%, transparent 75%),
      linear-gradient(145deg, rgba(30,41,59,0.14), rgba(15,23,42,0.08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

#AIChatAgent .ved-chat-card-body.ved-subscription-inline-mode-qr { min-height: 456px; }
#AIChatAgent .ved-chat-card-body.ved-subscription-inline-mode-hosted { min-height: 190px; }
#AIChatAgent .ved-chat-card-body.ved-subscription-inline-mode-error { min-height: 205px; }
#AIChatAgent .ved-chat-card-body.ved-subscription-inline-mode-loading { min-height: 230px; }

#AIChatAgent .ved-chat-card-body.ved-subscription-payment-complete {
  min-height: 118px;
  padding: 18px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

#AIChatAgent .ved-subscription-thank-you {
  display: block;
  font-size: clamp(64px, 12vw, 92px);
  line-height: 1;
  text-align: center;
}

#AIChatAgent .ved-subscription-payment-panel {
  position: absolute;
  inset: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 10px 12px;
  text-align: center;
}
#AIChatAgent .ved-chat-card-body.ved-subscription-inline-mode-qr .ved-subscription-payment-panel {
  justify-content: flex-start;
  padding-top: 4px;
}
#AIChatAgent .ved-subscription-payment-loading {
  gap: 0;
}
#AIChatAgent .ved-subscription-payment-loading-spinner {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 999px;
  border: 5px solid color-mix(
    in srgb,
    var(--ved-accent) 22%,
    transparent
  );
  border-top-color: var(--ved-accent);
  animation: vedAssistantLoadingSpin 0.8s linear infinite;
}

/* Subscription payment offer */
#AIChatAgent .ved-subscription-payment-headline { max-width: 100%; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; column-gap: 6px; row-gap: 2px; text-align: center; line-height: 1.1; text-wrap: balance; }
#AIChatAgent .ved-subscription-payment-prefix { color: var(--ved-text-secondary); font-size: 14px; font-weight: 700; white-space: nowrap; }
#AIChatAgent .ved-subscription-payment-price { color: #158840; font-size: clamp(28px, 4vw, 34px); font-weight: 900; line-height: 1; letter-spacing: -0.025em; white-space: nowrap; }
#AIChatAgent .ved-subscription-payment-offer { color: var(--ved-text-primary); font-size: clamp(16px, 2.3vw, 19px); font-weight: 700; white-space: nowrap; }
#AIChatAgent .ved-subscription-payment-unlimited { color: #158840; font-weight: 900; }
#AIChatAgent .ved-subscription-payment-lightning { display: inline-block; margin-left: 3px; font-size: 0.95em; }
#AIChatAgent .ved-subscription-inline-qr { width: 222px; height: 222px; display: flex; align-items: center; justify-content: center; padding: 6px; border: 1px solid rgba(15,23,42,0.13); border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(15,23,42,0.11); }
#AIChatAgent .ved-subscription-inline-qr canvas,
#AIChatAgent .ved-subscription-inline-qr img { display: block; max-width: 100%; max-height: 100%; }
#AIChatAgent .ved-subscription-qr-actions { width: 100%; max-width: 100%; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
#AIChatAgent .ved-subscription-payment-apps-banner { display: block; width: min(88%, 360px); height: auto; max-height: 34px; object-fit: contain; }
#AIChatAgent .ved-subscription-pay-button { border: 0; border-radius: 13px; min-height: 42px; font: inherit; font-weight: 800; line-height: 1.1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease; }
#AIChatAgent .ved-subscription-pay-button:hover:not(:disabled) { transform: translateY(-1px); }
#AIChatAgent .ved-subscription-pay-button:disabled { cursor: wait; opacity: 0.62; }
#AIChatAgent .ved-subscription-pay-primary { width: min(100%, 360px); min-height: 50px; padding: 11px 20px; background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); color: #fff; font-size: 17px; box-shadow: 0 8px 20px rgba(22,163,74,0.24); }
#AIChatAgent .ved-subscription-paid-button { min-height: 44px; padding: 5px 18px; font-size: clamp(20px, 2.8vw, 22px); line-height: 1; }
#AIChatAgent .ved-subscription-pay-secondary { min-height: 34px; padding: 7px 12px; border: 1px solid rgba(15,23,42,0.13); background: rgba(255,255,255,0.78); color: #475569; font-size: 12px; box-shadow: 0 3px 10px rgba(15,23,42,0.07); }
#AIChatAgent .ved-subscription-help-button { white-space: nowrap; }
#AIChatAgent .ved-subscription-hosted-button { margin-top: 10px; font-size: 18px; }
#AIChatAgent .ved-subscription-payment-error-title { font-size: 18px; font-weight: 800; }
#AIChatAgent .ved-subscription-payment-error-text { color: var(--ved-text-secondary); font-size: 13px; }

/* UPI Help popup: SweetAlert is the shell; visible UI is custom Bootstrap HTML. */
.swal2-popup.ved-payment-help-popup { width: min(92vw, 420px) !important; padding: 0 !important; border-radius: 1rem !important; background: transparent !important; box-shadow: none !important; overflow: hidden !important; }
.ved-payment-help-popup .swal2-html-container { width: 100% !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
.ved-payment-help-popup .ved-payment-help-whatsapp iconify-icon { display: block; flex: 0 0 auto; }

@media (max-width: 520px) {
  #AIChatAgent .ved-chat-card-body.ved-subscription-inline-mode-qr { min-height: 430px; }
  #AIChatAgent .ved-chat-card-body.ved-subscription-inline-mode-loading { min-height: 210px; }
  #AIChatAgent .ved-subscription-payment-panel { inset: 8px; padding: 8px; }
  #AIChatAgent .ved-chat-card-body.ved-subscription-inline-mode-qr .ved-subscription-payment-panel { padding-top: 4px; }
  #AIChatAgent .ved-subscription-inline-qr { width: 202px; height: 202px; }
  #AIChatAgent .ved-subscription-payment-loading-spinner { width: 50px; height: 50px; flex-basis: 50px; }
  #AIChatAgent .ved-subscription-payment-headline { column-gap: 5px; row-gap: 2px; }
  #AIChatAgent .ved-subscription-payment-price { font-size: 28px; }
  #AIChatAgent .ved-subscription-payment-offer { font-size: 16px; }
  #AIChatAgent .ved-subscription-qr-actions { gap: 6px; }
  #AIChatAgent .ved-subscription-payment-apps-banner { width: min(92%, 340px); max-height: 31px; }
  #AIChatAgent .ved-subscription-pay-secondary { padding-left: 10px; padding-right: 10px; }
  #AIChatAgent .ved-subscription-pay-primary { width: 100%; }
  #AIChatAgent .ved-subscription-paid-button { min-height: 44px; padding-top: 5px; padding-bottom: 5px; font-size: 20px; }
}

#AIChatAgent .ved-chat-copy-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ved-chat-speaker);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

#AIChatAgent .ved-chat-copy-btn:hover {
  background: var(--ved-chat-speaker-bg);
  transform: translateY(-1px);
}

#AIChatAgent .ved-chat-copy-btn:active {
  transform: translateY(0);
}

#AIChatAgent .ved-chat-copy-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

#AIChatAgent .ved-chat-copy-btn.copied {
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
}

#AIChatAgent .ved-chat-summarize-btn {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}
#AIChatAgent .ved-chat-summarize-btn.active {
  background: var(--ved-accent, #4f46e5);
  color: #fff;
  border-color: var(--ved-accent, #4f46e5);
}
#AIChatAgent .ved-chat-summary-wrap {
  animation: vedSummaryFadeIn 0.45s ease-out;
}
@keyframes vedSummaryFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

#AIChatAgent .ved-msg {
  text-align: left;
}

#AIChatAgent .ved-content {
  text-align: left;
}

#AIChatAgent .ved-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 5px;
  opacity: 0.55;
}

#AIChatAgent .user .ved-role { color: var(--ved-info); }
#AIChatAgent .user .ved-msg {
  background: transparent;
  color: inherit;
  border: none;
}

#AIChatAgent .ved-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  align-self: flex-end;
  justify-content: flex-end;
  margin-top: 8px;
  width: fit-content;
  max-width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: max-height 0.18s ease, margin-top 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

#AIChatAgent .ved-message-actions.visible {
  margin-top: 8px;
  max-height: 72px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* User-message actions live in the bubble header (right of "You"), not below the
   card. Neutralize the below-card layout so the group sits inline + centered. */
#AIChatAgent .ved-chat-card-header .ved-message-actions {
  margin-top: 0;
  align-self: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
  max-height: none;
  overflow: visible;
  transform: none;
}

#AIChatAgent .ved-message-action {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  /* Outline / ghost button: transparent fill, thick border, icon = border color. */
  border: 1.5px solid var(--ved-chat-user-btn-border);
  background: var(--ved-chat-user-btn-bg);
  color: var(--ved-chat-user-btn-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

#AIChatAgent .ved-message-action:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--ved-chat-user-btn-border) 12%, transparent);
}

#AIChatAgent .ved-message-action:disabled {
  cursor: default;
  opacity: 0.5;
  transform: none;
}

#AIChatAgent .assistant .ved-role { color: var(--ved-accent-text); }
#AIChatAgent .assistant .ved-msg {
  background: transparent;
  color: inherit;
  border: none;
}

#AIChatAgent .assistant .ved-content h1,
#AIChatAgent .assistant .ved-content h2,
#AIChatAgent .assistant .ved-content h3 {
  color: var(--ved-accent-text);
  margin: 10px 0 4px;
  font-weight: 600;
}

#AIChatAgent .assistant .ved-content h1 { font-size: 17px; }
#AIChatAgent .assistant .ved-content h2 { font-size: 15px; }
#AIChatAgent .assistant .ved-content h3 { font-size: 14px; }
#AIChatAgent .assistant .ved-content ul { padding-left: 18px; margin: 6px 0; }
#AIChatAgent .assistant .ved-content li { margin-bottom: 3px; }
#AIChatAgent .assistant .ved-content hr { border: none; border-top: 1px solid var(--ved-border-strong); margin: 10px 0; }
#AIChatAgent .assistant .ved-content blockquote { border-left: 3px solid var(--ved-accent); padding-left: 10px; margin: 6px 0; color: var(--ved-text-secondary); }
#AIChatAgent .assistant .ved-content strong { color: var(--ved-text-primary); }

@media (max-width: 767px) {
  #AIChatAgent .ved-msg-wrap {
    margin-bottom: 12px;
  }

  #AIChatAgent .ved-chat-message.assistant .ved-chat-card,
  #AIChatAgent .ved-chat-message.user .ved-chat-card {
    width: fit-content;
    max-width: 100%;
  }

  #AIChatAgent .ved-chat-card-header {
    padding: 4px 12px 3px;
  }

  #AIChatAgent .ved-chat-card-body {
    padding: 11px 12px;
  }
}

#AIChatAgent .ved-code-block {
  background: var(--ved-bg-code) !important;
  border: 1px solid var(--ved-border);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  overflow-x: auto;
  font-size: 12px;
  position: relative;
}
#AIChatAgent .ved-code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--ved-bg-elevated);
  border: 1px solid var(--ved-border);
  border-radius: 6px;
  color: var(--ved-text-muted);
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  line-height: 1.6;
}
#AIChatAgent .ved-code-block:hover .ved-code-copy-btn { opacity: 1; }
#AIChatAgent .ved-code-copy-btn:hover { color: var(--ved-text-main); background: var(--ved-bg-surface); }

#AIChatAgent .ved-code-lang {
  font-size: 10px;
  color: var(--ved-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

#AIChatAgent .ved-code-block code {
  font-family: "JetBrains Mono", "Fira Code", Menlo, Monaco, monospace;
  color: var(--ved-accent-text);
  line-height: 1.5;
}

#AIChatAgent .ved-table-wrap {
  overflow-x: auto;
  margin: 8px 0;
}
#AIChatAgent .ved-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
#AIChatAgent .ved-table th {
  background: var(--ved-bg-elevated);
  border: 1px solid var(--ved-border);
  padding: 6px 12px;
  font-weight: 600;
  color: var(--ved-text-primary);
  white-space: nowrap;
}
#AIChatAgent .ved-table td {
  border: 1px solid var(--ved-border);
  padding: 5px 12px;
  color: var(--ved-text-main);
}
#AIChatAgent .ved-table tr:nth-child(even) td {
  background: color-mix(in srgb, var(--ved-bg-elevated) 40%, transparent);
}

#AIChatAgent .ved-inline-code {
  font-family: "JetBrains Mono", Menlo, Monaco, monospace;
  background: color-mix(in srgb, var(--ved-bg-elevated) 78%, transparent);
  border: 1px solid var(--ved-border-strong);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 12px;
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-attention {
  font-size: 1.35em;
  font-weight: 700;
  color: #e67e22;
}

/* Guide image: a simple inline illustration that is part of the message bubble.
   Starts collapsed + transparent; when the image loads it fades and grows in
   gently (grid-rows 0fr -> 1fr) so the text below reflows smoothly, not abruptly. */
#AIChatAgent .ved-guide-image-card {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0;
  max-width: min(340px, 90%);
  opacity: 0;
  transform: translateY(4px);
  transition: grid-template-rows .5s cubic-bezier(.22, .61, .36, 1),
              opacity .55s ease,
              transform .55s cubic-bezier(.22, .61, .36, 1),
              margin .5s cubic-bezier(.22, .61, .36, 1);
}
#AIChatAgent .ved-guide-image-card.is-loaded {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  margin: .15rem 0 .55rem;
}
#AIChatAgent .ved-guide-image-card.is-broken {
  display: none;
}
#AIChatAgent .ved-guide-image-inner {
  overflow: hidden;
  min-height: 0;
  border-radius: 14px;
}
#AIChatAgent .ved-guide-image-thumb {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 2px 10px -4px rgba(15, 23, 42, .22);
}
@media (prefers-reduced-motion: reduce) {
  #AIChatAgent .ved-guide-image-card {
    transform: none;
    transition: opacity .25s ease;
  }
}

/* Payment collector quick replies (inside message cards) */
#AIChatAgent .ved-subscription-inline-cta-row {
  margin: 0.65rem 0 0;
}

#AIChatAgent .ved-subscription-inline-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: baseline;
  margin: 0 0.12em;
  padding: 0.18em 0.72em;
  border: 1px solid rgba(22, 163, 74, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  color: #fff;
  box-shadow: 0 3px 9px rgba(21, 128, 61, 0.22);
  font: inherit;
  font-size: 0.88em;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

#AIChatAgent .ved-subscription-inline-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 5px 13px rgba(21, 128, 61, 0.3);
}

#AIChatAgent .ved-subscription-inline-cta:active {
  transform: translateY(0);
}

#AIChatAgent .ved-subscription-inline-cta:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.28);
  outline-offset: 2px;
}

#AIChatAgent .ved-subscription-inline-cta:disabled {
  opacity: 0.66;
  cursor: wait;
  transform: none;
}

#AIChatAgent .ved-payment-collector-actions {
  display: none;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 4px 14px 14px;
}

#AIChatAgent .ved-payment-collector-actions.has-items {
  display: flex;
}

/* === FREE button — de-emphasized, sits on the LEFT === */
#AIChatAgent .ved-payment-collector-actions .ved-payment-free-btn {
  order: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
  color: var(--ved-text-muted, #64748b);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

#AIChatAgent .ved-payment-collector-actions .ved-payment-free-btn:hover {
  opacity: 1;
  background: rgba(148, 163, 184, 0.16);
  color: var(--ved-text-secondary, #475569);
  border-color: rgba(148, 163, 184, 0.42);
  transform: none;
}

/* === PAY button — bright, animated, sits on the RIGHT === */
#AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn {
  order: 1;
  margin-left: auto;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 45%, #ec4899 100%);
  background-size: 220% 220%;
  background-position: 0% 50%;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(120, 20, 0, 0.28);
  box-shadow:
    0 6px 16px rgba(239, 68, 68, 0.35),
    0 2px 6px rgba(245, 158, 11, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation:
    vedPayGradient 4.5s ease-in-out infinite,
    vedPayPulse 2.6s ease-in-out infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  transform: skewX(-22deg);
  animation: vedPayShine 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

#AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn .ved-payment-pay-label {
  position: relative;
  z-index: 1;
  display: inline-block;
}

#AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn:hover {
  transform: translateY(-2px) scale(1.035);
  filter: saturate(1.08) brightness(1.04);
  box-shadow:
    0 10px 24px rgba(239, 68, 68, 0.5),
    0 4px 10px rgba(245, 158, 11, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

#AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn:active {
  transform: translateY(0) scale(1);
  filter: saturate(1) brightness(0.98);
}

#AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.85),
    0 0 0 6px rgba(239, 68, 68, 0.55),
    0 10px 24px rgba(239, 68, 68, 0.45);
}

#AIChatAgent .ved-payment-collector-actions.is-paying .ved-payment-pay-btn,
#AIChatAgent .ved-payment-collector-actions.is-paying .ved-payment-pay-btn::before {
  animation-play-state: paused;
}

#AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn[disabled] {
  cursor: default;
  filter: saturate(0.85);
}

@keyframes vedPayShine {
  0%   { left: -75%; }
  55%  { left: 130%; }
  100% { left: 130%; }
}

@keyframes vedPayPulse {
  0%, 100% {
    box-shadow:
      0 6px 16px rgba(239, 68, 68, 0.35),
      0 2px 6px rgba(245, 158, 11, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow:
      0 10px 22px rgba(239, 68, 68, 0.55),
      0 4px 12px rgba(245, 158, 11, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }
}

@keyframes vedPayGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  #AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn {
    animation: none;
  }
  #AIChatAgent .ved-payment-collector-actions .ved-payment-pay-btn::before {
    animation: none;
    display: none;
  }
}

#AIChatAgent .ved-attach-preview {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 12px 0;
}
#AIChatAgent .ved-attach-preview:empty { display: none; }
#AIChatAgent .ved-attach-chip {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 8px; font-size: 12px;
  background: var(--ved-bg-elevated); border: 1px solid var(--ved-border);
  max-width: 160px;
}
#AIChatAgent .ved-attach-chip img {
  width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0;
}
#AIChatAgent .ved-attach-chip-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100px;
}
#AIChatAgent .ved-attach-remove {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  color: var(--ved-text-muted); font-size: 14px; line-height: 1; flex-shrink: 0;
}
#AIChatAgent .ved-attach-remove:hover { color: var(--ved-text); }
#AIChatAgent .ved-chat-input-wrap.ved-drag-over {
  outline: 2px dashed var(--ved-accent); outline-offset: -4px;
  background: color-mix(in srgb, var(--ved-accent) 8%, transparent);
}
#AIChatAgent .ved-attach-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--ved-text-muted); display: flex; align-items: center;
  border-radius: 6px; transition: color 0.15s;
}
#AIChatAgent .ved-attach-btn:hover { color: var(--ved-text); }
#AIChatAgent .ved-inline-img {
  max-width: 220px; max-height: 180px; border-radius: 8px; display: block; margin: 4px 0;
}

#AIChatAgent .ved-tool-artifact {
  max-width: 100%;
  width: 100%;
  margin: 0 0 8px;
  align-self: flex-start;
  text-align: left;
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-tool-artifact-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--ved-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ved-bg-elevated) 74%, transparent);
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

#AIChatAgent .ved-tool-artifact-toggle-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

#AIChatAgent .ved-tool-artifact-icon {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--ved-text-subtle);
  font-family: "JetBrains Mono", Menlo, Monaco, monospace;
}

#AIChatAgent .ved-tool-artifact-title {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-tool-artifact-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
}

#AIChatAgent .ved-tool-artifact-summary::-webkit-scrollbar {
  display: none;
}

#AIChatAgent .ved-tool-artifact-summary-empty {
  font-size: 12px;
  color: var(--ved-text-muted);
}

#AIChatAgent .ved-tool-artifact-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ved-accent-soft) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--ved-accent) 18%, transparent);
  color: var(--ved-accent-text);
  font-size: 11px;
  font-weight: 600;
}

#AIChatAgent .ved-tool-artifact-chip-count {
  color: var(--ved-text-muted);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
}

#AIChatAgent .ved-tool-artifact-toggle-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

#AIChatAgent .ved-tool-artifact-status {
  font-size: 11px;
  color: var(--ved-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#AIChatAgent .ved-tool-artifact-chevron {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.18s ease;
}

#AIChatAgent .ved-tool-artifact.expanded .ved-tool-artifact-chevron {
  transform: rotate(180deg);
}

#AIChatAgent .ved-tool-artifact-panel {
  display: none;
  margin-top: 8px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.96));
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
  padding: 14px;
}

#AIChatAgent .ved-tool-artifact.expanded .ved-tool-artifact-panel {
  display: block;
}

#AIChatAgent .ved-tool-artifact-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  text-align: left;
}

#AIChatAgent .ved-tool-artifact-item {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.34);
  padding: 12px;
}

#AIChatAgent .ved-tool-artifact-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#AIChatAgent .ved-tool-artifact-item-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#AIChatAgent .ved-tool-artifact-item-source {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.66);
}

#AIChatAgent .ved-tool-artifact-item-name {
  font-size: 15px;
  color: #f8fafc;
}

#AIChatAgent .ved-tool-artifact-item-summary {
  min-width: 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.76);
  overflow-wrap: anywhere;
}

#AIChatAgent .ved-tool-artifact-item-status {
  flex: 0 0 auto;
  align-self: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

#AIChatAgent .ved-tool-artifact-item-status.is-done {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

#AIChatAgent .ved-tool-artifact-item-status.is-running {
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
}

#AIChatAgent .ved-tool-artifact-item-status.is-failed,
#AIChatAgent .ved-tool-artifact-item-status.is-denied {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

#AIChatAgent .ved-tool-artifact-sections {
  display: grid;
  gap: 10px;
  text-align: left;
}

#AIChatAgent .ved-tool-artifact-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.62);
}

#AIChatAgent .ved-tool-artifact-body {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.38);
  padding: 10px;
  text-align: left;
}

#AIChatAgent .ved-tool-artifact-body pre {
  margin: 0;
  font-size: 11px;
  font-family: "JetBrains Mono", Menlo, Monaco, monospace;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

#AIChatAgent .ved-turn-activity {
  color: rgba(226, 232, 240, 0.68);
}

#AIChatAgent .ved-turn-activity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}

#AIChatAgent .ved-turn-activity-row strong {
  color: #f8fafc;
  font-weight: 600;
}

#AIChatAgent .ved-turn-activity-icon {
  color: rgba(226, 232, 240, 0.45);
  font-size: 12px;
}

#AIChatAgent .ved-agent-thought {
  width: 100%;
  margin: 0 0 8px;
  text-align: left;
}

#AIChatAgent .ved-agent-thought-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ved-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

#AIChatAgent .ved-agent-thought-toggle:hover {
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-agent-thought-toggle-left {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#AIChatAgent .ved-agent-thought-caret {
  font-size: 11px;
  transition: transform 0.18s ease;
}

#AIChatAgent .ved-agent-thought.is-expanded .ved-agent-thought-caret {
  transform: rotate(90deg);
}

#AIChatAgent .ved-agent-thought-title {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
}

#AIChatAgent .ved-agent-thought-duration {
  font-size: 12px;
  color: var(--ved-text-subtle);
}

#AIChatAgent .ved-agent-thought-panel {
  display: none;
  margin-top: 8px;
  margin-left: 5px;
  padding-left: 10px;
  border-left: 1px solid color-mix(in srgb, var(--ved-border) 85%, transparent);
}

#AIChatAgent .ved-agent-thought.is-expanded .ved-agent-thought-panel {
  display: block;
}

#AIChatAgent .ved-agent-thought-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
}

#AIChatAgent .ved-agent-thought-row-icon {
  width: 14px;
  margin-top: 1px;
  text-align: center;
  font-size: 11px;
  color: var(--ved-text-subtle);
}

#AIChatAgent .ved-agent-thought-row.is-running .ved-agent-thought-row-icon {
  color: #3b82f6;
  animation: vedAgentThoughtPulse 1.1s ease-in-out infinite;
}

#AIChatAgent .ved-agent-thought-row.is-done .ved-agent-thought-row-icon {
  color: #16a34a;
  animation: none;
}

#AIChatAgent .ved-agent-thought-row.is-error .ved-agent-thought-row-icon {
  color: #dc2626;
  animation: none;
}

#AIChatAgent .ved-agent-thought-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#AIChatAgent .ved-agent-thought-row-main strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--ved-text-primary);
  overflow-wrap: anywhere;
}

#AIChatAgent .ved-agent-thought-row-main span {
  font-size: 11px;
  color: var(--ved-text-muted);
  overflow-wrap: anywhere;
}

@keyframes vedAgentThoughtPulse {
  0% { opacity: 0.45; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.45; transform: scale(0.95); }
}

#AIChatAgent .ved-assistant-context {
  max-width: 760px;
  width: 100%;
  margin: 0 0 8px;
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-assistant-context:empty {
  display: none;
}

#AIChatAgent .ved-assistant-body-loading {
  color: var(--ved-text-secondary);
}

/* Standard chat-app typing indicator shown inside the normal assistant bubble. */
#AIChatAgent .ved-assistant-typing-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-height: 22px;
  padding: 3px 1px;
  vertical-align: middle;
}

#AIChatAgent .ved-assistant-typing-dot {
  width: 7px;
  height: 7px;
  display: block;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--ved-text-secondary);
  opacity: 0.35;
  transform: translateY(0);
  animation: vedAssistantTypingDot 1.15s ease-in-out infinite;
}

#AIChatAgent .ved-assistant-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

#AIChatAgent .ved-assistant-typing-dot:nth-child(3) {
  animation-delay: 0.30s;
}

@keyframes vedAssistantTypingDot {
  0%, 60%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #AIChatAgent .ved-assistant-typing-dot {
    animation: none;
    opacity: 0.65;
    transform: none;
  }
}

@keyframes vedAssistantLoadingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#AIChatAgent .ved-inline-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: middle;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ved-accent) 25%, transparent);
  border-top-color: var(--ved-accent);
  animation: vedAssistantLoadingSpin 0.7s linear infinite;
  opacity: 0.7;
}

#AIChatAgent .ved-temp-text-stream-elm {
  display: inline;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#AIChatAgent .ved-chat-card-body.ved-stream-finalizing {
  transition: opacity 120ms ease;
}

#AIChatAgent .ved-assistant-body-loading .ved-inline-spinner {
  opacity: 0.75;
}

/* Horary "casting" animation — shown while the Prashna reading is generated. */
#AIChatAgent .ved-tool-casting {
  width: 320px;
  max-width: 100%;
  margin: 0 auto 0.6rem;
  box-sizing: border-box;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: color-mix(in srgb, var(--ved-accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--ved-accent) 16%, transparent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  animation: vedToolCastingIn 320ms ease forwards;
}

/* Kept collapsed until the video has a displayable frame, so a still-loading or
   broken <video> never shows its default 300×150 empty box. */
#AIChatAgent .ved-tool-casting.is-loading { display: none; }

#AIChatAgent .ved-tool-casting-video {
  display: block;
  width: 100%;
  height: auto;
  /* Stable ratio guards against the browser's 300×150 default before load. */
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
}

#AIChatAgent .ved-tool-casting-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ved-text-secondary);
}

#AIChatAgent .ved-tool-casting-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--ved-accent);
  animation: vedToolCastingPulse 1.1s ease-in-out infinite;
}

#AIChatAgent .ved-tool-casting.ved-tool-casting-out {
  animation: vedToolCastingOut 620ms ease forwards;
  pointer-events: none;
}

@keyframes vedToolCastingIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes vedToolCastingOut {
  to { opacity: 0; transform: translateY(-4px) scale(0.98); }
}

@keyframes vedToolCastingPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  #AIChatAgent .ved-tool-casting,
  #AIChatAgent .ved-tool-casting.ved-tool-casting-out {
    animation-duration: 1ms;
  }
  #AIChatAgent .ved-tool-casting-dot { animation: none; }
}

#AIChatAgent .ved-chat-input-area {
  padding: 0 6px 8px;
}

@media (max-width: 575.98px) {
  #AIChatAgent .ved-chat-input-area {
    padding: 0 0 8px;
  }
}

#AIChatAgent .ved-chat-input-wrap {
  max-width: min(100%, 1100px);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 10px;
  background: var(--ved-glass-surface-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1.5rem;
  border: 1px solid var(--ved-glass-border);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

@media (max-width: 575.98px) {
  #AIChatAgent .ved-chat-input-wrap {
    padding: 11px 9px 9px;
    border-radius: 1.3rem;
  }
}

#AIChatAgent .ved-chat-input-wrap:focus-within {
  border-color: #6366f1;
  box-shadow: 0 20px 45px -12px rgba(79, 70, 229, 0.25);
  transform: translateY(-1px);
}

#AIChatAgent .ved-chat-input-main {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  width: 100%;
}

#AIChatAgent .ved-chat-input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  min-height: 40px;
  color: var(--ved-input-icon);
  padding: 0 2px 0 4px;
}

#AIChatAgent .ved-chat-input-icon iconify-icon {
  display: block;
  transform: translateY(-1px);
}

#AIChatAgent .ved-chat-plus-wrap {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
}
#AIChatAgent .ved-chat-plus-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--ved-border-strong);
  background: var(--ved-bg-elevated);
  color: var(--ved-input-icon);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.18s ease, transform 0.18s ease;
}
#AIChatAgent .ved-chat-plus-btn:hover {
  background: var(--ved-mic-hover-bg);
}
#AIChatAgent .ved-chat-plus-btn.is-open {
  background: var(--ved-accent-soft);
  color: var(--ved-accent-text);
}
#AIChatAgent .ved-chat-plus-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  background: var(--ved-glass-surface-strong);
  border: 1px solid var(--ved-glass-border);
  box-shadow: 0 18px 40px rgba(15,23,42,0.18);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 50;
}
#AIChatAgent .ved-chat-plus-menu.show {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}
#AIChatAgent .ved-chat-plus-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 11px;
  border: none; background: transparent; cursor: pointer;
  border-radius: 9px; font: inherit; font-weight: 600;
  color: var(--ved-text-primary); text-align: left;
}
#AIChatAgent .ved-chat-plus-item[hidden] {
  display: none;
}
#AIChatAgent .ved-chat-plus-item:hover,
#AIChatAgent .ved-chat-plus-item:focus-visible {
  background: var(--ved-accent-soft);
}
#AIChatAgent .ved-chat-plus-item.is-active {
  color: var(--ved-accent-text);
}
#AIChatAgent .ved-chat-input {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  color: var(--ved-input-text);
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.4;
  padding: 8px 4px;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 150px;
  box-sizing: border-box;
  align-self: center;
  overflow-y: auto;
  min-width: 0;
  width: 100%;
}

#AIChatAgent .ved-chat-input::placeholder { color: var(--ved-input-placeholder); }

#AIChatAgent .ved-chat-input-controls {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  flex: 0 0 auto;
}

#AIChatAgent .ved-chat-mode-footer {
  display: none !important;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  padding: 0 4px 2px 2px;
  color: var(--ved-text-secondary);
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  flex-wrap: wrap;
}

#AIChatAgent .ved-chat-mode-footer-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ved-text-secondary);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
  flex: 0 0 auto;
}

#AIChatAgent .ved-chat-mode-footer-label {
  font-weight: 700;
  text-transform: lowercase;
}

#AIChatAgent .ved-chat-mode-footer-hint {
  color: var(--ved-text-muted);
  white-space: nowrap;
}

#AIChatAgent .ved-chat-mode-footer-loading {
  display: none;
  align-items: center;
  gap: 6px;
  color: #f59e0b;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  #AIChatAgent .ved-chat-input-wrap {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin-left: auto;
    margin-right: auto;
    padding: 8px;
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 14px 32px -18px rgba(15, 23, 42, 0.28);
  }

  #AIChatAgent .ved-chat-input-main {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 0;
  }

  #AIChatAgent .ved-chat-input-icon {
    display: none;
  }

  #AIChatAgent .ved-chat-input {
    order: 1;
    flex: 1 1 100%;
    min-height: 84px;
    max-height: min(220px, 38vh);
    padding: 16px 16px 14px;
    line-height: 1.5;
    font-size: 1.03rem;
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    align-self: auto;
  }

  #AIChatAgent .ved-chat-input::placeholder {
    color: color-mix(in srgb, var(--ved-input-placeholder) 70%, #64748b 30%);
  }

  #AIChatAgent .ved-chat-plus-wrap {
    order: 2;
    align-self: center;
  }

  #AIChatAgent .ved-chat-input-controls {
    order: 3;
    margin-left: auto;
    align-self: center;
    position: static;
    z-index: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
    padding-left: 0;
    padding-right: 2px;
    border-radius: 999px;
    background: transparent;
  }

  #AIChatAgent .ved-chat-send {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: 1.1rem;
    box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.55);
  }

  #AIChatAgent .vedastro-mic-btn,
  #AIChatAgent .ved-attach-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--ved-input-icon-muted);
    background: rgba(241, 245, 249, 0.78);
  }

  #AIChatAgent .ved-chat-mode-footer {
    display: none;
  }
}

@media (max-width: 398px) {
  #AIChatAgent .ved-chat-input-wrap {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    padding: 6px;
  }

  #AIChatAgent .ved-chat-input-main {
    gap: 7px;
  }

  #AIChatAgent .ved-chat-input {
    min-height: 80px;
    max-height: min(240px, 42vh);
    padding: 14px 14px 12px;
    font-size: 1rem;
  }

  #AIChatAgent .ved-chat-input-controls {
    gap: 5px;
  }
}

@media (max-width: 575.98px) {
  #AIChatAgent .ved-chat-input-wrap.is-long-input .ved-chat-input {
    min-height: 112px;
  }
}

#AIChatAgent .ved-chat-mode-footer.is-busy .ved-chat-mode-footer-loading {
  display: inline-flex;
}

#AIChatAgent .ved-chat-mode-footer-loading-spinner {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
  animation: vedFooterLoadingPulse 1.05s ease-in-out infinite;
}

@keyframes vedFooterLoadingPulse {
  0%, 100% {
    transform: scale(0.75);
    opacity: 0.7;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

#AIChatAgent .ved-chat-mode-footer[data-state="accept-edits"] .ved-chat-mode-footer-dot {
  background: var(--ved-info);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

#AIChatAgent .ved-chat-mode-footer[data-state="active"] .ved-chat-mode-footer-dot {
  background: var(--ved-text-secondary);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

#AIChatAgent .ved-chat-mode-footer[data-state="ready"] .ved-chat-mode-footer-dot {
  background: var(--ved-text-secondary);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.08);
}

#AIChatAgent .ved-chat-input-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 2px;
}

#AIChatAgent .ved-chat-send {
  background: var(--ved-send-bg);
  color: #ffffff;
  border: none;
  border-radius: 1rem;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--ved-send-shadow);
  transition: all 0.2s;
}

#AIChatAgent .ved-chat-send iconify-icon,
#AIChatAgent .vedastro-mic-btn iconify-icon {
  display: block;
}

#AIChatAgent .ved-chat-send:hover { background: var(--ved-send-bg-hover); transform: scale(1.05); }
#AIChatAgent .ved-chat-send:disabled { background: var(--ved-border-strong); color: var(--ved-text-subtle); cursor: not-allowed; box-shadow: none; transform: none; }

#AIChatAgent .vedastro-mic-btn {
  background: transparent;
  color: var(--ved-input-icon-muted);
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: all 0.2s;
  cursor: pointer;
}

#AIChatAgent .vedastro-mic-btn:hover {
  color: var(--ved-input-icon);
  background: var(--ved-mic-hover-bg);
}

#AIChatAgent .vedastro-mic-btn.recording {
  color: #ffffff;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  animation: vedastroMicPulse 1.5s ease-in-out infinite;
}

#AIChatAgent .vedastro-mic-btn.transcribing {
  color: var(--ved-input-icon);
  background: var(--ved-mic-hover-bg);
  pointer-events: none;
}

#AIChatAgent .vedastro-mic-btn.transcribing iconify-icon {
  animation: vedastroMicSpin 1s linear infinite;
}

@keyframes vedastroMicPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes vedastroMicSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#AIChatAgent .ved-chat-modal,
.ved-chat-modal[data-ved-owner="AIChatAgent"] {
  position: fixed;
  inset: 0;
  background: var(--ved-overlay);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2147483600;
  padding: 16px;
}

#AIChatAgent .ved-chat-modal.show,
.ved-chat-modal[data-ved-owner="AIChatAgent"].show { display: flex; }

#AIChatAgent .ved-modal-content,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-content {
  position: relative;
  background: var(--ved-bg-surface);
  border: 1px solid var(--ved-border);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: var(--ved-shadow);
  box-sizing: border-box;
}

#AIChatAgent .ved-modal-header,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ved-border);
}

#AIChatAgent .ved-modal-header h3,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-header h3 {
  font-size: 17px;
  color: var(--ved-accent-text);
  font-weight: 700;
  margin: 0;
}

#AIChatAgent .ved-modal-close,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-close {
  background: none;
  border: none;
  color: var(--ved-text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

#AIChatAgent .ved-modal-close:hover,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-close:hover { color: var(--ved-text-primary); }

#AIChatAgent .ved-modal-section-title,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ved-text-subtle);
  font-weight: 700;
  margin-bottom: 10px;
}

#AIChatAgent .ved-settings-support-box,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-support-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid rgba(124,58,237,0.14);
  background:
    linear-gradient(135deg, rgba(124,58,237,0.08), rgba(59,130,246,0.06)),
    rgba(255,255,255,0.95);
  box-shadow: 0 10px 24px rgba(15,23,42,0.06);
}

#AIChatAgent .ved-settings-support-icon,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-support-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  background: rgba(124,58,237,0.12);
  color: var(--ved-accent-text);
}

#AIChatAgent .ved-settings-support-content,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-support-content {
  flex: 1;
  min-width: 0;
}

#AIChatAgent .ved-settings-support-title,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-support-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-settings-support-text,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-support-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ved-text-secondary);
}

#AIChatAgent .ved-settings-support-link,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-support-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ved-accent-text);
  text-decoration: none;
}

#AIChatAgent .ved-settings-support-link:hover,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-support-link:hover {
  text-decoration: underline;
}

#AIChatAgent .ved-form-group,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group { margin-bottom: 10px; }

#AIChatAgent .ved-form-group input,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group input {
  width: 100%;
  padding: 9px 11px;
  background: var(--ved-bg-input);
  border: 1px solid var(--ved-border-strong);
  border-radius: 7px;
  color: var(--ved-text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

#AIChatAgent .ved-form-group input:focus,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group input:focus { border-color: var(--ved-accent); }
#AIChatAgent .ved-form-group input::placeholder,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group input::placeholder { color: var(--ved-text-subtle); }
#AIChatAgent .ved-form-group small,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group small { display: block; font-size: 11px; color: var(--ved-text-muted); margin-top: 4px; }

#AIChatAgent .ved-settings-checkbox-row,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ved-border);
  border-radius: 10px;
  background: var(--ved-bg-elevated);
  color: var(--ved-text-primary);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

#AIChatAgent .ved-settings-checkbox-row input[type="checkbox"],
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  accent-color: var(--ved-accent);
  flex-shrink: 0;
}

#AIChatAgent .ved-tool-approval-status,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-tool-approval-status {
  min-height: 16px;
}

#AIChatAgent .ved-form-buttons,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-buttons { display: flex; gap: 8px; margin-top: 12px; }

#AIChatAgent .ved-form-buttons button,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-buttons button {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  box-sizing: border-box;
}

#AIChatAgent .ved-form-buttons-llm .ved-llm-reset,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-buttons-llm .ved-llm-reset {
  flex: 0 0 auto;
  padding-inline: 14px;
}

#AIChatAgent .ved-form-buttons-llm .ved-llm-test,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-buttons-llm .ved-llm-test {
  flex: 0 0 auto;
  min-width: 150px;
}

#AIChatAgent .ved-form-buttons-llm .ved-llm-save,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-buttons-llm .ved-llm-save {
  flex: 1;
}

#AIChatAgent .ved-form-buttons button:hover,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-buttons button:hover { opacity: 0.85; }
#AIChatAgent .ved-form-buttons button:disabled,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-buttons button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Shared button styles (reused by LLM Config + Prompts tab buttons). */
#AIChatAgent .ved-btn-add,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-btn-add { background: var(--ved-accent); color: var(--ved-text-inverse); }
#AIChatAgent .ved-btn-test,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-btn-test { background: var(--ved-bg-elevated); color: var(--ved-info); border: 1px solid var(--ved-info-border); }

#AIChatAgent .ved-empty-state {
  color: var(--ved-text-subtle);
  text-align: center;
  padding: 16px;
  font-size: 13px;
}

#AIChatAgent .ved-toast,
.ved-toast[data-ved-owner="AIChatAgent"] {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ved-bg-toast);
  border: 1px solid var(--ved-border-strong);
  color: var(--ved-text-secondary);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: normal;
  max-width: min(90vw, 640px);
  text-align: center;
  z-index: 2147483647;
}

#AIChatAgent .ved-toast.show,
.ved-toast[data-ved-owner="AIChatAgent"].show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#AIChatAgent .ved-welcome {
  text-align: center;
  color: var(--ved-text-muted);
  padding: 40px 20px;
  font-size: 13px;
  line-height: 1.7;
}

#AIChatAgent .ved-welcome strong { color: var(--ved-text-secondary); }

#AIChatAgent .ved-welcome-label {
  font-size: 11px;
  font-weight: 700;
}

#AIChatAgent .ved-welcome-label-auto { color: var(--ved-success); }
#AIChatAgent .ved-welcome-label-approval { color: var(--ved-warning); }

#AIChatAgent .ved-welcome-badge {
  background: var(--ved-bg-elevated);
  border: 1px solid var(--ved-border-strong);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  display: inline-block;
  margin: 2px;
}

#AIChatAgent .ved-welcome-badge-auto { color: var(--ved-success); }
#AIChatAgent .ved-welcome-badge-approval { color: var(--ved-warning); }

#AIChatAgent .ved-tool-approval {
  background: var(--ved-bg-approval);
  border: 1px solid var(--ved-warning-border);
  border-left: 3px solid var(--ved-warning);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px auto;
  max-width: 760px;
  width: 100%;
  font-size: 13px;
}

#AIChatAgent .ved-tool-approval.ved-approval-approved {
  border-left-color: var(--ved-success);
  background: var(--ved-bg-approval-approved);
}

#AIChatAgent .ved-tool-approval.ved-approval-denied {
  border-left-color: var(--ved-danger);
  background: var(--ved-bg-approval-denied);
}

#AIChatAgent .ved-approval-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ved-warning);
  font-weight: 600;
}

#AIChatAgent .ved-approval-args {
  font-size: 12px;
  color: var(--ved-text-secondary);
  margin-bottom: 10px;
  padding: 6px 8px;
  background: var(--ved-bg-elevated);
  border-radius: 6px;
  line-height: 1.6;
}

#AIChatAgent .ved-approval-buttons {
  display: flex;
  gap: 8px;
}

#AIChatAgent .ved-approval-allow {
  background: var(--ved-success);
  color: #0b1220;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#AIChatAgent .ved-approval-allow:hover { opacity: 0.9; }

#AIChatAgent .ved-approval-deny {
  background: var(--ved-bg-elevated);
  color: var(--ved-danger);
  border: 1px solid var(--ved-danger-border);
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#AIChatAgent .ved-approval-deny:hover { opacity: 0.9; }

/* Advanced Settings Modal Tabs */
#AIChatAgent .ved-settings-tabs,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-tabs {
  display: flex;
  gap: 8px;
  padding: 0 0 0 0;
  border-bottom: 1px solid var(--ved-border-strong);
  margin-bottom: 16px;
}

#AIChatAgent .ved-tab-btn,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-tab-btn {
  padding: 10px 16px;
  background: transparent;
  color: var(--ved-text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

#AIChatAgent .ved-tab-btn:hover,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-tab-btn:hover {
  color: var(--ved-text-primary);
  background: var(--ved-accent-soft);
}

#AIChatAgent .ved-tab-btn.ved-tab-active,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-tab-btn.ved-tab-active {
  color: var(--ved-accent);
  border-bottom-color: var(--ved-accent);
}

/* Tab Content */
#AIChatAgent .ved-tab-content,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-tab-content {
  display: none;
}

#AIChatAgent .ved-tab-content.ved-tab-active,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-tab-content.ved-tab-active {
  display: block;
}

#AIChatAgent .ved-modal-content.ved-settings-login-gated .ved-settings-body .ved-tab-content.ved-tab-active,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-content.ved-settings-login-gated .ved-settings-body .ved-tab-content.ved-tab-active {
  pointer-events: none;
  user-select: none;
}

#AIChatAgent .ved-settings-login-overlay,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#AIChatAgent .ved-modal-content.ved-settings-login-revealed .ved-settings-body .ved-tab-content.ved-tab-active,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-content.ved-settings-login-revealed .ved-settings-body .ved-tab-content.ved-tab-active {
  filter: blur(3px);
  opacity: 0.58;
}

#AIChatAgent .ved-modal-content.ved-settings-login-revealed .ved-settings-login-overlay,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-content.ved-settings-login-revealed .ved-settings-login-overlay {
  display: flex;
}

#AIChatAgent .ved-settings-login-card,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-card {
  max-width: min(92%, 360px);
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(8px);
  transition: opacity 0.34s ease, transform 0.34s ease, filter 0.34s ease;
}

#AIChatAgent .ved-modal-content.ved-settings-login-revealed .ved-settings-login-card,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-modal-content.ved-settings-login-revealed .ved-settings-login-card {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

#AIChatAgent .ved-settings-login-btn,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--ved-accent) 45%, var(--ved-border-strong));
  background: var(--ved-accent);
  color: var(--ved-text-inverse);
  border-radius: 999px;
  padding: 11px 24px;
  min-height: 44px;
  font-size: 14px;
  letter-spacing: 0.01em;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

#AIChatAgent .ved-settings-login-btn:hover,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ved-accent) 70%, var(--ved-border-strong));
  filter: saturate(1.06);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.24);
}

#AIChatAgent .ved-settings-login-btn:active,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(15, 23, 42, 0.2);
}

#AIChatAgent .ved-settings-login-btn:focus-visible,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--ved-accent) 35%, transparent),
    0 10px 24px rgba(15, 23, 42, 0.24);
}

#AIChatAgent .ved-settings-login-btn .ved-settings-login-icon,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-btn .ved-settings-login-icon {
  font-size: 14px;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  #AIChatAgent .ved-settings-login-card,
  .ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-card {
    transition: none;
    transform: none;
    filter: none;
  }
}

#AIChatAgent .ved-settings-login-note,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-settings-login-note {
  margin: 10px auto 0 auto;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ved-text-muted);
}

/* LLM Config Form */
#AIChatAgent .ved-form-group label,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group label {
  display: block;
  font-size: 13px;
  color: var(--ved-text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

#AIChatAgent .ved-label-with-help,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
  flex-wrap: wrap;
}

#AIChatAgent .ved-label-with-help > span:first-child,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-label-with-help > span:first-child {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
}

#AIChatAgent .ved-inline-doc,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-inline-doc {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ved-text-muted);
  background: var(--ved-bg-elevated);
  border: 1px solid var(--ved-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

#AIChatAgent .ved-inline-doc strong,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-inline-doc strong {
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-inline-doc .ved-hover-help,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-inline-doc .ved-hover-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--ved-border-strong);
  background: var(--ved-accent-soft);
  font: inherit;
  color: var(--ved-accent-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
}

#AIChatAgent .ved-inline-doc .ved-hover-help:hover,
#AIChatAgent .ved-inline-doc .ved-hover-help:focus-visible,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-inline-doc .ved-hover-help:hover,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-inline-doc .ved-hover-help:focus-visible {
  border-color: var(--ved-accent);
  background: var(--ved-accent);
  color: var(--ved-text-inverse);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

#AIChatAgent .ved-inline-doc .ved-hover-help:active,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-inline-doc .ved-hover-help:active {
  transform: translateY(1px);
}

#AIChatAgent .ved-inline-doc .help-text-icon,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-inline-doc .help-text-icon,
#AIChatAgent .ved-label-with-help .help-text-icon,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-label-with-help .help-text-icon {
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: center;
  vertical-align: middle !important;
  line-height: 1;
  margin-top: 0;
  position: relative;
  top: 0;
  transform: none;
}

.tippy-box[data-theme~='ved-hover-help'] {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.32);
}

.tippy-box[data-theme~='ved-hover-help'] .tippy-arrow {
  color: #0f172a;
}

.tippy-box[data-theme~='ved-hover-help'] .tippy-content {
  padding: 12px 14px;
}

.ved-hover-help-card {
  display: grid;
  gap: 10px;
  max-width: 320px;
}

.ved-hover-help-title {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.ved-hover-help-row {
  display: grid;
  gap: 3px;
}

.ved-hover-help-row strong {
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 700;
}

.ved-hover-help-row span {
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.45;
}

#AIChatAgent .ved-form-group small,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group small {
  display: block;
  font-size: 11px;
  color: var(--ved-text-muted);
  margin-top: 4px;
}

#AIChatAgent .ved-form-group select,
#AIChatAgent .ved-form-group input[type="number"],
#AIChatAgent .ved-form-group input[type="password"],
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group select,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group input[type="number"],
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group input[type="password"] {
  width: 100%;
  padding: 8px 12px;
  background: var(--ved-bg-input);
  border: 1px solid var(--ved-border-strong);
  border-radius: 4px;
  color: var(--ved-text-primary);
  font-size: 13px;
  box-sizing: border-box;
}

#AIChatAgent .ved-form-group select:focus,
#AIChatAgent .ved-form-group input:focus,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group select:focus,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-form-group input:focus {
  outline: none;
  border-color: var(--ved-accent);
}

/* Direct API reassurance */
#AIChatAgent .ved-direct-api-only small,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-direct-api-only small {
  color: var(--ved-success);
  font-weight: 600;
}

/* ── Simple Mode ── */
#AIChatAgent .ved-simple-mode .ved-agent-thought,
#AIChatAgent .ved-simple-mode .ved-tool-artifact,
#AIChatAgent .ved-simple-mode .ved-turn-activity {
  display: none !important;
}

#AIChatAgent .ved-prompt-stack,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-prompt-stack {
  display: grid;
  gap: 12px;
}

#AIChatAgent .ved-prompt-section-card,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-prompt-section-card {
  border: 1px solid var(--ved-border);
  border-radius: 12px;
  background: var(--ved-bg-surface);
  overflow: hidden;
}

#AIChatAgent .ved-prompt-section-card summary,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-prompt-section-card summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--ved-text-primary);
}

#AIChatAgent .ved-prompt-section-card summary::-webkit-details-marker,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-prompt-section-card summary::-webkit-details-marker {
  display: none;
}

#AIChatAgent .ved-prompt-section-card pre,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-prompt-section-card pre {
  margin: 0;
  padding: 0 14px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ved-text-secondary);
  background: transparent;
}

#AIChatAgent .ved-prompt-meta,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-prompt-meta {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ved-text-muted);
}

#AIChatAgent .ved-prompt-preview,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-prompt-preview {
  width: 100%;
  min-height: 260px;
  max-height: 440px;
  border: 1px solid var(--ved-border-strong);
  border-radius: 12px;
  background: var(--ved-bg-code);
  color: var(--ved-text-primary);
  padding: 14px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#AIChatAgent .ved-prompt-preview-info,
.ved-chat-modal[data-ved-owner="AIChatAgent"] .ved-prompt-preview-info {
  font-size: 12px;
  color: var(--ved-text-muted);
  margin-top: 8px;
}


/* =====================================================================
 * HomeNew additions
 * ---------------------------------------------------------------------
 * Only the states the legacy chat never needed.
 * =================================================================== */

/* Mic while transcribing: same spin language as the inline spinner. */
#AIChatAgent .vedastro-mic-btn.transcribing iconify-icon {
  animation: vedAssistantLoadingSpin 0.9s linear infinite;
}

@keyframes vedAssistantLoadingSpin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   Collapsible process card (agent "working…" notes)
   Expands while the turn runs, folds to "Worked for X s · N steps" after it.
   --------------------------------------------------------------------------- */
#AIChatAgent .ved-process-wrap {
  align-self: stretch;
  max-width: min(92%, 860px);
  margin: 2px 0 6px;
}

@media (max-width: 767px) {
  #AIChatAgent .ved-process-wrap {
    max-width: 100%;
  }
}

#AIChatAgent .ved-process-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#AIChatAgent .ved-process-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: #fcfdff;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

#AIChatAgent .ved-process-head:hover {
  background: #f8fafc;
}

#AIChatAgent .ved-process-spinner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  flex: 0 0 auto;
  animation: vedProcessPulse 1.1s infinite ease-in-out;
}

@keyframes vedProcessPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

#AIChatAgent .ved-process-title {
  min-width: 0;
}

#AIChatAgent .ved-process-chevron {
  margin-left: auto;
  color: #94a3b8;
  font-size: 10px;
  transition: transform 0.18s ease;
}

#AIChatAgent .ved-process-card.is-expanded .ved-process-chevron {
  transform: rotate(180deg);
}

#AIChatAgent .ved-process-steps {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease;
}

#AIChatAgent .ved-process-card.is-expanded .ved-process-steps {
  max-height: 340px;
}

#AIChatAgent .ved-process-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: #64748b;
  font-size: 12px;
  font-style: italic;
  line-height: 1.35;
  animation: vedProcessStepIn 0.2s ease-out;
}

#AIChatAgent .ved-process-step.no-anim {
  animation: none;
}

@keyframes vedProcessStepIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

#AIChatAgent .ved-process-step:first-child {
  padding-top: 2px;
}

#AIChatAgent .ved-process-step:last-child {
  padding-bottom: 11px;
}

#AIChatAgent .ved-process-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
  flex: 0 0 auto;
}

#AIChatAgent .ved-process-text {
  min-width: 0;
}
/* ── Waiting / stop button ─────────────────────────────────────────────── */
#AIChatAgent .ved-chat-send.ved-stop-active {
  background: #ef4444 !important;
  color: #fff !important;
}

#AIChatAgent .ved-chat-send.ved-stop-active:hover {
  background: #dc2626 !important;
}

/* ── Simple mode ───────────────────────────────────────────────────────── */
#AIChatAgent.is-simple-mode .ved-process-wrap {
  display: none !important;
}

/* ── Composer mode footer ──────────────────────────────────────────────── */
#AIChatAgent .ved-chat-mode-footer.is-visible {
  display: flex !important;
}

#AIChatAgent .ved-chat-mode-footer.is-loading .ved-chat-mode-footer-loading {
  display: inline-flex;
}

#AIChatAgent .ved-chat-mode-footer-loading-spinner {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: vedModeFooterSpin 0.8s linear infinite;
}

@keyframes vedModeFooterSpin {
  to { transform: rotate(360deg); }
}

/* ── Profile card (astrologer / user) ──────────────────────────────────── */
.ved-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  animation: vedProfileFade 160ms ease;
}

@keyframes vedProfileFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ved-profile-card {
  width: min(420px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  color: #0f172a;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  position: relative;
  animation: vedProfileRise 220ms ease;
}

@keyframes vedProfileRise {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.ved-profile-image,
.ved-profile-avatar-fallback {
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, #fdf6e3, #f3e6c8);
  font-size: 4rem;
  text-align: center;
  line-height: 190px;
}

.ved-profile-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.25);
}

.ved-profile-body {
  padding: 14px 18px 18px;
}

.ved-profile-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 999px;
  padding: 3px 9px;
}

.ved-profile-name {
  margin: 8px 0 2px;
  font-size: 20px;
  font-weight: 700;
}

.ved-profile-tagline {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.ved-profile-desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.ved-profile-stats {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.ved-profile-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12.5px;
}

.ved-profile-stat-title {
  font-weight: 700;
  color: #334155;
}

.ved-profile-stat-text {
  display: block;
  font-weight: 400;
  color: #64748b;
  font-size: 11.5px;
}

.ved-profile-stat-value {
  font-weight: 700;
  color: #4f46e5;
  white-space: nowrap;
}

.ved-profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ved-profile-action-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.ved-profile-action-btn:hover {
  background: #f1f5f9;
}

.ved-profile-action-btn.primary {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.ved-profile-action-btn.primary:hover {
  background: #4338ca;
}

/* Attachment chips inside a sent message bubble */
#AIChatAgent .ved-msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
#AIChatAgent .ved-msg-attachments .ved-attach-chip {
  background: rgba(255, 255, 255, 0.55);
}
/* The footer is only a working indicator now: no mode label/hint at rest. */
#AIChatAgent .ved-chat-mode-footer:not(.is-loading) {
  display: none !important;
}
