.profit-toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;margin:20px 0}.profit-toolbar label{display:flex;flex-direction:column;gap:6px;color:var(--hub-muted);font-size:12px}.profit-toolbar input,.profit-toolbar select{border:1px solid var(--hub-border);border-radius:8px;padding:10px 12px;background:var(--hub-table);color:var(--hub-text);min-height:39px}.profit-toolbar .push{margin-left:auto}.profit-tabs{display:flex;gap:20px;border-bottom:1px solid var(--hub-border);margin-bottom:16px}.profit-tabs button{background:none;border:0;border-bottom:3px solid transparent;padding:15px 8px;color:var(--hub-muted);cursor:pointer}.profit-tabs button.active{color:var(--hub-accent);border-bottom-color:var(--hub-success-border);font-weight:700}.profit-quality{display:flex;gap:12px;align-items:center;padding:14px 18px;background:var(--hub-success-soft);border:1px solid var(--hub-success-border);border-radius:10px;margin:16px 0;color:var(--hub-success)}.profit-quality.warn{background:var(--hub-warning-soft);border-color:var(--hub-warning-border);color:var(--hub-warning)}.profit-quality span{flex:1}.profit-table{min-width:1180px;width:100%;border-collapse:collapse}.profit-table th{background:var(--hub-surface-soft);color:var(--hub-muted);font-size:11px;padding:15px 12px;text-align:right;white-space:normal}.profit-table th:first-child{min-width:240px;text-align:left}.profit-table td{padding:18px 12px;border-bottom:1px solid var(--hub-border);text-align:right;font-variant-numeric:tabular-nums;vertical-align:top}.profit-table td:first-child{text-align:left}.profit-table button{border:0;background:none;color:var(--hub-accent);font:inherit;cursor:pointer}.profit-table .profit-sku{display:block;text-align:left;font-weight:700;color:var(--hub-text);margin:0;padding:0}.profit-sub{display:block;font-size:11px;line-height:1.6;color:var(--hub-muted);margin-top:5px;max-width:290px}.profit-negative{color:var(--hub-danger)}.profit-positive{color:var(--hub-success)}.profit-tag{display:inline-block;font-size:10px;padding:3px 7px;border-radius:5px;background:var(--hub-surface-soft);color:var(--hub-accent);margin:3px}.profit-tag.warn{background:var(--hub-warning-soft);color:var(--hub-warning)}.profit-section{margin-top:18px;padding:22px}.profit-section h3{margin:0 0 8px}.profit-small{color:var(--hub-muted);font-size:12px;line-height:1.7}.profit-source-tools{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}.profit-source-tools button{font-size:12px}.profit-ledger{width:100%;border-collapse:collapse}.profit-ledger td{padding:9px;border-bottom:1px solid var(--hub-border)}.profit-ledger td:last-child{text-align:right;font-variant-numeric:tabular-nums}.profit-ledger tr:last-child{font-weight:700;background:var(--hub-surface-soft)}.profit-summary{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:18px 0}.profit-missing{color:var(--hub-muted)}.profit-months{min-width:760px}.profit-source-details{margin-top:22px;border:1px solid var(--hub-border);border-radius:12px;background:var(--hub-table);padding:17px}.profit-source-details>summary{cursor:pointer;color:var(--hub-muted);font-size:12px}.profit-sort{color:var(--hub-muted)!important;white-space:normal;font-weight:600!important}.profit-form{display:grid;gap:14px;margin:18px 0}.profit-form label{display:grid;gap:7px}.profit-form select,.profit-form input{padding:10px;border:1px solid var(--hub-border);border-radius:7px}.order-range-info{padding:12px 18px;background:var(--hub-surface-soft);color:var(--hub-muted);font-size:12px;border-bottom:1px solid var(--hub-border)}.order-archive-tag{display:inline-block;padding:2px 7px;border-radius:5px;background:var(--hub-accent-soft);color:var(--hub-muted);font-size:10px;margin-left:6px}.order-period-controls{display:flex;flex-wrap:wrap;gap:10px;padding:12px 18px;border-bottom:1px solid var(--hub-border)}.order-period-controls label{display:flex;gap:7px;align-items:center;color:var(--hub-muted);font-size:12px}.order-period-controls input,.order-period-controls select{padding:7px;border:1px solid var(--hub-border);border-radius:5px;background:var(--hub-table)}@media(max-width:850px){.profit-summary{grid-template-columns:1fr}.profit-toolbar .push{margin-left:0}.profit-toolbar label{flex:1}.profit-toolbar input{width:100%}.profit-section{padding:14px}}
.profit-ledger td:last-child{white-space:nowrap;min-width:108px}
.profit-table{min-width:1340px}.profit-known-part{display:block;margin-top:5px;color:var(--hub-muted);font-size:10px;font-weight:400;white-space:nowrap}.profit-tag.expense-only{background:var(--hub-danger-soft);color:var(--hub-danger)}.profit-order-stats{display:flex;gap:24px;margin:14px 0}.profit-order-stats>div{display:flex;flex-direction:column;gap:5px}.profit-order-stats>div>span{font-size:12px;color:var(--hub-muted)}.profit-order-stats b{font-size:21px;color:var(--hub-text)}.profit-expense-note{padding:12px 14px;background:var(--hub-surface-soft);border:1px solid var(--hub-warning-border);border-radius:8px;color:var(--hub-warning);font-size:12px;line-height:1.7}.profit-operation-group{border:1px solid var(--hub-border);border-radius:9px;margin:10px 0;background:var(--hub-table)}.profit-operation-group>summary{display:grid;grid-template-columns:minmax(180px,1fr) minmax(150px,.6fr) minmax(120px,.5fr);gap:16px;align-items:start;cursor:pointer;padding:14px 16px;list-style:none;position:relative;padding-left:34px}.profit-operation-group>summary::-webkit-details-marker{display:none}.profit-operation-group>summary::before{content:'▸';position:absolute;left:14px;top:15px;color:var(--hub-muted)}.profit-operation-group[open]>summary::before{content:'▾'}.profit-operation-group[open]>summary{background:var(--hub-surface-soft);border-radius:9px 9px 0 0}.profit-operation-group>summary:focus-visible{outline:2px solid var(--hub-border);outline-offset:2px;border-radius:9px}.profit-group-order{overflow-wrap:anywhere;min-width:0}.profit-group-order b{font-size:13px;color:var(--hub-text)}.profit-group-order small,.profit-group-number small{display:block;color:var(--hub-muted);font-size:11px;line-height:1.6;margin-top:4px}.profit-group-number{text-align:right;font-variant-numeric:tabular-nums}.profit-group-number b{display:block;margin-top:5px;font-size:14px;white-space:nowrap}.profit-group-body{padding:0 15px 15px}.profit-operation-table{min-width:700px;width:100%}.profit-operation-table th{white-space:normal}.profit-operation-table td{vertical-align:top;line-height:1.65}.profit-operation-table th:first-child{width:120px}.profit-operation-table td:nth-last-child(-n+2){text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.profit-operation-table td:nth-child(2){min-width:270px}.profit-operation-title{color:var(--hub-accent);font-size:12px}.profit-source-key{display:block;overflow-wrap:anywhere;color:var(--hub-muted);font-size:10px;max-width:160px}.profit-operation-reason{margin:6px 0;color:var(--hub-muted);font-size:12px}.profit-service-list{list-style:none;padding:0;margin:8px 0}.profit-service-list li{display:flex;justify-content:space-between;gap:14px;padding:5px 0;color:var(--hub-muted);font-size:11px}.profit-service-list li span:last-child{white-space:nowrap}.profit-source-fields{margin-top:8px;font-size:11px;color:var(--hub-muted)}.profit-source-fields summary{cursor:pointer}.profit-source-fields dl{display:grid;grid-template-columns:130px 1fr;gap:5px 12px;margin:9px 0}.profit-source-fields dd{margin:0;overflow-wrap:anywhere}.profit-operations-more{margin:12px 0}.profit-load-more-error{font-size:12px;color:var(--hub-danger);line-height:1.6;overflow-wrap:anywhere}.profit-months{min-width:960px}@media(max-width:600px){.profit-operation-group>summary{grid-template-columns:1fr 1fr;gap:10px}.profit-group-order{grid-column:1/-1}.profit-group-number{text-align:left}.profit-operations{padding:12px}.profit-group-body{padding:0 10px 10px}.profit-source-fields dl{grid-template-columns:1fr}.profit-order-stats{gap:20px}}
.profit-tabs{flex-wrap:wrap;gap:4px 14px}
.profit-export-note{font-size:12px;color:var(--hub-warning);margin:10px 0}
.profit-column-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.profit-view-select{font-size:12px;color:var(--hub-muted)}
.profit-view-select select{padding:7px;border:1px solid var(--hub-border);border-radius:6px;background:var(--hub-table)}
.profit-column-menu{position:relative;font-size:12px}
.profit-column-menu summary{cursor:pointer;padding:7px;border:1px solid var(--hub-border);border-radius:6px}
.profit-column-menu>div{position:absolute;right:0;z-index:5;display:grid;gap:6px;min-width:220px;padding:12px;background:var(--hub-table);border:1px solid var(--hub-border);border-radius:6px;box-shadow:0 8px 24px var(--hub-shadow-ink)}
.profit-column-menu label{display:flex;gap:6px;align-items:center}
.profit-column-menu small{color:var(--hub-muted)}
.profit-table [hidden]{display:none!important}
#finance [data-profit-scope][hidden],#profit-export[hidden]{display:none!important}
.profit-cost-diagnostics{margin:22px 0}.profit-cost-diagnostics>h3{margin-bottom:6px}.profit-cost-reason{margin:12px 0;padding:14px 16px;border:1px solid var(--hub-border);border-radius:10px;background:var(--hub-surface-soft)}.profit-cost-reason h4{margin:0;color:var(--hub-text);font-size:14px;line-height:1.6}.profit-cost-reason p{margin:8px 0;line-height:1.7}.profit-cost-reason .profit-small{margin:4px 0}.profit-cost-reason summary{color:var(--hub-muted);cursor:pointer;font-size:12px}.profit-cost-examples{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:9px}.profit-cost-examples .text-button{padding:0;overflow-wrap:anywhere;text-align:left}.profit-cost-diagnostics>.btn{margin-top:4px;white-space:normal}
.profit-operation-category{margin:4px 0;color:var(--hub-muted);font-size:11px}.profit-cancellation-reason{padding-top:10px}
@media(max-width:600px){.profit-quality{align-items:flex-start;flex-direction:column;gap:8px}.profit-quality span{flex:initial}}
.profit-loading{display:flex;align-items:center;justify-content:center;gap:20px;min-height:240px;padding:28px 16px;text-align:left}.profit-loading h3,.profit-load-error h3{margin:0 0 8px;color:var(--hub-text);font-size:18px}.profit-loading p,.profit-load-error p{margin:0;color:var(--hub-muted);line-height:1.7}.profit-spinner{flex:0 0 34px;width:34px;height:34px;border:3px solid var(--hub-border);border-top-color:var(--hub-border);border-radius:50%;animation:profit-spin .8s linear infinite}.profit-load-error{padding:26px 8px;min-height:180px}.profit-load-error .profit-small{margin-top:16px}.profit-months th{white-space:normal}.profit-months th:nth-child(3){min-width:150px}.profit-months th:first-child{min-width:110px}@keyframes profit-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.profit-spinner{animation:none}}@media(max-width:500px){.profit-loading{gap:14px;min-height:200px;padding:20px 0}.profit-loading h3{font-size:16px}}

/* 1.7.1: counters in the free area above the order table, responsive wrap. */
.orders-toolbar{flex-wrap:wrap;gap:12px}.orders-tabs{flex-wrap:wrap}.orders-summary{display:flex;flex:1 1 440px;align-items:center;justify-content:center;gap:7px}.orders-count{display:flex;flex-direction:column;gap:4px;padding:8px 12px;background:var(--hub-surface-soft);border:1px solid var(--hub-border);border-radius:8px;min-width:76px}.orders-count span{font-size:10px;color:var(--hub-muted);white-space:nowrap}.orders-count b{font-size:17px;color:var(--hub-accent);font-variant-numeric:tabular-nums}.orders-count[data-order-count="delivered"]{background:var(--hub-success-soft)}.orders-count[data-order-count="canceled"]{background:var(--hub-surface-soft)}.orders-filters{flex-wrap:wrap;gap:8px}.orders-summary-note{flex:0 0 100%;font-size:11px;line-height:1.6;color:var(--hub-muted)}.phase-tag.delivered{background:var(--hub-success-soft);color:var(--hub-text)}.phase-tag.delivering{background:var(--hub-surface-soft);color:var(--hub-accent)}.phase-tag.processing{background:var(--hub-surface-soft);color:var(--hub-accent)}.phase-tag.unknown{background:var(--hub-surface-soft);color:var(--hub-muted)}.phase-tag.returned{background:var(--hub-warning-soft);color:var(--hub-warning)}.profit-source-warning{background:var(--hub-warning-soft);border-radius:7px;padding:8px;margin-top:8px;max-width:440px;word-break:break-word;font-size:11px;line-height:1.5}
@media(max-width:1000px){.orders-summary{order:3;flex-basis:100%;justify-content:flex-start;flex-wrap:wrap}.orders-summary-note{order:4}.orders-count{flex:1}.orders-filters{flex:1}}

.profit-calculation-basis{border:1px solid var(--hub-border);border-radius:10px;background:var(--hub-surface-soft);padding:16px 18px;margin:18px 0;color:var(--hub-muted)}.profit-calculation-basis h3{margin:0 0 10px;font-size:14px;color:var(--hub-accent)}.profit-calculation-basis p{font-size:12px;line-height:1.7;margin:8px 0}.profit-calculation-basis .profit-small{font-size:11px}
.profit-finance-activity,.profit-readiness{display:flex;gap:14px;align-items:center;margin:14px 0;padding:15px 18px;border:1px solid var(--hub-border);border-radius:10px;background:var(--hub-surface-soft);color:var(--hub-text)}
.profit-finance-activity p,.profit-readiness p{margin:5px 0;line-height:1.55;font-size:13px}.profit-finance-activity.warn,.profit-readiness{border-color:var(--hub-warning-border);background:var(--hub-warning-soft)}
.profit-finance-activity .profit-spinner{width:24px;height:24px;flex-basis:24px;border-top-color:var(--hub-accent)}.profit-readiness{display:block}.profit-readiness p+p{margin-top:10px}
.ad-status-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin:12px 0}
.ad-buttons {display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.ad-stat-list {max-height:220px;overflow:auto;display:grid;gap:6px;border:1px solid var(--border,#d9dfe5);padding:10px;margin:10px 0;border-radius:8px}
.ad-stat-list label {display:flex;gap:8px;align-items:flex-start}

/* Finance setup and dated unit-price editor. */
.profit-tabs{flex-wrap:wrap;gap:6px 16px}.profit-tabs button{padding:12px 8px}.profit-settings-card{padding:18px;margin:14px 0;border:1px solid var(--hub-border);border-radius:10px;background:var(--hub-surface-soft)}.profit-settings-card h3{margin:0 0 10px;font-size:16px}.profit-settings-card p{font-size:13px;line-height:1.65}.profit-setting-check{display:flex;align-items:flex-start;gap:10px;margin:16px 0;font-size:13px}.profit-setting-check input{margin-top:3px;accent-color:var(--hub-accent);flex-shrink:0}.profit-setting-check small,.profit-form small,.profit-price-fields small{display:block;margin-top:6px;line-height:1.6;color:var(--hub-muted);font-size:12px}.profit-settings-links{display:flex;flex-wrap:wrap;gap:8px}.profit-readiness.estimate{background:var(--hub-surface-soft);border-color:var(--hub-border)}.profit-price-fields{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:16px 0}.profit-price-fields label,.profit-price-note{display:grid;gap:6px;font-size:13px}.profit-price-fields input,.profit-price-note input,.profit-form select{padding:10px 12px;color:var(--hub-text);background:var(--hub-table);border:1px solid var(--hub-border);border-radius:7px;min-width:0;width:100%;box-sizing:border-box}.profit-price-table{width:100%;min-width:640px}.profit-price-table th{text-align:left}.profit-price-history{display:block;margin:7px 0}.profit-price-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;font-size:12px}.profit-price-success{padding:10px 14px;border-radius:8px;color:var(--hub-success);background:var(--hub-success-soft)}.profit-settings-card .profit-form{margin-bottom:0}.profit-settings-card .profit-form select{max-width:100%}@media(max-width:650px){.profit-price-fields{grid-template-columns:1fr}.profit-settings-card{padding:13px}.profit-price-pager{flex-wrap:wrap}.profit-toolbar>label{min-width:140px}}

/* Keep checkbox controls out of the generic full-width modal input layout. */
.modal .profit-setting-check{display:grid;grid-template-columns:18px minmax(0,1fr);gap:10px;align-items:start;width:100%;min-width:0;box-sizing:border-box}
.modal .profit-setting-check input[type=checkbox]{display:block;width:18px;min-width:18px;max-width:18px;height:18px;min-height:18px;margin:2px 0 0;padding:0;box-sizing:border-box}
.modal .profit-setting-check>span{display:block;min-width:0;white-space:normal;overflow-wrap:anywhere}
#profit-settings-dialog{min-width:0;max-width:100%;box-sizing:border-box}
#profit-settings-dialog .profit-settings-card{min-width:0;max-width:100%;box-sizing:border-box}
#profit-settings-dialog .profit-form{grid-template-columns:minmax(0,1fr);min-width:0}
#profit-settings-dialog .profit-form label{min-width:0;max-width:100%}
#profit-settings-dialog .profit-form select{max-width:100%;box-sizing:border-box}
.profit-expense-steps{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:22px;margin:18px 0 8px;align-items:start}
.profit-expense-steps>div{min-width:0}.profit-expense-steps .btn{white-space:normal;text-align:left;max-width:100%}
.profit-expense-settings{border-left:3px solid var(--hub-accent)}
@media(max-width:700px){.profit-expense-steps{grid-template-columns:minmax(0,1fr);gap:18px}#profit-settings-dialog .profit-settings-card{padding:14px}}
