.pot-ledger-sheet:not([open]) { display: none; }
.pot-ledger-sheet {
  box-sizing: border-box; position: fixed; top: calc(var(--compact-dialog-top, 0px) + 12px); bottom: auto; right: 12px; left: auto;
  width: min(460px, calc(var(--compact-dialog-width, 100vw) - 24px)); max-width: none;
  height: min(800px, calc(var(--compact-dialog-height, 100dvh) - 24px)); max-height: none; margin: 0;
  padding: 0; border: 1px solid #686044; border-top: 2px solid #d1b57c; border-radius: 14px;
  background: #131b16; color: #e9ede4; font: 14px/1.55 var(--font-ui); overflow: hidden;
  box-shadow: 0 18px 60px #02080588; color-scheme: dark; font-variant-numeric: tabular-nums;
}
.pot-ledger-sheet[open] { display: flex; flex-direction: column; animation: ledger-enter 180ms ease-out; }
.pot-ledger-sheet::backdrop { background: #02080580; }
.pot-ledger-sheet:focus { outline: none; }
.pot-ledger-sheet * { box-sizing: border-box; }
.pot-ledger-head, .pot-ledger-footer { flex: 0 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #18221a; }
.pot-ledger-head { border-bottom: 1px solid #374334; }
.pot-ledger-head h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.pot-ledger-head p { margin: 2px 0 0; color: #a9b49f; font-size: 11px; }
.pot-ledger-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 16px; scrollbar-width: thin; }
.pot-ledger-sheet button, .pot-ledger-sheet select, .pot-ledger-sheet input { font: inherit; }
.pot-ledger-sheet button { min-height: 44px; padding: 8px 12px; border: 1px solid #48563f; border-radius: 8px; background: #243022; color: #e4e7da; cursor: pointer; transition: background 140ms; }
.pot-ledger-sheet button:hover:not(:disabled) { background: #35432b; }
.pot-ledger-sheet button:active:not(:disabled) { transform: translateY(1px); }
.pot-ledger-sheet button:disabled, .pot-ledger-sheet fieldset:disabled { opacity: .45; cursor: not-allowed; }
.pot-ledger-sheet :is(button, input, select):focus-visible { outline: 2px solid #e1c180; outline-offset: 2px; }
.pot-ledger-sheet .ledger-primary { background: #d1b57c; border-color: #d1b57c; color: #172018; font-weight: 600; }
.pot-ledger-sheet .ledger-primary:hover:not(:disabled) { background: #e1c992; }
.ledger-history-label { display: block; color: #aeb8a4; font-size: 12px; }
.pot-ledger-sheet select, .pot-ledger-sheet input { width: 100%; min-width: 0; min-height: 44px; margin-top: 5px; padding: 8px 10px; border: 1px solid #44543b; border-radius: 7px; color: #e9ede4; background: #10180f; font-size: 16px; }
.ledger-total { display: flex; align-items: end; justify-content: space-between; gap: 10px; padding: 16px 0; border-bottom: 1px solid #35412e; margin-bottom: 14px; }
.ledger-total span { display: block; color: #b5bea9; font-size: 12px; }
.ledger-total strong { display: block; font-size: 36px; line-height: 1.2; color: #e7c88e; overflow-wrap: anywhere; }
.ledger-total small { flex-shrink: 0; color: #aab59e; }
.pot-ledger-sheet fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.ledger-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ledger-selectors label, .ledger-amount-label { color: #b5bea9; font-size: 12px; }
.ledger-kind { display: flex; gap: 8px; margin: 12px 0; }
.ledger-kind button { flex: 1; }
.ledger-kind button[aria-pressed="true"] { border-color: #c3a56d; background: #393323; color: #f0d7a0; }
.ledger-entry { display: grid; grid-template-columns: minmax(0,1fr) 90px; gap: 10px; align-items: end; }
.ledger-entry input { font-size: 22px; font-weight: 600; }
.ledger-entry button { height: 50px; }
.ledger-chips { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 10px; }
.ledger-chips button { display: flex; gap: 5px; justify-content: center; align-items: center; padding: 6px 2px; font-size: 12px; }
.ledger-chips i { display: inline-block; width: 15px; height: 15px; border: 2px dashed #e6e6d3; border-radius: 50%; background: #484b4b; }
.ledger-chips button[data-ledger-increment="500"] i { background: #bc648c; }
.ledger-chips button[data-ledger-increment="1000"] i { background: #bf9d34; }
.ledger-chips button[data-ledger-increment="10000"] i { background: #ce699d; width: 18px; height: 18px; }
.ledger-help, .ledger-note { color: #a6b29c; font-size: 12px; line-height: 1.65; }
#pot-ledger-message { min-height: 18px; color: #e0bf83; font-size: 12px; margin: 6px 0; }
#pot-ledger-rewind, #pot-ledger-readonly { padding: 10px; border-left: 2px solid #cfaa65; background: #2c2a1d; font-size: 12px; }
.ledger-edit-actions { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0; }
.ledger-edit-actions button { font-size: 12px; background: transparent; }
#pot-ledger-clear-confirm { margin-bottom: 12px; padding: 10px; border: 1px solid #795b40; border-radius: 8px; }
#pot-ledger-clear-confirm p { margin: 0 0 8px; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger-table th { font-weight: 500; font-size: 11px; color: #a7b09c; text-align: start; padding: 8px 3px; }
.ledger-table td { padding: 10px 3px; border-top: 1px solid #303b2c; }
.ledger-table td:nth-last-child(-n+2), .ledger-table th:nth-last-child(-n+2) { text-align: end; }
.ledger-table small { display: block; font-size: 10px; color: #a7b09c; }
.ledger-table .is-return { color: #d3b47e; }
#pot-ledger-empty { text-align: center; padding: 20px 10px; color: #aeb8a4; font-size: 13px; }
.ledger-summary { border-top: 1px solid #7a6745; padding-top: 14px; margin-top: 18px; }
.ledger-summary h3 { font-size: 15px; margin: 0 0 5px; }
.ledger-summary > strong { font-size: 30px; color: #e7c88e; }
.ledger-summary dl { margin: 12px 0; }
.ledger-summary dl > div { display: flex; justify-content: space-between; padding: 4px 0; }
.ledger-summary dd { margin: 0; }
.pot-ledger-footer { border-top: 1px solid #374334; }
.pot-ledger-footer button { width: 100%; }
body.pot-ledger-open { overflow: hidden; }
html[data-language="ar"] .pot-ledger-sheet { direction: rtl; }
html[data-language="ar"] .pot-ledger-sheet :is(input, .ledger-total strong, .ledger-summary > strong, .ledger-table td:nth-last-child(-n+2)) { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 899px) {
  .pot-ledger-sheet { top: calc(var(--compact-dialog-top,0px) + max(8px,env(safe-area-inset-top))); bottom: auto; left: calc(var(--compact-dialog-left,0px) + 8px); right: auto; width: calc(var(--compact-dialog-width,100vw) - 16px); height: calc(var(--compact-dialog-height,100dvh) - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom))); border-radius: 12px; }
  .mobile-table-links { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .mobile-table-links button { font-size: 11px; padding-inline: 2px; }
}
@media (max-width: 1399px), (max-height: 599px) {
  .table-top-nav button { padding-inline: 10px; }
}
@media (max-height: 499px) and (orientation: landscape) {
  .mobile-table-links { width: 100%; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .mobile-table-links button { font-size: 10px; }
  .pot-ledger-head, .pot-ledger-footer { padding-block: 6px; }
}
@media (prefers-reduced-motion: reduce) { .pot-ledger-sheet[open] { animation: none; } .pot-ledger-sheet button { transition: none; } }
@keyframes ledger-enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* The inline counter shares the ledger, but never shares live betting controls. */
.action-dock .quick-pot-counter {
  flex: 0 0 auto; grid-column: 1 / -1; width: 100%; max-width: 1180px;
  min-width: 0; margin: 0 auto; padding: 5px 0 0; border-top: 1px solid #344233;
  color: #c6cfbe; font-variant-numeric: tabular-nums;
}
.quick-pot-balance { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 44px; text-align: center; }
.quick-pot-balance span { font-size: 10px; line-height: 1.3; color: #a6b29c; }
.quick-pot-balance output { max-width: 100%; color: #e3c68b; font: 600 18px/1.2 var(--font-mono, monospace); overflow-wrap: anywhere; }
.quick-pot-controls { display: grid; grid-template-columns: minmax(0,1fr) 90px repeat(2,74px) 112px; align-items: center; gap: 10px; }
.quick-pot-controls input { min-width: 0; width: 100%; }
.quick-pot-controls input[type="text"] {
  height: 44px; border: 1px solid #4c5b43; border-radius: 8px; background: #101811;
  color: #e5e8da; font: 500 16px/1.2 var(--font-mono, monospace); text-align: center; padding: 8px 4px;
}
.quick-pot-controls input[aria-invalid="true"] { border-color: #d08d85; }
.quick-pot-controls button {
  display: flex; justify-content: center; align-items: center; gap: 3px;
  width: 100%; min-height: 44px; padding: 7px 3px; border: 1px solid #7b704e; border-radius: 8px;
  background: #2c3021; color: #e7d4ac; font: 550 12px/1.2 var(--font-ui); cursor: pointer;
  transition: background 140ms, transform 140ms;
}
.quick-pot-controls button:hover:not(:disabled) { background: #414431; }
.quick-pot-controls button:active:not(:disabled) { transform: translateY(1px); }
.quick-pot-controls :is(button,input):disabled { opacity: .38; cursor: not-allowed; }
.quick-pot-controls :is(button,input):focus-visible { outline: 2px solid #dfc38b; outline-offset: 2px; }
.quick-pot-counter #quick-pot-slider { appearance: none; -webkit-appearance: none; height: 44px; min-height: 44px; margin: 0; border: 0; background: transparent; accent-color: #c9b689; }
.quick-pot-counter #quick-pot-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: #58634e; }
.quick-pot-counter #quick-pot-slider::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 3px solid #283223; border-radius: 50%; background: #c9b689; box-shadow: 0 0 0 1px #a68b55; }
.quick-pot-counter #quick-pot-slider::-moz-range-track { height: 4px; border-radius: 2px; background: #58634e; }
.quick-pot-counter #quick-pot-slider::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid #283223; border-radius: 50%; background: #c9b689; }
/* Keep the safety explanation and routine confirmations accessible without
   spending another row of table height. Errors and warnings remain visible. */
#quick-pot-help, .quick-pot-message[data-tone="notice"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.quick-pot-message { margin: 2px 0 0; color: #d7c08e; font: 400 10px/1.4 var(--font-ui); }
.quick-pot-message[data-tone="error"] { color: #edb0a5; }
html[data-language="ar"] .quick-pot-counter { direction: rtl; }
html[data-language="ar"] .quick-pot-counter :is(input,output) { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 899px) {
  .quick-pot-controls { grid-template-columns: minmax(0,1fr) 60px repeat(2,44px) 82px; gap: 5px; }
  .quick-pot-controls button { font-size: 11px; gap: 1px; }
  .quick-pot-balance output { font-size: 16px; }
}
@media (max-width: 359px), (max-height: 499px) and (orientation: landscape) {
  .quick-pot-controls { grid-template-columns: minmax(0,1fr) 48px repeat(2,44px) 72px; gap: 4px; }
  .quick-pot-balance output { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .quick-pot-controls button { transition: none; } }
