/* How AI sorts a company's books: a six-slide slideshow. Each slide plays one short animation on entry.
   All sizes inside the stage use cqw (1% of the stage width) so the slides scale as one picture. */

.bx-intro { padding: var(--ltg-space-8) 0 var(--ltg-space-5); }
.bx-intro .lead { margin-top: var(--ltg-space-4); }
.bx-section { padding: var(--ltg-space-5) 0 var(--ltg-space-8); border-bottom: var(--ltg-border); }

.sl { container: sl / inline-size; max-width: var(--ltg-content-width); margin: 0 auto; outline: none; }
.sl-stage {
  position: relative; container-type: inline-size; aspect-ratio: 16 / 9;
  background: var(--ltg-surface); border: var(--ltg-border); border-radius: var(--ltg-radius); overflow: hidden;
}
.sl-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--ltg-space-3); }
.sl-tag {
  font-size: var(--ltg-text-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ltg-slate);
  background: var(--ltg-paper); border: var(--ltg-border); border-radius: 99px; padding: 2px var(--ltg-space-3); white-space: nowrap;
}
.sl-slide { position: absolute; inset: 0; display: none; padding: 3cqw 4.5cqw 2cqw; font-size: 1.95cqw; line-height: 1.3; color: var(--ltg-ink); }
.sl-slide.on { display: block; }
/* If the script has not run (blocked, failed or an old copy), still show the first slide instead of an empty stage */
html:not(.sl-ready) .sl-stage .sl-slide:first-of-type { display: block; }
.sl-big { font-size: 2.3cqw; }
.paper { background: var(--ltg-paper); border: var(--ltg-border); border-radius: .5cqw; padding: 1.4cqw 2cqw; box-shadow: 0 .2cqw 1cqw rgba(27, 42, 58, .06); }

/* ---- animations ---- */
@keyframes sl-up { from { opacity: 0; transform: translateY(1.2cqw); } to { opacity: 1; transform: none; } }
@keyframes sl-pop { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.15); } 100% { opacity: 1; transform: scale(1); } }
@keyframes sl-left { from { opacity: 0; transform: translateX(-2cqw); } to { opacity: 1; transform: none; } }
@keyframes sl-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sl-flash { 0%, 100% { background-color: transparent; } 40% { background-color: rgba(185, 139, 62, .22); } }
.sl-slide.on .ledger-name, .sl-slide.on .lr, .sl-slide.on .pr, .sl-slide.on .in, .sl-slide.on .rule,
.sl-slide.on .col h3, .sl-slide.on .rule-line, .sl-slide.on .col li, .sl-slide.on .tot, .sl-slide.on .eq,
.sl-slide.on .start, .sl-slide.on .card, .sl-slide.on .btns { animation: sl-up .55s var(--d, 0s) both; }
.sl-slide.on .in { animation-name: sl-left; }
.sl-slide.on .q, .sl-slide.on .bubble { animation: sl-pop .5s var(--d, 0s) both; }
.sl-slide.on .lr.flag { animation: sl-up .55s var(--d, 0s) both; }
.sl-slide.on .bar i { animation: sl-grow 1s calc(var(--d, 0s) + .5s) both; transform-origin: 0 50%; }

/* ---- 1: the ledger ---- */
.ledger-name { margin: 0 0 .6cqw; font-family: var(--ltg-font-display); font-weight: 600; font-size: 2.7cqw; }
.lh, .lr { display: grid; grid-template-columns: 3cqw 8.5cqw 1fr 11cqw 13cqw; gap: 1cqw; align-items: center; }
.lh { font-size: 1.35cqw; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ltg-slate); padding-bottom: .6cqw; border-bottom: 1px solid var(--ltg-ink); }
.lh .r, .lr .amt { text-align: right; }
.lr { position: relative; height: 4.5cqw; border-bottom: var(--ltg-border); }
.lr .n, .lr .d, .lr .bk { color: var(--ltg-slate); }
.lr .desc { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr .q {
  position: absolute; right: 1cqw; top: 50%; margin-top: -1.2cqw; width: 2.4cqw; height: 2.4cqw; display: grid; place-items: center;
  font-size: 1.5cqw; font-weight: 700; color: var(--ltg-brass); border: .2cqw solid var(--ltg-brass); border-radius: .5cqw; background: var(--ltg-paper);
}
.lr .bk { padding-right: 3.2cqw; }

/* Slide 1 on larger screens: let the ledger fill the stage instead of floating in it */
@container sl (min-width: 561px) {
  .sl-slide.sl-ledger-slide { padding: 1.8cqw 2.2cqw; font-size: 2.2cqw; }
  .sl-ledger-slide .paper { padding: 1.2cqw 2.2cqw; }
  .sl-ledger-slide .ledger-name { font-size: 3cqw; }
  .sl-ledger-slide .lh { font-size: 1.45cqw; }
  .sl-ledger-slide .lh, .sl-ledger-slide .lr { grid-template-columns: 3.4cqw 9.5cqw 1fr 13cqw 15cqw; }
  .sl-ledger-slide .lr { height: 5cqw; }
  .sl-ledger-slide .lr .q { width: 2.7cqw; height: 2.7cqw; margin-top: -1.35cqw; font-size: 1.7cqw; }
  .sl-ledger-slide .lr .bk { padding-right: 3.6cqw; }
}

/* ---- Slide 1 annotations (wide screens only): highlighter sweep, then three notes beside the ledger ---- */
.l1 { position: relative; height: 100%; }
.rows { position: relative; }
.band, .notes { display: none; }
@keyframes l-shrink { from { transform: none; } }
@keyframes l-sweep { from { transform: scaleY(0); } }
@keyframes l-fade { from { opacity: 0; } }
@keyframes l-note { from { opacity: 0; transform: translateX(1.6cqw); } }
@keyframes l-draw { from { transform: scaleX(0); } }
@keyframes l-outline { from { outline-color: transparent; } }
@container sl (min-width: 561px) {
  .ledger-paper { transform-origin: 0 0; transform: translateY(5.5cqw) scale(.74); }
  .sl-slide.on .ledger-paper { animation: l-shrink .5s 2.9s both; }
  .band { display: block; position: absolute; top: 0; bottom: 0; pointer-events: none; mix-blend-mode: multiply; border-radius: .4cqw; }
  .band::before {
    content: attr(data-n); position: absolute; top: -2.5cqw; right: .3cqw; width: 2.2cqw; height: 2.2cqw; display: grid; place-items: center;
    font: 700 1.4cqw/1 var(--ltg-font-text); color: var(--ltg-ledger-ink); background: var(--ltg-ink); border-radius: 50%; mix-blend-mode: normal;
  }
  .l1 .band1 { left: calc(3.4cqw + 9.5cqw + 2cqw); width: calc(100% - 44.9cqw); background: rgba(255, 226, 90, .6); }
  .l1 .band2 { left: calc(100% - 15cqw); width: 15cqw; background: rgba(255, 170, 90, .5); }
  .sl-slide.on .l1 .band1 { animation: l-sweep .8s 2.1s both; transform-origin: top; }
  .sl-slide.on .l1 .band1::before { animation: l-fade .3s 2.9s both; }
  .sl-slide.on .l1 .band2 { animation: l-fade .4s 3.8s both; }
  .sl-slide.on .l1 .band2::before { animation: l-fade .3s 3.9s both; }
  .lr.flag { outline: .25cqw solid var(--ltg-brass); outline-offset: -.1cqw; }
  .sl-slide.on .lr.flag { animation: sl-up .55s var(--d, 0s) both, l-outline .4s 4.3s both; }
  .notes { display: block; position: absolute; top: 0; right: 0; width: 22.5cqw; height: 100%; }
  .note {
    position: absolute; left: 0; right: 0; margin: 0; padding: 1cqw 1.4cqw; font-size: 1.7cqw; line-height: 1.25; background: var(--ltg-paper);
    border: var(--ltg-border); border-left-width: .6cqw; border-radius: .5cqw; box-shadow: 0 .2cqw 1cqw rgba(27, 42, 58, .06);
  }
  .note b { display: inline-grid; place-items: center; width: 2.2cqw; height: 2.2cqw; margin-right: .6cqw; font-size: 1.4cqw; color: var(--ltg-ledger-ink); background: var(--ltg-ink); border-radius: 50%; }
  .note::before { content: ""; position: absolute; left: -3.2cqw; top: 50%; width: 3.2cqw; height: .22cqw; background: var(--ltg-ink); transform-origin: right center; }
  .note::after { content: ""; position: absolute; left: -3.3cqw; top: 50%; margin-top: -.55cqw; border-right: .9cqw solid var(--ltg-ink); border-top: .6cqw solid transparent; border-bottom: .6cqw solid transparent; }
  .l1 .n1 { top: 6.5cqw; border-left-color: #f0cf2e; }
  .l1 .n2 { top: 15.5cqw; border-left-color: #f09a3e; }
  .l1 .n3 { top: 24.5cqw; border-left-color: var(--ltg-brass); }
  .sl-slide.on .note { animation: l-note .5s var(--d) both; }
  .sl-slide.on .note::before { animation: l-draw .35s calc(var(--d) + .2s) both; }
  .sl-slide.on .note::after { animation: l-fade .15s calc(var(--d) + .5s) both; }
}

/* ---- 2: what I hand the AI ---- */
.handoff { display: grid; grid-template-columns: 24cqw 1fr; gap: 3cqw; align-items: center; height: 100%; padding-bottom: 3cqw; }
.inputs { display: grid; gap: 1.4cqw; }
.inputs .in { margin: 0; padding: 1.3cqw 1.6cqw; background: var(--ltg-paper); border: var(--ltg-border); border-left: .5cqw solid var(--ltg-ledger); border-radius: .4cqw; font-weight: 600; }
.ask { padding: 2.2cqw 2.6cqw; }
.ask-label { margin: 0 0 1cqw; font-size: 1.35cqw; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ltg-slate); }
.ask-text { margin: 0; font-family: var(--ltg-font-display); font-size: 2.6cqw; line-height: 1.35; min-height: 11cqw; }
.ask-text.typing::after { content: ""; display: inline-block; width: .25cqw; height: 2.4cqw; margin-left: .3cqw; background: var(--ltg-ledger); vertical-align: -.3cqw; }
.rule { margin: 1.6cqw 0 0; padding-top: 1.2cqw; border-top: var(--ltg-border); color: var(--ltg-slate); }
.rule b { color: var(--ltg-ink); }

/* ---- 3: what each payee does ---- */
.payees { display: grid; gap: .5cqw; padding-top: .8cqw; }
.pr { display: grid; grid-template-columns: 24cqw 8cqw 1fr; align-items: center; height: 5.3cqw; border-bottom: var(--ltg-border); }
.pr .who { font-weight: 600; letter-spacing: .02em; }
.pr .arr { position: relative; height: .22cqw; background: var(--ltg-ledger); margin: 0 1.2cqw; }
.pr .arr::after { content: ""; position: absolute; right: -.1cqw; top: -.55cqw; border-left: 1cqw solid var(--ltg-ledger); border-top: .66cqw solid transparent; border-bottom: .66cqw solid transparent; }
.pr .role { display: flex; align-items: baseline; gap: 1.2cqw; flex-wrap: wrap; }
.pr .role b { color: var(--ltg-ledger); }
.pr .role i { font-style: normal; font-size: 1.45cqw; color: var(--ltg-slate); }

/* ---- 4: the sort ---- */
.sort { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3cqw; padding-top: .4cqw; }
.col h3 { margin: 0; font-family: var(--ltg-font-display); font-size: 2.9cqw; line-height: 1.15; padding-bottom: .9cqw; border-bottom: .22cqw solid var(--ltg-ink); }
.col h3 small { font-family: var(--ltg-font-text); font-size: 1.6cqw; font-weight: 400; color: var(--ltg-slate); }
.rule-line { margin: .8cqw 0 1cqw; font-size: 1.6cqw; color: var(--ltg-slate); }
.col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7cqw; }
.col li { display: flex; justify-content: space-between; gap: 1cqw; background: var(--ltg-paper); border: var(--ltg-border); border-radius: .4cqw; padding: .8cqw 1.4cqw; }
.col li b { font-variant-numeric: tabular-nums; }
.col.cogs li { border-left: .5cqw solid var(--ltg-ledger); }
.col.ovh li { border-left: .5cqw solid var(--ltg-slate); }
.col li.odd { border: .2cqw dashed var(--ltg-brass); border-left: .5cqw solid var(--ltg-brass); }
.bubble { margin: 1cqw 0 0; padding: .8cqw 1.4cqw; font-size: 1.65cqw; background: rgba(185, 139, 62, .15); border: .15cqw solid var(--ltg-brass); border-radius: .5cqw; }

/* ---- 5: the split ---- */
.split { display: grid; gap: 1.8cqw; padding-top: .6cqw; }
.tot p { margin: 0; color: var(--ltg-slate); font-size: 1.9cqw; }
.tot strong { display: inline-block; font-family: var(--ltg-font-display); font-size: 5.6cqw; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tot.t1 strong { color: var(--ltg-ledger); }
.bar { height: 1.4cqw; background: var(--ltg-rule); border-radius: .3cqw; overflow: hidden; margin-top: .4cqw; }
.bar i { display: block; height: 100%; width: var(--w); background: var(--ltg-ledger); }
.tot.t2 .bar i { background: var(--ltg-slate); }
.eq { margin: .4cqw 0 0; font-size: 2cqw; line-height: 1.5; }
.start { margin: .2cqw 0 0; padding: 1.2cqw 1.8cqw; font-family: var(--ltg-font-display); font-size: 3cqw; font-weight: 600; background: var(--ltg-ledger); color: var(--ltg-ledger-ink); border-radius: .5cqw; }

/* ---- 6: a person decides ---- */
.decide { display: grid; place-items: center; height: 100%; padding-bottom: 3cqw; }
.card { width: 76cqw; padding: 2.4cqw 3cqw; }
.card .line { display: flex; justify-content: space-between; margin: 0; font-size: 2.3cqw; }
.card .move { display: grid; grid-template-columns: auto 5cqw 1fr; align-items: center; margin: 1.4cqw 0; gap: 1cqw; }
.card .from { color: var(--ltg-slate); text-decoration: line-through; }
.card .to { height: .22cqw; background: var(--ltg-ledger); position: relative; }
.card .to::after { content: ""; position: absolute; right: -.1cqw; top: -.5cqw; border-left: .9cqw solid var(--ltg-ledger); border-top: .6cqw solid transparent; border-bottom: .6cqw solid transparent; }
.card .prop { font-weight: 600; color: var(--ltg-ledger); }
.card .evid { margin: 0 0 1.6cqw; color: var(--ltg-slate); font-size: 1.7cqw; }
.card .evid b { color: var(--ltg-ink); }
.btns { display: flex; gap: 1.2cqw; }
.btns button { font: inherit; font-size: 1.8cqw; font-weight: 600; padding: .9cqw 2cqw; border-radius: .4cqw; border: .15cqw solid var(--ltg-ink); background: var(--ltg-paper); color: var(--ltg-ink); cursor: pointer; }
.btns button:first-child { background: var(--ltg-ledger); border-color: var(--ltg-ledger); color: var(--ltg-ledger-ink); }
.btns button:focus-visible, .sl-controls button:focus-visible { outline: 3px solid var(--ltg-brass); outline-offset: 2px; }
.card .result { margin: 1.4cqw 0 0; padding-top: 1.2cqw; border-top: var(--ltg-border); font-size: 1.75cqw; color: var(--ltg-slate); min-height: 2.6em; }


/* ================= Slides 2-6 (the story continues from slide 1) ================= */
@keyframes l-fade-up { from { opacity: 0; transform: translateY(1cqw); } }

/* 2: hand the AI the whole ledger */
.handoff { grid-template-columns: 27cqw 1fr; gap: 5.4cqw; }
.inputs .in { position: relative; display: grid; gap: .3cqw; }
.inputs .in b { font-size: 1.95cqw; }
.inputs .in span { font-size: 1.45cqw; font-weight: 400; color: var(--ltg-slate); }
.inputs .in::after { content: ""; position: absolute; left: 100%; top: 50%; width: 5.4cqw; height: .22cqw; background: var(--ltg-ledger); transform-origin: left center; }
.inputs .in::before { content: ""; position: absolute; left: calc(100% + 4.5cqw); top: 50%; margin-top: -.55cqw; border-left: .9cqw solid var(--ltg-ledger); border-top: .6cqw solid transparent; border-bottom: .6cqw solid transparent; z-index: 1; }
.sl-slide.on .inputs .in::after { animation: l-draw .4s calc(var(--d, 0s) + .35s) both; }
.sl-slide.on .inputs .in::before { animation: l-fade .15s calc(var(--d, 0s) + .7s) both; }

/* 3: every line gets a plain description and a type */
.l3, .l6 { position: relative; height: 100%; }
.typed-paper { padding: 1.2cqw 2.2cqw; }
.typed-paper .ledger-name { font-size: 2.6cqw; margin-bottom: .4cqw; }
.th, .tr { display: grid; grid-template-columns: 1fr 12cqw 14cqw; column-gap: 1.4cqw; align-items: center; }
.th { font-size: 1.4cqw; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ltg-slate); padding-bottom: .5cqw; border-bottom: 1px solid var(--ltg-ink); }
.th .r, .tr .amt { text-align: right; }
.tr { height: 4.1cqw; border-bottom: var(--ltg-border); font-size: 1.9cqw; }
.tr .what { display: flex; align-items: baseline; gap: 1.2cqw; min-width: 0; white-space: nowrap; }
.tr .what b { font-weight: 600; }
.tr .what i { font-style: normal; font-size: 1.3cqw; color: var(--ltg-slate); overflow: hidden; text-overflow: ellipsis; }
.chip { justify-self: start; font-size: 1.3cqw; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .35cqw 1.1cqw; border-radius: 99px; border: .18cqw solid; white-space: nowrap; }
.c-in { background: var(--ltg-ledger); color: var(--ltg-ledger-ink); border-color: var(--ltg-ledger); }
.c-cogs { color: var(--ltg-ledger); border-color: var(--ltg-ledger); }
.c-ovh { color: var(--ltg-slate); border-color: var(--ltg-slate); }
.sl-slide.on .tr { animation: sl-up .5s var(--d, 0s) both; }
.sl-slide.on .chip { animation: sl-pop .45s var(--d, 0s) both; }

/* 4: the sort. The flagged payment gets an arrow from its note */
.bubble { position: relative; margin-top: 2.6cqw; }
.bubble::before { content: ""; position: absolute; left: 4cqw; top: -2.6cqw; width: .22cqw; height: 2.6cqw; background: var(--ltg-brass); }
.bubble::after { content: ""; position: absolute; left: calc(4cqw - .5cqw); top: -3.1cqw; border-bottom: .9cqw solid var(--ltg-brass); border-left: .6cqw solid transparent; border-right: .6cqw solid transparent; }

/* 5: revenue to what is left */
.bridge { display: grid; gap: 1.1cqw; padding-top: .6cqw; }
.rev { display: flex; align-items: baseline; gap: 1.6cqw; font-size: 2.2cqw; color: var(--ltg-slate); }
.rev b { font-family: var(--ltg-font-display); font-size: 4.6cqw; color: var(--ltg-ink); font-variant-numeric: tabular-nums; }
.rev-brk { height: 1.3cqw; border: .22cqw solid var(--ltg-ink); border-bottom: 0; }
.labels { display: flex; }
.lb { position: relative; padding: 0 1cqw 2.6cqw; font-size: 1.85cqw; line-height: 1.2; text-align: center; display: flex; align-items: flex-end; justify-content: center; }
.l-cogs { width: 34.5%; } .l-ovh { width: 26.5%; } .l-left { width: 39%; }
.lb::before { content: ""; position: absolute; left: 50%; bottom: .2cqw; width: .22cqw; height: 2cqw; background: var(--ltg-ink); }
.lb::after { content: ""; position: absolute; left: calc(50% - .5cqw); bottom: -.5cqw; border-top: .9cqw solid var(--ltg-ink); border-left: .6cqw solid transparent; border-right: .6cqw solid transparent; }
.stack { display: flex; height: 8cqw; border-radius: .5cqw; overflow: hidden; }
.seg { display: grid; place-items: center; font-family: var(--ltg-font-display); font-size: 3.2cqw; color: var(--ltg-ledger-ink); transform-origin: left center; }
.seg b { font-weight: 600; font-variant-numeric: tabular-nums; }
.s-cogs { width: 34.5%; background: var(--ltg-ledger); } .s-ovh { width: 26.5%; background: var(--ltg-slate); } .s-left { width: 39%; background: var(--ltg-brass); }
.gp { margin: .2cqw 0 0 34.5%; width: 65.5%; height: 1.3cqw; border: .22cqw solid var(--ltg-ink); border-top: 0; }
.gp-text { margin: 0 0 .6cqw 34.5%; width: 65.5%; text-align: center; font-size: 2.2cqw; color: var(--ltg-slate); }
.gp-text b { font-family: var(--ltg-font-display); font-size: 3cqw; color: var(--ltg-ink); font-variant-numeric: tabular-nums; }
.sl-slide.on .rev, .sl-slide.on .rev-brk, .sl-slide.on .lb, .sl-slide.on .gp, .sl-slide.on .gp-text { animation: l-fade-up .5s var(--d, 0s) both; }
.sl-slide.on .seg { animation: sl-grow .7s var(--d, 0s) both; }

/* 6: you decide */
.l6 { padding-top: 7cqw; }
.l6 .card { width: 60cqw; padding: 2cqw 2.6cqw; }
.l6 .card .line { font-size: 2.3cqw; }
.l6 .card .move { grid-template-columns: auto 4cqw 1fr; }
@container sl (min-width: 561px) {
  /* slide 3: the table slides left to make room for the notes, like slide 1 */
  .typed-paper { transform-origin: 0 0; transform: translateY(7cqw) scale(.74); }
  .sl-slide.on .typed-paper { animation: l-shrink .5s 3.6s both; }
  .band-what { left: 0; width: calc(100% - 12cqw - 14cqw - 2.8cqw); background: rgba(255, 226, 90, .6); }
  .band-type { left: calc(100% - 14cqw); width: 14cqw; background: rgba(255, 170, 90, .45); }
  .sl-slide.on .band-what { animation: l-sweep .8s 1.6s both; transform-origin: top; }
  .sl-slide.on .band-what::before { animation: l-fade .3s 2.4s both; }
  .sl-slide.on .band-type { animation: l-fade .4s 3.9s both; }
  .sl-slide.on .band-type::before { animation: l-fade .3s 4s both; }
  .l3 .n1 { top: 11cqw; border-left-color: #f0cf2e; }
  .l3 .n2 { top: 22cqw; border-left-color: #f09a3e; }
  /* slide 6: notes sit beside the card */
  .l6 .notes { width: 27cqw; }
  .l6 .note::before { left: -4cqw; width: 4cqw; }
  .l6 .note::after { left: -4.1cqw; }
  .l6 .n1 { top: 17.5cqw; border-left-color: #f0cf2e; }
  .l6 .n2 { top: 26cqw; border-left-color: #f09a3e; }
}

/* ---- caption and controls ---- */
.sl-caption { margin-top: var(--ltg-space-4); min-height: 7.2em; }
.sl-text:empty { display: none; }
.sl-count { margin: 0; font-size: var(--ltg-text-sm); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ltg-brass); }
.sl-title { font-size: var(--ltg-text-xl); margin: var(--ltg-space-1) 0 var(--ltg-space-2); }
.sl-text { margin: 0; max-width: 60ch; color: var(--ltg-slate); font-size: var(--ltg-text-base); }
.sl-controls { display: flex; align-items: center; gap: var(--ltg-space-3); flex-wrap: wrap; margin-top: var(--ltg-space-4); }
.sl-controls button { font: inherit; font-size: var(--ltg-text-sm); font-weight: 600; min-height: 44px; padding: 0 var(--ltg-space-4); border: 1px solid var(--ltg-ink); border-radius: var(--ltg-radius); background: var(--ltg-paper); color: var(--ltg-ink); cursor: pointer; }
.sl-controls .sl-next { background: var(--ltg-ledger); border-color: var(--ltg-ledger); color: var(--ltg-ledger-ink); margin-left: auto; }
.sl-controls button:disabled { opacity: .4; cursor: default; }
.sl-controls .sl-replay { border-color: var(--ltg-rule); color: var(--ltg-slate); }
.sl-dots { display: flex; gap: var(--ltg-space-2); margin: 0 auto 0 var(--ltg-space-3); }
.sl-controls .sl-dots button {
  width: 40px; min-height: 40px; padding: 0; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--ltg-slate); background: var(--ltg-paper); color: var(--ltg-slate); font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.sl-controls .sl-dots button:hover { border-color: var(--ltg-ledger); color: var(--ltg-ledger); transform: translateY(-1px); }
.sl-controls .sl-dots button[aria-current="true"] { background: var(--ltg-ledger); border-color: var(--ltg-ledger); color: var(--ltg-ledger-ink); }
.sl-controls button:not(:disabled) { cursor: pointer; }
.sl-controls .sl-back:not(:disabled):hover, .sl-controls .sl-replay:hover { border-color: var(--ltg-ledger); color: var(--ltg-ledger); }
.sl-controls .sl-next:not(:disabled):hover { filter: brightness(1.1); }
.sl-hint { margin-top: var(--ltg-space-2); }

/* ---- the numbered list under the slideshow ---- */
.bx-how { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ltg-space-5); max-width: var(--ltg-text-width); }
.bx-how li { display: grid; grid-template-columns: 40px 1fr; gap: var(--ltg-space-4); }
.bx-how .n { font-family: var(--ltg-font-display); font-weight: 600; color: var(--ltg-brass); font-size: var(--ltg-text-xl); line-height: 1.2; }
.bx-how h3 { font-size: var(--ltg-text-lg); margin-bottom: var(--ltg-space-1); }
.bx-how p { margin: 0; color: var(--ltg-slate); }

/* ---- Phone layout: when the slideshow is under 560px wide, use a taller stage and larger type ---- */
@container sl (max-width: 560px) {
  .sl-stage { aspect-ratio: 5 / 7; }
  .sl-slide { font-size: 4.2cqw; padding: 5cqw 5cqw 4cqw; }
  .sl-big { font-size: 4.5cqw; }
  .paper { padding: 3cqw 3.5cqw; border-radius: 1.2cqw; }

  .ledger-name { font-size: 5.6cqw; margin-bottom: 1.6cqw; }
  .lh, .lr { grid-template-columns: 1fr auto; column-gap: 3cqw; row-gap: .4cqw; }
  .lh span:nth-child(1), .lh span:nth-child(2), .lh span:nth-child(5), .lr .n, .lr .d { display: none; }
  .lh { font-size: 2.7cqw; padding-bottom: 1.6cqw; }
  .lr { height: auto; padding: .9cqw 0; font-size: 3.6cqw; }
  .lr .desc { white-space: normal; line-height: 1.15; }
  .lr .bk { padding: 0; font-size: 3cqw; }
  .lr .q { position: static; margin: 0; justify-self: end; align-self: center; width: 5cqw; height: 5cqw; font-size: 3.2cqw; border-radius: 1.2cqw; }

  .handoff { grid-template-columns: 1fr; gap: 4cqw; align-items: start; padding-bottom: 0; height: auto; }
  .inputs { grid-template-columns: 1fr 1fr 1fr; gap: 2cqw; }
  .inputs .in { padding: 2.2cqw 2.4cqw; font-size: 3.4cqw; border-left-width: 1.2cqw; }
  .ask { padding: 4cqw; }
  .ask-label { font-size: 2.8cqw; margin-bottom: 2cqw; }
  .ask-text { font-size: 5.4cqw; min-height: 38cqw; }
  .ask-text.typing::after { height: 5cqw; width: .6cqw; vertical-align: -.8cqw; }
  .rule { margin-top: 3cqw; padding-top: 2.4cqw; font-size: 3.9cqw; }

  .payees { gap: 0; padding-top: 0; }
  .pr { grid-template-columns: 1fr; height: auto; padding: 2.2cqw 0; }
  .pr .arr { display: none; }
  .pr .who { font-size: 3.7cqw; }
  .pr .role { gap: 2cqw; }
  .pr .role b { font-size: 4.2cqw; }
  .pr .role i { font-size: 3.1cqw; }

  .sort { grid-template-columns: 1fr; gap: 2.6cqw; padding-top: 0; }
  .col h3 { font-size: 5.2cqw; padding-bottom: 1.2cqw; border-bottom-width: .5cqw; }
  .col h3 small { font-size: 3.2cqw; }
  .rule-line { font-size: 3.2cqw; margin: 1cqw 0 1.4cqw; }
  .col ul { gap: 1.4cqw; }
  .col li { padding: 1.1cqw 2.6cqw; border-radius: 1cqw; font-size: 3.7cqw; }
  .col.cogs li, .col.ovh li, .col li.odd { border-left-width: 1.2cqw; }
  .bubble { font-size: 3.3cqw; padding: 1.4cqw 2.6cqw; margin-top: 1.4cqw; border-radius: 1cqw; }

  .split { gap: 4cqw; }
  .tot p { font-size: 4cqw; }
  .tot strong { font-size: 11.5cqw; }
  .bar { height: 3cqw; border-radius: .8cqw; }
  .eq { font-size: 4cqw; }
  .start { font-size: 5.8cqw; padding: 3cqw 3.6cqw; border-radius: 1.2cqw; }

  .decide { place-items: start center; padding-bottom: 0; }
  .card { width: 100%; padding: 4.4cqw; }
  .card .line { font-size: 4.9cqw; }
  .card .move { grid-template-columns: 1fr; gap: 1.4cqw; margin: 3cqw 0; }
  .card .to { display: none; }
  .card .from { font-size: 3.7cqw; }
  .card .prop { font-size: 4.2cqw; }
  .card .evid { font-size: 3.6cqw; margin-bottom: 3.4cqw; }
  .btns { flex-wrap: wrap; gap: 2.4cqw; }
  .btns button { font-size: 3.8cqw; padding: 2.2cqw 4cqw; border-radius: 1cqw; }
  .card .result { font-size: 3.7cqw; margin-top: 3cqw; padding-top: 2.4cqw; }

  .sl-caption { min-height: 0; }
  .sl-back { order: 0; }
  .sl-controls .sl-replay { order: 1; }
  .sl-next { order: 2; }
  .sl-dots { order: 3; width: 100%; margin: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .sl-slide *, .sl-slide.on * { animation: none !important; }
}

/* Embedded in the home page: show only the slideshow */
html.embed .site-header, html.embed .skip-link, html.embed .bx-intro, html.embed main > section:not(.bx-section), html.embed .site-footer { display: none !important; }
html.embed body { background: transparent; }
html.embed .bx-section { padding: 0; border: 0; }
html.embed .bx-section .wrap { padding-inline: 0; }
html.embed .sl-hint { display: none; }
/* In the embed the home page already draws a card, so the stage does not need a second box */
html.embed .sl-stage { border: 0; background: transparent; border-radius: 0; }
/* Padding around the embedded slideshow so the stage, caption and buttons do not touch the frame edge */
html.embed .sl { padding: var(--ltg-space-4); }
@media (max-width: 560px) { html.embed .sl { padding: var(--ltg-space-3); } }
