/* Shared brand and explicit palettes, without filters applied to products, photos or maps. */
.sp-brand{display:inline-block!important;position:relative;width:180px;height:48px;overflow:hidden;vertical-align:middle;flex:none}
.sp-brand img{display:block;position:absolute;left:-5%;top:50%;width:110%!important;max-width:none!important;height:auto!important;transform:translateY(-50%);object-fit:contain!important;filter:none!important}
.sp-brand .sp-brand-dark{display:none;mix-blend-mode:screen}
html[data-theme=dark] .sp-brand-light{display:none}html[data-theme=dark] .sp-brand .sp-brand-dark{display:block}
.sp-home-brand{background:none!important;border:0!important;padding:0!important;min-width:0!important}
.g20-surface .g20-brand{background:none!important;min-width:0;letter-spacing:normal}
.g20-brand .sp-brand{width:166px;height:44px}
.sp-placeholder{background:none!important;box-shadow:none!important;letter-spacing:normal!important;width:180px!important;height:48px!important;border-radius:0!important}
#admin-launch .sp-brand,.launch-brand .sp-brand{width:260px;height:76px}
.tow-logo{display:flex!important;align-items:center;gap:8px;color:inherit!important;background:none!important;font-size:12px!important}.tow-logo>small{font-size:9px}
.wordmark{flex-wrap:wrap}.wordmark>small{font-size:9px;letter-spacing:2px}
.presentation .app-logo{display:flex;flex-direction:column;align-items:flex-start;gap:0}.presentation .app-logo>small{font-size:8px;letter-spacing:2px;color:var(--muted);padding-left:48px}
html[data-theme=light]{color-scheme:light;--bg:#f6f7f9;--panel:#edf1f5;--card:#fff;--line:#dce3e9;--text:#19232e;--muted:#5c6d7d}
html[data-theme=dark]{color-scheme:dark;--bg:#10191f;--panel:#1b2a33;--card:#1b2a33;--line:#3a4b57;--text:#f1f5f8;--muted:#b5c3cf}
html[data-theme]{background:var(--bg);color:var(--text)}
/* Head-admin mobile UI, preserving all desktop-admin structure. */
html[data-theme=light] body:has(#admin-launch),html[data-theme=light] body:has(#admin-dialog){background:var(--bg);color:var(--text)}
html[data-theme=light] body:has(#admin-dialog) :is(#app,#nav,#admin-dialog,#admin-launch){background:var(--bg)!important;color:var(--text)!important}
html[data-theme=light] body:has(#admin-dialog) :is(.i-card,.a-panel,.a-stat,.i-product,.i-vehicle-list label,.i-options,.v-bubble,.a-donut>div){background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme=light] body:has(#admin-dialog) :is(.i-field,.a-field,.i-toggle,.i-chip,.i-filter-tabs button,.i-product,.menu-row,.v-chat-row,.i-editor-head button,.v-back,.i-order-actions .secondary){color:var(--text)!important}
html[data-theme=light] body:has(#admin-dialog) :is(input:not([type=checkbox]),select,textarea,.secondary,.i-price,.i-toggle,.i-chip,.i-filter,.i-search,.i-user,.v-back,.a-close){background:var(--panel)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme=light] body:has(#admin-dialog) :is(.subtle,.i-muted,.a-login>p,.i-brand small,.i-card small,.a-field,.i-card p,.a-panel p,.i-stats .i-card>div,.v-chat-row small,.i-order-item p,.i-order-note,.a-filter-label,.a-chart-data,.a-legend){color:var(--muted)!important}
html[data-theme=light] body:has(#admin-dialog) :is(.a-tabs button.active,.i-filter-tabs button.active,.primary,.i-primary){color:#fff!important;background:var(--red)!important}
html[data-theme=light] body:has(#admin-dialog) .i-publish{background:var(--bg)!important}
html[data-theme=light] body:has(#admin-dialog) :is(.i-card,.a-panel,.a-stat) :is(small,.subtle,p){color:var(--muted)!important}
html[data-theme=light] .presentation :is(.logout-box p,.muted-note,.sheet-lead,.review-status){color:var(--muted)!important}
/* Mechanic UI uses its existing palette variables; fill the hard-coded surface exceptions. */
html[data-theme=light] body:has(.presentation){background:var(--bg);color:var(--text)}
html[data-theme=light]:has(.presentation){--mint:#147348}
html[data-theme=light] .presentation :is(.online-row,.review-status,.search,.settings-row,.offline-note,.info-row,.level-card){background:var(--panel)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme=light] .presentation :is(.online-row strong,.online-row b,.metric-card span,.metric-card small,.profile-line p,.section-title .text-btn,.settings-row small){color:var(--muted)!important}
html[data-theme] body:has(.presentation){font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
html[data-theme=light] .presentation :is(.subheading,.empty,.phone p,.phone label,.phone small){color:var(--muted)}
html[data-theme=light] .presentation :is(.phone,.system-bar,.app-header,.app-nav,#app-nav,.home-indicator,.notification){background:var(--card)!important;color:var(--text)!important}
html[data-theme=light] .presentation :is(.card,.stat,.profile-card,.team-card,.call-card,.settings-card,.input,.chip,.category-chip,.question-card,.segmented,.switch-row){background:var(--panel)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme=light] body:has(.presentation) :is(#sheet,input,select,textarea){background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme=dark] body:has(.presentation){background:var(--bg);color:var(--text)}
/* Seller app: explicitly darken white surfaces, keeping colored status pills and photography intact. */
html[data-theme=dark] body:has(.auth),html[data-theme=dark] body:has(.content){background:var(--bg);color:var(--text)}
html[data-theme=dark] body:has(.auth) :is(button,input,select,textarea),html[data-theme=dark] body:has(.content) :is(.stat,.bottom-nav,.nav,button:not(.primary):not(.action-card),input,select,textarea,dialog){background:var(--panel);color:var(--text);border-color:var(--line)}
html[data-theme=dark] body:has(.auth) button.primary,html[data-theme=dark] body:has(.content) button.primary{background:var(--red);color:white}
/* Tow app: remove previous forced-light restriction. */
html[data-theme=dark]:has(#tow-app){background:var(--bg);color:var(--text);--tow-bg:#10191f;--tow-card:#1b2a33;--tow-ink:#f1f5f8;--tow-soft:#b5c3cf;--tow-line:#3a4b57;color-scheme:dark}
html[data-theme=dark] #tow-app :is(.tow-phone,.tow-header,.tow-main,.tow-nav,.tow-card,.tow-panel,.tow-section){background:var(--bg)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme=dark] #tow-app :is(button,.tow-person,.tow-vehicle,.tow-call,.tow-empty,.tow-status),html[data-theme=dark] #tow-dialog,html[data-theme=dark] #tow-dialog :is(input:not([type=checkbox]),textarea,select,button:not(.primary),.tow-link:not(.primary)){background:var(--panel)!important;color:var(--text)!important;border-color:var(--line)!important;color-scheme:dark}
html[data-theme=dark] #tow-app button.primary,html[data-theme=dark] #tow-dialog button.primary{background:var(--tow-red)!important;color:white!important}
html[data-theme=dark] #tow-app .tow-nav button[aria-current=page]{background:#4d252b!important;color:#ff8992!important}
html[data-theme=dark] #tow-dialog :is(label,small,.tow-muted-note){color:var(--muted)!important}
html[data-theme=dark] #tow-app :is(.tow-muted-note,.tow-subhead,.tow-version){color:var(--muted)!important}
html[data-theme=dark] #tow-app{color-scheme:dark;--tow-bg:var(--bg);--tow-card:var(--card);--tow-ink:var(--text);--tow-soft:var(--muted);--tow-line:var(--line);--tow-wash:var(--panel)}
html[data-theme=dark] #tow-app :is(input:not([type=checkbox]),textarea,select){background:var(--panel)!important;color:var(--text)!important;border-color:var(--line)!important}
@media(max-width:380px){.g20-brand .sp-brand{width:136px;height:42px}.sp-brand{width:155px;height:44px}}


/* V43: theme transition stays in-place; no route or data reload. */
.sp-rejections{background:#fff1f0;border:1px solid #fac3bd;border-radius:16px;padding:16px;margin:15px 0;color:#a02525}.sp-rejections h3{margin:0 0 10px}.sp-rejections article+article{border-top:1px solid #fac3bd;padding-top:10px;margin-top:10px}.sp-rejections p{margin:7px 0;white-space:pre-wrap;overflow-wrap:anywhere}html[data-theme=dark] .sp-rejections{background:#322021;border-color:#6c343b;color:#ffb8be}
.sp-theme-instant *,.sp-theme-instant *::before,.sp-theme-instant *::after,.theme-switch *{transition:none!important;animation:none!important}.sp-remember{display:flex!important;align-items:center;gap:11px;padding:10px 0;cursor:pointer}.sp-remember input{width:20px!important;height:20px!important;flex:0 0 20px;accent-color:#f62f41}.sp-remember span{display:block}.sp-remember small{display:block;font-size:12px;opacity:.7;margin-top:3px;font-weight:400}
/* V42: explicit app surfaces in both palettes, not image/map inversion. */
.sp-theme-button{flex:none!important;min-width:40px!important;width:40px!important;height:40px!important;min-height:40px!important;padding:0!important;display:grid!important;place-items:center!important;border:1px solid var(--line)!important;border-radius:12px!important;background:var(--panel)!important;color:var(--text)!important;font:24px system-ui!important;cursor:pointer;margin-left:8px}
.auth>.sp-theme-button{margin-left:auto}.sp-theme-button:focus-visible{outline:3px solid #ff746d;outline-offset:2px}
.sp-theme-dialog{width:min(400px,calc(100vw - 24px));max-height:calc(100dvh - 40px);border:1px solid var(--line)!important;border-radius:20px!important;background:var(--card)!important;color:var(--text)!important;padding:20px!important;box-sizing:border-box}.sp-theme-dialog::backdrop{background:#0009}.sp-theme-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px}.sp-theme-dialog h2{font-size:19px;margin:0}.sp-theme-dialog p{color:var(--muted);font-size:12px;margin:12px 0;line-height:1.6}.sp-theme-dialog button{cursor:pointer;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:12px;min-height:44px;padding:10px;font:inherit}.sp-theme-dialog header button{min-width:44px}.sp-theme-dialog>div{display:grid;gap:9px}.sp-theme-dialog button[aria-pressed=true]{border-color:#ed3543;color:#ed3543}
html[data-theme=dark] body:has(.content) :is(.product,.empty,.card:not(.hero),.search,.sheet-head,.bubble,.biz-features,.biz-subscription){background:var(--card);color:var(--text);border-color:var(--line)}
html[data-theme=dark] body:has(.content) :is(.business-entry,.photo-picker){background:var(--panel);color:var(--text);border-color:var(--line)}
html[data-theme=dark] body:has(.content) :is(.business-entry small,.business-entry em,.biz-paywall p,.biz-price small,.biz-subscription small,.biz-caption,.biz-stock p,.chart-desc,.definition span){color:var(--muted)}
html[data-theme=dark] body:has(.content) .notice{background:#29392d;color:#d8e6da;border-color:#44624c}
html[data-theme=dark] body:has(.content) :is(.notice.warn,.offline){background:#453823;color:#ffe0a2;border-color:#7f643a}
html[data-theme=dark] body:has(.content) .bubble.mine{background:#45272e;color:#ffe6ea}
html[data-theme=dark] body:has(.content) .chips button.active{background:#435a70;color:#fff;border-color:#657b91}
html[data-theme=dark] body:has(.content) .biz-actions button{background:var(--panel);color:var(--text);border-color:var(--line)}
/* Usta light mode previously retained dark cards/text in forms and community. */
html[data-theme=light] .presentation :is(.question-card,.reply-card,.service-checklist,.metric-icon,.mini-cta,.secondary,.category-chip,.segmented button,.pills button,.chip,.badge,.settings-row,.field input,.field textarea,.field select){background:var(--panel)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme=light] .presentation :is(.detail-body,.reply-card>p,.review-small p,.question-card p,.mini-cta p,.call-card p,.online-row p,.card small,.progress-label,.settings-row small,.field,.form-hint){color:var(--muted)!important}
html[data-theme=light] .presentation :is(.primary,.intro-primary){background:var(--accent,#ed3543)!important;color:#fff!important}
html[data-theme=dark] .presentation :is(.intro h1,.guide h2,.guide-item h3){color:var(--text)}
/* Head admin: readable light charts, shops and balances. */
html[data-theme=light] body:has(#admin-dialog) :is(.a-two span,.a-shop-stats span,.a-shop-stats strong,.a-line small,.a-bar-group>span,.a-note,.a-range,.a-shop h2 small,.a-login>small){color:var(--text)!important}
html[data-theme=light] body:has(#admin-dialog) :is(.a-tabs,.a-shop h2 small,.a-range select){background:var(--panel)!important;color:var(--text)!important}
/* Keep tow semantic status text readable on its dark card backgrounds. */
html[data-theme=dark] #tow-app :is(.tow-call small,.tow-card p,.tow-panel p,.tow-status p,.tow-person small,.tow-vehicle small){color:var(--muted)!important}
html[data-theme=dark] #tow-app :is(.tow-good,.tow-badge){background:#193d2d;color:#a5e8c3;border-color:#41664f}
.sp-pickup{padding:16px;margin:12px 0;border:1px solid var(--line,#dce3e9);border-radius:15px;background:var(--card,#fff);color:var(--text,#19232e);text-align:left;overflow-wrap:anywhere}.sp-pickup h3{font-size:15px;margin:0 0 10px}.sp-pickup article+article{margin-top:12px;padding-top:12px;border-top:1px solid var(--line,#dce3e9)}.sp-pickup strong{display:block;font-size:14px}.sp-pickup p,.sp-pickup small{font-size:12px;line-height:1.6;margin:5px 0;color:var(--muted,#5c6d7d)}.sp-pickup small{display:block}.sp-pickup a{display:inline-flex;align-items:center;min-height:44px;color:var(--text,#19232e);border:1px solid var(--line,#dce3e9);border-radius:10px;padding:8px 12px;margin-top:9px;text-decoration:none;font-size:12px;font-weight:650}
html[data-theme=light] body:has(.content),html[data-theme=light] body:has(.auth){--red:#ba2235}
html[data-theme=dark] body:has(.content),html[data-theme=dark] body:has(.auth){--red:#ff8a97}
html[data-theme] body:has(.content) :is(button.primary,.action-card),html[data-theme] body:has(.auth) button.primary{background:#ba2235;border-color:#ba2235;color:#fff}
html[data-theme] body:has(.content) .action-card small{color:#fff}
html[data-theme] body:has(.content) .biz-symbol{color:#92390f}
html[data-theme] body:has(.content) .pill.orange{color:#83510d}
html[data-theme=dark] body:has(.content) :is(.form-step span,.avatar){background:var(--panel);color:#ffc3cb}
html[data-theme=light] body:has(.content) :is(.biz-back,.biz-price small){color:#566575}
html[data-theme=dark] .sp-theme-dialog button[aria-pressed=true]{color:#ff8a97}
html[data-theme=light] .sp-theme-dialog button[aria-pressed=true]{color:#ba2235}
html[data-theme=light] body.g20-app{--muted:#566575;--green:#146b43}
html[data-theme=light] body.g20-app .timeline li.current b{color:#146b43}
html[data-theme=light] .presentation .stars{color:#876000}
html[data-theme=dark] #tow-app .tow-gps[data-ready=false],html[data-theme=dark] #tow-dialog .map-warning{color:#ffd195}
html[data-theme=dark] #tow-app .tow-gps[data-ready=true]{color:#a5e8c3}
html[data-theme] body:has(#admin-dialog) :is(.primary.primary,.i-primary.i-primary){background:#ba2235!important;color:#fff!important}
/* Readable secondary text and actions in the shared customer storefront. */
html[data-theme=light] body.g20-app{--g20-muted:#566575;--g20-red:#ba2235;--g20-green:#146b43}
html[data-theme=dark] body.g20-app{--g20-red:#ff8a97}
html[data-theme] body.g20-app :is(.g20-primary,.primary,.g32-service-tabs button[aria-pressed=true],.service-chips button.active){background:#ba2235!important;color:#fff!important}
html[data-theme=dark] body.g20-app .g20-condition{background:#fff4d9!important;color:#34383d!important}
html[data-theme=light] body.g20-app .v14-brand-logo{color:#566575!important}
html[data-theme=light] body.g20-app .v14-latest .badge{color:#165b8b!important;border-color:#165b8b}
html[data-theme=dark] .leaflet-control-attribution{background:#1b2a33!important;color:#d7e0e8!important}
html[data-theme=dark] .leaflet-control-attribution a{color:#a5e8c3!important}
html[data-theme=light] .presentation .segments button{color:#566575!important}
html[data-theme] .presentation .calls14-tabs button.active{background:#ba2235!important;color:#fff!important}
html[data-theme=dark] .presentation .version{color:var(--muted)}
/* Explicit active states avoid white-on-bright-red and dark-on-dark tabs. */
html[data-theme] body:has(#admin-dialog) #app :is(.primary,.i-primary,.a-tabs button.active,.i-filter-tabs button.active){background:#ba2235!important;color:#fff!important}
html[data-theme=light] body:has(#admin-dialog) :is(.a-tabs button:not(.active),.i-filter-tabs button:not(.active)){background:var(--panel)!important;color:var(--text)!important}
html[data-theme=light] body:has(#admin-dialog) .a-shop em{background:#fff0f2!important;color:#a71f32!important}
html[data-theme=light] body:has(#admin-dialog) .a-info{background:#e6f1ff!important;color:#215880!important}
html[data-theme=light] body:has(#admin-dialog) .a-status-completed{background:#e2f4e9!important;color:#17613c!important}
html[data-theme=light] body:has(#admin-dialog) .a-status-new{background:#fff1d7!important;color:#80520b!important}
html[data-theme=light] body:has(#admin-dialog) :is(.a-status-confirmed,.a-status-preparing){background:#e6f1ff!important;color:#215880!important}
html[data-theme=light] body:has(#admin-dialog) :is(.a-status-shipped,.a-status-ready){background:#f0e7ff!important;color:#634191!important}
html[data-theme=light] body:has(#admin-dialog) .a-status-cancelled{background:#fff0f2!important;color:#a71f32!important}
@media(max-width:359px){.sp-theme-button{min-width:36px!important;width:36px!important;margin-left:4px}body:has(#admin-dialog) #header .sp-brand,.presentation .app-logo .sp-brand{width:140px!important}.top .top-left{min-width:0}.top strong{font-size:17px}.top small{font-size:11px}.top{gap:5px}}
