/* A receipt is document content, not a sticky product-table column. */
.finance-calculation-scroll{max-height:none;overflow:visible}
.finance-calculation-scroll>.data-table{table-layout:fixed;width:100%;min-width:0}
.finance-calculation-scroll>.data-table>thead>tr>th:first-child{width:auto}
.finance-calculation-scroll>.data-table>thead>tr>th:last-child{width:126px;text-align:right}
.finance-calculation-scroll>.data-table>tbody>tr>th{position:static!important;min-width:0!important;max-width:none!important;width:auto!important;white-space:normal;overflow-wrap:anywhere}
.finance-calculation-scroll>.data-table>tbody>tr>td{vertical-align:top}
.finance-calculation-scroll .finance-receipt-row>td{padding:0 10px 10px;white-space:normal;text-align:left}
.finance-receipt-row details{min-width:0;max-width:100%}
.finance-receipt-row summary{cursor:pointer;color:var(--accent,#baa4f3);padding:6px 0;font-size:13px;white-space:normal}
.finance-calculation-dialog .finance-calculation-inputs>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:5px 0}
.finance-calculation-dialog .finance-calculation-inputs dt{min-width:0;white-space:normal;overflow-wrap:anywhere;font-weight:400}
.finance-calculation-dialog .finance-calculation-inputs dd{margin:0;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.self-buyout-receipt .finance-calculation-inputs>div:last-child{border-top:1px solid var(--border);margin-top:4px;font-weight:600}
.self-buyout-receipt p{font-weight:400;overflow-wrap:anywhere}
.self-buyout-records{display:grid;gap:5px;margin:8px 0;padding-left:18px;font-size:12px;font-weight:400}
.finance-calculation-dialog .analysis-item-body{min-width:0;max-width:100%;overflow-wrap:anywhere}
.finance-calculation-dialog.self-buyout-dialog{width:calc(100vw - 24px);max-width:none;height:calc(100dvh - 24px);max-height:none;padding:0;margin:12px;border-radius:12px;overflow:hidden}
.self-buyout-dialog[open]{display:flex;flex-direction:column}
.self-buyout-dialog .self-buyout-header{align-items:center;gap:20px;padding:14px 18px;border-bottom:1px solid var(--border)}
.self-buyout-dialog .self-buyout-header h2{margin:0;font-size:18px}
.self-buyout-dialog .self-buyout-header p{margin:4px 0 0;color:var(--muted);font-size:12px}
.self-buyout-summary{display:grid;grid-template-columns:auto auto;column-gap:12px;align-items:baseline;margin-left:auto;text-align:right;white-space:nowrap}
.self-buyout-summary>span,.self-buyout-summary>small{color:var(--muted);font-size:12px}
.self-buyout-summary>strong{font-size:22px;font-variant-numeric:tabular-nums}
.self-buyout-summary>small{grid-column:1/-1}
.self-buyout-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;padding:10px 18px;font-size:12px}
.self-buyout-toolbar input{width:260px;min-width:0;max-width:100%;font-size:13px}
.self-buyout-method{position:relative}.self-buyout-method summary{color:var(--accent);cursor:pointer}
.self-buyout-method[open]>p{position:absolute;z-index:8;left:0;top:20px;width:360px;max-width:75vw;background:var(--panel);padding:14px;border:1px solid var(--border);box-shadow:0 10px 25px var(--theme-shadow-color,#0005);margin:0;font-size:12px}
.self-buyout-units{color:var(--muted);margin-left:auto}
.self-buyout-table-wrap{flex:1;min-height:0;overflow:auto;border-top:1px solid var(--border)}
.self-buyout-table{border-collapse:separate;border-spacing:0;width:100%;font-size:12px;font-variant-numeric:tabular-nums}
.self-buyout-table th,.self-buyout-table td{padding:9px 8px;border-bottom:1px solid var(--border);vertical-align:top;min-width:76px}
.self-buyout-table .number{text-align:right;white-space:nowrap}
.self-buyout-table thead th{position:sticky;top:0;z-index:3;background:var(--panel);color:var(--muted);font-weight:500;white-space:normal;vertical-align:bottom;text-align:right;max-width:100px}
.self-buyout-table th:first-child{position:sticky;left:0;z-index:2;background:var(--panel);min-width:220px;width:260px;max-width:300px;text-align:left}
.self-buyout-table thead th:first-child{z-index:4}
.self-buyout-table td:nth-child(2),.self-buyout-table th:nth-child(2){min-width:32px}
.self-buyout-product{display:flex;gap:7px;align-items:start;cursor:pointer;background:none;border:0;color:inherit;text-align:left;font:inherit;padding:0;width:100%}
.self-buyout-product>span:last-child{min-width:0;overflow-wrap:anywhere;line-height:1.35}
.self-buyout-table small{display:block;margin-top:3px;font-size:11px;font-weight:400;color:var(--muted)}
.self-buyout-table .self-buyout-result{background:var(--theme-accent-bg,#bca8f012);font-weight:600;border-left:1px solid var(--border)}
.self-buyout-table thead .self-buyout-result{background:var(--panel)}
.self-buyout-table .self-buyout-credit{color:var(--theme-good,#83d9b6)}
.self-buyout-totals{font-weight:600;background:var(--theme-accent-bg,#bca8f010)}
.self-buyout-table .self-buyout-expanded>td{padding:12px 18px;background:var(--theme-accent-bg,#bca8f008);white-space:normal}
.self-buyout-row-detail{display:grid;grid-template-columns:minmax(260px,1fr) minmax(350px,1fr);gap:24px;max-width:1400px}
.self-buyout-row-detail p{font-size:12px;margin:7px 0;max-width:70ch;color:var(--muted)}
.self-buyout-row-detail .self-buyout-equation{font-size:15px;color:var(--text);line-height:1.6}
.self-buyout-source-table{border-collapse:collapse;width:100%;margin-top:8px;font-size:12px}
.self-buyout-source-table th,.self-buyout-source-table td{position:static!important;min-width:0!important;width:auto!important;max-width:none!important;white-space:normal;padding:6px 8px;background:none!important}
.self-buyout-source-table th{font-weight:400;color:var(--muted)}
.self-buyout-gap{color:var(--theme-warning,#e3bc7e)!important}
.self-buyout-footer{padding:10px 18px}
.finance-calculation-dialog.calculation-document{width:min(1440px,calc(100vw - 24px));max-width:none;padding:0 20px 20px;max-height:calc(100dvh - 24px);overflow:auto;scroll-padding-top:90px}
.calculation-document>header{position:sticky;top:0;z-index:6;background:var(--panel);padding:14px 0;border-bottom:1px solid var(--border);gap:18px;align-items:center}
.calculation-document>header>div{min-width:0;flex:1}
.calculation-document>header h2{font-size:20px;margin:0;overflow-wrap:anywhere}
.calculation-document>header p{margin:0 0 4px}
.calculation-document>header .finance-calculation-total{font-size:23px;white-space:nowrap;margin:0}
.calculation-document>section{padding:12px 0;margin:0;border-bottom:1px solid var(--border)}
.calculation-document>section:last-child{border-bottom:0}
.calculation-document h3{font-size:14px;margin:0 0 7px}
.calculation-document p{margin:6px 0;line-height:1.5;overflow-wrap:anywhere}
.calculation-document>section>p{max-width:110ch}
.calculation-document .analysis-item{margin:6px 0;border-top:1px solid var(--border);padding-top:4px}
.calculation-document .analysis-item-body{padding:8px 0}
.calculation-operands{margin:8px 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:7px 24px}
.calculation-operands>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 12px;align-items:baseline;border-bottom:1px solid var(--border);padding:4px 0}
.calculation-operands dt{font-weight:400;min-width:0;white-space:normal}
.calculation-operands dd{margin:0;text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.calculation-operands small{display:block;grid-column:1/-1;font-size:11px;font-weight:400;color:var(--muted);white-space:normal}
.calculation-equation{background:var(--theme-accent-bg);padding:10px 12px;border-radius:6px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums;font-size:14px}
.calculation-dimensions{padding:6px 0;white-space:normal}
.self-buyout-components{margin:8px 0 14px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px;font-size:13px}
.self-buyout-components>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;border-bottom:1px solid var(--border);padding:7px 0;align-items:baseline}
.self-buyout-components>div:last-child{grid-column:1/-1;font-weight:600;font-size:15px}
.self-buyout-components dt{font-weight:400;white-space:normal}.self-buyout-components dd{margin:0;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.self-buyout-row-detail h3{font-size:14px;margin:0 0 8px}
.self-buyout-sources-scroll{overflow-x:auto;max-width:100%}
.self-buyout-row-detail>div{min-width:0}
.self-buyout-row-detail summary{cursor:pointer;color:var(--accent);padding:5px 0;white-space:normal}
.self-buyout-row-detail .self-buyout-equation{font-size:14px;background:var(--theme-accent-bg);padding:10px;border-radius:6px;max-width:none}
.self-buyout-table .self-buyout-expanded>td{overflow:visible;text-align:left}
.self-buyout-method[open]{flex:1 1 100%;order:10}
.self-buyout-method[open]>p{position:static;width:auto;max-width:110ch;padding:6px 0;background:none;box-shadow:none;border:0;line-height:1.5}
.product-name-actions{display:flex;gap:4px;align-items:flex-start;min-width:0}
.product-name-actions>div{min-width:0;flex:1}
.product-history-link,.product-size-toggle{font:inherit;color:inherit;background:none;border:0;padding:0;text-align:left;cursor:pointer;white-space:normal;min-width:0;max-width:100%;overflow-wrap:anywhere}
.product-history-link:hover{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.product-size-toggle{flex:0 0 20px;width:20px;min-height:26px;color:var(--accent)}
.finance-calculation-dialog.product-history-dialog{width:calc(100vw - 24px);max-width:1600px;height:calc(100dvh - 24px);max-height:none;padding:0;overflow:hidden}
.product-history-dialog[open]{display:flex;flex-direction:column}
.product-history-header{padding:14px 18px;border-bottom:1px solid var(--border);gap:16px;flex-shrink:0}
.product-history-header>div{min-width:0;flex:1}.product-history-header h2{font-size:18px;margin:0;overflow-wrap:anywhere}.product-history-header p{margin:0 0 4px}
.product-history-controls{display:flex;gap:10px 16px;align-items:center;flex-wrap:wrap;padding:10px 18px;border-bottom:1px solid var(--border);font-size:12px}
.product-history-controls label{display:flex;gap:7px;align-items:center}.product-history-controls input{font-size:13px;min-width:0;width:155px;padding:5px 8px}
.product-history-controls [role=status]{font-size:12px;color:var(--muted);flex:1 1 250px}
.product-history-body{overflow:auto;min-height:0;padding:12px 18px 24px}
.product-history-method{font-size:12px;color:var(--muted);margin-bottom:12px}.product-history-method summary{color:var(--accent);cursor:pointer}.product-history-method p{max-width:110ch;line-height:1.5}
.product-history-section{margin:0 0 22px}.product-history-section h3{margin:0 0 8px;font-size:15px}
.product-history-table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:8px;max-height:none}
.product-history-table{font-size:12px;font-variant-numeric:tabular-nums;min-width:980px;width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0}
.product-history-table th,.product-history-table td{padding:8px!important;white-space:nowrap}
.product-history-table th{font-weight:500;background:var(--panel);position:static}
.product-history-table thead th,.product-history-table thead th.number{white-space:normal;vertical-align:bottom;color:var(--muted);text-align:right}
.product-history-table th:first-child{position:sticky;left:0;z-index:2;width:105px;text-align:left;background:var(--panel)}
.product-history-table thead th:first-child{z-index:3}
.product-history-table small{display:block;font-size:11px;color:var(--muted)}
.product-history-table .history-month-status{color:var(--muted);white-space:normal;text-align:left}
.product-history-table .history-profit{color:var(--good)}.product-history-table .history-loss{color:var(--bad)}
.product-history-table .is-loading{background:linear-gradient(100deg,transparent 30%,var(--theme-accent-bg) 50%,transparent 70%);background-size:220% 100%;animation:history-loading 2s linear infinite}
@keyframes history-loading{to{background-position:-220% 0}}
@media(prefers-reduced-motion:reduce){.product-history-table .is-loading{animation:none}}
@media(max-width:600px){
 .finance-calculation-scroll>.data-table>thead>tr>th:last-child{width:86px}
 .finance-calculation-dialog .finance-calculation-inputs>div{gap:8px;font-size:12px}
 .finance-receipt-row>td{padding:0 5px 8px!important}
 .finance-calculation-dialog.self-buyout-dialog{width:100vw;height:100dvh;margin:0;border-radius:0;border:0}
 .self-buyout-dialog .self-buyout-header{padding:10px;gap:8px;flex-wrap:wrap}
 .self-buyout-dialog .self-buyout-header>div:first-child{flex:1;min-width:0}
 .self-buyout-dialog .self-buyout-header>button{order:2}
 .self-buyout-dialog .self-buyout-summary{order:3;width:100%;margin:0;grid-template-columns:1fr auto;text-align:left}
 .self-buyout-summary>strong{text-align:right;font-size:20px}
 .self-buyout-toolbar{padding:8px 10px;gap:8px;font-size:11px}
 .self-buyout-toolbar input{width:100%}.self-buyout-units{display:none}
 .self-buyout-method[open]>p{left:auto;right:0;max-width:80vw}
 .self-buyout-table th:first-child{min-width:154px;width:154px;max-width:154px}
 .self-buyout-table th,.self-buyout-table td{padding:8px 6px}
 .self-buyout-row-detail{display:block;max-width:calc(100vw - 36px)}
 .self-buyout-row-detail>div+div{margin-top:14px;overflow:auto}
 .self-buyout-components{grid-template-columns:1fr}
 .finance-calculation-dialog.calculation-document{width:100vw;max-height:100dvh;height:100dvh;margin:0;padding:0 12px 12px;border:0;border-radius:0}
 .calculation-document>header{flex-wrap:wrap;gap:6px 10px;padding:10px 0}
 .calculation-document>header>div{flex-basis:calc(100% - 58px);order:0}
 .calculation-document>header .finance-calculation-total{order:2;font-size:20px}
 .calculation-document>header>button{order:1}
 .calculation-operands{grid-template-columns:1fr}
 .finance-calculation-dialog.product-history-dialog{width:100vw;height:100dvh;margin:0;border:0;border-radius:0}
 .product-history-header{padding:10px;gap:8px}.product-history-header h2{font-size:16px}
 .product-history-controls{padding:8px 10px;gap:8px}
 .product-history-controls label{flex:1 1 calc(50% - 8px);display:block;min-width:0}.product-history-controls input{display:block;width:100%;margin-top:3px}
 .product-history-body{padding:10px}.product-history-table th:first-child{width:94px}
}
