/* Project money (spec T9, T10): the Funding box summary, the project funding page, the request window's Charge to / Mark paid panels and the Manage > Money tool.
 * Calm by default: rows are two lines (title and amount, then one muted line), a thin bar, no buttons until Edit is on. Status is words first and colour second
 * (late = over, soon = ending); ink is for actions. Tokens only, no raw colours. */
.s1-mny-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s1-space-2); margin: 0 0 var(--s1-space-2); }
.s1-mny-totals > div { min-width: 0; }
.s1-mny-totals dt { color: var(--s1-mute); font: 600 var(--s1-text-micro)/1.3 var(--s1-font-ui); }
.s1-mny-totals dd { margin: 0; color: var(--s1-ink); font: 700 var(--s1-text-base)/1.3 var(--s1-font-ui); overflow-wrap: anywhere; }
.s1-mny-totals--big dd { font-size: var(--s1-fs-5); }
.s1-mny-totals dd.is-late, .s1-mny-amt.is-late, .s1-mny-left.is-late, .s1-mny-fund-left.is-late { color: var(--s1-late); }
.s1-mny-bar { display: flex; height: 6px; border-radius: var(--s1-radius-pill); background: var(--s1-line-soft); overflow: hidden; margin: 4px 0; }
.s1-mny-bar i { display: block; height: 100%; }
.s1-mny-bar-spent { background: var(--s1-ink-2); }
.s1-mny-bar-promised { background: var(--s1-mute); opacity: .55; }
.s1-mny-bar.is-soon .s1-mny-bar-spent { background: var(--s1-soon); }
.s1-mny-bar.is-late { background: var(--s1-late); }
.s1-mny-fund-rows, .s1-mny-alerts, .s1-mny-list, .s1-mny-files { list-style: none; margin: 0; padding: 0; }
.s1-mny-fund-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s1-space-2); align-items: baseline; padding: calc(6px * var(--s1-scale, 1)) 0; border-top: 1px solid var(--s1-line-soft); }
.s1-mny-fund-name { font: 600 var(--s1-text-small)/1.4 var(--s1-font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s1-mny-fund-left { color: var(--s1-ink-2); font: 600 var(--s1-text-small)/1.4 var(--s1-font-ui); }
.s1-mny-fund-row .s1-mny-bar { grid-column: 1 / -1; }
.s1-mny-alerts { display: flex; flex-direction: column; gap: 4px; margin: var(--s1-space-2) 0; }
.s1-mny-alert { font: 600 var(--s1-text-small)/1.4 var(--s1-font-ui); color: var(--s1-ink-2); }
.s1-mny-alert.is-late { color: var(--s1-late); }
.s1-mny-alert.is-soon { color: var(--s1-soon); }
.s1-mny-alert.is-wait { color: var(--s1-wait); }
.s1-mny-open { margin: var(--s1-space-2) 0 0; }
.s1-mny-sub { margin: var(--s1-space-4) 0 var(--s1-space-2); font: 700 var(--s1-text-small)/1.4 var(--s1-font-ui); color: var(--s1-ink-2); }
.s1-mny-summary + .s1-mny-sub { padding-top: var(--s1-space-3); border-top: 1px solid var(--s1-line-soft); }

.s1-mny-page { display: flex; flex-direction: column; gap: var(--s1-space-3); min-width: 0; }
.s1-mny-back { margin: 0; }
.s1-mny-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1-space-2); }
.s1-mny-title { margin: 0; font: 700 var(--s1-fs-5)/1.3 var(--s1-font-display); color: var(--s1-ink); }
.s1-mny-head-actions, .s1-mny-actions, .s1-mny-chips, .s1-mny-row-actions { display: flex; flex-wrap: wrap; gap: var(--s1-space-2); align-items: center; margin: 0; }
.s1-mny-notice { margin: 0; color: var(--s1-ok); font: 600 var(--s1-text-small)/1.4 var(--s1-font-ui); }
.s1-mny-error { margin: 0; color: var(--s1-late); font: 600 var(--s1-text-small)/1.4 var(--s1-font-ui); }
.s1-mny-fy { display: flex; flex-direction: column; gap: 2px; margin: var(--s1-space-2) 0; max-width: 220px; }
.s1-mny-list { display: flex; flex-direction: column; }
.s1-mny-row, .s1-mny-fund { display: flex; flex-direction: column; gap: 2px; padding: calc(8px * var(--s1-scale, 1)) 0; border-top: 1px solid var(--s1-line-soft); min-width: 0; }
.s1-mny-list > :first-child { border-top: 0; }
.s1-mny-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s1-space-2); min-width: 0; }
.s1-mny-row-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 var(--s1-text-small)/1.4 var(--s1-font-ui); }
.s1-mny-amt { flex: none; font: 700 var(--s1-text-small)/1.4 var(--s1-font-ui); color: var(--s1-ink); }
.s1-mny-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s1-mny-row.is-voided .s1-mny-row-title, .s1-mny-row.is-voided .s1-mny-amt { text-decoration: line-through; color: var(--s1-mute); }
.s1-mny-filters { display: flex; flex-wrap: wrap; gap: var(--s1-space-2); align-items: center; margin-bottom: var(--s1-space-2); }

.s1-mny-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(12px * var(--s1-scale, 1)) calc(16px * var(--s1-scale, 1)); padding: 0 0 calc(20px * var(--s1-scale, 1)); border: 0; border-bottom: 1px solid var(--s1-line-soft); border-radius: 0; background: none; max-width: 680px; align-items: start; }
.s1-mny-form > :not(.s1-mny-field), .s1-mny-form > .s1-mny-field:has(textarea) { grid-column: 1 / -1; }
.s1-mny-form-title { margin: 0; font: 750 var(--s1-fs-4)/1.4 var(--s1-font-ui); }
.s1-mny-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.s1-mny-field > label, .s1-mny-split legend { font: 600 var(--s1-text-micro)/1.4 var(--s1-font-ui); color: var(--s1-ink-2); }
.s1-mny-input { width: 100%; max-width: 100%; box-sizing: border-box; font: 400 var(--s1-fs-2)/1.4 var(--s1-font-ui); color: var(--s1-ink); background: var(--s1-panel); border: 1px solid var(--s1-control-line); border-radius: 8px; padding: calc(7px * var(--s1-scale, 1)) calc(11px * var(--s1-scale, 1)); min-height: 34px; }
.s1-mny-hint, .s1-mny-more { color: var(--s1-mute); font: 400 var(--s1-text-micro)/1.4 var(--s1-font-ui); margin: 0; }
.s1-mny-check { display: flex; align-items: flex-start; gap: var(--s1-space-2); font: 400 var(--s1-text-small)/1.4 var(--s1-font-ui); }
.s1-mny-split { border: 0; border-top: 1px solid var(--s1-line-soft); border-radius: 0; padding: var(--s1-space-3) 0 0; display: flex; flex-direction: column; gap: var(--s1-space-2); }
.s1-mny-files li { display: flex; gap: var(--s1-space-2); align-items: baseline; font: 400 var(--s1-text-small)/1.4 var(--s1-font-ui); }

/* The request window: Charge to, Mark paid, receipts, cancel. */
.s1-mny-charge, .s1-mny-pay { display: flex; flex-direction: column; gap: var(--s1-space-2); margin: 0; padding: var(--s1-space-3); border: 1px solid var(--s1-line); border-radius: var(--s1-radius-control); min-width: 0; }
.s1-mny-charge legend, .s1-mny-pay legend { font: 700 var(--s1-text-small)/1.4 var(--s1-font-ui); padding: 0 var(--s1-space-1); }
.s1-mny-pick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s1-space-2); align-items: center; padding: 4px 0; font: 500 var(--s1-text-small)/1.4 var(--s1-font-ui); }
.s1-mny-pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s1-mny-left { color: var(--s1-ink-2); font: 600 var(--s1-text-small)/1.4 var(--s1-font-ui); }
.s1-mny-part { grid-column: 2 / -1; }
.s1-mny-payline { margin: 0; color: var(--s1-ink-2); font-weight: 600; }

@media (max-width: 640px) {
  .s1-mny-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s1-mny-form { max-width: none; grid-template-columns: minmax(0, 1fr); }
  .s1-mny-input { min-height: 44px; font-size: var(--s1-fs-4); }
  .s1-mny-head-actions { width: 100%; }
}

/* Spending categories: a name and its Retired switch on one line, hairlines between, fields no wider than they need. */
[data-mt-cats] { list-style: none; margin: 8px 0 0; padding: 0; max-width: 560px; }
[data-mt-cats] > .s1-mny-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: calc(16px * var(--s1-scale, 1)); padding: calc(8px * var(--s1-scale, 1)) 0; border-bottom: 1px solid var(--s1-line-soft, var(--s1-line)); }
[data-mt-cats] .s1-mny-check { align-items: center; margin: 0; white-space: nowrap; color: var(--s1-ink-2); }
[data-mt-newcat] { max-width: 360px; }
[data-mt-cats] + .s1-mny-field { margin-top: 16px; }
[data-mt-cats] + .s1-mny-field + .s1-mny-actions { margin-top: 12px; }
.s1-mny-totals { gap: calc(24px * var(--s1-scale, 1)); margin-bottom: 12px; }
.s1-mny-totals dd { font-size: var(--s1-fs-6); letter-spacing: -.01em; }

/* Manage > Expenses (round 4): totals with the year and downloads on the same row, one-line activity, categories in two columns. */
.s1t-money .s1-mny-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.s1t-money .s1-mny-top .s1-mny-totals { flex: 1 1 520px; margin: 0; }
.s1t-money .s1-mny-top .s1-mny-actions { flex: none; }
.s1t-money .s1-mny-fy { display: inline-flex; margin: 0; max-width: 160px; }
.s1t-money .s1-mny-fy .s1-mny-input { min-height: 30px; }
.s1t-money .s1-mny-row-sub a { font-weight: 400; color: var(--s1-ink-2); }
.s1t-money .s1-mny-act { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 16px; padding: 6px 0; }
.s1t-money .s1-mny-act .s1-mny-row-title a { font-weight: 400; }
.s1t-money [data-mt-cats] { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.s1t-money [data-mt-cats] > .s1-mny-cat { padding: 4px 0; }
.s1t-money [data-mt-cats] .s1-mny-input { min-height: 32px; }
.s1t-money .s1-mny-addcat { margin-top: 12px; }
.s1t-money .s1-mny-addcat .s1-mny-input { width: 240px; min-height: 32px; }
.s1t-money .k-panel--open { margin-top: 28px; }
.s1t-money .s1-mny-list a { text-decoration: none; color: var(--s1-ink); }
.s1t-money .s1-mny-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.s1t-money .s1-mny-row-sub a { color: var(--s1-ink-2); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .s1t-money .s1-mny-top .s1-mny-actions { flex: 1 1 100%; }
  .s1t-money .s1-mny-row-sub { white-space: normal; }
  .s1t-money [data-mt-cats] { grid-template-columns: minmax(0, 1fr); }
  .s1t-money .s1-mny-act { flex-direction: column; gap: 0; }
  .s1t-money .s1-mny-act .s1-mny-row-title { white-space: normal; }
  .s1t-money .s1-mny-addcat .s1-mny-input { flex: 1 1 100%; width: auto; }
  .s1t-money .s1-mny-top .s1-mny-totals { flex-basis: 100%; }
}
