.app:has([data-nav="plan"].active) .main>.cards{display:none}
.app:has([data-nav="plan"].active) .topbar [data-action="add"]{display:none}
.plan-form{font-size:1rem;line-height:1.5}
.plan-intro{display:grid;grid-template-columns:minmax(240px,1fr) 1.25fr;gap:28px;align-items:end;margin-bottom:24px}
.plan-intro label{display:block;font-size:.875rem;font-weight:600;margin-bottom:7px}.plan-intro input{width:100%;font-size:1.0625rem;font-weight:600}.plan-intro p{color:#526275;font-size:.9375rem;margin:0}
.plan-kpis{display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:16px;margin-bottom:24px}
.plan-kpi{padding:20px;background:white;border:1px solid #e8edf3;border-radius:14px;display:flex;flex-direction:column;gap:9px}
.plan-kpi:first-child{border-top:3px solid #3860cf}.plan-kpi span{font-size:.875rem;color:#56677a}.plan-kpi strong{font-size:1.35rem;line-height:1.4;font-variant-numeric:tabular-nums}.plan-kpi small{font-size:.8125rem;color:#627185}
.plan-salary,.plan-expenses,.plan-investments{margin-bottom:24px}.plan-salary-body{padding:20px 24px}.plan-salary-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.plan-form input{min-width:0;font-size:1rem;max-width:100%}.plan-form .field input{width:100%}
.plan-formula{padding:16px 18px;background:#edf3ff;border-radius:10px;color:#2f4a80;margin-bottom:16px}.plan-formula span{font-size:.875rem}.plan-salary-fact{font-size:.875rem;color:#607083;line-height:1.6;margin-bottom:18px}
.plan-basis{display:flex;gap:20px;justify-content:space-between;align-items:center;flex-wrap:wrap}.plan-basis label{font-size:.875rem}.plan-basis select{max-width:240px}.plan-group-title{background:#eef2f8;padding:15px 24px;display:flex;align-items:center;justify-content:space-between;gap:18px}.plan-group-title h3{font-size:1rem;margin:0}.plan-group-title span{font-size:.875rem;color:#596c80;font-variant-numeric:tabular-nums}
.plan-row,.plan-column-head{display:grid;grid-template-columns:minmax(250px,1.4fr) 160px minmax(150px,1fr);gap:20px;padding:19px 24px;align-items:start;border-bottom:1px solid #edf0f5}.plan-column-head{padding-top:12px;padding-bottom:12px;background:#fafbfe;font-size:.875rem;color:#637386}.plan-article>label{font-size:1rem;font-weight:500;line-height:1.45}.plan-statistics{display:flex;gap:16px;flex-wrap:wrap;margin-top:11px}.plan-statistics span{display:flex;flex-direction:column;gap:3px}.plan-statistics small{font-size:.8125rem;color:#6f7e8f}.plan-statistics b{font-size:.875rem;font-weight:500;font-variant-numeric:tabular-nums}.plan-number input{width:100%;font-variant-numeric:tabular-nums;border-color:#aebfdf;background:#fbfcff}.plan-number input:placeholder-shown{background:#fff}.plan-use{font-size:.8125rem!important;padding:6px 0!important;min-height:30px!important;color:#365bc0!important}.plan-row>input{width:100%;font-size:.875rem}
.plan-note{font-size:.875rem;color:#617084;line-height:1.6;margin:12px 0 24px}.plan-savebar{position:sticky;bottom:0;background:rgba(255,255,255,.98);box-shadow:0 -4px 20px #20305012;border:1px solid #e0e7f1;border-radius:12px;display:flex;gap:20px;justify-content:space-between;align-items:center;padding:17px 22px;z-index:5}.plan-savebar strong{font-size:.9375rem;color:#31513e}#plan-error{color:#b33d37;font-size:.875rem;max-width:520px}.plan-form .panel h2{font-size:1.15rem}
@media(max-width:1250px){.plan-kpis{grid-template-columns:1fr 1fr}.plan-kpi:first-child{grid-column:1/-1}.plan-intro{grid-template-columns:1fr;gap:12px}.plan-row,.plan-column-head{grid-template-columns:minmax(220px,1fr) 150px;gap:15px}.plan-row>input{grid-column:1/-1}.plan-column-head>span:last-child{display:none}.plan-group-title{flex-wrap:wrap;gap:5px}.plan-salary-fields{gap:12px}.plan-salary-fields label{font-size:.875rem}.plan-savebar{flex-wrap:wrap}}
@media(max-width:650px){.plan-kpis{grid-template-columns:1fr}.plan-kpi:first-child{grid-column:auto}.plan-salary-fields{grid-template-columns:1fr}.plan-salary-fields .field{margin-bottom:4px}.plan-row{grid-template-columns:1fr;padding:17px}.plan-row>input{grid-column:auto}.plan-number{display:flex;gap:14px;align-items:center}.plan-number input{max-width:180px}.plan-column-head{display:none}.plan-savebar{padding:14px}.plan-basis .toolbar{align-items:stretch;flex-wrap:wrap}}

.article-help{margin:9px 0 5px;font-size:.875rem;color:#50637b;line-height:1.6}
.article-help summary{display:list-item;cursor:pointer;color:#365bc0;font-weight:500;width:fit-content;padding:3px 0}
.article-help summary:focus-visible{outline:2px solid #3860cf;outline-offset:4px;border-radius:3px}
.article-help[open]{background:#f3f6fc;border-radius:8px;padding:10px 13px}
.article-help p{margin:9px 0 0}.article-help p:last-child{color:#596d84}
.salary-help{margin:0 0 20px}.salary-help[open]{max-width:100%}

.revenue-panel{margin-bottom:24px}.revenue-fields{display:grid;grid-template-columns:1fr 1fr;gap:20px;padding:20px 24px 0}.revenue-fields input{width:100%}.revenue-hint{padding:0 24px 20px;margin:0;font-size:.875rem;color:#617084}
.plan-row,.plan-column-head{grid-template-columns:minmax(230px,1.2fr) minmax(240px,1fr) minmax(150px,.8fr)}
.plan-number select{width:100%;margin-bottom:10px}.item-values{display:flex;gap:10px}.item-field-label{display:block;flex:1;min-width:0;font-size:.875rem;color:#53667e}.item-field-label input{margin-top:5px}.item-result{font-size:.8125rem;color:#53667e;line-height:1.6;margin-top:8px}.scenario-status{grid-column:1/-1;font-size:.875rem;color:#53667e;background:#eef3fc;padding:12px 18px;border-radius:9px}
@media(max-width:1250px){.plan-row,.plan-column-head{grid-template-columns:minmax(220px,1fr) minmax(240px,1fr)}}
@media(max-width:650px){.revenue-fields{grid-template-columns:1fr}.plan-row{grid-template-columns:1fr}.plan-number{display:block}.plan-number input{max-width:none}}

.salary-position{padding:18px;border:1px solid #dce4f0;border-radius:12px;margin-bottom:15px;background:#fafcff}.position-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.position-heading strong{font-size:.9375rem}.position-fields{display:grid;grid-template-columns:1.4fr 110px 1fr;gap:14px}.position-fields select{width:100%;margin-top:5px}.position-pay{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.salary-position input{width:100%}.salary-tax{display:flex;align-items:center;gap:16px;margin:22px 0}.salary-tax label{font-size:.875rem;font-weight:600}.salary-tax input{width:150px}.salary-positions .muted{font-size:.9375rem}
@media(max-width:900px){.position-fields{grid-template-columns:1fr 100px}.position-fields>label:last-child{grid-column:1/-1}}
@media(max-width:650px){.position-fields,.position-pay{grid-template-columns:1fr}.salary-tax{flex-wrap:wrap}}

/* Compact planning workspace */
.plan-form input,.plan-form select{font-size:.875rem;height:32px;min-height:32px;padding:5px 8px;border-radius:6px}.plan-form button{min-height:30px;padding:5px 10px;font-size:.875rem}.plan-form input::placeholder{font-size:.8125rem}
.plan-form .panel-head{padding:12px 16px}.plan-form .panel h2{font-size:1rem}.plan-form .panel-head .subtitle{font-size:.875rem;margin-top:4px}.plan-salary-body{padding:12px 16px}.plan-form .panel{margin-bottom:16px}
.plan-group-title{padding:8px 16px}.plan-group-title h3{font-size:.9375rem}.plan-group-title span{font-size:.8125rem}.plan-column-head{padding:6px 16px;font-size:.8125rem}
.plan-row,.plan-column-head{grid-template-columns:minmax(220px,1.2fr) minmax(280px,1.3fr) minmax(170px,.8fr);gap:12px}.plan-row{padding:8px 16px;align-items:center}.plan-article>label{font-size:.875rem;font-weight:500;line-height:1.35}.plan-number{display:flex;align-items:end;gap:8px}.plan-number select{width:112px;flex:0 0 112px;margin:0}.item-values{flex:1;gap:6px;min-width:0}.item-field-label{font-size:.8125rem;line-height:1.3}.item-field-label input{margin-top:3px}.plan-number input{width:100%;min-width:70px}.compact-result{font-size:.875rem;line-height:1.5;font-variant-numeric:tabular-nums;color:#435b77;text-align:right}
.row-details{margin-top:3px;font-size:.875rem}.row-details>summary{font-size:.8125rem;cursor:pointer;color:#5874a2}.row-details[open]{padding-top:4px}.row-details .plan-statistics{gap:12px;margin:7px 0}.row-details input{width:100%;margin-top:7px}.row-details .article-help{margin:5px 0}.row-details .plan-use{display:block}.plan-use{min-height:26px!important}
.salary-block{border:1px solid #dce4f0;border-radius:8px;margin-bottom:12px;overflow:hidden}.salary-block-head{display:flex;align-items:center;gap:12px;padding:8px 10px;background:#eef2f8;flex-wrap:wrap}.salary-block-head h3{font-size:.9375rem;margin:0}.salary-block-head>span{font-size:.8125rem;color:#53667e;margin-left:auto}.salary-block-head button{font-size:.8125rem!important}.salary-empty{padding:9px 12px;font-size:.875rem;color:#758296}
.salary-position{display:grid;grid-template-columns:minmax(400px,1.6fr) minmax(210px,1fr);gap:4px 10px;border:0;border-radius:0;border-top:1px solid #e3e9f3;margin:0;padding:8px 10px;background:white}.position-fields{display:grid;grid-template-columns:minmax(120px,1.3fr) 54px minmax(100px,1fr) minmax(110px,1fr);gap:8px}.position-fields>label:last-child{grid-column:auto}.position-fields select{margin-top:3px}.position-pay{display:grid;grid-template-columns:1fr 1fr 24px;gap:6px;margin:0;align-items:end}.position-remove{padding:3px!important}.salary-position .item-result{grid-column:1/-1;margin-top:1px;font-size:.8125rem;line-height:1.3}.salary-tax{margin:12px 0;gap:12px}.salary-tax input{width:100px}.plan-formula{padding:10px 12px;font-size:.875rem;margin-bottom:10px}.plan-salary-fact{font-size:.8125rem;margin-bottom:10px}.salary-help{margin:0 0 10px}
.plan-savebar{padding:9px 16px;border-radius:8px}.plan-intro{margin-bottom:14px}.revenue-fields{padding:12px 16px 0;gap:14px}.revenue-hint{padding:0 16px 12px;font-size:.8125rem}.plan-kpis{gap:12px;margin-bottom:16px}.plan-kpi{padding:12px 16px;gap:5px}.plan-kpi strong{font-size:1.2rem}.scenario-status{padding:8px 12px;font-size:.8125rem}.plan-note{font-size:.8125rem;margin:10px 0 16px}
@media(max-width:1150px){.plan-row,.plan-column-head{grid-template-columns:minmax(190px,1fr) minmax(260px,1.3fr)}.compact-result{grid-column:2;text-align:left;font-size:.8125rem}.plan-column-head>span:last-child{display:none}.salary-position{grid-template-columns:1fr}.position-pay{max-width:400px}.position-fields>label:last-child{grid-column:auto}}
@media(max-width:650px){.plan-row{grid-template-columns:1fr}.compact-result{grid-column:auto}.plan-number{display:flex}.plan-number select{width:100px;flex-basis:100px}.position-fields{grid-template-columns:1fr 60px}.position-pay{max-width:none}.salary-block-head>span{margin:0}.plan-row .plan-number input{max-width:none}.plan-column-head{display:none}}

.plan-number .item-field-label{font-size:0}.plan-number .item-field-label input{font-size:.875rem;margin-top:0;height:30px;min-height:30px}.plan-number select{height:30px;min-height:30px}.plan-row{padding-top:6px;padding-bottom:6px}.row-details>summary{line-height:1.3}

/* Article disclosure stays on the title line. */
.row-details{margin-top:0}.row-details>summary{font-size:.875rem;font-weight:500;color:#263b52;line-height:1.35}.row-details[open]{padding-top:0}.row-details>summary::marker{color:#5874a2}
.plan-number .item-values:has(>.item-field-label:only-child){flex:0 1 128px;max-width:128px}.plan-number .item-values:has(>.item-field-label:only-child) input{width:100%}.plan-row{min-height:43px}

/* A salary position occupies one table row at every viewport width. */
.salary-grid-scroll{overflow-x:auto}.salary-position,.salary-columns{display:grid;grid-template-columns:minmax(150px,1.3fr) 52px 108px 112px 104px 104px 24px minmax(160px,1.2fr);gap:8px;min-width:900px;align-items:center}.salary-columns{padding:6px 10px;font-size:.8125rem;color:#637386;background:#fafbfe}.salary-position{padding:5px 10px;min-height:40px}.salary-position .position-fields,.salary-position .position-pay{display:contents}.salary-position .item-field-label{font-size:0;line-height:1;min-width:0}.salary-position .item-field-label input,.salary-position .item-field-label select{height:30px;min-height:30px;margin:0;font-size:.875rem;width:100%;font-variant-numeric:tabular-nums}.salary-position .item-result{grid-column:auto;margin:0;text-align:right;white-space:nowrap;font-size:.875rem;line-height:1.4;font-variant-numeric:tabular-nums}.salary-position .position-remove{height:28px;min-height:28px}.salary-position input[data-position-field="title"]{font-weight:500}.salary-empty{min-width:900px}
.plan-form input[inputmode="decimal"]{font-variant-numeric:tabular-nums}

/* Projects are a separate dimension; keep expense and salary rows compact. */
.projects-body{padding:12px 16px}.project-list{display:flex;flex-wrap:wrap;gap:8px}.project-edit{display:flex;gap:4px;align-items:center;max-width:300px}.project-edit input{width:240px}.project-edit button{padding:4px 7px!important}.project-add{display:flex;gap:8px;margin-top:8px}.project-add input{width:280px}.project-add button{white-space:nowrap}#projects-error{color:#a33132;font-size:.875rem;margin-top:6px}
.plan-row,.plan-column-head{grid-template-columns:minmax(230px,1.2fr) minmax(270px,1fr) minmax(190px,.85fr) 140px}.plan-column-head>span:last-child{display:block}.allocation-trigger{font-size:.8125rem!important;color:#516984;background:#f4f7fc;border:1px solid #dbe3ee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;max-width:100%;height:30px;min-height:30px!important}.allocation-trigger:hover{background:#e9eff8}.allocation-trigger.allocation-invalid{color:#a33132;border-color:#d58c8c}
.salary-position,.salary-columns{grid-template-columns:minmax(150px,1.3fr) 52px 108px 112px 104px 104px 24px minmax(150px,1fr) 140px;min-width:1080px}.salary-position>.allocation-trigger{width:140px}
.allocation-dialog{padding:0;border:1px solid #dce4ef;border-radius:12px;box-shadow:0 20px 70px #14233935;width:530px;max-width:calc(100vw - 32px);max-height:85vh;overflow:auto;color:#263b52}.allocation-dialog::backdrop{background:#17283c70}.allocation-dialog-head{padding:18px 22px 12px;border-bottom:1px solid #e6ebf3}.allocation-dialog-head h2{font-size:1.1rem;margin:0}.allocation-dialog-head p{font-size:.9375rem;color:#596c82;margin:6px 0 0}.allocation-help{font-size:.875rem;line-height:1.55;color:#53677d;margin:14px 22px}.allocation-fields{padding:0 22px}.allocation-fields>label{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:7px 0;font-size:.9375rem;border-bottom:1px solid #edf0f5}.allocation-fields label>span{overflow-wrap:anywhere}.allocation-fields label>div{white-space:nowrap;flex-shrink:0}.allocation-fields input{width:86px;text-align:right}.allocation-common{margin:14px 22px;padding:12px;background:#eef2f7;display:flex;justify-content:space-between;gap:16px;font-size:.9375rem;border-radius:7px}#allocation-error{color:#a33132;font-size:.875rem;margin:0 22px}.allocation-dialog-footer{display:flex;justify-content:flex-end;gap:8px;padding:16px 22px}.allocation-dialog-footer button{padding:7px 16px!important}
.project-totals-table{width:100%;font-size:.875rem}.project-totals-table th,.project-totals-table td{padding:10px 14px;text-align:right;white-space:nowrap;border-bottom:1px solid #e8edf4;font-variant-numeric:tabular-nums}.project-totals-table th:first-child{text-align:left;min-width:180px;white-space:normal}.project-totals-table thead{color:#5d7086;background:#f7f9fc}.project-totals-table .project-common{background:#edf0f6}.project-totals-table .project-grand-total{font-weight:600;background:#f8fafc}.project-report-note{margin:12px 16px;font-size:.8125rem;color:#607186;line-height:1.5}.project-report-note.error{color:#a33132}
@media(max-width:1300px){.plan-row,.plan-column-head{grid-template-columns:minmax(190px,1fr) minmax(240px,1fr) minmax(175px,.7fr) 140px}.compact-result{grid-column:auto;text-align:right}.plan-column-head>span:last-child{display:block}}
@media(max-width:1100px){.plan-row,.plan-column-head{grid-template-columns:minmax(180px,1fr) minmax(240px,1fr)}.compact-result{grid-column:1;text-align:left}.plan-row>.allocation-trigger{justify-self:start}.plan-column-head>span:nth-child(n+3){display:none}}
@media(max-width:650px){.plan-row{grid-template-columns:1fr}.compact-result{grid-column:auto}.project-add{flex-wrap:wrap}.project-add input{width:100%}.project-edit{max-width:100%}.allocation-fields>label{gap:8px}}
.project-parent>th{padding:5px 8px!important}.plan-form .project-breakdown-toggle{display:flex;align-items:center;gap:9px;width:100%;text-align:left;background:transparent;border:0;color:#354d69;font-weight:600;white-space:normal;line-height:1.4}.project-breakdown-toggle::before{content:'+';font-size:1rem;width:14px;flex:0 0 14px;text-align:center;color:#61758d}.project-breakdown-toggle[aria-expanded="true"]::before{content:'−'}.project-breakdown-toggle:hover{background:#e8eef7}.project-breakdown-toggle:focus-visible{outline:2px solid #3267bd;outline-offset:1px}
.project-totals-table tr[hidden]{display:none}.project-totals-table .project-department>th,.project-totals-table .project-department>td{background:var(--section-tint);color:var(--section-color);padding-top:7px;padding-bottom:7px}.project-totals-table .project-department>th{border-left:4px solid var(--section-color);padding-left:32px;font-weight:500}.project-totals-table .project-department .department-name{display:block}.project-totals-table .project-parent:not(:first-child)>th,.project-totals-table .project-parent:not(:first-child)>td{border-top:2px solid #dce4ef}
.project-list{display:block}.project-edit,.project-revenue-head{display:grid;grid-template-columns:minmax(180px,1fr) 180px 180px 28px;gap:8px;max-width:none;margin-bottom:7px;align-items:center}.project-edit input{width:100%}.project-revenue-head{font-size:.8125rem;color:#607187;align-items:end}.project-revenue-note{font-size:.8125rem;color:#607187;line-height:1.5;margin:9px 0}.department-rules-title{font-size:.9375rem;margin:18px 0 10px}.department-rules{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.department-rule{padding:10px;border:1px solid #e1e6ed;border-left:4px solid var(--section-color);border-radius:7px;background:var(--section-tint);display:flex;flex-direction:column;align-items:start;gap:6px}.department-rule strong{font-size:.875rem;color:var(--section-color)}.department-rule button{font-size:.8125rem!important;background:white;max-width:100%}.other-department-rules{margin-top:10px;font-size:.875rem;color:#596e87}.other-department-rules>summary{cursor:pointer;margin-bottom:9px}.allocation-trigger.allocation-custom{border-color:#819abd;color:#335b94;background:#edf3ff}.distribution-field{display:block;margin:12px 22px;font-size:.875rem;color:#475f78}.distribution-field select{display:block;width:100%;margin-top:6px}.distribution-common{display:flex;justify-content:space-between;align-items:center;gap:12px}.distribution-common input{width:90px;text-align:right}.allocation-participants{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:8px 22px}.allocation-participants label{display:flex;align-items:center;gap:8px;font-size:.9375rem;overflow-wrap:anywhere}.allocation-participants input{width:16px;height:16px;min-height:16px;margin:0;flex-shrink:0}.allocation-preview{white-space:pre-line;margin:14px 22px;padding:12px;background:#edf2f8;font-size:.875rem;line-height:1.6;border-radius:7px;color:#425c76}
@media(max-width:1200px){.department-rules{grid-template-columns:repeat(2,minmax(0,1fr))}.project-edit,.project-revenue-head{grid-template-columns:minmax(160px,1fr) 150px 150px 26px}}
@media(max-width:650px){.department-rules{grid-template-columns:1fr}.project-edit{grid-template-columns:1fr 1fr 26px;gap:5px;margin-bottom:12px}.project-edit>[data-project-name]{grid-column:1/3}.project-edit>[data-remove-project]{grid-column:3;grid-row:1}.project-revenue-head{display:none}.project-edit>[data-project-revenue]::placeholder{font-size:.75rem}.allocation-participants{grid-template-columns:1fr}}

.company-rule{display:flex;gap:16px;align-items:center;justify-content:space-between;margin-top:14px;padding:12px;background:#eef3fa;border:1px solid #dbe4f0;border-radius:8px}.company-rule strong{font-size:.9375rem}.company-rule p{margin:4px 0 0}.company-rule button{white-space:nowrap}@media(max-width:650px){.company-rule{align-items:start;flex-direction:column}}

/* Three inputs appear only for the combined expense mode. */
.ambassador-number{display:grid;grid-template-columns:1fr 1fr;gap:6px;align-items:end}.ambassador-number>label{font-size:.75rem;line-height:1.3;color:#52667e}.ambassador-number input{width:100%;min-width:0;margin-top:3px}.ambassador-number>small{grid-column:1/-1;color:#a33132;font-size:.75rem}.ambassador-number>small:empty{display:none}.ambassador-row .row-details p{font-size:.8125rem;line-height:1.5;color:#53677d}
.discount-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px 0}.discount-controls>label{font-size:.875rem;font-weight:600}.discount-controls>input{width:125px;text-align:right}.discount-controls>span{font-size:.8125rem;color:#607187}.discount-controls>small{font-size:.8125rem;color:#a33132}.retail-calculated{background:#fff!important;border-top:0!important}.retail-calculated .total-values strong{font-weight:500}
.plan-materials{border-left:4px solid var(--section-color)}.plan-materials .panel-head{background:var(--section-tint)}.materials-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:0 16px 12px}.materials-controls>label{font-size:.875rem;font-weight:600}.materials-controls>input{width:125px;text-align:right}.materials-controls>.allocation-trigger{margin-left:auto;width:140px}.plan-materials .block-total{border-left:0}.plan-materials .revenue-hint{margin-bottom:0}@media(max-width:650px){.materials-controls>.allocation-trigger{margin-left:0}}
.salary-tax-setting{display:flex;align-items:center;gap:18px;padding:12px 14px;margin-bottom:14px;border:1px solid #c8d7ed;border-left:4px solid #496fc5;border-radius:7px;background:#eef4ff}.salary-tax-setting>div{flex:1}.salary-tax-setting label{display:block;font-weight:600;font-size:.9375rem}.salary-tax-setting p{font-size:.8125rem;color:#596e87;margin:5px 0 0;line-height:1.4}.salary-tax-setting input{width:125px;flex:0 0 125px;text-align:right}.salary-tax-setting>strong{font-size:.8125rem;min-width:145px;color:#3a5680}.salary-block-total{padding:10px 12px;background:var(--section-tint);border-top:1px solid #dce4ef}.salary-total-title{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:6px}.salary-total-title>strong{font-size:.875rem;color:var(--section-color)}.salary-total-title>small{font-size:.75rem;color:#607187}.payroll-totals{width:100%;border-collapse:collapse;table-layout:fixed;font-size:.8125rem;font-variant-numeric:tabular-nums}.payroll-totals th,.payroll-totals td{padding:5px 8px;text-align:right;white-space:nowrap}.payroll-totals th:first-child{width:43%;text-align:left;white-space:normal}.payroll-totals thead th{font-size:.75rem;font-weight:400;color:#607187;border-bottom:1px solid #d4deeb}.payroll-totals tbody th{font-weight:400}.payroll-totals tbody tr:last-child{font-weight:600;border-top:1px solid #d4deeb}.payroll-totals tbody tr:last-child th{font-weight:600}.payroll-totals tbody tr:nth-child(2){color:#596e87}.plan-formula .payroll-totals{margin:8px 0}.salary-block-head>[data-salary-group-count]{margin-left:auto;font-size:.8125rem;color:#53667e}@media(max-width:700px){.salary-tax-setting{flex-wrap:wrap;gap:10px}.salary-tax-setting>div{flex-basis:100%}.salary-total-title{align-items:start;flex-direction:column;gap:4px}.payroll-totals th:first-child{width:34%}.payroll-totals th,.payroll-totals td{padding:5px 3px;font-size:.75rem}}
.revenue-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.total-values{display:grid;grid-template-columns:repeat(3,minmax(100px,1fr));gap:14px;font-variant-numeric:tabular-nums}.total-values>div{display:flex;flex-direction:column;gap:3px}.total-values span{font-size:.75rem;font-weight:400;color:#607187}.total-values strong{font-size:.9375rem;white-space:nowrap}.block-total{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 16px;background:var(--section-tint);border-top:1px solid #dce4ef;border-left:4px solid var(--section-color)}.block-total>div>strong{font-size:.875rem}.block-total small,.compact-result small,.salary-position .item-result small{display:block;font-size:.75rem;color:#607187}.salary-block-head>[data-salary-group-total]{display:flex;align-items:center;gap:16px}.salary-block-head .total-values{gap:10px;grid-template-columns:repeat(3,minmax(95px,1fr))}.salary-block-head .total-values strong{font-size:.8125rem}.plan-formula .total-values{margin:10px 0}.plan-formula small{font-size:.8125rem}.plan-row .compact-result{line-height:1.35}.salary-position .item-result{line-height:1.25}@media(max-width:700px){.revenue-fields{grid-template-columns:1fr}.block-total{align-items:start;flex-direction:column}.salary-block-head>[data-salary-group-total]{flex-wrap:wrap}.total-values{gap:8px}}
.plan-number.has-fixed-range{display:grid;grid-template-columns:minmax(0,1fr);gap:4px}.plan-number.has-fixed-range select{width:170px;max-width:100%;flex-basis:auto}.plan-number .three-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-width:100%}.plan-number .three-values>.item-field-label{font-size:.75rem;line-height:1.3}.plan-number .three-values input{min-width:0;width:100%;margin-top:3px}.plan-number.has-fixed-range+.compact-result{white-space:normal}

/* Same row contract per block, with reversible removal. */
.row-actions{display:flex;align-items:center;gap:4px;min-width:0}.row-actions .allocation-trigger{min-width:0;flex:1}.row-remove{padding:1px 6px!important;font-size:16px!important;flex:none}
.row-tools{padding:7px 12px;display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap}.row-tools>button{font-size:12px;padding:3px 8px}
.removed-rows{font-size:12px;color:#64748b;margin:6px 12px}.removed-rows summary{cursor:pointer}.removed-rows>div{display:flex;align-items:center;gap:12px;padding:4px 0}.removed-rows button{font-size:11px;padding:2px 6px}.removed-rows p{margin:5px 0}
.plan-article [data-article-name]{width:100%;max-width:320px;height:25px;margin:4px 0}.row-actions button:first-child{max-width:calc(100% - 26px)}
.loan-row,.loan-columns{display:grid;grid-template-columns:minmax(180px,1fr) 150px minmax(160px,1fr) 28px;gap:8px;align-items:center;padding:6px 12px}.loan-columns{font-size:11px;color:#64748b;background:#f8fafc}.loan-row{border-bottom:1px solid #f0f3f8}.loan-row input{width:100%;min-width:0;height:26px;padding:3px 7px}.plan-loans #loans-total{background:#faf1df}.plan-loans .panel-head{background:#fffcf5}
@media(max-width:700px){.loan-row,.loan-columns{grid-template-columns:minmax(100px,1fr) 110px 28px}.loan-row input[data-loan-field="note"]{grid-column:1/3;grid-row:2}.loan-columns span:nth-child(3){display:none}.loan-row button{grid-column:3;grid-row:1}}

/* Compact tables: stable columns instead of distributing figures across the panel. */
.summary-table-scroll{max-width:100%;overflow-x:auto}.plan-form .budget-totals{width:710px;max-width:none;min-width:710px;table-layout:fixed;border-collapse:collapse;margin:0;background:#fff;color:#263b52}.budget-totals col.summary-label{width:290px}.budget-totals col:not(.summary-label){width:140px}
.plan-form .budget-totals th,.plan-form .budget-totals td{border:1px solid #dbe3ed;padding:5px 9px;line-height:1.35;font-size:.8125rem;text-align:right;white-space:nowrap;overflow:visible}.plan-form .budget-totals th:first-child{width:auto;text-align:left;white-space:normal}.budget-totals thead th{background:#f4f7fb;color:#596d84;font-weight:500}.budget-totals tbody th{background:transparent}.budget-totals tbody tr:last-child th,.budget-totals tbody tr:last-child td{background:var(--section-tint,#eef3fb);font-weight:600}.plan-form .budget-totals tbody tr:nth-child(2){color:inherit}
.summary-note{display:block;font-size:.75rem!important;color:#607187;margin:6px 0 0;max-width:710px;line-height:1.4}.plan-form .block-total{display:block;padding:8px 12px}.salary-total-title{display:block;max-width:710px}.salary-total-title>small{display:block;margin-top:2px}.plan-form #plan-salary-result{padding:10px 12px}.plan-form #plan-salary-result>.summary-table-scroll{margin:6px 0}.plan-form #plan-salary-result>small{display:block;max-width:710px;margin-top:6px}.salary-block-total{padding:8px 10px}
.plan-form .plan-kpis{display:block;margin-bottom:16px}.budget-summary{padding:10px 12px}.budget-summary h2{margin:0 0 7px;font-size:.95rem!important}.plan-form .budget-summary .summary-note{margin-bottom:0}
/* Editors retain one row per article or position, with shared fixed column widths. */
@media(min-width:1101px){.plan-row,.plan-column-head{grid-template-columns:310px 290px 210px 140px;gap:10px;justify-content:start}.salary-position,.salary-columns{grid-template-columns:230px 48px 100px 105px 96px 96px 22px 170px 132px;justify-content:start;gap:8px;min-width:1087px}.plan-group{overflow-x:auto}.plan-row,.plan-column-head{min-width:1004px}}
.plan-form .loan-row,.plan-form .loan-columns{grid-template-columns:280px 150px 280px 28px;justify-content:start}.plan-form .plan-loans{overflow-x:auto}.loan-row,.loan-columns{min-width:786px}.plan-form .project-totals-table{width:max-content;min-width:0;table-layout:auto}.plan-form .project-totals-table th,.plan-form .project-totals-table td{border:1px solid #dbe3ed;padding:5px 9px}.plan-form .project-totals-table th:first-child{width:230px;min-width:230px}.project-totals-table .project-department>th{padding-left:24px}
@media(max-width:1100px){.plan-form .plan-row,.plan-form .plan-column-head{grid-template-columns:280px 290px 210px 140px;min-width:974px;gap:10px}.plan-form .plan-column-head{display:grid}.plan-column-head>span:nth-child(n+3){display:block}.plan-form .compact-result{grid-column:auto;text-align:right}.plan-form .plan-group{overflow-x:auto}.plan-form .plan-row .plan-number input{max-width:100%}.plan-form .salary-total-title{display:block}}
/* Financial workspace: one table owns rows, scenario columns and totals. */
.plan-form{--ledger-line:#e2e8f0;--ledger-ink:#20354e;--ledger-muted:#6a7c90;color:var(--ledger-ink)}
.plan-form .panel{border-radius:10px;box-shadow:0 1px 2px #20354e04}.plan-form .panel-head{padding:13px 16px;border-bottom:1px solid var(--ledger-line)}
.plan-form .panel-head h2{font-size:15px;font-weight:650;letter-spacing:-.15px}.plan-form .panel-head .subtitle{font-size:12px;line-height:1.5;max-width:920px;color:var(--ledger-muted)}
.plan-form input,.plan-form select{height:28px;min-height:28px;font-size:12px;padding:4px 7px;border-color:#d8e1ec;background:#fff;border-radius:5px}.plan-form input:hover,.plan-form select:hover{border-color:#a9bbd1}.plan-form input:focus,.plan-form select:focus{outline:2px solid #3f76c33b;outline-offset:0;border-color:#4f7fbe}.plan-form input::placeholder{font-size:11px;color:#93a0af}
.plan-form button{font-size:12px;min-height:27px;padding:4px 8px}.plan-form .plan-intro{gap:20px}.plan-intro p{font-size:12px;max-width:680px;line-height:1.55}.plan-form .plan-intro input{height:34px;font-size:14px}
.plan-form .revenue-fields{gap:12px;max-width:905px}.plan-form .revenue-fields label{font-size:12px}.plan-form .revenue-fields input{height:32px;font-size:14px;font-weight:600;text-align:right}.plan-form .revenue-hint{font-size:11px;line-height:1.45;max-width:1030px}.plan-form .discount-controls{padding-top:0;padding-bottom:10px}.plan-form .discount-controls label{font-size:12px}
.plan-form .plan-group{overflow:visible}.plan-form .plan-group-title,.plan-form .salary-block-head{padding:9px 12px;background:var(--section-tint);border-left:3px solid var(--section-color)}.plan-form .plan-group-title h3,.plan-form .salary-block-head h3{font-size:13px;color:var(--section-color);font-weight:650}.plan-form .plan-group-title span,.plan-form .salary-block-head span{font-size:11px}.plan-form .salary-block{border-radius:7px;border-color:var(--ledger-line);border-left:0}.plan-form .salary-block-head button{margin-left:0;font-size:11px!important;background:#ffffffa8;border-color:transparent}
.ledger-scroll{width:100%;max-width:100%;overflow-x:auto;scrollbar-width:thin}.plan-form .ledger-table{width:1050px;min-width:1050px;max-width:none;table-layout:fixed;border-collapse:collapse;border-spacing:0;font-size:12px;line-height:1.35;background:white;color:var(--ledger-ink);font-variant-numeric:tabular-nums}
.plan-form .ledger-table th,.plan-form .ledger-table td{box-sizing:border-box;border:1px solid var(--ledger-line);padding:5px 8px;vertical-align:middle;text-align:left;position:static;white-space:normal;background:transparent;min-width:0;max-width:none;overflow:visible}
.plan-form .ledger-table thead th{background:#f6f8fb;color:var(--ledger-muted);font-size:10.5px;font-weight:500;padding:7px 8px;white-space:nowrap}.plan-form .ledger-table thead th:nth-last-child(n+2):nth-last-child(-n+4){text-align:right}
.plan-form .ledger-table .ledger-money{text-align:right;white-space:nowrap;font-size:12px;font-weight:500;font-variant-numeric:tabular-nums}.plan-form .ledger-table tbody th{font-weight:500}.plan-form .ledger-table tbody tr:hover>td,.plan-form .ledger-table tbody tr:hover>th{background:#f7faff}
.plan-form .ledger-table tfoot th,.plan-form .ledger-table tfoot td{background:var(--section-tint,#eff3fa);font-weight:600;border-top:1px solid #cdd9e6}.plan-form .ledger-table tfoot small{display:block;color:var(--ledger-muted);font-size:10px;font-weight:400;margin-top:2px}.plan-form .salary-ledger tfoot tr:not(:last-child)>*{background:#f8fafc;font-weight:400}.plan-form .ledger-table tfoot .ledger-end{border-left-color:transparent}
.plan-form .ledger-article{border-left:3px solid var(--section-color)!important}.plan-form .ledger-article .row-details{margin:0;font-size:12px;font-weight:400}.plan-form .ledger-article .row-details>summary{font-size:12px;color:var(--ledger-ink);line-height:1.4;padding:3px 0;font-weight:500}.plan-form .ledger-article .row-details>summary::marker{color:var(--section-color)}.plan-form .ledger-article .row-details p{font-size:11px;line-height:1.5;font-weight:400}.ledger-article .plan-statistics{font-size:10px}.ledger-article .row-details input{width:100%;font-size:11px}
.plan-form .ledger-settings{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px;align-items:end}.ledger-settings>select{width:100%;font-size:11px}.plan-form .ledger-settings .item-values{display:flex;gap:5px;min-width:0}.plan-form .ledger-settings .item-field-label{display:block;flex:1;font-size:10px;line-height:1.2;color:var(--ledger-muted);min-width:0}.plan-form .ledger-settings .item-field-label input{width:100%;min-width:0;text-align:right;font-size:12px;margin-top:3px;height:26px;min-height:26px}
.plan-form .ledger-settings.mode-range,.plan-form .ledger-settings.mode-fixed_range{grid-template-columns:1fr}.ledger-settings.mode-range>select,.ledger-settings.mode-fixed_range>select{max-width:170px}.plan-form .ledger-settings .three-values{display:flex;max-width:100%}.ledger-pay-inputs{display:flex;gap:5px;align-items:end}.plan-form .ledger-field{display:block;flex:1;min-width:0;color:var(--ledger-muted);font-size:9px;line-height:1.2}.ledger-field>span{display:block;margin-bottom:3px}.plan-form .ledger-field input{width:100%;min-width:0;font-size:12px;text-align:right;padding:4px 5px;height:26px;min-height:26px}
.plan-form .position-title-cell>.ledger-field{display:inline-block;width:calc(100% - 22px);vertical-align:middle}.position-title-cell>.ledger-field>span,.position-count .ledger-field>span{display:none}.plan-form .position-title-cell input{text-align:left}.plan-form .position-count input{padding:3px;text-align:center}.plan-form .salary-ledger select{width:100%;font-size:11px;padding-left:4px;padding-right:2px}.position-move{display:inline-block;vertical-align:middle;position:relative;width:18px}.position-move>summary{list-style:none;cursor:pointer;font-size:17px;color:#8190a4;text-align:center}.position-move>label{position:absolute;left:0;top:25px;width:190px;background:white;box-shadow:0 4px 14px #17395824;border:1px solid var(--ledger-line);padding:8px;z-index:10;font-size:11px}.position-move select{margin-top:5px}
.ledger-actions{display:flex;gap:3px;align-items:center;min-width:0}.plan-form .ledger-actions .allocation-trigger{flex:1;min-width:0;width:auto;max-width:110px;font-size:11px!important;height:26px;min-height:26px!important;padding:3px 5px;background:#f6f8fc}.plan-form .ledger-actions .danger{flex:none;padding:2px 5px;font-size:15px;min-width:20px;min-height:24px;color:#9a6970}.plan-form .ledger-actions .danger:hover{background:#fff0f0;color:#b33342}.plan-form .ledger-empty{padding:12px;color:var(--ledger-muted);font-weight:400}
.plan-form .row-tools{padding:7px 10px;background:#fbfcfe;border-bottom:1px solid var(--ledger-line);gap:10px}.plan-form .row-tools>button{font-size:11px;background:white;border-style:dashed;color:#476384}.plan-form .removed-rows{font-size:11px;margin:5px 10px}.plan-form .loan-ledger input{width:100%}.plan-form .loan-ledger [data-loan-field="amount"]{max-width:140px;text-align:right}.loan-comment{font-size:10px;color:var(--ledger-muted);margin-top:3px}.loan-comment summary{cursor:pointer}.loan-comment input{margin-top:4px}.plan-form .plan-loans{overflow:hidden}
.plan-form .budget-totals{width:905px;min-width:905px}.plan-form .budget-totals col.summary-label{width:530px}.plan-form .budget-totals col:not(.summary-label){width:125px}.plan-form .budget-totals th,.plan-form .budget-totals td{font-size:12px;padding:6px 8px}.budget-summary-title{display:flex;align-items:center;gap:12px;margin-bottom:9px}.plan-form .budget-summary-title h2{margin:0;font-size:15px!important}.budget-status{font-size:10px;color:#936221;background:#fcf2dd;padding:3px 7px;border-radius:4px}.budget-status.is-complete{background:#e8f4ee;color:#207050}.plan-form .budget-totals .profit-row th,.plan-form .budget-totals .profit-row td{background:#eef6f2;font-weight:650;border-top:2px solid #ccdfd4}.plan-form .budget-totals .profit-row [data-sign="negative"]{color:#b04247}.plan-form .budget-totals .profit-row [data-sign="positive"]{color:#187357}.plan-form .budget-totals .margin-row>*{background:#f5f9f7!important;font-weight:500!important}.estimate-badge{display:inline!important;color:#93723f;font-size:9px;margin-left:3px;font-weight:400}.budget-incomplete{font-size:11px;color:#896633;line-height:1.5;max-width:905px;margin:8px 0 0}.plan-form .summary-note{max-width:905px;line-height:1.5;font-size:11px!important}.plan-form .budget-summary{border-top:3px solid #456d9f;padding:12px}
.plan-form .plan-salary-body{padding:12px}.plan-form .plan-formula{background:#f5f8fc;border:1px solid var(--ledger-line);border-radius:6px}.plan-form .plan-savebar{border-radius:7px;padding:8px 12px}.plan-form .salary-tax-setting{padding:10px 12px}.salary-tax-setting label{font-size:12px}.salary-tax-setting p{font-size:11px}.plan-form .company-rule{padding:10px;background:#f7f9fc}.plan-form .projects-body{padding:12px 16px}.plan-form .project-edit,.plan-form .project-revenue-head{grid-template-columns:290px 190px 190px 26px;justify-content:start}.plan-form .project-revenue-note{font-size:11px}
@media(max-width:760px){.budget-summary-title{flex-wrap:wrap}.plan-form .plan-intro{display:block}.plan-form .project-list{overflow-x:auto}.plan-form .project-edit,.plan-form .project-revenue-head{min-width:720px}.plan-form .project-edit>[data-project-name]{grid-column:auto}.plan-form .project-edit>[data-remove-project]{grid-column:auto;grid-row:auto}.plan-form .ledger-table{min-width:1050px}.plan-form .plan-savebar .toolbar{gap:4px}}


/* Constant inputs need no repeated per-row caption. Range components keep explicit labels. */
.plan-form .ledger-settings.mode-fixed .item-field-label{font-size:0}.plan-form .ledger-settings.mode-fixed input{margin-top:0}.plan-form .ledger-table tbody .ledger-article{line-height:1.4}.plan-form .ledger-table tbody .ledger-row>th,.plan-form .ledger-table tbody .ledger-row>td{padding-top:5px;padding-bottom:5px}

/* All calculation controls stay on one horizontal line in every expense mode. */
.plan-form .ledger-table{width:1140px;min-width:1140px}
.plan-form .ledger-settings,.plan-form .ledger-settings.mode-range,.plan-form .ledger-settings.mode-fixed_range{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px;align-items:end}
.plan-form .ledger-settings>select{width:100%;max-width:none}
.plan-form .ledger-settings.mode-fixed{grid-template-columns:100px 120px}
.plan-form .ledger-settings.mode-percent{grid-template-columns:100px 105px}
.plan-form .ledger-settings .item-values{flex-wrap:nowrap;gap:5px}.plan-form .ledger-settings .item-field-label{min-width:0;white-space:nowrap}
.plan-form .ledger-settings.mode-fixed_range .item-field-label{font-size:9px}.plan-form .ledger-settings.mode-fixed_range input{font-size:11px;padding-left:4px;padding-right:4px}
.plan-form .budget-totals{width:995px;min-width:995px}.plan-form .budget-totals col.summary-label{width:620px}
.plan-form .ledger-settings .item-field-label input{display:block}

/* Labels remain available through placeholders, tooltips and accessible names. */
.plan-form .ledger-settings .item-field-label,.plan-form .ledger-settings.mode-fixed_range .item-field-label{font-size:0;line-height:0}
.plan-form .ledger-settings .item-field-label input{display:block;margin-top:0;line-height:normal}
.plan-form .ledger-field>span{display:none}.plan-form .ledger-field{line-height:normal}
.plan-form .ledger-settings,.plan-form .ledger-settings.mode-range,.plan-form .ledger-settings.mode-fixed_range,.ledger-pay-inputs{align-items:center}
.plan-form .ledger-table input,.plan-form .ledger-table select{height:26px;min-height:26px}
.plan-form .ledger-article .row-details>summary{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.plan-form .budget-totals .expense-summary-row>*{font-weight:600;background:#f6f8fb}
.plan-form .budget-totals .block-breakdown>th{padding-left:22px;border-left:3px solid var(--section-color);color:var(--section-color);font-weight:400;background:var(--section-tint)}
.plan-form .budget-totals .block-breakdown>td{font-weight:400;background:#fff}
.plan-form .loan-comment{display:none}

/* Profit terms share the existing retail discount and scenario table. */
.plan-form .profit-program{border-left:3px solid var(--section-color)}.profit-program .panel-head{background:var(--section-tint)}.profit-program-head{display:flex;align-items:center;gap:24px;flex-wrap:wrap}.profit-program-head h2{margin:0}.profit-switch{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:500;color:#416b5d}.plan-form .profit-switch input{width:15px;height:15px;min-height:15px;margin:0}
.profit-terms{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;padding:12px 14px}.profit-terms>label{font-size:11px;color:#536b7c;display:block}.profit-terms>label>input{display:block;width:155px;text-align:right;margin-top:5px}.profit-terms>label>small:empty{display:none}.profit-terms input:disabled{background:#f4f6f9;color:#9aa5af}.profit-terms button{height:28px}.profit-program-note{font-size:11px;line-height:1.5;color:#667c8b;padding:0 14px 10px;max-width:1010px}#profit-program-error{font-size:12px;color:#b23e47;padding:0 14px}#profit-program-error:empty{display:none}.profit-program .block-total{border-left:0}.profit-allocation{display:flex;align-items:center;gap:14px;padding:8px 14px;font-size:11px;color:#65788a}.profit-allocation .allocation-trigger{width:145px}.profit-jump{font-size:11px!important;color:#237b63}
@media(max-width:650px){.profit-terms{gap:10px}.profit-terms>label{flex:1 1 140px}.profit-terms>label>input{width:100%}.profit-terms>button{flex-basis:100%}}

#profit-program-error.is-rounding{color:#946521}

.scenario-picker{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px;padding:10px 14px}
.scenario-picker label,.scenario-dialog label{font-weight:600}
.scenario-picker select{width:auto;min-width:145px;max-width:100%}
.scenario-picker button,.scenario-picker select{font-size:13px}
.scenario-dialog{border:1px solid #d5deea;border-radius:10px;width:min(400px,90vw);padding:20px;color:#192f4a}
.scenario-dialog::backdrop{background:#15253d66}
.scenario-dialog h2{margin:0}.scenario-dialog input{width:100%;margin:5px 0 15px}
