.theme-toggle,header .tools .theme-toggle{display:inline-grid;place-items:center;flex:none;width:44px;height:44px;padding:0;border:1px solid #b9bbc0;border-radius:50%;background:#fff;color:#202124;font:600 22px/1 Arial,sans-serif;cursor:pointer}
.theme-toggle:hover{background:#f1f1f1}
.theme-toggle:focus-visible{outline:3px solid #c92d35;outline-offset:3px}
html[data-theme="dark"]{color-scheme:dark;--paper:#161719;--ink:#ececef;--muted:#bbc0c6;--line:#47494e}
html[data-theme="dark"] body,html[data-theme="dark"] header,html[data-theme="dark"] footer{background:#161719;color:#f0f0f2;border-color:#484b50}
html[data-theme="dark"] .theme-toggle,html[data-theme="dark"] header .tools .theme-toggle{background:#303236;color:#f9f5e9;border-color:#676b70}
html[data-theme="dark"] .theme-toggle:hover{background:#414449}
html[data-theme="dark"] :is(.card,.card-body,.hero-offer,.guide-grid a,#buying-guides>div a,.student-support,.student-software,.faq-contact,.catalog-list a,.product>div:last-child,.photo,.buying-steps,.catalog-tools,.recent-card,.collection-nav a,#quality .quality-items article,#ks-contact .kc-panel,dialog){background:#26282c;color:#f0f0f2;border-color:#4a4d53}
html[data-theme="dark"] :is(#buyingGuide,#quality,.finder,.hero-art,.filterbar,.student-support,.catalog-tools,.buying-steps){background:#202226;color:#f0f0f2;border-color:#494c51}
html[data-theme="dark"] :is(.card,.card-body,.hero-offer,.faq-contact,.catalog-list a,.product>div:last-child,.buying-steps,.catalog-tools,dialog,.student-support,.student-software,#quality,.ks-footer-help) :is(h1,h2,h3,h4,strong,label,summary,span,p,small,dt,dd){color:inherit}
html[data-theme="dark"] :is(.specs,.muted,.card .variant-summary,.hero-copy>p,.hero-foot a,.decision-facts span,.buying-steps p,.catalog-list span,footer p,footer a:not(.logo),footer>span,.guide-rows p){color:#c0c4cb}
html[data-theme="dark"] :is(input,select,textarea){background:#303238;color:#f4f4f5;border-color:#686c73}
html[data-theme="dark"] :is(.search,.filterbar select,.catalog-tools input,.catalog-tools select){background:#303238;color:#f4f4f5;border-color:#686c73}
html[data-theme="dark"] :is(button.outline,.outline,.hero .hero-copy .actions .text-link,.catalog-tools button,.ask-device,.ks-social a){background:#303238;color:#f4f4f5;border-color:#686c73}
html[data-theme="dark"] :is(.hero-tabs,.hero .hero-offer-price button,.student-support>a){background:#3a3c42;color:#fff}
html[data-theme="dark"] :is(.hero-tabs button:not(.active),#ks-contact a){color:#202124}
html[data-theme="dark"] :is(.hero .hero-copy h1,.hero-copy h1,#quality h2){color:#f5f5f6}
html[data-theme="dark"] :is(.product-art,.hero .hero-art){background:#eeeeef;color:#202124}
html[data-theme="dark"] .hero .hero-offer{background:#26282c;color:#f0f0f2}
html[data-theme="dark"] :is(.badge,.favorite,.product-art button){color:#202124}
html[data-theme="dark"] :is(.button,.card-actions>button,.hero .hero-copy .actions .button,#ks-contact button){color:#fff}
html[data-theme="dark"] .business{color:#f1f1f1}
html[data-theme="dark"] .ks-footer-help{color:#ededee;border-color:#484b50}
html[data-theme="dark"] .ks-footer-help p{color:#d3d5d9}
html[data-theme="dark"] :is(#buyingGuide summary::after,.student-software summary::after){color:#202124}

/* Storefront masthead */
header:has(.tools), #categoryNav {
  --nav-ink: #252629;
  --nav-surface: #fff;
  --nav-soft: #f4f4f5;
  --nav-line: #dedee2;
  --nav-accent: #a8222b;
  --nav-tint: #fbe9ea;
  background: var(--nav-surface);
  color: var(--nav-ink);
}
html[data-theme=dark] :is(header:has(.tools), #categoryNav) {
  --nav-ink: #f0eff1;
  --nav-surface: #1c1d20;
  --nav-soft: #292b30;
  --nav-line: #44464c;
  --nav-accent: #ffabb0;
  --nav-tint: #48282e;
  background: var(--nav-surface);
}
header:has(.tools) .logo .store-domain {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 10px; letter-spacing: 0; margin-top: 3px;
}
header:has(.tools) .store-domain span + span {border-inline-start: 1px solid var(--nav-line); padding-inline-start: 6px}
header:has(.tools) nav {gap: 4px}
header:has(.tools) nav a, #categoryNav :is(button,a) {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 13px; min-height: 44px; border: 0; border-radius: 10px;
  font-size: 13px; font-weight: 650; color: var(--nav-ink); text-decoration: none;
}
header:has(.tools) nav a:hover, #categoryNav :is(button,a):hover {background: var(--nav-soft); color: var(--nav-ink)}
#categoryNav {gap: 3px; height: auto; padding-block: 4px; border-color: var(--nav-line)}
#categoryNav a {margin-inline-start: 0; flex-shrink: 0}
#categoryNav a:first-of-type {margin-inline-start: auto}
#categoryNav button.active, #categoryNav button[aria-current=true] {background: var(--nav-tint); color: var(--nav-accent)}
header .tools {gap: 5px; align-items: center}
header .tools :is(.theme-toggle,#libraryButton,#language,#cartBtn) {
  box-sizing: border-box; border: 1px solid var(--nav-line); border-radius: 999px;
  background: var(--nav-surface); color: var(--nav-ink); min-height: 44px; cursor: pointer;
}
header .tools #language {padding-inline-start: 9px}
header .tools #cartBtn {display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; font-weight: 750; background: #ad222d; color: white; border-color: transparent}
header .tools #cartBtn:hover {background: #941e27}
header .tools #cartCount {display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 3px; border-radius: 99px; background: white; color: #96202a}
header .tools :is(.theme-toggle,#language,#libraryButton):hover {background: var(--nav-soft)}
@media(max-width:960px) {
  header:has(.tools) {height: auto; flex-wrap: wrap; gap: 8px; padding-block: 10px}
  #categoryNav {overflow-x: auto; padding-inline: 12px}
}
@media(max-width:560px) {
  header:has(.tools) {display: grid; grid-template-columns: minmax(0,1fr); padding: 10px 14px 8px}
  header:has(.tools) .tools {display: flex; width: 100%; margin: 0; justify-content: flex-start}
  header .tools #cartBtn {margin-inline-start: auto}
  header .tools #libraryButton {padding-inline: 9px}
  #categoryNav :is(button,a) {padding-inline: 12px}
}

/* Pair foreground and surface explicitly so editorial panels and controls
   remain readable when components bring their own light-theme backgrounds. */
html[data-theme=dark] {
  --night-panel: #24262b;
  --night-raised: #33363c;
  --night-text: #f1f2f4;
  --night-secondary: #c6cad1;
  --night-border: #555a64;
}
html[data-theme=dark] :is(.study-editorial,.study-visual,.finance-section,.brand-row,.checkout-v6,.checkout-panel) {
  background-color: var(--night-panel); color: var(--night-text);
}
html[data-theme=dark] :is(.study-feature,.finance-partner,.variant-link.variant-summary,.faq-contact-actions a,details,.view-switch,.count-pill,.payment-method,.delivery-disclosure,.product-facts span) {
  background-color: var(--night-raised); color: var(--night-text); border-color: var(--night-border);
}
html[data-theme=dark] :is(.study-editorial,.finance-intro,.finance-partner,.study-feature) :is(h2,h3,p,a,small,strong,span,button.text-button),
html[data-theme=dark] :is(#brandTrust a,#quality .text-link,.finder label,.extra-filters label,.brand-row .brand-word,.hero-tabs button:not(.active),.view-switch button:not(.active),details summary) {
  color: var(--night-text);
}
html[data-theme=dark] :is(.store-domain span,.path-tax,.study-paths p,.path-spec,.card-body .price-note,.catalog .source-note,.mac-heading p,.faq li span,footer small,footer small a) {
  color: var(--night-secondary);
}
html[data-theme=dark] :is(.button.light,.skip-link) {background: #f3f4f6; color: #202124}
html[data-theme=dark] .service-card :is(h3,p) {color: #202124}
html[data-theme=dark] :is(.study-feature b,.study-feature .price) {color: var(--night-text)}
html[data-theme=dark] :is(input,textarea)::placeholder {color: #b9bec7; opacity: 1}
html[data-theme=dark] .hero-tabs button[aria-selected=true] {background:#f3f4f6; color:#202124}
html[data-theme=dark] .study-feature button,
html[data-theme=dark] #catalog #extraFilters label {color: var(--night-text)}
html[data-theme=dark] #business .button.light,
html[data-theme=dark] .mac-art button.button.light {color: #202124}
html[data-theme=dark] :is(.finance-disclosure,#warranty small,#warranty small a,#catalogCount,.photo p) {color: var(--night-secondary)}
html[data-theme=dark] body:has(link[href*="blog.css"]) a,
html[data-theme=dark]:has(link[href*="blog.css"]) :is(header,article,main) a {color: #ffb5bb}
html[data-theme=dark] .hero .hero-tabs button[aria-pressed=true],
html[data-theme=dark] #mac .mac-art button.button.light,
html[data-theme=dark] .mac-art button.button.light {background: #f3f4f6 !important; color: #202124 !important}
html[data-theme=dark] .warranty-note a {color:#ffb5bb}
html[data-theme=dark] #quoteForm .checkout-steps button {color:var(--night-secondary)}
html[data-theme=dark] #quoteForm .checkout-steps [aria-current=step] {color:var(--night-text)}
html[data-theme=dark] #quoteForm .checkout-steps [aria-current=step] span {background:#aa2631;color:white}
html[data-theme=dark] #toast {background:#f1f2f4;color:#202124}
html[data-theme=dark] #quoteForm :is(.payment-current,.payment-upcoming button,#checkoutReview) {background:var(--night-raised);color:var(--night-text)}
html[data-theme=dark] #quoteForm .checkout-exports button {color:var(--night-text)}
