/* =====================================================================
   Chin's Family — one design system ("warm family")
   Cream background · white cards · soft pastel tints · one accent per tab
   🏠 house = coral peach · 👶 baby = rose · ☕ business = caramel
   Type scale 12 · 13 · 15 · 17 · 20 · 24 · 32/40  ·  spacing 4 · 8 · 12 · 16 · 20 · 24 · 32
   Page-specific layouts live in shop.css and dash.css and only use these tokens.
   ===================================================================== */
:root{
  color-scheme:light;
  /* neutrals (warm) */
  --bg:#FFF8F4; --surface:#FFFFFF; --surface-2:#FFF1EC; --soft:#FFF1EC;
  --ink:#3B2F36; --ink-2:#5E4F58; --muted:#9A8A92; --line:#F6E4E2; --line-2:#EFD3D3;
  /* accent (per tab, see bottom) */
  --brand:#F27FA5; --brand-ink:#FFFFFF; --brand-shade:#D85E89; --brand-soft:#FFE9F1;
  /* money */
  --inc:#2E9467; --exp:#D9534F; --warn:#C98A12;
  /* pastel tints: background + matching text */
  --t-mint:#E3F6EC;   --t-mint-ink:#2C7A58;
  --t-peach:#FFEADF;  --t-peach-ink:#B8582F;
  --t-pink:#FFE6EF;   --t-pink-ink:#B83A6C;
  --t-sky:#E4F1FD;    --t-sky-ink:#2C6AA3;
  --t-butter:#FFF3CF; --t-butter-ink:#8F6408;
  --t-lilac:#EFE9FD;  --t-lilac-ink:#6A4FB4;
  /* shape */
  --r:22px; --r-sm:16px; --r-xs:12px; --wobbly:var(--r);
  --shadow:0 1px 2px rgba(150,70,90,.05), 0 10px 26px -14px rgba(150,70,90,.22);
  --shadow-lg:0 2px 4px rgba(150,70,90,.06), 0 26px 50px -20px rgba(150,70,90,.32);
  /* type */
  --font:'IBM Plex Sans Thai Looped','IBM Plex Sans Thai',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --head-font:'Mali','IBM Plex Sans Thai Looped',system-ui,sans-serif; --font-cute:var(--head-font);
  /* legacy names still used by page css */
  --crayon-blue:#5B9BD5; --crayon-pink:#E57BA3; --crayon-yellow:#F2C14E; --crayon-green:#4FB286;
  --tone-yellow:var(--t-butter); --tone-blue:var(--t-sky); --tone-pink:var(--t-pink); --tone-green:var(--t-mint); --tone-orange:var(--t-peach);
}
body[data-mode=baby]{ --brand:#A38BE6; --brand-shade:#7F66C9; --brand-soft:#F1ECFD; --bg:#FBF8FF; --surface-2:#F5F1FD; --soft:#F5F1FD; --line:#ECE4F6; --line-2:#DFD3F1; }
/* ☕ the shop is a grown-up place: calm caramel, clean Prompt headings */
body[data-mode=business]{ --brand:#A8714A; --brand-shade:#8C5A37; --brand-soft:#F5EBE1; --bg:#F8F4EF; --surface-2:#F5EEE6; --soft:#F5EEE6; --line:#EDE3D8; --line-2:#E1D3C4; --ink:#2E2A27; --ink-2:#55504B; --muted:#8C847D;
  --head-font:'Prompt','IBM Plex Sans Thai Looped',system-ui,sans-serif; --shadow:0 1px 2px rgba(70,45,20,.04), 0 8px 24px -14px rgba(70,45,20,.18); }

/* ---------- base ---------- */
*{box-sizing:border-box;margin:0}
html{-webkit-text-size-adjust:100%}
body{font-family:var(--font);font-size:15px;line-height:1.55;color:var(--ink);background-color:var(--bg);
  /* tiny hearts + dots, very faint — cosy, not busy */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23F27FA5' fill-opacity='.07'%3E%3Cpath d='M30 38c-4-3-8-6-8-10a4 4 0 0 1 8-1 4 4 0 0 1 8 1c0 4-4 7-8 10z'/%3E%3Ccircle cx='90' cy='30' r='2.5'/%3E%3Ccircle cx='60' cy='90' r='2'/%3E%3Cpath d='M96 98c-3-2.4-6-4.6-6-7.6a3 3 0 0 1 6-.8 3 3 0 0 1 6 .8c0 3-3 5.2-6 7.6z'/%3E%3C/g%3E%3C/svg%3E");font-variant-numeric:tabular-nums;-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;text-align:inherit}
input,select,textarea{font:inherit;color:inherit}
button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
a{color:var(--brand-shade)}
h1,h2,.brand,.auth-title,.who-name{font-family:var(--head-font);letter-spacing:0}
h1{font-size:24px;font-weight:600;line-height:1.25}
h2{font-size:17px;font-weight:600;line-height:1.35;margin-bottom:8px}
.mut{color:var(--muted);font-size:13px}
.small{font-size:12px}.tiny{font-size:11px}
.pos{color:var(--inc)}.neg{color:var(--exp)}
.grow{flex:1;min-width:0}
.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.link{color:var(--brand-shade);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.ic{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.ic.cute{stroke:var(--ink);stroke-width:1.4;width:24px;height:24px;filter:none}
.deco{display:block;pointer-events:none;user-select:none;-webkit-user-drag:none;height:auto}
/* kids' crayon drawings: only in empty states and the sign-in page now */
.page-deco,.parade,.nav-doodle,.note-doodle,.menu-banner{display:none!important}
.empty-kid{width:72px;margin:0 auto 10px;opacity:.9}
.yay{display:flex;align-items:center;gap:10px;margin:0}
.yay .deco,.note-yay .deco{width:44px;flex:none}
.note-yay{display:flex;align-items:center;gap:10px}

/* ---------- shell + navigation ---------- */
.shell{max-width:1440px;margin:0 auto}
main{position:relative;padding:16px 16px calc(140px + env(safe-area-inset-bottom));max-width:720px;margin:0 auto}
@media(min-width:600px){ main{padding:20px 24px calc(140px + env(safe-area-inset-bottom))} }
@media(max-width:359px){ main{padding-left:12px;padding-right:12px} }

nav.nav{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;justify-content:center;
  background:rgba(255,255,255,.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
nav.nav button{flex:1;max-width:112px;min-width:0;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px 7px;font-size:11px;color:var(--muted);position:relative;text-align:center}
nav.nav button .ic.cute{opacity:.7;transition:opacity .15s,transform .15s}
nav.nav button.on{color:var(--brand-shade);font-weight:600}
nav.nav button.on .ic.cute{opacity:1;transform:translateY(-1px)}
nav.nav button.on::before{content:"";position:absolute;top:0;left:30%;right:30%;height:3px;border-radius:0 0 3px 3px;background:var(--brand)}
nav.nav .nl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
nav.nav .badge{position:absolute;top:4px;left:calc(50% + 6px);min-width:17px;height:17px;padding:0 4px;border-radius:99px;background:var(--exp);color:#fff;font-size:10px;font-weight:700;display:grid;place-items:center;box-shadow:0 0 0 2px #fff}
nav.nav .badge.warn{background:var(--warn)} nav.nav .badge.info{background:var(--brand)}
.brand,nav.nav .nav-add,.nav-h,.nav-hr{display:none}
@media(max-width:899px){ nav.nav .nav-sec{display:none} }

.fab{position:fixed;right:16px;bottom:calc(76px + env(safe-area-inset-bottom));z-index:25;width:56px;height:56px;border-radius:50%;display:grid;place-items:center;
  background:var(--brand);color:var(--brand-ink);box-shadow:0 10px 24px -8px color-mix(in srgb,var(--brand) 70%,transparent)}
.fab .ic{width:26px;height:26px;stroke-width:2.2}
.fab:active{transform:scale(.95)}

@media(min-width:900px){
  .shell{display:grid;grid-template-columns:248px minmax(0,1fr);align-items:start}
  nav.nav{position:sticky;top:0;height:100vh;flex-direction:column;justify-content:flex-start;gap:2px;padding:20px 14px;
    background:rgba(255,255,255,.6);border-top:0;border-right:1px solid var(--line);overflow-y:auto}
  nav.nav button{max-width:none;flex:none;flex-direction:row;gap:10px;padding:9px 12px;border-radius:12px;font-size:15px;color:var(--ink-2);justify-content:flex-start}
  nav.nav button.on{background:var(--brand-soft);color:var(--brand-shade)}
  nav.nav button.on::before{top:9px;bottom:9px;left:0;right:auto;width:3px;height:auto;border-radius:0 3px 3px 0}
  nav.nav .badge{position:static;margin-left:auto;box-shadow:none}
  nav.nav .nav-phone{display:none}
  .nav-h{display:block;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:16px 12px 4px}
  nav.nav .nav-add{display:flex;justify-content:center;gap:8px;margin:4px 0 6px;padding:11px 12px;background:var(--brand);color:var(--brand-ink);font-weight:600;border-radius:14px}
  nav.nav .nav-add .ic{stroke-width:2.2}
  .fab{display:none}
  main{padding:28px 36px 64px;margin:0;max-width:1180px}
  main.page-activity,main.page-bills,main.page-lists,main.page-money,main.page-stock,main.page-onboard,main.page-settings,main.page-contacts{max-width:820px}
  main>.btn{width:auto;display:inline-block;padding:11px 24px}
}
@media(hover:hover){ nav.nav button:not(.on):not(.nav-add):hover{background:var(--surface-2);color:var(--ink)} }

/* brand */
.brand{align-items:center;gap:10px;padding:2px 6px 14px}
@media(min-width:900px){ .brand{display:flex} }
.brand-mark{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:var(--brand-soft);flex:none}
.brand-mark .ic.cute{width:24px;height:24px}
.brand-t{display:flex;flex-direction:column;min-width:0}
.brand-t b{font-family:var(--head-font);font-size:18px;font-weight:600}

/* top bar (phone/tablet): tab switch + chat */
.topbar{position:sticky;top:0;z-index:15;display:flex;gap:8px;align-items:center;margin:-16px -16px 16px;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;
  background:color-mix(in srgb,var(--bg) 90%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
@media(min-width:600px){ .topbar{margin:-20px -24px 20px;padding-left:24px;padding-right:24px} }
@media(max-width:359px){ .topbar{margin-left:-12px;margin-right:-12px;padding-left:12px;padding-right:12px} }
@media(min-width:900px){ .topbar{display:none} }

/* 🏠 · 👶 · ☕ switch */
.mode-switch{flex:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;width:100%;
  background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}
.mode-switch button,nav.nav .mode-switch button{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:6px;padding:8px 6px;border-radius:12px;
  color:var(--ink-2);font-size:14px;max-width:none;min-width:0;background:transparent;font-weight:500}
nav.nav .mode-switch button::before,.mode-switch button::before{display:none}
.mode-switch .ms-e{font-size:18px;line-height:1}
.mode-switch .ms-t{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.mode-switch .ms-t b{font-weight:600;white-space:nowrap}
.mode-switch .ms-t small{display:none}
.mode-switch button.on,nav.nav .mode-switch button.on{background:var(--brand);color:var(--brand-ink);box-shadow:0 4px 10px -4px color-mix(in srgb,var(--brand) 70%,transparent)}
@media(hover:hover){ .mode-switch button:not(.on):hover{background:var(--surface-2)} }
nav.nav .ms-side{display:none}
@media(min-width:900px){
  nav.nav .ms-side{display:grid;margin:0 0 10px;box-shadow:none}
  nav.nav .ms-side button{flex-direction:column;gap:2px;padding:8px 2px;font-size:13px}
}

/* chat button */
.chat-btn{position:relative;display:inline-flex;align-items:center;gap:6px;flex:none;padding:9px 12px;border-radius:14px;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);font-size:17px}
.chat-btn .cb-l{font-size:14px;font-weight:600}
.chat-btn .badge{position:absolute;top:-6px;right:-6px;min-width:19px;height:19px;padding:0 5px;border-radius:99px;background:var(--exp);color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center;box-shadow:0 0 0 2px var(--bg)}
.brand .chat-btn{margin-left:auto;padding:6px 9px;box-shadow:none}
.brand .chat-btn .cb-l{display:none}
@media(max-width:419px){ .topbar .chat-btn .cb-l{display:none} }

/* page header */
.page-head{position:relative;margin:0 0 18px}
.page-head h1{display:flex;align-items:center;gap:10px}
.page-head .mut{margin-top:4px;font-size:14px;max-width:62ch}
.page-head .mut .avatar.xs{display:inline-grid;vertical-align:-5px;margin-right:2px}
.ph-ic{flex:none;width:40px;height:40px;display:grid;place-items:center;border-radius:12px;background:var(--brand-soft)}
.ph-ic .ic{width:24px;height:24px}
.crumb{display:none;align-items:center;gap:6px;font-size:13px;color:var(--muted);margin-bottom:4px}
.crumb b{color:var(--brand-shade);font-weight:600}
.back-btn{display:inline-flex;align-items:center;gap:2px;margin:0 0 8px -4px;padding:5px 12px 5px 8px;border-radius:99px;font-weight:600;font-size:14px;color:var(--brand-shade);background:var(--surface);border:1px solid var(--line)}
@media(max-width:599px){ .page-head h1{font-size:21px} .ph-ic{width:34px;height:34px} .ph-ic .ic{width:21px;height:21px} }
@media(min-width:900px){ .page-head h1{font-size:27px} .crumb{display:flex} .back-btn{display:none} }

/* ---------- surfaces ---------- */
.sec{margin:0 0 24px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:6px 16px;box-shadow:var(--shadow)}
.card.pad{padding:16px}
.row{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line);width:100%}
.row:first-child{border-top:0}
button.row{text-align:left;border-radius:8px}
@media(hover:hover){ button.row:hover{background:color-mix(in srgb,var(--surface-2) 60%,transparent)} }
.ico{width:40px;height:40px;border-radius:12px;background:var(--surface-2);display:grid;place-items:center;font-size:19px;flex:none}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block;flex:none}
.amt-t{font-weight:600;white-space:nowrap}
.hero{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:18px 20px;margin:0 0 18px;box-shadow:var(--shadow)}
.hero .big{font-family:var(--head-font);font-size:clamp(30px,8vw,40px);font-weight:600;letter-spacing:-.01em;line-height:1.15}
.hero .two{display:flex;gap:28px;margin-top:10px;flex-wrap:wrap}
.stack{display:flex;height:10px;border-radius:99px;overflow:hidden;background:var(--surface-2);margin:12px 0 6px;gap:2px}
.stack i{display:block;height:100%}
.bar{height:8px;background:var(--surface-2);border-radius:99px;overflow:hidden}
.bar>i{display:block;height:100%;background:var(--brand);border-radius:99px}
.bar.warn>i{background:var(--warn)}.bar.red>i{background:var(--exp)}.bar.ok>i{background:var(--inc)}
.trend{display:flex;gap:8px;height:120px;align-items:flex-end}
.trend>div{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px}
.trend .bars{display:flex;gap:3px;align-items:flex-end;height:92px;width:100%;justify-content:center}
.trend .bars i{display:block;width:40%;max-width:14px;border-radius:4px 4px 0 0;min-height:2px}
.legend{display:flex;gap:14px;margin-top:8px}
.legend.split{flex-wrap:wrap;gap:6px 16px;font-size:13px;color:var(--muted)}
.legend.split b{color:var(--ink);font-weight:600}
.empty{text-align:center;padding:28px 12px;color:var(--muted)}
.empty b{display:block;color:var(--ink);font-family:var(--head-font);font-weight:600;font-size:17px;margin-bottom:4px}
.mnav{display:flex;align-items:center;justify-content:space-between;margin:0 0 12px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:14px}
.mnav button{width:38px;height:38px;display:grid;place-items:center;border-radius:10px;color:var(--ink-2)}
.mnav strong{font-family:var(--head-font);font-size:16px;font-weight:600}
.scroll{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;margin-bottom:12px;scrollbar-width:none}
.scroll::-webkit-scrollbar{display:none}
.cnt{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 7px;border-radius:99px;background:var(--surface-2);color:var(--ink-2);font-size:12px;font-weight:600;margin-left:4px;font-family:var(--font)}
.cnt.warn{background:var(--t-butter);color:var(--t-butter-ink)}
h2 .count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:var(--exp);color:#fff;font-size:12px;margin-left:4px}
.flow,.grid{display:block}
@media(min-width:1100px){
  .flow{columns:2;column-gap:20px} .flow>.sec,.flow>.empty{break-inside:avoid}
  .grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 24px;align-items:start}
  .top{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}
}
.notice{margin:16px 0 0;padding:12px 14px;border-radius:12px;font-size:14px;border:1px solid var(--line);background:var(--surface-2)}
.notice.ok{background:var(--t-mint);color:var(--t-mint-ink)} .notice.warn{background:var(--t-butter);color:var(--t-butter-ink)} .notice.err{background:#FDECEA;color:var(--exp)}
.sql-note{background:var(--t-butter);color:var(--t-butter-ink);border-color:transparent;line-height:1.55}
.alerts{padding:0}
.alert-row{gap:10px;padding:10px 8px;border-radius:10px;font-size:14px}
.alert-row .a-ic{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;flex:none;background:var(--t-butter)}
.alert-row.red .a-ic{background:var(--t-pink)} .alert-row.red .grow{color:var(--exp);font-weight:500}
.alert-row .a-go{color:var(--muted);font-size:20px}

/* ---------- controls ---------- */
.btn{display:block;width:100%;padding:12px 18px;border-radius:var(--r-sm);background:var(--brand);color:var(--brand-ink);font-weight:600;text-align:center;
  transition:transform .08s,filter .12s,background .12s;box-shadow:0 4px 12px -6px color-mix(in srgb,var(--brand) 70%,transparent)}
.btn:active{transform:scale(.98)}
.btn.ghost{background:var(--surface);color:var(--ink);border:1px solid var(--line-2);box-shadow:none}
.btn.danger{background:transparent;color:var(--exp);box-shadow:none}
.btn.sm{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:auto;padding:7px 14px;font-size:13px;border-radius:11px}
.btn .ic{width:18px;height:18px;stroke-width:2.4}
.btns{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}
.btns .btn:not(.sm){flex:1}
@media(hover:hover){ .btn:hover{filter:brightness(1.05)} .btn.ghost:hover{background:var(--surface-2);filter:none} }
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:7px 13px;border-radius:99px;background:var(--surface);border:1px solid var(--line-2);font-size:14px;white-space:nowrap;text-align:center;transition:background .12s,border-color .12s}
.chip.on{background:color-mix(in srgb,var(--c,var(--brand)) 14%,#fff);border-color:var(--c,var(--brand));color:var(--ink);font-weight:600}
.chip.sm{padding:5px 10px;font-size:13px}
@media(hover:hover){ .chip:not(.on):hover{background:var(--surface-2)} }
.chip .avatar.xs{margin-left:-5px}
.seg{display:flex;gap:2px;padding:4px;background:var(--surface-2);border-radius:14px}
.seg button{flex:1;padding:9px;border-radius:11px;font-weight:500;color:var(--ink-2);text-align:center}
.seg button.on{background:var(--surface);color:var(--ink);font-weight:600;box-shadow:0 1px 3px rgba(70,45,20,.12)}
.seg button.on.exp{color:var(--exp)}.seg button.on.inc{color:var(--inc)}
.seg button.on .cnt{background:var(--brand);color:var(--brand-ink)}
.lbl{display:block;font-size:13px;font-weight:600;color:var(--ink-2);margin:16px 0 6px}
.in{width:100%;padding:11px 13px;border:1px solid var(--line-2);border-radius:var(--r-sm);background:var(--surface);font-size:16px;transition:border-color .12s,box-shadow .12s}
.in:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent)}
textarea.in{resize:vertical;line-height:1.5}
.amt{font-size:32px;font-weight:600;text-align:center;padding:12px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.small-in{width:100px;text-align:right;padding:7px 10px}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:36px;min-width:36px;padding:0 10px;border-radius:99px;border:1px solid var(--line);background:var(--surface);color:var(--ink-2);font-size:12px;font-weight:600;flex:none}
.icon-btn .ic{width:18px;height:18px}
.icon-btn.sm{width:32px;height:32px;min-width:32px;padding:0;border-radius:50%}
.busy{opacity:.7;cursor:progress}
.btn.busy{position:relative;color:transparent!important}
.btn.busy::after{content:"";position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;border:2px solid var(--brand-ink);border-right-color:transparent;animation:spin .7s linear infinite}
.btn.ghost.busy::after,.btn.danger.busy::after{border-color:var(--ink);border-right-color:transparent}
button:disabled{cursor:default;opacity:.5}
@keyframes spin{to{transform:rotate(360deg)}}

/* tags */
.tag{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:99px;font-size:12px;font-weight:600;white-space:nowrap;
  color:color-mix(in srgb,var(--c,var(--muted)) 85%,var(--ink));background:color-mix(in srgb,var(--c,var(--muted)) 13%,#fff)}
.tag:has(.avatar){padding-left:3px}
.tag.any{--c:var(--muted)} .tag.home{--c:#C98A12} .tag.soon{--c:var(--warn)} .tag.late{--c:var(--exp)} .tag.ok{--c:var(--inc)}
.tag.note{--c:var(--muted);font-weight:400;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.tag.add{--c:var(--brand);border:1px dashed color-mix(in srgb,var(--brand) 55%,transparent);cursor:pointer;height:26px}

/* avatars */
.avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--c,var(--brand));color:#fff;font-weight:600;font-size:17px;flex:none;overflow:hidden}
.avatar.xs{width:20px;height:20px;font-size:11px}
.avatar.sm{width:28px;height:28px;font-size:13px}
.avatar.md{width:40px;height:40px}
.avatar.lg{width:64px;height:64px;font-size:26px}
.avatar.xl{width:92px;height:92px;font-size:36px}
.avatar.any{background:var(--surface-2);color:var(--ink-2);font-size:11px;font-weight:700}
.avatar.photo{padding:0;background:var(--c)}
.avatar.photo img{width:100%;height:100%;object-fit:cover;display:block}
.face-av{background:none}
.face-av .face{width:100%;height:100%;display:block}

/* ---------- sheet + toast ---------- */
.scrim{position:fixed;inset:0;background:rgba(46,42,39,.35);z-index:40;backdrop-filter:blur(2px)}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:41;max-height:92vh;overflow:auto;background:var(--surface);border-radius:24px 24px 0 0;
  padding:18px 18px calc(24px + env(safe-area-inset-bottom));box-shadow:var(--shadow-lg)}
.sheet::before{content:"";display:block;width:40px;height:4px;border-radius:4px;background:var(--line-2);margin:-8px auto 10px}
.sheet .head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px}
.sheet .head h2{font-size:19px;margin:0}
.sheet .head button{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;color:var(--ink-2);background:var(--surface-2)}
@media(min-width:700px){ .sheet{left:50%;top:50%;bottom:auto;transform:translate(-50%,-50%);width:480px;border-radius:24px} .sheet::before{display:none} }
#toast{position:fixed;left:50%;top:calc(12px + env(safe-area-inset-top));transform:translate(-50%,-16px);z-index:60;display:flex;align-items:center;gap:10px;width:max-content;max-width:min(92vw,440px);
  padding:11px 16px 11px 12px;border-radius:16px;background:var(--surface);color:var(--ink);border:1px solid var(--line);box-shadow:var(--shadow-lg);font-size:14px;line-height:1.4;
  opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;cursor:pointer}
#toast.show{opacity:1;transform:translate(-50%,0);pointer-events:auto}
#toast .t-ic{flex:none;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:700;color:#fff;background:var(--muted)}
#toast.ok .t-ic{background:var(--inc)} #toast.info .t-ic{background:var(--brand)} #toast.warn .t-ic{background:var(--warn)}
#toast.err{background:#FDECEA;color:var(--exp);border-color:#F6C9C5} #toast.err .t-ic{background:var(--exp)}

/* ---------- sign-in ---------- */
.auth-page{position:relative;overflow:hidden;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:calc(56px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  background:radial-gradient(80% 50% at 15% 0%,var(--t-peach),transparent 70%),radial-gradient(70% 50% at 95% 10%,var(--t-pink),transparent 70%),var(--bg)}
.auth-top{position:fixed;top:calc(14px + env(safe-area-inset-top));right:16px;z-index:5}
.auth-card{position:relative;z-index:1;width:100%;max-width:360px;display:flex;flex-direction:column;align-items:center;text-align:center}
@media(min-width:600px){ .auth-card{max-width:420px;background:var(--surface);border:1px solid var(--line);border-radius:28px;padding:36px 32px 32px;box-shadow:var(--shadow-lg)} }
.auth-sq{display:none}
.auth-art{width:132px;height:auto;margin:-6px 0 6px}
@media(max-height:760px){ .auth-art{width:96px} } @media(max-height:620px){ .auth-art{display:none} }
.auth-brand{display:flex;flex-direction:column;align-items:center;gap:8px;margin-bottom:20px}
.brand-mark.lg{width:52px;height:52px;border-radius:16px}
.auth-app{font-size:14px;font-weight:600;color:var(--muted)}
.auth-title{font-size:24px;font-weight:600;line-height:1.3}
.auth-sub{color:var(--muted);margin:4px 0 24px}
.auth-msg{min-height:22px;margin:0 0 18px;font-size:14px;color:var(--muted)}
.auth-msg.err{color:var(--exp);font-weight:500} .auth-msg.warn{color:var(--warn)}
.who{display:flex;justify-content:center;gap:24px;flex-wrap:wrap}
.who-btn{display:flex;flex-direction:column;align-items:center;gap:10px;padding:10px;border-radius:20px}
.who-name{font-size:18px;font-weight:600}
.avatar.xl{box-shadow:0 0 0 4px #fff,0 0 0 6px color-mix(in srgb,var(--c) 40%,transparent);transition:transform .15s,box-shadow .15s}
@media(hover:hover){ .who-btn:hover .avatar{transform:translateY(-3px);box-shadow:0 0 0 4px #fff,0 0 0 7px var(--c)} }
.pin-user{display:inline-flex;align-items:center;gap:10px;padding:6px 14px 6px 6px;border-radius:99px;background:var(--surface-2);margin-bottom:18px}
.pin-user .avatar{width:34px;height:34px;font-size:15px}
.pin-user-name{font-weight:600}
.pin-switch{font-size:12px;color:var(--brand-shade);font-weight:600;padding-left:8px;border-left:1px solid var(--line-2)}
.dots{display:flex;justify-content:center;gap:14px;margin:18px 0 12px;height:18px}
.dots i{width:14px;height:14px;border-radius:50%;background:var(--line-2);transition:background .15s,transform .15s}
.dots i.on{background:var(--c,var(--brand));transform:scale(1.15)}
.dots.busy i{background:var(--c,var(--brand));animation:pulse 1s ease-in-out infinite}
.dots.busy i:nth-child(even){animation-delay:.15s}
.dots.shake{animation:shake .4s} .dots.shake i{background:var(--exp)}
.keypad{display:grid;grid-template-columns:repeat(3,72px);gap:14px 22px;justify-content:center}
.key{width:72px;height:72px;border-radius:50%;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);font-family:var(--head-font);font-size:26px;font-weight:500;display:grid;place-items:center;user-select:none;-webkit-tap-highlight-color:transparent;transition:transform .06s}
.key:active{transform:scale(.93);background:var(--surface-2)}
.key-del{background:transparent;border:0;box-shadow:none;color:var(--muted)}
.key-del .ic{width:26px;height:26px}
@media(max-height:680px){ .keypad{grid-template-columns:repeat(3,62px);gap:10px 20px} .key{width:62px;height:62px;font-size:22px} }
.loading{display:grid;place-items:center;min-height:60vh}
.spinner{width:28px;height:28px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--brand);animation:spin .8s linear infinite}
@keyframes shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-9px)}40%,80%{transform:translateX(9px)}}
@keyframes pulse{50%{opacity:.3}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------- lists (to buy / to do) ---------- */
.list-tabs{margin-bottom:12px}
.list-tabs button{padding:10px 9px;font-size:15px}
.people .chip{padding:6px 12px}
.quick{display:flex;gap:8px;align-items:stretch}
.quick .in{flex:1;min-width:0}
.quick .btn.sm{padding:0 14px;border-radius:12px;font-size:14px}
.quick .btn .ic{width:18px;height:18px}
.quick-hint{font-size:12px;margin:6px 2px 18px}
.grp-head{display:flex;align-items:center;gap:8px;font-family:var(--head-font);font-size:16px;font-weight:600;margin:0 0 8px}
.grp-head .mut{font-weight:500;font-size:13px;font-family:var(--font)}
.task-grp .card{padding:2px 14px}
.task{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-top:1px solid var(--line)}
.task:first-child{border-top:0}
.task-main{flex:1;min-width:0;text-align:left;display:flex;flex-direction:column;gap:6px}
.task-title{font-weight:500;line-height:1.4;word-break:break-word}
.task-title .qty{color:var(--muted);font-weight:400}
.task-meta{display:flex;flex-wrap:wrap;gap:6px}
.task.done .task-title{text-decoration:line-through;color:var(--muted)}
.tick{width:26px;height:26px;margin-top:1px;border-radius:50%;border:2px solid color-mix(in srgb,var(--c,var(--brand)) 60%,var(--line-2));display:grid;place-items:center;flex:none;color:transparent;transition:background .15s,color .15s,transform .08s}
.tick .ic{width:15px;height:15px;stroke-width:2.8}
.tick:active{transform:scale(.9)}
.tick.on{background:var(--c,var(--inc));border-color:var(--c,var(--inc));color:#fff}
@media(hover:hover){ .tick:not(.on):hover{color:color-mix(in srgb,var(--c,var(--brand)) 60%,transparent)} }
.done-list{margin-top:8px}
.done-list summary{cursor:pointer;font-weight:600;padding:8px 2px;list-style:none;display:flex;gap:8px;align-items:center}
.done-list summary::before{content:"›";display:inline-block;transition:transform .15s;color:var(--muted);font-size:18px;line-height:1}
.done-list[open] summary::before{transform:rotate(90deg)}
.done-list summary::-webkit-details-marker{display:none}
.done-list .card{padding:2px 14px}

/* ---------- business board notes + home stock rows + more page ---------- */
.board{display:flex;flex-direction:column;gap:16px}
.board.board-grid{display:grid;grid-template-columns:minmax(0,1fr)}
@media(min-width:760px){ .board.board-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start} }
main.page-home{max-width:1180px}
.note{--tone:#fff;position:relative;display:flex;flex-direction:column;gap:10px;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow)}
.note::before{display:none}
.note-h{display:flex;align-items:center;gap:10px}
.note-h h2{flex:1;min-width:0;margin:0;font-size:16px}
.note-e{width:34px;height:34px;flex:none;display:grid;place-items:center;border-radius:11px;font-size:18px;background:var(--tone)}
.note.yellow{--tone:var(--t-butter)} .note.blue{--tone:var(--t-sky)} .note.pink{--tone:var(--t-pink)} .note.green{--tone:var(--t-mint)} .note.orange{--tone:var(--t-peach)} .note.paper{--tone:var(--surface-2)}
.note-more{flex:none;font-size:13px;font-weight:600;color:var(--brand-shade);padding:4px 10px;border-radius:99px;white-space:nowrap}
.note-more:hover{background:var(--brand-soft)}
.note>p{margin:0}
.note .btn.sm{align-self:flex-start}
.note-big{font-family:var(--head-font);font-size:clamp(26px,7vw,32px);font-weight:600;line-height:1.15}
.note-sub{font-size:12px;font-weight:600;color:var(--muted);margin-bottom:-4px}
.note-three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.note-three.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.note-three>div{background:var(--surface-2);border-radius:12px;padding:8px 10px;min-width:0}
.note-three span{display:block;font-size:12px}
.note-three b{display:block;font-size:17px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.note-split{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:13px;color:var(--muted)}
.note-split span{display:inline-flex;align-items:center;gap:5px}
.note-split b{color:var(--ink)}
.note-warn{font-size:13px;padding:7px 10px;border-radius:10px;background:var(--t-butter);color:var(--t-butter-ink)}
.note-warn.red{background:#FDECEA;color:var(--exp);font-weight:500}
.note-list{list-style:none;margin:0;padding:0}
.note-list li{display:flex;align-items:center;gap:8px;padding:8px 0;border-top:1px solid var(--line);min-width:0}
.note-list li:first-child{border-top:0;padding-top:0}
.note-list b{white-space:nowrap;font-size:14px}
.note-list .btn.sm{padding:4px 10px;font-size:12px}
.note-tx{background:var(--surface-2);border-radius:12px;padding:0 10px}
.note-tx .row{padding:8px 0;gap:10px}
.note-tx .ico{width:32px;height:32px;font-size:16px;background:#fff}
.mini{font-size:12px;white-space:nowrap;color:var(--muted)}
.goal-li .grow{display:flex;flex-direction:column;gap:5px}
.hitem{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 10px;padding:10px 0;border-top:1px solid var(--line)}
.hitem:first-child{border-top:0}
.hitem-main{text-align:left;min-width:0;padding:4px 0}
.hitem-low{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;margin-top:-2px}
.hitem.low .task-title{font-weight:600}
.stepper{display:inline-flex;align-items:center;gap:2px;background:var(--surface-2);border-radius:99px;padding:3px}
.stepper button{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--surface);box-shadow:0 1px 2px rgba(70,45,20,.12)}
.stepper button:active{transform:scale(.94)}
.stepper .ic{width:16px;height:16px;stroke-width:2.6}
.stepper b{min-width:30px;text-align:center;font-size:16px;font-family:var(--head-font)}
.low-banner{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 14px;margin:0 0 18px;border-radius:var(--r-sm);background:var(--t-peach);color:var(--t-peach-ink);font-weight:600}
.day-h{display:flex;justify-content:space-between;margin-bottom:6px;font-size:13px}
.menu-grid{display:grid;gap:10px}
@media(min-width:700px){ .menu-grid{grid-template-columns:1fr 1fr} }
.menu-sec{grid-column:1/-1;font-size:12px;font-weight:700;letter-spacing:.05em;color:var(--muted);margin:12px 4px 0}
.menu-sec:first-child{margin-top:0}
.menu-tile{display:flex;align-items:center;gap:14px;text-align:left;padding:14px 16px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow)}
.menu-tile .ic.cute{width:32px;height:32px}
.menu-tile .grow{display:flex;flex-direction:column;gap:2px;min-width:0}
.menu-tile b{font-family:var(--head-font);font-weight:600;font-size:16px}
.menu-tile .a-go{color:var(--muted);font-size:22px}
.menu-who{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:20px}
.owner-seg{margin-bottom:14px;overflow-x:auto;scrollbar-width:none}
.owner-seg button{white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:9px 10px}
.acc-row .ico{font-size:20px}
.money-now{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:12px 14px;margin:0 0 18px}
.setup-banner{display:flex;flex-direction:column;gap:12px;padding:16px 18px;margin:0 0 16px;border-radius:var(--r);background:var(--t-butter);color:var(--t-butter-ink)}

/* settings */
details.adv{margin-top:8px}
details.adv>summary{cursor:pointer;list-style:none;display:flex;flex-direction:column;gap:2px;margin-bottom:8px}
details.adv>summary::-webkit-details-marker{display:none}
details.adv>summary h2{margin:0}
details.adv>summary h2::after{content:" ▾";font-size:14px;color:var(--muted)}
.profile-photo{display:flex;align-items:center;gap:16px}
.profile-photo .grow{display:flex;flex-direction:column;gap:2px}
.pp-pic{position:relative;flex:none;border-radius:50%}
.pp-cam{position:absolute;right:-2px;bottom:-2px;width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);font-size:15px}
.grid.cards>.card{margin-bottom:12px}
@media(min-width:1100px){ .grid.cards{gap:16px} .grid.cards>.card{margin-bottom:0} }
@media(min-width:1500px){ .grid.cards{grid-template-columns:repeat(3,minmax(0,1fr))} }
.sb-text{display:flex;flex-direction:column;gap:4px}
.sb-text b{font-family:var(--head-font);font-size:18px;font-weight:600}

/* ---------- 🎨 Phosphor icons (replace emoji) + bank logos ---------- */
.pi{width:1.2em;height:1.2em;display:inline-block;vertical-align:-.22em;flex:none}
.pi-wrap{display:inline-flex;align-items:center;justify-content:center;line-height:1}
.ic.ph{width:24px;height:24px;fill:currentColor;stroke:none}
nav.nav .ic.ph{width:23px;height:23px}
nav.nav button.on .ic.ph{color:var(--brand)}
.ph-ic .ic.ph,.brand-mark .ic.ph{color:var(--brand-shade)}
.menu-tile .ic.ph{width:30px;height:30px;color:var(--brand-shade)}
/* bubbles that hold one icon: centre it and size it from the bubble */
.ico .pi-wrap .pi,.dbox-e .pi,.ov-e .pi,.note-e .pi,.ll-e .pi,.cat-t span .pi,.log-btn span .pi,.mood span .pi,.mp-mood .pi,.fam-mood .pi,.whose-e .pi,.tile-e .pi{width:1em;height:1em;vertical-align:0}
.ico{font-size:20px}.dbox-e,.ov-e,.note-e{font-size:19px}
.mood span,.log-btn span{font-size:28px}
.ms-e .pi{width:1.1em;height:1.1em}
.mode-switch button.on .pi{color:#fff!important}
.btn .pi{vertical-align:-.2em}
.bank-logo{padding:0;overflow:hidden;background:#fff;border:1px solid var(--line)}
.bank-logo img{width:100%;height:100%;object-fit:cover;display:block}
.bank-chip img{width:18px;height:18px;border-radius:5px;margin-left:-4px}

/* ---------- 📱 devices: iPhone 16 (393) · 17 Pro Max (440) · iPad portrait (744–1032) · MacBook (1280–1512) ---------- */
/* iPad portrait (bottom bar, no sidebar yet): use the width instead of a 720px column */
@media(min-width:744px) and (max-width:899px){ main{max-width:920px;padding-left:28px;padding-right:28px} .topbar{margin-left:-28px;margin-right:-28px;padding-left:28px;padding-right:28px} }
/* phones in landscape: keep content clear of the notch / Dynamic Island */
@supports(padding:max(0px)){
  main{padding-left:max(16px, env(safe-area-inset-left));padding-right:max(16px, env(safe-area-inset-right))}
  nav.nav{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
}
@media(min-width:900px){ main{padding-left:36px;padding-right:36px} }
/* big touch targets on touch screens */
@media(pointer:coarse){ .chip{min-height:36px} .icon-btn{min-height:40px;min-width:40px} .tick{width:28px;height:28px} }

/* =====================================================================
   🧭 5 sections (Overview · Plan · Money · Family · Me) + sub-tabs
   ===================================================================== */
.hubs{display:flex;flex:1;justify-content:center;min-width:0}
.hub{flex:1;max-width:120px;display:flex;min-width:0}
.hub-btn{flex:1}
.hub-sub{display:none}
nav.nav .sub .badge{position:static;margin-left:auto;box-shadow:none}
@media(min-width:900px){
  .hubs{flex:none;flex-direction:column;gap:2px;justify-content:flex-start}
  .hub{display:block;max-width:none}
  .hub-btn{width:100%}
  nav.nav .hub-btn{font-size:15px;font-weight:600}
  .hub.open .hub-sub{display:flex;flex-direction:column;gap:1px;margin:2px 0 10px 23px;padding-left:10px;border-left:2px solid var(--line)}
  nav.nav .hub-sub .sub{padding:6px 10px;font-size:14px;font-weight:500;color:var(--ink-2);border-radius:10px}
  nav.nav .hub-sub .sub::before{display:none}
  nav.nav .hub-sub .sub.on{background:var(--brand-soft);color:var(--brand-shade);font-weight:600}
  nav.nav .hub-btn.on{background:transparent;color:var(--brand-shade)}
  nav.nav .hub-btn.on::before{display:none}
  nav.nav .hub.open .hub-btn{background:color-mix(in srgb,var(--brand-soft) 60%,transparent)}
}
/* sub-tabs at the top of each page */
.subtabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;margin:0 0 16px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}
.subtabs::-webkit-scrollbar{display:none}
.subtabs button{position:relative;flex:none;padding:8px 14px;border-radius:12px;font-size:14px;font-weight:600;color:var(--ink-2);white-space:nowrap}
.subtabs button.on{background:var(--brand);color:var(--brand-ink)}
@media(hover:hover){ .subtabs button:not(.on):hover{background:var(--surface-2)} }
.subtabs .dot-badge{position:absolute;top:6px;right:6px;width:7px;height:7px;border-radius:50%;background:var(--exp)}
@media(min-width:600px){ .subtabs{display:inline-flex;max-width:100%} }
/* the old "‹ More" back button and "More" page aren't needed any more */
.back-btn{display:none!important}
@media(min-width:900px){ nav.nav .ms-side{flex:none} }
