:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --ok: #86efac;
  --error: #fca5a5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.card {
  width: 100%;
  max-width: 460px;
  padding: 28px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
}

.brand h1 { margin: 0; font-size: 22px; }
.sub { margin: 4px 0 20px; color: var(--muted); font-size: 13px; }
.who { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.section { margin: 22px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

label { display: block; margin: 12px 0 6px; font-size: 13px; color: #cbd5e1; }

input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

button {
  width: 100%;
  margin-top: 18px;
  padding: 11px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled { opacity: .6; cursor: progress; }
button.secondary { background: var(--line); color: var(--text); }
.actions { margin-top: 22px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--bg); border-radius: 10px; padding: 12px; }
.stat span { display: block; color: var(--muted); font-size: 12px; }
.stat strong { font-size: 20px; }

.list { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }
.list li.empty { color: var(--muted); justify-content: flex-start; }
.list .amount { font-variant-numeric: tabular-nums; color: var(--ok); }
.list .amount.minus { color: var(--error); }

.msg { margin: 16px 0 0; font-size: 13px; min-height: 18px; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--ok); }

.hidden { display: none; }
