:root {
  color-scheme: light;
  --paper: #f4efe6;
  --card: #fffdf8;
  --ink: #1c1915;
  --muted: #6d655b;
  --line: #e2d8c8;
  --income: #1d6b45;
  --expense: #9a3d2f;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

.wrap {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}

h1, h2 { font-family: Georgia, "Iowan Old Style", serif; font-weight: 500; }

h1 { margin: 0; font-size: 3rem; line-height: 1; }

.lede { margin: 0.75rem 0 0; max-width: 36rem; color: var(--muted); }

main { padding-bottom: 3rem; }

.flashes {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fff6d8;
  border: 1px solid #e6d39a;
}

.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.totals article, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}

.panel { margin-top: 0.75rem; }

h2 { margin: 0 0 0.75rem; font-size: 1.25rem; }

.figure {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 1.7rem;
}

.income { color: var(--income); }
.expense { color: var(--expense); }

.entry-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.wide { grid-column: 1 / -1; }

input, select, button {
  font: inherit;
  color: var(--ink);
}

input, select {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
}

button {
  background: var(--ink);
  color: #fffdf8;
  border: 0;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

button.text {
  background: transparent;
  color: var(--expense);
  padding: 0;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.num { text-align: right; font-variant-numeric: tabular-nums; }

.tag {
  display: inline-block;
  text-transform: capitalize;
  font-size: 0.8rem;
}

.empty { margin: 0; color: var(--muted); }

@media (max-width: 720px) {
  .totals, .entry-form { grid-template-columns: 1fr; }
  h1 { font-size: 2.4rem; }
}
