:root {
  --orange: #f57c00;
  --orange-dark: #c25e00;
  --cream: #fff8f0;
  --ink: #2b1a0e;
  --muted: #6b5444;
  --line: #f1e4d8;
  --green: #1f8a3b;
  --red: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}
header.bar {
  background: var(--orange);
  color: #fff;
  padding: 16px;
}
header.bar .inner {
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
header.bar a.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; }
header.bar h1 { margin: 0; font-size: 1rem; font-weight: 600; opacity: 0.95; flex: 1; text-align: right; }
main { max-width: 560px; margin: 24px auto 48px; padding: 0 16px; }
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(43, 26, 14, 0.08);
  padding: 24px;
  margin-bottom: 20px;
}
h2 { margin: 0 0 12px; color: var(--orange-dark); font-size: 1.25rem; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
label { display: block; font-weight: 600; margin-bottom: 14px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input {
  display: block; width: 100%; margin-top: 6px;
  padding: 12px 14px; font: inherit; font-size: 1.05rem;
  border: 2px solid var(--line); border-radius: 10px; background: #fffdfa; color: var(--ink);
}
input:focus { outline: none; border-color: var(--orange); }
button {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 10px; padding: 12px 18px;
  background: var(--orange); color: #fff;
}
button:hover { background: var(--orange-dark); }
button[disabled] { opacity: 0.6; cursor: default; }
button.link { background: none; color: var(--orange-dark); padding: 4px 0; text-decoration: underline; font-weight: 600; }
button.full { width: 100%; }
.msg { margin-top: 12px; font-weight: 600; }
.msg.error { color: var(--red); }
.msg.ok { color: var(--green); }
.balance { font-size: 3rem; font-weight: 800; color: var(--green); line-height: 1.1; }
.balance small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.history { list-style: none; margin: 0; padding: 0; }
.history li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.history li:last-child { border-bottom: 0; }
.history .when { color: var(--muted); font-size: 0.85rem; display: block; }
.history .amt { font-weight: 700; white-space: nowrap; }
.history .earn { color: var(--green); }
.history .spend { color: var(--red); }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > * { flex: 1; }
.results { list-style: none; margin: 12px 0 0; padding: 0; }
.results button {
  width: 100%; text-align: left; margin-bottom: 8px;
  background: var(--cream); color: var(--ink); font-weight: 400;
  display: flex; justify-content: space-between; gap: 12px;
}
.results button:hover { background: var(--line); }
.results b { display: block; }
.picked { background: var(--cream); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.hidden { display: none !important; }
footer { text-align: center; color: #8a7464; font-size: 0.9rem; padding: 0 16px 32px; }
