/* Final shared color contract: every functional surface has an explicit text pair. */
html[data-theme=light]{--ld-bg:#ffffff;--ld-surface:#ffffff;--ld-soft:#edf2f3;--ld-text:#292b2d;--ld-muted:#4b5055;--ld-border:#748087;--ld-focus:#775000}
html[data-theme=dark]{--ld-bg:#101215;--ld-surface:#1c2025;--ld-soft:#292f36;--ld-text:#f2f3f5;--ld-muted:#cbd0d7;--ld-border:#78828e;--ld-focus:#f4e7a9;--paper:#101215;--ink:#f2f3f5;--muted:#cbd0d7;--line:#65717d;--white:#1c2025;--pine:#f2f3f5}
html[data-theme] body{background:var(--ld-bg)!important;color:var(--ld-text)!important}
html[data-theme=dark] body :is(h1,h2,h3,h4,h5,h6,p,small,label,legend,li,dt,dd,summary,th,td,pre,figcaption,.eyebrow,.muted,.note,.help,.metric-label){color:var(--ld-text)!important;opacity:1}
html[data-theme] body :is(input,select,textarea){background:var(--ld-surface)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important;caret-color:var(--ld-text)}
html[data-theme] body :is(input,textarea)::placeholder{color:var(--ld-muted)!important;opacity:1}
html[data-theme] body :is(input,select,textarea):disabled{opacity:.65!important}
html[data-theme] :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid var(--ld-focus)!important;outline-offset:4px}
html[data-theme] body :is(button,.button):disabled{opacity:.55!important}
html[data-theme=dark] body :is(.card,.panel,.program,.stat,.program-card,.offer-card,.nutrition-grid article,.login-form,.sidebar,.contact,.empty,dialog,.pricing-card,.price-card){background:var(--ld-surface)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important}
html[data-theme=dark] body :is(.secondary,.subnav button,.note,.exercise-row,.message,.calendar-date,.tag,.topbar,.form-actions,.dialog-head){background:var(--ld-soft)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important}
html[data-theme=dark] body :is(a,button,.button){color:var(--ld-text)}
html[data-theme=dark] body:has(.hero) :is(.section,.closing,footer){background:var(--ld-bg)!important;color:var(--ld-text)!important}
html[data-theme=dark] body:has(.hero) .coaching{background:var(--ld-surface)!important;color:var(--ld-text)!important}
html[data-theme=dark] body:has(.hero) .coaching :is(h1,h2,h3,p,span,strong,b,i,em,small,.eyebrow,.detail-row){color:var(--ld-text)!important}
html[data-theme=dark] body:has(.hero) .closing :is(h2,em,.eyebrow),html[data-theme=dark] body:has(.hero) footer :is(span,a,.brand-type){color:var(--ld-text)!important}
html[data-theme] body:has(.hero) .hero{background:#243b42!important}
html[data-theme=dark] body:has(.hero) .hero :is(h1,h1 em,p,.eyebrow,.hero-foot span){color:#ffffff!important}
html[data-theme=light] body:has(.hero) .hero{background:#d9ecec!important}
html[data-theme=light] body:has(.hero) .hero :is(h1,h1 em,p,.eyebrow,.hero-foot span){color:#292b2d!important}
html[data-theme] .hero-image figcaption{background:#1c2025!important;color:#ffffff!important;opacity:1!important;padding:8px 10px;border-radius:8px}
/* Pastel cards, artwork and device previews stay light in either mode. */
html[data-theme] body :is(.ribbon,.device-stage,.device,.app-brand-preview,.posing-art,.hero-panel,.login-story,.health-labs-card){color:#292b2d!important}
html[data-theme] body :is(.ribbon,.device-stage,.device,.app-brand-preview,.posing-art,.hero-panel,.login-story,.health-labs-card) :is(h1,h2,h3,h4,p,small,span,em,b,strong,label,li,a,.art-caption){color:#292b2d!important}
html[data-theme] body .device{background:#fff8fb!important}
html[data-theme] body .device-nav b{color:#292b2d!important;font-weight:800;text-decoration:underline;text-underline-offset:3px}
html[data-theme] body :is(.hero-panel,.login-story,.health-labs-card){background:#dceff0!important}
html[data-theme] body .coming{background:var(--ld-soft)!important;color:var(--ld-text)!important;padding:6px 9px;border-radius:6px}
/* Contrast is set on both the button and its icon/arrow text. */
html[data-theme] body :is(.lime,.coral,.primary,.nav-cta,.badge,.pill){background:#e9948c!important;color:#292b2d!important;border-color:#9a5f58}
html[data-theme] body :is(.lime,.coral,.primary,.nav-cta,.badge,.pill) :is(span,small,b,strong,em){color:#292b2d!important}
html[data-theme] body :is(.button.dark,.dark.button){background:#292b2d!important;color:#ffffff!important;border-color:#c1c5ca}
html[data-theme] body :is(.button.dark,.dark.button) :is(span,small,b,strong,em){color:#ffffff!important}
html[data-theme=dark] body :is(.feature-switch button,.program-filters button,.program-arrows button,.sidebar nav button,.quiet){background:var(--ld-surface)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important}
html[data-theme] body :is(.feature-switch button.active,.program-filters button[aria-pressed=true],.sidebar nav button.active,.subnav button.active){background:#b8dfe2!important;color:#292b2d!important;border-color:#739399!important}
html[data-theme] body :is(.feature-switch button.active,.sidebar nav button.active) :is(span,b,small){color:#292b2d!important}
html[data-theme] body:has(.hero) header :is(.nav-trigger,.brand-type,.brand-type>span,.mobile-menu-toggle),html[data-theme] body:has(.hero) header .nav-panel :is(a,span){color:#292b2d!important}
html[data-theme] body:has(.hero) header .nav-panel{background:#ffffff!important;border-color:#6f7d83!important}
html[data-theme] .skip-link{background:#292b2d!important;color:#ffffff!important}
html[data-theme] .mobile-action{background:var(--ld-surface)!important;border-color:var(--ld-border)!important}
html[data-theme] .mobile-action a{background:#292b2d!important;color:#ffffff!important}
html[data-theme] .mobile-action button{background:#e9948c!important;color:#292b2d!important}
/* Plan configurator, client messages and Flexy keep coherent color pairs. */
html[data-theme] body .plan-review{background:var(--ld-soft)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important}
html[data-theme] body .plan-review :is(p,strong,span){color:var(--ld-text)!important}
html[data-theme] body .plan-choice :is(strong,small),html[data-theme] body :is(.plan-checkin-note,.plan-availability){color:var(--ld-text)!important}
html[data-theme] body .program-paths button:first-child{background:#292b2d!important;color:#ffffff!important}
html[data-theme] body .program-paths button+button{background:var(--ld-surface)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important}
html[data-theme] body .flexy-panel{background:var(--ld-surface)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important}
html[data-theme] body .flexy-head{background:#dceff0!important}
html[data-theme] body .flexy-head :is(strong,small,button){color:#292b2d!important}
html[data-theme] body #flexy-messages .flexy-bubble{background:var(--ld-soft)!important;color:var(--ld-text)!important}
html[data-theme] body #flexy-messages .flexy-bubble.user{background:#f5d4ce!important;color:#292b2d!important}
html[data-theme] body #flexy-messages .flexy-bubble a{color:inherit!important}
html[data-theme] body .flexy-panel .flexy-note{color:var(--ld-text)!important}
html[data-theme] body .flexy-compose{background:var(--ld-surface)!important;border-color:var(--ld-border)!important}
html[data-theme] body #flexy-chat :is(input,textarea){background:var(--ld-surface)!important;color:var(--ld-text)!important}
html[data-theme] body .flexy-prompts button{background:var(--ld-soft)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important}
html[data-theme] body #flexy-chat button{background:#e9948c!important;color:#292b2d!important}
html[data-theme] body .ld-chat .chat-bubble :is(p,.chat-byline){color:var(--ld-text)!important}
html[data-theme=light] body .ld-chat .chat-bubble.mine :is(p,.chat-byline){color:#292b2d!important}
html[data-theme] body .ld-chat .chat-tools button,html[data-theme] body .ld-chat .chat-file button{background:var(--ld-soft)!important;color:var(--ld-text)!important;border-color:var(--ld-border)!important}
html[data-theme] body .ld-chat .chat-tools .chat-send{background:#292b2d!important;color:#ffffff!important}
.flexy-cursor{position:fixed!important;left:0!important;top:0!important;width:34px!important;height:49px!important;margin:0!important;padding:0!important;pointer-events:none!important;z-index:2147483647!important;display:block;will-change:transform;filter:drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px #000b)}
.flexy-cursor[hidden]{display:none!important}.flexy-cursor img{display:block!important;width:32px!important;height:46px!important;object-fit:contain!important;max-width:none!important;margin:4px 0 0 6px!important;animation:none!important}.flexy-cursor:before{content:'';position:absolute;top:0;left:0;width:8px;height:8px;background:white;clip-path:polygon(0 0,100% 50%,50% 100%);filter:drop-shadow(0 0 1px #000)}.flexy-cursor.interactive img{filter:drop-shadow(0 0 2px white)}
@media(hover:hover) and (pointer:fine){html.flexy-cursor-active,html.flexy-cursor-active *{cursor:none!important}}
@media(hover:none),(pointer:coarse){.flexy-cursor{display:none!important}}
@media(forced-colors:active){.flexy-cursor{display:none!important}html.flexy-cursor-active,html.flexy-cursor-active *{cursor:auto!important}}
/* Remaining measured exceptions: pastel actions and nested light panels. */
html[data-theme=light] body .shop-page em,html[data-theme=light] body.shop-page em{color:#292b2d!important}
html[data-theme] body .flexy-launch span{background:#f3b3aa!important;color:#292b2d!important}
html[data-theme=dark] body:has(.hero) .coaching .duration,html[data-theme=dark] body:has(.hero) .coaching .duration :is(span,strong,small,b,i){color:#292b2d!important;background-color:#dceff0}
html[data-theme=dark] body:has(.hero) .coaching .button.lime :is(span,small,b,strong){color:#292b2d!important}
html[data-theme] body.shop-page :is(#cart-open,#cart-open span,#products .card button:not(.details)){background:#e9948c!important;color:#292b2d!important}
html[data-theme] #owner-login button,html[data-theme] #owner-login button span,html[data-theme] #app form:not(.chat-compose) button,html[data-theme] #identity button{color:#292b2d!important}
html[data-theme=dark] .shell :is(.form-actions button,.actions .button:not(.secondary):not(.quiet),form button:not(.secondary),.toolbar button:not(.secondary)){color:#292b2d!important}
html[data-theme=dark] .shell .ld-chat form button{color:var(--ld-text)!important}
html[data-theme=dark] .shell .ld-chat form .chat-send{color:#ffffff!important}
html[data-theme=light] body:has(.hero) .hero-image{opacity:1!important;background:#d9ecec!important}
html[data-theme=light] body:has(.hero) .hero-image :is(img,video){opacity:.12!important}
html[data-theme] body .hero-image figcaption{opacity:1!important;background:#1c2025!important;color:#ffffff!important}
/* Product-detail buttons added alongside the storefront integration. */
html[data-theme] #products button.details{background:#b8dfe2!important;color:#292b2d!important;border-color:#6c9d9f!important}
html[data-theme=light] body:has(#identity) :is(h1,h2,h3,nav a){color:#292b2d!important}
/* Member shopping controls and the supplement bag use explicit contrast pairs. */
html[data-theme] #member-shopping-bag button,html[data-theme] #bag .line button,html[data-theme] #bag .bag-actions button{background:#dceff0!important;color:#292b2d!important;min-height:44px}
html[data-theme] #member-shopping-bag a.button{background:#e9948c!important;color:#292b2d!important}
#bag .bag-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}#bag .bag-actions [hidden],#member-shopping-bag [hidden]{display:none!important}
