.finance-modes {display:flex;flex-wrap:wrap;gap:4px;border-top:1px solid #d9ddce;padding:7px clamp(12px,1.5vw,22px);background:#f4f5eb}
.finance-modes button,.lab-stages button {font:inherit;font-weight:640;font-size:.85rem;border:1px solid transparent;border-radius:6px;background:transparent;line-height:1.4;color:#536251;padding:6px 10px}
.finance-modes [aria-pressed=true],.lab-stages [aria-current=step] {background:#fffef7;border-color:#9fae97;color:#284d3c;box-shadow:0 1px 2px #26332d12}
.ledger-context {color:#526055;font-size:.83rem;font-weight:650;margin:0 0 14px}
.ledger-scene,.ledger-scene *,.lab-tally,.lab-stages,.transaction-scene {min-width:0}
.ledger-plot {display:grid;gap:2px}
.ledger-row {width:100%;display:grid;align-items:center;grid-template-columns:minmax(70px,1fr) minmax(58px,1.7fr) minmax(64px,auto);gap:8px;text-align:left;border:1px solid transparent;border-radius:6px;background:transparent;padding:6px 7px;min-height:37px;font:inherit}
.ledger-row[aria-pressed=true],.parts-legend button[aria-pressed=true],.ledger-node[aria-pressed=true]{border-color:#8eaa96;background:#e8f0e5}
.ledger-row:hover,.parts-legend button:hover,.ledger-node:hover {background:#edf2e6}
.ledger-label,.ledger-row b,.parts-legend button {font-size:.9rem;font-weight:650;line-height:1.4}
.ledger-label,.ledger-note,.ledger-node,.figure-insight,.parts-heading {word-break:keep-all;overflow-wrap:anywhere}
.ledger-row b {text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.ledger-scale {position:relative;height:18px;border-radius:2px;background:repeating-linear-gradient(90deg,#dbe1d3 0 1px,transparent 1px 25%)}
.ledger-bar {position:absolute;height:12px;top:3px;min-width:1px;border-radius:3px;background:#648d77}
.ledger-row.down .ledger-bar {background:#bb8066}.ledger-row.up .ledger-bar {background:#54877e}
.ledger-thread {position:absolute;bottom:15px;border-left:1px dashed #a1ac9b;height:25px}
.ledger-parts {display:grid;gap:10px}
.parts-heading {font-size:.93rem;display:flex;justify-content:space-between;align-items:baseline;gap:8px;color:#344e41}
.parts-heading b {font-size:1.11rem}
.parts-band {height:21px;display:flex;gap:1px;overflow:hidden;border-radius:5px;background:#e2e8df;margin:6px 0}
.parts-band i {display:block}
.parts-legend {display:flex;flex-wrap:wrap;gap:4px}
.parts-legend button {display:inline-flex;gap:5px;align-items:center;padding:5px 7px;border:1px solid #cbd5c5;border-radius:5px;background:#fffdf6;text-align:left}
.parts-legend i {height:9px;width:9px;flex:none;border-radius:2px}
.parts-legend b {font-weight:740}
.parts-equal {font:bold 1.15rem/1 system-ui;color:#637b6b;text-align:center}
.ledger-nodes {list-style:none;display:grid;gap:10px;align-items:stretch;padding:0}
.ledger-nodes.by-question {grid-template-columns:repeat(2,minmax(0,1fr))}
.ledger-nodes.in-sequence {display:flex;align-items:stretch;gap:18px;flex-wrap:wrap}
.ledger-nodes.in-sequence li {flex:1 1 95px;position:relative}
.ledger-nodes.in-sequence li:not(:last-child)::after {content:"→";position:absolute;left:100%;top:50%;transform:translateY(-50%);width:18px;text-align:center;color:#839786;font:normal 1rem sans-serif}
.ledger-node {display:flex;align-items:center;gap:8px;width:100%;height:100%;padding:10px 8px;border:1px solid #c6d0bf;border-radius:8px;background:#fffef8;text-align:left;font:inherit}
.in-sequence .ledger-node {flex-direction:column;justify-content:flex-start;align-items:flex-start;padding:11px}
.node-icon {flex:none;display:grid;place-items:center;border-radius:8px;width:31px;height:31px;background:#e5ecde;color:#53725c}
.ledger-nodes li:nth-child(4n+2) .node-icon {background:#f1e8d9;color:#886c44}
.ledger-nodes li:nth-child(4n+3) .node-icon {background:#e2eaf0;color:#567489}
.ledger-nodes li:nth-child(4n) .node-icon {background:#eae5ee;color:#816e87}
.node-icon svg {width:22px;height:22px}
.node-title strong,.node-title small,.node-title em {display:block}
.node-title strong {font-size:.95rem;font-weight:710;line-height:1.44}
.node-title small {font-weight:580;font-size:.77rem;color:#586a5a;line-height:1.4}
.node-title em {font-style:normal;font-weight:710;font-size:.93rem;color:#385e4c;margin-top:4px}
.figure-insight {padding:12px 13px;margin-top:15px;border:1px solid #c6d5c5;border-left:4px solid #7e9e83;background:#f0f5e9;border-radius:7px;line-height:1.65}
.figure-insight>strong {font-size:.95rem;color:#284936}
.figure-insight p {font-size:.94rem;color:#384a3c;margin:3px 0 0}
.figure-insight a {display:inline-block;margin-top:6px;font-size:.88rem;font-weight:660}
.ledger-note {font-size:.8rem;line-height:1.57;color:#586556;margin:12px 0 0}
.lab-stages {display:flex;gap:3px;flex-wrap:wrap;border:1px solid #d2d9ca;background:#f3f5eb;border-radius:8px;padding:4px}
.transaction-scene {display:grid;grid-template-columns:1fr minmax(70px,.75fr) 1fr;align-items:center;gap:9px;margin:20px 0}
.transaction-scene>div {display:grid;justify-items:center;gap:7px;color:#335e49;padding:12px 3px;border:1px solid #b9cbb4;border-radius:8px;background:#ecf2e6;font-size:.95rem}
.transaction-scene>div:last-child {background:#e8eff1;color:#4a6879;border-color:#bfccd1}
.transaction-scene svg {width:38px;height:38px}
.transaction-scene>span {text-align:center;color:#54705b}
.transaction-scene>span small {display:block;font-size:.8rem;margin-bottom:6px}
.transaction-scene>span i {display:block;height:1px;background:#738e77;position:relative}
.transaction-scene>span i::after {content:"";position:absolute;right:0;top:-3px;width:6px;height:6px;border:solid #738e77;border-width:1.5px 1.5px 0 0;transform:rotate(45deg)}
.lab-tally {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.lab-tally>div {padding:9px 7px;border:1px solid #d1d6ca;border-radius:7px;background:#fafbf2}
.lab-tally .changed {background:#e8f1e3;border-color:#a6bea1}
.lab-tally small,.lab-tally strong,.lab-tally em {display:block}
.lab-tally small {font-size:.78rem;color:#475a4e}.lab-tally strong {font-size:1.5rem;line-height:1.5;color:#2f5942}
.lab-tally strong span {font-size:.8rem;margin-left:3px}.lab-tally em{font-size:.78rem;color:#526753;font-style:normal}
@media(max-width:620px){
  .ledger-row {gap:4px;padding:6px 4px;grid-template-columns:minmax(62px,1fr) minmax(46px,1.1fr) minmax(64px,auto)}.ledger-label,.ledger-row b {font-size:.83rem}
  .ledger-nodes.in-sequence {display:grid;grid-template-columns:1fr;gap:13px}
  .in-sequence .ledger-node {flex-direction:row;align-items:center;padding:8px 10px}
  .ledger-nodes.in-sequence li:not(:last-child)::after {content:"↓";left:17px;top:100%;height:13px;line-height:13px;transform:none}
  .ledger-node {gap:5px}.by-question .node-icon {display:none}.node-title strong {font-size:.9rem}
  .lab-tally{grid-template-columns:repeat(2,minmax(0,1fr))}
  .parts-legend button {font-size:.84rem}.figure-insight {margin-top:12px}
}
.ledger-context {display:flex;align-items:center;justify-content:space-between;gap:8px}
.ledger-context>span {color:#47674c}
.ledger-label small {display:block;line-height:1.3;font-size:.75rem;color:#5a695d;font-weight:470;margin-top:2px}
.ledger-equation {display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 10px;margin:12px 0 0;border-top:1px solid #c9d5c3;padding-top:9px;color:#34583f}
.ledger-equation small {font-size:.81rem}.ledger-equation strong{font-size:1.05rem;font-variant-numeric:tabular-nums}
.finance-jump {display:inline-block;border:0;background:transparent;text-decoration:underline;text-underline-offset:3px;color:#3f6348;font:inherit;font-size:.86rem;font-weight:650;margin-top:10px;padding:3px 0;text-align:left}
.exact-amount {margin-top:6px}.exact-amount summary {cursor:pointer;font-size:.8rem}
.exact-amount p {font-variant-numeric:tabular-nums}
.ledger-parts.balance {grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:start}
.balance .parts-heading {display:grid;gap:3px}.balance .parts-equal {align-self:start;margin-top:37px}
@media(max-width:620px){.ledger-parts.balance {grid-template-columns:1fr}.balance .parts-equal {margin-top:0}.balance .parts-heading {display:flex}}
.ledger-impact {border:1px solid #becbb7;background:#f1f5e9;border-radius:8px;padding:10px 13px;margin:0 0 12px}
.ledger-impact>div:first-child {display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:7px;color:#34513c}
.ledger-impact small {font-size:.88rem;font-weight:650}
.ledger-impact strong {font-size:clamp(1.15rem,1.5vw,1.55rem);letter-spacing:-.035em;font-variant-numeric:tabular-nums}
.ribbon {position:relative;height:16px;background:#e0e6d8;border-radius:4px;overflow:hidden}
.ribbon i {display:block;position:absolute;height:100%}
.ribbon-remaining {background:#668b70}
.ribbon-change.lost {background:repeating-linear-gradient(130deg,#c58a72 0px 4px,#e0b19b 4px 7px)}
.ribbon-change.gained {background:repeating-linear-gradient(130deg,#54877a 0px 4px,#8eb5a6 4px 7px)}
.ribbon-zero {border-left:1px solid #576b59}
