/* /tools/contribution-margin-calculator. Loads after tools.css. */
.cm-wf { margin: 0; padding: 24px; list-style: none; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--border-dark); border-radius: var(--radius--small); background-color: var(--light); }
.cm-wf-head { font-family: var(--font--mono); font-size: var(--text--label); letter-spacing: var(--letter-spacing--2-0); text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.cm-wf li { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) 6em; gap: 12px; align-items: center; font-size: 14px; line-height: 1.3; }
.cm-wf li[hidden] { display: none; }
.cm-wf li.cm-wf-head { display: block; }
.cm-wf-track { height: 18px; display: flex; }
.cm-bar { display: block; height: 100%; min-width: 0; border-radius: 3px; background-color: rgba(22,35,27,.28); transition: margin-left .25s ease, width .25s ease; }
.cm-wf li.total { font-weight: 500; }
.cm-wf li.total .cm-bar { background-color: var(--dark); }
.cm-wf li.neg .cm-wf-val { color: #b3261e; }
.cm-wf-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cm-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cm-btn { min-height: 44px; padding: 10px 18px; border: 1px solid var(--dark); border-radius: 999px; background: transparent; color: var(--dark); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
.cm-btn:hover { background-color: var(--dark); color: var(--light); }
.cm-btn:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }
.cm-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cm-cards .pg-card h3 { font-size: 24px; }
.cm-table { min-width: 0; }
.cm-table td:first-child { font-weight: 500; white-space: nowrap; }
.cm-ledger { margin: 0; max-width: 560px; border-top: 1px solid var(--border-dark); }
.cm-ledger div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-dark); font-variant-numeric: tabular-nums; }
.cm-ledger dt, .cm-ledger dd { margin: 0; }
.cm-ledger .total { font-weight: 600; }
.cm-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.cm-split .tl-formula { margin-top: 20px; }
@media screen and (max-width: 991px) { .cm-split { grid-template-columns: minmax(0, 1fr); gap: 32px; } .tl-tool .cm-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; } }
@media screen and (max-width: 479px) {
  .cm-wf { padding: 18px 14px; }
  .cm-wf li { grid-template-columns: minmax(0, 6.2em) minmax(0, 1fr) 5.4em; gap: 8px; font-size: 13px; }
  .cm-table th, .cm-table td { padding: 12px 10px; font-size: 14px; }
  .cm-table td:first-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .cm-bar { transition: none; } }
