/* Explicit appearance palettes retain section hierarchy and unaltered photography. */
html[data-theme="light"]{--bg:#f8f8f5;--surface:#efefeb;--raised:#e5e5e0;--text:#19191b;--muted:#53535b;--subtle:#585861;--line:#74747c;--paper:#fff;--ink:#19191b;--paper-muted:#53535b;--paper-line:#74747c;--white:#fff;--background:#f8f8f5;--foreground:#19191b;--card:#efefeb;--card-foreground:#19191b;--popover:#fff;--popover-foreground:#19191b;--muted-foreground:#53535b;--secondary:#e5e5e0;--secondary-foreground:#19191b;--border:#74747c;--input:#74747c}
html[data-theme="dark"]{--bg:#111112;--surface:#1c1c1f;--raised:#27272b;--text:#f5f5f3;--muted:#c0c0c7;--subtle:#b3b3bc;--line:#85858d;--paper:#1c1c1f;--ink:#f5f5f3;--paper-muted:#c0c0c7;--paper-line:#85858d;--white:#242428;--background:#111112;--foreground:#f5f5f3;--card:#242428;--card-foreground:#f5f5f3;--popover:#242428;--popover-foreground:#f5f5f3;--muted-foreground:#c0c0c7;--secondary:#27272b;--secondary-foreground:#f5f5f3;--border:#85858d;--input:#85858d;--green:#233d31;--green-ink:#d7f2df}
.appearance-control{display:inline-flex;align-items:center;flex-wrap:wrap;gap:8px;font:inherit;color:inherit}.appearance-control select{min-height:44px;max-width:100%;font:inherit;padding:8px 28px 8px 10px;border:1px solid currentColor;border-radius:6px;background:var(--surface,#232325);color:var(--text,#f5f5f3)}
html[data-theme] body{background:var(--bg);color:var(--text)}
html[data-theme] :is(.skip-link,.ss-skip,.skip){background:var(--text);color:var(--bg);z-index:100}
html[data-theme] .skip:focus{position:relative;display:block;top:auto;left:auto;min-height:44px;padding:12px 24px;outline-offset:-4px;outline-color:var(--bg)}
html[data-theme] :is(.footer,.portfolio-footer,.modal,.estimate-summary,.estimator,.estimate-details,.estimate-addons,.option,.browser-caption,.browser-chrome,.mobile-nav,.language-note,.ss-storage-notice){background:var(--surface);color:var(--text)}
html[data-theme] :is(.site-header,.topbar,.site-footer,.footer,.modal,.estimate-summary,.price-card,.estimator,.estimate-details,.option,.browser-caption,.browser-chrome,.mobile-nav,.contact-section,.language-note,.ss-storage-notice) :is(p,a,span,strong,h1,h2,h3,h4,label,legend,output,dt,dd,small,li){color:inherit}
html[data-theme] :is(input,textarea,select){color:var(--text);background-color:var(--bg);border-color:var(--line)}
html[data-theme] :is(.button,.header-cta,.language [aria-current="page"],.language [aria-pressed="true"]){background:var(--text);color:var(--bg);border-color:var(--text)}
html[data-theme] .button :is(span,svg){color:inherit}
html[data-theme] .button.outline{background:transparent;color:var(--text)}
html[data-theme] :is(.ss-support-links,.footer-bottom,.site-footer,.footer){color:var(--text)}
html[data-theme] :focus-visible{outline:3px solid currentColor;outline-offset:4px}
/* Keep explicit page colours in the same palette as their inherited surfaces. */
html[data-theme] :is(section,.policy-body,.policy-nav,.contact-card,.next-card,.mentor-review,.evidence-panel,.academic-card,.future-note,.business-card,.leadership-feature,.research-copy,.snapshot,.snapshot-card){background-color:var(--bg)}
html[data-theme] :is(.light-section,.card,.next-card,.contact-card,.estimate-blueprint){background-color:var(--surface)}
html[data-theme] :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,legend,output,small,a,button,summary,blockquote,figcaption,th,td){color:var(--text)}
html[data-theme] :is(.soft-text,.hero-tagline,.eyebrow,.small-meta,.plain-link,.policy-body p,.policy-nav a,.pricing-note,.payment-note){color:var(--muted)}
html[data-theme] .showcase-switcher button[aria-pressed="true"]{background:var(--text);color:var(--bg)}
html[data-theme] .showcase-switcher button span{color:inherit}
html[data-theme] :is(.solid-button,.button,.header-cta){background:var(--text);color:var(--bg)}
html[data-theme] :is(.solid-button,.button,.header-cta) :is(span,svg){color:inherit}
html[data-theme] .language :is(a,button){color:var(--text)}
html[data-theme] .language :is([aria-pressed="true"],[aria-current="page"]){color:var(--bg)}
html[data-theme] .ss-support-links :is(a,button,span){color:var(--text)}
html[data-theme] :is(span,strong,em,b,time){color:inherit}
html[data-theme] :is(.partner-contribution,.media-results,.toc,.toc a,.light-button){background-color:var(--surface);color:var(--text)}
html[data-theme] .ss-header :is(a,span,button){color:var(--text)}
html[data-theme] .ss-header .language [aria-current="page"]{color:var(--bg)}
html[data-theme] .hero :is(h1,p,a){color:var(--text)}
html[data-theme] .hero :is(.eyebrow,.hero-tagline,.hero-description){color:var(--muted)}
html[data-theme] :is(.target-row,.portrait-topline,.digital-number,.experience-meta){color:var(--text)}
html[data-theme] .story-body>p{color:var(--text)}
html[data-theme] :is(.solid-button,.light-button){background:var(--text);color:var(--bg)}
html[data-theme] :is(.solid-button,.light-button) span{color:inherit}
html[data-theme] .hero-zone{background:var(--bg);color:var(--text);border-bottom:1px solid var(--line)}
/* Layout surfaces belong to the full-width band, never its constrained wrapper. */
html[data-theme] :is(.site-header,.ss-header,.topbar){background:var(--bg);color:var(--text);border-bottom:1px solid var(--line)}
html[data-theme] :is(.hero,.hero-section,.faq-section,footer.site-footer,.case-footer){background:transparent}
html[data-theme] :is(.light-section,.pricing-section,.about-section){background:var(--surface)}
html[data-theme] .contact-section:not(.container){--bg:inherit;background:var(--surface);border-block:1px solid var(--line)}
html[data-theme] .contact-section.container{background:transparent}
html[data-theme] .price-card{--bg:inherit;background:var(--bg);color:var(--text);border-color:var(--line)}
html[data-theme] .price-card.featured{border:2px solid var(--text)}
html[data-theme] .price-card.featured .plan-number{align-self:flex-start;padding:4px 10px;border-radius:4px;background:var(--text);color:var(--bg)}
html[data-theme] .soft-text{color:var(--muted)}
html[data-theme] #page-title span{color:var(--text);opacity:1}
html[data-theme] .confirmed.badge{background:var(--raised);color:var(--text)}
html[data-theme] .portrait-caption{background:var(--surface);color:var(--text)}
html[data-theme] .media-results p{color:var(--text)}
html[data-theme] .contact-actions .solid-button{background:var(--text);color:var(--bg)}
html[data-theme] .contact-actions .solid-button span{color:var(--bg)}
html[data-theme] :focus-visible{outline-color:var(--text)}
html[data-theme] .context-strip{background:transparent;color:var(--text)}
html[data-theme] :is(.snapshot-meta,.context-strip){border-color:var(--line)}
html[data-theme] .progress-track{background:var(--raised)}
html[data-theme] .progress-track>span{background:var(--green-ink)}

/* One treatment for every brand mark, independent of its page's old palette. */
html[data-theme="light"] :is(.brand-s,.brand-logo,.ss-brand-s,.brand svg,.language-mark){filter:brightness(0);mix-blend-mode:normal}
html[data-theme="dark"] :is(.brand-s,.brand-logo,.ss-brand-s,.brand svg,.language-mark){filter:brightness(0) invert(1);mix-blend-mode:normal}

/* Photography overlays have their own stable, opaque contrast context. */
html[data-theme] .image-action{background:#161617;color:#f5f5f3;border:1px solid #85858d}
html[data-theme] .image-action :is(span,svg){color:#f5f5f3}
html[data-theme] .portrait-label{background:rgba(17,17,18,.84);color:#f5f5f3;backdrop-filter:blur(8px)}
html[data-theme] .portrait-label strong{color:#f5f5f3}
html[data-theme] .portrait-label span{color:#d4d4d8}
html[data-theme] :is(.request-context,.close-modal){background:var(--raised);color:var(--text);border:1px solid var(--line)}
html[data-theme] .close-modal :is(span,svg){color:inherit}
html[data-theme] :is(.progress-card,.preview-bar,.current-stage .stage-status,.honor-feature,.club-list,.contents-menu nav,.project-open){background:var(--surface);color:var(--text);border-color:var(--line)}
html[data-theme] :is(.badge,.pill,.tags span,.stage-status,.contents-menu summary,.ss-language,.language,.ss-mobile-nav a,.detail-features li){border-color:var(--line)}
html[data-theme] :is(.ss-header,.light-section,.contact-section){color-scheme:inherit}
html[data-theme] .ss-header :is(.ss-button,.ss-header-cta){background:var(--text);color:var(--bg);border-color:var(--text)}
html[data-theme] .ss-header :is(.ss-button,.ss-header-cta) :is(span,svg){color:inherit}
html[data-theme] .ss-header .ss-language :is(a,button){background:transparent;color:var(--text)}
html[data-theme] .ss-header .ss-language :is([aria-current="page"],[aria-pressed="true"]){background:var(--text);color:var(--bg)}
html[data-theme] .ss-header .ss-language :is([aria-current="page"],[aria-pressed="true"]) :is(span,svg){color:inherit}
html[data-theme] :is(.ss-header,.topbar) :focus-visible{outline-color:var(--text)}
html[data-theme] .project-open :is(span,svg){color:inherit}
html[data-theme] :is(.button:disabled,#request-form button:disabled,.data-tool button:disabled){opacity:1;background:var(--raised);color:var(--muted);border:1px solid var(--line);cursor:not-allowed;transform:none}
html[data-theme] :is(.button:disabled,#request-form button:disabled,.data-tool button:disabled) :is(span,svg){color:inherit}
html[data-theme="light"]{--danger:#9c231b;--select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2319191b' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E")}
html[data-theme="dark"]{--danger:#ffb6ac;--select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23f5f5f3' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E")}
html[data-theme] :is(.form-error,.field-error){color:var(--danger)}
html[data-theme] :is([aria-invalid="true"],.error-summary){border-color:var(--danger)}
html[data-theme] input::placeholder,html[data-theme] textarea::placeholder{color:var(--muted);opacity:1}
html[data-theme] select{appearance:none;-webkit-appearance:none;padding-right:38px;background-image:var(--select-chevron);background-position:right 12px center;background-size:12px 8px;background-repeat:no-repeat}

.appearance-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:10px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}
.appearance-toggle svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
html[data-theme] .appearance-toggle{background:var(--surface);color:var(--text);border-color:var(--line)}
:is(#mobile-nav,#ss-mobile-nav)>.appearance-control{margin-block:16px 0}
#mobile-nav>.appearance-control{margin-inline:20px}
@media(hover:hover){
  html[data-theme] :is(.close-modal,.appearance-toggle):hover{background:var(--text);color:var(--bg);border-color:var(--text)}
  html[data-theme] .ss-header :is(.ss-button,.ss-header-cta):hover{background:var(--muted);color:var(--bg);border-color:var(--muted)}
  html[data-theme] .ss-header .ss-language :is(a,button):hover{background:var(--raised);color:var(--text)}
  html[data-theme] .ss-header .ss-language :is([aria-current="page"],[aria-pressed="true"]):hover{background:var(--text);color:var(--bg)}
  html[data-theme] .button.outline:hover{background:var(--raised);color:var(--text);border-color:var(--line)}
}
@media(max-width:880px){:is(.nav-actions,.ss-nav-actions)>.appearance-toggle{display:none}}
@media(max-width:620px){.case-nav,.case-nav-links{gap:8px}.case-nav{flex-wrap:wrap}.case-nav-links{margin-left:auto}.appearance-control{max-width:100%}}
@media(forced-colors:active){html[data-theme] select{appearance:auto;background-image:none}.appearance-toggle{border:1px solid ButtonText}}

/* Editorial sections inherit the page canvas; expanded records use theme ink. */
html[data-theme] :is(.mentor-review,.evidence-panel,.academic-card,.portrait-topline){background:transparent}
html[data-theme] .academic-card{border-top-color:var(--line)}
html[data-theme] .delivery-metric progress,html[data-theme] .delivery-metric progress::-webkit-progress-bar{background:var(--raised)}
html[data-theme] .delivery-metric progress::-webkit-progress-value{background:var(--green-ink)}
html[data-theme] .delivery-metric progress::-moz-progress-bar{background:var(--green-ink)}
html[data-theme] :is(.honor-feature>div>p,.credentials-grid article>p:not(.eyebrow),.credential-type,.credentials-footer>p){color:var(--muted)}
