/* ---- Sales › Finances (#734): burn rate, runway, in/out bars, biggest lines, feeding, the ledger. Both clients. ---- */
.fn { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.fn-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); }
.fn-tile { display: flex; flex-direction: column; gap: 6px; padding: 13px 14px 14px; min-width: 0; }
.fn-tile + .fn-tile { border-left: 1px solid var(--rule); }
.fn-tile b { font-family: var(--mono); font-size: 23px; font-weight: 600; line-height: 1; letter-spacing: -.01em; white-space: nowrap; }
.fn-tile b small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 1px; }
.fn-tile.out b { color: var(--brick); } .fn-tile.in b { color: var(--moss); }
.fn-tile.good { background: color-mix(in srgb, var(--moss) 8%, transparent); box-shadow: inset 0 3px 0 var(--moss); }
.fn-tile.low { background: color-mix(in srgb, var(--amber) 12%, transparent); box-shadow: inset 0 3px 0 var(--amber); }
.fn-tile.low b { color: var(--amber); }
.fn-seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--rule-2); border-radius: 16px; overflow: hidden; }
.fn-seg button { border: 0; border-radius: 0; background: transparent; color: var(--ink-2); padding: 5px 14px; font-size: 12.5px; min-height: 0; }
.fn-seg button + button { border-left: 1px solid var(--rule-2); }
.fn-seg button.on { background: var(--ink); color: var(--paper); }
.fn-mid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; }
.fn-chart .nb-key i.o { background: var(--brick); opacity: .8; }
.fn-chart .nb-key b { font-family: var(--mono); margin-left: 8px; } .fn-chart .nb-key b.neg { color: var(--brick); } .fn-chart .nb-key b.pos { color: var(--moss); }
.fn-bars { display: flex; align-items: stretch; gap: 3px; height: 160px; padding-top: 4px; }
.fn-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.fn-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 1px; border-bottom: 1px solid var(--rule-2); }
.fn-pair i { display: block; width: 46%; max-width: 16px; min-height: 0; border-radius: 2px 2px 0 0; }
.fn-pair i.in { background: var(--moss); } .fn-pair i.out { background: var(--brick); opacity: .8; }
.fn-col:hover .fn-pair i { opacity: 1; filter: brightness(1.15); }
.fn-col span { height: 14px; margin-top: 4px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); text-align: center; white-space: nowrap; overflow: visible; }
.fn-note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.4; }
.fn-line { cursor: pointer; } .fn-line + .fn-line { margin-top: 11px; }
.fn-line.out .nb-bar > i { background: var(--brick); opacity: .8; } .fn-line.out .nb-rt > b { color: var(--brick); } .fn-line.in .nb-rt > b { color: var(--moss); }
.fn-line:hover .nb-rl b { text-decoration: underline; }
.fn-feedline { font-size: 14px; line-height: 1.5; margin: 0; }
.fn-feedline b { font-family: var(--mono); font-weight: 600; }
.fn-eaters { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.fn-eater { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 10px; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding: 7px 0 4px; min-height: 0; color: var(--ink); font-size: 13px; }
.fn-eater b { font-family: var(--mono); font-weight: 600; }
.fn-eater:hover .nb-rl { text-decoration: underline; }
.fn-ledger select { font-size: 12.5px; max-width: 55%; }
.fn-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.fn-when { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.fn-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-amt { font-family: var(--mono); font-weight: 600; white-space: nowrap; } .fn-row.out .fn-amt { color: var(--brick); } .fn-row.in .fn-amt { color: var(--moss); }
@media (max-width: 900px) { .fn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fn-tile:nth-child(3) { border-left: 0; } .fn-tile:nth-child(n+3) { border-top: 1px solid var(--rule); } .fn-mid { grid-template-columns: minmax(0, 1fr); } }

/* the phone: the Deals | Finances switch, a tighter layout */
.fn-sub.seg { margin: 4px 0 10px; border-radius: 10px; overflow: hidden; }
.fn-sub.seg button { flex: 1; min-height: 34px; font-size: 13px; }
body.mobile .fn { margin-top: 4px; gap: 12px; }
body.mobile .fn-tile { padding: 11px 12px 12px; }
body.mobile .fn-tile b { font-size: 20px; }
body.mobile .fn-bars { height: 130px; gap: 2px; }
body.mobile .fn-bars.fortnight .fn-col span, body.mobile .fn-bars.day .fn-col span { font-size: 9px; }
body.mobile .fn-row { grid-template-columns: 74px minmax(0, 1fr) auto; font-size: 12.5px; }
body.mobile .fn-eater { grid-template-columns: minmax(0, 1fr) auto; } body.mobile .fn-eater .meta { display: none; }

/* the header's cash turns amber when it is about to run out (summary().low) */
#hud .cash-cell.cash-low { background: color-mix(in srgb, var(--amber) 16%, transparent); box-shadow: inset 0 -2px 0 var(--amber); }
#hud .cash-cell.cash-low #hCash { color: var(--amber); }
body.mobile #top .stat.cash.cash-low { box-shadow: inset 0 0 0 1.5px #ff9b3d; border-radius: 8px; background: rgba(255, 155, 61, .16); }
body.mobile #top .stat.cash.cash-low b { color: #ff9b3d !important; }
