/* Shared account themes. Print output and document artwork retain their own palette. */
:root{--ap-bg:#f5f1e9;--ap-surface:#fffcf6;--ap-alt:#ede5d8;--ap-ink:#40372e;--ap-muted:#706153;--ap-line:#dcd0bf;--ap-control:#c3b19a;--ap-accent:#97512f;--ap-on-accent:#ffffff;--ap-soft:#f3e3d5;--ap-hover:#f7eee2;--ap-nav:#eee6d9;--ap-nav-ink:#493a2d;--app-line:var(--ap-line);--app-ink-muted:var(--ap-muted)}
:root[data-app-theme=classic],[data-preview-theme=classic]{--ap-bg:#f5f7f9;--ap-surface:#ffffff;--ap-alt:#edf2f5;--ap-ink:#243746;--ap-muted:#536777;--ap-line:#dce4e9;--ap-control:#b5c5ce;--ap-accent:#087f70;--ap-on-accent:#ffffff;--ap-soft:#e6f2ee;--ap-hover:#eef6f3;--ap-nav:#ffffff;--ap-nav-ink:#243746;color-scheme:light}
:root[data-app-theme=ocean],[data-preview-theme=ocean]{--ap-bg:#eef4fb;--ap-surface:#ffffff;--ap-alt:#e6eef9;--ap-ink:#203551;--ap-muted:#526880;--ap-line:#cedbeb;--ap-control:#afc2db;--ap-accent:#215caa;--ap-on-accent:#ffffff;--ap-soft:#e0ebfc;--ap-hover:#edf3fd;--ap-nav:#f7faff;--ap-nav-ink:#203551;color-scheme:light}
:root[data-app-theme=linen],[data-preview-theme=linen]{--ap-bg:#f5f1e9;--ap-surface:#fffcf6;--ap-alt:#ede5d8;--ap-ink:#40372e;--ap-muted:#706153;--ap-line:#dcd0bf;--ap-control:#c3b19a;--ap-accent:#97512f;--ap-on-accent:#ffffff;--ap-soft:#f3e3d5;--ap-hover:#f7eee2;--ap-nav:#eee6d9;--ap-nav-ink:#493a2d;color-scheme:light}
:root[data-app-theme=lavender],[data-preview-theme=lavender]{--ap-bg:#f4f1fa;--ap-surface:#fefcff;--ap-alt:#ece5f6;--ap-ink:#393047;--ap-muted:#6e617e;--ap-line:#ddd2e9;--ap-control:#bcabd0;--ap-accent:#7553a5;--ap-on-accent:#ffffff;--ap-soft:#ede1f8;--ap-hover:#f2eaf9;--ap-nav:#eee7f6;--ap-nav-ink:#443354;color-scheme:light}
:root[data-app-theme=rose],[data-preview-theme=rose]{--ap-bg:#faf2f4;--ap-surface:#fffdfd;--ap-alt:#f4e5eb;--ap-ink:#463039;--ap-muted:#7a5e69;--ap-line:#e8d1da;--ap-control:#d0abbc;--ap-accent:#a1466c;--ap-on-accent:#ffffff;--ap-soft:#f7e0e9;--ap-hover:#fbedf2;--ap-nav:#f3e6ec;--ap-nav-ink:#513242;color-scheme:light}
:root[data-app-theme=graphite],[data-preview-theme=graphite]{--ap-bg:#12191f;--ap-surface:#1c252e;--ap-alt:#25313c;--ap-ink:#e4edf3;--ap-muted:#afbfcd;--ap-line:#425365;--ap-control:#627589;--ap-accent:#91d9c4;--ap-on-accent:#102722;--ap-soft:#243f39;--ap-hover:#2b3b46;--ap-nav:#182129;--ap-nav-ink:#e4edf3;color-scheme:dark}
[data-preview-theme=system]{--ap-bg:#f5f7f9;--ap-surface:#ffffff;--ap-alt:#edf2f5;--ap-ink:#243746;--ap-muted:#536777;--ap-line:#dce4e9;--ap-control:#b5c5ce;--ap-accent:#087f70;--ap-on-accent:#ffffff;--ap-soft:#e6f2ee;--ap-hover:#eef6f3;--ap-nav:#ffffff;--ap-nav-ink:#243746}
@media(prefers-color-scheme:dark){[data-preview-theme=system]{--ap-bg:#12191f;--ap-surface:#1c252e;--ap-alt:#25313c;--ap-ink:#e4edf3;--ap-muted:#afbfcd;--ap-line:#425365;--ap-control:#627589;--ap-accent:#91d9c4;--ap-on-accent:#102722;--ap-soft:#243f39;--ap-hover:#2b3b46;--ap-nav:#182129;--ap-nav-ink:#e4edf3}}
@media screen{
html[data-app-theme]{--blue:var(--ap-accent);--ink:var(--ap-ink);--muted:var(--ap-muted);--line:var(--ap-line)}
html[data-app-theme],html[data-app-theme] body{background:var(--ap-bg);color:var(--ap-ink)}
html[data-app-theme] body.app-unified{--app-line:var(--ap-line);--app-ink-muted:var(--ap-muted);--book-ink:var(--ap-ink);--book-line:var(--ap-line);--book-green:var(--ap-accent)}
html[data-app-theme] #app-navigation{background:var(--ap-nav);color:var(--ap-nav-ink)}
html[data-app-theme] #app-navigation .app-brand{color:var(--ap-nav-ink)}
html[data-app-theme] #app-global{background:var(--ap-bg);border-color:var(--ap-line)}
html[data-app-theme] :is(#pnl-page,.certificates-workspace,#security-settings){color:var(--ap-ink)}
html[data-app-theme] body.app-unified :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){background:var(--ap-surface);color:var(--ap-ink);border-color:var(--ap-control)}
html[data-app-theme] body.app-unified :is(input,textarea)::placeholder{color:var(--ap-muted);opacity:1}
html[data-app-theme] body.app-unified :is(.card,.stat,.metric,.panel,.book-chapter,.release-card,#tablePanel,#filters,.app-tools-body,.enterprise-period-body,.enterprise-period>summary,.enterprise-totals>summary,.enterprise-detail-tabs,.professional-views,#appearance-dialog){background:var(--ap-surface);border-color:var(--ap-line);color:var(--ap-ink)}
html[data-app-theme] body.app-unified :is(td,th){border-color:var(--ap-line)}
html[data-app-theme] body.app-unified :is(th,thead th){background:var(--ap-alt);color:var(--ap-ink)}
html[data-app-theme] body.app-unified :is(.muted,.mono,.route,.scope,.eyebrow,.progressCaption,.stat span,.statusline,footer){color:var(--ap-muted)}
html[data-app-theme] body.app-unified .tablewrap tbody tr:nth-child(even)>td{background:var(--ap-surface)}
html[data-app-theme] body.app-unified :is(.tablewrap,.tableWrap,.enterprise-ledger) tbody tr:hover>td{background:var(--ap-hover)}
html[data-app-theme] body.app-unified .tablewrap tbody tr:has(input[data-select]:checked)>td{background:var(--ap-soft)}
html[data-app-theme] body.app-unified :is(.tablewrap,.enterprise-ledger) td:last-child{background:var(--ap-surface)}
html[data-app-theme] body.app-unified button:not(.primary):not(.danger):not(.appearance-choice){background:var(--ap-surface);color:var(--ap-ink);border-color:var(--ap-control)}
html[data-app-theme] body.app-unified :is(button.active,.enterprise-detail-tabs [aria-selected=true]){background:var(--ap-soft);color:var(--ap-ink)}
html[data-app-theme] body.app-unified :is(button.primary,a.primary,#pnl-page #add,#pnl-page #save){background:var(--ap-accent);border-color:var(--ap-accent);color:var(--ap-on-accent)}
html[data-app-theme] body.app-unified :is(.stock-tabs .nav.active,#chips button,#selection:not(:empty)){background:var(--ap-soft);border-color:var(--ap-accent);color:var(--ap-ink)}
html[data-app-theme] body.app-unified :is(a:not(.primary):not(.book-cover a),.stat b){color:var(--ap-accent)}
html[data-app-theme] body.app-unified :is(#app-navigation a:not(.app-brand),#app-global button){color:var(--ap-ink)}
html[data-app-theme] #app-navigation a[aria-current=page]{background:var(--ap-soft);color:var(--ap-ink);border-left-color:var(--ap-accent)}
html[data-app-theme] body.app-unified :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline-color:var(--ap-accent)}
html[data-app-theme] body.app-unified :is(input[type=checkbox],input[type=radio]){accent-color:var(--ap-accent)}
html[data-app-theme] body.app-unified dialog{background:var(--ap-surface);color:var(--ap-ink)}
html[data-app-theme=graphite] body.app-unified :is(.notice,.book-note,.book-example){background:var(--ap-alt);color:var(--ap-ink)}
html[data-app-theme=graphite] body.app-unified .error{background:#422b2a;color:#ffb4aa}
html[data-app-theme] #security-shield{background:var(--ap-bg);color:var(--ap-ink)}
html[data-app-theme] #security-shield .security-card{background:var(--ap-surface);border-color:var(--ap-line)}
html[data-app-theme] #security-shield input{background:var(--ap-surface);color:var(--ap-ink)}
html[data-app-theme] #security-shield button[type=submit]{background:var(--ap-accent);color:var(--ap-on-accent)}
}
#appearance-open{white-space:nowrap}
#appearance-dialog{box-sizing:border-box;width:min(780px,94vw);max-width:94vw;max-height:88dvh;padding:24px;border:1px solid var(--ap-line);border-radius:16px;background:var(--ap-surface);color:var(--ap-ink);box-shadow:0 24px 90px #0004;font:14px/1.5 system-ui,sans-serif}
#appearance-dialog::backdrop{background:#101c2c80;backdrop-filter:blur(3px)}
#appearance-dialog .appearance-heading{display:flex;align-items:center;gap:16px;justify-content:space-between}
#appearance-dialog h2{font-size:24px;margin:0}#appearance-dialog .appearance-intro{color:var(--ap-muted);max-width:580px;margin:10px 0 20px}
#appearance-dialog .appearance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#appearance-dialog .appearance-choice{display:flex;flex-direction:column;align-items:stretch;gap:5px;padding:10px;border:2px solid var(--ap-line);border-radius:12px;background:var(--ap-surface);color:var(--ap-ink);text-align:left;font:inherit;min-width:0;cursor:pointer}
#appearance-dialog .appearance-choice[aria-pressed=true]{border-color:var(--ap-accent);box-shadow:0 0 0 1px var(--ap-accent)}
#appearance-dialog .appearance-choice:hover{background:var(--ap-hover)}
#appearance-dialog .appearance-swatch{display:flex;height:76px;background:var(--ap-bg);border:1px solid var(--ap-line);border-radius:7px;overflow:hidden;margin-bottom:4px}
#appearance-dialog .appearance-swatch>i{width:26%;background:var(--ap-nav);border-right:1px solid var(--ap-line)}
#appearance-dialog .appearance-swatch>span{display:flex;flex:1;flex-direction:column;gap:6px;padding:10px}
#appearance-dialog .appearance-swatch>span i{height:10px;background:var(--ap-surface);border:1px solid var(--ap-line);border-radius:3px}
#appearance-dialog .appearance-swatch>span i:first-child{background:var(--ap-accent);border-color:var(--ap-accent);width:58%}
#appearance-dialog .appearance-description{font-size:12px;color:var(--ap-muted);min-height:36px}
#appearance-dialog .appearance-check{min-height:18px;color:var(--ap-accent);font-size:12px;font-weight:650}
#appearance-dialog .appearance-status{margin:18px 0 0;color:var(--ap-muted)}
#appearance-dialog button:disabled{opacity:.6;cursor:wait}
#appearance-dialog .appearance-heading button,#appearance-dialog>button{background:var(--ap-surface);color:var(--ap-ink);border:1px solid var(--ap-control);padding:8px 12px;border-radius:6px}
@media(max-width:560px){#appearance-dialog{padding:16px}#appearance-dialog .appearance-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#appearance-dialog h2{font-size:21px}#appearance-open{max-width:100%;white-space:normal}}
@media print{:root[data-app-theme]{--ap-bg:#f5f7f9;--ap-surface:#ffffff;--ap-alt:#edf2f5;--ap-ink:#243746;--ap-muted:#536777;--ap-line:#dce4e9;--ap-control:#b5c5ce;--ap-accent:#087f70;--ap-on-accent:#ffffff;--ap-soft:#e6f2ee;--ap-hover:#eef6f3;--ap-nav:#ffffff;--ap-nav-ink:#243746;color-scheme:light}#appearance-dialog,#appearance-open{display:none!important}}

/* React task surfaces also use the existing account palette. Paper artwork keeps its own colours. */
@media screen{
html[data-app-theme] :is(#erp-platform-root,#erp-leader-root){--ep-accent:var(--ap-accent);--ep-accent-soft:var(--ap-soft);--ep-card:var(--ap-surface);--ep-border:var(--ap-line);--ep-text:var(--ap-ink)}
html[data-app-theme] :is(#erp-platform-root,#erp-leader-root) .ep-button--primary{background:var(--ap-accent);border-color:var(--ap-accent);color:var(--ap-on-accent)}
html[data-app-theme] :is(#erp-platform-root,#erp-leader-root) .ep-button--primary:hover:not(:disabled){background:var(--ap-accent);border-color:var(--ap-accent);color:var(--ap-on-accent)}
}

/* The account theme includes both actual navigation shells, desktop and mobile. */
@media screen{
html[data-app-theme]{--ap-navigation-shadow:color-mix(in srgb,var(--ap-nav-ink) 22%,transparent);--ap-navigation-scrim:color-mix(in srgb,var(--ap-nav-ink) 45%,transparent)}
html[data-app-theme=graphite]{--ap-navigation-shadow:color-mix(in srgb,var(--ap-bg) 80%,transparent);--ap-navigation-scrim:color-mix(in srgb,var(--ap-bg) 72%,transparent)}
html[data-app-theme] #erp-platform-root .ep-sidebar,html[data-app-theme] #erp-leader-root .lr-sidebar{background:var(--ap-nav);color:var(--ap-nav-ink);border-color:var(--ap-line);scrollbar-color:var(--ap-muted) var(--ap-nav)}
html[data-app-theme] #erp-platform-root .ep-sidebar :is(.ep-brand,.ep-nav-link,.ep-quick-nav a,.ep-sidebar-bottom>a,.ep-user strong),html[data-app-theme] #erp-leader-root .lr-sidebar :is(.lr-brand,.lr-nav-link,.lr-user strong){color:var(--ap-nav-ink)}
html[data-app-theme] #erp-platform-root .ep-sidebar :is(.ep-brand small,.ep-nav-label,.ep-user small),html[data-app-theme] #erp-leader-root .lr-sidebar :is(.lr-brand small,.lr-nav-caption,.lr-user small,.lr-nav-secondary){color:var(--ap-muted)}
html[data-app-theme] #erp-platform-root .ep-sidebar .ep-nav-group>summary{color:var(--ap-nav-ink)}
html[data-app-theme] #erp-platform-root .ep-sidebar :is(.ep-nav-start,.ep-user),html[data-app-theme] #erp-platform-root .ep-sidebar .ep-nav-group>div,html[data-app-theme] #erp-leader-root .lr-sidebar .lr-user{border-color:var(--ap-line)}
html[data-app-theme] #erp-platform-root .ep-sidebar :is(.ep-nav-link,.ep-quick-nav a,.ep-sidebar-bottom>a):hover,html[data-app-theme] #erp-platform-root .ep-sidebar .ep-nav-group>summary:hover,html[data-app-theme] #erp-leader-root .lr-sidebar .lr-nav-link:hover{background:var(--ap-hover);color:var(--ap-nav-ink)}
html[data-app-theme] #erp-platform-root .ep-sidebar a.ep-nav-link--active,html[data-app-theme] #erp-platform-root .ep-sidebar a.ep-nav-link--active:hover,html[data-app-theme] #erp-leader-root .lr-sidebar a.lr-nav-link--current,html[data-app-theme] #erp-leader-root .lr-sidebar a.lr-nav-link--current:hover{background:var(--ap-soft);color:var(--ap-ink);border-color:var(--ap-accent);box-shadow:inset 3px 0 0 var(--ap-accent)}
html[data-app-theme] #erp-platform-root .ep-sidebar .ep-icon,html[data-app-theme] #erp-leader-root .lr-sidebar .ep-icon{color:inherit;opacity:1}
html[data-app-theme] #erp-platform-root .ep-sidebar .ep-nav-link--active .ep-icon,html[data-app-theme] #erp-leader-root .lr-sidebar .lr-nav-link--current .ep-icon{color:var(--ap-accent)}
html[data-app-theme] #erp-platform-root .ep-sidebar .ep-nav-active-dot{background:var(--ap-accent)}
html[data-app-theme] #erp-platform-root .ep-sidebar .ep-avatar,html[data-app-theme] #erp-leader-root .lr-sidebar .lr-avatar{background:var(--ap-soft);color:var(--ap-ink);border-color:var(--ap-line)}
html[data-app-theme] #erp-platform-root .ep-sidebar :is(a,summary,button):focus-visible,html[data-app-theme] #erp-leader-root .lr-sidebar :is(a,summary,button):focus-visible{outline:3px solid var(--ap-accent);outline-offset:2px}
html[data-app-theme] #erp-platform-root .ep-sidebar::-webkit-scrollbar,html[data-app-theme] #erp-leader-root .lr-sidebar::-webkit-scrollbar{background:var(--ap-nav)}
html[data-app-theme] #erp-platform-root .ep-sidebar::-webkit-scrollbar-thumb,html[data-app-theme] #erp-leader-root .lr-sidebar::-webkit-scrollbar-thumb{background:var(--ap-muted)}
html[data-app-theme] #erp-platform-root .ep-mobile-bar{background:var(--ap-nav);color:var(--ap-nav-ink);border-color:var(--ap-line)}
html[data-app-theme] #erp-platform-root .ep-mobile-bar :is(.ep-brand,.ep-icon-button),html[data-app-theme] #erp-leader-root :is(.lr-sidebar-close,.lr-menu-toggle){color:var(--ap-nav-ink);background:var(--ap-nav);border-color:var(--ap-control)}
html[data-app-theme] #erp-platform-root .ep-mobile-bar .ep-icon-button:hover,html[data-app-theme] #erp-leader-root :is(.lr-sidebar-close,.lr-menu-toggle):hover{color:var(--ap-nav-ink);background:var(--ap-hover);border-color:var(--ap-accent)}
html[data-app-theme] #erp-platform-root .ep-mobile-bar .ep-icon-button:focus-visible,html[data-app-theme] #erp-leader-root :is(.lr-sidebar-close,.lr-menu-toggle):focus-visible{outline:3px solid var(--ap-accent);outline-offset:2px}
html[data-app-theme] #erp-platform-root .ep-shell-more>summary,html[data-app-theme] :is(#erp-platform-root,#erp-leader-root) #security-controls>details>summary{background:var(--ap-surface);color:var(--ap-ink);border-color:var(--ap-control)}
html[data-app-theme] #erp-platform-root .ep-shell-more-panel,html[data-app-theme] :is(#erp-platform-root,#erp-leader-root) .security-account-links{background:var(--ap-surface);color:var(--ap-ink);border-color:var(--ap-line);box-shadow:0 10px 30px var(--ap-navigation-shadow)}
html[data-app-theme] #erp-platform-root .ep-shell-more-panel :is(a,button),html[data-app-theme] :is(#erp-platform-root,#erp-leader-root) #security-controls .security-account-links a{color:var(--ap-ink)}
html[data-app-theme] #erp-platform-root .ep-shell-more>summary:hover,html[data-app-theme] #erp-platform-root .ep-shell-more-panel :is(a,button):hover,html[data-app-theme] :is(#erp-platform-root,#erp-leader-root) #security-controls :is(summary,.security-account-links a):hover{background:var(--ap-hover);color:var(--ap-ink)}
html[data-app-theme] #erp-platform-root .ep-shell-more :is(summary,a,button):focus-visible,html[data-app-theme] :is(#erp-platform-root,#erp-leader-root) #security-controls :is(summary,.security-account-links a):focus-visible{outline:3px solid var(--ap-accent);outline-offset:2px}
html[data-app-theme] #appearance-dialog::backdrop{background:var(--ap-navigation-scrim)}
}
@media screen and (max-width:760px){html[data-app-theme] #erp-platform-root .ep-sidebar--open{box-shadow:0 14px 24px var(--ap-navigation-shadow)}}
@media screen and (max-width:850px){html[data-app-theme] #erp-leader-root .lr-sidebar--open{box-shadow:12px 0 35px var(--ap-navigation-shadow)}}

/* Editor chrome and native dialogs follow the account palette; certificate artwork is untouched. */
@media screen{
html[data-app-theme] #erp-platform-root .ep-certificate-page>aside{background:var(--ap-surface);color:var(--ap-ink)}
html[data-app-theme] #erp-platform-root .ep-certificate-page>aside legend{color:var(--ap-muted)}
body[data-erp-platform] .wt-host{--wt-bg:var(--ap-surface);--wt-ink:var(--ap-ink);--wt-line:var(--ap-line);--wt-soft:var(--ap-alt);--accent:var(--ap-accent)}
}
