.profit-tool { display: inline-flex; align-items: center; gap: 8px; }
.profit-selection-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 24px; }
.profit-selection-heading h3 { font-size: 18px; }
.profit-selection-heading strong { font-size: 14px; color: var(--muted); }
.profit-selection-controls { display: grid; grid-template-columns: auto minmax(160px, 320px); gap: 24px; align-items: end; margin-bottom: 12px; }
.profit-selection-controls label { min-width: 0; }
.profit-select-all { display: flex; flex-direction: row; align-items: center; gap: 8px; padding-bottom: 10px; }
.profit-member-list { max-height: 300px; overflow: auto; border-block: 1px solid var(--line); }
.profit-member-row { display: grid; grid-template-columns: 20px minmax(70px, .6fr) minmax(120px, 2fr) minmax(85px, .6fr); align-items: center; gap: 12px; padding: 10px 4px; margin: 0; border-bottom: 1px solid var(--line); }
.profit-member-row input, .profit-select-all input { width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; }
.profit-member-row span { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.profit-member-row span:last-child { text-align: right; }
.profit-member-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.profit-basis-label { color: var(--green-dark); margin-block: 12px; font-size: 14px; }
#postProfit { width: auto; margin-bottom: 16px; }
#postProfit:disabled { opacity: .55; cursor: not-allowed; }
#profitStatement .report-grid strong { font-size: 20px; overflow-wrap: anywhere; }
#profitStatement table { min-width: 850px; }
#profitStatement .data-table { margin-top: 18px; }
#profitPreviewTable { max-height: 500px; overflow: auto; }
#profitPreviewTable th { position: sticky; top: 0; background: #f8fbf9; z-index: 1; }
#profitStatement .sub-heading { flex-wrap: wrap; }
@media (max-width: 600px) {
  #profitSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .profit-selection-controls { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .profit-member-row { grid-template-columns: 18px minmax(40px, .6fr) minmax(80px, 1.5fr) minmax(65px, .6fr); gap: 8px; }
  .profit-member-row span { font-size: 13px; }
  #postProfit { width: 100%; }
}
@media print {
  #profitStatement .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #profitStatement table { min-width: 0; }
  #profitPreviewTable { max-height: none; overflow: visible; }
  #profitPreviewTable th { position: static; }
}
