:root{
  color-scheme:light dark;
  --aqua:#00FCD3; --teal:#0EB4A0; --teal-dark:#067A68; --teal-deep:#0A7A66;
  --bg:#F5F7F7; --surface:#FFFFFF; --surface2:#EEF2F2; --border:#D7DEDF;
  --text:#111718; --muted:#5E6C6F;
  --gold:#F5B301; --red:#E5484D; --green:#147A52;
  --radius:16px; --tabbar-h:68px;
}
/* dark theme — same accents, surfaces go dark */
[data-theme="dark"]{
  color-scheme:dark;
  --aqua:#00FCD3; --teal:#0EB4A0; --teal-dark:#3ADDC2;
  --bg:#0C1212; --surface:#15201F; --surface2:#1E2B2A; --border:#2B3A38;
  --text:#EFF6F5; --muted:#93A5A3;
  --gold:#FFC53D; --red:#F27373; --green:#3ED598;
}
[data-theme="dark"] .pct-input{background:var(--surface);}
[data-theme="dark"] .kidname-grid button:active{background:#1D3833;}
[data-theme="dark"] .toast{background:var(--surface);color:var(--text);}
[data-theme="dark"] .nudge{background:#2E2614;}
[data-theme="dark"] .form-err{background:#3A1E1E;color:#FFA3A3;border-color:#5E2B2B;}
[data-theme="dark"] .form-ok{background:#123B2D;color:#7FE3C0;border-color:#1F5C45;}
[data-theme="dark"] .tag.pending{background:#3A2E10;color:#FFD968;}
[data-theme="dark"] .tag.approved{background:#123B2D;color:#7FE3C0;}
[data-theme="dark"] .tag.redo{background:#3A2410;color:#FFB37A;}
[data-theme="dark"] .tag.rejected{background:#3A1E1E;color:#FFA3A3;}
[data-theme="dark"] .tag.paid{background:#1B2A4A;color:#9DBCFF;}
[data-theme="dark"] .tag.rel{background:#2A1E4A;color:#C4A8FF;}
[data-theme="dark"] .neg{color:#FF9B9B;}
[data-theme="dark"] .streak{color:#FFB14D;}
[data-theme="dark"] .card,[data-theme="dark"] .item,[data-theme="dark"] .trophy-card{box-shadow:0 1px 2px rgba(0,0,0,.35);}
/* "Waiting for payday" card — celebratory tint, readable in both themes */
.payday-wait{border:2px solid var(--teal);background:linear-gradient(135deg,#EFFDF8,#E6FBF3);}
[data-theme="dark"] .payday-wait{background:linear-gradient(135deg,#0F2E28,#123B30);}
.payday-amt{font-size:26px;font-weight:800;color:var(--teal-dark);white-space:nowrap;}
.streak{color:#d97a00;font-weight:800;}
.theme-toggle{background:transparent;border:1px solid var(--border);border-radius:10px;
  font-size:17px;line-height:1;padding:6px 9px;cursor:pointer;flex:none;color:var(--teal-dark);}
.theme-toggle:active{transform:scale(.94);}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0;padding:0;overflow-x:clip;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--text); font-size:16px; line-height:1.45;
  max-width:520px; margin:0 auto; min-height:100vh; min-height:100dvh;
  touch-action:manipulation; /* no double-tap zoom; pinch still works */
}
#app{min-height:100vh; min-height:100dvh; display:flex; flex-direction:column;}
.splash{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;}
.splash-logo{width:200px;height:auto;}
.spinner{width:28px;height:28px;border-radius:50%;border:3px solid var(--border);border-top-color:var(--teal);animation:spin 0.8s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}

/* header */
.topbar{
  position:sticky;top:0;z-index:20;background:var(--surface);
  border-bottom:1px solid var(--border);padding:10px 16px;
  display:flex;align-items:center;gap:10px;
}
.topbar img.logo{height:34px;width:auto;}
.topbar .who{margin-left:auto;font-size:13px;color:var(--muted);
  max-width:34vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:none;}
.topbar .who b{color:var(--text);}

/* layout */
.page{flex:1;padding:16px 16px calc(var(--tabbar-h) + 24px);animation:fadein .18s ease;}
@keyframes fadein{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:none;}}
.page.no-tabs{padding-bottom:32px;}
h1{font-size:24px;margin:4px 0 4px;letter-spacing:-0.3px;}
h2{font-size:18px;margin:18px 0 8px;}
h3.timesec{font-size:15px;margin:14px 0 6px;color:var(--teal-dark);}
.sub{color:var(--muted);font-size:14px;margin:0 0 12px;}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin:0 0 12px;box-shadow:0 1px 2px rgba(17,23,24,.04);}
.row{display:flex;align-items:center;gap:10px;}
.grow{flex:1;}
.muted{color:var(--muted);} .small{font-size:13px;} .tiny{font-size:12px;}
.center{text-align:center;}
.mt{margin-top:12px;} .mb{margin-bottom:12px;}
.hidden{display:none !important;}

/* segmented toggle (signup mode: new family vs join) */
.seg{display:flex;background:var(--surface2);border-radius:14px;padding:4px;gap:4px;margin-bottom:14px;}
.seg button{flex:1;border:0;background:transparent;border-radius:10px;padding:10px 6px;
  font-size:14px;font-weight:600;color:var(--muted);cursor:pointer;}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(17,23,24,.12);}

/* hero counter */
.hero{
  background:linear-gradient(135deg,var(--teal) 0%,#08D9B8 60%,var(--aqua) 100%);
  border-radius:20px;padding:22px 18px;color:#fff;margin-bottom:14px;
  box-shadow:0 6px 18px rgba(14,180,160,.28);
}
.hero .label{font-size:13px;opacity:.92;text-transform:uppercase;letter-spacing:.8px;font-weight:600;}
.hero .amount{font-size:44px;font-weight:800;letter-spacing:-1px;margin:2px 0;}
.hero .meta{display:flex;gap:14px;font-size:13px;opacity:.95;margin-top:6px;}
.hero .meta b{font-weight:700;}
.hero.child{background:linear-gradient(135deg,#7C5CFF 0%,#0EB4A0 100%);}

/* slim family-total strip (budgeting line under per-kid heroes) */
.slimstrip{background:var(--surface2);border:1px solid var(--border);border-radius:12px;
  padding:10px 14px;margin-bottom:14px;display:flex;gap:14px;flex-wrap:wrap;
  font-size:13px;color:var(--muted);}
.slimstrip b{color:var(--text);font-weight:800;}
.hero .streak{color:#fff;}

/* buttons */
.btn{
  display:block;width:100%;border:0;border-radius:14px;padding:14px 16px;
  font-size:16px;font-weight:700;cursor:pointer;text-align:center;
  background:linear-gradient(135deg,var(--teal),#0BD8B6);color:#fff;
  box-shadow:0 3px 10px rgba(14,180,160,.3);
}
.btn:active{transform:scale(.98);}
.btn:disabled{opacity:.55;box-shadow:none;}
.btn.secondary{background:var(--surface2);color:var(--text);box-shadow:none;border:1px solid var(--border);}
.btn.danger{background:var(--surface2);color:var(--red);box-shadow:none;border:1px solid var(--border);}
.pill{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;border-radius:20px;background:var(--surface2);color:var(--muted);border:1px solid var(--border);vertical-align:middle;}
.pill.danger{background:rgba(255,80,80,.12);color:var(--red);border-color:rgba(255,80,80,.35);}
.btn.ghost{background:transparent;color:var(--teal-dark);box-shadow:none;padding:10px;}
.btn.small{width:auto;padding:9px 14px;font-size:14px;border-radius:11px;display:inline-block;}
.btnrow{display:flex;gap:8px;margin-top:10px;}
.btnrow .btn{margin:0;}

/* forms */
.field{margin:0 0 12px;}
.field label{display:block;font-size:13px;font-weight:600;color:var(--muted);margin-bottom:6px;}
.input,select.input,textarea.input{
  width:100%;border:1px solid var(--border);border-radius:12px;padding:13px 14px;
  font-size:16px;background:var(--surface);color:var(--text);font-family:inherit;
}
.input:focus{outline:2px solid var(--aqua);border-color:var(--teal);}
textarea.input{resize:vertical;min-height:70px;}
.form-err{background:#FDECEC;color:#B3261E;border:1px solid #F5C6C6;border-radius:12px;padding:10px 12px;font-size:14px;margin-bottom:12px;}
.form-ok{background:#E6F9F3;color:#0B6B4F;border:1px solid #BDEBD9;border-radius:12px;padding:10px 12px;font-size:14px;margin-bottom:12px;}
.pin-input{letter-spacing:10px;text-align:center;font-size:26px;font-weight:800;}

/* lists */
.item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;margin-bottom:10px;}
.item .title{font-weight:700;font-size:16px;}
.item .amt{font-weight:800;color:var(--teal-dark);font-size:17px;}
.tag{display:inline-block;font-size:12px;font-weight:700;padding:3px 10px;border-radius:999px;background:var(--surface2);color:var(--muted);}
.tag.pending{background:#FFF4D6;color:#8A6D00;}
.tag.approved{background:#E6F9F3;color:#0B6B4F;}
.tag.redo{background:#FFE9D6;color:#A34A00;}
.tag.rejected{background:#FDECEC;color:#B3261E;}
.tag.rel{background:#F3E8FF;color:#6D28D9;}
.nudge-row{border-left:4px solid #8B5CF6;}
.tag.paid{background:#E8F0FE;color:#1A56DB;}

/* approvals */
.proof{width:100%;border-radius:12px;margin:10px 0;display:block;background:var(--surface2);min-height:120px;object-fit:cover;}
.proof-wrap{position:relative;}
.proof-loading{position:absolute;inset:10px 0;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:13px;}

/* allocation bars */
.alloc{margin:6px 0;}
.alloc .lbl{display:flex;justify-content:space-between;font-size:13px;margin-bottom:4px;}
.alloc .bar{height:10px;background:var(--surface2);border-radius:99px;overflow:hidden;}
.alloc .fill{height:100%;border-radius:99px;background:linear-gradient(90deg,var(--teal),var(--aqua));}

/* tab bar — each tab is its own tappable box with instant press feedback */
.tabbar{
  position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:520px;
  height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);
  background:var(--surface);border-top:1px solid var(--border);
  display:flex;gap:6px;padding-left:8px;padding-right:8px;z-index:30;
}
.tabbar button{flex:1;min-width:0;border:1px solid var(--border);background:var(--surface2);border-radius:14px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  font-size:11px;font-weight:700;color:var(--muted);cursor:pointer;position:relative;
  margin:10px 0;padding:6px 2px;
  transition:transform .08s ease,background-color .12s ease,color .12s ease,border-color .12s ease;
  touch-action:manipulation;user-select:none;-webkit-user-select:none;}
.tabbar button .ico{font-size:21px;line-height:1;}
/* active tab: filled box, unmistakable */
.tabbar button.active{background:var(--teal-deep);border-color:var(--teal-deep);color:#fff;}
/* press feedback: fires instantly on tap, before the view swaps */
.tabbar button:active{transform:scale(.9);}
.tabbar button:not(.active):active{background:var(--border);}
.badge{position:absolute;top:3px;right:5px;background:var(--red);color:#fff;font-size:10px;font-weight:800;min-width:18px;height:18px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 5px;}

/* kid cards */
.chore-pick{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin-bottom:10px;cursor:pointer;font-family:inherit;color:var(--text);}
.chore-pick:active{transform:scale(.99);border-color:var(--teal);}
.chore-pick .amt{font-size:22px;font-weight:800;color:var(--teal-dark);}
.chore-pick.done{cursor:default;opacity:.62;}
.chore-pick.done:active{transform:none;border-color:var(--border);}
.cam-preview{width:100%;border-radius:14px;margin:12px 0;display:block;max-height:50vh;object-fit:contain;background:#0c1111;}
.photo-strip{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:12px 0;}
.photo-strip .thumb{position:relative;width:30%;min-width:96px;aspect-ratio:1;border-radius:12px;overflow:hidden;background:var(--surface2);border:1px solid var(--border);}
.photo-strip .thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.photo-strip .thumb-x{position:absolute;top:4px;right:4px;width:28px;height:28px;border-radius:50%;border:0;background:rgba(0,0,0,.65);color:#fff;font-size:14px;font-weight:800;cursor:pointer;line-height:1;}
.proof-strip{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0;}
.proof-strip .proof{margin:0;width:calc(50% - 4px);}
.kidname-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0;}
.kidname-grid button{padding:18px 8px;font-size:16px;font-weight:700;border-radius:14px;border:1px solid var(--border);background:var(--surface);cursor:pointer;color:var(--text);}
.kidname-grid button:active{border-color:var(--teal);background:#EAFBF7;}
.code-input{text-align:center;font-size:30px;font-weight:800;letter-spacing:8px;text-transform:uppercase;}

/* misc */
.divider{height:1px;background:var(--border);margin:14px 0;}
.linklike{background:none;border:0;color:var(--teal-dark);font-weight:600;font-size:14px;cursor:pointer;padding:6px 0;}
.empty{text-align:center;color:var(--muted);padding:28px 12px;font-size:14px;}
.ledger-row{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--surface2);font-size:14px;}
.ledger-row:last-child{border-bottom:0;}
.pos{color:var(--green);font-weight:700;}
.neg{color:#B3261E;font-weight:700;}
.bucket-row{display:grid;grid-template-columns:1fr 92px 46px;gap:8px;margin-bottom:8px;align-items:center;}
.bucket-row .input{min-height:48px;}
.pct-wrap{position:relative;}
.pct-wrap span{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:14px;pointer-events:none;}
.pct-wrap .input{padding-right:26px;}
/* The % box is a plain type-in box: centered, bold, obvious tap target. */
.pct-input{text-align:center;font-weight:800;font-size:18px;background:var(--surface);}
.pct-input:focus{outline:3px solid var(--aqua);border-color:var(--teal);}
.kbd-code{font-size:34px;font-weight:800;letter-spacing:6px;background:var(--surface2);border:1px dashed var(--teal);border-radius:12px;padding:10px 16px;display:inline-block;margin:8px 0;}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--tabbar-h) + 16px);background:var(--surface);color:var(--text);padding:12px 18px 12px 14px;border-radius:14px;font-size:14px;font-weight:700;z-index:99;box-shadow:0 8px 24px rgba(0,0,0,.22);border:1.5px solid var(--teal);border-left-width:6px;animation:fadein .2s;max-width:min(92vw,480px);text-align:center;}
/* themed in-app confirmation modal (askConfirm) — matches toast styling */
.confirm-overlay{position:fixed;inset:0;background:rgba(10,20,19,.45);display:flex;align-items:center;justify-content:center;padding:24px;z-index:200;animation:fadein .15s;}
/* "I bought something" card: mic buttons, receipt thumbnails, lightbox */
.micbtn{font-size:20px;padding:12px 14px;width:auto;flex:0 0 auto;display:inline-block;}
.rcpt-thumb{background:var(--surface2);border:1px solid var(--border);border-radius:8px;
  font-size:12px;padding:3px 8px;margin-top:6px;cursor:pointer;color:var(--text);}
.rcpt-thumb:active{transform:scale(.95);}
.lightbox{position:fixed;inset:0;background:rgba(10,20,19,.8);display:flex;flex-direction:column;
  align-items:center;justify-content:center;padding:24px;z-index:300;animation:fadein .15s;}
.lightbox img{max-width:100%;max-height:80vh;border-radius:12px;}
[data-theme="dark"] .lightbox img{box-shadow:0 4px 24px rgba(0,0,0,.5);}
.confirm-card{background:var(--surface);color:var(--text);border:1.5px solid var(--teal);border-left-width:6px;border-radius:14px;box-shadow:0 8px 24px rgba(0,0,0,.22);padding:18px;max-width:420px;width:100%;}
.confirm-msg{font-weight:600;font-size:15px;margin-bottom:16px;white-space:pre-line;}
.confirm-btns{display:flex;gap:10px;}
.confirm-btns .btn{width:auto;flex:1;margin:0;padding:12px 10px;font-size:15px;}
/* hold-to-drag reorder */
.item[data-drag]{cursor:grab;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}
.item.drag-src{opacity:.94;box-shadow:0 12px 28px rgba(0,0,0,.28);cursor:grabbing;}
.drag-placeholder{border:2px dashed var(--teal);border-radius:var(--radius);margin-bottom:10px;background:rgba(14,180,160,.08);}
details.faq{border:1px solid var(--border);border-radius:12px;padding:10px 12px;margin-bottom:8px;background:var(--surface);}
details.faq summary{font-weight:700;cursor:pointer;font-size:14px;}
/* Kid chore sections: big tappable collapsible groups (Morning / Afternoon / Completed) */
details.fold{border:1px solid var(--border);border-radius:var(--radius);margin-bottom:10px;background:var(--surface);overflow:hidden;}
details.fold>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:15px 16px;font-weight:800;font-size:16px;cursor:pointer;list-style:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
details.fold>summary::-webkit-details-marker{display:none;}
details.fold>summary .sright{display:flex;align-items:center;gap:8px;}
details.fold>summary .sright::after{content:"▾";color:var(--muted);font-size:15px;transition:transform .15s;}
details.fold[open]>summary .sright::after{transform:rotate(180deg);}
/* Folds whose summary has no .sright still get a chevron. */
details.fold>summary:not(:has(.sright))::after{content:"▾";color:var(--muted);font-size:15px;transition:transform .15s;}
details.fold[open]>summary:not(:has(.sright))::after{transform:rotate(180deg);}
details.fold>summary .count{background:var(--teal);color:#fff;font-size:12px;font-weight:800;min-width:26px;height:26px;border-radius:13px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;}
details.fold .foldbody{padding:2px 8px 10px;}
details.fold.done-fold{opacity:.88;}
details.fold.done-fold>summary .count{background:var(--surface2);color:var(--muted);}
details.fold .foldnote{margin:4px 8px 10px;}

/* feature wave: streaks, recap, trophy shelf, recurring, give nudge */

/* reports tab: kid picker, clickable heroes, stat grid */
.hero.clickable{cursor:pointer;}
.hero.clickable:active{transform:scale(.99);}
.pickrow{display:flex;gap:8px;flex-wrap:wrap;}
.pickrow button{border:1px solid var(--border);background:var(--surface);color:var(--text);
  border-radius:999px;padding:9px 16px;font-size:14px;font-weight:700;cursor:pointer;}
.pickrow button.on{background:var(--teal);border-color:var(--teal);color:#fff;}
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px;}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:12px 14px;}
.stat .v{font-size:20px;font-weight:800;letter-spacing:-.3px;color:var(--text);}
/* Inside the green hero the card stays light in both themes, so the value
   must not inherit the hero's white text (invisible in light mode). */
.stat .l{font-size:12px;color:var(--muted);margin-top:2px;}
.dayrow{display:flex;gap:6px;flex-wrap:wrap;}
.daypick input{position:absolute;opacity:0;pointer-events:none;}
.daypick span{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:12px;border:1px solid var(--border);background:var(--surface2);font-weight:700;font-size:13px;color:var(--muted);cursor:pointer;}
.daypick input:checked + span{background:var(--teal);border-color:var(--teal);color:#fff;}
.daypick{position:relative;}
.nudge{border:1.5px dashed var(--gold);background:#FFFBF0;}
.center{text-align:center;}
.trophy-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.trophy-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:0 1px 2px rgba(17,23,24,.04);}
.trophy-photo{position:relative;aspect-ratio:1/1;background:var(--surface2);display:flex;align-items:center;justify-content:center;}
.trophy-photo img{width:100%;height:100%;object-fit:cover;display:block;}
.trophy-photo .proof-loading{position:absolute;color:var(--muted);}
.trophy-meta{padding:8px 10px;}
.trophy-meta .title{font-weight:800;font-size:14px;line-height:1.3;}

/* ---------- help button + panel ---------- */
.help-wrap{position:relative;flex:none;}
.help-btn{background:transparent;border:1px solid var(--border);border-radius:10px;
  font-size:17px;line-height:1;padding:6px 9px;cursor:pointer;color:var(--teal-dark);}
.help-btn:active{transform:scale(.94);}
.help-panel{position:absolute;top:calc(100% + 8px);right:0;z-index:1200;
  background:var(--surface);border:1px solid var(--border);border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.18);min-width:190px;overflow:hidden;}
.help-panel button{display:block;width:100%;text-align:left;background:none;border:0;
  padding:12px 14px;font-size:15px;cursor:pointer;color:var(--text);}
.help-panel button:active{background:var(--surface2);}

/* ---------- guided tour ---------- */
.tour-veil{position:fixed;inset:0;z-index:2000;background:transparent;}
.tour-spot{position:fixed;z-index:2001;pointer-events:none;border-radius:12px;
  border:2px solid var(--teal);
  box-shadow:0 0 0 9999px rgba(8,14,14,.62),0 0 18px rgba(14,180,160,.55);
  animation:tourPulse 1.6s ease-in-out infinite;}
@keyframes tourPulse{
  0%,100%{box-shadow:0 0 0 9999px rgba(8,14,14,.62),0 0 10px rgba(14,180,160,.4);}
  50%{box-shadow:0 0 0 9999px rgba(8,14,14,.62),0 0 26px rgba(14,180,160,.8);}
}
.tour-tip{position:fixed;z-index:2002;left:12px;right:12px;bottom:12px;
  background:var(--surface);border:1px solid var(--border);border-radius:16px;
  box-shadow:0 12px 32px rgba(0,0,0,.28);padding:12px 14px;max-width:520px;margin:0 auto;
  animation:tourIn .18s ease-out;}
@keyframes tourIn{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:none;}}
.tour-tip.center{top:50%;bottom:auto;transform:translateY(-50%);}
.tour-tip.center{animation-name:tourInC;}
@keyframes tourInC{from{opacity:0;transform:translateY(calc(-50% + 8px));}to{opacity:1;transform:translateY(-50%);}}
.tour-tip.at-top{top:64px;bottom:auto;}
.tour-count{font-size:11px;font-weight:700;color:var(--teal-dark);text-transform:uppercase;letter-spacing:.06em;}
.tour-title{font-size:16px;font-weight:800;margin:2px 0 4px;}
.tour-text{font-size:14px;color:var(--text);opacity:.92;margin-bottom:10px;}
.tour-btns{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.tour-btns .ghost{flex:none;}
.tour-scrollhint{font-size:13px;font-weight:700;color:var(--teal-dark);margin-bottom:6px;}

/* ---------- tour guide arrow: bright green, points at the spotlight target ---------- */
.tour-arrow{position:fixed;z-index:2002;pointer-events:none;width:40px;height:56px;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.35));}
.tour-arrow svg{width:100%;height:100%;display:block;overflow:visible;}
.tour-arrow.up svg{transform:scaleY(-1);}
.tour-arrow.down{animation:arrowBobD 1s ease-in-out infinite;}
.tour-arrow.up{animation:arrowBobU 1s ease-in-out infinite;}
@keyframes arrowBobD{0%,100%{transform:translateY(0);}50%{transform:translateY(10px);}}
@keyframes arrowBobU{0%,100%{transform:translateY(0);}50%{transform:translateY(-10px);}}

/* ---------- kid card: name row + squared action grid ---------- */
.kid-top{display:flex;align-items:center;gap:10px;}
.kid-actions{display:flex;gap:8px;margin-top:10px;}
.kid-actions .btn{flex:1;white-space:nowrap;padding-left:6px;padding-right:6px;justify-content:center;}

/* Live-camera capture overlay (kid photo proof: live photo only, no gallery) */
.livecam-ov{position:fixed;inset:0;z-index:300;background:rgba(8,14,15,.72);display:flex;align-items:flex-end;justify-content:center;animation:fadein .15s;}
.livecam-sheet{background:var(--surface);border-radius:20px 20px 0 0;padding:16px 16px 20px;width:100%;max-width:520px;max-height:94vh;overflow:auto;position:relative;}
.livecam-gate{position:absolute;inset:0;background:var(--surface);border-radius:20px 20px 0 0;display:flex;align-items:center;justify-content:center;padding:24px;z-index:2;}
.livecam-gate-card{text-align:center;max-width:340px;}
.livecam-gate-t{font-weight:800;font-size:19px;margin:8px 0 6px;}
.livecam-gate-s{color:var(--muted);font-size:14px;line-height:1.55;}
.livecam-gate-card .btnrow{margin-top:14px;}
.livecam-title{font-weight:800;font-size:17px;text-align:center;margin-bottom:10px;}
.livecam-sheet video{width:100%;border-radius:12px;background:#000;aspect-ratio:3/4;object-fit:cover;display:block;}
.livecam-err{margin-top:8px;}
.livecam-sheet .btnrow{margin-top:12px;}
.livecam-sheet .btn{padding:14px;}
#livecam-snap{font-size:17px;}

/* good grades card */
.grade-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;margin-top:10px;padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface2);}
/* Trey 2026-09-14: grade rows must never squeeze the $ each / Count labels into each other — wrap instead */
.grade-row>.field{flex:1 1 120px !important;min-width:0;}
/* Trey 2026-09-14: kid-card action buttons must wrap in a grid, never run off-screen */
#kidrows .row{flex-wrap:wrap;}
#kidrows .row>.grow{flex:1 1 220px;min-width:0;}
.grade-badge{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:800;flex:none;color:#fff;}
.grade-badge.gA{background:var(--green);}
.grade-badge.gB{background:var(--teal);}
.grade-badge.gC{background:var(--gold);color:#5a4300;}
.grade-badge.gD{background:#E8833A;}
.grade-badge.gF{background:var(--red);}
.stepper{display:flex;align-items:center;gap:8px;}
.stepper button{width:34px;height:34px;border-radius:10px;border:1px solid var(--border);background:var(--surface);font-size:18px;font-weight:800;cursor:pointer;color:var(--text);line-height:1;}
.stepper button:active{transform:scale(.9);}
.stepper .cnt{min-width:22px;text-align:center;font-weight:800;font-size:16px;}
/* spend receipt — the "money left the bucket" moment */
.spend-receipt{text-align:center;padding:8px 4px;}
.spend-receipt .big-out{font-size:44px;font-weight:800;color:var(--red);margin:6px 0;}
.spend-drain{margin:14px 0 6px;text-align:left;}
.spend-drain .bar{height:22px;border-radius:12px;background:var(--surface2);border:1px solid var(--border);overflow:hidden;position:relative;}
.spend-drain .bar .fill{height:100%;border-radius:11px;background:linear-gradient(90deg,var(--teal),var(--aqua));transition:width 1.2s ease;}
.spend-drain .bar .lost{position:absolute;top:0;bottom:0;background:var(--red);opacity:.85;transition:left 1.2s ease,width 1.2s ease;}
.spend-drain .lbls{display:flex;justify-content:space-between;font-size:13px;font-weight:700;margin-top:6px;}
.spend-drain .lbls .was{color:var(--muted);text-decoration:line-through;}
.spend-drain .lbls .now{color:var(--teal-dark);}

/* ---------- hamburger drawer (☰) ---------- */
.icon-btn{background:transparent;border:1px solid var(--border);border-radius:10px;
  font-size:17px;line-height:1;padding:6px 9px;cursor:pointer;color:var(--text);flex:none;}
.icon-btn:active{transform:scale(.94);}
.drawer-scrim{position:fixed;inset:0;background:rgba(10,20,19,.45);z-index:1500;
  opacity:0;pointer-events:none;transition:opacity .2s ease;}
.drawer{position:fixed;top:0;left:0;bottom:0;width:min(300px,84vw);z-index:1501;
  background:var(--surface);border-right:1px solid var(--border);
  transform:translateX(-105%);transition:transform .22s ease;
  display:flex;flex-direction:column;box-shadow:8px 0 24px rgba(0,0,0,.18);}
#drawerWrap.open .drawer-scrim{opacity:1;pointer-events:auto;}
#drawerWrap.open .drawer{transform:none;}
.drawer-head{display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;border-bottom:1px solid var(--border);}
.drawer-title{font-size:18px;font-weight:800;letter-spacing:-.3px;}
.drawer-body{padding:10px;display:flex;flex-direction:column;gap:4px;}
.drawer-item{display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  background:none;border:0;border-radius:12px;padding:13px 12px;font-size:16px;font-weight:600;
  color:var(--text);cursor:pointer;font-family:inherit;}
.drawer-item:active{background:var(--surface2);}
.di-ico{font-size:20px;width:28px;text-align:center;flex:none;}
.drawer-item.active{opacity:.55;}
.drawer-section{border-top:1px solid var(--border);margin-top:6px;padding-top:8px;}
.drawer-section-title{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.6px;padding:4px 12px 6px;}

/* narrow phones: tighten the tab bar so all five tabs fit without zooming */
@media (max-width:380px){
  .tabbar{gap:4px;padding-left:6px;padding-right:6px;}
  .tabbar button{font-size:10px;margin:8px 0;padding:4px 1px;border-radius:12px;}
  .tabbar button .ico{font-size:18px;}
  .topbar{padding:10px 12px;gap:8px;}
}

/* ---------- ChoreStack brand icons ---------- */
.cs-ic{display:inline-flex;width:1.2em;height:1.2em;flex:none;vertical-align:-.24em;}
.cs-ic svg{width:100%;height:100%;display:block;}
.cs-ic.warm{color:#D9932B;}
.tabbar button .ico .cs-ic{width:23px;height:23px;vertical-align:0;}
.fold > summary .cs-ic{color:var(--teal);}
.fold > summary .cs-ic.warm{color:#D9932B;}
.card h2 .cs-ic,.card h3 .cs-ic{color:var(--teal);}
.card h2 .cs-ic.warm,.card h3 .cs-ic.warm{color:#D9932B;}
.btn .cs-ic{width:1.1em;height:1.1em;vertical-align:-.2em;}

/* ---------- family group chat ---------- */
.chat-card{padding-bottom:14px;}
.chat-list{display:flex;flex-direction:column;gap:8px;max-height:52vh;overflow-y:auto;padding:6px 2px;margin:6px 0;}
.msg{display:flex;}
.msg .msg-bubble{max-width:84%;background:var(--surface2);border-radius:14px;padding:8px 12px;}
.msg.mine{justify-content:flex-end;}
.msg.mine .msg-bubble{background:var(--teal-deep);color:#fff;}
.msg-who{font-size:12px;font-weight:800;margin-bottom:2px;}
.msg-who .tag{font-size:10px;padding:1px 7px;margin-left:4px;}
.msg-text{white-space:pre-wrap;overflow-wrap:anywhere;}
.msg-time{font-size:11px;opacity:.6;margin-top:3px;}
.msg.mine .msg-time{opacity:.85;}
.chat-composer{display:flex;gap:8px;margin-top:8px;}
.chat-composer .input{flex:1 1 auto;min-width:0;}
/* The global .btn is display:block;width:100% — the send button must not stretch. */
.chat-composer .btn{flex:0 0 auto;width:auto;padding:12px 14px;}
.chat-composer .chat-send{width:48px;height:48px;padding:0;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:0 0 auto;}
.chat-composer .chat-send svg{width:22px;height:22px;}

/* ---------- floating family-chat bubble + bottom sheet ---------- */
#chatFab{position:fixed;right:16px;bottom:calc(var(--tabbar-h) + 18px);width:58px;height:58px;border-radius:50%;border:0;z-index:60;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--teal),#0BD8B6);color:#fff;box-shadow:0 6px 18px rgba(14,180,160,.45);cursor:pointer;-webkit-tap-highlight-color:transparent;}
#chatFab.kid{bottom:24px;}
#chatFab:active{transform:scale(.94);}
#chatFab svg{width:26px;height:26px;}
.fab-badge{position:absolute;top:-4px;right:-4px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--red);color:#fff;font-size:12px;font-weight:800;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(0,0,0,.25);}
.fab-badge[hidden]{display:none;}
#chatOverlay{position:fixed;inset:0;background:rgba(10,20,20,.45);z-index:70;display:flex;align-items:flex-end;justify-content:center;opacity:0;transition:opacity .22s ease;}
#chatOverlay.open{opacity:1;}
#chatSheet{position:relative;background:var(--surface);border-radius:22px 22px 0 0;width:100%;max-width:560px;max-height:82vh;max-height:82dvh;display:flex;flex-direction:column;transform:translateY(102%);transition:transform .26s ease;padding:6px 14px calc(12px + env(safe-area-inset-bottom));box-shadow:0 -8px 30px rgba(0,0,0,.25);}
#chatOverlay.open #chatSheet{transform:translateY(0);}
.sheet-grab{width:44px;height:5px;border-radius:3px;background:var(--border);margin:2px auto 6px;flex:0 0 auto;}
#chatClose{position:absolute;top:10px;right:12px;width:36px;height:36px;border-radius:50%;border:0;background:var(--surface2);color:var(--muted);font-size:20px;line-height:1;cursor:pointer;z-index:2;}
#chatSheet #chatHead{padding-right:44px;flex:0 0 auto;}
#chatSheet .chat-list{flex:1 1 auto;min-height:180px;overflow-y:auto;-webkit-overflow-scrolling:touch;}
#chatSheet #chatErr{flex:0 0 auto;}
#chatSheet .chat-composer{flex:0 0 auto;padding-bottom:env(safe-area-inset-bottom);}
#chatSheet #chatCount{flex:0 0 auto;min-height:16px;}
