/* An independent, read-only window: no backdrop and no table reflow. */
#playerLedger{position:fixed;z-index:84;display:flex;flex-direction:column;max-width:calc(100vw - 16px);max-height:var(--ledger-height,392px);margin:0;border:1px solid #b6a572;border-top:2px solid #e6c586;border-radius:14px;background:linear-gradient(145deg,#2a4031,#14271f);box-shadow:0 10px 34px #0009,inset 0 0 0 3px #dfcc9310;color:#e7e7cf;overflow:hidden;box-sizing:border-box;text-align:left;font-family:system-ui,sans-serif;isolation:isolate}
#playerLedger [hidden]{display:none!important}
#playerLedger .ledger-handle{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:10px 10px 9px;border-bottom:1px solid #b9c29935;flex:none;min-width:0;cursor:grab;touch-action:none;user-select:none}
#playerLedger.is-dragging .ledger-handle{cursor:grabbing}
.ledger-identity{display:flex;align-items:center;gap:7px;min-width:0;flex:1}
.ledger-symbol{font-size:23px;color:#e2c889;flex:none}.ledger-identity>div{min-width:0;flex:1}
#playerLedger .ledger-identity small{display:block;font-size:10px;color:#a9ba9e;line-height:1.3;margin-bottom:3px;pointer-events:none}
#playerLedger select{display:block;width:100%;max-width:100%;min-height:21px;padding:0 14px 0 0;border:0;border-radius:0;background:transparent;color:#f4d99e;font:750 14px/1.4 system-ui;box-shadow:none;text-overflow:ellipsis;cursor:pointer;touch-action:auto}
#playerLedger option{background:#193025;color:#e9e1c6}
.ledger-tools{display:flex;flex:none;gap:2px}
#playerLedger .ledger-tools button{display:grid;place-items:center;width:25px;min-width:25px;height:27px;min-height:27px;padding:0;border:1px solid transparent;border-radius:5px;background:transparent;color:#bfcfb1;font:600 20px/1 system-ui;box-shadow:none;cursor:pointer}
#playerLedger .ledger-tools button:hover,#playerLedger .ledger-tools button:focus-visible{background:#5b633833;border-color:#b5ac7555;color:#ffdfa2}
#playerLedger button:focus-visible,#playerLedger select:focus-visible,#playerLedger .ledger-scroll:focus-visible{outline:2px solid #f1d083;outline-offset:-2px}
#playerLedger .ledger-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#81976e #14281e;padding:12px}
.ledger-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.ledger-metric{min-width:0;padding:9px 10px;background:#0c201855;border:1px solid #879b6a29;border-radius:8px}
.ledger-metric>span,.ledger-bitcoin span{display:block;font-size:11px;line-height:1.4;color:#b5c8a9;font-weight:650}
.ledger-metric>strong{display:block;font-size:19px;line-height:1.35;font-weight:800;font-variant-numeric:tabular-nums;margin-top:3px;overflow-wrap:anywhere}
.ledger-metric>small{display:block;font-size:10px;line-height:1.45;margin-top:4px;color:#9cad90}
.ledger-debt{border-color:#a76d4e44;background:#78482d1b}.ledger-debt>strong{color:#f8b5a0}
.ledger-worth>strong{color:#f5d791}
.ledger-bitcoin{grid-column:1/-1;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:7px;padding:10px;border:1px solid #b6a96a40;border-radius:8px;background:#101e18}
.ledger-bitcoin strong{display:block;font-size:18px;color:#f4d59a;line-height:1.45;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.ledger-bitcoin strong small{font-size:10px;white-space:nowrap}.ledger-bitcoin b{font-size:15px;font-variant-numeric:tabular-nums}.ledger-bitcoin>div:last-child{text-align:right}
.ledger-income{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;padding:3px 2px 0}
.ledger-income dt{font-size:11px;color:#aabf9e}.ledger-income dd{font-size:15px;font-weight:750;margin:3px 0 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#playerLedger>footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;flex:none;margin:0;padding:8px 12px;border-top:1px solid #bdc39127;background:#14271f;text-align:left}
#playerLedger>footer button{min-height:29px;padding:4px 9px;border:1px solid #b2a46c5c;border-radius:5px;background:#46563545;color:#edd69c;font:700 12px/1.4 system-ui;box-shadow:none;cursor:pointer}
#playerLedger>footer>span{font-size:10px;color:#8ea389;white-space:nowrap}
#playerLedger.is-minimized>.ledger-scroll,#playerLedger.is-minimized>footer{display:none}
.ledger-details h3{font-size:13px;line-height:1.4;color:#ead49b;margin:19px 0 10px;padding-top:13px;border-top:1px solid #95a9743b}
.ledger-lines{margin:0}.ledger-lines>div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px solid #96ac771c;font-size:12px;line-height:1.5}.ledger-lines dt{color:#abbd9f}.ledger-lines dd{margin:0;text-align:right;color:#dde4c9;font-weight:650;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.ledger-protections{display:grid;gap:7px}.ledger-protection{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px;border:1px solid #7f956b45;border-radius:7px;padding:9px;font-size:12px;background:#10241a66}.ledger-protection>b{font-weight:700}.ledger-protection>strong{font-size:11px;color:#a9b99e}.ledger-protection.is-active>strong{color:#c7dd9f}.ledger-protection.is-paused>strong{color:#ffb9a0}.ledger-protection>small{grid-column:1/-1;font-size:10px;line-height:1.6;color:#a6ba99}
.ledger-projects{list-style:none;margin:0;padding:0}.ledger-projects>li{display:flex;flex-direction:column;gap:4px;margin:0;padding:8px 0;border-bottom:1px solid #98a96e25;font-size:12px}.ledger-projects b{font-weight:700}.ledger-projects span{font-size:11px;line-height:1.5;color:#b0c19f}.ledger-empty,.ledger-footnote{font-size:11px;line-height:1.7;color:#a3b396;margin:10px 0 0}.ledger-footnote{padding-top:12px;border-top:1px solid #95a97430}
.game-table .seat-card[data-player]{cursor:pointer;transition:border-color .2s,box-shadow .2s}
.game-table .seat-card[data-player]:focus-visible{outline:2px solid #efcf84;outline-offset:2px}
.game-table .seat-card.ledger-selected{border-left-color:#ede2a4;border-right-color:#ede2a4}
.game-table .seat-card.active-seat:not(.seat-bankrupt){border-color:#f2c86a;box-shadow:inset 0 0 0 1px #ffdd8866,inset 0 0 24px #ebc15e11,0 0 0 2px #e6b95a4a,0 0 22px #e4b14847}
.game-table .seat-card.main-turn-seat:not(.active-seat):not(.seat-bankrupt){border-top-color:#d1b578;border-style:solid;border-top-style:dashed}
.game-table .seat-card .seat-name strong{display:flex;align-items:center;gap:4px;min-width:0}
.game-table .seat-nickname{min-width:0;overflow:hidden;text-overflow:ellipsis;font:inherit;line-height:inherit}
.game-table .seat-number{display:inline-flex!important;align-items:center;justify-content:center;flex:none;min-width:24px;height:18px;padding:0 3px;border:1px solid #c6b87969;border-radius:4px;background:#13291e;color:#f3d48b;font:750 10px/1 system-ui;letter-spacing:0;white-space:nowrap}
.game-table .active-seat .seat-number{background:#e1be73;color:#25321f;border-color:#ffdf95;box-shadow:0 0 8px #efc36033}
.game-table .main-turn-seat:not(.active-seat) .seat-turn-badge{color:#d8bc84}
@media(max-width:1100px){#playerLedger .ledger-scroll{padding:9px}.ledger-metric{padding:7px}.ledger-metric>strong{font-size:16px}.ledger-bitcoin{padding:7px}.ledger-bitcoin strong{font-size:16px}.ledger-bitcoin b{font-size:13px}#playerLedger .ledger-handle{padding:8px}.ledger-symbol{display:none}#playerLedger .ledger-tools button{min-width:23px;width:23px}.ledger-income dd{font-size:14px}#playerLedger>footer{padding:7px 9px}.game-table .seat-number{min-width:21px;height:16px;font-size:9px}}
@media(max-height:600px) and (min-width:601px){#playerLedger .ledger-identity small{display:none}#playerLedger .ledger-handle{padding:6px 7px}#playerLedger select{font-size:12px}#playerLedger .ledger-scroll{padding:8px}.ledger-summary{gap:6px}.ledger-metric{padding:6px}.ledger-metric>strong{font-size:15px}.ledger-bitcoin strong{font-size:14px}.ledger-metric>small{font-size:9px}.ledger-income dt{font-size:10px}.ledger-income dd{font-size:13px}#playerLedger>footer{padding:6px 8px}#playerLedger>footer>span{display:none}.game-table .seat-number{min-width:16px;height:13px;padding:0 2px;font-size:8px}}
@media(max-width:600px){#playerLedger .ledger-identity small{display:none}#playerLedger .ledger-handle{padding:7px 10px}#playerLedger select{font-size:13px}#playerLedger .ledger-scroll{padding:9px 11px}.ledger-metric>strong{font-size:18px}.ledger-summary{gap:7px}body.player-ledger-open:has(#playerLedger:not(.is-minimized)) #roomSocialDock #roomSocialDrawer{max-height:var(--ledger-chat-room,45dvh);height:min(450px,var(--ledger-chat-room,45dvh))}}
@container seat (max-height:189px){.game-table .seat-number{height:13px;min-width:18px;font-size:8px}}
body[data-ledger-keyboard="true"] #roomSocialDrawer>header{flex-wrap:nowrap;padding-bottom:3px;min-height:25px}
body[data-ledger-keyboard="true"] #roomSocialDrawer #chatTurnHint,body[data-ledger-keyboard="true"] #roomSocialDrawer #chatHint{display:none}
body[data-ledger-keyboard="true"] #roomSocialDrawer .chat-tabs button{font-size:10px;padding:3px 4px;min-height:24px}
body[data-ledger-keyboard="true"] #roomSocialDock #roomSocialDrawer{padding:6px;gap:4px}
body[data-ledger-keyboard="true"] #roomSocialDrawer #chatClose{font-size:10px;min-height:24px;padding:2px 4px}
body[data-ledger-keyboard="true"] #playerLedger .ledger-scroll{padding:6px 9px}
body[data-ledger-keyboard="true"] #playerLedger>footer{padding:4px 9px}
/* Keep the financial overview visible while browsing individual positions and assets. */
#playerLedger .ledger-overview{flex:none;padding:10px 12px 0;background:#1c3227;border-bottom:1px solid #a9b67f33}
#playerLedger .ledger-summary{display:block}
#playerLedger .ledger-net{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:8px;flex-wrap:wrap}
#playerLedger .ledger-net>span{font-size:12px;color:#b4c4a9}
#playerLedger .ledger-net>strong{font-size:25px;line-height:1.2;color:#f5d791;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#playerLedger .ledger-net>small{font-size:11px}
#playerLedger .ledger-finances{display:grid;grid-template-columns:1fr 1fr;gap:5px 12px;margin:0}
#playerLedger .ledger-finances>div{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 7px;min-width:0}
#playerLedger .ledger-finances dt{font-size:11px;color:#b4c4a9}
#playerLedger .ledger-finances dd{margin:0;font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#playerLedger .ledger-finances .ledger-flow{grid-column:1/-1}
#playerLedger .ledger-btc-line{display:flex;justify-content:space-between;flex-wrap:wrap;gap:3px 8px;font-size:10px;line-height:1.5;margin-top:7px;color:#bac9ae}
#playerLedger .ledger-btc-line b{font-weight:650;color:#ecd29b;font-variant-numeric:tabular-nums}
#playerLedger .ledger-goal-line{display:flex;justify-content:space-between;font-size:10px;color:#aebfa4;margin-top:3px}
#playerLedger progress{display:block;width:100%;height:4px;margin:4px 0 9px;appearance:none;border:0;border-radius:4px;overflow:hidden;background:#10231a}
#playerLedger progress::-webkit-progress-bar{background:#10231a}#playerLedger progress::-webkit-progress-value{background:#dabd78}#playerLedger progress::-moz-progress-bar{background:#dabd78}
#playerLedger .ledger-contract-summary{border-top:1px solid #afbc8733;padding:8px 0}
#playerLedger .ledger-section-title{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-bottom:5px}
#playerLedger .ledger-section-title h3{margin:0;font-size:13px;line-height:1.4;color:#ead49b}
#playerLedger .ledger-section-title>span{font-size:10px;color:#aebeac}
#playerLedger .ledger-pnl-line{display:flex;align-items:baseline;justify-content:space-between;gap:5px;font-size:11px;color:#b4c4a9}
#playerLedger .ledger-pnl-line strong{font-size:19px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#playerLedger .ledger-net-pnl{margin-top:2px;font-size:10px}#playerLedger .ledger-net-pnl b{font-size:12px;font-variant-numeric:tabular-nums}
#playerLedger .up{color:#98d8af}#playerLedger .down{color:#f2a58e}
#playerLedger .ledger-contract-empty{font-size:11px;color:#96ab92;padding:0 0 8px}
#playerLedger .ledger-position-list{max-height:174px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#81976e #14281e;border:1px solid #92a57633;border-radius:7px;padding:0 8px;background:#10231a55}
#playerLedger .ledger-position{border-bottom:1px solid #8ca16a29}#playerLedger .ledger-position:last-child{border-bottom:0}
#playerLedger .ledger-position>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;cursor:pointer;list-style:none}
#playerLedger .ledger-position>summary::-webkit-details-marker{display:none}
#playerLedger .ledger-position>summary>span{min-width:0}#playerLedger .ledger-position>summary b{display:block;font-size:12px;color:#e3d5a8}
#playerLedger .ledger-position>summary small{display:block;margin-top:2px;font-size:10px;color:#a9bca1}
#playerLedger .ledger-position>summary>strong{font-size:13px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#playerLedger .ledger-position>summary>strong:after{content:'⌄';font-size:11px;color:#a9bca1;margin-left:5px}
#playerLedger .ledger-position[open]>summary>strong:after{content:'⌃'}
#playerLedger .ledger-position .ledger-lines{padding-bottom:8px}#playerLedger .ledger-position .ledger-lines>div{font-size:10px;padding:4px 0}
#playerLedger .ledger-caption{font-size:10px;color:#9eaf95;margin:5px 0 12px}
#playerLedger .ledger-projects>li{padding:9px 0;gap:3px}
#playerLedger .ledger-projects details{font-size:10px;color:#a9bba1}
#playerLedger .ledger-projects summary{cursor:pointer;color:#d4c28c;padding:3px 0}
#playerLedger .ledger-projects details p{font-size:10px;line-height:1.5;margin:3px 0}
#playerLedger .ledger-statuses{display:flex;flex-wrap:wrap;gap:5px 12px;border-top:1px solid #95a97430;margin-top:10px;padding-top:8px;font-size:10px;color:#acbfa2}
#playerLedger .ledger-statuses b{color:#d9cf9f;font-weight:600}
#playerLedger .ledger-details h3{margin-top:12px;padding-top:10px}
#playerLedger .ledger-own-actions{display:flex;gap:5px;align-items:center}
#playerLedger>footer{flex-wrap:wrap;gap:5px}
#playerLedger>footer>.ledger-own-actions:empty{display:none}
#playerLedger>footer:has(.ledger-own-actions:not(:empty))>span:not(.ledger-own-actions){display:none}
#playerLedger .ledger-own-actions .bank-entry{margin:0;min-height:29px;padding:4px 7px}
#playerLedger.is-minimized>.ledger-overview{display:none}
#playerLedger summary:focus-visible,#playerLedger [data-ledger-scroll]:focus-visible{outline:2px solid #f1d083;outline-offset:-2px}
@media(max-width:600px){#playerLedger .ledger-overview{padding:8px 11px 0}#playerLedger .ledger-net{margin-bottom:5px}#playerLedger .ledger-net>strong{font-size:22px}#playerLedger .ledger-contract-summary{padding:6px 0}#playerLedger .ledger-position-list{max-height:155px}}
@media(max-height:500px) and (min-width:601px){#playerLedger .ledger-overview{padding:6px 8px 0}#playerLedger .ledger-net{margin:0 0 3px}#playerLedger .ledger-net>strong{font-size:18px}#playerLedger .ledger-finances{gap:2px 6px}#playerLedger .ledger-btc-line{margin-top:3px}#playerLedger .ledger-contract-summary{padding:4px 0}#playerLedger .ledger-pnl-line strong{font-size:15px}#playerLedger .ledger-net-pnl,#playerLedger .ledger-goal-line,#playerLedger progress{display:none}}
body[data-ledger-keyboard="true"] #playerLedger .ledger-overview{display:none}

#playerLedger .ledger-bankruptcy-reason{margin:8px 0 10px;padding:10px 12px;border:1px solid #b9756d66;border-radius:9px;background:#622d2726;color:#ffaaa1;font-size:13px;line-height:1.55}#playerLedger .ledger-bankruptcy-reason strong{color:#ffaaa1;font-size:14px}#playerLedger .ledger-bankruptcy-reason p{margin:4px 0}#playerLedger .ledger-bankruptcy-reason small{display:block;color:#ffaaa1;font-size:12px}

#playerLedger .ledger-accounting{margin:0 0 12px;padding:9px 11px;border:1px solid #a9b67f44;border-radius:8px;font-size:12px;line-height:1.6;color:#bdcdb0}#playerLedger .ledger-accounting summary{color:#f4d99e;cursor:pointer;font-weight:700}#playerLedger .ledger-accounting p{margin:7px 0;overflow-wrap:anywhere}
