/* Shared brand theme. Status and third-party identity colors remain semantic. */
html { accent-color: var(--theme-primary, #2563eb); }
body { background: var(--theme-background, #f8fafc); color: var(--theme-text, #172033); }
:focus-visible { outline-color: var(--theme-accent-text, #2563eb); }

/* Storefront, customer area, checkout and payment pages. */
.site-header, .checkout-header { background: var(--theme-surface, #ffffff); border-color: var(--theme-line, #cbd5e1); }
.announcement, .story-section, .site-footer { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.story-section { background: linear-gradient(135deg, var(--theme-secondary, #1e3a5f), var(--theme-secondary-end, #294f7c)); }
.story-section h2, .site-footer h2, .site-footer h3 { color: var(--theme-on-secondary, #fff); }
.story-section p, .story-points p, .site-footer p, .site-footer a { color: var(--theme-on-secondary-muted, #dbeafe); }
.footer-store-copy small, .footer-social > span, .footer-bottom { color: var(--theme-on-secondary-muted, #dbeafe); }
.footer-bottom a, .footer-links a:hover, .footer-bottom a:hover,
.social-links a, .social-links a:hover { color: var(--theme-on-secondary, #fff); }
.social-links a:hover { border-color: var(--theme-on-secondary, #fff); background: color-mix(in srgb, var(--theme-on-secondary, #fff) 12%, transparent); }
.story-points > li > span, .eyebrow-light { color: var(--theme-on-secondary, #fff); }
.delivery-section, .order-summary, .chat-messages { background: var(--theme-surface-alt, #e2e8f0); }
.product-card, .delivery-card, .search-field, .sort-field select, .catalog-page-button,
.checkout-dialog, .payment-demo-card, .account-card, .privacy-banner, .privacy-box,
.optional-account-box, .chat-panel, .chat-message, .quick-replies,
.recovery-dialog, .password-reset-page { background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.product-image, .hero-carousel-slide, .brand-preview-image { background: var(--theme-accent-soft, #fef3c7); }
.product-card:nth-child(2n) .product-image { background: var(--theme-primary-soft, #f8d8b3); }
.product-card:nth-child(3n) .product-image { background: var(--theme-secondary-soft, #ffe9c7); }
.product-card .product-image.has-placeholder { background: var(--theme-surface-alt, #eef3f8); }
.product-placeholder { color: color-mix(in srgb, var(--theme-text, #172033) 54%, var(--theme-surface-alt, #eef3f8)); }
.product-placeholder svg { background: color-mix(in srgb, var(--theme-text, #172033) 7%, transparent); }
.demo-product-badge, .skip-link { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.stock-label { background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); }
.button-primary, .add-button, .category-filters button.active, .cart-count,
.checkout-fields h3 > span, .privacy-actions button:last-child,
.chat-toggle, .chat-message.user, .chat-message button, .chat-form button { background: var(--theme-primary, #2563eb); color: var(--theme-on-primary, #fff); }
.button-secondary, .showcase-card-round { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.button-primary:hover { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.cart-button, .privacy-actions button, .quick-replies button { border-color: var(--theme-primary, #2563eb); color: var(--theme-primary-text, #2563eb); }
.desktop-nav a, .privacy-banner, .chat-panel, .chat-message { color: var(--theme-text, #172033); }
.privacy-banner a, .featured-heading > a, .privacy-actions button, .whatsapp-link { color: var(--theme-primary-text, #2563eb); }
.privacy-actions button:last-child { color: var(--theme-on-primary, #fff); }
.privacy-box, .optional-account-box, .chat-messages { background: var(--theme-surface-alt, #f1f5f9); }
.payment-demo-page { background: radial-gradient(circle at top, var(--theme-accent-soft, #fff7df), var(--theme-background, #f8fafc) 72%); }
.chat-panel header { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.chat-panel header small { color: var(--theme-on-secondary-muted, #dbeafe); }
.chat-panel header .icon-button { color: var(--theme-on-secondary, #fff); }
.chat-toggle > span:first-child { color: var(--theme-on-primary, #fff); }
input, textarea, select { color: var(--theme-text, #172033); }
.checkout-fields input, .checkout-fields textarea, .checkout-fields select,
.chat-form input, .chat-message input, .recovery-dialog input { background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.recovery-dialog .button { background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.recovery-dialog .button-primary { background: var(--theme-primary, #2563eb); color: var(--theme-on-primary, #fff); }
.recovery-link, .password-reset-page > a { color: var(--theme-primary-text, #2563eb); }
.password-toggle { background: var(--theme-primary-soft, #dbeafe); color: var(--theme-primary-text, #2563eb); }
.password-toggle:hover, .password-toggle[aria-pressed="true"] { background: var(--theme-primary, #2563eb); color: var(--theme-on-primary, #fff); }
.account-page { background: var(--theme-background, #f8fafc); }
.account-login-card, .account-empty, .account-loading, .account-help,
.product-share-actions a, .product-share-actions button,
.product-social-actions button, .cart-drawer, .cart-item, .cart-thumb,
.checkout-shipping-options > label, .payment-methods > label { background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.account-help { background: var(--theme-surface-alt, #f1f5f9); }
.cart-panel, .cart-footer, .quantity-control button, .product-share-dialog,
.product-share-dialog input, .product-details-dialog, .product-details-close {
  background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1);
}
.product-social-actions button:hover, .product-social-actions button[aria-pressed="true"] { background: var(--theme-primary-soft, #dbeafe); color: var(--theme-primary-text, #2563eb); }
.product-details-button, .text-link, .product-social-actions button,
.product-share-actions a, .product-share-actions button,
.favorites-filter, .cart-total strong { color: var(--theme-primary-text, #2563eb); }
.favorites-filter[aria-pressed="true"], .shipping-option input:checked + span,
.payment-methods input:checked + span, .demo-methods input:checked + span { background: var(--theme-primary-soft, #dbeafe); border-color: var(--theme-primary, #2563eb); color: var(--theme-text, #172033); }
.payment-provider-option > span, .cart-thumb { background: var(--theme-primary-soft, #dbeafe); color: var(--theme-primary-text, #2563eb); }
.infinitepay-badge { color: var(--theme-primary-text, #2563eb); }
.hero h1, .section-heading h2, .featured-heading h2, .category-heading h3,
.product-info h3, .product-info h4, .delivery-card h2, .account-heading h1,
.account-login-card h1, .checkout-fields h3, .order-summary h3,
.payment-demo-card h1, .payment-demo-summary dd, .summary-total dt,
.summary-total dd { color: var(--theme-text, #172033); }
.hero-carousel-controls > button, .hero-dots button, .search-field input,
.sort-field select, .field input, .field textarea { background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }

/* Merchant and system panels. */
.sidebar { background: linear-gradient(180deg, var(--theme-secondary, #1e3a5f), var(--theme-secondary-end, #294f7c)); color: var(--theme-on-secondary, #fff); }
.admin-brand-light, .nav-item:hover, .nav-item.active { color: var(--theme-on-secondary, #fff); }
.admin-brand-light > span, .nav-item, .sidebar-footer a, .sidebar-footer button, .nav-group summary { color: var(--theme-on-secondary-muted, #dbeafe); }
.nav-item span, .nav-item.active span { color: var(--theme-on-secondary, #fff); }
.nav-item:hover, .nav-item.active { background: color-mix(in srgb, var(--theme-on-secondary, #fff) 13%, transparent); }
.topbar, .system-topbar, .metric-card, .panel, .settings-content-group,
.integration-form, .gateway-card, .merchant-user-form, .merchant-users-table-wrap,
.settings-required-field[data-settings-panel], .settings-tabs button, .account-card,
.order-details-dialog, .chat-panel, .chat-message, .quick-replies { background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.primary-button { background: var(--theme-primary, #2563eb); color: var(--theme-on-primary, #fff); }
.primary-button:hover { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.secondary-button, .menu-button, .topbar-logout { background: var(--theme-surface, #ffffff); color: var(--theme-primary-text, #2563eb); border-color: var(--theme-line, #cbd5e1); }
.settings-tabs button[aria-selected="true"] { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.metric-icon.green, .metric-icon.brown, .settings-section-heading > span, .admin-avatar, .success-icon { background: var(--theme-primary-soft, #dbeafe); color: var(--theme-primary-text, #2563eb); }
.fiscal-notice { background: var(--theme-surface-alt, #f1f5f9); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.fiscal-notice > span { background: var(--theme-primary-soft, #dbeafe); color: var(--theme-primary-text, #2563eb); }
.fiscal-notice strong { color: var(--theme-text, #172033); }
.fiscal-notice p { color: var(--theme-muted, #52647a); }
.metric-card strong, .metric-card p, .panel-heading h2, .view-heading h1,
.login-card h1, .settings-section-heading h2, .settings-content-group > summary,
.integration-form-heading h3, .integration-summary-grid strong { color: var(--theme-text, #172033); }
.integration-grid, .merchant-management-grid, .variant-admin-fields, .order-customer-details,
.integration-summary-grid > div, .settings-content-group[open] > summary,
.settings-submit-bar, .gateway-save-bar, .chat-messages { background: var(--theme-surface-alt, #f1f5f9); border-color: var(--theme-line, #cbd5e1); }
.settings-section-heading, .settings-content-group[open] > summary,
.panel-heading, .next-steps li, .settings-required-field { border-color: var(--theme-line, #cbd5e1); }
.system-form label, .system-actions label, .login-card label, .product-form-panel label { color: var(--theme-text, #172033); }
.system-form input, .system-form textarea, .system-form select, .system-actions input,
.login-card input, .product-form-panel input, .product-form-panel textarea,
.table-search, .settings-required-field[data-settings-panel] input,
.settings-required-field[data-settings-panel] textarea { background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.system-section-nav a { background: var(--theme-surface, #ffffff); color: var(--theme-primary-text, #2563eb); border-color: var(--theme-line, #cbd5e1); }
.system-section-nav a:hover, .system-section-nav a:focus-visible { background: var(--theme-primary-soft, #dbeafe); }
.settings-check input, .system-form .smtp-security input[type="checkbox"] { accent-color: var(--theme-primary, #2563eb); }
.settings-tabs button, .gateway-save-bar, .settings-submit-bar { border-color: var(--theme-line, #cbd5e1); }
.row-button, .dialog-close, .dispatch-quotes, .import-report,
.tracking-editor input, #merchant-password-dialog input,
.fiscal-dialog input[type="text"], .fiscal-dialog input[name="nfe_chave"],
.color-input-row, .settings-logo-row > img,
.melhor-envio-config-form input:not([type="checkbox"]), .melhor-envio-config-form select {
  background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1);
}
.row-button { color: var(--theme-primary-text, #2563eb); }
.row-button.fiscal { background: var(--theme-primary, #2563eb); color: var(--theme-on-primary, #fff); border-color: var(--theme-primary, #2563eb); }
.row-button:hover, .upload-field em:hover { background: var(--theme-primary-soft, #dbeafe); }
.toast:not(.error) { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.category-pill { background: var(--theme-primary-soft, #dbeafe); color: var(--theme-primary-text, #2563eb); }
th, .callback-list, .sender-fields, #smtp-test-form,
.melhor-envio-config-form .sender-fields, .melhor-envio-config-form .settings-check,
.melhor-envio-oauth-card .integration-summary-grid > div { background: var(--theme-surface-alt, #f1f5f9); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.smtp-security label:has(input:checked) { background: var(--theme-primary-soft, #dbeafe); border-color: var(--theme-primary, #2563eb); }
.callback-list code, .tracking-link, .settings-content-group > summary::after { color: var(--theme-primary-text, #2563eb); }
.login-art { background: linear-gradient(145deg, color-mix(in srgb, var(--theme-accent, #f59e0b) 40%, #24191a), color-mix(in srgb, var(--theme-primary, #2563eb) 34%, #24191a) 52%, color-mix(in srgb, var(--theme-secondary, #1e3a5f) 55%, #171a25)); color: white; }
.chat-toggle, .chat-message.user, .chat-message button, .chat-form button { background: var(--theme-primary, #2563eb); color: var(--theme-on-primary, #fff); }
.chat-panel header { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }

/* Standalone legal pages. */
body[data-document] main { background: var(--theme-surface, #ffffff); }
body[data-document] h1 { color: var(--theme-text, #172033); }
body[data-document] .eyebrow, body[data-document] a { color: var(--theme-primary-text, #2563eb); }
body[data-document] .meta { color: var(--theme-muted, #78675b); border-color: var(--theme-line, #cbd5e1); }

/* Live preview uses the same computed variables as the published pages. */
.brand-presets-heading, .brand-custom-heading { display: grid; gap: 3px; }
.brand-presets-heading strong, .brand-custom-heading strong { color: var(--theme-text, #172033); font: 700 .92rem Georgia, serif; }
.brand-presets-heading small, .brand-custom-heading small { color: var(--theme-muted, #52647a); font-size: .67rem; }
.brand-custom-heading { margin-top: 3px; border-top: 1px solid var(--theme-line, #cbd5e1); padding-top: 18px; }
.brand-palette-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.brand-palette-option { position: relative; display: grid; align-content: start; gap: 5px; min-width: 0; min-height: 122px; border: 1px solid var(--theme-line, #cbd5e1); border-radius: 11px; padding: 12px; background: var(--theme-surface, #ffffff); color: var(--theme-text, #172033); text-align: left; cursor: pointer; transition: border-color .18s, background-color .18s, transform .18s; }
.brand-palette-option:hover { border-color: var(--palette-primary); transform: translateY(-2px); }
.brand-palette-option[aria-pressed="true"] { border: 2px solid var(--palette-primary); padding: 11px; background: color-mix(in srgb, var(--palette-primary) 7%, var(--theme-surface, #ffffff)); }
.brand-palette-option[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 10px; right: 10px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--palette-primary); color: var(--palette-on-primary); font-size: .72rem; font-weight: 800; }
.brand-palette-option strong { max-width: calc(100% - 22px); font-size: .78rem; line-height: 1.25; }
.brand-palette-option small { max-width: 22ch; color: var(--theme-muted, #52647a); font-size: .62rem; line-height: 1.35; }
.brand-palette-swatches { display: flex; flex-wrap: wrap; gap: 5px; align-self: end; margin-top: 5px; }
.brand-palette-swatches i { width: 19px; height: 19px; border: 1px solid color-mix(in srgb, var(--theme-text, #172033) 18%, transparent); border-radius: 50%; }
@media (max-width: 619px) { .brand-palette-options { grid-template-columns: 1fr; } .brand-palette-option { min-height: 88px; } }
.brand-preview { background: var(--theme-background, #f8fafc); color: var(--theme-text, #172033); border-color: var(--theme-line, #cbd5e1); }
.brand-preview-top, .brand-preview-sidebar { background: var(--theme-secondary, #1e3a5f); color: var(--theme-on-secondary, #fff); }
.brand-preview-image { background: var(--theme-accent-soft, #fef3c7); border-color: var(--theme-accent, #f59e0b); color: var(--theme-text, #172033); }
.brand-preview-button { background: var(--theme-primary, #2563eb); color: var(--theme-on-primary, #fff); }
.brand-preview-link { color: var(--theme-primary-text, #2563eb); }
.brand-preview-dashboard { display: grid; grid-template-columns: 94px 1fr; min-height: 114px; border-top: 1px solid var(--theme-line, #cbd5e1); font-size: .66rem; }
.brand-preview-sidebar { padding: 13px 11px; line-height: 2; }
.brand-preview-panel { display: grid; align-content: start; gap: 5px; padding: 13px; background: var(--theme-surface-alt, #f1f5f9); }
.brand-preview-panel strong { color: var(--theme-text, #172033); font: 700 .9rem Georgia, serif; }
.brand-preview-panel span { color: var(--theme-muted, #52647a); }
.brand-preview-metric { margin-top: 4px; border: 1px solid var(--theme-line, #cbd5e1); border-radius: 6px; padding: 7px; background: var(--theme-surface, #ffffff); color: var(--theme-primary-text, #2563eb); font-weight: 700; }
.theme-contrast-message { color: var(--theme-muted, #52647a); font-size: .67rem; line-height: 1.4; }
