/* Finance is an independent cabinet ledger, not a sixth SKU column layout. */
#finance-panel{display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;color:var(--ink)}
.finance-intro{padding:14px 4px;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.finance-intro h2{font-size:16px;margin:0 0 6px}.finance-intro p{font-size:11px;color:var(--muted);margin:4px 0}
.finance-scroll{overflow:auto;flex:1;min-height:0;border:1px solid var(--line);border-radius:4px}
#finance-panel table{table-layout:fixed;font-size:var(--data-font-size)}
#finance-panel th,#finance-panel td{position:static;left:auto;min-width:0;max-width:none;width:auto;box-shadow:none;text-align:left;white-space:normal;overflow-wrap:anywhere;padding:7px 10px;font-size:var(--data-font-size);height:var(--data-row-height);color:inherit}
#finance-panel th{color:#fff;background:var(--blue);height:36px}
#finance-panel .finance-summary>thead th{position:sticky;top:0;z-index:2}
#finance-panel .finance-summary>thead th:first-child{width:48px}
#finance-panel .finance-summary>thead th:nth-child(2){width:40%}
#finance-panel .finance-summary>thead th:nth-child(3){width:20%;text-align:right}
#finance-panel .finance-group td{height:var(--data-row-height);font-weight:600;background:#fff}
#finance-panel .finance-group td:first-child{text-align:center;color:#4072b5}
#finance-panel .finance-group td:nth-child(3){text-align:right;white-space:nowrap}
#finance-panel .finance-group td:nth-child(4){color:var(--muted);font-weight:400;font-size:10px}
#finance-panel .finance-group .toggle{margin-right:8px}
#finance-panel .finance-summary>tbody>tr>td{padding:4px 10px}
#finance-panel .finance-detail>td{background:#fff;font-weight:400}
#finance-panel .finance-detail>td:first-child{text-align:center;white-space:nowrap;color:var(--muted);font-size:10px}
#finance-panel .finance-detail>td:nth-child(2){padding-left:34px}
#finance-panel .finance-detail>td:nth-child(3){text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
#finance-panel .finance-category .toggle{flex-shrink:0;width:16px;height:16px;line-height:14px;margin:0}
#finance-panel .finance-category .finance-label>span{font-weight:600}
#finance-panel .finance-service>td:nth-child(2){padding-left:58px}
#finance-panel .finance-group:has([aria-expanded="true"])>td{background:#f0f5fc}
#finance-panel .finance-detail:hover>td{background:#f5f8fc}
#finance-panel .finance-detail .finance-detail-empty{color:var(--muted)}
#finance-panel .finance-detail>td.finance-unverified{color:#886014;background:#fff9e9;font-size:10px}
#finance-panel .finance-expenses{margin-top:10px}
#finance-panel .finance-expenses th:first-child{width:11%}
#finance-panel .finance-expenses th:nth-child(2){width:25%}
#finance-panel .finance-expenses td:nth-child(3),#finance-panel .finance-expenses td:nth-child(5),#finance-panel .finance-expenses td:nth-child(6){text-align:right}
#finance-panel small{display:block;font-size:10px;font-weight:400;color:var(--muted);margin-top:4px}
#finance-panel button{font-size:11px;padding:5px 8px}
#finance-panel button.toggle{padding:0}
.finance-hint{font-size:11px;line-height:1.5;color:var(--muted)}
.finance-warnings{font-size:11px;line-height:1.6;padding:16px;background:#fff9e9;color:#796028}
.finance-warnings summary{cursor:pointer}
#finance-expense-dialog{max-width:720px;width:calc(100vw - 32px);max-height:90vh;overflow:auto}
.finance-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.finance-form-grid input,.finance-form-grid select,.finance-form-grid textarea{width:100%;min-width:0;border:1px solid #cbd6e2;border-radius:5px;padding:8px;font:inherit;color:var(--ink);background:white}
.finance-wide{grid-column:1/-1}
@media(max-width:700px){.finance-form-grid{grid-template-columns:1fr}.finance-scroll{overflow-x:auto}.finance-intro{padding:8px 0}}

/* Compact calculation table and independent monthly expense register. */
.finance-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(0,1fr);gap:16px;flex:1;min-height:0;overflow:hidden}
.finance-scroll{border:1px solid var(--line);border-radius:4px;min-width:0}
.finance-sidebar{display:flex;flex-direction:column;min-width:0;min-height:0;border:1px solid var(--line);border-radius:4px;overflow:hidden;background:#fff}
.finance-sidebar-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;height:36px;flex-shrink:0;padding:5px 10px;background:var(--blue);color:white;font-size:12px}
.finance-side-scroll{overflow:auto;flex:1;min-height:0;min-width:0}
.finance-empty{padding:18px 14px;color:var(--muted);font-size:12px;line-height:1.5}
.finance-side-total{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px;border-top:1px solid var(--line);font-size:12px}
.finance-side-total>span{display:flex;align-items:center;gap:8px}.finance-side-total strong{white-space:nowrap}
.finance-legal{padding:6px 2px 2px;text-align:right;font-size:9px;color:var(--muted);line-height:1.4}
#finance-panel table{width:100%;border-collapse:collapse}
#finance-panel .finance-summary>thead th:first-child{text-align:center}
#finance-panel .finance-summary>thead th:nth-child(2){width:auto}
#finance-panel .finance-summary>thead th:nth-child(3){width:28%}
.finance-label{display:flex;align-items:center;gap:8px;min-width:0}.finance-label>span{min-width:0}
#finance-panel .finance-group .toggle{flex-shrink:0;margin:0}
#finance-panel .finance-grand-total td{font-weight:700;background:#e8eff8;border-top:2px solid var(--blue);height:44px}
#finance-panel .finance-grand-total td:first-child{text-align:center;color:#4072b5}
#finance-panel .finance-grand-total td:nth-child(3){text-align:right;white-space:nowrap}
#finance-panel .finance-grand-total .positive{color:#00866e}#finance-panel .finance-grand-total .negative{color:#d33232}
#finance-panel .finance-expenses{margin:0}
#finance-panel .finance-expenses th{font-size:11px;background:#eef3fa;color:var(--ink);font-weight:600}
#finance-panel .finance-expenses th:first-child{width:54%}
#finance-panel .finance-expenses th:nth-child(2){width:28%;text-align:right}
#finance-panel .finance-expenses th:nth-child(3){width:18%;text-align:center}
#finance-panel .finance-expenses td:nth-child(2){text-align:right;white-space:nowrap}
#finance-panel .finance-expenses td:nth-child(3){text-align:center;font-size:10px}
#finance-panel .finance-expenses td{vertical-align:top}
#finance-panel .finance-expense-actions{display:flex;gap:8px;margin-top:5px}
#finance-panel .finance-expense-actions button{border:0;background:none;padding:0;font-size:10px;color:var(--muted)}
#finance-panel .finance-expense-actions button:hover{color:var(--blue);text-decoration:underline}
#finance-panel button.finance-help-icon{flex:0 0 17px;width:17px;height:17px;line-height:15px;border:1px solid #9fb4cf;border-radius:50%;padding:0;margin-left:auto;color:#6281a8;background:#fff;font-size:11px;font-weight:600}
#finance-panel button.finance-help-icon:hover,#finance-panel button.finance-help-icon:focus-visible{background:#e7f0ff;border-color:var(--blue);color:var(--blue)}
#finance-help{position:fixed;z-index:120;width:min(420px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;background:white;color:var(--ink);border:1px solid #b9cbe6;border-radius:9px;padding:16px;box-shadow:0 8px 30px #19355226}
#finance-help>div:first-child{display:flex;align-items:start;justify-content:space-between;gap:12px}
#finance-help-title{font-size:14px;line-height:1.4;margin:0 0 10px}#finance-help-close{font-size:16px;padding:0 6px}
#finance-help-body{font-size:12px;line-height:1.55;white-space:pre-line}
#finance-expense-dialog{max-width:460px}
@media(max-width:900px){.finance-grid{grid-template-columns:1fr;grid-template-rows:minmax(230px,1.4fr) minmax(160px,1fr);gap:12px}.finance-legal{text-align:left}#finance-panel .finance-summary{min-width:0}}
@media(max-width:480px){#finance-panel th,#finance-panel td,#finance-panel .finance-detail>td{padding:6px;font-size:11px}#finance-panel .finance-summary>thead th:first-child{width:42px}#finance-panel .finance-detail>td:nth-child(2){padding-left:18px}#finance-panel .finance-summary>thead th:nth-child(3){width:30%}.finance-label{gap:5px}}
@media(max-width:480px){#finance-panel .finance-service>td:nth-child(2){padding-left:39px}}

/* One revenue denominator across all monetary rows; no extra row height. */
#finance-panel .finance-summary>thead th:nth-child(3){width:24%}
#finance-panel .finance-summary>thead th:nth-child(4){width:100px;text-align:center;padding:4px 6px}
.finance-share-heading{display:flex;align-items:center;justify-content:center;gap:5px;font-size:10px;line-height:12px}
.finance-share-heading>span{min-width:0}
#finance-panel .finance-share-heading .finance-help-icon{margin:0}
#finance-panel .finance-summary td.finance-share{text-align:center;white-space:nowrap;padding:4px 6px;font-size:10px;font-weight:500;font-variant-numeric:tabular-nums}
.finance-share-badge{display:inline-block;padding:2px 5px;border-radius:4px;background:#edf3fc;color:#46648e;line-height:1.2}
.finance-share-empty{color:var(--muted)}
#finance-panel .finance-grand-total .finance-share-badge.positive{background:#daf3eb;color:#00866e}
#finance-panel .finance-grand-total .finance-share-badge.negative{background:#fce7e5;color:#d33232}
.finance-shared-note{margin:0;padding:9px 11px;border-top:1px solid var(--line);background:#fff9e9;color:#765f2d;font-size:10px;line-height:1.45}
.finance-shared-note strong{white-space:nowrap}
@media(max-width:480px){#finance-panel .finance-summary>thead th:nth-child(4){width:76px}#finance-panel .finance-summary>thead th:nth-child(3){width:27%}.finance-share-heading{gap:3px}}

/* Match the primary Finance header to the shared SKU-table header geometry. */
#finance-panel .finance-summary>thead th{height:40px;padding:3px 5px;font-size:var(--data-font-size);font-weight:600;line-height:1.35;border-color:#6694db}
#finance-panel .finance-summary>thead th:first-child{width:var(--finance-number-width,40px)}
#finance-panel .finance-summary>thead th:nth-child(2){width:var(--finance-label-width,270px);text-align:left}
#finance-panel .finance-summary>thead th:nth-child(3){width:auto;text-align:center}
#finance-panel .finance-summary>thead th:nth-child(4){width:100px;text-align:center}
.finance-sidebar-heading{height:40px}

/* Stable finance geometry: the amount column no longer absorbs all free space. */
.finance-grid{grid-template-columns:minmax(660px,1.65fr) minmax(360px,1fr);gap:12px;margin-top:6px}
#finance-panel .finance-summary col.finance-col-number{width:46px}
#finance-panel .finance-summary col.finance-col-label{width:44%}
#finance-panel .finance-summary col.finance-col-sum{width:auto}
#finance-panel .finance-summary col.finance-col-share{width:112px}
#finance-panel .finance-summary>thead th,.finance-sidebar-heading{height:40px;background:var(--blue);color:#fff;border-color:#6694db}
#finance-panel .finance-summary>thead th{padding:3px 5px;font-size:var(--data-font-size);line-height:1.1;text-align:center;vertical-align:middle}
#finance-panel .finance-summary>thead th:nth-child(2){text-align:left}
#finance-panel .finance-summary>tbody>tr>td:nth-child(3){text-align:right;white-space:nowrap}
@media(max-width:1050px){.finance-grid{grid-template-columns:1fr;grid-template-rows:minmax(230px,1.4fr) minmax(160px,1fr)}#finance-panel .finance-summary col.finance-col-label{width:45%}}

