/* Account-type colours. One hue per type, identical in every mode and every world, so a colour always means the
   same kind of account. Loaded after the world themes on purpose: worlds change the surface a tint is mixed into
   (via --sheet and --ink), never the hue itself. */
:root {
  --t-asset: #3D7FE0;      /* blue: what the business owns */
  --t-contra: #7B93B8;     /* slate blue, striped: counts against an asset (accumulated depreciation) */
  --t-expense: #E8782E;    /* orange: costs */
  --t-drawings: #D9558F;   /* pink: money the owner takes out */
  --t-liability: #9B62E0;  /* purple: what the business owes */
  --t-equity: #17A2A0;     /* teal: the owner's capital */
  --t-income: #3BAA4B;     /* green: money earned */
}
[data-type="asset"] { --tc: var(--t-asset); }
[data-type="contra"] { --tc: var(--t-contra); }
[data-type="expense"] { --tc: var(--t-expense); }
[data-type="drawings"] { --tc: var(--t-drawings); }
[data-type="liability"] { --tc: var(--t-liability); }
[data-type="equity"] { --tc: var(--t-equity); }
[data-type="income"] { --tc: var(--t-income); }

/* Swatches: in ledgers, journal lines, explanations and the colour key */
.sw { display: inline-block; flex: none; width: .72em; height: .72em; margin-right: .45em; border-radius: 3px; vertical-align: -.02em;
  background: var(--tc) !important; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.sw[data-type="contra"], [data-type="contra"] > .sw, [data-type="contra"] .grp-label .sw {
  background: repeating-linear-gradient(45deg, var(--tc) 0 2px, transparent 2px 4px) !important; box-shadow: inset 0 0 0 1.5px var(--tc); }
.colour-key { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; }
.colour-key .ck { display: inline-flex; align-items: center; font-weight: 600; color: color-mix(in srgb, var(--tc) 70%, var(--ink)); }

/* Tray: group labels and account chips */
.grp-label { display: flex; align-items: center; color: color-mix(in srgb, var(--tc) 72%, var(--ink)) !important; }
.grp[data-type] .grp-label .sw { background: var(--tc) !important; }
body .acc[data-type] {
  border-left: 5px solid var(--tc) !important;
  background: color-mix(in srgb, var(--tc) 13%, var(--sheet)) !important;
}
body .acc[data-type]:hover:not(:disabled) { background: color-mix(in srgb, var(--tc) 24%, var(--sheet)) !important; }
body .acc[data-type="contra"] { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--tc) 16%, var(--sheet)) 0 6px, color-mix(in srgb, var(--tc) 8%, var(--sheet)) 6px 12px) !important; }

/* Cards on the T (and worked examples): stripe and tint by type; right and wrong shown by outline and ✓ / ✗ */
body .placed[data-type] {
  border-left: 6px solid var(--tc) !important;
  border-color: color-mix(in srgb, var(--tc) 50%, var(--rule));
  background: color-mix(in srgb, var(--tc) 14%, var(--sheet)) !important;
}
body .placed[data-type] .pl-name { color: var(--ink) !important; }
body .placed[data-type].ok { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
body .placed[data-type].no { border-color: var(--bad); background: var(--bad-wash) !important; }
body .placed[data-type].no .pl-name { color: var(--bad) !important; }

/* New accounts in a chapter briefing */
body .new-acc[data-type] { border-left: 5px solid var(--tc) !important; background: color-mix(in srgb, var(--tc) 12%, var(--sheet)) !important; }

/* Ledgers */
.acc-cell { white-space: nowrap; }
.type-tag { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .04em; padding: 3px 7px; border-radius: 3px;
  color: color-mix(in srgb, var(--tc) 75%, var(--ink)); background: color-mix(in srgb, var(--tc) 14%, transparent); }
tr[data-type] { --tc-row: var(--tc); }

/* Debit and credit are positions (left, right), not colours: keep side labels neutral so they never read as a type */
.t-lbl.dr, .t-lbl.cr { color: var(--ink) !important; }
.t-lbl span { opacity: .55; }
.acc-tag.dr, .acc-tag.cr { background: var(--ink) !important; color: var(--sheet) !important; }
.up-dr, .up-cr { color: var(--ink) !important; font-weight: 700; }
.slot.next.dr, .slot.next.cr { border-color: var(--ledger) !important; color: var(--ink) !important; background: color-mix(in srgb, var(--ledger) 8%, transparent) !important; }
.entry-line .ln { display: inline-flex; align-items: center; }
.why .k { color: inherit !important; display: inline-flex; align-items: center; }
