/* Preserve Layout 2 geometry/density; dark palette is the first-load default. */
body[data-theme="dark"]{
 color-scheme:dark;
 --rl-bg:#0b1521;--rl-muted-bg:#101d2e;--rl-surface2:#142437;--rl-surface3:#1b324a;
 --rl-border:#304459;--rl-ink:#e8f0f8;--rl-muted:#abbdd0;--rl-faint:#8ea5ba;
 --rl-accent:#69abf2;--rl-positive:#64c0ae;
 --bg:#0b1521;--bg2:#101d2e;--surface:#132235;--surface2:#172b41;--surface3:#213b54;--border:#304459;
 --text:#e8f0f8;--muted:#abbdd0;--muted2:#8ea5ba;--blue:#69abf2;--teal:#64c0ae;--gold:#dcb874;--red:#fb928a;--nav:#101d2e;
 --shadow:0 6px 22px rgba(0,0,0,.25);
}
body[data-theme="dark"] .main{background:linear-gradient(135deg,#0c1827,#0b1521)}
body[data-theme="dark"] .app-toprail,body[data-theme="dark"] .sidebar,body[data-theme="dark"] .sidebar-close,
body[data-theme="dark"] .nav-trigger{background:#111e2d;color:var(--text);border-color:var(--rl-border)!important}
body[data-theme="dark"] .rail-monogram{background:#315f91}
body[data-theme="dark"] .nav-trigger:hover,body[data-theme="dark"] .quick-nav:hover{background:#1b3148}
body[data-theme="dark"] .top-search,body[data-theme="dark"] .top-export,body[data-theme="dark"] .top-theme,
body[data-theme="dark"] .top-sync,body[data-theme="dark"] .layout-button,body[data-theme="dark"] .zoom-buttons,
body[data-theme="dark"] .filter-wrap select{background:#16283b!important;color:#e8f0f8!important;border-color:#37526b!important}
body[data-theme="dark"] .top-search input{color:#eef4fb!important}
body[data-theme="dark"] .top-subline .subline-button{background:#15283a!important;color:#e8f0f8!important;border-color:#36516b!important}
body[data-theme="dark"] .kpi-grid{background:#132235;border-color:var(--rl-border)!important}
body[data-theme="dark"] .kpi-card{background:#132235!important;border-color:#304459!important}
body[data-theme="dark"] .kpi-card:hover,body[data-theme="dark"] .kpi-card.selected{background:#1d344e!important}
body[data-theme="dark"] .workspace-card,body[data-theme="dark"] .info-card,body[data-theme="dark"] .insights-panel{background:#142337!important;border-color:#304459!important}
body[data-theme="dark"] .grid-cell{background:#142337;color:var(--text)}
body[data-theme="dark"] .grid-head .grid-cell,body[data-theme="dark"] .group .grid-cell,body[data-theme="dark"] .group .grid-cell.sticky{background:#1d3147!important;color:var(--text)}
body[data-theme="dark"] .tab.active,body[data-theme="dark"] .detail-tabs button.active,
body[data-theme="dark"] .detail-value{background:#1d344e!important;color:#eef4fb!important}
body[data-theme="dark"] .edit-selected{background:#1e344b!important;color:#9cc9ff!important}
body[data-theme="dark"] .insights-panel{background:#132235!important}
body[data-theme="dark"] .insights-head{background:#1c3046;color:#e8f0f8}
body[data-theme="dark"] .sidebar .nav-item{color:#b7cce1}
body[data-theme="dark"] .sidebar .nav-item.active{background:#274968;color:#fff}
body[data-theme="dark"] .project-pill{background:#1c3046;color:#e8f0f8;border-color:#36516c}
body[data-theme="dark"] .grid-head{background:#1c3046}
body[data-theme="dark"] .ctl-wrapper,body[data-theme="dark"] .pc-root,body[data-theme="dark"] .fin-root{color:var(--text)}
body[data-theme="dark"] .ctl-table,body[data-theme="dark"] .ctl-table tr,body[data-theme="dark"] .ctl-table td,
body[data-theme="dark"] .ctl-table th{border-color:#2e4359;color:var(--text)}
body[data-theme="dark"] .ctl-table th{background:#1b3148}
body[data-theme="dark"] .top-caption,body[data-theme="dark"] .quick-nav.active{color:#8ec2ff}
body[data-theme="dark"] :is(input,select,textarea){color-scheme:dark}
body[data-theme="dark"] .web-auth-card{background:#142337;color:#e8f0f8;border-color:#38546c}
/* The clean-document module inherits the dark default without changing its density. */
body[data-theme="dark"] .starcom-module{color:var(--text)}
body[data-theme="dark"] .st-head h2,body[data-theme="dark"] .st-detail-head{color:#e8f0f8}
body[data-theme="dark"] .st-head p,body[data-theme="dark"] .st-foot,body[data-theme="dark"] .st-detail-group p{color:#abbdd0}
body[data-theme="dark"] .st-eyebrow,body[data-theme="dark"] .st-msg{color:#89b7e3}
body[data-theme="dark"] .st-notice{background:#192c41;border-color:#2f475e;color:#d0dfed}
body[data-theme="dark"] .st-grid .st-stat{background:#182b42;border-color:#30475c}
body[data-theme="dark"] .st-stat strong{color:#e9f4ff}
body[data-theme="dark"] .st-stat span{color:#a8bed2}
body[data-theme="dark"] .st-panel{background:#15283d;border-color:#30475c}
body[data-theme="dark"] .st-actions button:not(.st-primary),body[data-theme="dark"] .st-button:not(.st-primary),
body[data-theme="dark"] .st-canvas-toolbar button,body[data-theme="dark"] .st-table button{
 background:#1c3148!important;border-color:#385672!important;color:#e8f0f8!important}
body[data-theme="dark"] .st-actions button:hover,body[data-theme="dark"] .st-sheet-button:hover{background:#264461!important}
body[data-theme="dark"] .st-filters label,body[data-theme="dark"] .st-form label,body[data-theme="dark"] .st-drawing-detail label{color:#bbcee0}
body[data-theme="dark"] .starcom-module :is(input,select,textarea){background:#192d42!important;color:#eff6ff!important;border-color:#38536b!important}
body[data-theme="dark"] .st-table-scroll{background:#15283d;border-color:#34506a}
body[data-theme="dark"] .st-table{color:#e8f0f8}
body[data-theme="dark"] .st-table th{background:#1e364d;color:#c7d9e9;border-color:#36526a}
body[data-theme="dark"] .st-table td{border-color:#30475d}
body[data-theme="dark"] .st-table td:first-child{color:#91c3ff}
body[data-theme="dark"] .st-table tbody tr:hover{background:#223a53}
body[data-theme="dark"] .st-pill{background:#2a4057;color:#e8f0f8}
body[data-theme="dark"] .st-pill.prepared_review{background:#164c55;color:#91e5d7}
body[data-theme="dark"] .st-pill.restricted_pending{background:#604224;color:#ffda9b}
body[data-theme="dark"] .st-sheet-button{color:#e8f0f8;border-color:#365168}
body[data-theme="dark"] .st-sheet-button.selected{background:#25415a}
body[data-theme="dark"] .st-sheet-button strong{color:#d9ebff}
body[data-theme="dark"] .st-sheet-button small{color:#a8bed2}
body[data-theme="dark"] .st-drawing-list input,body[data-theme="dark"] .st-drawing-list select{background:#182e43;color:#e8f0f8}
body[data-theme="dark"] .st-link{background:#203d56;color:#dbefff;border-color:#3e5a73}
body[data-theme="dark"] .st-detail-group{border-color:#37506a}
body[data-theme="dark"] .st-modal-content{background:#172b40;color:#e8f0f8;border:1px solid #34516b}
body[data-theme="dark"] .st-view{background:#2a3c4f;border-color:#3b5772}
