/* Compatibility skin for installed Propostas 3.4.x and VisuAI 1.6.x.
 * Specificity is deliberate: plugins load their CSS after the Core.
 * Do not change calculations, stage colors, conversation anchoring or module data. */
html[data-vis-theme] .vis-ui .vai-shell {
  --vai-line: var(--vis-border); --vai-line-soft: var(--vis-border);
  --vai-soft: var(--vis-surface-soft); --vai-muted: var(--vis-muted);
  --vai-ink: var(--vis-ink); --primary: var(--vis-action);
  font-family: var(--vis-font); color: var(--vis-ink);
}
html[data-vis-theme] .vis-ui :is(.vai-chat,.vai-plan,.vai-sidebar,.vai-composer-dock) { background: var(--vis-surface); color: var(--vis-ink); border-color: var(--vis-border); box-shadow: none; }
html[data-vis-theme] .vis-ui :is(.vai-chat,.vai-plan) { border: 1px solid var(--vis-border); border-radius: 18px; }
html[data-vis-theme] .vis-ui .vai-sidebar { background: transparent; }
html[data-vis-theme] .vis-ui :is(.vai-chat-head,.vai-plan-head) { border-color: var(--vis-border); }
html[data-vis-theme] .vis-ui :is(.vai-chat-head h2,.vai-plan-head h2,.vai-welcome h2,.vai-plan-empty h3,.vai-plan-content h3,.vai-plan-content h4,.vai-product-chip strong,.vai-plan-products strong,.vai-proposal-draft h4,.vai-sidebar-head strong,.vai-bubble) { color: var(--vis-ink); }
html[data-vis-theme] .vis-ui :is(.vai-thread,.vai-global-disclaimer,.vai-welcome p,.vai-plan-empty p,.vai-chat-head p) { color: var(--vis-muted); }
html[data-vis-theme] .vis-ui :is(.vai-thread-row.active,.vai-thread:hover,.vai-thread.active) { background: var(--vis-accent-soft); color: var(--vis-accent-ink); border-radius: 10px; }
html[data-vis-theme] .vis-ui :is(.vai-icon-button,.vai-composer,.vai-product-chip,.vai-plan-products button,.vai-proposal-draft,.vai-message-products button) { background: var(--vis-surface); border-color: var(--vis-border); color: var(--vis-ink); border-radius: 12px; box-shadow: none; }
html[data-vis-theme] .vis-ui .vai-composer textarea { background: transparent; color: var(--vis-ink); font-size: 14px; }
html[data-vis-theme] .vis-ui .vai-message.user .vai-bubble { border-radius: 14px; background: var(--vis-accent-soft); color: var(--vis-ink); }
html[data-vis-theme] .vis-ui :is(.vai-plan-button,.vai-proposal-button,.vai-create-proposal,.vai-composer .vai-send-button) { border: 1px solid transparent; border-radius: 10px; background: var(--vis-action); color: var(--vis-on-action); box-shadow: none; }
html[data-vis-theme] .vis-ui .vai-composer .vai-attach-button { background: var(--vis-surface-soft); color: var(--vis-muted); border-color: var(--vis-border); }
html[data-vis-theme] .vis-ui :is(.vai-inline-link,.vai-simulation-step) { background: var(--vis-accent-soft); color: var(--vis-accent-ink); border-color: var(--vis-border); }
html[data-vis-theme] .vis-ui .vai-ai-status.online { background: var(--vis-success-soft); color: var(--vis-success); border-color: transparent; }

html[data-vis-theme] .vis-ui :is(.vp-card,.vp-product-card,.vp-simulation-card,.vp-request-card,.vp-guided-question,.vp-guided-preview,.vp-detail-aside,.vp-setting-card,.vp-result-card,.vp-offer-card,.vp-quota-card,.vp-review-item,.vp-kanban-card,.vp-advisor-link-card) { border: 1px solid var(--vis-border); border-radius: 16px; background: var(--vis-surface); color: var(--vis-ink); box-shadow: var(--vis-shadow-sm); }
html[data-vis-theme] .vis-ui :is(.vp-intro,.vp-guided-result) { border-color: var(--vis-border); border-radius: 20px; background: var(--vis-accent-soft); color: var(--vis-ink); }
html[data-vis-theme] .vis-ui .vp-intro { padding: 24px; gap: 24px; align-items: center; }
html[data-vis-theme] .vis-ui .vp-intro > div { min-width: 0; }
html[data-vis-theme] .vis-ui .vp-intro h2 { max-width: 650px; margin: 8px 0 12px; font-size: clamp(24px,2.3vw,32px); font-weight: 600; line-height: 1.18; }
html[data-vis-theme] .vis-ui .vp-intro p { font-size: 13px; line-height: 1.6; }
html[data-vis-theme] .vis-ui .vp-section-head h3 { font-size: clamp(22px,2vw,28px); font-weight: 600; }
html[data-vis-theme] .vis-ui .vp-tabs { min-width: 0; scrollbar-width: thin; }
html[data-vis-theme] .vis-ui .vp-tabs button { flex: 0 0 auto; min-height: 44px; padding: 10px 16px; font-size: 13px; line-height: 1.3; }
html[data-vis-theme] .vis-ui .vp-tabs button > svg { width: 18px; height: 18px; flex: 0 0 18px; }
html[data-vis-theme] .vis-ui .vp-tabs-indicator { pointer-events: none; }
@media (max-width: 680px) {
  html[data-vis-theme] .vis-ui .vp-intro { flex-direction: column; align-items: stretch; padding: 20px; gap: 18px; }
  html[data-vis-theme] .vis-ui .vp-tabs { width: 100%; margin-inline: 0; }
}
html[data-vis-theme] .vis-ui :is(.vp-product-card,.vp-simulation-card,.vp-request-card):hover { border-color: var(--vis-action); background: var(--vis-surface); transform: none; box-shadow: var(--vis-shadow-md); }
html[data-vis-theme] .vis-ui :is(.vp-intro h2,.vp-section-head h3,.vp-card h3,.vp-detail-head h3,.vp-product-card h3,.vp-guided-copy h3,.vp-request-main strong,.vp-request-value strong,.vp-simulation-card strong) { color: var(--vis-ink); }
html[data-vis-theme] .vis-ui :is(.vp-intro p,.vp-section-head p,.vp-card-head p,.vp-detail-head p,.vp-product-card p,.vp-guided-copy p,.vp-simulation-card small,.vp-request-main span) { color: var(--vis-muted); }
html[data-vis-theme] .vis-ui :is(.vp-product-icon,.vp-preview-icon,.vp-quick span,.vp-guided-option,.vp-plan-products button,.vp-advisor-link-note) { border-color: var(--vis-border); background: var(--vis-accent-soft); color: var(--vis-accent-ink); }
html[data-vis-theme] .vis-ui .vp-tabs { background: var(--vis-surface-soft); border: 1px solid var(--vis-border); border-radius: 12px; }
html[data-vis-theme] .vis-ui .vp-tabs button { color: var(--vis-muted); border-radius: 8px; }
html[data-vis-theme] .vis-ui .vp-tabs button.active { color: var(--vis-accent-ink); background: transparent; }
html[data-vis-theme] .vis-ui .vp-tabs-indicator { background: var(--vis-surface); border-color: var(--vis-border); border-radius: 8px; box-shadow: var(--vis-shadow-sm); }
html[data-vis-theme] .vis-ui :is(.vp-field input,.vp-field select,.vp-field textarea,.vp-search input) { min-height: 46px; background: var(--vis-surface); color: var(--vis-ink); border: 1px solid var(--vis-control-border); border-radius: 12px; }
html[data-vis-theme] .vis-ui :is(.vp-field label,.vp-guided-option) { color: var(--vis-ink); }
html[data-vis-theme] .vis-ui .vp-guided-option.selected { border-color: var(--vis-action); background: var(--vis-accent-soft); color: var(--vis-accent-ink); }
html[data-vis-theme] .vis-ui :is(.vp-kanban-column,.vp-eligibility,.vp-guided-preview dl div,.vp-quota-card dl div) { background: var(--vis-surface-soft); color: var(--vis-ink); border-color: var(--vis-border); }
html[data-vis-theme] .vis-ui :is(.vp-disclaimer,.vp-support-note,.vp-result-note) { border-color: var(--vis-border); background: var(--vis-surface-soft); color: var(--vis-muted); }
html[data-vis-theme] .vis-ui .vp-quota-credit { background: var(--vis-accent-soft); color: var(--vis-accent-ink); }
html[data-vis-theme] .vis-ui .vp-quota-credit span { color: var(--vis-muted); }

html[data-vis-theme] .vis-ui .vps-app { --vps-blue: var(--vis-action); --vps-ink: var(--vis-ink); --vps-muted: var(--vis-muted); --vps-line: var(--vis-border); --vps-bg: var(--vis-bg); --vps-card: var(--vis-surface); background: var(--vis-bg); font-family: var(--vis-font); }
html[data-vis-theme] .vis-ui .vps-header { background: var(--vis-glass); border: 1px solid var(--vis-border); border-radius: 14px; box-shadow: var(--vis-shadow-sm); }
html[data-vis-theme] .vis-ui :is(.vps-product-card,.vps-question-card,.vps-final-result,.vps-register,.vps-preview) { border: 1px solid var(--vis-border); border-radius: 20px; background: var(--vis-surface); color: var(--vis-ink); box-shadow: var(--vis-shadow-sm); }
html[data-vis-theme] .vis-ui .vps-product-card:hover { transform: none; border-color: var(--vis-action); background: var(--vis-surface); }
html[data-vis-theme] .vis-ui :is(.vps-catalog-copy h1,.vps-question-copy h1,.vps-final-result h1,.vps-register h2) { font-weight: 500; letter-spacing: -.045em; color: var(--vis-ink); }
html[data-vis-theme] .vis-ui :is(.vps-option,.vps-final-primary div) { border-color: var(--vis-border); border-radius: 12px; background: var(--vis-surface-soft); color: var(--vis-ink); }
html[data-vis-theme] .vis-ui .vps-option.selected,html[data-vis-theme] .vis-ui .vps-option:hover { border-color: var(--vis-action); background: var(--vis-accent-soft); color: var(--vis-accent-ink); transform: none; }
html[data-vis-theme] .vis-ui .vps-button { min-height: 44px; border: 1px solid transparent; border-radius: 12px; background: var(--vis-action); color: var(--vis-on-action); font-weight: 600; }
html[data-vis-theme] .vis-ui .vps-button.secondary,html[data-vis-theme] .vis-ui .vps-header nav a { border: 1px solid var(--vis-border); border-radius: 12px; background: var(--vis-surface); color: var(--vis-ink); }
html[data-vis-theme] .vis-ui .vps-register input,html[data-vis-theme] .vis-ui .vps-value input { min-height: 46px; border: 1px solid var(--vis-control-border); border-radius: 12px; background: var(--vis-surface); color: var(--vis-ink); }
html[data-vis-theme] .vis-ui :is(.vps-preview > span,.vps-preview > small,.vps-preview dt,.vps-preview-primary small,.vps-final-primary small) { color: var(--vis-muted); }
html[data-theme=dark] .vis-ui .vps-brand img[src*="logo-visucio"] { content: url('/assets/logo-visucio-white.png'); }

/* Fit the existing fixed chat to the new header, without reimplementing its scroll. */
@media (min-width: 1281px) {
  html[data-vis-theme] .vis-ui .client-main:has(.page.visuai-page) { height: calc(100dvh - var(--core-header)); min-height: 0; overflow: hidden; }
  html[data-vis-theme] .vis-ui .app-shell:not(.client-shell) .main:has(.page.visuai-page) { height: 100dvh; min-height: 0; overflow: hidden; }
  html[data-vis-theme] .vis-ui .page.visuai-page { height: calc(100dvh - var(--core-header)); min-height: 0; padding-block: 16px; overflow: hidden; }
  html[data-vis-theme] .vis-ui .page.visuai-page > .visucio-plugin-host { height: 100%; min-height: 0; }
  html[data-vis-theme] .vis-ui .page.visuai-page .vai-shell { height: 100%; max-height: 100%; min-height: 0; }
  html[data-vis-theme] .vis-ui .page.visuai-page .vai-chat { height: 100%; min-height: 0; max-height: none; top: auto; position: relative; }
}
@media (max-width: 600px) {
  html[data-vis-theme] .vis-ui .vai-composer textarea,html[data-vis-theme] .vis-ui .vp-field :is(input,select,textarea),html[data-vis-theme] .vis-ui .vps-register input { font-size: 16px; }
}
