:root {
  --bg: #0d1117; --panel: #161b22; --border: #2d333b; --text: #e6edf3;
  --muted: #8b949e; --accent: #4c9aff; --good: #3fb950; --bad: #f85149;
}
* { box-sizing: border-box; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.topbar .brand { font-weight: 700; font-size: 17px; color: var(--text); }
.topbar nav { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 14px 0; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 15px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { cursor: pointer; border: 0; border-radius: 8px; font-size: 15px; padding: 10px 14px; }
.btn-primary { background: var(--accent); color: #06101f; font-weight: 600; width: 100%; margin-top: 14px; }
.btn-link { background: none; color: var(--accent); padding: 4px 0; font-size: 14px; }
.error { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 18px; }
.reqs { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.reqs li.ok { color: var(--good); }
.muted { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { background: none; color: var(--muted); padding: 10px 12px; border-radius: 0; border-bottom: 2px solid transparent; font-size: 14px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.row { display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.cardname { font-weight: 600; font-size: 14px; }
.cardsub { font-size: 12.5px; color: var(--muted); }
.pill { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.spendgrid { display: grid; grid-template-columns: 1fr 110px; gap: 8px 12px; align-items: center; }
.spendgrid .cat { font-size: 14px; }
.big { font-size: 26px; font-weight: 700; }
.good { color: var(--good); }
table.res { width: 100%; border-collapse: collapse; font-size: 14px; }
table.res td, table.res th { padding: 7px 4px; border-bottom: 1px solid var(--border); text-align: left; }
table.res td.num, table.res th.num { text-align: right; white-space: nowrap; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.cond { color: #d29922; font-size: 12px; }
h2 { font-size: 16px; margin: 4px 0 8px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.card-detail { flex-basis: 100%; width: 100%; padding: 6px 0 8px 28px; font-size: 13px; line-height: 1.5; color: var(--muted, #9aa); }
.card-detail div { margin: 2px 0; }
.card-detail a { color: #6ea8fe; }
.chcat label { display: inline-block; margin: 2px 10px 2px 0; font-size: 13px; color: var(--text, #dde); }
.chcat input { margin-right: 4px; }
.chcat-off { opacity: 0.55; }
.chcat-note { font-size: 11.5px; color: var(--muted); margin: 0 0 2px 22px; }

.cat.sub { font-size: .78rem; opacity: .75; padding-left: 12px; }
.note-details summary { cursor: pointer; text-decoration: underline; }
.note-details p { margin-top: 6px; }

.cardart { width: 46px; height: auto; border-radius: 5px; flex: 0 0 auto; box-shadow: 0 1px 2px rgba(0,0,0,.35); }

.cardname { overflow-wrap: anywhere; }
.row .pill { flex: 0 0 auto; }
