:root { --bg:#fff; --fg:#1b1b1f; --mute:#6b6b76; --line:#e4e4ea; --head:#f6f6f9; --acc:#2a6df4;
  --own:#1a7f4b; --borrowed:#b06000; --unk:#8a8a94; --bad:#c0392b; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#141418; --fg:#e8e8ee; --mute:#9a9aa6; --line:#2c2c34; --head:#1c1c22; --acc:#6f9bff;
    --own:#4cc38a; --borrowed:#f0a040; --unk:#77777f; --bad:#ff6b5e; }
}
* { box-sizing: border-box; }
body { margin:0; font:14px/1.45 system-ui, "Hiragino Sans", "Yu Gothic UI", sans-serif; background:var(--bg); color:var(--fg); }
header { display:flex; gap:16px; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--bg); z-index:2; }
h1 { font-size:18px; margin:0; }
#meta { margin-left:auto; color:var(--mute); font-size:12px; }
.tab { border:1px solid var(--line); background:none; color:var(--fg); padding:4px 10px; border-radius:6px; cursor:pointer; }
.tab.on { background:var(--acc); color:#fff; border-color:var(--acc); }
section { padding:12px 16px; }
#filters { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-start; }
#q { padding:6px 10px; min-width:260px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); }
fieldset { border:1px solid var(--line); border-radius:6px; padding:4px 8px; margin:0; }
legend { color:var(--mute); font-size:12px; padding:0 4px; }
.chips { display:flex; flex-wrap:wrap; gap:4px 10px; }
.chips label { white-space:nowrap; cursor:pointer; }
#reset { padding:6px 10px; border:1px solid var(--line); border-radius:6px; background:none; color:var(--fg); cursor:pointer; }
#count { color:var(--mute); margin:8px 0; }
.scroll { overflow:auto; max-height:calc(100vh - 230px); border:1px solid var(--line); border-radius:6px; }
table { border-collapse:collapse; width:100%; }
th, td { padding:5px 8px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
th { background:var(--head); position:sticky; top:0; cursor:pointer; user-select:none; white-space:nowrap; z-index:1; }
th.asc::after { content:" ▲"; } th.desc::after { content:" ▼"; }
td.date { white-space:nowrap; font-variant-numeric:tabular-nums; }
td.notes { color:var(--mute); max-width:380px; }
a { color:var(--acc); text-decoration:none; } a:hover { text-decoration:underline; }
.pill { display:inline-block; padding:0 6px; border-radius:10px; font-size:12px; border:1px solid currentColor; white-space:nowrap; }
.liq-own { color:var(--own); } .liq-borrowed { color:var(--borrowed); } .liq-unknown { color:var(--unk); }
.st-closed, .st-winding_down { color:var(--bad); }
.tracked { font-size:11px; color:var(--acc); margin-left:4px; }
.src { font-size:11px; margin-left:4px; }
#chg td:first-child { white-space:nowrap; font-variant-numeric:tabular-nums; color:var(--mute); }
td.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
