:root{color-scheme:dark;--bg:#101317;--panel:#191e24;--line:#2b333d;--text:#e6ecf3;--muted:#8d9aaa;--blue:#6991ff;--green:#54d4a1;--red:#ff8693;--amber:#ebbb6b;font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;font-size:13px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit;color:inherit;background:#151a20;border:1px solid var(--line);border-radius:6px}button{cursor:pointer;white-space:nowrap;padding:9px 13px}button:hover{background:#293342;border-color:#53657d}button:disabled{opacity:.4;cursor:default}button.primary{background:#527ef0;border-color:#638bf2;color:white}input,select{padding:9px 10px;min-height:35px}input[type=date]{color-scheme:dark}input:focus,select:focus,textarea:focus,button:focus-visible{outline:2px solid var(--blue);outline-offset:2px}header{display:flex;align-items:center;justify-content:space-between;padding:22px 30px;border-bottom:1px solid var(--line);gap:15px}.brand{display:flex;gap:13px;align-items:center}.logo{background:#557ef0;color:white;border-radius:11px;width:43px;height:43px;display:grid;place-items:center;font-weight:800;letter-spacing:-2px;font-size:22px}.brand h1{font-size:19px;margin:0 0 5px;font-weight:600}.brand .muted{font-size:11px}.header-actions{display:flex;align-items:center;gap:9px}.chip{font-size:11px;border:1px solid var(--line);padding:6px 9px;border-radius:20px;color:#b6c1cf}nav{display:flex;gap:22px;align-items:center;padding:0 30px;border-bottom:1px solid var(--line)}nav button{border:0;background:none;border-radius:0;padding:16px 0;color:var(--muted);border-bottom:2px solid transparent}nav button.active{border-bottom-color:var(--blue);color:#c2d3ff}nav>span{margin-left:auto;font-size:11px}.badge{background:#30343c;color:#c6d1e0;padding:2px 6px;border-radius:10px;font-size:10px;margin-left:4px}main{padding:25px 30px 50px;max-width:2300px;margin:auto}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px}h2{font-size:21px;font-weight:600;margin:0 0 7px}h3{font-size:15px;font-weight:600}p{line-height:1.7;margin:7px 0}.muted{color:var(--muted)}.datebar{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin-bottom:18px}.datebar label{display:flex;align-items:center;gap:12px}.datebar>span:last-child{margin-left:auto;font-size:11px}.kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin:18px 0 22px}.kpi{border:1px solid var(--line);border-radius:9px;padding:17px 19px;background:var(--panel)}.kpi small{color:var(--muted);font-size:12px}.kpi strong{display:block;margin:11px 0 4px;font-size:25px;font-weight:550;letter-spacing:-.5px;font-variant-numeric:tabular-nums}.kpi .sub{font-size:11px;color:var(--muted)}.positive{color:var(--green)!important}.negative{color:var(--red)!important}.panel{background:var(--panel);border:1px solid var(--line);border-radius:9px;overflow:hidden}.levels{padding:17px 16px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--line)}.eyebrow{color:var(--muted);font-size:11px;margin-right:2px}#levels{display:flex;gap:10px;flex-wrap:wrap}.level{display:flex;align-items:center;border:1px solid #3b4c6b;border-radius:6px;background:#1d2736}.level b{font-weight:500;color:var(--blue);padding-left:10px}.level select{border:0;background:none;max-width:205px}.level button{border:0;background:none;padding:8px;color:var(--muted)}.filters{display:flex;align-items:end;gap:10px;flex-wrap:wrap;padding:14px 16px}.filter{flex:1;min-width:125px;max-width:280px}.filter label{font-size:10px;color:var(--muted);display:block;margin-bottom:6px}.filter select{width:100%}.toolbar{padding:12px 16px;border-top:1px solid var(--line);display:flex;gap:8px;align-items:center;flex-wrap:wrap}.toolbar input{min-width:245px}.spacer{flex:1}.segmented{display:flex;background:#10151e;border-radius:6px;padding:3px}.segmented button{border:0;background:none;padding:6px 10px;color:var(--muted)}.segmented button.active{background:#2c394e;color:#dce6fa}.table-scroll{overflow:auto;max-height:65vh;min-height:240px;border-top:1px solid var(--line)}table{border-collapse:separate;border-spacing:0;width:100%;font-size:12px;white-space:nowrap}th,td{padding:13px 15px;text-align:right;border-bottom:1px solid #293039;border-right:1px solid #242b34;font-variant-numeric:tabular-nums}th{background:#252d37;color:#bac7d6;font-weight:500;position:sticky;top:0;z-index:3;font-size:11px}th button{font-size:11px;border:0;background:none;padding:0;color:inherit}td:first-child,th:first-child{text-align:left}#reportTable td:first-child,#reportTable th:first-child{position:sticky;left:0;z-index:2;background:var(--panel);min-width:310px;max-width:480px}#reportTable th:first-child{background:#252d37;z-index:4}#reportTable tbody tr:hover td{background:#212e43}#reportTable tbody tr.parent td{font-weight:600}#reportTable td:first-child{overflow:hidden;text-overflow:ellipsis}#reportTable .node{border:none;background:none;padding:0 8px 0 0;min-width:20px;color:#a9bfe6}#reportTable .name{border:0;background:none;padding:0;color:inherit;max-width:390px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;text-align:left}#reportTable tfoot{position:sticky;bottom:0;z-index:4}#reportTable tfoot td{background:#283345!important;font-weight:600;border-top:1px solid #465775}.dimension-tag{color:#8797ac;margin-left:10px;font-size:10px;font-weight:400}.table-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 16px;font-size:10px;color:var(--muted)}#pagination{display:flex;align-items:center;gap:8px}.empty{text-align:center;padding:65px 25px}.empty h3{font-size:20px}.empty p{color:var(--muted)}.empty .primary{margin:16px 0}.empty-icon{font-size:40px;color:var(--blue)}.notice,#message{border:1px solid #615034;color:#e7c58f;background:#28231c;border-radius:7px;padding:12px 15px;line-height:1.7;margin-bottom:15px}.notice button{padding:3px 8px;margin-left:10px;color:inherit;background:transparent;border-color:#615034}#message.error{color:#ffa4ad;background:#302027;border-color:#774550}.method{margin-top:20px;color:var(--muted);line-height:1.7;max-width:1100px}.method summary{cursor:pointer}.method p{font-size:12px}.rules{padding:22px;max-width:1150px}.rules h3{margin-top:0}textarea{width:100%;height:430px;padding:15px;line-height:1.6;font:12px Consolas,monospace;margin-top:14px;resize:vertical}.help{margin-top:20px;padding:20px;max-width:1150px}.help button{margin-top:10px}.audit-block{margin-bottom:22px}.audit-block>h3{margin-top:0}.audit-block .panel{margin-top:12px}.audit-block .table-scroll{min-height:0;max-height:430px}.issue-name{white-space:normal;min-width:260px;max-width:580px;word-break:break-word}.issue-id{font-size:10px;display:block;color:var(--muted);margin-top:4px}.issue-assign{display:flex;gap:6px}.issue-assign input{width:135px}.issue-assign button{padding:6px 9px}.audit-summary{padding:15px 18px;cursor:pointer;background:#1b222c}.audit-summary .muted{margin-left:15px}details.audit-block{border:1px solid var(--line);border-radius:8px;overflow:hidden}details.audit-block>div{padding:15px}dialog{color:var(--text);background:var(--panel);border:1px solid #52627a;border-radius:10px;width:95vw;max-width:1500px;max-height:90vh;padding:24px}dialog::backdrop{background:#0009}dialog .table-scroll{max-height:65vh}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}@media(max-width:1050px){header{padding:17px 20px;flex-wrap:wrap}main{padding:20px}nav{padding:0 20px;gap:18px;flex-wrap:wrap}nav>span{display:none}.kpis{grid-template-columns:repeat(3,1fr)}.kpi strong{font-size:22px}.table-footer{flex-wrap:wrap}.datebar>span:last-child{margin-left:0}.toolbar input{min-width:160px}}@media(max-width:600px){main{padding:14px}.header-actions{flex-wrap:wrap}.chip{display:none}.kpis{grid-template-columns:repeat(2,1fr)}.kpi{padding:13px}.kpi strong{font-size:21px}nav{gap:13px;font-size:12px}.filter{min-width:130px}#reportTable td:first-child,#reportTable th:first-child{min-width:190px;max-width:220px}.levels{gap:8px}#levels{width:100%}.level{width:100%}.level select{flex:1;max-width:none}.section-heading{align-items:flex-start}.toolbar input{width:100%}.table-scroll{max-height:60vh}}
.level .level-handle{cursor:grab;touch-action:none;user-select:none;padding:8px 5px 8px 9px;font-size:19px;line-height:1;color:#92a8c9}
.level .level-handle:active{cursor:grabbing}.level .level-handle:disabled{cursor:default}
.level:has(.level-handle) b{padding-left:3px}.level.dragging{opacity:.55}.level.drop-target{outline:2px solid var(--blue);outline-offset:3px;background:#293c59}

.login-panel{min-height:100vh;display:grid;place-items:center;padding:24px}.login-card{width:100%;max-width:400px;padding:30px}.login-card h1{font-size:24px}.login-card form{display:grid;gap:12px;margin-top:24px}.login-card input{width:100%}.login-card button{margin-top:8px}#loginError{color:var(--red);min-height:20px}

/* Account-selected light palette, including sticky cells and native controls. */
:root[data-theme="light"]{color-scheme:light;--bg:#f5f7fa;--panel:#ffffff;--line:#d7dfe9;--text:#202c3d;--muted:#5f6d80;--blue:#315fce;--green:#087b50;--red:#ba263f;--amber:#946000}
[data-theme="light"] button,[data-theme="light"] input,[data-theme="light"] select,[data-theme="light"] textarea{background:#fff}
[data-theme="light"] input[type=date]{color-scheme:light}
[data-theme="light"] button:hover{background:#e9eff8;border-color:#91a6c3}
[data-theme="light"] button.primary{background:#315fce;color:#fff;border-color:#315fce}
[data-theme="light"] .chip{color:#506078}
[data-theme="light"] nav button{background:transparent}
[data-theme="light"] nav button.active{color:#244fb8}
[data-theme="light"] .badge{background:#e5ebf5;color:#364c6d}
[data-theme="light"] .level{background:#eff4fc;border-color:#b8c9e3}
[data-theme="light"] .level select,[data-theme="light"] .level button{background:transparent}
[data-theme="light"] .level .level-handle{color:#536d93}
[data-theme="light"] .level.drop-target{background:#dce9fc}
[data-theme="light"] .segmented{background:#edf1f7}
[data-theme="light"] .segmented button{background:transparent}
[data-theme="light"] .segmented button.active{background:#d9e5fb;color:#244b9b}
[data-theme="light"] th,[data-theme="light"] #reportTable th:first-child{background:#eaf0f7;color:#43546b}
[data-theme="light"] th button,[data-theme="light"] #reportTable .name,[data-theme="light"] #reportTable .node{background:transparent}
[data-theme="light"] th,[data-theme="light"] td{border-color:#dfe5ee}
[data-theme="light"] #reportTable tbody tr:hover td{background:#eef4ff}
[data-theme="light"] #reportTable .node{color:#4c6792}
[data-theme="light"] #reportTable tfoot td{background:#e1eafa!important;border-top-color:#aabbd6}
[data-theme="light"] .dimension-tag{color:#65758d}
[data-theme="light"] .notice,[data-theme="light"] #message{background:#fff7e8;border-color:#dec58d;color:#78520c}
[data-theme="light"] .notice button{background:transparent;border-color:#cdb371}
[data-theme="light"] #message.error{background:#fff0f2;border-color:#e5a7b1;color:#a72138}
[data-theme="light"] .audit-summary{background:#eff3f9}
[data-theme="light"] dialog{border-color:#aabbd1}

.search-select{position:relative;display:inline-block;min-width:150px;max-width:300px}.search-select-trigger{width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;min-height:35px}.search-select-popup{position:absolute;top:calc(100% + 5px);left:0;z-index:20;width:280px;max-width:80vw;padding:8px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 26px #0003}.search-select-popup input{width:100%;margin-bottom:6px}.search-select-list{display:block;max-height:260px;overflow-y:auto}.search-select-option,.search-select-empty{display:block;padding:9px 10px;white-space:normal;overflow-wrap:anywhere}.search-select-option{cursor:pointer;border-radius:4px}.search-select-option:hover,.search-select-option.highlight{background:#293c59}.search-select-option[aria-selected=true]{color:var(--blue);font-weight:600}[data-theme=light] .search-select-option:hover,[data-theme=light] .search-select-option.highlight{background:#e5edfc}

.level select.level-sort{border-left:1px solid var(--line);border-radius:0;max-width:175px;font-size:11px;color:var(--muted)}
@media(max-width:600px){.level{flex-wrap:wrap}.level select.level-sort{flex-basis:100%;max-width:none;border-left:0;border-top:1px solid var(--line)}}

.cost-toggle{display:flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap}.cost-toggle input{min-height:0;accent-color:var(--blue)}

/* Cost sources and the local report cost-mode switch. */
.cost-kpi{position:relative;border-color:var(--blue)}
.cost-card-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.cost-card-heading .cost-toggle{position:relative;cursor:pointer;font-size:11px;font-weight:600;color:var(--text);gap:6px;padding:4px 6px;border-radius:6px;background:var(--bg)}
.cost-toggle input{position:absolute;width:1px;height:1px;opacity:0;min-height:0;padding:0}
.cost-switch{display:inline-block;width:28px;height:16px;background:var(--muted);border-radius:12px;position:relative;flex-shrink:0;transition:background .15s}
.cost-switch:after{content:'';position:absolute;width:12px;height:12px;top:2px;left:2px;border-radius:50%;background:#fff;transition:transform .15s}
.cost-toggle input:checked+.cost-switch{background:var(--blue)}
.cost-toggle input:checked+.cost-switch:after{transform:translateX(12px)}
.cost-toggle input:focus-visible+.cost-switch{outline:2px solid var(--blue);outline-offset:3px}
.cost-hover{position:relative;width:fit-content;max-width:100%}
.cost-value{padding:0;border:0;background:transparent!important;text-align:left;cursor:help;border-radius:3px}
.cost-value strong{border-bottom:1px dashed var(--muted)}
.cost-details{display:none;position:absolute;top:100%;left:0;width:min(360px,calc(100vw - 60px));z-index:20;background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 32px #0004;padding:16px;color:var(--text);font-size:12px;line-height:1.5}
.cost-hover:hover .cost-details,.cost-hover:focus-within .cost-details{display:block}
.cost-detail-title{display:block;font-size:14px;margin-bottom:10px}
.cost-detail-line{display:flex;justify-content:space-between;align-items:baseline;gap:18px;padding:6px 0;font-variant-numeric:tabular-nums}
.cost-detail-line b{white-space:nowrap;font-weight:600}
.cost-platform{padding-left:12px;color:var(--muted);font-size:11px}
.cost-detail-total{border-top:1px solid var(--line);margin-top:9px;padding-top:12px;font-weight:600}
.cost-deduction,.cost-empty{font-size:11px;color:var(--muted)}

.cost-account{padding-left:24px;color:var(--muted);font-size:11px}

.report-multiselect{display:block;width:100%;min-width:0}.report-multiselect .search-select-trigger{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.report-multiselect .search-select-popup{width:max(100%,320px);max-width:calc(100vw - 32px);z-index:100}.filter:last-child .report-multiselect .search-select-popup{left:auto;right:0}.multi-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px}.multi-actions button{font-size:12px;padding:6px 10px}.report-multiselect .multi-option{display:flex;align-items:center;gap:9px;padding:9px 12px;cursor:pointer;overflow-wrap:anywhere;color:var(--text);font-size:14px}.report-multiselect .multi-option input{width:16px;height:16px;min-width:16px;margin:0;accent-color:var(--blue)}.report-multiselect .multi-option:hover{background:var(--bg)}

.panel:has(#filters){overflow:visible}.report-multiselect .multi-option input{min-height:16px;padding:0}.report-multiselect .multi-option{margin:0}
