/* QMSJ Theme Engine 2.0 */
:root,
:root[data-theme="system"],
:root[data-theme="light"] {
  --theme-background:#F6F7F8; --theme-surface:#FFFFFF; --theme-card:#FFFFFF;
  --theme-text-primary:#202326; --theme-text-secondary:#697077; --theme-border:#E2E5E8;
  --theme-button:#202326; --theme-button-text:#FFFFFF; --theme-accent:#5C7CFA;
  --theme-accent-soft:#EEF1FF; --theme-sidebar:#F0F2F4; --theme-hover:#F3F5F6;
  --theme-shadow:0 18px 55px rgba(31,38,43,.13); --theme-background-image:none; color-scheme:light;
}
@media(prefers-color-scheme:dark){:root[data-theme="system"]{--theme-background:#0D1220;--theme-surface:#151C2C;--theme-card:#1B2436;--theme-text-primary:#F5F7FB;--theme-text-secondary:#9DAAC0;--theme-border:#2D3950;--theme-button:#EAF0FF;--theme-button-text:#101625;--theme-accent:#68A7FF;--theme-accent-soft:#213653;--theme-sidebar:#111827;--theme-hover:#222E42;--theme-shadow:0 22px 64px rgba(0,0,0,.42);--theme-background-image:radial-gradient(circle at 12% 18%,rgba(166,206,255,.52) 0 1px,transparent 1.6px),radial-gradient(circle at 72% 14%,rgba(255,255,255,.38) 0 1px,transparent 1.5px),radial-gradient(circle at 36% 72%,rgba(113,170,255,.32) 0 1px,transparent 1.7px),radial-gradient(circle at 88% 66%,rgba(210,228,255,.3) 0 1px,transparent 1.5px),linear-gradient(145deg,#080C16 0%,#10182A 48%,#111D31 100%);color-scheme:dark}}
:root[data-theme="eye-care"] {
  --theme-background:#F4F1E6; --theme-surface:#FFFFFF; --theme-card:#FBFAF5;
  --theme-text-primary:#30352F; --theme-text-secondary:#70756D; --theme-border:#DED9C9;
  --theme-button:#426A54; --theme-button-text:#FFFFFF; --theme-accent:#5C8D72;
  --theme-accent-soft:#E5EEE7; --theme-sidebar:#ECE8DA; --theme-hover:#F0EDE2;
  --theme-shadow:0 18px 55px rgba(62,67,55,.12); color-scheme:light;
}
:root[data-theme="dark"] {
  --theme-background:#0D1220; --theme-surface:#151C2C; --theme-card:#1B2436;
  --theme-text-primary:#F5F7FB; --theme-text-secondary:#9DAAC0; --theme-border:#2D3950;
  --theme-button:#EAF0FF; --theme-button-text:#101625; --theme-accent:#68A7FF;
  --theme-accent-soft:#213653; --theme-sidebar:#111827; --theme-hover:#222E42;
  --theme-shadow:0 22px 64px rgba(0,0,0,.42);
  --theme-background-image:radial-gradient(circle at 12% 18%,rgba(166,206,255,.52) 0 1px,transparent 1.6px),radial-gradient(circle at 72% 14%,rgba(255,255,255,.38) 0 1px,transparent 1.5px),radial-gradient(circle at 36% 72%,rgba(113,170,255,.32) 0 1px,transparent 1.7px),radial-gradient(circle at 88% 66%,rgba(210,228,255,.3) 0 1px,transparent 1.5px),linear-gradient(145deg,#080C16 0%,#10182A 48%,#111D31 100%);
  color-scheme:dark;
}
:root[data-preset="tech-blue"] { --theme-accent:#3979F6; --theme-accent-soft:#E8F0FF; --theme-button:#3979F6; --theme-sidebar:#EAF1FA; }
:root[data-theme="dark"][data-preset="tech-blue"] { --theme-accent:#69A1FF; --theme-accent-soft:#24354E; --theme-button:#69A1FF; --theme-sidebar:#19212C; }
:root[data-preset="forest"] { --theme-accent:#5C8D72; --theme-accent-soft:#E5EEE7; --theme-button:#4F7B63; --theme-sidebar:#E9EEE6; }
:root[data-theme="dark"][data-preset="forest"] { --theme-accent:#80B795; --theme-accent-soft:#263B2E; --theme-button:#80B795; --theme-sidebar:#19231D; }
:root[data-preset="midnight"] { --theme-accent:#536779; --theme-accent-soft:#E6EBEF; --theme-button:#455968; --theme-sidebar:#E7EBEE; }
:root[data-theme="dark"][data-preset="midnight"] { --theme-accent:#9CB0C1; --theme-accent-soft:#2B343D; --theme-button:#9CB0C1; --theme-sidebar:#181D22; }
:root[data-preset="amethyst"] { --theme-accent:#7A5AA6; --theme-accent-soft:#EEE8F5; --theme-button:#72519E; --theme-sidebar:#EEEAF2; }
:root[data-theme="dark"][data-preset="amethyst"] { --theme-accent:#B99ADE; --theme-accent-soft:#372D44; --theme-button:#B99ADE; --theme-sidebar:#211B27; }
:root[data-theme="eye-care"][data-preset="default"] { --theme-accent:#5C8D72; --theme-accent-soft:#E5EEE7; --theme-button:#426A54; }
:root[data-preset="default"]{--theme-background:#F6F8FC;--theme-surface:#FFFFFF;--theme-card:#FFFFFF;--theme-sidebar:#F1F5FD;--theme-text-primary:#25324A;--theme-text-secondary:#66758F;--theme-border:#DCE5F4;--theme-hover:#EEF4FF;--theme-accent:#3979F6;--theme-accent-soft:#E8F0FF;--theme-button:#3979F6;--theme-button-text:#FFFFFF;--theme-shadow:0 14px 40px rgba(47,105,202,.10)}
:root[data-preset="anthropic"]{--theme-background:#F5F1E9;--theme-surface:#FFFDF9;--theme-card:#F0ECE4;--theme-sidebar:#ECE7DC;--theme-text-primary:#3B3832;--theme-text-secondary:#756F66;--theme-border:#DED8CC;--theme-hover:#EAE5DC;--theme-accent:#C9795C;--theme-accent-soft:#F5E1D8;--theme-button:#B9674E;--theme-button-text:#FFFFFF;--theme-shadow:0 16px 42px rgba(91,72,53,.12)}
:root[data-preset="rose"]{--theme-background:#FFF7F8;--theme-surface:#FFFFFF;--theme-card:#FFFAFB;--theme-sidebar:#FFF4F6;--theme-text-primary:#2E2025;--theme-text-secondary:#806C73;--theme-border:#F4D8DE;--theme-hover:#FCECEF;--theme-accent:#ED4C78;--theme-accent-soft:#FDE3EA;--theme-button:#E94270;--theme-button-text:#FFFFFF;--theme-shadow:0 16px 44px rgba(151,62,88,.11)}
:root[data-theme="dark"][data-preset="rose"]{--theme-background:#1B1719;--theme-surface:#221C1F;--theme-card:#2A2226;--theme-sidebar:#201A1D;--theme-text-primary:#FAF5F7;--theme-text-secondary:#C5AEB6;--theme-border:#45343B;--theme-hover:#33282D;--theme-accent:#FF7EA2;--theme-accent-soft:#472A34;--theme-button:#FF7EA2;--theme-button-text:#21171B;--theme-shadow:0 20px 60px rgba(0,0,0,.36)}
:root[data-preset="lake"]{--theme-background:#F3FBF8;--theme-surface:#FFFFFF;--theme-card:#F8FCFA;--theme-sidebar:#F0F9F5;--theme-text-primary:#17362E;--theme-text-secondary:#658078;--theme-border:#CFE9DF;--theme-hover:#E5F6EF;--theme-accent:#00A98F;--theme-accent-soft:#DDF6F1;--theme-button:#008F7A;--theme-button-text:#FFFFFF;--theme-shadow:0 16px 44px rgba(23,102,84,.10)}
:root[data-theme="dark"][data-preset="lake"]{--theme-background:#121C19;--theme-surface:#182420;--theme-card:#1D2C27;--theme-sidebar:#15211D;--theme-text-primary:#F1FAF7;--theme-text-secondary:#A4C3B8;--theme-border:#2B4940;--theme-hover:#243830;--theme-accent:#35D0B4;--theme-accent-soft:#1E443A;--theme-button:#35D0B4;--theme-button-text:#10211C}
:root[data-preset="sunset"]{--theme-background:#F7F2E8;--theme-surface:#FFFDF8;--theme-card:#FBF7EF;--theme-sidebar:#F1EBDD;--theme-text-primary:#352B23;--theme-text-secondary:#7A6D5E;--theme-border:#E5D7C3;--theme-hover:#F2E7D6;--theme-accent:#B98047;--theme-accent-soft:#F1E3CF;--theme-button:#A9663F;--theme-action:#A9663F;--theme-button-text:#FFFCF7;--theme-gold:#B58A45;--theme-warm:#B98047;--theme-warm-soft:#F1E3CF;--theme-danger:#A85F54;--theme-danger-soft:#F2DFDA;--theme-success:#5F8060;--theme-success-soft:#E5EFE3;--theme-shadow:0 14px 38px rgba(98,72,43,.10)}
:root[data-theme="dark"][data-preset="sunset"]{--theme-background:#1D1A16;--theme-surface:#26211B;--theme-card:#2D2720;--theme-sidebar:#221E19;--theme-text-primary:#F5EBDD;--theme-text-secondary:#C3B49F;--theme-border:#493E31;--theme-hover:#382F26;--theme-accent:#D4A15F;--theme-accent-soft:#4A3925;--theme-button:#C47D52;--theme-action:#C47D52;--theme-button-text:#211811;--theme-gold:#D4A15F;--theme-warm:#D4A15F;--theme-warm-soft:#4A3925;--theme-danger:#D18A7B;--theme-danger-soft:#4A302A;--theme-success:#86AA7E;--theme-success-soft:#293A29}
:root[data-preset="forest"]{--theme-background:#F3F8F7;--theme-surface:#FFFFFF;--theme-card:#F7FAF9;--theme-sidebar:#EEF5F3;--theme-text-primary:#243936;--theme-text-secondary:#6C807D;--theme-border:#D2E3DF;--theme-hover:#E7F1EF;--theme-accent:#2E7F86;--theme-accent-soft:#DDEEEF;--theme-button:#276E74;--theme-button-text:#FFFFFF;--theme-shadow:0 16px 44px rgba(39,91,88,.10)}
:root[data-theme="dark"][data-preset="forest"]{--theme-background:#151B1B;--theme-surface:#1C2424;--theme-card:#222D2D;--theme-sidebar:#182121;--theme-text-primary:#F2F8F7;--theme-text-secondary:#A9BFBC;--theme-border:#344746;--theme-hover:#2A3837;--theme-accent:#65B5BB;--theme-accent-soft:#26454A;--theme-button:#65B5BB;--theme-button-text:#122022}
:root[data-preset="sea"]{--theme-background:#F3F7FF;--theme-surface:#FFFFFF;--theme-card:#F8FAFF;--theme-sidebar:#EEF4FF;--theme-text-primary:#1E2E53;--theme-text-secondary:#6B7B9C;--theme-border:#D4DFFF;--theme-hover:#E8EFFF;--theme-accent:#4565E8;--theme-accent-soft:#E3E8FD;--theme-button:#3857D5;--theme-button-text:#FFFFFF;--theme-shadow:0 16px 44px rgba(57,86,184,.11)}
:root[data-theme="dark"][data-preset="sea"]{--theme-background:#151824;--theme-surface:#1C2030;--theme-card:#23283A;--theme-sidebar:#181C29;--theme-text-primary:#F3F5FF;--theme-text-secondary:#ABB5D6;--theme-border:#343E5D;--theme-hover:#2A3148;--theme-accent:#839BFF;--theme-accent-soft:#303A66;--theme-button:#839BFF;--theme-button-text:#141A30}
:root[data-preset="lavender"]{--theme-background:#FAF7FD;--theme-surface:#FFFFFF;--theme-card:#FCFAFE;--theme-sidebar:#F6F0FB;--theme-text-primary:#33253F;--theme-text-secondary:#7D6D89;--theme-border:#E5D8F0;--theme-hover:#F1E8F8;--theme-accent:#8E68C7;--theme-accent-soft:#EEE7F8;--theme-button:#7956B0;--theme-button-text:#FFFFFF;--theme-shadow:0 16px 44px rgba(104,73,141,.11)}
:root[data-theme="dark"][data-preset="lavender"]{--theme-background:#1A171E;--theme-surface:#221D27;--theme-card:#2A2331;--theme-sidebar:#1E1923;--theme-text-primary:#FAF5FE;--theme-text-secondary:#C2B0CE;--theme-border:#44364F;--theme-hover:#342A3D;--theme-accent:#B99ADE;--theme-accent-soft:#3C2D4B;--theme-button:#B99ADE;--theme-button-text:#211628}
html[data-preset="anthropic"] body,html[data-preset="anthropic"] body .yx-admin-shell,html[data-preset="anthropic"] body .yx-admin-content{background:#F5F1E9!important;color:#3B3832!important}html[data-preset="anthropic"] body .yx-sidebar{background:#ECE7DC!important}html[data-preset="anthropic"] body .yx-panel,html[data-preset="anthropic"] body .yx-section{background:#F0ECE4!important;border-color:#DED8CC!important}
html[data-preset="anthropic"] body .yx-table-wrap,html[data-preset="anthropic"] body .yx-table,html[data-preset="anthropic"] body .yx-stat,html[data-preset="anthropic"] body .yx-card{background:#FFFDF9!important;border-color:#DED8CC!important}html[data-preset="anthropic"] body .yx-table th{background:#EEE9DF!important;color:#756F66!important}html[data-preset="anthropic"] body .yx-table td{border-color:#E6E0D5!important;color:#3B3832!important}html[data-preset="anthropic"] body .yx-primary{background:#B9674E!important;border-color:#B9674E!important}
html[data-preset="anthropic"] body main,html[data-preset="anthropic"] body aside,html[data-preset="anthropic"] body header,html[data-preset="anthropic"] body section,html[data-preset="anthropic"] body article,html[data-preset="anthropic"] body .yx-admin-shell,html[data-preset="anthropic"] body .yx-admin-content{background-color:#F5F1E9!important}
html[data-preset="anthropic"] body .yx-panel,html[data-preset="anthropic"] body .yx-section,html[data-preset="anthropic"] body .yx-table-wrap,html[data-preset="anthropic"] body .yx-table,html[data-preset="anthropic"] body .yx-stat,html[data-preset="anthropic"] body .yx-card,html[data-preset="anthropic"] body .yx-platform-pane{background-color:#FFFDF9!important}
html[data-preset="anthropic"] body .yx-table tr:nth-child(even){background-color:#F8F4ED!important}html[data-preset="anthropic"] body .yx-table th{background-color:#EEE9DF!important}
html[data-preset="anthropic"] body #platforms-panel,html[data-preset="anthropic"] body #platforms-panel>.yx-panel-head,html[data-preset="anthropic"] body #platforms-panel>.yx-table-wrap,html[data-preset="anthropic"] body #platforms-panel>.yx-section{background:#FFFDF9!important;border-color:#DED8CC!important}
html[data-preset="anthropic"] body #platforms-panel.active,html[data-preset="anthropic"] body #platforms-panel.active>*,html[data-preset="anthropic"] body .yx-admin-content>header{background:#FFFDF9!important;border-color:#DED8CC!important}html[data-preset="anthropic"] body .yx-admin-content>header{background:#F5F1E9!important}
html[data-preset="anthropic"] body .yx-admin-content main,html[data-preset="anthropic"] body .yx-admin-content main *,html[data-preset="anthropic"] body .yx-admin-content .yx-panel,html[data-preset="anthropic"] body .yx-admin-content .yx-panel *,html[data-preset="anthropic"] body .yx-admin-content .yx-section,html[data-preset="anthropic"] body .yx-admin-content .yx-section *{border-color:#DED8CC!important}
html[data-preset="anthropic"] body .yx-admin-content main,html[data-preset="anthropic"] body .yx-admin-content main .yx-panel,html[data-preset="anthropic"] body .yx-admin-content main .yx-section,html[data-preset="anthropic"] body .yx-admin-content main .yx-table-wrap,html[data-preset="anthropic"] body .yx-admin-content main .yx-table,html[data-preset="anthropic"] body .yx-admin-content main .yx-table tbody,html[data-preset="anthropic"] body .yx-admin-content main .yx-table tr,html[data-preset="anthropic"] body .yx-admin-content main .yx-table td{background-color:#FFFDF9!important}
html[data-preset="anthropic"] body .yx-admin-content main .yx-table th,html[data-preset="anthropic"] body .yx-admin-content main thead{background-color:#EEE9DF!important}
:root[data-preset="anthropic"] body .yx-brand,:root[data-preset="anthropic"] body .yx-admin-shell,:root[data-preset="anthropic"] body .yx-admin-content,:root[data-preset="anthropic"] body .yx-admin-content>header,:root[data-preset="anthropic"] body #platforms-panel,:root[data-preset="anthropic"] body .yx-panel{background-color:#FFFDF9!important;border-color:#DED8CC!important}
:root[data-preset="anthropic"] body .yx-sidebar,:root[data-preset="anthropic"] body .yx-sidebar *{background-color:#ECE7DC!important}
:root[data-preset="anthropic"] body .yx-admin-shell{background:#F5F1E9!important}
:root[data-preset="anthropic"] body .yx-brand strong,:root[data-preset="anthropic"] body .yx-brand span,:root[data-preset="anthropic"] body .yx-brand img,:root[data-preset="anthropic"] body #platforms-panel button{background:transparent!important}
:root[data-preset="anthropic"] body .yx-admin-content .yx-embedded-panel,:root[data-preset="anthropic"] body .yx-admin-content .yx-embedded-frame,:root[data-preset="anthropic"] body .yx-admin-content [class*="data-"],:root[data-preset="anthropic"] body .yx-admin-content [class*="operation"],:root[data-preset="anthropic"] body .yx-admin-content [class*="plan"],:root[data-preset="anthropic"] body .yx-admin-content [class*="dashboard"]{background-color:#FFFDF9!important;border-color:#DED8CC!important;color:#3B3832!important}
:root[data-preset="anthropic"] body .yx-admin-content [class*="card"],:root[data-preset="anthropic"] body .yx-admin-content [class*="grid"],:root[data-preset="anthropic"] body .yx-admin-content [class*="toolbar"],:root[data-preset="anthropic"] body .yx-admin-content [class*="content"]{background-color:#FFFDF9!important;border-color:#DED8CC!important}
:root[data-theme="dark"][data-preset="default"]{--theme-background:#17191C;--theme-surface:#1D2024;--theme-card:#24282D;--theme-sidebar:#1B1E22;--theme-text-primary:#F5F7F8;--theme-text-secondary:#A7AEB6;--theme-border:#343A40;--theme-hover:#292E34;--theme-accent:#8DA2FB;--theme-accent-soft:#2A3048;--theme-button:#F1F3F4;--theme-button-text:#17191C}
:root{--theme-action:var(--theme-button)}
:root[data-theme="dark"][data-preset="default"]{--theme-action:#7654B4}
:root{--theme-success:#2E8B62;--theme-success-soft:#E8F6EE}
:root[data-theme="dark"][data-preset="default"]{--theme-success:#7BC49B;--theme-success-soft:#263A31}
:root[data-preset="anthropic"]{--theme-accent:#E9896A;--theme-accent-soft:#FBE8E0;--theme-button:#D97757}:root[data-preset="accessible"]{--theme-accent:#66717C;--theme-accent-soft:#E8EDF1;--theme-button:#4D5A66}:root[data-preset="rose"]{--theme-accent:#F04472;--theme-accent-soft:#FDE4EB;--theme-button:#E53161}:root[data-preset="lake"]{--theme-accent:#00A98F;--theme-accent-soft:#DDF6F1;--theme-button:#008F7A}:root[data-preset="sunset"]{--theme-accent:#B98047;--theme-accent-soft:#F1E3CF;--theme-button:#A9663F;--theme-action:#A9663F}:root[data-preset="sea"]{--theme-accent:#4565E8;--theme-accent-soft:#E3E8FD;--theme-button:#3857D5}:root[data-preset="lavender"]{--theme-accent:#8E68C7;--theme-accent-soft:#EEE7F8;--theme-button:#7956B0}


.te2-avatar-menu{position:absolute;right:0;top:calc(100% + 9px);z-index:2147481000;width:190px;padding:8px;border:1px solid var(--theme-border);border-radius:12px;background:var(--theme-surface);box-shadow:var(--theme-shadow);color:var(--theme-text-primary)}.te2-avatar-menu[hidden]{display:none}.te2-avatar-menu small{display:block;padding:5px 9px;color:var(--theme-text-secondary)}.te2-avatar-menu button{width:100%;padding:10px;border:0;border-radius:8px;background:transparent;color:var(--theme-text-primary);text-align:left;cursor:pointer}.te2-avatar-menu button:hover{background:var(--theme-hover)}.admin-global-profile,.top-actions{position:relative}
.top-actions>.te2-avatar-menu{display:block!important;visibility:visible!important;opacity:1!important;height:auto!important;min-height:0!important;color:var(--theme-text-primary)!important;background:var(--theme-surface)!important}.top-actions>.te2-avatar-menu[hidden]{display:none!important}.top-actions>.te2-avatar-menu small{display:block!important;color:var(--theme-text-secondary)!important;opacity:1!important}.top-actions>.te2-avatar-menu button{display:block!important;width:100%!important;min-height:38px!important;padding:9px 10px!important;border:0!important;background:transparent!important;color:var(--theme-text-primary)!important;opacity:1!important;text-align:left!important}.top-actions>.te2-avatar-menu button:hover{background:var(--theme-hover)!important}
.te2-header-tools{display:flex;align-items:center;gap:8px;margin-right:8px}.te2-header-tool{width:38px;height:38px;display:grid;place-items:center;padding:0;border:1px solid var(--theme-border);border-radius:50%;background:var(--theme-surface);box-shadow:0 2px 8px rgba(31,38,43,.06);color:var(--theme-text-secondary);font-size:16px;line-height:1;cursor:pointer;transition:background .18s,border-color .18s,color .18s,transform .18s,box-shadow .18s}.te2-header-tool:hover{background:var(--theme-accent-soft);border-color:var(--theme-accent);color:var(--theme-accent);transform:translateY(-1px);box-shadow:0 5px 14px rgba(31,38,43,.11)}.te2-theme-tool{font-size:18px;color:var(--theme-accent)}.te2-header-tools+.admin-global-profile,.te2-header-tools+.user-center-trigger{margin-left:0}
.te2-layer{position:fixed;inset:0;z-index:2147483000;pointer-events:none}.te2-layer[data-open="true"]{pointer-events:auto}.te2-backdrop{position:absolute;inset:0;background:rgba(23,25,28,.42);backdrop-filter:blur(2px);opacity:0;transition:opacity .2s}.te2-layer[data-open="true"] .te2-backdrop{opacity:1}
.te2-drawer{position:absolute;top:12px;right:12px;width:420px;max-width:calc(100vw - 24px);height:calc(100% - 24px);box-sizing:border-box;overflow:auto;padding:24px;background:var(--theme-surface);border:1px solid var(--theme-border);border-radius:24px;box-shadow:var(--theme-shadow);color:var(--theme-text-primary);transform:translateX(calc(100% + 30px));transition:transform .24s ease}.te2-layer[data-open="true"] .te2-drawer{transform:none}
.te2-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:18px}.te2-head small{color:var(--theme-text-secondary)}.te2-head h2{margin:3px 0 0!important;font-size:22px!important;line-height:1.2!important;letter-spacing:0!important;color:var(--theme-text-primary)!important}.te2-close{width:34px;height:34px;border:0;border-radius:50%;background:var(--theme-hover);color:var(--theme-text-secondary);font-size:21px;cursor:pointer}.te2-section{padding:18px 0;border-top:1px solid var(--theme-border)}.te2-section h3{margin:0 0 12px!important;font-size:13px!important;letter-spacing:0!important;color:var(--theme-text-primary)!important}
.te2-live-preview{display:grid;grid-template-columns:54px 1fr;height:116px;margin-bottom:18px;overflow:hidden;border:1px solid var(--theme-border);border-radius:16px;background:var(--theme-background);box-shadow:inset 0 0 0 1px rgba(255,255,255,.04)}.te2-preview-sidebar{padding:12px 9px;background:var(--theme-sidebar);border-right:1px solid var(--theme-border)}.te2-preview-logo{width:24px;height:24px;border-radius:7px;background:var(--theme-accent)}.te2-preview-lines{display:grid;gap:7px;margin-top:12px}.te2-preview-lines i{display:block;width:30px;height:3px;border-radius:2px;background:var(--theme-text-secondary);opacity:.35}.te2-preview-main{padding:13px}.te2-preview-top{display:flex;justify-content:space-between;margin-bottom:12px}.te2-preview-top i{display:block;width:76px;height:6px;border-radius:3px;background:var(--theme-text-secondary);opacity:.4}.te2-preview-top b{width:28px;height:12px;border-radius:5px;background:var(--theme-accent)}.te2-preview-card{height:49px;padding:8px;box-sizing:border-box;border:1px solid var(--theme-border);border-radius:var(--ui-radius);background:var(--theme-card)}.te2-preview-card i{display:block;width:55%;height:5px;margin-bottom:8px;border-radius:3px;background:var(--theme-text-primary);opacity:.75}.te2-preview-card span{display:block;width:80%;height:4px;border-radius:2px;background:var(--theme-text-secondary);opacity:.35}
.te2-theme-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.te2-theme-card{padding:7px;border:1px solid var(--theme-border);border-radius:12px;background:var(--theme-surface);color:var(--theme-text-secondary);cursor:pointer}.te2-theme-card[aria-pressed="true"]{border-color:var(--theme-accent);box-shadow:0 0 0 2px var(--theme-accent-soft);color:var(--theme-text-primary)}.te2-theme-shot{display:block;height:54px;margin-bottom:7px;padding:7px;box-sizing:border-box;border-radius:8px}.te2-theme-shot i{display:block;height:12px;margin-bottom:6px;border-radius:4px}.te2-theme-shot b{display:block;width:66%;height:6px;border-radius:3px}.te2-shot-light{background:#F6F7F8}.te2-shot-light i{background:#FFF;border:1px solid #E2E5E8}.te2-shot-light b{background:#697077}.te2-shot-eye{background:#F4F1E6}.te2-shot-eye i{background:#FFF;border:1px solid #DED9C9}.te2-shot-eye b{background:#5C8D72}.te2-shot-dark{background:#17191C}.te2-shot-dark i{background:#24282D;border:1px solid #343A40}.te2-shot-dark b{background:#F5F7F8}
.te2-preset-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.te2-preset{padding:7px 2px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--theme-text-secondary);font-size:10px;cursor:pointer}.te2-preset[aria-pressed="true"]{border-color:var(--theme-accent);background:var(--theme-accent-soft);color:var(--theme-text-primary)}.te2-preset i{display:block;width:25px;height:25px;margin:0 auto 5px;border-radius:50%;background:var(--swatch);box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.te2-visual-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.te2-visual-card{min-height:67px;padding:9px;border:1px solid var(--theme-border);border-radius:11px;background:var(--theme-card);color:var(--theme-text-secondary);cursor:pointer}.te2-visual-card[aria-pressed="true"]{border-color:var(--theme-accent);background:var(--theme-accent-soft);color:var(--theme-text-primary)}.te2-font-sample{display:block;margin-bottom:8px;font-size:20px;color:var(--theme-text-primary)}.te2-radius-sample{display:block;height:28px;margin-bottom:7px;border:1px solid var(--theme-accent);background:var(--theme-accent-soft)}.te2-density-sample{display:grid;gap:var(--sample-gap);margin-bottom:8px}.te2-density-sample i{height:4px;border-radius:2px;background:var(--theme-text-secondary);opacity:.45}.te2-layout-sample{display:block;height:30px;margin-bottom:7px;padding:4px;box-sizing:border-box;border:1px solid var(--theme-border);background:var(--theme-background)}.te2-layout-sample i{display:block;height:100%;margin:0 var(--sample-margin);background:var(--theme-accent-soft);border:1px solid var(--theme-accent)}
.te2-row{display:grid;grid-template-columns:108px 1fr;align-items:center;gap:12px;min-height:44px;color:var(--theme-text-secondary);font-size:13px}.te2-row select{width:100%;min-height:36px;padding:6px 9px;border:1px solid var(--theme-border);border-radius:9px;background:var(--theme-card);color:var(--theme-text-primary)}.te2-range{display:block}.te2-range span{display:flex;justify-content:space-between;margin-bottom:9px}.te2-range input{width:100%;accent-color:var(--theme-accent)}.te2-toggle{display:flex;justify-content:space-between;align-items:center;min-height:42px;color:var(--theme-text-secondary);font-size:13px}.te2-toggle input{width:38px;height:20px;accent-color:var(--theme-accent)}.te2-status{min-height:16px;margin:12px 0 0;color:var(--theme-text-secondary);font-size:11px}
.te2-admin-save{width:100%;height:39px;margin-top:10px;border:0;border-radius:10px;background:var(--theme-button);color:var(--theme-button-text);cursor:pointer}
@media(max-width:640px){.te2-drawer{top:0;right:0;width:100%;max-width:none;height:100%;border-radius:0;padding:18px}.te2-theme-grid,.te2-visual-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Wallet theme drawer, matched to open.codexcn.org/wallet. */
.wallet-drawer{top:0;right:0;width:448px;max-width:100vw;height:100%;padding:0;border:0;border-left:1px solid var(--theme-border);border-radius:0;background:var(--theme-surface);box-shadow:-14px 0 40px rgba(0,0,0,.12)}
.wallet-header{position:sticky;top:0;z-index:4;display:flex;justify-content:space-between;align-items:flex-start;height:80px;padding:20px 24px;box-sizing:border-box;border-bottom:1px solid var(--theme-border);background:var(--theme-surface)}.wallet-header h2{margin:0!important;font-size:16px!important;font-weight:650!important;color:var(--theme-text-primary)!important}.wallet-header p{margin:5px 0 0;font-size:13px;color:var(--theme-text-secondary)}.wallet-header>button{width:28px;height:28px;border:0;background:transparent;color:var(--theme-text-primary);font-size:20px;cursor:pointer}
.wallet-scroll{height:calc(100% - 136px);overflow-y:auto;padding:2px 24px 24px;box-sizing:border-box;scrollbar-width:thin;scrollbar-color:var(--theme-border) transparent}.wallet-scroll section{padding:20px 0 0!important;background:transparent!important;border:0!important}.wallet-scroll h3{margin:0 0 10px!important;font-size:14px!important;font-weight:650!important;color:var(--theme-text-primary)!important}.wallet-scroll h3 small{color:var(--theme-text-secondary);font-weight:400}.wallet-help{margin:8px 0 0;font-size:12px;color:var(--theme-text-secondary)}
.wallet-grid{display:grid;gap:8px}.wallet-grid.cols-2{grid-template-columns:repeat(2,1fr)}.wallet-grid.cols-3{grid-template-columns:repeat(3,1fr)}.wallet-grid.cols-4{grid-template-columns:repeat(4,1fr)}.wallet-grid.cols-6{grid-template-columns:repeat(6,1fr)}
.wallet-choice{position:relative;min-width:0;padding:0;border:1px solid var(--theme-border);border-radius:12px;background:transparent;color:var(--theme-text-primary);cursor:pointer}.wallet-choice>span{display:block;padding:6px 2px 0;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wallet-choice[aria-pressed="true"]{border-color:#1597E5!important;box-shadow:0 0 0 1px #1597E5}.wallet-check{position:absolute;right:-6px;top:-7px;z-index:2;width:20px;height:20px;display:grid;place-items:center;border:2px solid var(--theme-surface);border-radius:50%;background:#168ED1;color:#fff;font:700 12px/1 sans-serif}
.wallet-theme-choice{border-color:transparent!important;box-shadow:none!important;text-align:left}.wallet-theme-choice[aria-pressed="true"] .wallet-theme-shot{outline:2px solid #168ED1}.wallet-theme-shot{position:relative;display:block;height:76px;overflow:hidden;border-radius:7px;background:#EEF1F4}.wallet-theme-shot b{position:absolute;left:7px;top:9px;width:21px;height:48px;border-right:1px solid rgba(120,130,140,.2)}.wallet-theme-shot em,.wallet-theme-shot u,.wallet-theme-shot s{position:absolute;display:block;text-decoration:none;border-radius:2px}.wallet-theme-shot em{left:36px;top:12px;width:18px;height:29px;background:#80BCE6}.wallet-theme-shot u{right:13px;top:13px;width:24px;height:24px;border-radius:50%;background:#A8D8F5}.wallet-theme-shot s{left:36px;bottom:10px;width:62px;height:23px;background:#B9DDF4}.shot-light{background:#F3F4F5}.shot-light b{background:#D7DADD}.shot-light em{background:#D7DADD}.shot-light u{background:#FFF}.shot-light s{background:#FFF}.shot-dark{background:#132036}.shot-dark b{background:#223A5E}.shot-dark em{background:#1D5094}.shot-dark u{background:#284E86}.shot-dark s{background:#1C355A}
.preset-grid .wallet-choice{border:0!important;box-shadow:none!important}.preset-grid .wallet-choice[aria-pressed="true"] .wallet-preset{outline:2px solid #168ED1}.wallet-preset{display:block;height:48px;border-radius:13px}.preset-rainbow{background:linear-gradient(135deg,#ff9e00,#e9ed1d,#00c978,#00a8ff,#8059df)}.preset-anthropic{background:linear-gradient(135deg,#FFE4D9,#F49578)}.preset-accessible{background:linear-gradient(135deg,#090909,#F8F8F8)}.preset-midnight{background:linear-gradient(135deg,#47745F,#A77B9F)}.preset-rose{background:linear-gradient(135deg,#F1265D,#FF8EAD)}.preset-lake{background:linear-gradient(135deg,#00C8A1,#009B90)}.preset-sunset{background:linear-gradient(135deg,#D74332,#FF8E6B)}.preset-forest{background:linear-gradient(135deg,#087D77,#517A94)}.preset-sea{background:linear-gradient(135deg,#2269E8,#605AE8)}.preset-lavender{background:linear-gradient(135deg,#8C56C8,#A7D6E2)}
.wallet-aa{display:grid;height:48px;place-items:center;font-size:21px;font-weight:400}.wallet-aa.sans{font-family:Arial,sans-serif;font-weight:650}.wallet-aa.serif{font-family:Georgia,serif}.radius-grid{gap:7px}.radius-grid .wallet-choice{height:51px}.wallet-corner{display:block;width:24px;height:20px;margin:9px 0 0 10px;border-left:1.5px solid var(--theme-text-primary);border-top:1.5px solid var(--theme-text-primary);border-radius:12px 0 0 0}.radius-0{border-radius:0}.radius-0-3{border-radius:5px 0 0 0}.radius-0-5{border-radius:8px 0 0 0}.radius-0-75{border-radius:12px 0 0 0}.radius-1{border-radius:16px 0 0 0}.wallet-lines{display:grid;align-content:center;gap:4px;height:45px;padding:0 10px}.wallet-lines b{display:block;height:2px;background:var(--theme-text-secondary)}.wallet-lines b:nth-child(2){width:75%}.wallet-lines b:nth-child(3){width:55%}.wallet-lines b:nth-child(4){width:40%}
.wallet-layout-mini,.wallet-page-mini{display:block;height:60px;margin:6px;border:1px solid var(--theme-border);border-radius:6px;background:var(--theme-card)}.wallet-layout-mini:before{content:"";display:block;width:26%;height:100%;background:var(--theme-sidebar);border-right:1px solid var(--theme-border)}.wallet-layout-mini.floating:before{height:80%;margin:6%;border:1px solid var(--theme-border);border-radius:5px}.wallet-layout-mini.side:before{width:38%}.wallet-page-mini{position:relative}.wallet-page-mini:before{content:"";position:absolute;inset:10px;background:var(--theme-accent-soft);border:1px solid var(--theme-accent)}.wallet-page-mini.compact-layout:before{inset:10px 18px}.wallet-page-mini.full-layout:before{inset:3px}.wallet-direction{display:grid;height:48px;place-items:center;font-size:25px}.width-grid .wallet-choice{height:62px}
.wallet-footer{position:absolute;left:0;right:0;bottom:0;z-index:5;height:56px;display:flex;align-items:center;justify-content:flex-end;padding:0 24px;border-top:1px solid var(--theme-border);background:var(--theme-surface)}.wallet-footer button{padding:8px 14px;border:0;border-radius:999px;background:#FFF0F0;color:#E33B47;cursor:pointer}
@media(max-width:640px){.wallet-drawer{width:100%;padding:0}.wallet-grid.cols-4{grid-template-columns:repeat(3,1fr)}.wallet-grid.cols-6{grid-template-columns:repeat(3,1fr)}}
[data-te2-appearance] .wallet-drawer .wallet-scroll > section:nth-child(5),[data-te2-appearance] .wallet-drawer .wallet-scroll > section:nth-child(6),[data-te2-appearance] .wallet-drawer .wallet-scroll > section:nth-child(7),[data-te2-appearance] .wallet-drawer .wallet-scroll > section:nth-child(8){display:none!important}
[data-radius="0"]{--ui-radius:0px}[data-radius="0.3"]{--ui-radius:5px}[data-radius="0.5"]{--ui-radius:8px}[data-radius="0.75"]{--ui-radius:12px}[data-radius="1"]{--ui-radius:16px}
[data-font="serif"]{--ui-font-family:Georgia,"Times New Roman",serif}[data-font="source-han-sans"]{--ui-font-family:Arial,"Microsoft YaHei",sans-serif}[data-font="system"]{--ui-font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif}
body{font-family:var(--ui-font-family);font-size:calc(1em * var(--ui-scale,1))}
html[data-preset] body{background-color:var(--theme-background)!important;color:var(--theme-text-primary)}
html[data-preset] main,html[data-preset] .main-content,html[data-preset] .page-content{background-color:var(--theme-background)!important;color:var(--theme-text-primary)}
html[data-preset] [class*="card"],html[data-preset] [class*="panel"],html[data-preset] table{background-color:var(--theme-card);border-color:var(--theme-border)}
html[data-preset] input,html[data-preset] select,html[data-preset] textarea{background-color:var(--theme-surface);border-color:var(--theme-border);color:var(--theme-text-primary)}
html[data-preset] body .yx-admin-shell{background:var(--theme-background)!important;color:var(--theme-text-primary)}
html[data-preset] body .yx-sidebar{background:var(--theme-sidebar)!important;border-color:var(--theme-border)!important}
html[data-preset] body .yx-admin-content,html[data-preset] body .yx-admin-content>header{background:var(--theme-background)!important;color:var(--theme-text-primary)}
html[data-preset] body .yx-panel,html[data-preset] body .yx-section{background:var(--theme-card)!important;border-color:var(--theme-border)!important;color:var(--theme-text-primary)}
html[data-preset] body .yx-panel-head{border-color:var(--theme-border)!important}
html[data-preset] body .yx-sidebar a,html[data-preset] body .yx-sidebar button{color:var(--theme-text-secondary)}
html[data-preset] body .yx-sidebar a.active,html[data-preset] body .yx-sidebar button.active{background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important}
[data-ui-theme-admin]{display:none!important}
.preset-rainbow{background:linear-gradient(135deg,#ff9e00,#e9ed1d,#00c978,#00a8ff,#8059df)!important}.preset-anthropic{background:linear-gradient(135deg,#FFE4D9,#F49578)!important}.preset-accessible{background:linear-gradient(135deg,#090909,#F8F8F8)!important}.preset-midnight{background:linear-gradient(135deg,#47745F,#A77B9F)!important}.preset-rose{background:linear-gradient(135deg,#F1265D,#FF8EAD)!important}.preset-lake{background:linear-gradient(135deg,#00C8A1,#009B90)!important}.preset-sunset{background:linear-gradient(135deg,#D74332,#FF8E6B)!important}.preset-forest{background:linear-gradient(135deg,#087D77,#517A94)!important}.preset-sea{background:linear-gradient(135deg,#2269E8,#605AE8)!important}.preset-lavender{background:linear-gradient(135deg,#8C56C8,#A7D6E2)!important}
.wallet-choice{transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;background:color-mix(in srgb,var(--theme-card) 72%,transparent)}.wallet-choice:hover{transform:translateY(-1px);border-color:var(--theme-accent)}.wallet-aa{font-family:var(--ui-font-family)}
.radius-grid .wallet-choice{display:flex;flex-direction:column;align-items:center;justify-content:flex-start}.radius-grid .wallet-choice>span{padding-top:4px}.wallet-corner{margin:8px 0 0;width:26px;height:22px}
.admin-color-input{width:100%;height:42px;padding:3px;box-sizing:border-box;border:1px solid var(--theme-border);border-radius:9px;background:var(--theme-card)}.admin-select{width:100%;height:40px;padding:0 10px;border:1px solid var(--theme-border);border-radius:9px;background:var(--theme-card);color:var(--theme-text-primary)}.te2-admin-save{padding:9px 18px!important;border-radius:999px!important;background:var(--theme-button)!important;color:var(--theme-button-text)!important}

/* Personal theme drawer polish: clearer hierarchy, softer matching and better readability. */
[data-te2-appearance] .wallet-drawer {
  width: 468px;
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--theme-accent) 10%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-surface) 96%, #ffffff 4%), var(--theme-surface)) !important;
  box-shadow: -18px 0 52px rgba(24, 32, 56, 0.16);
}

[data-te2-appearance] .wallet-header,
[data-te2-appearance] .wallet-footer {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--theme-surface) 96%, #ffffff 4%), color-mix(in srgb, var(--theme-card) 86%, transparent)) !important;
  border-color: color-mix(in srgb, var(--theme-border) 78%, transparent) !important;
}

[data-te2-appearance] .wallet-header {
  height: auto;
  min-height: 84px;
  padding: 22px 24px 18px;
}

[data-te2-appearance] .wallet-header h2 {
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: .01em;
}

[data-te2-appearance] .wallet-header p {
  margin-top: 7px;
  line-height: 1.45;
}

[data-te2-appearance] .wallet-header > button {
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 80%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--theme-card) 82%, transparent);
}

[data-te2-appearance] .wallet-scroll {
  height: calc(100% - 142px);
  padding: 6px 24px 28px;
}

[data-te2-appearance] .wallet-scroll section {
  margin-top: 14px !important;
  padding: 16px !important;
  border: 1px solid color-mix(in srgb, var(--theme-border) 72%, transparent) !important;
  border-radius: 18px;
  background: color-mix(in srgb, var(--theme-card) 76%, transparent) !important;
  box-shadow: 0 10px 26px rgba(20, 31, 58, .045);
}

[data-te2-appearance] .wallet-scroll h3 {
  margin-bottom: 12px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

[data-te2-appearance] .wallet-grid {
  gap: 10px;
}

[data-te2-appearance] .wallet-choice {
  min-height: 74px;
  padding: 8px;
  border-color: color-mix(in srgb, var(--theme-border) 72%, transparent);
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--theme-card) 90%, #ffffff 10%), color-mix(in srgb, var(--theme-card) 72%, transparent)) !important;
}

[data-te2-appearance] .wallet-choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--theme-accent) 12%, transparent);
}

[data-te2-appearance] .wallet-choice[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--theme-accent) 86%, white 14%) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--theme-accent-soft) 55%, var(--theme-card) 45%), color-mix(in srgb, var(--theme-card) 80%, transparent)) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent) 22%, transparent), 0 12px 26px color-mix(in srgb, var(--theme-accent) 12%, transparent) !important;
}

[data-te2-appearance] .wallet-choice > span {
  padding-top: 8px;
  color: var(--theme-text-primary);
  font-size: 12px;
  font-weight: 750;
}

[data-te2-appearance] .wallet-theme-choice {
  min-height: 112px;
  padding: 0;
  border-color: transparent !important;
  background: transparent !important;
}

[data-te2-appearance] .wallet-theme-choice > span {
  padding-left: 2px;
}

[data-te2-appearance] .wallet-theme-shot {
  height: 86px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 70%, transparent);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

[data-te2-appearance] .wallet-theme-choice[aria-pressed="true"] .wallet-theme-shot {
  outline: 2px solid color-mix(in srgb, var(--theme-accent) 86%, white 14%);
  outline-offset: 2px;
}

[data-te2-appearance] .preset-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

[data-te2-appearance] .preset-grid .wallet-choice {
  min-height: 78px;
  padding: 6px 4px;
}

[data-te2-appearance] .wallet-preset {
  height: 42px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.26), 0 8px 18px rgba(20,31,58,.08);
}

/* Per-account quick presets sit at the top of the existing appearance drawer. */
[data-te2-appearance] .te2-personal-presets {
  display:grid;
  gap:12px;
}

[data-te2-appearance] .te2-personal-presets-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

[data-te2-appearance] .te2-personal-presets-head h3,
[data-te2-appearance] .te2-personal-presets-head p {
  margin:0;
}

[data-te2-appearance] .te2-personal-presets-head p {
  margin-top:4px;
  color:var(--theme-text-secondary);
  font-size:12px;
  line-height:1.45;
}

[data-te2-appearance] .te2-personal-slots {
  display:flex;
  align-items:center;
  gap:12px;
}

html[data-theme] body [data-te2-appearance] .te2-personal-slot,
html[data-theme] body [data-te2-appearance] .te2-personal-slot[aria-pressed="true"] {
  display:grid;
  gap:5px;
  justify-items:center;
  min-width:44px;
  padding:0;
  border:0;
  background:transparent!important;
  background-color:transparent!important;
  color:var(--theme-text-secondary);
  cursor:pointer;
}

[data-te2-appearance] .te2-personal-dot {
  width:30px;
  height:30px;
  border:2px solid color-mix(in srgb,var(--theme-surface) 80%,var(--theme-border));
  border-radius:50%;
  box-shadow:0 5px 12px rgba(20,31,58,.13);
}

[data-te2-appearance] .te2-personal-dot-empty {
  background:repeating-linear-gradient(135deg,var(--theme-hover) 0 5px,var(--theme-surface) 5px 10px)!important;
}

[data-te2-appearance] .te2-personal-slot[aria-pressed="true"] .te2-personal-dot {
  outline:2px solid var(--theme-accent);
  outline-offset:3px;
}

[data-te2-appearance] .te2-personal-slot span {
  font-size:11px;
}

[data-te2-appearance] .te2-personal-save {
  flex:0 0 auto;
  min-height:32px;
  padding:0 10px;
  border:1px solid color-mix(in srgb,var(--theme-accent) 55%,var(--theme-border));
  border-radius:8px;
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
  font:700 12px/1 var(--ui-font-family,system-ui);
  cursor:pointer;
}

.te2-weekly-hint {
  position:fixed;
  top:72px;
  right:24px;
  z-index:10050;
  max-width:280px;
  padding:10px 14px;
  border:1px solid color-mix(in srgb,var(--theme-accent) 42%,var(--theme-border));
  border-radius:8px;
  background:var(--theme-surface);
  color:var(--theme-text-primary);
  box-shadow:var(--theme-shadow);
  font:600 13px/1.4 var(--ui-font-family,system-ui);
  cursor:pointer;
}

[data-te2-appearance] .wallet-aa,
[data-te2-appearance] .wallet-lines,
[data-te2-appearance] .wallet-layout-mini,
[data-te2-appearance] .wallet-page-mini {
  border-radius: 12px;
  background: color-mix(in srgb, var(--theme-surface) 64%, transparent);
}

[data-te2-appearance] .wallet-footer button {
  background: color-mix(in srgb, #fff0f0 80%, var(--theme-card) 20%);
  color: #c72f39;
  font-weight: 800;
}

:root[data-theme="dark"] [data-te2-appearance] .wallet-drawer {
  background:
    radial-gradient(circle at 16% 0%, rgba(83, 130, 255, .12), transparent 32%),
    linear-gradient(180deg, #25232a, #1d1b21) !important;
}

:root[data-theme="dark"] [data-te2-appearance] .wallet-scroll section,
:root[data-theme="dark"] [data-te2-appearance] .wallet-choice {
  background: #2c2931 !important;
  border-color: #4a4350 !important;
}

@media (max-width: 640px) {
  [data-te2-appearance] .wallet-drawer { width: 100%; }
  [data-te2-appearance] .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-te2-appearance] .wallet-scroll section { padding: 14px !important; }
}

/* Shared semantic bridge. Existing modules and newly created pages inherit one palette. */
:root[data-preset] {
  --bg:var(--theme-background); --panel:var(--theme-surface);
  --line:var(--theme-border); --line-strong:var(--theme-border);
  --text:var(--theme-text-primary); --muted:var(--theme-text-secondary);
  --blue:var(--theme-accent); --shadow:var(--theme-shadow);
  --yx-bg:var(--theme-background); --yx-panel:var(--theme-surface);
  --yx-panel-soft:var(--theme-card); --yx-ink:var(--theme-text-primary);
  --yx-muted:var(--theme-text-secondary); --yx-line:var(--theme-border);
  --yx-blue:var(--theme-accent);
  --ui-page-bg:var(--theme-background); --ui-surface:var(--theme-surface);
  --ui-card-bg:var(--theme-card); --ui-input-bg:var(--theme-surface);
  --ui-text:var(--theme-text-primary); --ui-muted:var(--theme-text-secondary);
  --ui-border:var(--theme-border); --ui-accent:var(--theme-accent);
}

html[data-preset] :where(input,select,textarea) {
  background-color:var(--theme-surface)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] :where(input,textarea)::placeholder { color:var(--theme-text-secondary)!important;opacity:.78 }
html[data-preset] :where(table,thead,tbody,tr,th,td) { border-color:var(--theme-border)!important }
html[data-preset] :where(table,tbody,tr,td) { background-color:var(--theme-card)!important;color:var(--theme-text-primary) }
html[data-preset] :where(thead,th) { background-color:var(--theme-hover)!important;color:var(--theme-text-secondary)!important }

html[data-preset] :where(.pagination,.pager,.page-controls,.table-pagination,[class$="-pagination"]) {
  background-color:var(--theme-card)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-secondary)!important;
}
html[data-preset] :where(.pagination,.pager,.page-controls,.table-pagination,[class$="-pagination"]) button {
  background-color:var(--theme-surface)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] :where(.pagination,.pager,.page-controls,.table-pagination,[class$="-pagination"]) button.active,
html[data-preset] :where(.pagination,.pager,.page-controls,.table-pagination,[class$="-pagination"]) [aria-current="page"] {
  background-color:var(--theme-accent)!important;
  border-color:var(--theme-accent)!important;
  color:var(--theme-button-text)!important;
}

html[data-preset] :where(.empty-state,.error-state,.account-empty-state,.analysis-empty-state,[class$="-empty"],[class$="-error"]) {
  background-color:var(--theme-card)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-secondary)!important;
}

/* Account OS search, filters and publish surfaces are semantic UI, not media content. */
html[data-preset] :where(.dy-search,.dy-keyword-form,.search-box,.filter-bar,.filter-select) {
  background-color:var(--theme-surface)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] :where(.publish-center-shell,.inline-publish,.inline-publish-head,.inline-publish-tabs,.inline-publish-card,
  .pcv5-publish-engine,.pcv5-publish-engine .pcv5-card,.pcv5-publish-engine .pcv5-empty,
  .dy-publish,.dy-publish-row,.dy-publish-grid) {
  background-color:var(--theme-card)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] :where(.inline-publish-tabs button,.publish-field,.publish-option-group,.publish-preview,
  .publish-side-tabs,.publish-record,.pcv5-publish-engine input,.pcv5-publish-engine select,.pcv5-publish-engine textarea) {
  background-color:var(--theme-surface)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}

/* Retire the legacy cyber skin inside the current publish application. */
html[data-preset] #publishCenterInlineApp,
html[data-preset] #publishCenterInlineApp .pcv5-shell {
  --pcv5-bg:var(--theme-background); --pcv5-card:var(--theme-card);
  --pcv5-line:var(--theme-border); --pcv5-text:var(--theme-text-primary);
  --pcv5-muted:var(--theme-text-secondary); --pcv5-blue:var(--theme-accent);
  --pcv5-purple:var(--theme-accent); --pcv5-shadow:var(--theme-shadow);
  background:var(--theme-background)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}
html[data-preset] #publishCenterInlineApp :where(.pcv5-panel,.pcv5-card,.pcv5-workbench,.pcv5-content-pool,
  .pcv5-matrix-pool,.pcv5-control-panel,.pcv5-stage,.pcv5-step,.pcv5-input,.pcv5-output,
  .pcv5-preview,.pcv5-sidebar,.pcv5-toolbar,.pcv5-form,.pcv5-field,.pcv5-option,.pcv5-chip,
  .pcv5-pill,.pcv5-empty,.pcv5-empty-mini,section,article,aside) {
  background:var(--theme-card)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}
html[data-preset] #publishCenterInlineApp :where(input,select,textarea) {
  background:var(--theme-surface)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}
html[data-preset] #publishCenterInlineApp :where(.pcv5-shell,.pcv5-panel)::before,
html[data-preset] #publishCenterInlineApp :where(.pcv5-shell,.pcv5-panel)::after { display:none!important }

/* Data acquisition center is embedded in admin but owns a legacy dark palette. */
:root[data-preset] {
  --border:var(--theme-border); --primary:var(--theme-accent);
  --accent:var(--theme-accent); --line:var(--theme-border);
}
html[data-preset] body.dac-embed-mode,
html[data-preset] .dac-shell,
html[data-preset] .dac-main {
  --bg:var(--theme-background); --panel:var(--theme-card);
  --panel-2:var(--theme-surface); --border:var(--theme-border);
  --primary:var(--theme-accent); --accent:var(--theme-accent);
  --text:var(--theme-text-primary); --muted:var(--theme-text-secondary);
  --line:var(--theme-border);
  background:var(--theme-background)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] :where(.dac-summary article,.dac-panel,.dac-method,.dac-flow article,.dac-detail article,
  .dac-dashboard-card,.dac-dashboard-plans,.dac-plan-health,.dac-plan-health article,
  .dac-timeline article,.dac-table-wrap,.dac-top-platform-switch) {
  background:var(--theme-card)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:var(--theme-shadow)!important;
}
html[data-preset] :where(.dac-dashboard,.dac-dashboard > article,.dac-dashboard-plans > article,
  .dac-top-platform-scroll,.dac-top-platform-scroll button,.dac-timeline-step,.dac-abnormal-center,
  .dac-abnormal-center article,.dac-terminal,.dac-modal > section,.dac-modal header) {
  background:var(--theme-surface)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}
html[data-preset] :where(.dac-summary span,.dac-topbar p,.dac-panel-head small,.dac-dashboard small,
  .dac-plan-health small,.dac-table td,.dac-table th) { color:var(--theme-text-secondary)!important }
html[data-preset] :where(.dac-eyebrow,.dac-panel-head span,.dac-dashboard strong,
  .dac-plan-health strong) { color:var(--theme-accent)!important }
html[data-preset] :where(.dac-actions button,.dac-actions a,.dac-panel-head button) {
  background:var(--theme-surface)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] .dac-top-platform-scroll::-webkit-scrollbar-track { background:var(--theme-hover)!important }
html[data-preset] .dac-top-platform-scroll::-webkit-scrollbar-thumb { background:var(--theme-accent)!important }
html[data-preset] .dac-modal { background:color-mix(in srgb,var(--theme-text-primary) 22%,transparent)!important }

html[data-preset] body:not(.embed-mode) .yx-sidebar,
html[data-preset] body:not(.embed-mode) .yx-sidebar .yx-menu-tree {
  max-width:252px;
  overflow-x:hidden!important;
}

/* Dark mode: restrained deep-space texture across frontend and admin canvases. */
:root[data-theme="dark"] body,
:root[data-theme="dark"] body > main,
:root[data-theme="dark"] .main-content,
:root[data-theme="dark"] .page-content,
:root[data-theme="dark"] .yx-admin-content,
:root[data-theme="dark"] .dac-main {
  background-color:var(--theme-background)!important;
  background-image:var(--theme-background-image)!important;
  background-size:190px 170px,260px 230px,310px 280px,370px 320px,cover!important;
  background-attachment:fixed!important;
}
@media(prefers-color-scheme:dark){
  :root[data-theme="system"] body,
  :root[data-theme="system"] body > main,
  :root[data-theme="system"] .main-content,
  :root[data-theme="system"] .page-content,
  :root[data-theme="system"] .yx-admin-content,
  :root[data-theme="system"] .dac-main {
    background-color:var(--theme-background)!important;
    background-image:var(--theme-background-image)!important;
    background-size:190px 170px,260px 230px,310px 280px,370px 320px,cover!important;
    background-attachment:fixed!important;
  }
}
:root[data-theme="dark"] .wallet-drawer {
  background-color:var(--theme-surface)!important;
  background-image:linear-gradient(165deg,rgba(104,167,255,.055),transparent 34%),linear-gradient(180deg,#151C2C,#111827)!important;
}
.te2-shot-dark,.shot-dark {
  background:radial-gradient(circle at 14% 20%,rgba(255,255,255,.76) 0 1px,transparent 1.5px),radial-gradient(circle at 82% 62%,rgba(104,167,255,.68) 0 1px,transparent 1.5px),linear-gradient(145deg,#080C16,#16243D)!important;
}
.te2-shot-dark i{background:#1B2436!important;border-color:#2D3950!important}.te2-shot-dark b{background:#F5F7FB!important}
.shot-dark b{background:#202D43!important}.shot-dark em{background:#275C9F!important}.shot-dark u{background:#315B91!important}.shot-dark s{background:#1E3B62!important}

/* Full dark coverage for legacy frontend and admin shells. */
:root[data-theme="dark"] body .dc-sidebar,
:root[data-theme="dark"] body .yx-sidebar {
  background-color:#0E1525!important;
  background-image:radial-gradient(circle at 22% 16%,rgba(166,206,255,.42) 0 1px,transparent 1.5px),radial-gradient(circle at 76% 68%,rgba(104,167,255,.32) 0 1px,transparent 1.5px),linear-gradient(180deg,#0C1220,#111B2E)!important;
  background-size:210px 190px,290px 260px,cover!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}
:root[data-theme="dark"] body .dc-main,
:root[data-theme="dark"] body .yx-admin-content {
  background-color:var(--theme-background)!important;
  background-image:var(--theme-background-image)!important;
  background-size:190px 170px,260px 230px,310px 280px,370px 320px,cover!important;
  color:var(--theme-text-primary)!important;
}
:root[data-theme="dark"] body :where(.topbar,.os-top-flow,.side-card,.metric-card,.cloud-hot-table,
  .insight-hub,.insight-section,.track-table,.rival-table,.account-stat-card,.account-card,
  .panel,.bubble-chart,.platform-trend-panel,.platform-topbar,.shell>aside,
  .yx-admin-content>header,.yx-panel,.yx-section,.yx-stat,.yx-table-wrap) {
  background-color:rgba(21,28,44,.94)!important;
  background-image:radial-gradient(circle at 14% 24%,rgba(166,206,255,.22) 0 1px,transparent 1.5px),radial-gradient(circle at 84% 72%,rgba(104,167,255,.2) 0 1px,transparent 1.5px),linear-gradient(145deg,rgba(24,34,53,.97),rgba(15,23,39,.96))!important;
  background-size:240px 210px,320px 280px,cover!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:0 12px 34px rgba(0,0,0,.24)!important;
}
:root[data-theme="dark"] body :where(.dc-sidebar button,.dc-sidebar a,.os-top-flow a,.os-top-flow button,
  .topbar button,.topbar input,.topbar select,.metric-card button,.yx-sidebar button,.yx-sidebar a,
  .yx-admin-content input,.yx-admin-content select,.yx-admin-content textarea,.yx-admin-content table,
  .yx-admin-content thead,.yx-admin-content tbody,.yx-admin-content tr,.yx-admin-content th,.yx-admin-content td) {
  background-color:rgba(27,36,54,.94)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}
:root[data-theme="dark"] body :where(.dc-sidebar span,.dc-sidebar small,.topbar span,.topbar small,
  .metric-card span,.metric-card em,.yx-sidebar span,.yx-sidebar small) { color:var(--theme-text-secondary)!important }
:root[data-theme="dark"] body :where(.platform-trend-row,.track-row,.rival-row,#trackRows,#rivalRows,
  .bubble-chart>div,.bubble-metric,.opportunity-radar-legend>div,.analysis-empty-state,.real-data-state,
  .account-create-drawer,.account-guide-text,.account-drawer-card,.scoreForm,.plan-history,.pc-video-preview) {
  background-color:rgba(21,28,44,.94)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}
:root[data-theme="dark"] body form.scoreForm,
:root[data-theme="dark"] body form#scoreForm {
  background:rgba(21,28,44,.94)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}

/* Codex-style dark theme: flat charcoal surfaces with restrained violet accents. */
:root[data-theme="dark"] {
  --theme-background:#181719;
  --theme-surface:#222023;
  --theme-card:#1D1C1F;
  --theme-sidebar:#242226;
  --theme-text-primary:#F2EFF4;
  --theme-text-secondary:#A7A0AD;
  --theme-border:#3B3341;
  --theme-hover:#302A34;
  --theme-accent:#A78BFA;
  --theme-accent-soft:#352C43;
  --theme-button:#A78BFA;
  --theme-button-text:#18151C;
  --theme-shadow:0 18px 48px rgba(0,0,0,.28);
  --theme-background-image:none;
}
:root[data-theme="dark"] body,
:root[data-theme="dark"] body > main,
:root[data-theme="dark"] .dc-main,
:root[data-theme="dark"] .main-content,
:root[data-theme="dark"] .page-content,
:root[data-theme="dark"] .yx-admin-content,
:root[data-theme="dark"] .dac-main {
  background:#181719!important;
  background-image:none!important;
}
:root[data-theme="dark"] body :where(.dc-sidebar,.yx-sidebar) {
  background:#242226!important;
  background-image:none!important;
  border-color:#3B3341!important;
}
:root[data-theme="dark"] body :where(.topbar,.os-top-flow,.side-card,.metric-card,.cloud-hot-table,
  .insight-hub,.insight-section,.track-table,.rival-table,.account-stat-card,.account-card,.panel,
  .bubble-chart,.platform-trend-panel,.platform-topbar,.shell>aside,.yx-admin-content>header,
  .yx-panel,.yx-section,.yx-stat,.yx-table-wrap,.dac-panel,.dac-plan-health,.dac-summary article) {
  background:#1D1C1F!important;
  background-image:none!important;
  border-color:#3B3341!important;
  box-shadow:0 12px 32px rgba(0,0,0,.2)!important;
}
:root[data-theme="dark"] body :where(.platform-trend-row,.track-row,.rival-row,#trackRows,#rivalRows,
  .bubble-chart>div,.bubble-metric,.opportunity-radar-legend>div,.analysis-empty-state,.real-data-state,
  .account-create-drawer,.account-guide-text,.account-drawer-card,.scoreForm,#scoreForm,.plan-history,
  .pc-video-preview,.dac-dashboard>article,.dac-dashboard-plans>article,.dac-timeline-step) {
  background:#222023!important;
  background-image:none!important;
  border-color:#3B3341!important;
  color:#F2EFF4!important;
}
:root[data-theme="dark"] body :where(input,select,textarea,table,thead,tbody,tr,th,td) {
  background-color:#222023!important;
  background-image:none!important;
  border-color:#3B3341!important;
  color:#F2EFF4!important;
}
:root[data-theme="dark"] body :where(button,a)[aria-current="page"],
:root[data-theme="dark"] body :where(button,a).active,
:root[data-theme="dark"] body :where(button,a)[aria-pressed="true"] {
  border-color:#6E5A7D!important;
  background-color:#352C43!important;
  color:#F2EFF4!important;
}
:root[data-theme="dark"] .wallet-drawer,
:root[data-theme="dark"] .wallet-header,
:root[data-theme="dark"] .wallet-footer {
  background:#222023!important;
  background-image:none!important;
  border-color:#3B3341!important;
}
html:root[data-theme="dark"] body > main.dc-main,
html:root[data-theme="dark"] body .dc-main,
html:root[data-theme="dark"] body .yx-admin-content,
html:root[data-theme="dark"] body .dac-main {
  background:#181719!important;
  background-image:none!important;
  background-size:auto!important;
  background-attachment:scroll!important;
}
html:root[data-theme="dark"] body .dc-sidebar,
html:root[data-theme="dark"] body .yx-sidebar {
  background:#242226!important;
  background-image:none!important;
  background-size:auto!important;
  border-color:#3B3341!important;
}

/* Final neutral tuning against the Codex reference. */
html:root[data-theme="dark"] {
  --theme-background:#1F1E20;
  --theme-surface:#252326;
  --theme-card:#222123;
  --theme-sidebar:#272529;
  --theme-border:#39343C;
  --theme-hover:#2D2A2F;
  --theme-accent:#B79ACB;
  --theme-accent-soft:#3A3041;
  --theme-text-primary:#F1EEF2;
  --theme-text-secondary:#A49DA7;
}
html:root[data-theme="dark"] body,
html:root[data-theme="dark"] body > main.dc-main,
html:root[data-theme="dark"] body .dc-main,
html:root[data-theme="dark"] body .yx-admin-content,
html:root[data-theme="dark"] body .dac-main { background:#1F1E20!important }
html:root[data-theme="dark"] body :where(.dc-sidebar,.yx-sidebar) { background:#272529!important }
html:root[data-theme="dark"] body :where(.topbar,.os-top-flow,.side-card,.metric-card,.cloud-hot-table,
  .insight-hub,.insight-section,.track-table,.rival-table,.account-stat-card,.account-card,.panel,
  .bubble-chart,.platform-trend-panel,.platform-topbar,.yx-admin-content>header,.yx-panel,.yx-section,
  .yx-stat,.yx-table-wrap,.dac-panel,.dac-plan-health,.dac-summary article) {
  background:#222123!important;
  background-image:none!important;
  border-color:#39343C!important;
  box-shadow:none!important;
}
html:root[data-theme="dark"] body :where(.dc-sidebar button,.dc-sidebar a,.os-top-flow a,.os-top-flow button,
  .topbar button,.metric-card button,.yx-sidebar button,.yx-sidebar a,.pagination button,
  .pager button,.page-controls button) {
  background:#252326!important;
  background-image:none!important;
  border-color:#39343C!important;
  color:#D8D2DA!important;
  box-shadow:none!important;
}
html:root[data-theme="dark"] body :where(.dc-sidebar button,.dc-sidebar a,.os-top-flow a,.os-top-flow button,
  .yx-sidebar button,.yx-sidebar a).active,
html:root[data-theme="dark"] body :where(.dc-sidebar button,.dc-sidebar a,.os-top-flow a,.os-top-flow button,
  .yx-sidebar button,.yx-sidebar a)[aria-current="page"] {
  background:#3A3041!important;
  border-color:#51445B!important;
  color:#F1EEF2!important;
}
html:root[data-theme="dark"] body :where(input,select,textarea,table,thead,tbody,tr,th,td) {
  background:#222123!important;
  border-color:#39343C!important;
  color:#D8D2DA!important;
}
html:root[data-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,strong) { color:#F1EEF2!important }
html:root[data-theme="dark"] body :where(p,small,em) { color:#A49DA7!important }

/* Flat dark mode: no glow, gradient, glass or elevated lighting. */
html:root[data-theme="dark"] {
  --theme-background:#111111;
  --theme-surface:#191919;
  --theme-card:#1E1E1E;
  --theme-sidebar:#161616;
  --theme-border:#303030;
  --theme-hover:#252525;
  --theme-accent:#9B8AA5;
  --theme-accent-soft:#2B272E;
  --theme-text-primary:#EEEEEE;
  --theme-text-secondary:#9B9B9B;
  --theme-shadow:none;
}
html:root[data-theme="dark"] body,
html:root[data-theme="dark"] body > main,
html:root[data-theme="dark"] body :where(.dc-main,.yx-admin-content,.dac-main,.main-content,.page-content) {
  background:#111111!important;
  background-image:none!important;
}
html:root[data-theme="dark"] body :where(.dc-sidebar,.yx-sidebar) {
  background:#161616!important;
  background-image:none!important;
  border-color:#303030!important;
}
html:root[data-theme="dark"] body :where(header,nav,section,article,aside,footer,table,thead,tbody,tr,th,td,
  .panel,.card,.metric-card,.side-card,.topbar,.os-top-flow,.bubble-chart,.wallet-drawer,
  .wallet-header,.wallet-footer,.te2-avatar-menu,.dac-panel,.dac-plan-health,.yx-panel,.yx-section,.yx-stat) {
  box-shadow:none!important;
  text-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
html:root[data-theme="dark"] body :where(.topbar,.os-top-flow,.side-card,.metric-card,.cloud-hot-table,
  .insight-hub,.insight-section,.track-table,.rival-table,.account-stat-card,.account-card,.panel,
  .bubble-chart,.platform-trend-panel,.platform-topbar,.yx-admin-content>header,.yx-panel,.yx-section,
  .yx-stat,.yx-table-wrap,.dac-panel,.dac-plan-health,.dac-summary article) {
  background:#1E1E1E!important;
  background-image:none!important;
  border-color:#303030!important;
}
html:root[data-theme="dark"] body :where(button,input,select,textarea,.wallet-choice,.te2-header-tool,
  .platform-trend-row,.track-row,.rival-row,#trackRows,#rivalRows,.bubble-chart>div,
  .opportunity-radar-legend>div,.account-create-drawer,.account-guide-text,.account-drawer-card,
  .plan-history,.pc-video-preview) {
  background:#191919!important;
  background-image:none!important;
  border-color:#303030!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
html:root[data-theme="dark"] body :where(button,a).active,
html:root[data-theme="dark"] body :where(button,a)[aria-current="page"],
html:root[data-theme="dark"] body :where(button,a)[aria-pressed="true"] {
  background:#2B272E!important;
  background-image:none!important;
  border-color:#48404D!important;
  box-shadow:none!important;
  color:#EEEEEE!important;
}
html:root[data-theme="dark"] .te2-backdrop {
  background:rgba(0,0,0,.62)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}

/* Near-black and acid-lime palette. */
html:root[data-theme="dark"] {
  --theme-background:#08090A;
  --theme-surface:#0E1011;
  --theme-card:#121415;
  --theme-sidebar:#0B0D0E;
  --theme-border:#272A2B;
  --theme-hover:#191C1D;
  --theme-accent:#E4F222;
  --theme-accent-soft:#252A0B;
  --theme-button:#E4F222;
  --theme-button-text:#08090A;
  --theme-text-primary:#F5F3EA;
  --theme-text-secondary:#A5A69F;
  --theme-shadow:none;
}
html:root[data-theme="dark"] body,
html:root[data-theme="dark"] body > main,
html:root[data-theme="dark"] body :where(.dc-main,.yx-admin-content,.dac-main,.main-content,.page-content) {
  background:#08090A!important;
}
html:root[data-theme="dark"] body :where(.dc-sidebar,.yx-sidebar) {
  background:#0B0D0E!important;
  border-color:#272A2B!important;
}
html:root[data-theme="dark"] body :where(.topbar,.os-top-flow,.side-card,.metric-card,.cloud-hot-table,
  .insight-hub,.insight-section,.track-table,.rival-table,.account-stat-card,.account-card,.panel,
  .bubble-chart,.platform-trend-panel,.platform-topbar,.yx-admin-content>header,.yx-panel,.yx-section,
  .yx-stat,.yx-table-wrap,.dac-panel,.dac-plan-health,.dac-summary article) {
  background:#121415!important;
  border-color:#272A2B!important;
}
html:root[data-theme="dark"] body :where(button,input,select,textarea,.wallet-choice,.te2-header-tool,
  .platform-trend-row,.track-row,.rival-row,#trackRows,#rivalRows,.bubble-chart>div,
  .opportunity-radar-legend>div,.account-create-drawer,.account-guide-text,.account-drawer-card,
  .plan-history,.pc-video-preview,table,thead,tbody,tr,th,td) {
  background:#0E1011!important;
  border-color:#272A2B!important;
  color:#F5F3EA!important;
}
html:root[data-theme="dark"] body :where(button,a).active,
html:root[data-theme="dark"] body :where(button,a)[aria-current="page"],
html:root[data-theme="dark"] body :where(button,a)[aria-pressed="true"] {
  background:#252A0B!important;
  border-color:#E4F222!important;
  color:#E4F222!important;
}
html:root[data-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,strong) { color:#F5F3EA!important }
html:root[data-theme="dark"] body :where(p,small,em) { color:#A5A69F!important }

/* Deep gray platform palette: neutral surfaces with purple, red and brown accents. */
html:root[data-theme="dark"] {
  --theme-background:#242326;
  --theme-surface:#2C2A2E;
  --theme-card:#343136;
  --theme-sidebar:#29272B;
  --theme-border:#4A454D;
  --theme-hover:#3D3940;
  --theme-accent:#A98BEA;
  --theme-accent-soft:#493D5B;
  --theme-button:#8D68D5;
  --theme-button-text:#FFFFFF;
  --theme-text-primary:#FFFFFF;
  --theme-text-secondary:#C9C2CB;
  --theme-danger:#E46D78;
  --theme-danger-soft:#543238;
  --theme-warm:#B48770;
  --theme-warm-soft:#4B3B35;
  --theme-shadow:0 12px 32px rgba(12,10,14,.22);
  --theme-background-image:none;
  color-scheme:dark;
}
html:root[data-theme="dark"] body,
html:root[data-theme="dark"] body > main,
html:root[data-theme="dark"] body :where(.dc-main,.yx-admin-shell,.yx-admin-content,.dac-shell,.dac-main,
  .main-content,.page-content,[class$="-page"],[class$="-shell"]) {
  background:#242326!important;
  background-image:none!important;
  color:#FFFFFF!important;
}
html:root[data-theme="dark"] body :where(.dc-sidebar,.yx-sidebar,[class$="-sidebar"]) {
  background:#29272B!important;
  background-image:none!important;
  border-color:#4A454D!important;
  color:#FFFFFF!important;
}
html:root[data-theme="dark"] body :where(header,nav,.topbar,.os-top-flow,.platform-topbar,
  .yx-admin-content>header,.wallet-header,.wallet-footer,.yx-brand) {
  background-color:#2C2A2E!important;
  background-image:none!important;
  border-color:#4A454D!important;
  color:#FFFFFF!important;
}
html:root[data-theme="dark"] body :where(section,article,.panel,[class*="card"],[class*="panel"],
  .yx-panel,.yx-section,.yx-stat,.yx-table-wrap,.dac-panel,.dac-plan-health,.wallet-drawer,
  .te2-avatar-menu,.modal-content,.drawer-content,.yx-panel-head,.yx-section-head,.yx-toolbar,
  .yx-filters,.yx-table-toolbar,.yx-pagination,.yx-empty,.yx-form-grid) {
  background-color:#343136!important;
  background-image:none!important;
  border-color:#4A454D!important;
  color:#FFFFFF!important;
}
html:root[data-theme="dark"] body :where(input,select,textarea,.wallet-choice,.te2-header-tool,
  table,tbody,tr,td) {
  background-color:#2C2A2E!important;
  background-image:none!important;
  border-color:#4A454D!important;
  color:#FFFFFF!important;
}
html:root[data-theme="dark"] body :where(thead,th) {
  background-color:#3D3940!important;
  border-color:#4A454D!important;
  color:#DED8E0!important;
}
html:root[data-theme="dark"] body :where(tbody tr:hover,button:hover,a:hover) {
  background-color:#3D3940!important;
}
html:root[data-theme="dark"] body :where(button,a).active,
html:root[data-theme="dark"] body :where(button,a)[aria-current="page"],
html:root[data-theme="dark"] body :where(button,a)[aria-pressed="true"] {
  background:#493D5B!important;
  border-color:#A98BEA!important;
  color:#FFFFFF!important;
}
html:root[data-theme="dark"] body :where(.primary,.btn-primary,.yx-primary,[data-variant="primary"]) {
  background:#8D68D5!important;
  border-color:#A98BEA!important;
  color:#FFFFFF!important;
}
html:root[data-theme="dark"] body :where(.danger,.btn-danger,.delete,.remove,[data-variant="danger"],
  [class*="error"],[class*="danger"]) {
  background-color:#543238!important;
  border-color:#8A4650!important;
  color:#FFB8BE!important;
}
html:root[data-theme="dark"] body :where(.tag,.badge,.status-tag,[class*="tag"],[class*="badge"]) {
  background-color:#4B3B35!important;
  border-color:#72584D!important;
  color:#E7C2AF!important;
}
html:root[data-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,strong,label) { color:#FFFFFF!important }
html:root[data-theme="dark"] body :where(p,small,em,.muted,[class*="muted"],input::placeholder,textarea::placeholder) {
  color:#C9C2CB!important;
}
html:root[data-theme="dark"] .te2-backdrop {
  background:rgba(20,18,22,.64)!important;
  backdrop-filter:blur(4px)!important;
  -webkit-backdrop-filter:blur(4px)!important;
}
html:root[data-theme="dark"] body :where(.metric-card,.insight-metric-card,.account-stat-card,
  .operation-kpi-card,.pc-metric-card,.flow-card)::before,
html:root[data-theme="dark"] body :where(.metric-card,.insight-metric-card,.account-stat-card,
  .operation-kpi-card,.pc-metric-card,.flow-card)::after {
  content:none!important;
  display:none!important;
  background:none!important;
  box-shadow:none!important;
  filter:none!important;
}
html:root[data-theme="dark"] body :where(.metric-card,.insight-metric-card,.account-stat-card,
  .operation-kpi-card,.pc-metric-card,.flow-card) {
  background:#343136!important;
  background-image:none!important;
  box-shadow:none!important;
  filter:none!important;
}

/* Remove decorative lighting from every semantic business surface in dark mode. */
html:root[data-theme="dark"] body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,
  .xhs-panel,.hub-panel,.account-card,.account-stat-card,.pc-card,.inline-publish-card,
  .platform-trend-panel,.insight-metric-card,.xhs-index-card,.module-card,.kpi-card,
  .account-drawer-card,.account-guide-card,.account-total-card,.account-os-overview-card,
  .account-os-v10-action-card,.account-os-v10-score-panel,.account-task-item,.operation-kpi-card,
  .operation-suggestion,.publish-record-card,.publish-side-panel,.content-card,.content-panel,
  .side-card,.track-panel,.analysis-source-card)::before,
html:root[data-theme="dark"] body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,
  .xhs-panel,.hub-panel,.account-card,.account-stat-card,.pc-card,.inline-publish-card,
  .platform-trend-panel,.insight-metric-card,.xhs-index-card,.module-card,.kpi-card,
  .account-drawer-card,.account-guide-card,.account-total-card,.account-os-overview-card,
  .account-os-v10-action-card,.account-os-v10-score-panel,.account-task-item,.operation-kpi-card,
  .operation-suggestion,.publish-record-card,.publish-side-panel,.content-card,.content-panel,
  .side-card,.track-panel,.analysis-source-card)::after {
  content:none!important;
  display:none!important;
  opacity:0!important;
  background:none!important;
  background-image:none!important;
  box-shadow:none!important;
  filter:none!important;
}

html:root[data-theme="dark"] body.account-center-mode :is(.account-guide-text,.account-flow-strip,
  .account-flow-node,.account-create-drawer,.account-drawer-card,.account-form,.account-empty-state) {
  background:#343136!important;
  background-image:none!important;
  border-color:#4A454D!important;
  color:#FFFFFF!important;
  box-shadow:none!important;
}
html:root[data-theme="dark"] body.account-center-mode :is(input,select,textarea,.account-field,
  .account-platform-select,.account-login-method) {
  background:#2C2A2E!important;
  background-image:none!important;
  border-color:#4A454D!important;
  color:#FFFFFF!important;
  box-shadow:none!important;
}
html:root[data-theme="dark"] body.account-center-mode :is(.account-flow-node b,.account-guide-step b) {
  background:#493D5B!important;
  color:#FFFFFF!important;
}
html:root[data-theme="dark"] body :is(.empty-state,.error-state,.loading-state,.account-empty-state,
  .analysis-empty-state,.publish-empty-state,.operation-empty-state,.auth-empty,.auth-error,
  [class$="-empty"],[class$="-error"],[class$="-loading"]) {
  background:#2C2A2E!important;
  background-image:none!important;
  border-color:#4A454D!important;
  color:#C9C2CB!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  filter:none!important;
}

@media (prefers-color-scheme: dark) {
  html:root[data-theme="system"] body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,
    .xhs-panel,.hub-panel,.account-card,.account-stat-card,.pc-card,.inline-publish-card,
    .platform-trend-panel,.insight-metric-card,.xhs-index-card,.module-card,.kpi-card,
    .account-drawer-card,.account-guide-card,.account-total-card,.account-os-overview-card,
    .account-os-v10-action-card,.account-os-v10-score-panel,.account-task-item,.operation-kpi-card,
    .operation-suggestion,.publish-record-card,.publish-side-panel,.content-card,.content-panel,
    .side-card,.track-panel,.analysis-source-card)::before,
  html:root[data-theme="system"] body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,
    .xhs-panel,.hub-panel,.account-card,.account-stat-card,.pc-card,.inline-publish-card,
    .platform-trend-panel,.insight-metric-card,.xhs-index-card,.module-card,.kpi-card,
    .account-drawer-card,.account-guide-card,.account-total-card,.account-os-overview-card,
    .account-os-v10-action-card,.account-os-v10-score-panel,.account-task-item,.operation-kpi-card,
    .operation-suggestion,.publish-record-card,.publish-side-panel,.content-card,.content-panel,
    .side-card,.track-panel,.analysis-source-card)::after {
    content:none!important;
    display:none!important;
    opacity:0!important;
    background:none!important;
    background-image:none!important;
    box-shadow:none!important;
    filter:none!important;
  }
  html:root[data-theme="system"] body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,
    .xhs-panel,.hub-panel,.account-card,.account-stat-card,.pc-card,.inline-publish-card,
    .platform-trend-panel,.insight-metric-card,.xhs-index-card,.module-card,.kpi-card,
    .account-drawer-card,.account-guide-card,.account-total-card,.account-os-overview-card,
    .account-os-v10-action-card,.account-os-v10-score-panel,.account-task-item,.operation-kpi-card,
    .operation-suggestion,.publish-record-card,.publish-side-panel,.content-card,.content-panel,
    .side-card,.track-panel,.analysis-source-card,[class*="glass-card"],[class*="GlassCard"]) {
    background:#343136!important;
    background-image:none!important;
    border-color:#4A454D!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    filter:none!important;
  }
}

/* Product decision: business cards never use diagonal lighting in any theme. */
html body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,.xhs-panel,.hub-panel,
  .account-card,.account-stat-card,.pc-card,.inline-publish-card,.platform-trend-panel,
  .insight-metric-card,.xhs-index-card,.module-card,.kpi-card,.account-drawer-card,
  .account-guide-card,.account-total-card,.account-os-overview-card,.account-os-v10-action-card,
  .account-os-v10-score-panel,.account-task-item,.operation-kpi-card,.operation-suggestion,
  .publish-record-card,.publish-side-panel,.content-card,.content-panel,.side-card,.track-panel,
  .analysis-source-card)::before,
html body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,.xhs-panel,.hub-panel,
  .account-card,.account-stat-card,.pc-card,.inline-publish-card,.platform-trend-panel,
  .insight-metric-card,.xhs-index-card,.module-card,.kpi-card,.account-drawer-card,
  .account-guide-card,.account-total-card,.account-os-overview-card,.account-os-v10-action-card,
  .account-os-v10-score-panel,.account-task-item,.operation-kpi-card,.operation-suggestion,
  .publish-record-card,.publish-side-panel,.content-card,.content-panel,.side-card,.track-panel,
  .analysis-source-card)::after {
  content:none!important;
  display:none!important;
  background:none!important;
  background-image:none!important;
  box-shadow:none!important;
  opacity:0!important;
}
html body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,.xhs-panel,.hub-panel,
  .account-card,.account-stat-card,.pc-card,.inline-publish-card,.platform-trend-panel,
  .insight-metric-card,.xhs-index-card,.module-card,.kpi-card,.account-drawer-card,
  .account-guide-card,.account-total-card,.account-os-overview-card,.account-os-v10-action-card,
  .account-os-v10-score-panel,.account-task-item,.operation-kpi-card,.operation-suggestion,
  .publish-record-card,.publish-side-panel,.content-card,.content-panel,.side-card,.track-panel,
  .analysis-source-card) {
  background-color:var(--theme-card)!important;
  background-image:none!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}

/* Insight tables and radar containers use semantic surfaces, never hard-coded light gradients. */
html[data-preset] body :is(.panel-head,.bubble-chart,.rival-table,#rivalRows,
  .creator-profile-empty,.cyber-empty-normalized) {
  background-color:var(--theme-card)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
html[data-preset] body .opportunity-radar-legend > div {
  background-color:var(--theme-surface)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  box-shadow:none!important;
}
html[data-preset] body :is(.bubble-chart,.rival-table,#rivalRows,
  .creator-profile-empty,.cyber-empty-normalized)::before,
html[data-preset] body :is(.bubble-chart,.rival-table,#rivalRows,
  .creator-profile-empty,.cyber-empty-normalized)::after {
  content:none!important;
  display:none!important;
  background:none!important;
  opacity:0!important;
}

/* Selection states stay readable and never flash to a white gradient. */
html[data-preset] body :is(tr,.track-row,.rival-row,.platform-trend-row,.analysis-table-row,
  .account-row,.inline-publish-row,.xhs-rank-table>div,.account-topic-table>div,
  .account-matrix-table>div,.account-auto-table>div):hover {
  background:var(--theme-hover)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  box-shadow:none!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body :is(tr,.track-row,.rival-row,.platform-trend-row,.analysis-table-row,
  .account-row,.inline-publish-row,.platform-item,.tabs button).active,
html[data-preset] body :is(tr,.track-row,.rival-row,.platform-trend-row,.analysis-table-row,
  .account-row,.inline-publish-row,.platform-item,.tabs button)[aria-selected="true"],
html[data-preset] body :is(tr,.track-row,.rival-row,.platform-trend-row,.analysis-table-row,
  .account-row,.inline-publish-row,.platform-item,.tabs button)[aria-pressed="true"] {
  background:var(--theme-accent-soft)!important;
  background-image:none!important;
  border-color:var(--theme-accent)!important;
  box-shadow:inset 3px 0 0 var(--theme-accent)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body :is(.track-row,.rival-row,.platform-trend-row,.analysis-table-row,
  .account-row,.inline-publish-row):hover * {
  color:inherit!important;
}

/* Theme every remaining application shell and interactive surface found by the UI audit. */
html[data-preset] body :is(.dc-app,.dc-main) {
  background-color:var(--theme-background)!important;
  background-image:none!important;
}
html[data-preset] body :is(.top-search,#globalSearchForm,.platform-table-toolbar,.platform-search,
  .account-select-value,.account-drawer-actions) {
  background-color:var(--theme-surface)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  box-shadow:none!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body #globalSearchPlatformLabel {
  background:var(--theme-accent-soft)!important;
  border-color:var(--theme-accent)!important;
  color:var(--theme-accent)!important;
}
html[data-preset] body :is(#trackRows,.insight-flow,#insightFlow) {
  background-color:var(--theme-card)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  box-shadow:none!important;
}
html[data-preset] body .flow-step,
html[data-preset] body .flow-step:hover {
  background:var(--theme-surface)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  box-shadow:none!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body .flow-step:is(.active,[aria-current="step"],[aria-selected="true"]) {
  background:var(--theme-accent-soft)!important;
  border-color:var(--theme-accent)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body :is(.quick-flow,.insight-flow,.overview-flow-card) .flow-step,
html[data-preset] body .overview-flow-card .flow-step:nth-child(4),
html[data-preset] body :is(.quick-flow,.insight-flow,.overview-flow-card) .flow-step:hover {
  background:var(--theme-surface)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  box-shadow:none!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body :is(.quick-flow,.insight-flow,.overview-flow-card) .flow-step :is(strong,span,b) {
  color:inherit!important;
}
html[data-preset] body .yx-sidebar a.is-active,
html[data-preset] body .yx-sidebar a:hover,
html[data-preset] body .platform-os-module-nav a.is-active,
html[data-preset] body .platform-os-module-nav a:hover {
  background:var(--theme-accent-soft)!important;
  background-image:none!important;
  border-color:var(--theme-accent)!important;
  box-shadow:none!important;
  color:var(--theme-text-primary)!important;
}

/* User center: a theme-aware account workspace instead of a light page inside a modal. */
html[data-preset] body .modal-backdrop:has(.user-center-modal) {
  background:rgba(18,16,20,.72)!important;
  backdrop-filter:blur(6px)!important;
  -webkit-backdrop-filter:blur(6px)!important;
}
html[data-preset] body .modal.user-center-modal {
  width:min(1180px,calc(100vw - 40px))!important;
  min-height:0!important;
  max-height:calc(100vh - 40px)!important;
  overflow:hidden!important;
  border:1px solid var(--theme-border)!important;
  border-radius:16px!important;
  background:var(--theme-background)!important;
  box-shadow:0 24px 70px rgba(10,8,12,.38)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body .user-center-modal > header {
  position:sticky;
  top:0;
  z-index:2;
  min-height:64px;
  box-sizing:border-box;
  background:var(--theme-surface)!important;
  border-color:var(--theme-border)!important;
}
html[data-preset] body .user-center-modal > header h3 { color:var(--theme-text-primary)!important }
html[data-preset] body .user-center-modal > header button {
  border-color:var(--theme-border)!important;
  background:var(--theme-hover)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body .modal.user-center-modal .modal-body {
  max-height:calc(100vh - 105px)!important;
  padding:20px!important;
  overflow:auto!important;
  background:var(--theme-background)!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body .user-center-modal .user-center-shell {
  min-height:0!important;
  gap:16px!important;
  background:transparent!important;
}
html[data-preset] body :is(.user-center-hero,.user-center-setting-card) {
  border-color:var(--theme-border)!important;
  background:var(--theme-card)!important;
  background-image:none!important;
  box-shadow:none!important;
  color:var(--theme-text-primary)!important;
}
html[data-preset] body .user-center-hero { padding:16px 18px!important;border-radius:12px!important }
html[data-preset] body .user-center-hero-avatar {
  background:var(--theme-accent)!important;
  background-image:none!important;
  box-shadow:none!important;
  color:#FFFFFF!important;
}
html[data-preset] body .user-center-hero-copy strong,
html[data-preset] body .user-center-card-head h4 { color:var(--theme-text-primary)!important }
html[data-preset] body .user-center-hero-copy span,
html[data-preset] body :is(.user-center-card-head small,.user-center-card-head span,
  .user-center-setting-card label span,.user-center-note,.user-center-empty p) {
  color:var(--theme-text-secondary)!important;
}
html[data-preset] body .user-center-panel { background:transparent!important }
html[data-preset] body .user-center-settings-grid {
  grid-template-columns:minmax(320px,1.15fr) minmax(260px,.9fr) minmax(290px,1fr)!important;
  gap:14px!important;
}
html[data-preset] body .user-center-setting-card { padding:18px!important;border-radius:12px!important }
html[data-preset] body .user-center-card-head { border-color:var(--theme-border)!important }
html[data-preset] body .user-center-setting-card :is(input,textarea) {
  border-color:var(--theme-border)!important;
  background:var(--theme-surface)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}
html[data-preset] body .user-center-setting-card :is(input,textarea):focus {
  border-color:var(--theme-accent)!important;
  box-shadow:0 0 0 3px var(--theme-accent-soft)!important;
}
html[data-preset] body .user-center-form-actions button {
  border-color:var(--theme-action,var(--theme-button))!important;
  background:var(--theme-action,var(--theme-button))!important;
  color:#FFFFFF!important;
  box-shadow:none!important;
}
html[data-preset] body .user-center-member-status > div {
  border-color:#72584D!important;
  background:var(--theme-warm-soft,#4B3B35)!important;
  background-image:none!important;
  box-shadow:none!important;
}
html[data-preset] body .user-center-member-status span { color:#D2B4A5!important }
html[data-preset] body .user-center-member-status strong { color:#FFFFFF!important }
html[data-preset] body .user-center-recharge-grid button {
  border-color:var(--theme-border)!important;
  background:var(--theme-surface)!important;
  background-image:none!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}
html[data-preset] body .user-center-recharge-grid button:hover {
  border-color:var(--theme-accent)!important;
  background:var(--theme-accent-soft)!important;
}
html[data-preset] body .user-center-recharge-grid button span { color:var(--theme-text-secondary)!important }
@media(max-width:1050px){
  html[data-preset] body .user-center-settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html[data-preset] body .user-center-member-card{grid-column:1/-1!important}
}
@media(max-width:720px){
  html[data-preset] body .modal-backdrop:has(.user-center-modal){padding:0!important}
  html[data-preset] body .modal.user-center-modal{width:100%!important;max-height:100vh!important;border-radius:0!important}
  html[data-preset] body .modal.user-center-modal .modal-body{max-height:calc(100vh - 64px)!important;padding:14px!important}
  html[data-preset] body .user-center-settings-grid{grid-template-columns:1fr!important}
  html[data-preset] body .user-center-member-card{grid-column:auto!important}
}

/* Account state feedback follows semantic dark surfaces. */
html[data-preset] body :is(.account-sync-hint,.account-auth-status,.account-login-status) {
  border:1px solid var(--theme-border)!important;
  background:var(--theme-surface)!important;
  background-image:none!important;
  box-shadow:none!important;
  color:var(--theme-text-secondary)!important;
}
html[data-preset] body :is(.account-sync-hint,.account-auth-status,.account-login-status) strong {
  color:var(--theme-text-primary)!important;
}
html[data-preset] body :is(.account-sync-hint.synced,.account-auth-status.success,
  .account-login-status.success,.account-login-status.synced) {
  border-color:var(--theme-success)!important;
  background:var(--theme-success-soft)!important;
  color:var(--theme-success)!important;
}
html[data-preset] body :is(.account-sync-hint.synced,.account-auth-status.success,
  .account-login-status.success,.account-login-status.synced) strong { color:var(--theme-success)!important }
html[data-preset] body :is(.account-sync-hint.pending,.account-auth-status.pending,
  .account-login-status.pending,.account-login-status.warning) {
  border-color:var(--theme-warm,#B48770)!important;
  background:var(--theme-warm-soft,#4B3B35)!important;
  color:#E7C2AF!important;
}
html[data-preset] body :is(.account-sync-hint.pending,.account-auth-status.pending,
  .account-login-status.pending,.account-login-status.warning) strong { color:#E7C2AF!important }
html[data-preset] body :is(.account-sync-hint.failed,.account-auth-status.failed,
  .account-login-status.failed,.account-login-status.error) {
  border-color:var(--theme-danger,#E46D78)!important;
  background:var(--theme-danger-soft,#543238)!important;
  color:#FFB8BE!important;
}
html[data-preset] body :is(.account-sync-hint.failed,.account-auth-status.failed,
  .account-login-status.failed,.account-login-status.error) strong { color:#FFB8BE!important }

/* Interaction hierarchy: one clear primary action, quiet secondary controls and muted metadata. */
html[data-preset] body :is(.dc-app,.yx-admin-shell,.dac-shell,.account-os-shell,
  .content-factory-shell,.publish-center-shell) button {
  font-weight:600!important;
  letter-spacing:0!important;
}
html[data-preset] body :is(.dc-app,.yx-admin-shell,.dac-shell,.account-os-shell,
  .content-factory-shell,.publish-center-shell) button:not(.primary):not(.danger):not(.active):not(.account-create):not(.table-add-platform-button):not([type="submit"]):not([data-account-action="create"]):not([data-account-action="save-edit"]):not([data-account-action="enter"]):not([aria-pressed="true"]):not([aria-current]) {
  color:var(--theme-text-secondary)!important;
}
html[data-preset] body :is(.dc-app,.yx-admin-shell,.dac-shell,.account-os-shell,
  .content-factory-shell,.publish-center-shell) :is(.primary,.account-create,.table-add-platform-button,
  .top-search>button,[data-account-action="create"],[data-account-action="save-edit"],
  [data-account-action="enter"],.user-center-form-actions button) {
  border-color:var(--theme-action,var(--theme-accent))!important;
  background:var(--theme-action,var(--theme-accent))!important;
  background-image:none!important;
  color:#FFFFFF!important;
  font-weight:700!important;
  box-shadow:none!important;
}
html[data-preset] body :is(.dc-app,.yx-admin-shell,.dac-shell,.account-os-shell,
  .content-factory-shell,.publish-center-shell) :is(button.active,button[aria-pressed="true"],button[aria-current]) {
  background:var(--theme-accent-soft)!important;
  background-image:none!important;
  border-color:var(--theme-accent)!important;
  color:var(--theme-text-primary)!important;
  font-weight:650!important;
  box-shadow:none!important;
}
html[data-preset] body :is(.dc-app,.yx-admin-shell,.dac-shell,.account-os-shell,
  .content-factory-shell,.publish-center-shell) :is(button.danger,[data-account-action="delete"],
  [data-action="delete"],[data-action="remove"]) {
  border-color:var(--theme-danger,#E46D78)!important;
  background:var(--theme-danger-soft,#543238)!important;
  color:#FFB8BE!important;
  font-weight:600!important;
}
html[data-preset] body :is(.os-top-flow a,.side-nav button,.platform-tabs button,
  .tabs button,.yx-sidebar a,.platform-os-module-nav a) {
  color:var(--theme-text-secondary)!important;
  font-weight:600!important;
}
html[data-preset] body :is(.os-top-flow a,.side-nav button,.platform-tabs button,
  .tabs button,.yx-sidebar a,.platform-os-module-nav a):is(.active,.is-active,[aria-current="page"],[aria-pressed="true"]) {
  color:var(--theme-text-primary)!important;
  font-weight:650!important;
}
html[data-preset] body .platform-item:not(.active) {
  color:var(--theme-text-secondary)!important;
  font-weight:600!important;
}
html[data-preset] body .platform-item:not(.active) :is(strong,span,small) {
  color:inherit!important;
  font-weight:inherit!important;
}
html[data-preset] body .platform-item.active :is(strong,span) { font-weight:650!important }

html[data-preset] body :is(.metric-card,.account-stat-card,.operation-kpi-card,.yx-stat) :is(span,small,em),
html[data-preset] body .account-card-metrics>span,
html[data-preset] body :is(.operation-context,.account-flow-node,.account-guide-text) :is(span,small,em) {
  color:var(--theme-text-secondary)!important;
  font-weight:500!important;
}
html[data-preset] body :is(.metric-card,.account-stat-card,.operation-kpi-card,.yx-stat) strong,
html[data-preset] body .account-card-metrics strong {
  color:var(--theme-text-primary)!important;
  font-weight:700!important;
}
html[data-preset] body :is(.metric-card,.account-stat-card) em { font-weight:400!important }
html[data-preset] body :is(.panel-head small,.user-center-note,.wallet-help,.account-guide-text,
  .account-drawer-card label small,.account-card header small,.yx-panel-head p,.yx-section-head span) {
  color:var(--theme-text-secondary)!important;
  font-weight:400!important;
}
html[data-preset] body :is(table th,.track-row.head,.rival-row.head,.platform-trend-row.head,
  .cloud-hot-head,.analysis-table-head,.account-table-head) {
  color:var(--theme-text-secondary)!important;
  font-weight:600!important;
}
html[data-preset] body :is(table td,.track-row:not(.head),.rival-row:not(.head),
  .platform-trend-row:not(.head),.analysis-table-row,.account-row) {
  font-weight:500!important;
}
html[data-preset] body :is(h1,.page-title) { font-weight:700!important }
html[data-preset] body :is(h2,h3,h4,.section-title) { font-weight:650!important }
html[data-preset] body :is(h1,h2,h3,h4) small { color:var(--theme-text-secondary)!important;font-weight:500!important }
html[data-preset] body :is(.account-empty-state,.analysis-empty-state,.publish-empty-state,
  .operation-empty-state) {
  color:var(--theme-text-secondary)!important;
  font-weight:500!important;
}
html[data-preset] body .account-drawer-card label {
  color:var(--theme-text-secondary)!important;
  font-weight:600!important;
}
html[data-preset] body .account-drawer-card :is(.account-select-value,select) {
  color:var(--theme-text-primary)!important;
  font-weight:600!important;
}
html[data-preset] body .account-drawer-card .account-platform-icon { color:#FFFFFF!important;font-weight:700!important }
html[data-preset] body .pcv5-empty strong {
  color:var(--theme-text-primary)!important;
  font-weight:650!important;
}
html[data-preset] body .pcv5-empty p {
  color:var(--theme-text-secondary)!important;
  font-weight:400!important;
}
html[data-preset] body .platform-breadcrumb strong {
  color:var(--theme-text-primary)!important;
  font-weight:700!important;
}
html[data-preset] body .platform-section-title strong {
  color:var(--theme-text-primary)!important;
  font-weight:650!important;
}
html[data-preset] body .platform-section-title span {
  color:var(--theme-text-secondary)!important;
  font-weight:400!important;
}
html[data-preset] body :is(.platform-name-cell,.column-name-cell,table td) strong {
  font-weight:600!important;
}
html[data-preset] body :is(.platform-name-cell,.column-name-cell,table td) span {
  color:var(--theme-text-secondary)!important;
  font-weight:400!important;
}
@media(max-width:720px){
  html[data-preset] body.account-center-mode .account-create-drawer{
    position:fixed!important;
    inset:0!important;
    z-index:2147482000!important;
    width:100vw!important;
    max-width:none!important;
    height:100dvh!important;
    max-height:100dvh!important;
    box-sizing:border-box!important;
    overflow-y:auto!important;
    border-radius:0!important;
    background:var(--theme-background)!important;
  }
}
html:root[data-theme="dark"] body :is(.metric-card,.panel,.flow-card,.analysis-card,.factory-panel,
  .xhs-panel,.hub-panel,.account-card,.account-stat-card,.pc-card,.inline-publish-card,
  .platform-trend-panel,.insight-metric-card,.xhs-index-card,.module-card,.kpi-card,
  .account-drawer-card,.account-guide-card,.account-total-card,.account-os-overview-card,
  .account-os-v10-action-card,.account-os-v10-score-panel,.account-task-item,.operation-kpi-card,
  .operation-suggestion,.publish-record-card,.publish-side-panel,.content-card,.content-panel,
  .side-card,.track-panel,.analysis-source-card,[class*="glass-card"],[class*="GlassCard"]) {
  background:#343136!important;
  background-image:none!important;
  border-color:#4A454D!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  filter:none!important;
}

/* Semantic surface reset: legacy cyber styles use !important background shorthands.
   Keep ordinary controls and data surfaces on the active preset in every module. */
html[data-preset] body :is(
  input:not([type]),
  input[type="text"],input[type="search"],input[type="email"],input[type="password"],
  input[type="number"],input[type="tel"],input[type="url"],input[type="date"],
  input[type="time"],input[type="datetime-local"],input[type="month"],input[type="week"],
  select,textarea
) {
  background:var(--theme-surface)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}

html[data-preset] body :is(
  .top-search,.search-box,.search-input,.hub-search,.keyword-radar-search,
  .platform-search,.platform-table-toolbar,.filter-bar,.filter-select,
  .account-search,.account-filter,.account-batch,.account-login-status,
  .dy-search,.dy-keyword-form
) {
  background:var(--theme-surface)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
  text-shadow:none!important;
  filter:none!important;
}

html[data-preset] body :is(
  .top-search,.search-box,.hub-search,.keyword-radar-search,.platform-search,
  .account-search,.dy-search,.dy-keyword-form
) :is(input,select,textarea) {
  background:transparent!important;
  background-image:none!important;
  border-color:transparent!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}

html[data-preset] body :is(
  .platform-trend-table,.track-table,.rival-table,.account-stat-table,
  .account-topic-table,.account-matrix-table,.analysis-table
) {
  background:var(--theme-card)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
  text-shadow:none!important;
  filter:none!important;
}

html[data-preset] body :is(
  .platform-trend-row.head,.track-row.head,.rival-row.head,.analysis-table-head,
  .account-table-head,.platform-trend-table>.head
) {
  background:var(--theme-hover)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-secondary)!important;
  box-shadow:none!important;
}

html[data-preset] body :is(
  .platform-trend-empty,.platform-trend-table>.empty,
  .platform-trend-table>[class*="empty"],.platform-trend-table>[data-empty],
  .platform-trend-table>[data-no-signal]
) {
  background:var(--theme-card)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-secondary)!important;
  box-shadow:none!important;
}

/* Sunset preset: 62/38 warm-neutral balance with adjacent terracotta and ochre accents. */
html[data-preset="sunset"] body :is(
  .account-toolbar .account-filter,.account-toolbar .account-batch,
  .account-card footer button:not(.danger):not([data-account-action="enter"]),
  .account-drawer-actions button:not(.primary),.account-guide-card button
) {
  background:var(--theme-surface)!important;
  background-image:none!important;
  border:1px solid var(--theme-border)!important;
  color:var(--theme-text-secondary)!important;
  box-shadow:none!important;
}

html[data-preset="sunset"] body :is(
  .account-create,.top-search>button,
  [data-account-action="enter"],[data-account-action="create"],
  [data-account-action="save-edit"]
) {
  background:var(--theme-action)!important;
  background-image:none!important;
  border-color:var(--theme-action)!important;
  color:var(--theme-button-text)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--theme-gold) 44%,transparent)!important;
}

html[data-preset="sunset"] body :is(
  .platform-item.active,.side-nav button.active,.account-auth-grid button.active,
  .os-top-flow a.active,.tabs button.active,.platform-tabs button.active
) {
  background:var(--theme-accent-soft)!important;
  background-image:none!important;
  border-color:var(--theme-gold)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}

html[data-preset="sunset"] body :is(.platform-item.active,.side-nav button.active) {
  box-shadow:inset 3px 0 0 var(--theme-gold)!important;
}

html[data-preset="sunset"]:not([data-theme="dark"]) body :is(
  button.danger,[data-account-action="delete"],[data-action="delete"],[data-action="remove"]
) {
  background:var(--theme-danger-soft)!important;
  background-image:none!important;
  border-color:color-mix(in srgb,var(--theme-danger) 48%,var(--theme-border))!important;
  color:var(--theme-danger)!important;
  box-shadow:none!important;
}

/* Keep viewport gutters and scrollbars on the active palette. Legacy skins left a dark
   canvas visible around inset admin shells when a light preset was selected. */
html[data-preset],
html[data-preset] body {
  background:var(--theme-background)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  scrollbar-color:color-mix(in srgb,var(--theme-text-secondary) 52%,var(--theme-background)) var(--theme-background);
}

html[data-preset] ::-webkit-scrollbar-track,
html[data-preset] ::-webkit-scrollbar-corner {
  background:var(--theme-background)!important;
  background-image:none!important;
}

html[data-preset] ::-webkit-scrollbar-thumb {
  background:color-mix(in srgb,var(--theme-text-secondary) 52%,var(--theme-background))!important;
  background-image:none!important;
  border:3px solid var(--theme-background)!important;
  border-radius:999px!important;
}

/* Platform hub is the complete admin application, so it must not inherit the
   generic admin page gutter that exposed a frame around the embedded shell. */
html[data-preset] body.platform-hub-view .yx-admin-content {
  min-height:100vh!important;
  padding:0!important;
}

html[data-preset] body.platform-hub-view #platform-hub-panel,
html[data-preset] body.platform-hub-view .platform-admin {
  width:100%!important;
  min-height:100vh!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
}

/* Light-palette compatibility: legacy admin skins hard-code blue-black canvas
   values. System, light and eye-care modes must stay in their selected palette;
   only the explicit dark mode may use the dark surface family. */
html[data-theme="system"],
html[data-theme="light"],
html[data-theme="eye-care"] {
  color-scheme:light!important;
  --yx-bg:var(--theme-background);
  --yx-sidebar:var(--theme-sidebar);
  --yx-panel:var(--theme-card);
  --yx-text:var(--theme-text-primary);
  --yx-muted:var(--theme-text-secondary);
  --yx-line:var(--theme-border);
  --yx-blue:var(--theme-accent);
}

html[data-theme]:not([data-theme="dark"]) body,
html[data-theme]:not([data-theme="dark"]) body .yx-admin-shell,
html[data-theme]:not([data-theme="dark"]) body .yx-admin-content {
  background:var(--theme-background)!important;
  background-image:none!important;
  color:var(--theme-text-primary)!important;
}

html[data-theme]:not([data-theme="dark"]) body .yx-sidebar {
  background:var(--theme-sidebar)!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:0 12px 30px color-mix(in srgb,var(--theme-text-primary) 8%,transparent)!important;
}

html[data-theme]:not([data-theme="dark"]) body :is(
  .yx-admin-content>header,.yx-panel,.yx-section,.yx-stat,.yx-card,
  .user-management-card,.user-management-toolbar,.yx-table-wrap,.yx-table,
  .user-detail-shell,.user-action-shell,.user-editor-shell
) {
  background:var(--theme-surface)!important;
  background-image:none!important;
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:0 10px 28px color-mix(in srgb,var(--theme-text-primary) 6%,transparent)!important;
}

html[data-theme]:not([data-theme="dark"]) body :is(
  .yx-table th,.yx-table td,.yx-sidebar button,.yx-sidebar a,
  input,select,textarea,.admin-global-profile summary,.admin-global-menu,
  .admin-theme-drawer-toggle
) {
  border-color:var(--theme-border)!important;
  color:var(--theme-text-primary)!important;
}

html[data-theme]:not([data-theme="dark"]) body .yx-table th {
  background:var(--theme-hover)!important;
  color:var(--theme-text-secondary)!important;
}

html[data-theme]:not([data-theme="dark"]) body .yx-sidebar button,
html[data-theme]:not([data-theme="dark"]) body .yx-sidebar a {
  background:transparent!important;
  border-color:transparent!important;
  color:var(--theme-text-secondary)!important;
  box-shadow:none!important;
}

html[data-theme]:not([data-theme="dark"]) body .yx-sidebar :is(button.active,a.active) {
  background:var(--theme-accent-soft)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 42%,var(--theme-border))!important;
  color:var(--theme-accent)!important;
}

/* Dark-palette compatibility: remove legacy white, pure-black, and green-tinted
   control frames. The selected preset is reserved for emphasis, not the page base. */
html[data-theme="dark"] {
  --theme-dark-canvas:#1F1D20;
  --theme-dark-sidebar:#28252A;
  --theme-dark-panel-start:#343136;
  --theme-dark-panel-end:#2C292E;
  --theme-dark-control-start:#29262B;
  --theme-dark-control-end:#222025;
  --theme-dark-border:color-mix(in srgb,var(--theme-accent) 30%,#4A454D);
}

html[data-theme="dark"] body,
html[data-theme="dark"] body .yx-admin-shell,
html[data-theme="dark"] body .yx-admin-content {
  background:var(--theme-dark-canvas)!important;
  background-image:none!important;
}

html[data-theme="dark"] body .account-workbench {
  background:var(--theme-dark-canvas)!important;
  background-image:none!important;
  color:var(--theme-text-primary)!important;
}

html[data-theme="dark"] body .account-os-page {
  background:var(--theme-dark-canvas)!important;
  background-image:none!important;
  color:var(--theme-text-primary)!important;
}

html[data-theme="dark"] body .yx-sidebar {
  background:linear-gradient(180deg,#302D33 0%,var(--theme-dark-sidebar) 100%)!important;
  border-color:var(--theme-dark-border)!important;
  box-shadow:inset -1px 0 0 color-mix(in srgb,var(--theme-accent) 16%,transparent),12px 0 32px rgba(0,0,0,.18)!important;
}

html[data-theme="dark"] body :is(
  .yx-admin-content>header,.yx-panel,.yx-section,.yx-stat,.yx-card,
  .user-management-card,.user-management-toolbar,.yx-table-wrap,.yx-table,
  .user-detail-shell,.user-action-shell,.user-editor-shell,.wallet-drawer,
  .wallet-header,.wallet-footer
) {
  background:linear-gradient(135deg,var(--theme-dark-panel-start),var(--theme-dark-panel-end))!important;
  background-image:linear-gradient(135deg,var(--theme-dark-panel-start),var(--theme-dark-panel-end))!important;
  border-color:var(--theme-dark-border)!important;
  box-shadow:0 14px 34px rgba(0,0,0,.18)!important;
}

html[data-theme="dark"] body :is(
  input,select,textarea,.yx-table th,.yx-table td,.wallet-choice,
  .admin-global-profile summary,.admin-global-menu,.admin-theme-drawer-toggle,
  .yx-secondary,.yx-ghost,.user-operation-tab,.user-detail-tab
) {
  background:linear-gradient(135deg,var(--theme-dark-control-start),var(--theme-dark-control-end))!important;
  background-image:linear-gradient(135deg,var(--theme-dark-control-start),var(--theme-dark-control-end))!important;
  border-color:var(--theme-dark-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}

html[data-theme="dark"] body .yx-table th {
  background:linear-gradient(135deg,color-mix(in srgb,var(--theme-accent) 14%,#423E45),#343136)!important;
}

html[data-theme="dark"] body .yx-sidebar button,
html[data-theme="dark"] body .yx-sidebar a {
  background:transparent!important;
  border-color:transparent!important;
  color:var(--theme-text-secondary)!important;
  box-shadow:none!important;
}

html[data-theme="dark"] body .yx-sidebar :is(button.active,a.active),
html[data-theme="dark"] body :is(.wallet-choice,.user-operation-tab)[aria-pressed="true"] {
  background:linear-gradient(135deg,color-mix(in srgb,var(--theme-accent) 30%,#403A43),#302C32)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 62%,#6B616D)!important;
  color:#F2FFF7!important;
  box-shadow:inset 3px 0 0 var(--theme-accent)!important;
}

/* Legacy modules use different container names. Keep transient surfaces in
   the same charcoal family so a dark palette never opens a white panel. */
html[data-theme="dark"] body :is(
  .modal,.modal-content,.modal-dialog,.modal-card,.modal-body,
  .drawer,.drawer-panel,.dialog,.dialog-panel,.popover,.dropdown,.menu,
  .empty-state,.empty-panel,.pagination,.pagination-panel,
  .filter-panel,.filter-bar,.form-panel,.form-card,.table-toolbar,
  [class*="modal"],[class*="drawer"],[class*="dialog"],[class*="popover"],
  [class*="empty-state"],[class*="empty-panel"]
) {
  background:linear-gradient(135deg,var(--theme-dark-panel-start),var(--theme-dark-panel-end))!important;
  background-image:linear-gradient(135deg,var(--theme-dark-panel-start),var(--theme-dark-panel-end))!important;
  border-color:var(--theme-dark-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:0 14px 34px rgba(0,0,0,.18)!important;
}

html[data-theme="dark"] body :is(
  .modal input,.modal select,.modal textarea,.drawer input,.drawer select,.drawer textarea,
  .dialog input,.dialog select,.dialog textarea,.filter-panel input,.filter-panel select,
  .filter-bar input,.filter-bar select,.pagination button
) {
  background:linear-gradient(135deg,var(--theme-dark-control-start),var(--theme-dark-control-end))!important;
  border-color:var(--theme-dark-border)!important;
  color:var(--theme-text-primary)!important;
}

/* Insight Home predates the shared surface tokens and still ships literal
   white panels.  Keep its data area in the same dark hierarchy as the rest
   of the console: canvas, raised panels, then compact controls. */
html[data-theme="dark"] body :is(
  .insight-home,.ih-header,.ih-panel,.ih-health-state,.ih-health-item,
  .ih-creator-table,.ih-creator-row,.ih-ki-metrics,.ih-ki-related,
  .ih-ki-chart,.ih-ki-compare,.ih-hot-list,.ih-rank-list,.ih-empty,
  .ih-keyword-index,.ih-footer,.ih-toolbar
) {
  background:linear-gradient(135deg,var(--theme-dark-panel-start),var(--theme-dark-panel-end))!important;
  background-image:linear-gradient(135deg,var(--theme-dark-panel-start),var(--theme-dark-panel-end))!important;
  border-color:var(--theme-dark-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}

html[data-theme="dark"] body .insight-home :is(
  button,input,select,textarea,.ih-tag,.ih-health-state em,.ih-health-item em,
  .ih-creator-row.is-head,.ih-keyword-chip,.ih-filter-chip,.ih-btn,.ih-tab,
  .ih-empty-note,.ih-source-badge,.ih-ki-metric,.ih-ki-related b
) {
  background:linear-gradient(135deg,var(--theme-dark-control-start),var(--theme-dark-control-end))!important;
  background-image:linear-gradient(135deg,var(--theme-dark-control-start),var(--theme-dark-control-end))!important;
  border-color:var(--theme-dark-border)!important;
  color:var(--theme-text-primary)!important;
  box-shadow:none!important;
}

html[data-theme="dark"] body .insight-home :is(
  .ih-health-state,.ih-health-item,.ih-creator-row.is-head,.ih-ki-metrics
) {
  background:linear-gradient(135deg,color-mix(in srgb,var(--theme-accent) 10%,#343136),#2C292E)!important;
}

/* `insight-home.css` deliberately scopes its legacy white palette under
   #insightHub and uses !important.  Match that scope so dark mode wins
   without introducing a broad override for unrelated pages. */
html[data-theme="dark"] #insightHub .insight-home,
html[data-theme="dark"] #insightHub .insight-home :is(
  .ih-header,.ih-panel,.ih-health-state,.ih-health-item,.ih-creator-table,
  .ih-creator-row,.ih-ki-metrics,.ih-ki-related,.ih-ki-chart,.ih-ki-compare,
  .ih-hot-list,.ih-rank-list,.ih-empty,.ih-keyword-index,.ih-footer,.ih-toolbar
) {
  background-color:var(--theme-dark-panel-end)!important;
  background-image:linear-gradient(135deg,var(--theme-dark-panel-start),var(--theme-dark-panel-end))!important;
  border-color:var(--theme-dark-border)!important;
  color:var(--theme-text-primary)!important;
}

html[data-theme="dark"] #insightHub .insight-home :is(
  button,input,select,textarea,.ih-tag,.ih-health-state em,.ih-health-item em,
  .ih-creator-row.is-head,.ih-keyword-chip,.ih-filter-chip,.ih-btn,.ih-tab,
  .ih-empty-note,.ih-source-badge,.ih-ki-metric,.ih-ki-related b
) {
  background-color:var(--theme-dark-control-end)!important;
  background-image:linear-gradient(135deg,var(--theme-dark-control-start),var(--theme-dark-control-end))!important;
  border-color:var(--theme-dark-border)!important;
  color:var(--theme-text-primary)!important;
}

html[data-theme="dark"] #insightHub .insight-home :is(
  .ih-health-state,.ih-health-item,.ih-creator-row.is-head,.ih-ki-metrics
) {
  background-color:#2C292E!important;
  background-image:linear-gradient(135deg,color-mix(in srgb,var(--theme-accent) 10%,#343136),#2C292E)!important;
}

/* Content links inherit the active preset. This removes legacy bright-blue
   topic links in warm and neutral dark palettes without changing link meaning. */
html[data-theme="dark"] body :is(a[href], [role="link"], .topic-link, .keyword-link, .content-link) {
  color:var(--theme-accent)!important;
}

html[data-theme="dark"] body :is(a[href], [role="link"], .topic-link, .keyword-link, .content-link):hover {
  color:color-mix(in srgb,var(--theme-accent) 76%,#FFFFFF)!important;
}

/* Topic titles are links too. Keep them tied to the active preset instead of
   letting an older global link rule restore the saturated default blue. */
html[data-theme="dark"] body .cloud-hot-row strong a {
  color:var(--theme-accent)!important;
}

html[data-theme="dark"] body .cloud-hot-row strong a:hover {
  color:color-mix(in srgb,var(--theme-accent) 76%,#FFFFFF)!important;
}

/* Keep personal presets as the requested three compact colour balls. */
[data-te2-appearance] .te2-personal-slot {
  width:34px!important;
  min-width:34px!important;
  min-height:44px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}

[data-te2-appearance] .te2-personal-slot .te2-personal-dot {
  display:block!important;
  width:28px!important;
  height:28px!important;
  min-height:28px!important;
  margin:0!important;
  border:2px solid color-mix(in srgb,var(--theme-surface) 80%,var(--theme-border))!important;
  border-radius:50%!important;
  box-shadow:0 5px 12px rgba(20,31,58,.13)!important;
}

[data-te2-appearance] .te2-personal-slot .te2-personal-dot-empty {
  background:repeating-linear-gradient(135deg,var(--theme-hover) 0 5px,var(--theme-surface) 5px 10px)!important;
}

[data-te2-appearance] .te2-personal-slot[aria-pressed="true"] .te2-personal-dot {
  outline:2px solid var(--theme-accent)!important;
  outline-offset:3px!important;
}

/* Avoid re-rasterising the complete dashboard behind the drawer on every
   palette switch. The dim overlay keeps focus without a costly blur pass. */
html[data-theme] .te2-backdrop,
html:root[data-theme="dark"] .te2-backdrop {
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
