/* Store palettes and picker samples share tokens; platform branding stays independent. */
html[data-storefront][data-theme="claro"],.theme-sample[data-palette="claro"]{
 --bg:#f7f5ef;--card:#fffefa;--card-soft:#eeefe5;--text:#253128;--muted:#626a5f;--accent:#40523d;--accent-contrast:#ffffff;--accent-hover:#30412e;--card-border:#d9ded1;--field-border:#84917d;--editorial:#6e4a35;--danger:#a12d30;--success:#365c3c;--info:#315d72;--shadow:0 8px 28px -20px #293b3540;color-scheme:light;
}
html[data-storefront][data-theme="oscuro"],.theme-sample[data-palette="oscuro"]{
 --bg:#151b22;--card:#1e2731;--card-soft:#28333f;--text:#f2eee6;--muted:#b8b8b1;--accent:#dfc49a;--accent-contrast:#1b2025;--accent-hover:#eed6b1;--card-border:#3b4652;--field-border:#7f8c99;--editorial:#dfc49a;--danger:#f2a6a6;--success:#a9cfad;--info:#a9c9e4;--shadow:0 10px 30px -18px #00000099;color-scheme:dark;
}
html[data-storefront][data-theme="alto-contraste"],.theme-sample[data-palette="alto-contraste"]{
 --bg:#0d0f12;--card:#15191f;--card-soft:#232a33;--text:#ffffff;--muted:#e2e6ec;--accent:#f0d892;--accent-contrast:#11151a;--accent-hover:#ffe8ac;--card-border:#b6c0cb;--field-border:#cbd2db;--editorial:#f0d892;--danger:#ffbbbb;--success:#b4e3bd;--info:#c5e1ff;--shadow:none;color-scheme:dark;
}
html[data-storefront][data-theme="vibrante"],.theme-sample[data-palette="vibrante"]{
 --bg:#faf5f5;--card:#fffcfb;--card-soft:#f1e4e7;--text:#392930;--muted:#74606a;--accent:#8a3450;--accent-contrast:#ffffff;--accent-hover:#6b263e;--card-border:#e1cdd4;--field-border:#987684;--editorial:#8a3450;--danger:#a12d30;--success:#365c3c;--info:#315d72;--shadow:0 8px 28px -20px #612c4040;color-scheme:light;
}
html[data-storefront][data-theme="suave"],.theme-sample[data-palette="suave"]{
 --bg:#f4eee6;--card:#fffaf3;--card-soft:#ede2d4;--text:#3d3028;--muted:#746254;--accent:#79533b;--accent-contrast:#ffffff;--accent-hover:#5d3d29;--card-border:#dccdba;--field-border:#9b826b;--editorial:#79533b;--danger:#a12d30;--success:#365c3c;--info:#315d72;--shadow:0 8px 28px -20px #5d402e40;color-scheme:light;
}
html[data-storefront],.theme-sample{--fg:var(--text);--border:var(--card-border);--primary:var(--accent);--primary-contrast:var(--accent-contrast);--link:var(--accent);--link-hover:var(--accent-hover)}
html[data-storefront] body{background:var(--bg);background-image:none;animation:none;color:var(--fg)}
html[data-storefront] .shop-topbar{background:var(--card)}
html[data-storefront]:is([data-theme="oscuro"],[data-theme="alto-contraste"]) .store-brand .shop-brand-logo,
html[data-storefront]:is([data-theme="oscuro"],[data-theme="alto-contraste"]) .store-footer-brand img{background:#fffefa;border-radius:9px;padding:4px}
html[data-storefront] .store-hero-tagline{color:var(--editorial)}
html[data-storefront] :is(.btn.primary,.store-cta,.cart-pill,.item-add,.shop-go,.shop-buy-box button,.checkout-actions button){background:var(--accent);border-color:var(--accent);color:var(--accent-contrast);box-shadow:none}
html[data-storefront] :is(.btn.primary,.store-cta,.cart-pill,.item-add,.shop-go,.shop-buy-box button,.checkout-actions button):hover{background:var(--accent-hover)!important;border-color:var(--accent-hover)!important;color:var(--accent-contrast)!important;filter:none}
html[data-storefront] :is(.btn.secondary,button.secondary){background:var(--card-soft);color:var(--fg);border-color:var(--border)}
html[data-storefront] :is(.chip,.item-view,.shop-back-link):hover{background:var(--card-soft)!important;color:var(--accent)!important;border-color:var(--accent)!important}
html[data-storefront] .chip-active,html[data-storefront] .chip-active:hover{background:var(--accent)!important;color:var(--accent-contrast)!important;border-color:var(--accent)!important}
html[data-storefront] .store-video-tag{background:var(--card);color:var(--fg);border:1px solid var(--border)}
html[data-storefront] :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea){background:var(--card);color:var(--fg);border-color:var(--field-border)!important}
html[data-storefront] ::placeholder{color:var(--muted);opacity:1}
html[data-storefront] :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid var(--accent)!important;outline-offset:3px;box-shadow:none!important}
html[data-storefront] .table tbody tr:nth-child(even),html[data-storefront] .table tbody tr:hover{background:var(--card-soft)}
html[data-storefront] .shop-cart-remove .btn:hover{color:var(--danger)!important;border-color:var(--danger)!important}
/* Chat controls inherit the shop identity rather than imposing a blue/light theme. */
html[data-storefront] .store-assistant{--fg:inherit;--card:inherit;--muted:inherit;--border:inherit;--accent:inherit;color:var(--fg);color-scheme:inherit}
html[data-storefront] :is(.agent-toggle,.agent-send){background:var(--accent);color:var(--accent-contrast);box-shadow:var(--shadow)}
html[data-storefront] :is(.agent-toggle,.agent-send):hover{background:var(--accent-hover);color:var(--accent-contrast)}
html[data-storefront] .store-agent-panel{background:var(--card);border-color:var(--border);color:var(--fg);box-shadow:var(--shadow)}
html[data-storefront] .agent-close{color:var(--fg);background:transparent}
html[data-storefront] :is(.agent-disclosure,.store-agent-panel small){color:var(--muted)}
html[data-storefront] .agent-message{background:var(--card-soft);color:var(--fg)}
html[data-storefront] .agent-message.agent-user{background:var(--bg);color:var(--fg);border:1px solid var(--border)}
html[data-storefront] .agent-chat-error{background:var(--card-soft);color:var(--danger);border:1px solid var(--danger)}
html[data-storefront][data-theme="alto-contraste"] :is(.card,.store-catalog .item){border:2px solid var(--border)!important}
html[data-storefront][data-theme="alto-contraste"] .store-catalog .item{padding:12px!important}
/* Picker works on its own page and when its form is inserted into either modal. */
.theme-settings .card-title{font-size:1.5rem}
.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;border:0;padding:0;margin:18px 0;min-width:0}
.theme-options legend{padding:0 0 12px;font-weight:600}
.theme-choice{position:relative;min-width:0;cursor:pointer;display:block}
.theme-choice>input{position:absolute;top:16px;left:16px;z-index:1;width:18px;height:18px;margin:0;padding:0;appearance:auto;accent-color:#2f5bea;background:transparent}
.theme-choice-content{display:flex;flex-direction:column;height:100%;padding:44px 14px 14px;border:2px solid var(--border);border-radius:16px;gap:8px;background:var(--card);box-sizing:border-box}
.theme-choice>input:checked+.theme-choice-content{border-color:#2f5bea}
.theme-choice>input:focus-visible+.theme-choice-content{outline:3px solid #2f5bea;outline-offset:3px}
.theme-choice-content>strong{font-size:1rem;line-height:1.3}
.theme-choice-description{font-size:.84rem;color:var(--muted);font-weight:400;line-height:1.45}
.theme-choice-status{visibility:hidden;color:#2448bb;font-size:.78rem;font-weight:600;margin-top:auto}
.theme-choice>input:checked+.theme-choice-content .theme-choice-status{visibility:visible}
.theme-sample{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px;border-radius:10px;border:1px solid var(--border);background:var(--bg);color:var(--fg);min-height:120px}
.theme-sample-title{grid-column:1/-1;color:var(--fg);font-size:.85rem;font-weight:700}
.theme-sample-products{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.theme-sample-products i{display:block;border-radius:5px;background:var(--card-soft);border:1px solid var(--border);min-height:38px}
.theme-sample-action{align-self:center;display:block;text-align:center;border-radius:5px;padding:8px 4px;background:var(--accent);color:var(--accent-contrast);font-size:.72rem;font-weight:600}
.theme-sample-caption{grid-column:1/-1;color:var(--muted);font-size:.7rem;font-weight:400}
#themeModal>.mscr-modal-card,#themePickerModal>.mscr-modal-card{max-width:920px!important;max-height:calc(100dvh - 48px);display:flex;flex-direction:column}
#themeModalBody,#themePickerBody{overflow:auto;min-height:0}
#themeModal .card-header,#themeModal .card-actions,#themePickerModal .card-header,#themePickerModal .card-actions{flex-shrink:0}
@media(max-width:900px){.theme-options{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.theme-options{grid-template-columns:minmax(0,1fr)}.theme-sample{min-height:112px}}
@media(forced-colors:active){html[data-storefront][data-theme],.theme-sample[data-palette]{--bg:Canvas;--card:Canvas;--card-soft:Canvas;--text:CanvasText;--muted:CanvasText;--accent:Highlight;--accent-contrast:HighlightText;--accent-hover:Highlight;--card-border:CanvasText;--field-border:CanvasText;--editorial:CanvasText;--shadow:none}}
