/* Account-wide dark palette; loaded only by the user layout. */
html[data-user-theme="dark"] {
  color-scheme:dark;
  background:#111318;
  --canvas:#111318; --surface:#1d2129; --surface-subtle:#252b35; --surface-muted:#2c3440;
  --surface-inverse:#e9edf5; --text-primary:#edf0f7; --text-secondary:#b0bacb;
  --text-tertiary:#98a5b8; --text-disabled:#7f8998; --text-inverse:#fff;
  --border-subtle:#303844; --border-default:#3b4554; --border-strong:#59677c;
  --color-brand-50:#172f49; --color-brand-100:#203d5d; --color-brand-600:#76b8ff; --color-brand-700:#93c7ff;
  --color-success-50:#12372d; --color-success-600:#64d8b1; --color-success-700:#7de2be;
  --color-warning-50:#3b2c18; --color-warning-700:#f5c37e;
  --color-danger-50:#3e222b; --color-danger-600:#ff9da7; --color-danger-700:#ffabb4;
  --color-info-50:#193249; --color-info-700:#91c8ff;
  --bg:var(--canvas); --surface-soft:var(--surface-subtle); --text:var(--text-primary);
  --muted:var(--text-secondary); --muted-2:var(--text-tertiary); --line:var(--border-default);
  --border:var(--border-default); --text-muted:var(--text-secondary); --danger:#ff9da7;
  --blue:var(--color-brand-600); --blue-soft:var(--color-brand-50); --blue-hover:#93c7ff;
  --green:#64d8b1; --green-soft:#12372d; --orange:#f5c37e; --orange-soft:#3b2c18;
  --red:#ff9da7; --red-soft:#3e222b; --shadow:0 10px 30px #0004;
}
html[data-user-theme="dark"] .user-app-body {
  --pm-surface:#1d2129; --pm-canvas:#111318; --pm-ink:#edf0f7; --pm-muted:#b0bacb; --pm-divider:#36404e;
  --dg-bg:#1d2129; --dg-soft:#252b35; --dg-text:#edf0f7; --dg-muted:#b0bacb; --dg-line:#36404e;
  --ref-ink:#edf0f7; --ref-muted:#b0bacb; --ref-line:#36404e;
  background:var(--canvas)!important; color:var(--text-primary)!important;
}
html[data-user-theme="dark"] .user-app-body :is(.app-frame,.app-main,.content-shell,.app-footer,.mobile-nav-page,.node-entry-portal,.site-entry) {
  background:var(--canvas)!important; color:var(--text-primary)!important;
}
html[data-user-theme="dark"] .user-app-body :is(.sidebar,.topbar,.panel,.card,.empty-state,.mobile-nav-list,.mobile-nav-list>a,.mobile-nav-profile,.node-entry-card,.node-status-empty,.node-status-workspace,.node-status-card,.node-monitor-kpis>article,.profile-summary-card,.account-list-group,.account-list-row,.account-logout-row,.account-edit-card,.notification-setting-list,.notification-setting-row,.wallet-transaction,.px-card,.px-reader-card,.px-article,.px-reader-search,.px-vote-card,.sc-row,.sc-overview,.sc-notice,.dg-card,.dg-metric,.ref-plan-surface,.ref-order,.ref-checkout,.ref-modal,.ref-key .glass-inner,.plan-store-period,.plan-store-summary,.plan-store-checkout,.plan-access-profile,.plan-access-panel,.database-card,.database-tile) {
  background:var(--surface)!important; color:var(--text-primary)!important; border-color:var(--border-subtle)!important;
}
html[data-user-theme="dark"] .user-app-body :is(h1,h2,h3,h4,.page-heading,.brand,.nav-item,.admin-nav-child,.mobile-topbar-title,.profile-summary-identity,.profile-summary-identity h1,.profile-summary-details dd,.account-list-row strong,.node-entry-copy h3,.dg-metric-copy strong,.dg-identity>strong,.ref-plan-top strong,.ref-order-total,.ref-dialog-title,.px-reader-title,.px-card-title,.sc-row-heading h3) { color:var(--text-primary)!important; }
html[data-user-theme="dark"] .user-app-body :is(.nav-label,.page-heading p,.muted,.hint,.field-hint,.empty-state p,.app-footer,.profile-summary-details dt,.account-list-row small,.notification-setting-row small,.node-entry-copy p,.node-capability-status,.ref-plan-top small,.ref-feature,.ref-order-breakdown,.px-card-meta,.px-card-summary,.sc-message,.sc-status-label) { color:var(--text-secondary)!important; }
html[data-user-theme="dark"] .user-app-body :is(.nav-item:hover,.nav-item.active,.admin-nav-child.active,.balance-pill,.wallet-balance,.node-entry-arrow,.profile-plan-badge,.access-badge,.api-status,.api-full-value,.sc-fix,.px-reader-tag,.ref-key-box,.ref-balance-bar,.ref-period,.ref-method>span,.ref-plan-details,.plan-store-total,.plan-store-periods,.dg-uid,.dg-plan-name,.dg-live-badge,.dg-update-time,.dg-tag,.dg-orders td code,.dg-metric-icon) {
  background:var(--surface-subtle)!important; color:var(--text-secondary)!important; border-color:var(--border-default)!important;
}
html[data-user-theme="dark"] .user-app-body :is(.button-secondary,.button-ghost,.icon-button,.account-edit-cancel,.dg-button,.mku-refresh,.mku-sort,.mku-filter,.mku-segment,.mku-segment button,.node-status-segmented,.node-status-segmented button,.ref-manage,.ref-icon,.ref-method>span) {
  background:var(--surface-subtle)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important;
}
html[data-user-theme="dark"] .user-app-body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]),select,textarea,option) {
  background-color:var(--surface-subtle)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important; color-scheme:dark;
}
html[data-user-theme="dark"] .user-app-body input::placeholder,html[data-user-theme="dark"] .user-app-body textarea::placeholder { color:var(--text-tertiary)!important; }
html[data-user-theme="dark"] .user-app-body input:-webkit-autofill { -webkit-box-shadow:0 0 0 1000px #252b35 inset!important; -webkit-text-fill-color:#edf0f7!important; }
html[data-user-theme="dark"] .user-app-body :is(table,thead,tbody,tr,th,td,.table-wrap,.table-container) { background-color:var(--surface)!important; color:var(--text-primary); border-color:var(--border-subtle)!important; }
html[data-user-theme="dark"] .user-app-body th { color:var(--text-secondary)!important; }
html[data-user-theme="dark"] .user-app-body :is(dialog,.modal-card,.modal-panel,.modal-content,.dialog-card,.dialog-panel,.pm-sheet-group,.pm-sheet-cancel,.island-toast,.toast,.alert) {
  background:var(--surface)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important;
}
html[data-user-theme="dark"] .user-app-body dialog::backdrop { background:#0009; }
html[data-user-theme="dark"] .user-app-body .profile-balance-card { background:linear-gradient(120deg,#174578,#24619b)!important; }
html[data-user-theme="dark"] .user-app-body .profile-membership-tier { background:linear-gradient(135deg,#513730,#352724)!important; color:#f0c5b6!important; border-color:#916b5e!important; }
html[data-user-theme="dark"] .user-app-body .mobile-tab-bar { background:rgba(29,33,41,var(--pm-glass-alpha,.92))!important; border-color:#ffffff20!important; box-shadow:0 8px 30px #0005; }
html[data-user-theme="dark"] .user-app-body .mobile-tab-item { color:#a7b2c3; }
html[data-user-theme="dark"] .user-app-body .mobile-tab-item.active { color:#84bfff!important; }
html[data-user-theme="dark"] .user-app-body .dashboard-gemini { --dg-bg:#1d2129; --dg-soft:#252b35; --dg-text:#edf0f7; --dg-muted:#b0bacb; --dg-line:#36404e; }
html[data-user-theme="dark"] .user-app-body :is(.dg-source-icon,.dg-source-summary,.dg-source-details dd,.dg-node-stats>div,.dg-sample-grid,.dg-avatar,.dg-balance) { background:var(--surface-subtle)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body :is(.ref-plan,.ref-order,.ref-key) { --ref-ink:#edf0f7; --ref-muted:#b0bacb; --ref-line:#36404e; color:var(--text-primary); }
html[data-user-theme="dark"] .user-app-body :is(.ref-plan input:checked+.ref-plan-surface,.ref-period:has(input:checked),.plan-store-period:has(input:checked),.ref-method>input:checked+span) { background:#19334f!important; border-color:#75b6ff!important; }
html[data-user-theme="dark"] .user-app-body .mk-monitor { --mk-line:#36404e; --mk-muted:#b0bacb; --mk-ok:#64d8b1; --mk-warn:#f5c37e; --mk-bad:#ff9da7; --mk-violet:#c3a6ff; color:var(--text-primary); }
html[data-user-theme="dark"] .user-app-body :is(.mku-bento,.mku-telemetry,.mku-toolbar,.mku-search,.mku-card,.mku-node,.mku-empty,.mk-panel,.mk-empty) { background:var(--surface)!important; color:var(--text-primary)!important; border-color:var(--border-subtle)!important; }
html[data-user-theme="dark"] .user-app-body :is(.mku-filter.is-active,.mku-segment .is-active,.node-status-segmented .is-active) { background:#19334f!important; color:#93c7ff!important; }
html[data-user-theme="dark"] .user-app-body #mobile-data-page { --bg:#111318; --panel:#1d2129; --text:#edf0f7; --muted:#b0bacb; }
html[data-user-theme="dark"] .user-app-body #mobile-data-page { --bg1:#111318; --bg2:#181e2b; --bg3:#142436; --ink:#edf0f7; --ink2:#b0bacb; --glass:#1d2129ed; --glass-b:#36404e; --solid:#252b35; --bubble:#2c3440; --dock:#1d2129ed; --shadow:0 12px 32px #0005; }
html[data-user-theme="dark"] .user-app-body .mku-front { --mku-text:#edf0f7; --mku-muted:#b0bacb; --mku-blue:#84bfff; --mku-line:#36404e; color:var(--mku-text); }
html[data-user-theme="dark"] .user-app-body .px-page { --px-blue:#84bfff; --px-line:#36404e; --px-muted:#b0bacb; --px-bg:#111318; color:var(--text-primary); }
/* Legacy page panels that predate the shared semantic tokens. */
html[data-user-theme="dark"] .user-app-body :is(.plan-store-benefits article,.plans-redeem-panel,.node-status-search,.mku-note,.dbui-card,.profile-avatar-frame,.sc-count,.px-roadmap-group,.du-card,.rn-search,.rental-version-switch,.ug-row,.ug-row>div,.ug-note,.ug-card,.ug-nav,.ug-section,.ug-sidebar,.ug-mobile-nav,.subpage-panel,.account-edit-panel,.px-choice,.px-prose pre,.px-prose blockquote) { background:var(--surface)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body :is(.profile-balance-action,.dbui-quota,.mku-service,.node-status-refresh,.ug-row.ug-hit) { background:var(--surface-subtle)!important; color:#b9d8ff!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body .ug-note-danger { background:#3e222b!important; color:#ffabb4!important; }
html[data-user-theme="dark"] .user-app-body .ref-features article { background:var(--surface-subtle)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body :is(.du-context-bar,.du-context-identity strong,.rental-version-switch a,.dbui-help,.dbui-badge,.dbui-rule-note,.dbui-egress-editor,.dbui-card-footer,.dbui-button,.px-badge) { background:var(--surface-subtle)!important; color:var(--text-secondary)!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body .usage-guide {
  --g-ink2:#b0bacb; --g-ink3:#98a5b8; --g-brand-ink:#aad2ff; --g-brand-line:#3a5978;
  --g-teal:#83d8dd; --g-teal-bg:#14353b; --g-warn-bg:#3b2c18; --g-warn-line:#70532c; --g-warn-ink:#f5c37e;
}
html[data-user-theme="dark"] .user-app-body :is(.usage-guide .ug-pair>div,.usage-guide .ug-pair code) { background:var(--surface-subtle)!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body .usage-guide mark { background:#5b4823; color:#ffe4a8; }
html[data-user-theme="dark"] .user-app-body .dbui { --dbui-ink:#edf0f7; --dbui-muted:#b0bacb; --dbui-border:#36404e; --dbui-blue:#84bfff; }
html[data-user-theme="dark"] .user-app-body :is(.dbui-form-grid label,.dbui-form-grid label>span,.dbui-field label,.mku-filter>span) { color:var(--text-secondary)!important; }
html[data-user-theme="dark"] .user-app-body :is(.profile-summary-details>div,.profile-summary-identity,.account-list-row,.dg-section-head) { border-color:var(--border-subtle)!important; }
html[data-user-theme="dark"] .user-app-body #md-dock { --dock:#1d2129ed; --ink2:#b0bacb; --glass-b:#36404e; --shadow:0 12px 32px #0005; color:#edf0f7; }
html[data-user-theme="dark"] .user-app-body :is(.redemption-hero,.redemption-card,.redemption-capsule,.redemption-help,.redemption-note,.ios-hero-card,.glass-card) { background:var(--surface)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important; }
/* User login, registration, recovery and payment return share the saved palette. */
html[data-user-theme="dark"] .user-public-body { background:#111318!important; color:#edf0f7!important; color-scheme:dark; }
html[data-user-theme="dark"] .user-public-body :is(.auth-reference-background,.auth-background-glow,.site-entry,#authReferenceSplash) { background:#111318!important; }
html[data-user-theme="dark"] .user-public-body .auth-reference-background>div { background:#142438!important; opacity:.25; }
html[data-user-theme="dark"] .user-public-body :is([class*="bg-white"],[class*="bg-slate-50"],[class*="bg-slate-100"],[class*="bg-charcoal-50"],.panel,.guest-card,.auth-card,.auth-form-card) { background:#1d2129!important; border-color:#36404e!important; }
html[data-user-theme="dark"] .user-public-body :is(h1,h2,h3,label,[class*="text-charcoal-"],[class*="text-slate-"],.brand,.guest-footer) { color:#dce3ef!important; }
html[data-user-theme="dark"] .user-public-body :is(input,select,textarea) { background:#252b35!important; color:#edf0f7!important; border-color:#3b4554!important; color-scheme:dark; }
html[data-user-theme="dark"] .user-public-body :is(input,textarea)::placeholder { color:#98a5b8!important; }
html[data-user-theme="dark"] .user-public-body :is(.ceramic-glass,.auth-nav-tab.is-selected,.auth-captcha,.auth-notice) { background:#1d2129!important; color:#dce3ef!important; border-color:#36404e!important; }
html[data-user-theme="dark"] .user-public-body :is([class*="text-blancpain-"],.auth-version) { color:#9bcaff!important; }
html[data-user-theme="dark"] .user-app-body :is(.px-empty strong,.px-prose,.px-note,.px-content-meta,.px-choice span,.px-poll-result strong) { color:var(--text-secondary)!important; }
html[data-user-theme="dark"] .user-app-body .store-bolt { color:#b1caff!important; }
html[data-user-theme="dark"] .user-app-body .pm-segment button[aria-pressed="true"] { background:#394557; color:#fff; box-shadow:0 1px 5px #0008; }
html[data-user-theme="dark"] .user-app-body :is(.mku-list-group,.mku-list-group .mku-node:hover,.node-status-detail,.node-status-error,.redemption-success-stats>div,.ref-pc-checkout-balance,.ref-subscription,.plan-store-pc-benefits) { background:var(--surface)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body :is(.platform-article-context,.ref-secure) { color:var(--text-secondary)!important; }
html[data-user-theme="dark"] .user-app-body :is(.ref-order-plan,.ref-close,.ref-spec) { background:var(--surface-subtle)!important; color:var(--text-primary)!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body :is(.ref-order-plan b,.ref-order-total strong,.ref-order-total b,.ref-method-icon,.ref-order-plan footer b) { color:#93c7ff!important; }
html[data-user-theme="dark"] .user-app-body :is(.button-primary,.sc-button-primary) { background:#2264ad!important; color:#fff!important; border-color:#397cc7!important; }
html[data-user-theme="dark"] .user-app-body .dbui-card-header { background:var(--surface)!important; border-color:var(--border-default)!important; }
html[data-user-theme="dark"] .user-app-body #mobile-data-page :is(.card,.hero,.tip) { background:#1d2129!important; color:#edf0f7!important; border-color:#36404e!important; }
html[data-user-theme="dark"] .user-app-body :is(.pm-row,.pm-profile,.pm-name,.pm-account-tier) { color:var(--pm-ink); }
html[data-user-theme="dark"] .user-app-body :is(.alert-success,.dg-plan-valid,.dg-tag.paid,.mk-normal,.ref-balance-result) { background:#12372d!important; color:#7de2be!important; border-color:#29594a!important; }
html[data-user-theme="dark"] .user-app-body :is(.alert-warning,.dg-tag.pending) { background:#3b2c18!important; color:#f5c37e!important; border-color:#70532c!important; }
html[data-user-theme="dark"] .user-app-body :is(.alert-danger,.alert-error,.dg-tag.error,.mk-failed,.ref-balance-result.insufficient) { background:#3e222b!important; color:#ffabb4!important; border-color:#74404e!important; }
