:root{
  --ink:#1e2333; --soft:#6b7280; --paper:#f7f8fb; --mist:#e6e9f2; --water:#cfe8f2;
  --coin:#f5b301; --coinbg:#fff6da; --star:#ffd83d; --go:#22c55e; --gobg:#e9fbef;
  --danger:#ef4444; --line:#e6e9ef; --card:#fff; --blue:#3d9bff; --purple:#8a6cf0; --pink:#f0568e;
  --hero:#3d9bff; --maxw:520px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
/* Phosphor inline line icons: size to the surrounding text, inherit colour via currentColor */
.phi{width:1em;height:1em;display:inline-block;vertical-align:-0.15em;flex:none;fill:currentColor}
/* Profile avatar images fill their circular container; buddy icon keeps its aspect */
.avimg{width:100%;height:100%;object-fit:contain;display:block;border-radius:50%}
/* avatar circles use a neutral backdrop (the hero colour is the task-progress ring, not the bg) */
.whoav,.pav,.av,.swav{background:#eef1f8;overflow:hidden}
.swav{width:42px;height:42px;border-radius:50%;flex:0 0 auto}
.buddyimg{object-fit:contain;display:block}
/* avatar picker grid */
.avgrid{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;max-height:240px;overflow-y:auto;padding:4px 2px}
.avcat{grid-column:1/-1;font-size:11px;font-weight:800;color:var(--soft);margin:6px 0 0;text-transform:capitalize}
.avopt{width:100%;aspect-ratio:1;border-radius:50%;border:2px solid transparent;background:#eef1f8;cursor:pointer;padding:0;overflow:hidden}
.avopt.on{border-color:var(--hero)}
.avopt img{width:100%;height:100%;object-fit:contain}
/* header language switch: plain tappable codes */
.langseg{display:inline-flex;gap:1px}
.langseg b,.langseg button{font-size:11px;font-weight:800;color:var(--soft);padding:6px 8px;border-radius:8px;cursor:pointer;border:none;background:none;font-family:inherit;min-height:32px}
.langseg b.on,.langseg button.on{color:#fff;background:var(--hero)}
html,body{margin:0;overflow-x:hidden}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);
  background:linear-gradient(135deg,#eef2fb,#f5eefb);font-size:16px;line-height:1.4;overscroll-behavior-y:none}
/* The app is a fixed viewport-height column: the topbar and bottom nav are real flex children (NOT
   position:fixed/sticky) and only .body scrolls inside. This is the reliable layout for an iOS
   home-screen (standalone) PWA, where position:fixed bottom bars detach and float into the content. */
#app{max-width:var(--maxw);margin:0 auto;height:100vh;height:100dvh;max-height:100dvh;display:flex;flex-direction:column;background:var(--paper);overflow:hidden}
.boot{padding:40px;text-align:center;color:var(--soft)}
b{font-weight:700}
h1,h2,h3,h4{margin:0 0 8px}
h2{font-size:20px}h3{font-size:18px;margin:4px 2px 10px}
h4{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--soft);margin:16px 2px 8px;display:flex;align-items:center;gap:6px;justify-content:space-between}
h4 .seeall{font-weight:700;color:var(--hero);text-transform:none;letter-spacing:0}
.mut{color:var(--soft);font-size:14px}.small{font-size:13px}.center{text-align:center}.grow{flex:1}
.row{display:flex;align-items:center}.row.gap{gap:8px}.row.wrap{flex-wrap:wrap}.row.between{justify-content:space-between;width:100%}.row.center{justify-content:center}
.mt{margin-top:10px}
hr{border:none;border-top:1px solid var(--line);margin:14px 0}
.note{font-size:11px;color:var(--soft);margin:7px 2px 0}

/* buttons */
.btn{border:none;border-radius:11px;padding:10px 15px;font-size:14px;font-weight:800;cursor:pointer;background:var(--mist);color:var(--ink);transition:transform .05s;white-space:nowrap}
.btn:active{transform:scale(.97)}
.btn.primary{background:var(--hero);color:#fff}
.btn.danger{background:var(--danger);color:#fff}
.btn.ghost{background:#fff;color:var(--blue);border:1.5px solid #cfe0ff}
.btn.ok{background:var(--go);color:#fff}
.btn.no{background:#fff;color:var(--danger);border:1.5px solid var(--danger)}
.btn.grab{background:var(--coin);color:#5b4300}
.btn.relbtn{padding:9px 10px;flex:0 0 auto}.btn.relbtn svg{width:18px;height:18px;display:block}
.btn.link{background:none;padding:6px 8px;color:var(--blue);font-weight:700}
.btn.link.danger{color:var(--danger)}.btn.link.on{color:var(--coin)}
.btn.small{padding:7px 11px;font-size:13px;border-radius:9px}
.btn.big{width:100%;padding:14px;font-size:16px;margin-top:8px}
.btn.chip{background:#eef1f8;padding:8px 12px;border-radius:999px}
.btn.round{width:42px;height:42px;border-radius:50%;font-size:22px;padding:0;background:#eef1f8}
.btn.on{outline:2px solid var(--hero)}
/* Keyboard focus indicator (tap highlight is removed, so without this keyboard users see nothing). WCAG 2.4.7 */
:focus-visible{outline:2px solid var(--hero);outline-offset:2px}
.btn.dark{background:#3a4357;color:#fff}
button:disabled{opacity:.45}
.btncol{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.btncol .btn{width:100%}
.colordot{width:34px;height:34px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.2);cursor:pointer;padding:0}

/* inputs */
.inp{width:100%;border:1.5px solid var(--line);border-radius:11px;padding:11px 13px;font-size:16px;background:#fff;color:var(--ink)}
.inp.num{width:96px;text-align:right}
.inp.pin{letter-spacing:.5em;text-align:center;font-size:24px}
.fld{display:block;margin:8px 0}.fld>span{display:block;font-size:13px;color:var(--soft);margin-bottom:4px}
textarea.choreinput,.listbox textarea{width:100%;border:2px dashed #cdd6e6;border-radius:12px;padding:13px 15px;font-size:16px;font-family:inherit;resize:vertical;min-height:120px;line-height:1.7;background:#fff;color:var(--ink)}
select.inp{appearance:auto}

/* topbar + nav */
.topbar{flex:none;display:flex;align-items:center;gap:8px;padding:10px 14px;
  padding-top:max(10px,env(safe-area-inset-top));background:#fff;border-bottom:1px solid var(--line)}
.who{display:flex;align-items:center;gap:8px;background:none;border:none;font-size:16px;font-weight:800;cursor:pointer;color:var(--ink)}
.dot{width:14px;height:14px;border-radius:50%;display:inline-block}.dot.big{width:24px;height:24px}
.whoav{width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:15px;flex:none}
.syncpill{display:inline-flex;align-items:center;justify-content:center;border:none;padding:5px;border-radius:999px;background:#f1f3f9;color:var(--soft);cursor:pointer;line-height:0;flex:none}
.syncpill .phi{width:18px;height:18px}
.syncpill.synced{background:#eaf7ee;color:#15803d}
.syncpill.offline,.syncpill.error{background:#fff2e8;color:#c2410c}
.syncpill.syncing{color:var(--blue)}
.syncpill.syncing .phi{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.syncpill.syncing .phi{animation:none}}
.body{flex:1;padding:14px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
.bottomnav{flex:none;display:flex;justify-content:space-around;
  background:#fff;border-top:1px solid var(--line);padding:6px 2px;padding-bottom:max(6px,env(safe-area-inset-bottom))}
.tab{flex:1;background:none;border:none;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:10px;font-weight:700;color:var(--soft);cursor:pointer;padding:4px 1px}
.tab .ic{font-size:21px;height:26px;display:flex;align-items:center;justify-content:center}
.tab .ic .buddyimg{height:23px;width:auto}
.tab.on{color:var(--hero)}
.tab .avatarimg{width:24px;height:24px;border-radius:50%;object-fit:contain}

/* screens + cards */
.screen{display:flex;flex-direction:column}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:6px 12px}
.card.pad{padding:12px}
.card.head{display:flex;justify-content:space-between;align-items:center;padding:14px 12px;margin-bottom:12px}
.empty{text-align:center;color:var(--soft);padding:28px 14px;background:#fff;border:1px dashed var(--line);border-radius:16px}

/* home identity */
.topline{display:flex;align-items:center;justify-content:space-between;margin:2px 2px 6px}
.hello{font-size:14px;color:var(--soft);font-weight:700}
.langmini{font-size:11px;font-weight:700;background:var(--mist);border-radius:10px;padding:3px 8px;color:var(--soft);border:none;cursor:pointer}
.identity{display:flex;flex-direction:column;align-items:center;margin:6px 0 14px}
.avatarRing{width:116px;height:116px;border-radius:50%;display:flex;align-items:center;justify-content:center;position:relative}
.avatarInner{width:96px;height:96px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;font-size:52px;box-shadow:inset 0 0 0 3px #fff;overflow:hidden}
.avatarInner img{width:92px;height:92px;object-fit:contain}
.ringbadge{position:absolute;bottom:-4px;left:50%;transform:translateX(-50%);background:var(--hero);color:#fff;font-size:11px;font-weight:800;border-radius:12px;padding:2px 10px;box-shadow:0 2px 6px rgba(0,0,0,.15)}
.editdot{position:absolute;top:4px;right:6px;background:#fff;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;font-size:13px;box-shadow:0 2px 5px rgba(0,0,0,.15);border:none;cursor:pointer}
.whoname{font-size:19px;font-weight:800;margin-top:13px;display:flex;align-items:center;gap:7px}
.rankline{font-size:12px;color:var(--soft);font-weight:700;margin-top:2px}
.flamechip{font-size:12px;font-weight:800;color:#c2410c;background:#fff2e8;border:1px solid #fcd9c2;border-radius:14px;padding:3px 9px}

/* wallet strip + chips */
.walletstrip{background:#fff;border:1px solid var(--line);border-radius:16px;padding:4px;display:flex;margin:2px 0 12px;cursor:pointer}
.walletstrip .wc{flex:1;text-align:center;padding:9px 4px;border-right:1px solid var(--line)}
.walletstrip .wc:last-child{border-right:none}
.walletstrip .wv{font-size:15px;font-weight:800;display:block}.walletstrip .wl{font-size:9px;color:var(--soft);font-weight:700}
.walletstrip .eur .wv{color:#127a37}.walletstrip .time .wv{color:#2563eb}.walletstrip .coin .wv{color:#9a6a00}.walletstrip .appr .wv{color:#8a6cf0}
.wallet{display:flex;gap:6px;justify-content:center;margin:4px 0 12px;flex-wrap:wrap}
.wchip{display:flex;flex-direction:column;align-items:center;background:#fff;border:1px solid var(--line);border-radius:13px;padding:9px 14px;min-width:90px;flex:1}
.wchip .wv{font-size:16px;font-weight:800}.wchip .wl{font-size:10px;color:var(--soft);font-weight:600;margin-top:1px}
.wchip.eur .wv{color:#127a37}.wchip.time .wv{color:#2563eb}.wchip.coin .wv{color:#9a6a00}

.claimpill{display:flex;align-items:center;justify-content:space-between;background:linear-gradient(135deg,#ffd84d,#ff8a3d);color:#5b2a00;font-weight:800;font-size:14px;border:none;width:100%;border-radius:14px;padding:13px 15px;margin-bottom:12px;box-shadow:0 4px 12px rgba(255,138,61,.35);cursor:pointer;animation:pulse 1.8s infinite}
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.015)}}
/* Respect reduced-motion: stop the always-on pulse (and other looping decoration). WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce){.claimpill{animation:none}}

/* pet float on home */
.petfloat{display:flex;align-items:center;gap:11px;margin:2px 2px 4px;background:none;border:none;width:100%;text-align:left;cursor:pointer}
.petfloat img{width:74px;height:74px;object-fit:contain;flex:0 0 auto;filter:drop-shadow(0 4px 8px rgba(40,50,90,.18))}
.petfloat .pt{flex:1;font-size:13px}.petfloat .pt b{font-size:14px}

/* golden + chores */
.golden{background:linear-gradient(135deg,#fff7e0,#ffe7a8);border:1.5px solid #f3c44d;border-radius:16px;padding:11px 12px;display:flex;align-items:center;gap:11px;box-shadow:0 4px 12px rgba(243,196,77,.3)}
.golden .ico{background:#fff}
.golden .lbl{flex:1}.golden .lbl .k{font-size:10px;font-weight:800;color:#b07b00;text-transform:uppercase;letter-spacing:.4px}
.golden .lbl .n{font-size:14px;font-weight:700}
/* A golden ("special task") chore - in both the chores list and the approvals view - is its OWN full
   gold card: the whole card is gold (gold border + soft shadow), with no white frame around it. */
.card.golden{background:linear-gradient(135deg,#fff7e0,#ffe7a8);border:1.5px solid #f3c44d;box-shadow:0 4px 12px rgba(243,196,77,.3);margin:10px 0}
.card.golden:first-child{margin-top:0}
/* purple "Ajastettu" (scheduled) special card - kid home variants mirror .golden */
.purple,.goldpurple{border-radius:16px;padding:11px 12px;display:flex;align-items:center;gap:11px}
.purple{background:linear-gradient(135deg,#efedfe,#cecbf6);border:1.5px solid #7f77dd;box-shadow:0 4px 12px rgba(83,74,183,.28)}
.goldpurple{background:linear-gradient(135deg,#ffe7a8,#d6cdf3);border:1.5px solid #9b7ad0;box-shadow:0 4px 12px rgba(120,90,190,.26)}
.purple .ico,.goldpurple .ico{background:#fff}
.purple .lbl,.goldpurple .lbl{flex:1}
.purple .lbl .k,.goldpurple .lbl .k{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;color:#3c3489}
.purple .lbl .n,.goldpurple .lbl .n{font-size:14px;font-weight:700}
.golden .sub,.purple .sub,.goldpurple .sub{font-size:11px;font-weight:600;color:#3c3489;display:flex;align-items:center;gap:4px;margin-top:2px}
.lockchip{font-size:12px;font-weight:700;color:#534ab7;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.golden,.purple,.goldpurple{animation:floaty 2.2s ease-in-out infinite}
.golden,.purple,.goldpurple{margin:8px 0;cursor:pointer}
.chore.tappable{cursor:pointer}
.infohint{margin-left:5px;opacity:.4}
.infohint .phi{width:13px;height:13px;vertical-align:-1px}
.infotext{line-height:1.55;white-space:pre-wrap;margin:6px 0}
@keyframes floaty{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@media (prefers-reduced-motion:reduce){.golden,.purple,.goldpurple{animation:none}}
.card.purple{background:linear-gradient(135deg,#f4f2ff,#e3def8);border:1.5px solid #9a92e0;box-shadow:0 4px 12px rgba(83,74,183,.2);margin:10px 0}
.card.goldpurple{background:linear-gradient(135deg,#fff1cf,#e3def8);border:1.5px solid #b59ad6;box-shadow:0 4px 12px rgba(120,90,190,.2);margin:10px 0}
.card.purple:first-child,.card.goldpurple:first-child{margin-top:0}
/* light-green "Oma tehtava" self-made task card - a calm sibling of the gold/purple specials, lighter
   and cooler so a parent's gold prize still reads as the headline */
.mine{background:linear-gradient(135deg,#eafaef,#c8f0d4);border:1.5px solid #5fcf86;border-radius:16px;padding:11px 12px;display:flex;align-items:center;gap:11px;box-shadow:0 4px 12px rgba(34,197,94,.18);margin:8px 0;cursor:pointer;animation:floaty 2.2s ease-in-out infinite}
.mine:first-child{margin-top:0}
.mine .ico{background:#fff}
.mine .lbl{flex:1}
.mine .lbl .k{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;color:#157a3c}
.mine .lbl .n{font-size:14px;font-weight:700}
@media (prefers-reduced-motion:reduce){.mine{animation:none}}
/* home quick-add: prominent green circular action on the greeting row (replaces the old text link) */
.hellobar{margin:2px 2px 8px}
.addfab{width:48px;height:48px;border-radius:50%;padding:0;flex:none;background:#22a05a;color:#fff;font-size:24px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(34,160,90,.32)}
.addfab .phi{width:1em;height:1em}
@media (hover:hover){.addfab:hover{filter:brightness(1.05)}}
/* locked "this is for me" chip in the child's self-task dialog */
.selfme{display:flex;align-items:center;gap:10px;background:#f3fcf6;border:1px solid #bfe8cc;border-radius:12px;padding:8px 10px;margin:8px 0}
.selfme .selflock{margin-left:auto;color:var(--soft);display:inline-flex}
.selfme .selflock .phi{width:16px;height:16px}
.drop{font-size:9px;font-weight:800;color:#b07b00;background:#fff;border-radius:9px;padding:3px 7px;text-transform:uppercase;letter-spacing:.4px}
.chore{display:flex;align-items:center;gap:10px;padding:9px 2px;border-bottom:1px solid var(--line)}
.chore:last-child{border-bottom:none}
.ico{width:38px;height:38px;border-radius:12px;background:var(--gobg);display:flex;align-items:center;justify-content:center;font-size:19px;flex:0 0 auto}
.ico.b{background:#eaf2ff}.ico.p{background:#f1ecfe}.ico.g{background:var(--coinbg)}
.ctitle{flex:1;min-width:0;font-size:14px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.chips{display:flex;gap:4px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
/* multi-level parent chore card: header (avatar+name+owner), body (desc+rewards), footer (actions) */
.card.chorecard{margin:8px 0;padding:10px 12px;cursor:pointer}
.card.chorecard:first-child{margin-top:0}
.chorecard-inner{display:flex;flex-direction:column;gap:7px;flex:1;min-width:0;width:100%}
.chead{display:flex;align-items:center;gap:9px;min-width:0}
.chead .cname{flex:1;min-width:0;font-size:15px;font-weight:700;line-height:1.25;overflow-wrap:anywhere}
/* owner cluster (small profile image + name) as a pill on the RIGHT of the header */
.ownerchip{flex:0 0 auto;display:flex;align-items:center;gap:6px;max-width:46%;background:#eef2ff;border-radius:999px;padding:3px 11px 3px 4px}
.ownerchip .pav{width:26px;height:26px}
.ownerchip .oname{min-width:0;font-size:13px;font-weight:800;color:#1d6fd6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ownerchip.pool{background:#eef1f8}.ownerchip.pool .oname{color:var(--soft)}
.ownerchip.tappable{cursor:pointer;border:none;font:inherit}
.ownerchip.tappable:active{transform:scale(.97)}
.ownerchip.tappable > svg{width:14px;height:14px;opacity:.55;flex:0 0 auto}
.pav.pool{color:var(--soft)}.pav.pool svg{width:18px;height:18px}
.cbody{display:flex;align-items:flex-start;gap:10px;min-width:0}
.cbody .cdesc{flex:1;min-width:0;font-size:13px;color:var(--soft);line-height:1.35;overflow-wrap:anywhere}
.cbody .rstack{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.cfoot{display:flex;align-items:center;justify-content:flex-end;gap:2px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:5px;margin-top:1px}
/* parent card footer: management icons grouped on the left, reassign alone on the right */
.chorecard:not(.kidcard) .cfoot{justify-content:space-between}
.cfootl{display:flex;align-items:center;gap:2px}
.reassignbtn{background:#eef2ff;border-radius:999px}
/* always-available (repeatable) tasks: coral accent (distinct from white/green/purple/gold) */
.card.coral{background:linear-gradient(135deg,#fff1f2,#ffe4e6);border:1.5px solid #fb7185;box-shadow:0 4px 12px rgba(251,113,133,.22);margin:8px 0}
.card.coral:first-child{margin-top:0}
.btn.link.on.coral{color:#be123c}
/* "update ready" pill: a new build is installed; tap to refresh (replaces the silent auto-reload) */
.updatepill{position:fixed;left:50%;transform:translateX(-50%);bottom:74px;z-index:9999;background:var(--hero);color:#fff;border:none;border-radius:999px;padding:10px 18px;font-size:14px;font-weight:800;box-shadow:0 6px 16px rgba(0,0,0,.22);cursor:pointer;display:flex;align-items:center;gap:6px}
.updatepill svg{width:16px;height:16px}
/* previous-tasks list: compact row that expands in place into the full card */
.prevrow{cursor:pointer}
.prevrow.expanded{align-items:stretch}
.prevchev{flex:0 0 auto;display:inline-flex;align-items:center;opacity:.45;transition:transform .15s}
.prevchev svg{width:16px;height:16px}
.prevchev.open{transform:rotate(90deg);opacity:.7}
.collhead{cursor:pointer}.alwayssec{margin-top:4px}
/* daily-template item cards */
.tmplcard.tmplpaused{opacity:.55}
.tmpltags{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
/* detail sheet header + reassign picker */
.shhead{display:flex;align-items:center;gap:11px}.shhead h3{margin:0}
.reassignlist{display:flex;flex-direction:column;gap:6px;margin:12px 0;max-height:50vh;overflow:auto}
.reassignrow{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:8px 10px;font-size:15px;font-weight:600;cursor:pointer}
.reassignrow.on{border-color:var(--blue);background:#eef2ff}
/* kid task cards: the same multi-level card, with a category icon in the header and big action buttons */
.card.kidcard{cursor:pointer}
.kidcard .cfoot{gap:8px;padding-top:8px}
.kidcard .pendtag,.kidcard .star{flex:0 0 auto}
.kidcard .pendtag{font-size:12px;font-weight:700;color:var(--soft)}
.eur{font-size:11px;font-weight:800;color:#127a37;background:var(--gobg);border-radius:9px;padding:2px 7px;white-space:nowrap}
.xp{font-size:11px;font-weight:800;color:#9a6a00;background:var(--coinbg);border-radius:9px;padding:2px 7px;white-space:nowrap}
.pendtag{font-size:11px;color:var(--soft);font-weight:400}
.donechip{font-size:12px;font-weight:800;color:#127a37}.star{font-size:13px}
.peek{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px dashed #cdd6e6;border-radius:13px;padding:11px 13px;font-size:12px;color:var(--soft);font-weight:600;margin-top:12px;cursor:pointer}
.peek b{color:var(--ink)}

/* segmented */
.seg{display:flex;gap:5px;margin:2px 0 12px}
.seg b,.seg button{flex:1;text-align:center;font-size:11px;font-weight:700;border:1px solid var(--line);border-radius:9px;padding:10px 4px;min-height:40px;background:#fff;color:var(--soft);cursor:pointer;font-family:inherit}
.seg b.on,.seg button.on{background:var(--hero);color:#fff;border-color:var(--hero)}

/* shop + savings jar */
.jarcard{background:#fff;border:1px solid var(--line);border-radius:16px;padding:13px;margin:12px 0;cursor:pointer}
.jarcard .gt{font-size:12px;color:var(--soft);display:flex;justify-content:space-between}.jarcard .gt b{color:var(--ink)}
.jar{height:14px;background:#eef2fb;border-radius:8px;overflow:hidden;margin-top:8px}
.jar span{display:block;height:100%;background:linear-gradient(90deg,var(--hero),var(--purple))}
.exrow{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 2px;border-bottom:1px solid var(--line);font-size:14px}
.exrow:last-child{border-bottom:none}.exrow .xl{font-weight:600}
.shopgrid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.shopitem{background:#fff;border:1px solid var(--line);border-radius:14px;padding:11px;text-align:center}
.shopitem .si{font-size:30px}.shopitem .sn{font-size:12px;font-weight:700;margin-top:3px}.shopitem .sp{font-size:11px;font-weight:800;color:#9a6a00;margin-top:4px}
.shopitem.lock{opacity:.55}
.shopitem.owned{border-color:var(--go);background:#f3fcf6}

/* badges */
.pb{background:#fff;border:1px solid var(--line);border-radius:14px;padding:11px 13px;margin-bottom:12px;font-size:13px}
.pb .r{display:flex;justify-content:space-between;padding:5px 0}.pb .r b{font-weight:800}
.badgegrid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}
.badge{text-align:center}
.bcircle{width:56px;height:56px;border-radius:50%;background:var(--coinbg);border:2px solid #f3c44d;display:flex;align-items:center;justify-content:center;font-size:27px;margin:0 auto}
.badge.locked .bcircle{background:#f0f1f4;border-color:#dcdfe6;filter:grayscale(1);opacity:.5}
.badge .bl{font-size:10px;color:var(--soft);margin-top:5px;line-height:1.2}

/* pet screen */
.petbanner{width:auto;margin:-14px -14px 8px;aspect-ratio:1/1;background:#fff;overflow:hidden;display:flex;align-items:center;justify-content:center}
.petbanner img,.petbanner .petvid{width:100%;height:100%;object-fit:cover;display:block}
.revealvid{width:120px;height:120px;object-fit:contain;display:block;margin:0 auto 6px}
.petname{display:flex;align-items:center;justify-content:center;gap:8px;font-size:19px;font-weight:800;margin-top:2px;flex-wrap:wrap}
.petnamepic{width:30px;height:30px;object-fit:contain}
.petstage{text-align:center;font-size:12px;color:var(--soft);font-weight:700;margin-top:2px}
.agechip{font-size:11px;font-weight:700;color:#9a6a00;background:var(--coinbg);border:1px solid #f3df9e;border-radius:10px;padding:2px 8px}
.bdayline{display:flex;align-items:center;justify-content:center;gap:8px;margin:4px 0 2px}
.bdaybar{width:90px;height:6px;background:#eef1fb;border-radius:6px;overflow:hidden}
.bdaybar span{display:block;height:100%;background:#f5b301}
.carebtn.buy{border-style:dashed;color:#9a6a00}
.speech{background:#fff;border:1px solid var(--line);border-radius:14px;padding:9px 13px;font-size:13px;font-weight:600;margin:10px auto 12px;max-width:240px;text-align:center}
.tokens{display:flex;align-items:center;justify-content:center;gap:14px;background:var(--coinbg);border:1px solid #f3df9e;border-radius:14px;padding:9px 11px;font-size:12px;font-weight:700;color:#9a6a00;margin-bottom:8px}
.tokens .petpoints{color:#6d28d9}
.carerow{display:flex;gap:7px;justify-content:center;margin:8px 0 4px}
.carebtn{flex:1;text-align:center;background:#fff;border:1.5px solid var(--line);border-radius:13px;padding:10px 3px;font-size:11px;font-weight:700;color:var(--ink);cursor:pointer;min-height:44px;min-width:44px}
.carebtn .ci{font-size:22px;display:block;line-height:1.5}
.carebtn.dim{opacity:.5}
.carecost{display:block;font-size:10px;color:var(--soft);margin-top:3px;font-weight:700}
.speech.big{font-size:16px;font-weight:700;max-width:280px}
.needs{margin-top:6px}
.meter .lockup{color:var(--pink);font-weight:800;font-size:13px}
.meter{display:flex;align-items:center;gap:10px;margin:9px 0;font-size:12px}
.meter .ml{width:108px;color:var(--soft);font-weight:700;white-space:nowrap;flex:none;font-size:11px;overflow:hidden;text-overflow:ellipsis}
.meter .mbar{flex:1;height:9px;background:#eef1fb;border-radius:6px;overflow:hidden}
.meter .mbar span{display:block;height:100%}
.meter .mval{width:34px;text-align:right;color:var(--soft);font-weight:700;font-size:11px}
.evobar{height:10px;background:#eef1fb;border-radius:6px;overflow:hidden;margin:4px 0}
.evobar span{display:block;height:100%;background:linear-gradient(90deg,var(--hero),var(--purple))}
.twofly{display:flex;gap:8px;margin-top:10px}.twofly .btn{flex:1;text-align:center}
.creaturegrid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:8px}
.creature{background:#fff;border:2px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer}
.creature .eggimg{width:90px;height:90px;object-fit:contain}
.creature.soon{opacity:.55}
.soontag{font-size:11px;background:#f1f3f9;border-radius:999px;padding:2px 9px;color:var(--soft)}

/* parent */
.appitem{display:flex;align-items:center;gap:9px;padding:11px 2px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.appitem:last-child{border-bottom:none}
.pav{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;flex:0 0 auto;color:#fff}
.react{display:flex;gap:3px}.react b,.react button{width:28px;height:28px;border-radius:8px;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font-size:15px;background:#fff;cursor:pointer;padding:0;font-family:inherit;color:inherit}
.react b.sel,.react button.sel{border-color:var(--coin);background:var(--coinbg)}
.kidrow{display:flex;align-items:center;gap:10px;padding:11px 2px;border-bottom:1px solid var(--line)}
.kidrow:last-child{border-bottom:none}
.kidrow .av{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:21px;flex:0 0 auto;color:#fff}
.kidrow .nm{min-width:58px;font-weight:700;font-size:14px}.bar2{flex:1;height:9px;background:#eef1fb;border-radius:6px;overflow:hidden}
.bar2 span{display:block;height:100%}
.kidrow .meta{font-size:11px;color:var(--soft);white-space:nowrap}.kidrow .flame{font-size:12px;font-weight:700;white-space:nowrap}.kidrow .bal{font-size:13px;font-weight:800;color:#2a2f45;white-space:nowrap}
.memcard{margin-bottom:10px}
.memcard .av{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:23px;flex:0 0 auto;color:#fff}
.memcard .meta{font-size:12px;color:var(--soft);white-space:nowrap;font-weight:700}
.memcard .flame{font-size:12px;font-weight:700;white-space:nowrap}
.walletline{font-size:13px;font-weight:800;color:#2a2f45;margin:4px 0 2px}
.setrow{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 2px;border-bottom:1px solid var(--line)}
.setrow:last-child{border-bottom:none}.setrow .lab{font-size:14px;font-weight:600}.setrow .lab small{display:block;font-weight:400;color:var(--soft);font-size:11px}
.setval{font-size:13px;background:#f1f3f9;border:1px solid var(--line);border-radius:8px;padding:7px 11px;font-weight:700;white-space:nowrap;color:var(--ink)}
.preview{margin-top:10px;display:flex;flex-direction:column;gap:6px}
.pchip{background:#f7f9ff;border:1px solid var(--line);border-radius:10px;padding:8px 10px;font-size:14px;display:flex;flex-direction:column;gap:6px}
.pchip.amber{background:#fff7e0;border-color:#ffd84d}
.pchiptop{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.pamts{display:flex;gap:8px;flex-wrap:wrap}
.pamt{display:flex;align-items:center;gap:4px;font-size:13px;font-weight:700}
.pamt .pai{font-size:14px}
.inp.tiny{width:62px;padding:6px 7px;font-size:16px;text-align:right;border-radius:8px}
.choredesc{font-weight:400;margin-top:2px;line-height:1.3;white-space:normal}
.tag{font-size:12px;background:#eef1f8;border-radius:999px;padding:1px 8px;color:var(--soft)}
.tag.pool{background:#eaf2ff;color:#2563eb}
.issue{font-size:12px;color:#9a6a00;background:#fff2cc;border-radius:999px;padding:1px 8px}
.bigadd{display:flex;gap:8px;align-items:stretch;margin-top:10px;flex-wrap:wrap}
.switch{width:48px;height:28px;border-radius:999px;background:#cdd6e6;border:none;position:relative;cursor:pointer;flex:none}
.switch .knob{position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;transition:left .15s}
.switch.on{background:var(--go)}.switch.on .knob{left:23px}
.redeemreq{margin-top:8px;gap:8px}

/* auth */
/* #app no longer scrolls (overflow:hidden), so the auth screen scrolls inside itself. margin:auto on
   the card centers it when it fits and falls back to top-aligned + scrollable when it is taller than
   the viewport (align-items:center would clip the top on overflow). */
.auth{flex:1;display:flex;justify-content:center;padding:20px;overflow:auto;-webkit-overflow-scrolling:touch}
.authcard{background:#fff;border:1px solid var(--line);border-radius:20px;padding:26px 24px;width:100%;max-width:380px;margin:auto;text-align:center;box-shadow:0 8px 30px rgba(30,35,51,.06)}
.authcard.wide{max-width:460px;text-align:left}
.authcard .logo{display:flex;justify-content:center;align-items:center;margin:2px 0 12px}
.authcard .sub{color:var(--soft);font-size:14px;margin:2px 0 16px}
.authtitle{font-size:22px;font-weight:800;line-height:1.3;margin:0}
.authcard.wide .authtitle{margin-bottom:12px}
.authsec{font-size:15px;font-weight:800;color:var(--ink);margin:18px 0 6px}
.authfoot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
.gwrap{margin-top:14px}.gwrap.hidden{display:none}
.ordiv{display:flex;align-items:center;gap:10px;color:var(--soft);font-size:12px;font-weight:700;margin:2px 0 12px}
.ordiv::before,.ordiv::after{content:"";flex:1;height:1px;background:var(--line)}
.gbtn{display:flex;justify-content:center;min-height:40px}
.glink{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:10px 4px 4px;font-size:14px}
.glink:empty{display:none}
.glink .lab{font-weight:700;display:flex;align-items:center;gap:6px}
.gdot{width:9px;height:9px;border-radius:50%;background:var(--go);display:inline-block}
.invlink{margin-top:12px}.invlink.hidden{display:none}.invlink input{margin-top:6px;font-size:16px}
.iconpickwrap{margin:4px}
.iconpick{display:flex;flex-wrap:wrap;gap:10px;margin-top:4px}
.iconopt{padding:2px;border:2px solid transparent;border-radius:15px;background:none;cursor:pointer;line-height:0}
.iconopt img{border-radius:12px;display:block}
.iconopt.on{border-color:var(--hero)}
.authcard .fld{text-align:left}
.famdet{margin:8px 0;text-align:left}
.kids{margin:6px 0}
.kidrow.add{display:grid;grid-template-columns:1fr 1fr 1fr auto auto;gap:6px;border:none;padding:6px 0}
.kidrow.add .inp{padding:8px}
.lang{padding:6px;border-radius:8px;border:1px solid var(--line)}

/* sheets/modals */
.backdrop{position:fixed;inset:0;background:rgba(20,25,45,.45);display:flex;align-items:flex-end;justify-content:center;z-index:50;opacity:0;transition:opacity .15s}
.backdrop.open{opacity:1}
.sheet{background:#fff;border-radius:20px 20px 0 0;padding:20px;width:100%;max-width:var(--maxw);max-height:88vh;overflow:auto;padding-bottom:max(20px,env(safe-area-inset-bottom))}
.sheetbody h3{margin-top:10px}.confirm h3{margin-bottom:10px}
.exout{margin:10px 0;display:flex;flex-direction:column;gap:4px}
.warn{color:#c2410c;background:#fff2e8;border-radius:10px;padding:8px 10px;font-size:14px}
.switcher .people,.confirm .people{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.person{display:flex;align-items:center;gap:10px;background:#f7f9ff;border:1px solid var(--line);border-radius:12px;padding:12px;cursor:pointer;text-align:left;font-size:16px}
.person small{margin-left:auto;color:var(--soft)}
.revealfull{position:fixed;inset:0;z-index:90;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;cursor:pointer;animation:fadein .2s;padding:20px}
@keyframes fadein{from{opacity:0}to{opacity:1}}
.revealfull .celebvid{width:100%;max-width:520px;aspect-ratio:1/1;object-fit:cover}
.revealfull .celebemoji{font-size:120px}
.revealfull h2{font-size:24px;margin:6px 0}
.reveal{text-align:center}
.reveal img{width:96px;height:96px;object-fit:contain;display:block;margin:0 auto 6px;filter:drop-shadow(0 4px 8px rgba(40,50,90,.18))}
.rewardgrid,.rrow{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin:12px 0}
.rwd,.rr{font-size:15px;font-weight:800;border-radius:12px;padding:8px 12px}
.rwd .ic{display:block;font-size:26px}
.pinpad{text-align:center}
.redeem{display:flex;flex-direction:column;gap:8px;align-items:center}

/* toast */
.toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%) translateY(20px);background:#1e2333;color:#fff;padding:12px 18px;border-radius:12px;font-weight:600;opacity:0;pointer-events:none;transition:all .2s;z-index:80;max-width:90%}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.err{background:#c2410c}.toast.ok{background:#127a37}

/* Family / Property & Assets (parent-side) */
.fambar{display:flex;align-items:center;gap:10px;margin:0 0 12px}
.fambar h3{font-size:20px}
.fambar .btn.round{width:36px;height:36px;font-size:22px;line-height:1;background:#eef1f8;color:var(--ink)}
.famrow{display:flex;align-items:center;gap:12px;width:100%;background:none;border:none;border-bottom:1px solid var(--line);padding:14px 4px;cursor:pointer;text-align:left;font:inherit;color:var(--ink)}
.famrow:last-child{border-bottom:none}
.famico{color:var(--hero);display:inline-flex;font-size:22px;flex:none}
.famlabel{flex:1;font-weight:700;font-size:17px}
.famcount{color:var(--soft);font-weight:700}
.famchev{color:var(--soft);font-size:20px;line-height:1}
.famseg{display:flex;gap:6px;background:#eef1f8;border-radius:999px;padding:4px;margin:8px 0}
.famsegbtn{flex:1;border:none;background:none;border-radius:999px;padding:9px 6px;font-weight:800;font-size:14px;color:var(--soft);cursor:pointer}
.famsegbtn.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(40,50,90,.15)}
.slothead{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--soft);padding:10px 6px 4px}
.slothead.now{color:var(--hero)}
.histrow{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;padding:9px 4px;border-top:1px solid var(--line)}
.histrow:first-child{border-top:none}
.histrow .hk{font-weight:700;flex:1}
.histrow .hd{color:var(--soft);font-size:11px}
.histrow .ha{width:100%;color:var(--ink);font-weight:700;font-size:12px}
.firstrun{margin:6px 2px 12px}
.frtitle{font-weight:800;margin-bottom:6px;display:flex;align-items:center;gap:6px}
.frstep{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:none;background:none;font:inherit;padding:10px 4px;min-height:40px;cursor:pointer;color:var(--ink);border-top:1px solid var(--line)}
.frtitle + .frstep{border-top:none}
.frstep .phi{opacity:.3}
.frstep.done{color:var(--soft);text-decoration:line-through}
.frstep.done .phi{opacity:1;color:var(--hero)}
.petgrouph{display:flex;align-items:center;gap:8px;color:var(--soft);font-weight:800;margin:12px 4px 2px}
.petgrouph .phi{font-size:18px}
.petrow{display:flex;align-items:center;gap:12px;padding:10px 4px;border-bottom:1px solid var(--line)}
.petrow:last-child{border-bottom:none}
.petav{width:40px;height:40px;border-radius:50%;background:#eaf2ff;color:var(--hero);display:inline-flex;align-items:center;justify-content:center;font-size:20px;flex:none}

/* Chores: tab bar + generated-suggestion rows */
.choretabs{display:flex;flex-wrap:wrap;gap:6px;padding:10px 10px 4px;justify-content:center}
.choretab{border:none;background:#eef1f8;color:var(--soft);border-radius:999px;padding:7px 12px;font-weight:800;font-size:13px;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;gap:5px}
.choretab .phi{font-size:15px}
.choretab.on{background:var(--hero);color:#fff}
.sugrow{display:flex;align-items:center;gap:10px;padding:11px 8px;border-bottom:1px solid var(--line);border-left:4px solid transparent}
.sugrow:last-child{border-bottom:none}
.sugrow .ctitle{flex:1}
.sugfreq{text-transform:capitalize}
.sugadd{min-width:40px;font-size:18px;line-height:1;padding:7px 12px}
.sugrow.imp-critical{border-left-color:var(--danger)}
.sugrow.imp-high{border-left-color:#f59e0b}
.sugrow.imp-medium{border-left-color:var(--hero)}
.sugrow.imp-low{border-left-color:var(--line)}
.sugrow.added,.sugrow.done{opacity:.62}
.sugrow{cursor:pointer}
.sugrow.expanded{align-items:stretch}
/* weekly schedule day picker (template item form) + the per-row days tag */
.daysseg{display:flex;gap:5px;flex-wrap:wrap;margin-top:6px}
.daychip{flex:1;min-width:36px;padding:7px 0;text-align:center;border:1.5px solid var(--line);background:#fff;border-radius:9px;font-weight:700;font-size:13px;color:var(--soft);cursor:pointer}
.daychip.on{border-color:#1d6fd6;background:#eef2ff;color:#1d6fd6}
.daystag{display:inline-flex;align-items:center;gap:3px}.daystag svg{width:12px;height:12px}
.sugbadge{font-weight:800;color:var(--hero)}

.platechip{display:inline-block;background:#fdf3c7;color:#6b5e1a;border-radius:6px;padding:2px 7px;font-weight:800;font-size:12px;margin-left:8px;letter-spacing:.5px}

.roombadge{display:inline-block;border-radius:999px;padding:1px 8px;font-size:11px;font-weight:800;margin-left:6px}
.roombadge.shared{background:var(--gobg);color:#15803d}
.roombadge.private{background:#fff3e0;color:#b45309}

/* Multi-select asset chips (appliances picker) */
.chipgrid{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 14px}
.asetchip{display:inline-flex;align-items:center;gap:6px;border:1.5px solid var(--line);background:#f4f6fb;color:var(--soft);border-radius:14px;padding:9px 13px;font-weight:700;font-size:14px;cursor:pointer}
.asetchip .phi{font-size:18px}
.asetchip.on{border-color:var(--hero);background:#eaf2ff;color:var(--hero)}

/* header gear (admin) + name truncation so the 4-control header fits a phone */
.topbar .gear{background:none;border:0;padding:4px;margin:0 2px;cursor:pointer;color:var(--soft);line-height:0}
.topbar .gear .phi{width:20px;height:20px}
.topbar .who b{max-width:12ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* daily template: a paused (inactive) item stays listed but dimmed so it can be re-enabled */
.chore.tmplpaused{opacity:.5}

/* settings: running build version + manual update check */
.verfoot{margin:18px 4px 8px;font-size:12px;color:var(--soft)}
.verfoot .vfline{font-weight:700;color:var(--ink)}
.verfoot .vflabel{color:var(--soft);font-weight:700}
.verfoot .vfdate{display:block;margin-top:2px;color:var(--soft)}
.verfoot .vfrow{display:flex;align-items:center;gap:10px;margin-top:8px;flex-wrap:wrap}
.verfoot .vfstatus{font-weight:700}

/* parent home v2 - collapsible sections (scoped to the parent Koti) */
.home .acc{background:#fff;border:1px solid var(--line);border-radius:16px;margin:0 0 10px;overflow:hidden}
.home .acc-head{display:flex;align-items:center;gap:10px;padding:13px 12px;cursor:pointer;user-select:none}
.home .acc-ico{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;flex:none;color:#fff}
.home .acc-ico .phi{width:17px;height:17px}
.home .acc-ico.mine{background:var(--go)}.home .acc-ico.appr{background:var(--purple)}.home .acc-ico.kids{background:var(--blue)}.home .acc-ico.sugg{background:var(--coin)}
.home .acc-title{font-size:16px;font-weight:800}
.home .acc .countpill{margin-left:auto;background:#eef1f8;color:#3a4357;border-radius:999px;padding:2px 10px;font-size:13px;font-weight:800;min-width:24px;text-align:center}
.home .acc .chev{flex:none;color:var(--soft);transition:transform .18s;line-height:0}
.home .acc .chev .phi{width:18px;height:18px}
.home .acc.open .chev{transform:rotate(180deg)}
.home .acc-body{padding:2px 12px 10px;border-top:1px solid var(--line)}
.home .acc.is-empty .acc-ico{background:#c4cad6}
.home .acc.is-empty .acc-title{color:#9aa1b0}
.home .acc.is-empty .countpill{background:#f1f3f7;color:#aab0bd}
.khrow{display:flex;align-items:center;gap:10px;padding:9px 2px;border-bottom:1px solid #f0f2f7;cursor:pointer}
.khrow:last-child{border-bottom:none}
.khring{width:36px;height:36px;border-radius:999px;flex:none;display:grid;place-items:center}
.khring i{width:26px;height:26px;border-radius:999px;background:#fff;display:grid;place-items:center;font-size:11px;font-weight:800;font-style:normal;color:#3a4357}
.khname{font-size:15px;font-weight:700}
.khmeta{display:flex;gap:10px;font-size:12px;font-weight:800;margin-top:1px}
.khmeta .e{color:#127a37}.khmeta .t{color:#2563eb}
.hsug{display:flex;align-items:center;gap:10px;padding:9px 2px;border-bottom:1px solid #f0f2f7}
.hsug:last-child{border-bottom:none}
.hsug .ctitle{flex:1;min-width:0}
