:root {
  color-scheme: light dark;
  --background: #f4f6f2;
  --surface: #fff;
  --total-surface: #e5eee7;
  --text: #20352f;
  --muted: #53695e;
  --line: #d8e0da;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #17231e;
    --surface: #22312a;
    --total-surface: #2c4035;
    --text: #eef4ed;
    --muted: #bdd0c6;
    --line: #445e51;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 16px/1.6 system-ui, sans-serif;
}

main { max-width: 48rem; margin: auto; padding: clamp(1rem, 4vw, 2rem); }
header { margin-bottom: 1rem; }
h1 { margin: 0; font-size: 1.5rem; }
h2 { margin: 0; font-size: 1.125rem; }
.demo-label, .month-label { margin: 0; font-size: 0.875rem; color: var(--muted); }

.card {
  padding: clamp(1rem, 4vw, 1.5rem);
  margin-bottom: 0.875rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.total-card { background: var(--total-surface); }
.total-card h2 { margin-top: 0.25rem; }

.living-amount {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.total-amount { margin: 0.75rem 0 0; }
.living-amount, .total-amount, dd { font-variant-numeric: tabular-nums; }
dl { margin: 0.5rem 0 0; }

dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 0.75rem;
  padding-block: 0.55rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

dl > div:last-child { border-bottom: 0; }
dd { margin: 0; text-align: end; }
