/* Money (◇ Money · Concept 472:9785): its lists' columns, round marks with logos, fact tokens, and a transaction or an
   account in the side card, its sunk fact cards and its footer of two acts. Every value is a token of
   clients/tokens/tokens.css; the shell, rows, bands, pills and keys are styles.css's own. */

/* ---- marks: round, 18 / 28 / 32 / 56, a logo inset at 62 % on the sunk ground laid over the card's own, so marks
   never show through each other; a pair's badge (15, 22 on the hero) at the foot right, ringed 2 in the card colour. */
.m-mark {
  --m-size: var(--size-28);
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--m-size);
  height: var(--m-size);
  border-radius: var(--radius-full);
  background: linear-gradient(var(--bg-sunk), var(--bg-sunk)), var(--bg-card);
  color: var(--text-primary);
  overflow: hidden;
  isolation: isolate;
}
.m-mark.s15 { --m-size: calc(var(--size-16) - 1px); }
.m-mark.s18 { --m-size: calc(var(--size-16) + var(--space-2)); }
.m-mark.s22 { --m-size: var(--size-22); }
.m-mark.s32 { --m-size: var(--size-32); }
.m-mark.s56 { --m-size: calc(2 * var(--size-28)); }
.m-mark img { width: 62%; height: 62%; object-fit: contain; border-radius: var(--radius-5); mix-blend-mode: multiply; }
/* In Dark a logo drawn on white keeps its white as a small tile, as an app icon does. */
[data-theme="dark"] .m-mark img { mix-blend-mode: normal; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .m-mark img { mix-blend-mode: normal; } }
.m-mark-text { font: var(--type-initials-s); letter-spacing: var(--type-initials-s-tracking); }
.m-mark-text.sign { font: var(--type-value-strong); }
.m-mark.s15 .m-mark-text, .m-mark.s18 .m-mark-text { font: var(--type-initials-s); }
.m-mark.s32 .m-mark-text { font: var(--type-initials-m); }
.m-mark.s32 .m-mark-text.sign { font: var(--type-body-strong); }
.m-mark.s56 .m-mark-text { font: var(--type-body-strong); }
.m-mark.s56 .m-mark-text.sign { font: var(--type-title); }
.m-mark.s56.logo img { width: 58%; height: 58%; }

.m-pair { position: relative; flex: none; display: inline-grid; }
.m-pair.s28 { width: var(--size-28); height: var(--size-28); }
.m-pair.s56 { width: calc(2 * var(--size-28)); height: calc(2 * var(--size-28)); }
.m-badge { position: absolute; right: calc(-1 * var(--space-3)); bottom: calc(-1 * var(--space-3)); box-shadow: 0 0 0 var(--space-2) var(--bg-card); }
.m-pair.s56 .m-badge { right: calc(-1 * var(--space-2)); bottom: calc(-1 * var(--space-2)); }

/* Faces at the sizes Money draws them. */
.m-face.s18 { width: calc(var(--size-16) + var(--space-2)); height: calc(var(--size-16) + var(--space-2)); font: var(--type-initials-s); }
.m-face.s22 { width: var(--size-22); height: var(--size-22); font: var(--type-initials-s); }
.m-face.s28 { width: var(--size-28); height: var(--size-28); font: var(--type-initials-m); }
.m-c-owners .m-face { box-shadow: 0 0 0 var(--space-2) var(--bg-card); }
.m-c-owners .m-face + .m-face { margin-left: calc(-1 * var(--space-6)); }

/* ---- figures: ink, the unit faint; quiet for money that only moves, the whole in secondary ------------------------ */
.m-amount { display: inline-flex; align-items: baseline; gap: var(--space-4); white-space: nowrap; font: var(--type-value); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.m-unit { color: var(--text-faint); }
.m-amount.quiet, .m-amount.quiet .m-unit { color: var(--text-secondary); }
.m-amount.stat { font: var(--type-page-title); gap: var(--space-5); }
.m-amount.hero { font: var(--type-hero); letter-spacing: var(--type-hero-tracking); gap: var(--space-6); }
.m-amount.hero .m-unit { color: var(--text-faint); }
.m-amount.hero.quiet .m-figure { color: var(--text-secondary); }
.m-gain { font: var(--type-label); color: var(--signal-positive); white-space: nowrap; }

/* ---- the lists' columns: Name fills; Category 190, Paid from 210, Amount 140; the accounts' seven ------------------ */
.m-table .name { gap: var(--space-10); }
.m-table .row .name { padding-left: var(--space-12); padding-right: var(--space-12); }
.m-table .head .name { padding-left: var(--space-16); }
.m-c-cat { width: calc(var(--size-column-m) + var(--space-40)); }
.m-c-from { width: calc(var(--size-column-l) + var(--space-10)); }
.m-c-amt { width: calc(var(--size-column-s) + var(--space-10)); }
.m-c-owners { width: calc(var(--size-column-xs) + var(--space-10)); padding-left: var(--space-12); }
.m-c-updated { width: calc(var(--size-column-l) + var(--space-10)); }
.m-c-spark { width: var(--size-column-m); color: var(--text-primary); }
.m-c-balance { width: var(--size-column-s); }
.m-c-share { width: calc(var(--size-column-xs) - var(--space-24)); }
.m-c-mine { width: calc(var(--size-column-s) + var(--space-20)); }
.m-row { cursor: pointer; }
.m-row .row-name { flex: none; }
.m-split { flex: none; color: var(--text-faint); margin-left: calc(-1 * var(--space-4)); }
.m-when { font: var(--type-value); color: var(--text-primary); }
.m-spark { display: block; width: calc(var(--size-column-s) - var(--space-10)); height: var(--size-16); overflow: visible; }

/* Fact tokens after a name: 22 high blocks on the sunk ground, radius 6, a grey label, the value in ink, a faint unit. */
.m-tokens { display: flex; align-items: center; gap: var(--space-6); min-width: 0; overflow: hidden; }
.m-token { display: inline-flex; align-items: center; gap: var(--space-4); flex: none; height: var(--size-22); padding: 0 var(--space-6); border-radius: var(--radius-6); background: var(--bg-sunk); font: var(--type-value); white-space: nowrap; }
.m-token-label { font: var(--type-label); color: var(--text-secondary); }
.m-token-value { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.m-token-unit { color: var(--text-faint); }
.m-token-next { color: var(--text-faint); margin: 0 var(--space-2); }

/* A category, an account or a person: full-round pills of the sunk ground, glyph 14 in secondary. */
.m-pill, .m-person { display: inline-flex; align-items: center; gap: var(--space-6); height: var(--size-24); padding: 0 var(--space-10) 0 var(--space-8); border-radius: var(--radius-full); background: var(--bg-sunk); font: var(--type-value); color: var(--text-primary); white-space: nowrap; }
.m-pill-glyph { color: var(--text-secondary); }
.m-person { padding-left: var(--space-3); }
.m-account { display: inline-flex; align-items: center; gap: var(--space-8); min-width: 0; font: var(--type-value); color: var(--text-primary); white-space: nowrap; }
.m-account.on-card { height: var(--size-24); padding: 0 var(--space-10) 0 var(--space-3); border-radius: var(--radius-full); background: var(--bg-card); gap: var(--space-6); }
.m-table .waits { padding-top: var(--space-3); padding-bottom: var(--space-3); }

/* The accounts' total under the last group. */
.m-total { display: flex; align-items: center; justify-content: space-between; height: var(--size-44); margin-top: var(--space-16); padding: 0 var(--space-12); }
.m-total-name { font: var(--type-body-strong); color: var(--text-primary); }
.m-total .m-amount { font: var(--type-value-strong); }

/* With the side card beside it the list keeps its columns: the tokens give way first, then the quieter columns. */
@container (max-width: 1280px) {
  .m-accounts .m-c-spark, .m-accounts .m-c-share { display: none; }
}
@container (max-width: 1080px) {
  .m-transactions .row .m-tokens { display: none; }
  .m-accounts .row-number { display: none; }
}
@container (max-width: 860px) {
  .m-accounts .m-c-owners { display: none; }
  .m-transactions .m-c-cat { width: var(--size-column-m); }
  .m-transactions .m-c-from { width: calc(var(--size-column-m) + var(--space-20)); }
  .m-transactions .m-c-amt { width: var(--size-column-xs); }
}

/* ---- the side card: a head with the name and ×, a body that scrolls, and the footer edge to edge at its foot -------- */
.side-card.money-card { padding: 0; overflow: hidden; }
.m-side-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); height: var(--size-52); padding: 0 var(--space-12) 0 var(--space-20); }
.m-side-name { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--type-body-strong); color: var(--text-primary); }
.m-side-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-8) var(--space-20) var(--space-24); }
.m-side-body::-webkit-scrollbar { display: none; }
.m-side-foot { flex: none; display: flex; align-items: center; height: calc(2 * var(--size-28)); border-top: var(--panel-edge) solid var(--line-hair); background: var(--bg-card); }
.m-foot-act { flex: 1; height: 100%; font: var(--type-body-strong); color: var(--text-primary); }
.m-foot-act:hover { background: var(--bg-row-hover); }
.m-foot-rule { flex: none; width: 1px; height: var(--size-20); background: var(--line-hair); }

/* The hero: the mark 56, the amount in Hero, the day in Label secondary, then its pills. */
.m-hero { display: flex; flex-direction: column; align-items: center; gap: var(--space-8); padding: var(--space-4) 0 var(--space-4); text-align: center; }
.m-hero > .m-amount.hero { margin-top: var(--space-6); }
.m-hero-line { display: flex; align-items: center; gap: var(--space-10); margin-top: var(--space-6); }
.m-hero-next { color: var(--text-faint); }
.m-hero-when { font: var(--type-label); color: var(--text-secondary); }
.m-hero-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-6); margin-top: var(--space-4); }

/* A fact card: sunk, radius 16, 16 inside; its head, then stats side by side, then label-and-value lines. */
.m-card { display: flex; flex-direction: column; gap: var(--space-14); padding: var(--space-16); border-radius: var(--radius-16); background: var(--bg-sunk); }
.m-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); }
.m-card-name { font: var(--type-value-strong); color: var(--text-primary); white-space: nowrap; }
.m-card-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: var(--type-label); color: var(--text-secondary); white-space: nowrap; }
.m-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-16); }
.m-stat { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.m-stat-label { display: flex; align-items: center; gap: var(--space-6); font: var(--type-label); color: var(--text-secondary); }
.m-stat-value { display: flex; align-items: baseline; gap: var(--space-8); }
.m-lines { display: flex; flex-direction: column; gap: var(--space-14); }
.m-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); min-height: var(--size-16); }
.m-line-label { font: var(--type-value); color: var(--text-secondary); white-space: nowrap; }
.m-line-value { display: flex; align-items: baseline; gap: var(--space-8); min-width: 0; font: var(--type-value); color: var(--text-primary); }
.m-line-value .m-account, .m-line-value .m-person, .m-line-value .waits { align-self: center; }
.m-dot { flex: none; width: var(--size-dot); height: var(--size-dot); border-radius: var(--radius-full); }
.m-dot.ink, .m-bar-part.ink { background: var(--text-primary); }
.m-dot.faint, .m-bar-part.faint { background: var(--text-faint); }

/* The loan's bar: principal in ink against interest faint, a 2 gap between. */
.m-bar { display: flex; gap: var(--space-2); height: var(--size-dot); }
.m-bar-part { flex-basis: 0; border-radius: var(--radius-split-bar); }

/* The flow: two legs, a 32 disc, name and sub line, the figure at the right; a 2 line under the first disc. */
.m-flow { gap: var(--space-14); }
.m-leg { position: relative; display: flex; align-items: center; gap: var(--space-12); }
.m-leg-disc { position: relative; flex: none; }
.m-leg.first .m-leg-disc::after { content: ""; position: absolute; left: calc(50% - 1px); top: calc(100% + var(--space-3)); width: var(--space-2); height: var(--space-8); border-radius: var(--radius-full); background: var(--bg-sunk-strong); }
.m-leg-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.m-leg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--type-value-strong); color: var(--text-primary); }
.m-leg-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--type-label); color: var(--text-secondary); }
.m-leg-sub.m-waits { display: flex; align-items: center; gap: var(--space-6); color: var(--signal-waiting); }
.m-leg-sub.m-waits::before { content: ""; flex: none; width: var(--size-dot); height: var(--size-dot); border-radius: var(--radius-full); background: var(--signal-waiting); }

/* A split's people and an account's latest transactions. */
.m-people, .m-latest { display: flex; flex-direction: column; gap: var(--space-12); }
.m-person-line { display: flex; align-items: center; gap: var(--space-12); }
.m-latest { gap: var(--space-2); margin: 0 calc(-1 * var(--space-8)); }
.m-latest-row { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-6) var(--space-8); border-radius: var(--radius-10); text-align: left; }
.m-latest-row:hover { background: var(--bg-row-hover); }

/* The receipt, shown as a small paper: the card colour, radius 6, a hairline and a soft shadow, centred. */
.m-receipt { align-self: center; display: flex; flex-direction: column; gap: var(--space-10); width: calc(var(--size-column-l) + var(--space-40)); padding: var(--space-14) var(--space-16) var(--space-12); border: var(--panel-edge) solid var(--line-hair); border-radius: var(--radius-6); background: var(--bg-card); box-shadow: var(--effect-soft-raised); font: var(--type-label); color: var(--text-primary); }
.m-receipt-head { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); color: var(--text-secondary); text-align: center; }
.m-receipt-name { font: var(--type-value-strong); letter-spacing: var(--space-2); color: var(--text-primary); }
.m-receipt-lines { display: flex; flex-direction: column; gap: var(--space-4); }
.m-receipt-line { display: flex; justify-content: space-between; gap: var(--space-12); font-variant-numeric: tabular-nums; }
.m-receipt-total { font: var(--type-value-strong); }
.m-receipt-foot { color: var(--text-secondary); text-align: center; }

/* What waits on you in a heading's count: amber on its tint. */
.tab .tab-count.m-waits-count, .tab[aria-current="true"] .tab-count.m-waits-count { background: var(--signal-waiting-tint); color: var(--signal-waiting); }

/* ---- Ask about a transaction: Joey as a layer of the side card -------------------------------------------------------
   The head with ‹, Joey's orb and name and ×; the subject chip under it; the conversation at the foot, newest last; the
   Ask at the very bottom. */
.m-ask-head { justify-content: flex-start; gap: var(--space-8); padding-left: var(--space-12); }
.m-ask-head .spacer { flex: 1; }
.m-ask-subject { flex: none; padding: 0 var(--space-20) var(--space-8); }
.m-subject { display: inline-flex; align-items: center; gap: var(--space-8); max-width: 100%; height: var(--size-32); padding: 0 var(--space-10) 0 var(--space-6); border-radius: var(--radius-full); background: var(--bg-sunk); font: var(--type-value-strong); color: var(--text-primary); white-space: nowrap; }
.m-subject:hover { background: var(--bg-sunk-strong); }
.m-subject-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.m-subject .m-amount { font: var(--type-value); }
.m-subject-next { color: var(--text-faint); }
.m-ask-body { padding-bottom: 0; }
.m-conversation { display: flex; flex-direction: column; gap: var(--space-20); margin-top: auto; padding-top: var(--space-16); }
.m-you { display: flex; justify-content: flex-end; }
.m-joey { display: flex; align-items: flex-start; gap: var(--space-12); }
.m-joey .joey-small-orb { margin-top: var(--space-2); }
.m-ask-foot { flex: none; padding: var(--space-16) var(--space-12) var(--space-12); }

/* Proposed changes: the card's head, each change as its label, the value it leaves struck through and the one it takes,
   then Refuse and Accept as two equal buttons 8 apart. */
.m-proposal { gap: var(--space-12); }
.m-proposal-head { display: flex; align-items: baseline; gap: var(--space-8); }
.m-change { display: flex; flex-direction: column; gap: var(--space-2); }
.m-change-label { font: var(--type-label); color: var(--text-secondary); }
.m-change-before { font: var(--type-value); color: var(--text-secondary); text-decoration-color: var(--text-secondary); }
.m-change-after { font: var(--type-value); color: var(--text-primary); }
.m-proposal-acts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); margin-top: var(--space-4); }
.m-button { height: var(--size-32); border-radius: var(--radius-10); font: var(--type-button); white-space: nowrap; }
.m-button.secondary { border: 1px solid var(--line-hair); background: var(--bg-card); box-shadow: var(--effect-soft-raised); color: var(--text-primary); }
.m-button.secondary:hover { background: var(--bg-row-hover); }
.m-button.primary { background: var(--button-primary); color: var(--button-on-primary); }
.m-button.primary:hover { background: var(--button-primary-hover); }

/* The toast after a change: one pill holding the words and Undo at its right. */
.toast.m-toast { border-radius: var(--radius-full); padding-left: var(--space-16); }
.toast.m-toast .toast-undo { border-radius: var(--radius-full); }
