:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #2b2a27;
  --soft: #6b675f;
  --line: #e2ddd2;
  --accent: #2f6f4f;
  --out: #a3412f;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
h1, h2 { text-wrap: balance; margin: 0.4em 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p, li, .hint { text-wrap: pretty; }
a { color: var(--accent); }
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0;
  color: inherit;
  text-decoration: none;
}
.card p { margin: 4px 0; }
.kid-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.balance { font-weight: 700; font-size: 1.3rem; color: var(--accent); white-space: nowrap; }
.balance.big { font-size: 2rem; }
.hint { color: var(--soft); font-size: 0.9rem; }
.error { color: var(--out); font-weight: 600; min-height: 0; }
.error:empty { display: none; }
.back { text-decoration: none; font-weight: 600; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
button { font: inherit; }
.tab, .primary {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  padding: 8px 12px;
}
.tab.on { border-color: var(--accent); background: #e7f1ec; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; margin-top: 8px; }
.primary:disabled { opacity: 0.6; }
.link { background: none; border: 0; color: var(--soft); text-decoration: underline; padding: 8px 0; }
.field { display: block; margin: 10px 0; }
.field > span:first-child { display: block; font-weight: 600; margin-bottom: 4px; }
input, select {
  font: inherit;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.history { list-style: none; padding: 0; margin: 0; }
.history li {
  display: grid;
  grid-template-columns: 6.5em 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.when { color: var(--soft); font-size: 0.9rem; }
.amt { font-weight: 700; white-space: nowrap; color: var(--accent); }
.amt.out { color: var(--out); }
.foot { margin-top: 24px; }
.section-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0 12px; padding-bottom: 4px; }
.section-tabs .tab { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; min-height: 44px; }
