/* TimeBank — paper, ink, and one big number.
   Kid view uses the system rounded face (SF Rounded on iPad): friendly,
   native, zero downloads. Parent view stays utilitarian. */

:root {
  --paper: #FBFAF7;
  --ink: #16181B;
  --muted: #6B6F76;
  --line: #E4E1DA;
  --earned: #2F7D4F;
  --pending: #C97F1B;
  --danger: #B3402E;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px; line-height: 1.45;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#app { max-width: 680px; margin: 0 auto; padding: 20px 16px 48px; }

button {
  font: inherit; border: none; border-radius: var(--radius);
  cursor: pointer; touch-action: manipulation;
}
input, select {
  font: inherit; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; width: 100%;
}
input:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(47,125,79,.4); outline-offset: 1px;
}

/* ---------- kid view: rounded face, giant targets ---------- */
.kidview { font-family: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif; }

.kid-head { display: flex; align-items: baseline; justify-content: space-between; }
.kid-name { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.kid-date { color: var(--muted); font-size: 15px; }

/* signature: the bank counter */
.bank {
  margin: 18px 0 26px; padding: 26px 22px; border-radius: 26px;
  background: var(--ink); color: var(--paper); text-align: center;
}
.bank .num {
  font-size: 76px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.bank .lbl { font-size: 15px; opacity: .65; margin-top: 6px; }

.tasklist { display: flex; flex-direction: column; gap: 12px; }
.taskcard {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 20px 18px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 19px; font-weight: 700; min-height: 72px;
}
.taskcard .mins { font-weight: 800; white-space: nowrap; }
.taskcard:active { transform: scale(.985); }
.taskcard.pending { border-color: var(--pending); color: var(--pending); background: #FDF6EB; }
.taskcard.approved { border-color: var(--earned); color: var(--earned); background: #EFF6F1; }
.taskcard.approved .check { animation: pop .3s ease; }
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

.spend {
  display: block; width: 100%; margin-top: 26px; padding: 20px;
  font-size: 19px; font-weight: 800; background: var(--earned); color: #fff;
}
.spend:disabled { background: var(--line); color: var(--muted); }
.spend-row { display: flex; gap: 10px; margin-top: 14px; }
.spend-row button {
  flex: 1; padding: 18px 0; font-size: 18px; font-weight: 800;
  background: #fff; border: 1.5px solid var(--line);
}
.spend-row button:disabled { opacity: .35; }

.note { color: var(--muted); font-size: 15px; margin-top: 14px; text-align: center; }

/* ---------- kid picker ---------- */
.picker { display: flex; flex-direction: column; gap: 14px; margin-top: 30px; }
.picker button {
  padding: 26px 20px; font-size: 22px; font-weight: 800; color: #fff;
  display: flex; justify-content: space-between; align-items: center;
}
.picker .bal { font-size: 16px; font-weight: 600; opacity: .85; }

/* ---------- parent view ---------- */
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 17px; text-transform: uppercase; letter-spacing: .06em;
     color: var(--muted); margin: 28px 0 10px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.row .meta { color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 8px; }
.btn { padding: 10px 16px; font-weight: 700; font-size: 15px; }
.btn.ok { background: var(--earned); color: #fff; }
.btn.no { background: #fff; border: 1.5px solid var(--line); color: var(--danger); }
.btn.ghost { background: #fff; border: 1.5px solid var(--line); }
.btn.wide { width: 100%; padding: 14px; margin-top: 10px; background: var(--ink); color: #fff; }

.tabs { display: flex; gap: 8px; margin: 16px 0 4px; flex-wrap: wrap; }
.tabs button {
  padding: 9px 14px; font-weight: 700; font-size: 15px;
  background: #fff; border: 1.5px solid var(--line);
}
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.field { margin: 12px 0; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.pill { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 99px; color: #fff; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }
.linklike { background: none; color: var(--muted); text-decoration: underline; padding: 8px; }
.topbar { display: flex; justify-content: space-between; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
