.ledger { display:grid; grid-template-columns:1fr 1fr; gap:1rem; align-items:start; }
.controls input:not([type=number]) { width:100%; padding:.65rem; background:#0d0f10; border:1px solid #51575a; border-radius:7px; color:inherit; }
.pair,.bar,article { display:flex; align-items:center; gap:.65rem; }
.pair label { flex:1; min-width:0; }
.pair input { display:block; }
.pair button { align-self:end; margin-bottom:.45rem; }
#lend { margin-top:.75rem; }
#inventory { max-height:12rem; overflow:auto; padding:0; list-style:none; }
#inventory li { padding:.45rem 0; border-bottom:1px solid #353d37; display:flex; justify-content:space-between; gap:.6rem; }
#inventory li b { font-weight:600; color:var(--text-2); white-space:nowrap; }
.records { margin-top:1rem; padding:clamp(15px,3vw,30px); background:#17201c; border:1px solid #39473d; border-radius:14px; }
.bar,article { justify-content:space-between; }
.bar h2 { margin:0; }
#filter { width:auto; margin:.75rem 0; }
#rows article { border-top:1px solid #3d483f; padding:.8rem 0; }
article div { overflow-wrap:anywhere; }
article p { margin:.35rem 0 0; font-size:.85rem; }
article form { display:flex; gap:.4rem; flex-shrink:0; }
article input[type=number] { width:4rem; }
.late,#status { color:#efbf83; }
@media(max-width:680px){.ledger{grid-template-columns:1fr;}article{flex-wrap:wrap;}}
[data-theme="light"] .controls input:not([type=number]) { background:var(--bg);color:var(--text); }
[data-theme="light"] .records { background:#f3f8f4;border-color:#b8cbbb; }
[data-theme="light"] .late, [data-theme="light"] #status { color:#8d471b; }
@media(max-width:680px){.ledger:has(#item:empty)>.controls:nth-child(2){grid-row:1;}}

.controls label { display:block; }
.controls label span { display:block; margin-bottom:.3rem; }
.starter { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem .8rem; margin-top:1rem; }
.starter span { color:var(--text-3); font-size:.9rem; }
.tip { font-size:.88rem; }
#status:empty { display:none; }
article form button { min-width:5.5em; }
[data-theme="light"] select, [data-theme="light"] input[type=number] { background:#fff; color:var(--text); }
[data-theme="light"] button.primary { color:#fff; }
[data-theme="light"] #inventory li, [data-theme="light"] #rows article { border-color:var(--border); }
