/* Midnight navy: colors only; existing motion and layouts are preserved. */
.appearanceControls{display:flex;align-items:center;border:1px solid var(--line);border-radius:11px;background:var(--sheet);overflow:hidden;flex-shrink:0}
.appearanceControls .chip-btn{border:0;border-radius:0;background:transparent;min-width:39px;height:36px;padding:7px 10px;display:grid;place-items:center}
.appearanceControls #languageToggle{border-left:1px solid var(--line)}
#themeToggle svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
#themeToggle .sunIcon{display:none}html[data-theme=dark] #themeToggle .sunIcon{display:block}html[data-theme=dark] #themeToggle .moonIcon{display:none}
html[data-theme=dark],html[data-theme=dark] body.api-page{color-scheme:dark;--paper:#111b32;--paper-2:#17243d;--sheet:#1b2944;--ink:#eaf0ff;--ink-2:#b7c5df;--ink-3:#8c9fbe;--line:#30415e;--brand:#91adff;--brand-deep:#c0d0ff;--blue:#91adff;--blue-soft:#263c68;--green:#64d6b0;--mint:#64d6b0;--amber:#efbd71;--soft:#223354;--shadow:0 18px 50px -24px #050d24a0;--small-shadow:0 3px 12px #07102750}
html[data-theme=dark] body{background:radial-gradient(ellipse 70% 36% at 75% 8%,#20345a55,transparent 80%),var(--paper);color:var(--ink)}
html[data-theme=dark] body.api-page{background:radial-gradient(ellipse 65% 42% at 76% 14%,#243b7555,transparent 80%),var(--paper)}
html[data-theme=dark] .top,html[data-theme=dark] body.api-page .top{background:#111b32ed;border-bottom-color:#30415e66}
html[data-theme=dark] :is(.navPill,.accountMenu){background:#24344f;border-color:var(--line);box-shadow:0 5px 24px #050d2440}
html[data-theme=dark] :is(.card,.cats,.ticket,.step-card,.readingLibrary,.article-index,.reader,.apiPanel,.apiReferenceBox,.apiAccess,.banliDialog,.banliDialogHead,.apiDrawer,.apiBuy,.orderResult,.helpContacts>a,.helpContacts>div,.checkoutFulfillment,.fulfillExample,.deliveryExampleDialog){background:var(--sheet);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] :is(input,textarea,select,.search,.sort,.checkoutForm input,.orderLookupForm input,.orderResult textarea,.fulfillCode textarea,#amtCustom){background:#142139;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.cats button.on,.cats button.active,.cats [aria-selected=true],.segTabs [aria-selected=true],.usageFilters [aria-pressed=true]){background:#2a3f68;color:#d8e4ff}
html[data-theme=dark] :is(.cats em,.cats .count,.checkoutSteps,.reader-callout,.fulfillCard,.apiSteps,.apiQR,.dialogClose,.apiDrawer header>button){background:#17243d;border-color:var(--line)}
html[data-theme=dark] :is(.btn-main,.buy,.dialogPrimary,.checkoutSubmit,.checkoutCopy,.fulfillButton.primary,#authDialog .authPrimary,.user){background:#4263ef;color:#fff;border-color:#4263ef}
html[data-theme=dark] :is(.btn-main:hover,.buy:hover,.dialogPrimary:hover,.checkoutSubmit:not(:disabled):hover){background:#5372f6}
html[data-theme=dark] :is(.btn-ghost,.fulfillButton,.apiStepPill,.amounts label span){background:#243552;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .amounts input:checked+span{background:#2b406c;color:#d7e3ff}
html[data-theme=dark] :is(.fab,.mnav){background:#1b2944ee;color:var(--ink);border-color:var(--line);box-shadow:0 9px 28px -14px #02091c}
html[data-theme=dark] :is(.logo img,.categoryIcon){filter:brightness(0) invert(.85)}
html[data-theme=dark] :is(.card .ic,.checkoutLogo,.hero .mono){background:#fff;border-color:#7285a655}
html[data-theme=dark] :is(.card .tags span,.tag,.badge){background:#273955;color:#c3d0e8}
html[data-theme=dark] :is(.fulfillExpiry,.checkoutWarning){background:#5b442533;color:#efc480}
html[data-theme=dark] :is(.fulfillEmphasis,.fulfillGuide a,.customGuide a,.helpContacts button,.helpContacts span,.rememberHint button){color:var(--brand)}
html[data-theme=dark] #shopCheckout,html[data-theme=dark] #shopCheckout .checkoutInfo{background:var(--sheet);border-color:var(--line)}
html[data-theme=dark] #shopCheckout .checkoutPay{background:#17243d;border-color:var(--line)}
html[data-theme=dark] .checkoutPaymentMethod{background:#22385c;color:#b8d1ff;border-color:#344d74}
html[data-theme=dark] .checkoutQR{background:#fff;color:#152747}html[data-theme=dark] .checkoutQRLocked{color:#5f7290}
html[data-theme=dark] :is(.checkoutCardCode,#orderLookupEmail[readonly]){background:#142139;color:var(--ink)}
html[data-theme=dark] :is(.orderResult p,.orderResult small,.dialogIntro,.helpBody>p,.helpBody section p,.helpBody ol){color:var(--ink-2)}
html[data-theme=dark] :is(.helpBody>h3,.helpBody section h3,.banliDialogHead h2,.orderResult h3){color:var(--ink)}
html[data-theme=dark] :is(.readingRow:hover,.orderClickable:hover,.accountMenu button:hover){background:#243552}
html[data-theme=dark] .modelTable th{background:#17243d;color:var(--ink-2)}
html[data-theme=dark] :is(.modelTable th:first-child,.modelTable .name){background:#1b2944}
html[data-theme=dark] .apiNextStep{background:#253754f5}html[data-theme=dark] .apiNextStep button{background:#e4edff;color:#1a2c4d}
html[data-theme=dark] :is(#shellToast,.apiToast){background:#dce7ff;color:#122442}
html[data-theme=dark] dialog::backdrop{background:#040b20aa}
html[data-theme=dark] #authDialog{background:#1b2944;border-color:var(--line);color:var(--ink);box-shadow:0 30px 95px #02091c99}
html[data-theme=dark] #authDialog :is(.authHeader h2,.authLabel){color:var(--ink)}
html[data-theme=dark] #authDialog :is(.authHeader p,.authHelp,.authSwitch,.authStatus,.authTurnstileNote){color:var(--ink-2)}
html[data-theme=dark] #authDialog :is(.authInputWrap,.authInputWrap:focus-within){background:#142139;border-color:var(--line)}
html[data-theme=dark] #authDialog input{color:var(--ink);-webkit-text-fill-color:var(--ink)}
html[data-theme=dark] #authDialog .authMethod{background:#142139}html[data-theme=dark] #authDialog .authMethod button.active{background:#2c4167;color:#d4e2ff}
html[data-theme=dark] #authDialog :is(.authLink,.authEye){color:var(--brand)}html[data-theme=dark] #authDialog .authSend{background:#243a60;color:#c6daff;border-color:#425a7d}
html[data-theme=dark] #authDialog .authSwitch{border-color:var(--line)}
@media(max-width:720px){.appearanceControls .chip-btn{min-width:34px;height:34px;padding:6px 8px}.top-r{gap:7px}}

html[data-theme=dark] .help{background:linear-gradient(160deg,#233653,#1b2944)}
html[data-theme=dark] :is(.card .tags span,.card .tag,.cats b){background:#263955;color:#cad7ed}
html[data-theme=dark] .card .buy:disabled{background:#34415b;color:#a6b4cc}
html[data-theme=dark] input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #142139 inset;-webkit-text-fill-color:#eaf0ff}

html[data-theme=dark] .checkoutNotes [style*="color: rgb(135, 97, 39)"],html[data-theme=dark] .checkoutNotes [style*="color:#876127"],html[data-theme=dark] .checkoutNotes [style*="color: #876127"]{color:#efc480!important}
html[data-theme=dark] :is(.checkoutNotes,.customGuide) [style*="color: rgb(36, 75, 196)"],html[data-theme=dark] :is(.checkoutNotes,.customGuide) [style*="color:#244bc4"],html[data-theme=dark] :is(.checkoutNotes,.customGuide) [style*="color: #244bc4"]{color:#a9c1ff!important}

html[data-theme=dark] .cats .categoryIcon{filter:none;background:#fff;border-radius:5px;padding:2px}

html[data-theme=dark] .helpContacts .wechatContactNote { color: #f398a1; }
