:root {
  --bg: #161616; --side: #1c1c1c; --card: #2a2a2a; --line: #3a3a3a;
  --text: #ececec; --muted: #9b9b9b; --accent: #6aa3c8; --in: #3d9a32; --out: #d05757;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.4 ui-sans-serif, system-ui, sans-serif; }
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; height: 100vh; }
aside { display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); min-height: 100vh; height: 100vh; position: sticky; top: 0; }
.side-top { flex: 1 1 auto; overflow: auto; padding: 14px 10px 12px; }
.side-bottom { flex: 0 0 auto; margin-top: auto; padding: 10px 10px 14px; border-top: 1px solid var(--line); background: var(--side); }
aside h1 { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 16px 8px 12px; }
.acct { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; margin-bottom: 4px; }
.acct .meta { min-width: 0; }
.acct.on { background: var(--card); }
.acct small { display: block; color: var(--muted); font-size: 11px; }
.acct .x { color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0 2px; }
#navAll { margin-bottom: 4px; }
#allMini { font-variant-numeric: tabular-nums; }
main { padding: 16px 20px 80px; max-width: 1180px; overflow: auto; }
.kicker { color: var(--muted); font-size: 13px; }
.bal-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.balance { font-size: 1.7rem; font-weight: 650; margin: 4px 0; }
.balance .chf { color: var(--muted); font-size: 1.05rem; font-weight: 500; margin-left: 8px; }
.spot { text-align: right; margin-left: auto; }
.spot b { display: block; font-size: 1.7rem; font-weight: 650; letter-spacing: -0.02em; }
.ranges button, button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 16px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.ranges button.on { color: var(--text); border-color: var(--accent); }
#chartWrap, .chart-wrap { position: relative; height: 168px; margin: 10px 0 6px; }
#chartWrap svg, .chart-wrap svg { width: 100%; height: 168px; display: block; }
#tip, .tip { display: none; position: absolute; pointer-events: none; z-index: 2; background: #111; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
#tip span, .tip span { display: block; color: var(--muted); font-size: 12px; }
.progress { color: var(--muted); min-height: 1.3em; }
h2 { font-size: 1rem; margin: 20px 0 10px; }
.card { background: var(--card); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.card > summary { list-style: none; display: grid; grid-template-columns: 26px minmax(0, 1fr) 148px; gap: 10px; align-items: center; padding: 11px 14px; cursor: pointer; }
.card > summary::-webkit-details-marker { display: none; }
.arrow.in { color: var(--in); }
.arrow.out { color: var(--out); }
.title { font: 600 12.5px ui-monospace, monospace; white-space: nowrap; overflow-x: auto; }
.when { color: var(--muted); font-size: 12px; }
.amt { text-align: right; white-space: nowrap; }
.amt.in { color: var(--in); }
.amt.out { color: var(--out); }
.amt .fiat { display: block; font-size: 11px; opacity: .85; }
.detail { border-top: 1px solid var(--line); padding: 12px 14px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 10px; }
.kv b { color: var(--muted); font-weight: 500; }
.kv span, .kv a { word-break: break-all; }
.fluss { margin: 4px 0 14px; background: #111; border: 1px solid var(--line); border-radius: 8px; }
.fluss > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; cursor: pointer; color: var(--text); font-weight: 650; }
.fluss > summary::-webkit-details-marker { display: none; }
.fluss > summary span { color: var(--accent); font-weight: 500; font-size: 12px; }
.fluss[open] > summary span::after { content: "Diagramm ausblenden"; }
.fluss:not([open]) > summary span::after { content: "Diagramm anzeigen"; }
.flow { width: 100%; height: auto; min-height: 168px; display: block; }
.flow-label { fill: #f3f3f3; font: 11px ui-monospace, monospace; }
.io { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.io h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 650; }
.io .row-io { padding: 6px 0; border-bottom: 1px solid var(--line); font: 12px ui-monospace, monospace; }
.io .row-io b { display: block; font-weight: 600; color: var(--text); word-break: break-all; }
details.box { margin-top: 18px; }
details.box > summary { color: var(--muted); cursor: pointer; font-weight: 650; }
textarea, input, select { width: 100%; background: #222; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: 13px ui-monospace, monospace; margin: 6px 0; }
input[type="password"], input[type="number"], select { width: auto; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button.pri { background: var(--accent); color: #111; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 650; cursor: pointer; }
button:disabled { opacity: .45; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 4px; }
td { padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.addr { font-family: ui-monospace, monospace; }
#allRows tr[data-id] { cursor: pointer; }
#allRows tr[data-id]:hover td { background: var(--card); }
a { color: var(--accent); }
pre.trace { background: #222; padding: 8px; font: 12px ui-monospace, monospace; white-space: pre-wrap; max-height: 120px; overflow: auto; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
#kindHint { min-width: 4.5rem; }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; height: auto; }
  aside { position: relative; height: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-top { max-height: 50vh; }
  .io { grid-template-columns: 1fr; }
}
