:root {
  color-scheme: light dark;
  --bg: #f4f4f7;
  --fg: #1a1a1a;
  --card: #fff;
  --accent: #2b6cb0;
  --error: #c53030;
  --muted: #666;
  --border: #cbd5e0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #f0f0f0;
    --card: #1c1f26;
    --muted: #9aa3ad;
    --border: #2d333b;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}
header h1 { margin: 0; font-size: 1.25rem; }
header .user { display: flex; gap: 1rem; align-items: center; font-size: .9rem; }
header button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  color: var(--fg);
  cursor: pointer;
}
main {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  gap: 1.5rem;
}
section {
  background: var(--card);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
section h2 { margin: 0 0 1rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.balance-value { font-size: 2.5rem; font-weight: 700; }
.balance-hint { color: var(--muted); margin: .5rem 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.actions button {
  flex: 1 1 auto;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  min-width: 180px;
}
.actions button:disabled {
  background: var(--border);
  cursor: not-allowed;
}
.status { width: 100%; margin: 0; color: var(--muted); font-size: .85rem; }
.status.error { color: var(--error); }
.history ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.history li {
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
}
.history li.empty { color: var(--muted); font-style: italic; border-style: dashed; }
.history li a { color: var(--fg); text-decoration: none; display: flex; justify-content: space-between; }
.history time { color: var(--muted); font-variant-numeric: tabular-nums; }
