/* One compact ledger control across headers, managers and forms. Native selects
   retain keyboard navigation and the platform's accessible option menu. */
:root{
  --ledger-book:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2349830e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5C8 2 4 3 2 4v15c4-2 7-1 10 1 3-2 6-3 10-1V4c-2-1-6-2-10 1v15'/%3E%3C/svg%3E");
  --ledger-down:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23798570' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}
select.ledger-switch,button.ledger-switch{
  box-sizing:border-box;min-width:0;max-width:100%;height:44px;min-height:44px;
  border:1px solid var(--line);border-radius:14px;background-color:var(--soft,#f0f8e8);
  color:var(--ink);font-family:inherit;line-height:1.3;letter-spacing:0;text-align:left;
  box-shadow:0 1px 2px #3d4d3210;cursor:pointer;
  transition:background-color .15s,border-color .15s,box-shadow .15s;
}
select.ledger-switch{
  display:block;flex:0 1 200px;width:200px;margin:0 auto;padding:0 32px 0 39px;
  appearance:none;-webkit-appearance:none;font-size:13px;font-weight:600;
  background-image:var(--ledger-book),var(--ledger-down);
  background-position:13px center,right 11px center;background-size:17px 17px,14px 14px;
  background-repeat:no-repeat;text-overflow:ellipsis;white-space:nowrap;
}
select.ledger-switch option{background:white;color:var(--ink)}
button.ledger-switch{display:inline-flex;align-items:center;gap:9px;padding:0 12px;font-size:13px;font-weight:600}
.ledger-switch-icon{display:grid;place-items:center;flex:none}
.ledger-switch-icon svg{width:17px;height:17px;stroke-width:1.7}
.ledger-switch-chevron{width:6px;height:6px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:translateY(-2px) rotate(45deg);opacity:.65;margin-left:3px;flex:none}
select.ledger-switch:hover:not(:disabled),button.ledger-switch:hover:not(:disabled){background-color:var(--soft,#f0f8e8);border-color:var(--line)}
select.ledger-switch:focus-visible,button.ledger-switch:focus-visible,.cash-ledgers button:focus-visible{outline:2px solid #d4e7c3;outline-offset:3px}
select.ledger-switch:disabled,button.ledger-switch:disabled{cursor:default;opacity:.65;box-shadow:none}
.dialog-head select.ledger-switch{width:200px;background-color:#fff;color:var(--ink);border-color:#ffffffb3;box-shadow:0 2px 5px #37492a12}
.report-header button.ledger-switch{background-color:#ffffff16;border-color:#ffffff35;color:white;box-shadow:none}
.report-header button.ledger-switch:hover:not(:disabled){background-color:#ffffff25;border-color:#ffffff65}
label:has(>select.ledger-switch):not(.budget-field){gap:8px}
:is(.metadata-manager,.category-manager,.loans-dialog) label:has(>select.ledger-switch),label.category-ledger-label{
  display:flex;flex-direction:row;align-items:center;justify-content:center;
  gap:10px;margin:10px 0 14px;width:100%;font-size:12px;color:var(--muted);
}
.category-ledger-label select.ledger-switch{margin:0;width:200px;max-width:calc(100% - 65px);min-height:44px;padding:0 32px 0 39px}
.entity-scope select.ledger-switch{margin:0;flex:1;max-width:240px}
.budget-extra select.ledger-switch{margin:0}
/* The cashflow shelf uses the same shape without a dropdown arrow: each chip
   selects its ledger directly. Keep it horizontally scrollable. */
.cash-expanded{padding-bottom:18px}
.cash-expanded h1{margin-bottom:16px}
.cash-ledgers{gap:8px;padding:3px 2px 5px}
.cash-ledgers button{
  flex:0 0 auto;flex-direction:row;gap:8px;min-height:44px;max-width:200px;
  padding:0 13px;border:1px solid #ffffff30;border-radius:14px;background:#ffffff0c;
  color:var(--soft,#f0f8e8);transition:background-color .15s,border-color .15s;
}
.cash-ledgers button.active{background:#fff;color:var(--muted);border-color:#fff;box-shadow:0 2px 6px #435c3118}
.cash-ledgers button:hover:not(.active){background:#ffffff20;border-color:#ffffff60}
.cash-ledgers button>span:last-child{font-size:13px;font-weight:600}
.cash-ledgers .ledger-glyph{height:22px;width:22px;flex:none;font-size:23px;color:inherit}
.cash-ledgers .ledger-glyph svg{width:19px;height:19px;stroke-width:1.7}
.cash-ledgers .ledger-glyph .ledger-symbol{width:22px;height:22px;font-size:19px;border-radius:0}
.cash-ledgers [data-cash-add-ledger]{border-style:dashed;color:var(--soft,#f0f8e8)}
.cash-header.compact .cash-collapse{justify-content:space-between;border:1px solid #ffffff35;border-radius:14px;background:#ffffff16;padding:0 10px;gap:7px}
.cash-header.compact .cash-collapse span{font-size:13px;font-weight:600}
.cash-header .cash-collapse b{font-size:18px;opacity:.75}
@media(max-width:360px){
  .report-title-row{gap:9px}.report-title-row .ledger-switch{max-width:56%;gap:6px;padding-inline:9px}
  .cash-expanded{padding-inline:16px}.cash-ledgers button{max-width:180px}
}
@media(prefers-reduced-motion:reduce){select.ledger-switch,button.ledger-switch,.cash-ledgers button{transition:none}}
