/* THE ACCOUNTING LEDGER (ledger.js, 20 Nov 2026): a leather-bound account book over the whole screen.
   Linen pages ruled in faint blue with a red double margin, figures in ink (jade for black ink, oxblood for
   red), a stitched gutter, pages that turn. The window never scrolls: each page scrolls inside itself.
   21 Nov 2026: pages are a faded persona WALL underneath and a two-column SCROLL on top; pictures are big. */
.ldg {
  --ink: #2a170e; --sepia: #6b452d; --oxblood: #8a2219; --jade: #1f5c46; --gilt: #a8772c; --linen: #f1e3c5;
  --rule-blue: #6f8fa833; --rule-red: #b0302a80;
  --kw: clamp(8.5rem, 13vw, 12.5rem); --ko: calc(var(--kw) * .72);   /* the bookkeeper's width, and how far she stands over the page */
  --bar-tick: var(--brass-hi); --bar-held: color-mix(in srgb, var(--deck-brass) 34%, transparent);
  --bar-buy: var(--jade-hi); --bar-sell: var(--blood-hi); --bar-empty: color-mix(in srgb, var(--deck-night) 80%, #000);
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: stretch center;
  background: #0b0806 radial-gradient(ellipse at 50% 30%, #2a1b14, #0b0806 75%);   /* solid: the game never shows through */
  padding: max(.5rem, env(safe-area-inset-top)) max(.6rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) max(.6rem, env(safe-area-inset-left));
}
.ldg.ldg-opening { animation: ldg-in .3s ease both; }   /* only when the book is opened, never on a redraw */
.ldg-frame { width: min(96rem, 100%); min-height: 0; display: flex; flex-direction: column; gap: .45rem; }
.ldg-frame > .ldg-head, .ldg-frame > .ldg-locked, .ldg-frame > .ldg-foot { flex: none; }
.ldg-frame > .ldg-book { flex: 1 1 0; }

/* ---- the head: her picture, the title, the index tabs ---- */
.ldg-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: end; gap: .9rem; position: relative; z-index: 2; }
.ldg-keeper { margin: 0 0 calc(var(--ko) * -1); width: var(--kw); position: relative; z-index: 3; aspect-ratio: 3 / 4; border-radius: .35rem; overflow: hidden;
  background: #15100c; box-shadow: 0 0 0 2px #c9a34e, 0 0 0 5px #3a2416, 0 14px 40px #000d, 0 0 60px #c9a34e33; transform: rotate(-2deg); }
.ldg-opening .ldg-keeper { animation: ldg-keeper .8s cubic-bezier(.2,.8,.2,1) both; }
.ldg-keeper img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; display: block; animation: none; }
.ldg-keeper.mood-happy { box-shadow: 0 0 0 2px #7fc4a2, 0 0 0 5px #1f3d31, 0 10px 30px #000c; }
.ldg-keeper.mood-angry { box-shadow: 0 0 0 2px #d0644f, 0 0 0 5px #4a120c, 0 10px 30px #000c; }
.ldg-quill { display: grid; place-items: center; height: 100%; color: #c9a34e; } .ldg-quill svg { width: 55%; }
.ldg-who { min-width: 0; padding-bottom: .2rem; }
.ldg-kicker { font: .72rem/1.2 var(--special); letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--deck-brass) 85%, var(--deck-ivory)); }
.ldg-who h1 { margin: .05rem 0 .1rem; font: 400 clamp(1.5rem, 3vw, 2.4rem)/1.05 var(--serif); color: var(--brass-hi);
  background: linear-gradient(100deg, #f6d98c, #c9a34e 45%, #fff3cf 55%, #b48a3a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ldg-line { margin: 0; font: italic clamp(.9rem, 1.3vw, 1.05rem)/1.35 var(--sans); color: var(--deck-ivory); max-width: 52rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ldg-opening .ldg-line { animation: ldg-ink .8s .3s both; }
.ldg-who small { color: var(--muted); font: italic .78rem/1.2 var(--sans); }
.ldg-tabs { display: flex; gap: .25rem; align-self: end; }
body.player .ldg-tab { min-height: 0; display: grid; justify-items: center; gap: .05rem; padding: .45rem .8rem .55rem; border-radius: .5rem .5rem 0 0;
  border: 1px solid #6b452d; border-bottom: 0; background: linear-gradient(#5a3a26, #3a2416); color: #e8d4ae;
  font: 600 .82rem/1.1 var(--sans); transform: translateY(.35rem); transition: transform .2s, background .2s; }
body.player .ldg-tab i { font: normal .7rem/1 var(--special); letter-spacing: .1em; color: #c9a34e; }
body.player .ldg-tab:hover { transform: translateY(.1rem); }
body.player .ldg-tab.on { background: linear-gradient(#f4e7cc, #e7d3ad); color: var(--ink); transform: none; border-color: #a8772c; }
body.player .ldg-tab.on i { color: var(--oxblood); }
body.player .ldg-x { min-height: 0; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; align-self: start; font-size: 1.1rem;
  background: #2a1b14; border: 1px solid var(--edge-hi); color: var(--brass-hi); }
.ldg-locked { margin: 0; padding: .35rem .8rem; border-radius: .4rem; background: #7b242833; border: 1px solid #b0302a66; color: var(--blood-hi);
  font: .85rem/1.3 var(--sans); text-align: center; }

/* ---- the book ---- */
.ldg-book { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); position: relative; color: var(--ink);
  border: .5rem solid #3a2416; border-radius: .7rem; padding: .25rem;
  background:
    linear-gradient(90deg, transparent 49.2%, #6b452d55 49.6%, #3a241699 50%, #6b452d55 50.4%, transparent 50.8%),
    linear-gradient(90deg, #d9bf92, var(--linen) 8%, var(--linen) 44%, #c9a77a 50%, var(--linen) 56%, var(--linen) 92%, #d9bf92);
  box-shadow: inset 0 0 0 2px #c9a34e66, 0 1.4rem 4rem #000c, 0 0 0 1px #000;
  font-size: clamp(.84rem, 1.02vw, 1rem); line-height: 1.35; }
.ldg-book::before { content: ""; position: absolute; top: 3%; bottom: 3%; left: 50%; border-left: 2px dashed #6b452d55; pointer-events: none; z-index: 1; }
.ldg-page { min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.ldg-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain;
  padding: clamp(.8rem, 1.8vw, 1.5rem) clamp(.9rem, 2.2vw, 1.9rem) clamp(.8rem, 1.6vw, 1.3rem) clamp(1.6rem, 3vw, 2.6rem);
  background:
    linear-gradient(90deg, transparent calc(clamp(1rem, 2vw, 1.8rem) - 3px), var(--rule-red) calc(clamp(1rem, 2vw, 1.8rem) - 3px) calc(clamp(1rem, 2vw, 1.8rem) - 2px),
      transparent calc(clamp(1rem, 2vw, 1.8rem) - 2px) clamp(1rem, 2vw, 1.8rem), var(--rule-red) clamp(1rem, 2vw, 1.8rem) calc(clamp(1rem, 2vw, 1.8rem) + 1px), transparent calc(clamp(1rem, 2vw, 1.8rem) + 1px)),
    repeating-linear-gradient(180deg, transparent 0 1.55rem, var(--rule-blue) 1.55rem calc(1.55rem + 1px));
  background-attachment: local;
  scrollbar-width: thin; scrollbar-color: #a8772c66 transparent; }
.ldg-page h2 { font: 400 1.55em/1.1 var(--serif); margin: 0 0 .5rem; color: var(--ink); }
.ldg-left .ldg-top { margin-left: calc(var(--kw) - clamp(2.4rem, 3.9vw, 3.4rem) + 1.1rem); min-height: max(0rem, calc(var(--ko) - 1.7rem)); }
.ldg-page h3 { font: 400 1.08em/1.2 var(--serif); margin: 1rem 0 .4rem; color: var(--oxblood); display: flex; align-items: center; gap: .6rem; }
.ldg-page h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #8a221966, transparent); }
.ldg-anim .ldg-book.ldg-turn-fwd .ldg-right, .ldg-anim .ldg-book.ldg-turn-back .ldg-left {
  animation: ldg-flip .7s cubic-bezier(.3,.7,.2,1) both; transform-origin: left center; }
.ldg-anim .ldg-book.ldg-turn-back .ldg-left { transform-origin: right center; animation-name: ldg-flip-back; }
.ldg-opening .ldg-scroll > *, .ldg-turn-fwd .ldg-right .ldg-scroll > *, .ldg-turn-back .ldg-left .ldg-scroll > * { animation: ldg-ink .55s both; }
:is(.ldg-opening .ldg-scroll, .ldg-turn-fwd .ldg-right .ldg-scroll, .ldg-turn-back .ldg-left .ldg-scroll) > :nth-child(2) { animation-delay: .06s; }
:is(.ldg-opening .ldg-scroll, .ldg-turn-fwd .ldg-right .ldg-scroll, .ldg-turn-back .ldg-left .ldg-scroll) > :nth-child(3) { animation-delay: .12s; }
:is(.ldg-opening .ldg-scroll, .ldg-turn-fwd .ldg-right .ldg-scroll, .ldg-turn-back .ldg-left .ldg-scroll) > :nth-child(4) { animation-delay: .18s; }
:is(.ldg-opening .ldg-scroll, .ldg-turn-fwd .ldg-right .ldg-scroll, .ldg-turn-back .ldg-left .ldg-scroll) > :nth-child(n+5) { animation-delay: .24s; }

.ldg-foot { display: flex; align-items: center; justify-content: center; gap: 1rem; color: var(--muted); font: .78rem/1 var(--special); letter-spacing: .1em; }
body.player .ldg-flip { min-height: 0; padding: .35rem 1rem; border-radius: 999px; font: 600 .85rem/1 var(--sans); background: #2a1b14; border: 1px solid var(--edge); color: var(--brass-hi); }

/* ---- figures and small print ---- */
.ldg-fig { font-family: var(--figures); font-variant-numeric: tabular-nums lining-nums; font-weight: 700; white-space: nowrap; }
.ldg .up, .ldg-fig.up { color: var(--jade); } .ldg .down, .ldg-fig.down { color: var(--oxblood); } .ldg .warn { color: #8a5a12; }
.ldg-muted { color: var(--sepia); font-style: italic; }
.ldg-fine { color: var(--sepia); font-size: .8em; margin: .5rem 0 0; }
.ldg-caption { color: var(--sepia); font: italic .9em/1.3 var(--sans); margin: .2rem 0 .3rem; }
.ldg .pt-unreal { font-size: .88em; color: var(--sepia); margin: .45rem 0 0; }
.ldg-away { margin: .5rem 0; padding: .5rem .7rem; border: 1px dashed #a8772c88; border-radius: .35rem; color: var(--sepia); font-size: .9em; background: #fff8e840; }

/* ---- spread 1: the balance ---- */
.ldg-worth { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .8rem; padding: .6rem .8rem; border-radius: .4rem;
  background: linear-gradient(135deg, #ffe9b055, #c9932f22); border: 1px solid #a8772c88; }
.ldg-worth > span { font: .74rem/1 var(--special); letter-spacing: .12em; text-transform: uppercase; color: var(--sepia); }
.ldg-worth .big { font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--ink); }
.ldg-worth.down .big { color: var(--oxblood); }
.ldg-parts { margin: .55rem 0 .2rem; display: grid; gap: .2rem; }
.ldg-bar { display: flex; height: .85rem; border-radius: .3rem; overflow: hidden; background: #6b452d22; box-shadow: inset 0 0 0 1px #6b452d44; }
.ldg-bar.debt { height: .45rem; background: transparent; box-shadow: none; }
.ldg-seg { width: var(--w); height: 100%; transform-origin: left; }
.ldg-anim .ldg-seg { animation: ldg-grow .9s var(--d, 0s) cubic-bezier(.3,.8,.2,1) both; }
.s-cash, .lg-cash i, .a-cash { background: #c9a34e; fill: #c9a34ecc; }
.s-bank, .lg-bank i, .a-bank { background: #2f6b5a; fill: #2f6b5acc; }
.s-cargo, .lg-cargo i, .a-cargo { background: #385467; fill: #385467cc; }
.s-fleet, .lg-fleet i, .a-fleet, .s-other { background: #6b452d; fill: #6b452dcc; }
.s-other { background: repeating-linear-gradient(135deg, #6b452d 0 4px, #8a6446 4px 8px); }
.s-debt, .lg-debt i, .a-debt { background: #8a2219; fill: #8a221999; }
.lg-worth i { background: #8a2219; height: 3px !important; }
.ldg-sheet { list-style: none; margin: 0; padding: 0; }
.ldg-sheet li { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; padding: .32rem 0; border-bottom: 1px solid #6b452d33; }
.ldg-sheet li span { display: grid; min-width: 0; }
.ldg-sheet li small { color: var(--sepia); font-size: .8em; }
.ldg-sheet.total li { border-bottom: 0; border-top: 3px double #2a170e; margin-top: .2rem; font-size: 1.08em; }
.ldg-sheet.total li + li { border-top: 0; font-size: .95em; }


/* ---- charts ---- */
.ldg-chart { margin: .3rem 0 0; position: relative; }
.ldg-chart svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.ldg-chart[data-chart="worth"] svg { aspect-ratio: 520 / 190; }
.ldg-area { stroke: none; }
:is(.ldg-anim, .ldg-draw) .ldg-area { animation: ldg-rise 1s var(--d, 0s) cubic-bezier(.3,.8,.2,1) both; transform-origin: 50% 100%; transform-box: fill-box; }
.ldg-line { fill: none; stroke: #8a2219; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
:is(.ldg-anim, .ldg-draw) .ldg-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ldg-draw 2s .4s cubic-bezier(.4,.1,.2,1) forwards; }
.ldg-zero { stroke: #2a170e66; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ldg-end { fill: #8a2219; stroke: #f1e3c5; stroke-width: 1.5; }
:is(.ldg-anim, .ldg-draw) .ldg-end { animation: ldg-pop .5s 2.2s both; transform-box: fill-box; transform-origin: center; }
.ldg-axis { font: 9px var(--sans); fill: #6b452d; }
.ldg-cursor { stroke: #2a170e; stroke-width: 1; opacity: 0; vector-effect: non-scaling-stroke; }
.ldg-cursor.on { opacity: .55; }
.ldg-tip { position: absolute; top: .2rem; z-index: 3; min-width: 11rem; padding: .45rem .6rem; border-radius: .35rem; pointer-events: none;
  background: #2a170ef0; color: #f1e3c5; font: .78rem/1.35 var(--sans); box-shadow: 0 6px 18px #0008; display: grid; gap: .1rem; }
.ldg-tip[hidden] { display: none; }
.ldg-tip b { font-weight: 700; color: #f6d98c; display: flex; justify-content: space-between; gap: .8rem; }
.ldg-tip span { display: flex; align-items: center; gap: .35rem; }
.ldg-tip span i { width: .6rem; height: .6rem; border-radius: 2px; flex: none; }
.ldg-tip em { margin-left: auto; font: normal 700 .78rem var(--figures); }
.ldg-tip em.up { color: #8fe0b8; } .ldg-tip em.down { color: #ffb4a6; }
.ldg-chart figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .8rem; margin-top: .3rem; font-size: .78em; color: var(--sepia); }
.ldg-legend { display: flex; flex-wrap: wrap; gap: .2rem .7rem; }
.ldg-legend span { display: inline-flex; align-items: center; gap: .3rem; } .ldg-legend i { width: .7rem; height: .7rem; border-radius: 2px; display: inline-block; }
.ldg-wf rect { fill: #2f6b5a; transition: filter .15s; }
.ldg-wf.down rect { fill: #8a2219; }
.ldg-wf.net rect { fill: #a8772c; stroke: #2a170e; stroke-width: 1; }
.ldg-wf.net.down rect { fill: #6b1a12; }
.ldg-wf.on rect, .ldg-wf:hover rect { filter: brightness(1.2) drop-shadow(0 2px 3px #0006); }
.ldg-wf { cursor: pointer; }
:is(.ldg-anim, .ldg-draw) .ldg-wf rect { animation: ldg-rise .7s var(--d, 0s) cubic-bezier(.3,.8,.2,1) both; transform-box: fill-box; transform-origin: 50% 100%; }
:is(.ldg-anim, .ldg-draw) .ldg-wf.down rect { transform-origin: 50% 0; }
:is(.ldg-anim, .ldg-draw) .ldg-wf text { animation: ldg-ink .5s calc(var(--d, 0s) + .4s) both; }
.ldg-wf-v { font: 700 10px var(--figures); } .ldg-wf-v.up { fill: #1f5c46; } .ldg-wf-v.down { fill: #8a2219; }
.ldg-join { stroke: #2a170e55; stroke-dasharray: 2 2; }

/* ---- tables ---- */
.ldg-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.ldg-table :is(td, th) { padding: .3rem .2rem; border-bottom: 1px solid #6b452d33; text-align: left; vertical-align: middle; }
.ldg-table th { font: 600 .72em/1.1 var(--special); letter-spacing: .08em; text-transform: uppercase; color: var(--sepia); }
.ldg-table .n { text-align: right; font-family: var(--figures); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ldg-grp td { padding-top: .6rem; font: .78em/1 var(--special); letter-spacing: .1em; text-transform: uppercase; color: var(--oxblood); border-bottom: 1px solid #8a221955; }
.ldg-grp + tr td:first-child, .ldg-grp ~ tr:not(.ldg-sub):not(.ldg-grp):not(.ldg-total) td:first-child { padding-left: .9rem; }
.ldg-sub td { background: #6b452d14; font-weight: 700; }
.ldg-total td { border-top: 3px double #2a170e; border-bottom: 0; font: 400 1.1em/1.2 var(--serif); padding-top: .45rem; }
.ldg-seg3 { display: inline-flex; border: 1px solid #a8772c; border-radius: 999px; overflow: hidden; margin-bottom: .3rem; }
body.player .ldg-seg3 button { min-height: 0; padding: .3rem .75rem; border: 0; border-radius: 0; background: transparent; color: var(--sepia); font: 600 .8rem/1 var(--sans); }
body.player .ldg-seg3 button[aria-pressed="true"] { background: #8a2219; color: #f6e8c8; }

/* ---- spread 2: money and the fleet ---- */
.ldg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.ldg-stat { padding: .45rem .6rem; border-radius: .35rem; border: 1px solid #a8772c66; background: #fff8e855; display: grid; gap: .1rem; }
.ldg-stat span { font: .68rem/1.1 var(--special); letter-spacing: .1em; text-transform: uppercase; color: var(--sepia); }
.ldg-stat .ldg-fig { font-size: 1.25em; }
.ldg-desk { margin-top: 0; padding: .6rem .8rem .5rem; border-radius: .4rem; background: #2a170ee8; color: var(--deck-ivory); box-shadow: 0 4px 12px #0004; }
.ldg-desk .pt-transfer-scale { color: var(--deck-brass); }
.ldg-desk .ldg-fine { color: var(--muted); } .ldg-desk .up, .ldg-desk .ldg-fig.up { color: var(--jade-hi); }
.ldg-deskhead { display: flex; align-items: center; gap: .6rem; font: 400 1.2em/1.1 var(--serif); color: #f6d98c; margin-bottom: .2rem; }
.ldg-face { flex: none; width: 3.6rem; aspect-ratio: 3 / 4; border-radius: .25rem; overflow: hidden; box-shadow: 0 0 0 1px #c9a34e88, 0 2px 6px #0006; background: #15100c; }
.ldg-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; display: block; }
.ldg-face.big { width: clamp(4.6rem, 7vw, 6rem); }
.ldg-face.none { display: grid; place-items: center; color: #c9a34e; font-size: 1.6rem; }
.ldg-rest { margin-top: .5rem; padding: .45rem .6rem; border-radius: .4rem; background: #c9a34e26; border: 1px solid #a8772c66; font-size: .88em; }
body.player .ldg-rest button { min-height: 0; padding: .3rem .8rem; border-radius: 999px; background: #8a2219; border: 1px solid #5a140e; color: #fff3df; font: 600 .8rem/1.2 var(--sans); white-space: nowrap; }
.ldg-proj { display: grid; gap: .1rem; padding: .5rem .7rem; border: 1px solid #a8772c66; border-radius: .4rem; background: #fff8e866; }
.ldg-prow { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; padding: .15rem 0; border-bottom: 1px dotted #6b452d44; }
.ldg-prow:last-child { border-bottom: 0; }
.ldg-prow b { font-family: var(--figures); text-align: right; }
.ldg .ldg-prow > span { color: var(--ink); }
.ldg-prow small { font: italic .8em var(--sans); color: var(--sepia); display: block; }
.ldg-prow.up b { color: var(--jade); } .ldg-prow.down b { color: var(--oxblood); } .ldg-prow.warn b { color: #8a5a12; }
.ldg-fleet .ldg-ship { display: flex; align-items: center; gap: .55rem; }
.ldg-fleet .ldg-ship > span:last-child { display: grid; min-width: 0; }
.ldg-fleet .ldg-ship small { color: var(--sepia); font-size: .8em; }
.ldg-shipimg { flex: none; width: 6.6rem; height: 4.3rem; border-radius: .25rem; overflow: hidden; box-shadow: 0 0 0 1px #6b452d88; background: #15100c; }
.ldg-shipimg :is(img, video) { width: 100%; height: 100%; object-fit: cover; display: block; }
.ldg-acts td { padding-top: 0; border-bottom: 1px solid #6b452d55; }
.ldg-actrow { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.ldg-fleet tbody tr:not(.ldg-acts):has(+ .ldg-acts) td { border-bottom: 0; }
body.player button.ldg-btn { min-height: 0; padding: .25rem .7rem; font: 600 .78rem/1.2 var(--sans); border-radius: 999px; white-space: nowrap;
  background: #3a2416; color: #f1e3c5; border: 1px solid #a8772c; }
body.player button.ldg-btn.ghost { background: transparent; color: var(--ink); border-color: #6b452d88; }
body.player button.ldg-btn.primary { background: #8a2219; border-color: #5a140e; color: #fff3df; }
body.player button.ldg-btn:hover:not(:disabled) { filter: brightness(1.12); }
body.player button.ldg-btn:disabled { opacity: .4; }
.ldg-laid { list-style: none; margin: 0; padding: 0; }
.ldg-laid li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .6rem; padding: .3rem 0; border-bottom: 1px solid #6b452d33; }
.ldg-laid li span:first-child { display: grid; } .ldg-laid small { color: var(--sepia); font-size: .8em; }
.ldg-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.ldg-bars li { display: grid; grid-template-columns: minmax(5rem, 30%) 1fr auto; align-items: center; gap: .5rem; font-size: .85em; }
.ldg-bars li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ldg-bars li i { height: .7rem; border-radius: .2rem; width: var(--w); background: linear-gradient(90deg, #6b452d, #8a2219); transform-origin: left; }
.ldg-bars li.b-escort i { background: linear-gradient(90deg, #385467, #8a2219); } .ldg-bars li.b-laid i { background: repeating-linear-gradient(135deg, #a8772c 0 4px, #c9a77a 4px 8px); }
.ldg-bars li b { font: 700 .9em var(--figures); color: var(--oxblood); }
.ldg-anim .ldg-bars li i { animation: ldg-grow .8s var(--d, 0s) cubic-bezier(.3,.8,.2,1) both; }
.ldg-prot { margin-top: .9rem; display: block; min-height: 6.5rem; }
.ldg-prot p { margin: .3rem 0; } .ldg-prot small { color: var(--muted); }
.ldg-prot button { justify-self: start; }
.ldg-prot.down b { color: #ff9c8a; } .ldg-prot.up b { color: var(--jade-hi); }

/* ---- spread 3: housing, the bill, who got the silver ---- */
.ldg-fill { height: .5rem; border-radius: .25rem; background: #6b452d22; margin: .25rem 0 .35rem; overflow: hidden; }
.ldg-fill i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, #2f6b5a, #a8772c); transform-origin: left; }
.ldg-anim .ldg-fill i { animation: ldg-grow 1s .3s both; }
.ldg-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.ldg-chip { padding: .1rem .45rem; border-radius: 999px; background: #38546722; border: 1px solid #38546755; font-size: .8em; }
.ldg-bill li { animation-delay: var(--d, 0s); }
.ldg-meter { height: .55rem; border-radius: .3rem; background: #6b452d1f; margin: .25rem 0; overflow: hidden; }
.ldg-meter i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, #8a2219, #c9563f); transform-origin: left; }
.ldg-taker.in .ldg-meter i { background: linear-gradient(90deg, #1f5c46, #4f9a7c); }
:is(.ldg-anim, .ldg-draw) .ldg-taker { animation: ldg-ink .5s var(--d, 0s) both; }
:is(.ldg-anim, .ldg-draw) .ldg-meter i { animation: ldg-grow .9s calc(var(--d, 0s) + .2s) cubic-bezier(.3,.8,.2,1) both; }

/* ---- the rail button (player.js): the bookkeeper's face, or a quill ---- */
.dk-nav .dk-acct svg { width: 1.6rem; height: 1.6rem; }

/* ---- smaller screens: one page under the other, the book scrolls ---- */
@media (max-width: 900px), (orientation: portrait) {
  .ldg-book { grid-template-columns: 1fr; overflow: auto; background: var(--linen); }
  .ldg-book::before { display: none; }
  .ldg-page + .ldg-page { border-top: 3px double #6b452d88; }
  .ldg-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ldg-tabs { grid-column: 1 / -1; order: 5; justify-content: center; }
  .ldg { --kw: 5.5rem; --ko: 0rem; }
  .ldg-book { grid-template-rows: none; grid-auto-rows: auto; }
  .ldg-page { overflow: visible; min-height: auto; }
  .ldg-scroll { position: relative; inset: auto; overflow: visible; }
  .ldg-wall { position: absolute; inset: 0; overflow: hidden; }
  .ldg-left .ldg-top { margin-left: 0; min-height: 0; }
}
@media (max-height: 560px) {
  .ldg { --kw: 4.6rem; --ko: 0rem; } .ldg-line { -webkit-line-clamp: 1; }
  .ldg-left .ldg-top { margin-left: 0; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ldg, .ldg *, .ldg *::before { animation: none !important; transition: none !important; }
}

@keyframes ldg-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ldg-keeper { from { opacity: 0; transform: translateY(-1rem) rotate(-6deg); } to { opacity: 1; transform: rotate(-2deg); } }
@keyframes ldg-breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes ldg-flip { from { transform: perspective(90rem) rotateY(-70deg); filter: brightness(.55); } to { transform: none; filter: none; } }
@keyframes ldg-flip-back { from { transform: perspective(90rem) rotateY(70deg); filter: brightness(.55); } to { transform: none; filter: none; } }
@keyframes ldg-ink { from { opacity: 0; transform: translateY(.3rem); } to { opacity: 1; transform: none; } }
@keyframes ldg-draw { to { stroke-dashoffset: 0; } }
@keyframes ldg-pop { from { opacity: 0; transform: scale(.3); } 70% { transform: scale(1.2); } to { opacity: 1; transform: none; } }
@keyframes ldg-grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes ldg-rise { from { transform: scaleY(0); opacity: .3; } to { transform: none; opacity: 1; } }

/* ======================= 21 Nov 2026: faded persona walls, two columns, big pictures ======================= */

/* ---- the wall: her wide picture bleeding into the linen (multiplied, so the paper shows through) ---- */
.ldg-wall { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ldg-wallimg { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; object-position: var(--wp, 50% 20%); display: block;
  opacity: .44; mix-blend-mode: multiply; filter: sepia(.5) saturate(1.3) contrast(1.1);
  -webkit-mask-image: radial-gradient(ellipse 88% 86% at var(--wx, 55%) 40%, #000 32%, #0000 84%);
          mask-image: radial-gradient(ellipse 88% 86% at var(--wx, 55%) 40%, #000 32%, #0000 84%);
  animation: ldg-drift 42s ease-in-out infinite alternate; }
.ldg-left .ldg-wall { --wx: 64%; } .ldg-right .ldg-wall { --wx: 40%; }
video.ldg-wallimg { animation: none; }

/* ---- two columns: balanced, never splitting a block; one column when the page is narrow ---- */
.ldg-cols { columns: 2 15rem; column-gap: 1.8rem; column-rule: 1px dotted #6b452d44; margin-top: .6rem; }
.ldg-blk { break-inside: avoid; margin: 0 0 .75rem; }
.ldg-span { column-span: all; }
.ldg-cols h3:first-child, .ldg-blk > h3:first-child { margin-top: .2rem; }
.ldg-top { display: flex; flex-direction: column; justify-content: center; gap: .35rem; }
.ldg-top h2 { margin-bottom: .1rem; }
.ldg-top .ldg-caption, .ldg-top .ldg-muted { margin: 0; }
.ldg-two { columns: 2 15rem; column-gap: 1.8rem; margin-top: .6rem; }
.ldg-two li { break-inside: avoid; }

/* ---- spread 1 ---- */
.ldg-worth { background: linear-gradient(135deg, #fff1c9aa, #c9932f33); box-shadow: 0 4px 14px #2a170e22; }
.ldg-worth .big { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
.ldg-pl { margin-top: 0; }
.ldg-grp td { padding-top: .2rem; }
.ldg-chart[data-chart="flow"] svg { max-height: 15rem; }

/* ---- spread 2: desks with the banker, the lender and the agent standing big behind them ---- */
.ldg-stats { gap: .6rem; }
.ldg-stat { background: #fff8e88c; box-shadow: 0 3px 10px #2a170e1f; }
.ldg-stat .ldg-fig { font-size: 1.5em; }
.ldg-desk { position: relative; overflow: hidden; min-height: 11rem; isolation: isolate; background: linear-gradient(120deg, #1f120b, #3a2416); border: 1px solid #a8772c88; }
.ldg-deskart { position: absolute; z-index: -1; right: 0; top: 0; bottom: 0; width: 70%; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #0000, #000 62%); mask-image: linear-gradient(90deg, #0000, #000 62%); }
.ldg-deskart :is(img, video) { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; display: block; opacity: .72; filter: saturate(1.1) contrast(1.05); animation: none; }
.ldg-desk > :not(.ldg-deskart) { position: relative; }
.ldg-desk .ldg-fine { color: #e8d4aecc; }
.ldg-proj { grid-template-columns: 1fr 1fr; column-gap: 2rem; background: #fff8e88c; }
.ldg-prot .ldg-deskhead { font-size: 1.3em; }
.ldg-prot { min-height: 8.5rem; }
.ldg-prot > :not(.ldg-deskart) { max-width: 60%; }
.ldg-fleet { margin-top: 0; }
.ldg-fleet .ldg-shipimg { box-shadow: 0 0 0 1px #6b452d88, 0 3px 8px #0005; }
.ldg-laid li { grid-template-columns: 1fr auto; }
.ldg-laid li .ldg-btn { grid-column: 1 / -1; justify-self: start; }

/* ---- spread 3: warehouse cards with a big picture, the bill beside the Mayor, takers on tall cards ---- */
.ldg-store { padding: 0; overflow: hidden; border-radius: .45rem; border: 1px solid #a8772c88; background: #fff8e88c; box-shadow: 0 4px 14px #2a170e2e; display: block; }
.ldg-storeimg { position: relative; aspect-ratio: 16 / 9; border-radius: 0; box-shadow: none; }
.ldg-storeimg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, #150e0ad9); pointer-events: none; }
.ldg-storeimg :is(img, video) { filter: sepia(.15) contrast(1.05); }
.ldg-store .ldg-sname { position: absolute; z-index: 1; left: .8rem; right: .8rem; bottom: .45rem; color: #f6e8c8; font: 400 1.25em/1.1 var(--serif); text-shadow: 0 2px 8px #000; }
.ldg-storebody { padding: .45rem .8rem .65rem; }
.ldg-artbox { position: relative; min-height: 9rem; padding-right: min(36%, 15rem); }
.ldg-boxart { position: absolute; right: 0; top: 0; bottom: 0; width: 44%; overflow: hidden; pointer-events: none; }
.ldg-boxart :is(img, video) { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; opacity: .8; mix-blend-mode: multiply; filter: sepia(.35) saturate(1.2);
  -webkit-mask-image: linear-gradient(90deg, #0000, #000 55%); mask-image: linear-gradient(90deg, #0000, #000 55%); animation: none; }
.ldg-artbox > :not(.ldg-boxart) { position: relative; }
.ldg-takers { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .65rem; }
.ldg-taker { position: relative; display: grid; grid-template-columns: minmax(6.4rem, 40%) 1fr; gap: 0; align-items: stretch; min-height: 10.5rem; padding: 0;
  overflow: hidden; border-radius: .45rem; background: #fff8e88c; border: 1px solid #a8772c66; box-shadow: 0 4px 14px #2a170e2e; }
.ldg-taker .ldg-face.big { width: auto; aspect-ratio: auto; height: 100%; border-radius: 0; box-shadow: none; background: #15100c;
  -webkit-mask-image: linear-gradient(90deg, #000 58%, #0000); mask-image: linear-gradient(90deg, #000 58%, #0000); }
.ldg-taker .ldg-face img { object-position: 50% 12%; }
.ldg-taker .ldg-face.none { background: radial-gradient(circle at 50% 45%, #5a3a26, #15100c 75%); font-size: 2.6rem; }
.ldg-tk { padding: .55rem .8rem .55rem .1rem; display: grid; align-content: center; gap: .1rem; min-width: 0; }
.ldg-tk b { font: 400 1.12em/1.1 var(--serif); }
.ldg-tk .ldg-fig { font-size: 1.45em; }
.ldg-tk .ldg-ports { line-height: 1.25; }

@keyframes ldg-drift { from { transform: scale(1) translate3d(0, 0, 0); } to { transform: scale(1.06) translate3d(-1.2%, -1%, 0); } }
.ldg-ph { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; }
.ldg-store b { display: block; font: 400 1.05em/1.15 var(--serif); }
.ldg-store small { color: var(--sepia); font-size: .82em; }
.ldg-storeimg { overflow: hidden; background: #15100c; max-height: 15rem; }
.ldg-storeimg :is(img, video) { width: 100%; height: 100%; object-fit: cover; display: block; }
.ldg-store .ldg-sname { display: block; }
