/* Existing ValleyFold roles applied to the plugin widget, without page redesign. */
#vf-ai-chatbot-root {
 --vf-ai-font: var(--font-body, 'Inter', sans-serif);
 --vf-ai-bg: var(--vf-canvas) !important;
 --vf-ai-msg-bot-bg: var(--vf-surface);
 --vf-ai-msg-bot-text: var(--vf-text);
 --vf-ai-border: var(--vf-line);
 --vf-ai-muted: var(--vf-muted);
 --vf-ai-surface: var(--vf-surface);
 --vf-ai-color: var(--wp--preset--color--brand, #1D4ED8) !important;
 --vf-ai-color-sec: var(--wp--preset--color--brand-strong, #1E40AF) !important;
 color: var(--vf-text);
}
#vf-ai-chatbot-root .vf-ai-bubble, #vf-ai-chatbot-root .vf-ai-panel__header { background: linear-gradient(135deg,var(--vf-ai-color),var(--vf-ai-color-sec)); color:var(--vf-ai-text,#fff); }
/* The native dark-mode rule loads later; keep the branded header and its ink paired. */
#vf-ai-chatbot-root .vf-ai-panel__header { background:linear-gradient(135deg,var(--vf-ai-color),var(--vf-ai-color-sec))!important; }
#vf-ai-chatbot-root .vf-ai-panel { border: 1px solid var(--vf-control); max-width: calc(100vw - 32px); max-height: calc(100dvh - 104px); }
#vf-ai-chatbot-root .vf-ai-panel__name { font-size: 16px; }
#vf-ai-chatbot-root .vf-ai-panel__status, #vf-ai-chatbot-root .vf-ai-disclosure { font-size: 13px; }
#vf-ai-chatbot-root .vf-ai-panel__footer { color: var(--vf-text); }
#vf-ai-chatbot-root .vf-ai-project-link { color: var(--vf-link); display: inline-flex; align-items: center; min-height: 44px; }
#vf-ai-chatbot-root input { color: var(--vf-text); background: var(--vf-canvas); font-size: 16px; }
#vf-ai-chatbot-root :focus-visible { outline: 2px solid var(--vf-link); outline-offset: 3px; }
.vfnet-chat-consent { position: fixed; right: 20px; bottom: 20px; min-height: 48px; border: 1px solid var(--vf-control); border-radius: 24px; padding: 10px 16px; background: var(--vf-canvas); color: var(--vf-text); font: inherit; z-index: 25; }
@media (max-width: 480px) { #vf-ai-chatbot-root .vf-ai-panel { right: 16px !important; left: 16px !important; width: auto !important; bottom: 16px !important; height: calc(100dvh - 32px) !important; max-height: calc(100dvh - 32px) !important; border-radius: 12px !important; } }
@media (prefers-reduced-motion: reduce) { #vf-ai-chatbot-root *, #vf-ai-chatbot-root *::before, #vf-ai-chatbot-root *::after { animation: none !important; transition: none !important; } }
#vf-ai-chatbot-root .vf-ai-disclosure { color: var(--vf-muted); }
#vf-ai-chatbot-root .vf-ai-status-dot { background: #9bbaff; animation: none; }
#vf-ai-chatbot-root .vf-ai-panel__close, #vf-ai-chatbot-root .vf-ai-back-btn { min-width: 44px; min-height: 44px; opacity: 1; }

#vf-ai-chatbot-root .vf-ai-msg--bot a { color: var(--vf-link); }
/* Keep the native required acknowledgment distinct from the composer without changing its copy or state. */
#vf-ai-chatbot-root .vf-ai-disclosure:has(#vf-ai-provider-consent) {
 box-sizing: border-box;
 display: grid;
 grid-template-columns: 20px minmax(0, 1fr);
 align-items: start;
 gap: 8px;
 margin: 8px 16px 0;
 padding: 10px 12px;
 border: 1px solid var(--vf-line);
 border-inline-start: 3px solid var(--vf-blue);
 border-radius: 8px;
 background: var(--vf-sunken, var(--vf-surface));
 color: var(--vf-text);
 font-size: 12px;
 line-height: 1.45;
 text-align: left;
}
#vf-ai-chatbot-root #vf-ai-provider-consent {
 width: 18px;
 height: 18px;
 min-width: 18px;
 margin: 1px 0 0;
 accent-color: var(--vf-blue);
 cursor: pointer;
}
#vf-ai-chatbot-root .vf-ai-panel__input { flex: 0 0 auto; }
#vf-ai-chatbot-root .vf-ai-panel__messages { min-height: 0; }
#vf-ai-chatbot-root.vf-ai--docked .vf-ai-panel {
 border-radius: 0;
 box-shadow: -8px 0 28px rgba(16, 31, 59, .14);
}
#vf-ai-chatbot-root.vf-ai--docked .vf-ai-panel__messages { padding: 20px; }
@media (min-width: 481px) {
 #vf-ai-chatbot-root .vf-ai-panel:not(.vf-ai-panel--closed) { min-height: min(600px, calc(100dvh - 104px)); }
}
@media (prefers-color-scheme: dark) {
 #vf-ai-chatbot-root .vf-ai-disclosure:has(#vf-ai-provider-consent) {
  border-color: var(--vf-control);
  border-inline-start-color: var(--vf-link);
 }
}
:root[data-vf-theme="dark"] #vf-ai-chatbot-root .vf-ai-welcome-card__title,
:root[data-vf-theme="dark"] #vf-ai-chatbot-root .vf-ai-prompt-btn,
:root[data-vf-theme="dark"] #vf-ai-chatbot-root .vf-ai-conv-item {
 color: var(--vf-text);
}
:root[data-vf-theme="dark"] #vf-ai-chatbot-root .vf-ai-prompt-btn,
:root[data-vf-theme="dark"] #vf-ai-chatbot-root .vf-ai-conv-item {
 background: var(--vf-surface);
 border-color: var(--vf-line);
}
:root[data-vf-theme="dark"] #vf-ai-chatbot-root .vf-ai-prompt-btn:hover,
:root[data-vf-theme="dark"] #vf-ai-chatbot-root .vf-ai-conv-item:hover {
 background: var(--vf-sunken);
 border-color: var(--vf-control);
}
@media (forced-colors: active) {
 #vf-ai-chatbot-root .vf-ai-disclosure:has(#vf-ai-provider-consent) { border: 1px solid CanvasText; }
 #vf-ai-chatbot-root #vf-ai-provider-consent { accent-color: Highlight; }
}
/* Native support/acknowledgment visibility must survive the site's generic form display rules. */
#vf-ai-chatbot-root [hidden] { display: none !important; }
/* Native message bubbles retain their own ink/surface in both site themes. */
#vf-ai-chatbot-root .vf-ai-msg--bot a[href$="/contact/"] {
 color: inherit;
 text-decoration: underline;
 text-underline-offset: .15em;
}

/* Compact presentation for both consent-gated and native launchers. The plugin owns behavior. */
#vf-ai-chatbot-root #vf-ai-bubble, #vf-ai-chatbot-root .vfnet-chat-consent {
 box-sizing:border-box; width:44px; height:44px; min-width:44px; min-height:44px;
 inline-size:44px; block-size:44px; padding:0; border-radius:50%;
 display:grid; place-items:center; position:fixed; left:auto!important;
 right:max(12px,env(safe-area-inset-right))!important;
 bottom:calc(max(12px,env(safe-area-inset-bottom)) + var(--vf-cookie-clearance,0px) + var(--vf-chat-clearance,0px))!important;
 visibility:var(--vf-chat-visibility,visible);
 box-shadow:var(--wp--custom--vf--shadow--small);
}
#vf-ai-chatbot-root .vfnet-chat-consent { background:var(--wp--preset--color--brand); color:#fff; border:1px solid var(--wp--preset--color--brand-strong); }
#vf-ai-chatbot-root :is(#vf-ai-bubble,.vfnet-chat-consent) svg { width:22px; height:22px; }
#vf-ai-chatbot-root .vfnet-chat-consent:hover { background:var(--wp--preset--color--brand-strong); }
[data-vf-theme="dark"] #vf-ai-chatbot-root {
 --vf-ai-color:var(--vf-link,#60A5FA)!important;
 --vf-ai-color-sec:var(--wp--custom--vf--dark--link-hover,#93C5FD)!important;
 --vf-ai-text:#0B1221!important;
}
[data-vf-theme="dark"] #vf-ai-chatbot-root .vfnet-chat-consent { background:var(--vf-link); color:#0B1221; border-color:var(--vf-link); }
