/* Nestling styles. Edit tokens in :root to retheme. */
/* Layout: one-column phone app — child switcher on top, scrolling cards, fixed tab bar at the bottom. Dark mode is tuned for 3am feeds. */
:root{
  --bg:#F3F2F7; --surface:#FFFFFF; --surface-2:#EBE9F2; --ink:#221F33; --muted:#6A6680; --line:#DCD9E6;
  --accent:#2C6E60; --accent-ink:#FFFFFF; --accent-soft:#DCECE7;
  --sleep:#5A5FC8; --nurse:#C24F7A; --bottle:#B97E14; --diaper:#6E7F22; --pump:#23849A; --solid:#CC6332; --med:#B0393A; --temp:#C04A26; --first:#9356B0;
  --warn-bg:#FCEADB; --warn-ink:#87380C;
  --f-display:"Fredoka","Nunito","Trebuchet MS",system-ui,sans-serif;
  --f-body:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;
  --r:16px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#111017; --surface:#1B1A23; --surface-2:#252431; --ink:#E9E7F1; --muted:#9A96AC; --line:#2E2C3A;
  --accent:#72C4B0; --accent-ink:#0D1A17; --accent-soft:#1E3530;
  --sleep:#9EA2F2; --nurse:#E994B3; --bottle:#E4B860; --diaper:#B6C566; --pump:#6FC6D6; --solid:#EE9C70; --med:#EE8484; --temp:#F09170; --first:#CB9EE2;
  --warn-bg:#3A2515; --warn-ink:#F4BA8C; color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#111017; --surface:#1B1A23; --surface-2:#252431; --ink:#E9E7F1; --muted:#9A96AC; --line:#2E2C3A;
  --accent:#72C4B0; --accent-ink:#0D1A17; --accent-soft:#1E3530;
  --sleep:#9EA2F2; --nurse:#E994B3; --bottle:#E4B860; --diaper:#B6C566; --pump:#6FC6D6; --solid:#EE9C70; --med:#EE8484; --temp:#F09170; --first:#CB9EE2;
  --warn-bg:#3A2515; --warn-ink:#F4BA8C; color-scheme:dark;
}
html,body{background:var(--bg);color:var(--ink)}
/* phone feel: no tap flash, no double-tap zoom delay, no rubber-band pull on the page, no text resizing on rotate */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overscroll-behavior-y:none;-webkit-tap-highlight-color:transparent}
button,a,label,summary,input[type=checkbox],input[type=radio]{touch-action:manipulation}
button,.tab,.pill,.kid,.btn{-webkit-user-select:none;user-select:none}
body{font:calc(15px*var(--ts,1))/1.45 var(--f-body);-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}
button{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.app{max-width:720px;margin:0 auto;padding-inline:16px;padding-block:0 calc(96px + env(safe-area-inset-bottom,0px))}
.muted{color:var(--muted)} .small{font-size:calc(13px*var(--ts,1))}
h1,h2,h3{margin:0;text-wrap:balance}
h2{font-family:var(--f-display);font-weight:600;font-size:calc(19px*var(--ts,1))}
h3{font-size:calc(13px*var(--ts,1));font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.stack{display:flex;flex-direction:column;gap:14px}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.spacer{flex:1}

/* header */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:6;background:var(--bg);padding-block:12px 10px;display:flex;align-items:center;gap:10px}
.brand{font-family:var(--f-display);font-weight:600;font-size:calc(21px*var(--ts,1));color:var(--accent);letter-spacing:-.01em}
.kids{display:flex;gap:6px;overflow-x:auto;flex:1;min-width:0;scrollbar-width:none;padding:2px}
.kids::-webkit-scrollbar{display:none}
.kid{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:4px 12px 4px 4px;display:flex;align-items:center;gap:8px;white-space:nowrap;cursor:pointer;font-weight:600;font-size:calc(14px*var(--ts,1))}
.kid[aria-pressed="true"]{border-color:var(--kc);box-shadow:inset 0 0 0 1px var(--kc)}
.kdot{width:26px;height:26px;border-radius:50%;background:var(--kc);color:#fff;display:grid;place-items:center;font-size:calc(12px*var(--ts,1));font-weight:700;flex:none}
.icon-btn{width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:var(--surface);display:grid;place-items:center;cursor:pointer;flex:none;font-size:calc(20px*var(--ts,1));line-height:1}
.icon-btn svg{width:19px;height:19px}

/* cards */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.card-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hello{padding-block:6px 2px}
.hello .name{font-family:var(--f-display);font-weight:600;font-size:calc(30px*var(--ts-big,1));line-height:1.1}
.hello .age{color:var(--muted);font-weight:500}

/* since tiles */
.since{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px;min-width:0}
.tile .lab{font-size:calc(11px*var(--ts,1));font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.tile .big{font-family:var(--f-display);font-weight:600;font-size:calc(24px*var(--ts-big,1));line-height:1.15;margin-top:4px;font-variant-numeric:tabular-nums}
.tile .sub{font-size:calc(12.5px*var(--ts,1));color:var(--muted);margin-top:2px}
.tile .sub b{color:var(--ink);font-weight:600}

/* quick log */
.quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.qbtn{border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:12px 4px 10px;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;font-size:calc(13px*var(--ts,1));font-weight:600}
.qbtn:active{transform:scale(.97)}
.qicon{width:34px;height:34px;border-radius:50%;background:color-mix(in srgb,var(--tc) 16%,transparent);color:var(--tc);display:grid;place-items:center}
.qicon svg{width:18px;height:18px}
.diaperbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.diaperbar .lab{font-size:calc(13px*var(--ts,1));color:var(--muted);font-weight:600}

/* buttons */
.btn{border:1px solid var(--line);background:var(--surface-2);border-radius:12px;padding:10px 14px;font-weight:600;cursor:pointer;font-size:calc(14.5px*var(--ts,1))}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.ghost{background:transparent}
.btn.danger{color:var(--med);background:transparent}
.btn.sm{padding:6px 10px;font-size:calc(13px*var(--ts,1));border-radius:10px}
.btn[disabled]{opacity:.55;cursor:default}
.btn.big{padding:14px 16px;font-size:calc(16px*var(--ts,1))}
.pill{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:6px 12px;font-size:calc(13px*var(--ts,1));font-weight:600;cursor:pointer}
.pill[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}

/* totals */
.totals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.tot{min-width:0}
.tot .v{font-weight:700;font-size:calc(17px*var(--ts,1));font-variant-numeric:tabular-nums}
.tot .k{font-size:calc(12px*var(--ts,1));color:var(--muted)}

/* timer */
.timer{border-color:color-mix(in srgb,var(--tc) 45%,var(--line));background:color-mix(in srgb,var(--tc) 8%,var(--surface))}
.timer .clock{font-family:var(--f-display);font-weight:600;font-size:calc(44px*var(--ts-big,1));line-height:1;font-variant-numeric:tabular-nums;color:var(--tc)}
.sides{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.side{border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:12px;cursor:pointer;text-align:left}
.side[aria-pressed="true"]{border-color:var(--tc);box-shadow:inset 0 0 0 1px var(--tc)}
.side .s1{font-weight:700} .side .s2{font-variant-numeric:tabular-nums;color:var(--muted);font-size:calc(13px*var(--ts,1))}

/* entries */
.list{display:flex;flex-direction:column}
.entry{display:flex;gap:12px;align-items:flex-start;padding:10px 4px;border-top:1px solid var(--line);cursor:pointer;background:none;border-left:0;border-right:0;border-bottom:0;text-align:left;width:100%}
.list .entry:first-child{border-top:0}
.edot{width:10px;height:10px;border-radius:50%;background:var(--tc);margin-top:6px;flex:none}
.ebody{flex:1;min-width:0}
.etitle{font-weight:600}
.edetail{color:var(--muted);font-size:calc(13.5px*var(--ts,1));overflow-wrap:anywhere}
.etime{font-size:calc(13px*var(--ts,1));color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}
.by{width:20px;height:20px;border-radius:50%;vertical-align:middle;margin-left:6px;object-fit:cover}
.flag{display:inline-block;background:var(--warn-bg);color:var(--warn-ink);font-size:calc(12px*var(--ts,1));font-weight:600;border-radius:6px;padding:1px 7px;margin-top:3px}
.tag{display:inline-block;background:var(--surface-2);font-size:calc(12px*var(--ts,1));font-weight:600;border-radius:6px;padding:1px 7px}
.dayhead{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;padding-top:6px}
.dayhead .d{font-weight:700}
.note-box{background:var(--surface-2);border-radius:12px;padding:10px 12px;font-size:calc(13.5px*var(--ts,1));color:var(--muted)}
.warnbox{background:var(--warn-bg);color:var(--warn-ink);border-radius:12px;padding:10px 12px;font-size:calc(13.5px*var(--ts,1))}
.empty{text-align:center;padding:22px 10px;color:var(--muted)}

/* week chart */
.bars{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;align-items:end;height:130px}
.bcol{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px;min-width:0}
.bar{width:70%;max-width:34px;background:var(--sleep);border-radius:6px 6px 2px 2px;min-height:2px}
.bv{font-size:calc(11.5px*var(--ts,1));font-variant-numeric:tabular-nums;color:var(--muted)}
.wk{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:calc(13px*var(--ts,1))}
.wk td,.wk th{padding:5px 2px;text-align:center}
.wk th{font-weight:600;color:var(--muted);font-size:calc(12px*var(--ts,1))}
.wk td:first-child,.wk th:first-child{text-align:left;color:var(--muted);font-weight:600}
.wk tr+tr td{border-top:1px solid var(--line)}
.scroll-x{overflow-x:auto}

/* growth */
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.stat .v{font-family:var(--f-display);font-weight:600;font-size:calc(18px*var(--ts,1));font-variant-numeric:tabular-nums}
.stat .k{font-size:calc(12px*var(--ts,1));color:var(--muted)}
.chart svg{width:100%;height:auto;display:block}
.chart text{fill:var(--muted);font-size:calc(11px*var(--ts,1));font-family:var(--f-body)}
.chart .grid{stroke:var(--line);stroke-width:1}
.chart .ln{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linejoin:round}
.chart .pt{fill:var(--surface);stroke:var(--accent);stroke-width:2}
.chart .pt.last{fill:var(--accent)}
.chart .pc{fill:none;stroke:var(--muted);stroke-width:1;opacity:.45}
.chart .pc.p50{opacity:.9;stroke-width:1.6}
.chart .band{fill:var(--accent);opacity:.09;stroke:none}
.chart .plab{font-size:calc(10px*var(--ts,1))}
.stat .k.pct{color:var(--accent);font-weight:600}
.pct-sum{font-size:calc(15px*var(--ts,1));line-height:1.4}
details.ms{border-top:1px solid var(--line);padding-top:8px}
details.ms summary{cursor:pointer;font-weight:700;display:flex;gap:8px;align-items:center;list-style:none;padding-block:4px}
details.ms summary::-webkit-details-marker{display:none}
details.ms summary::before{content:"›";display:inline-block;transition:transform .15s;color:var(--muted);font-size:calc(18px*var(--ts,1));width:12px}
details.ms[open] summary::before{transform:rotate(90deg)}
.check{display:flex;gap:10px;align-items:flex-start;padding:7px 2px;background:none;border:0;cursor:pointer;text-align:left;width:100%}
.box{width:22px;height:22px;border-radius:7px;border:2px solid var(--line);flex:none;display:grid;place-items:center;margin-top:1px}
.check[aria-checked="true"] .box{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.check .ct{flex:1;min-width:0}
.check .cd{font-size:calc(12.5px*var(--ts,1));color:var(--muted)}

/* firsts + photos */
.fgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.fcard{border:1px solid var(--line);background:var(--surface);border-radius:14px;overflow:hidden;cursor:pointer;text-align:left;padding:0;display:flex;flex-direction:column}
.fcard img{width:100%;aspect-ratio:1/1;object-fit:cover;display:block;background:var(--surface-2)}
.fcard .noimg{aspect-ratio:1/1;display:grid;place-items:center;background:color-mix(in srgb,var(--first) 12%,var(--surface));color:var(--first)}
.fcard .noimg svg{width:34px;height:34px}
.fcard .fb{padding:10px 12px}
.fcard .ft{font-weight:700;line-height:1.25}
.fcard .fd{font-size:calc(12.5px*var(--ts,1));color:var(--muted)}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.pill .pn{opacity:.7;font-weight:500}
.ghost-pill{border-style:dashed;background:transparent;color:var(--accent)}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:4px}
.ph{padding:0;border:0;background:var(--surface-2);border-radius:8px;overflow:hidden;cursor:pointer;aspect-ratio:1/1;max-width:100%}
.ph img{width:100%;height:100%;object-fit:cover;display:block}
.viewer img{width:100%;border-radius:12px;display:block;max-height:65vh;object-fit:contain;background:var(--surface-2)}

/* vaccines / illness */
.vrow,.irow{display:flex;gap:10px;align-items:center;padding:9px 2px;border-top:1px solid var(--line);flex-wrap:wrap}
.vrow:first-child,.irow:first-child{border-top:0}
.vrow .vt,.irow .vt{flex:1;min-width:150px}
.status{font-size:calc(12px*var(--ts,1));font-weight:700;border-radius:6px;padding:2px 8px}
.status.given{background:var(--accent-soft);color:var(--accent)}
.status.due{background:var(--warn-bg);color:var(--warn-ink)}
.sick{border-color:color-mix(in srgb,var(--temp) 45%,var(--line));background:color-mix(in srgb,var(--temp) 7%,var(--surface))}

/* tab bar */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:7;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom,0px)}
.tabs-in{max-width:720px;margin:0 auto;display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}
.tab{background:none;border:0;padding:8px 0 9px;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:calc(11.5px*var(--ts,1));font-weight:600;color:var(--muted);cursor:pointer}
.tab svg{width:22px;height:22px}
.tab[aria-current="page"]{color:var(--accent)}

/* sheet */
.sheet{position:fixed;inset:0;z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet-backdrop{position:absolute;inset:0;background:rgba(10,8,20,.45)}
.sheet-panel{position:relative;background:var(--surface);width:100%;max-width:560px;max-height:92%;overflow:auto;border-radius:22px 22px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom,0px));box-shadow:0 -10px 40px rgba(0,0,0,.2);animation:up .2s ease-out}
@keyframes up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
@media (min-width:640px){.sheet{align-items:center}.sheet-panel{border-radius:22px;max-height:88%}}
@media (prefers-reduced-motion:reduce){.sheet-panel{animation:none}}
.sheet-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.sheet-head h2{flex:1}
form.f{display:flex;flex-direction:column;gap:14px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.flabel{font-size:calc(13px*var(--ts,1));font-weight:700;color:var(--muted)}
.hint{font-size:calc(12.5px*var(--ts,1));color:var(--muted)}
input[type=text],input[type=password],input[type=email],input[type=number],input[type=date],input[type=datetime-local],input[type=time],select,textarea{width:100%;font:inherit;font-size:calc(16px*var(--ts,1));color:var(--ink);background:var(--surface-2);border:1px solid var(--line);border-radius:11px;padding:10px 12px;min-width:0}
textarea{resize:vertical}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.seg{display:flex;flex-wrap:wrap;gap:6px}
.seg label,.cb{position:relative;cursor:pointer}
.seg input,.cb input,.sw input{position:absolute;opacity:0;pointer-events:none}
.seg span,.cb span{display:inline-block;border:1px solid var(--line);background:var(--surface-2);border-radius:999px;padding:7px 13px;font-size:calc(14px*var(--ts,1));font-weight:600}
.seg input:checked+span,.cb input:checked+span{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.seg input:focus-visible+span,.cb input:focus-visible+span,.sw input:focus-visible+.chip-sw{outline:2px solid var(--accent);outline-offset:2px}
.swatches{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.sw{display:flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer;text-align:center;position:relative}
.chip-sw{width:38px;height:38px;border-radius:50%;background:var(--sw);border:2px solid var(--line)}
.sw input:checked+.chip-sw{box-shadow:0 0 0 3px var(--surface),0 0 0 5px var(--accent)}
.sw-l{font-size:calc(11.5px*var(--ts,1));line-height:1.2;color:var(--muted)}
.form-err{color:var(--med);font-weight:600;margin:0;min-height:0}
.form-err:empty{display:none}
.sheet-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;position:sticky;bottom:calc(-18px - env(safe-area-inset-bottom,0px));background:var(--surface);padding-block:10px 4px}
.sheet-actions .btn.primary{min-width:120px}
.choice{display:grid;gap:8px}
.thumb{width:84px;height:84px;object-fit:cover;border-radius:10px}

[hidden]{display:none!important}
.invite{font-family:var(--f-display);font-weight:600;font-size:calc(26px*var(--ts-big,1));letter-spacing:.12em;user-select:all;font-variant-numeric:tabular-nums}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(78px + env(safe-area-inset-bottom,0px));z-index:30;background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-weight:600;font-size:calc(14px*var(--ts,1));max-width:calc(100% - 32px);box-shadow:0 6px 24px rgba(0,0,0,.25)}
.banner{background:var(--accent-soft);color:var(--ink);border-radius:12px;padding:10px 12px;font-size:calc(13.5px*var(--ts,1))}
.welcome{padding:26px 20px;text-align:left;gap:14px}
.welcome .big{font-family:var(--f-display);font-weight:600;font-size:calc(28px*var(--ts-big,1));line-height:1.15}
@media (max-width:420px){
  .tile .big{font-size:calc(21px*var(--ts,1))}
  .quick{gap:6px}
  .qbtn{font-size:calc(12px*var(--ts,1))}
  .totals{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:10px}
}

/* appearance swatches */
.theme-picks{display:grid;grid-template-columns:repeat(auto-fill,minmax(108px,1fr));gap:6px}
.theme-picks label{display:block;min-width:0}
.theme-picks .sw-chip{display:flex;align-items:center;gap:8px;padding:6px 10px 6px 6px;width:100%;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theme-picks .sw-chip i{width:24px;height:24px;border-radius:50%;flex:none;border:1px solid rgba(127,127,127,.35);background:linear-gradient(135deg,var(--sb) 0 50%,var(--sa) 50% 100%);box-shadow:inset 0 0 0 4px var(--ss)}
.btn svg{width:17px;height:17px;vertical-align:-3px}
.gate-apple{background:#000;color:#fff;border-color:#000}
.gate-apple svg{width:16px;height:19px;vertical-align:-3px;margin-right:4px}
:root[data-theme="dark"] .gate-apple{background:#fff;color:#000;border-color:#fff}
a.btn{text-decoration:none;color:inherit;display:inline-flex;align-items:center}
#gate a:not(.btn),.sheet a:not(.btn){color:var(--accent)}
.deleted-banner{display:flex;gap:12px;align-items:flex-start;background:var(--accent-soft);color:var(--ink);border:1px solid var(--accent);border-radius:14px;padding:12px 14px}
.deleted-banner b{display:block;font-size:calc(16px*var(--ts,1))}
.deleted-banner .ok-dot{flex:none;width:26px;height:26px;border-radius:50%;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;font-weight:700}
/* the 'logged by' avatar inside the photo viewer must stay a small circle */
.viewer img.by{width:24px;height:24px;max-height:none;border-radius:50%;display:inline-block;background:none;margin-left:8px}
/* date picker */
.dp{position:relative;display:block}
.dp-row{display:flex;gap:8px}
.dp-btn{flex:1;display:flex;align-items:center;gap:10px;width:100%;font:inherit;font-size:calc(16px*var(--ts,1));text-align:left;color:var(--ink);background:var(--surface-2);border:1px solid var(--line);border-radius:11px;padding:10px 12px;cursor:pointer}
.dp-btn svg{width:18px;height:18px;flex:none;color:var(--accent)}
.dp-time{width:auto!important;flex:none;min-width:118px}
.dp-pop{margin-top:8px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:10px;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.dp-nav{display:flex;align-items:center;justify-content:space-between;padding:2px 2px 6px}
.dp-nav b{font-family:var(--f-display);font-weight:600;font-size:calc(17px*var(--ts,1))}
.dp-nav .dp-year{font-size:calc(19px*var(--ts,1))}
.dp-arrow{width:40px;height:36px;border-radius:10px;border:1px solid var(--line);background:var(--surface-2);font-size:calc(22px*var(--ts,1));line-height:1;color:var(--ink);cursor:pointer}
.dp-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;text-align:center}
.dp-wk span{font-size:calc(12px*var(--ts,1));font-weight:600;color:var(--muted);padding:4px 0}
.dp-day{min-height:38px;border-radius:10px;border:0;background:transparent;font:inherit;font-size:calc(15px*var(--ts,1));color:var(--ink);cursor:pointer;font-variant-numeric:tabular-nums}
.dp-day.today{box-shadow:inset 0 0 0 1.5px var(--accent)}
.dp-day.sel{background:var(--accent);color:var(--accent-ink);font-weight:700}
.dp-foot{display:flex;gap:8px;align-items:center;margin-top:8px}
/* night mode: dim warm reds, bigger targets for one-handed use in the dark */
.hello-row{display:flex;align-items:center;gap:10px;justify-content:space-between}
.night-pill{flex:none;font-size:calc(12.5px*var(--ts,1));padding:6px 11px}
[data-night] .night-pill{background:var(--accent-soft);border-color:var(--line);color:var(--ink)}
[data-night] img{filter:brightness(.55) sepia(.4) saturate(.8)}
[data-night] .card,[data-night] .tile,[data-night] .qbtn,[data-night] .sheet-panel{box-shadow:none}
[data-night] .quick{gap:10px}
[data-night] .qbtn{padding:18px 4px 15px;font-size:calc(15px*var(--ts,1));border-radius:16px}
[data-night] .qicon{width:46px;height:46px}
[data-night] .qicon svg{width:24px;height:24px}
[data-night] .tile .big{font-size:calc(28px*var(--ts-big,1))}
[data-night] .diaperbar .pill{padding:11px 18px;font-size:calc(15px*var(--ts,1))}
[data-night] .btn.big{padding:16px 20px;font-size:calc(17px*var(--ts,1))}
[data-night] .timer .clock{font-size:calc(56px*var(--ts-big,1))}
[data-night] .side{padding:16px}
[data-night] .tabs .tab{padding-block:12px}
[data-night] [style*="--kc"]{--kc:var(--accent)!important}
[data-night] .btn.primary{background:var(--accent-soft);border-color:var(--accent);color:var(--ink)}
[data-night] .diaperbar .lab{flex-basis:100%}
/* Larger text: give wide labels room */
[data-bigtext] .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
[data-bigtext] .theme-picks{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
/* Undo in the confirmation message */
.toast[hidden]{display:none!important}
.toast.has-undo{display:flex;align-items:center;gap:12px;padding:6px 6px 6px 16px;width:max-content}
.toast-undo{flex:none;background:transparent;color:var(--bg);border:1.5px solid color-mix(in srgb,var(--bg) 45%,transparent);border-radius:9px;font:inherit;font-weight:700;padding:8px 14px;min-height:40px;cursor:pointer}
.toast-undo:active{background:color-mix(in srgb,var(--bg) 18%,transparent)}
[data-night] .toast{background:var(--surface-2);color:var(--ink);border:1px solid var(--line);box-shadow:none}
[data-night] .toast-undo{color:var(--ink);border-color:var(--line)}
/* Selecting photos */
.ph{position:relative}
.ph.selecting img{transition:transform .12s,opacity .12s}
.ph.selecting[aria-pressed="true"] img{transform:scale(.88);opacity:.85;border-radius:6px}
.ph.selecting[aria-pressed="true"]{background:color-mix(in srgb,var(--accent) 22%,var(--surface-2))}
.ph .chk{position:absolute;top:6px;right:6px;width:24px;height:24px;border-radius:50%;border:2px solid #fff;background:rgba(0,0,0,.28);box-shadow:0 1px 3px rgba(0,0,0,.35);display:grid;place-items:center}
.ph[aria-pressed="true"] .chk{background:var(--accent);border-color:#fff}
.ph[aria-pressed="true"] .chk::after{content:"";width:6px;height:11px;border:solid var(--accent-ink);border-width:0 2.5px 2.5px 0;transform:translateY(-1px) rotate(45deg)}
.linkbtn{background:none;border:0;padding:4px 2px;font:inherit;font-size:calc(13px*var(--ts,1));font-weight:600;color:var(--accent);cursor:pointer}
.selpad{height:120px}
.selbar{position:fixed;left:50%;transform:translateX(-50%);width:calc(100% - 24px);max-width:696px;bottom:calc(70px + env(safe-area-inset-bottom,0px));z-index:8;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:10px 12px;box-shadow:0 8px 28px rgba(0,0,0,.18);display:flex;flex-direction:column;gap:8px}
.selbar .row{flex-wrap:wrap}
.selbar .btn[disabled]{opacity:.45}
body:has(.selbar) .toast{bottom:calc(196px + env(safe-area-inset-bottom,0px))}
/* Caregiver codes */
.invite.sm{font-size:calc(14px*var(--ts,1));padding:4px 8px;letter-spacing:.06em}
.invite.big-code{align-self:center;font-size:calc(30px*var(--ts-big,1));letter-spacing:.14em;padding:10px 16px}
/* Search in the log */
.searchbar{padding:2px 0 4px}
.searchbar input{width:100%;padding:11px 14px 11px 38px;border-radius:12px;border:1px solid var(--line);background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center/18px;color:var(--ink);font:inherit;font-size:calc(16px*var(--ts,1))}
.srow{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;text-align:left;background:none;border:0;border-top:1px solid var(--line);padding:10px 2px;color:var(--ink);font:inherit;cursor:pointer}
.srow:first-of-type{border-top:0}
/* Medicine dose safety */
.med-next{display:flex;flex-direction:column;gap:8px;background:color-mix(in srgb,var(--med) 9%,var(--surface));border:1px solid color-mix(in srgb,var(--med) 25%,var(--line));border-radius:14px;padding:10px 12px;margin:2px 0 4px}
.med-next .row{align-items:flex-start;gap:10px}
.mdot{flex:none;width:10px;height:10px;border-radius:50%;margin-top:5px;background:var(--muted)}
.mdot.wait{background:var(--med)}
.mdot.ok{background:var(--accent)}
.note-box.warn{background:var(--warn-bg);color:var(--warn-ink)}

/* Trends */
.viewtog{margin-bottom:2px}
.trend-tile{border-top:3px solid var(--tc)}
.trend-tile .delta{font-weight:600;color:var(--ink)}
.insights{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px;line-height:1.45}
.progress{height:8px;border-radius:99px;background:var(--surface-2);overflow:hidden;margin:6px 0 2px}
.progress span{display:block;height:100%;background:var(--accent);border-radius:99px}
.tbars{display:grid;grid-template-columns:repeat(14,minmax(0,1fr));gap:2px;align-items:end;height:120px;margin-top:6px}
.tbcol{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px;min-width:0;background:none;border:0;padding:0;cursor:pointer}
.tbar{width:72%;max-width:18px;background:var(--tc);border-radius:4px 4px 0 0;flex:none}
.tbar.partial{opacity:.3}
.tbcol.on .tbar{outline:2px solid var(--ink);outline-offset:1px}
.tbx{font-size:calc(10.5px*var(--ts,1));color:var(--muted);line-height:1}
.tb-tip{min-height:1.4em}
.trend-stats{grid-template-columns:repeat(2,minmax(0,1fr))}

/* Getting started */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.onb{border-top:3px solid var(--accent)}
.onb-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.onb-steps li{display:flex;align-items:flex-start;gap:10px}
.onb-steps li .btn{flex:none;align-self:center}
.onb-t{flex:1;min-width:0;line-height:1.35}
.onb-steps li.done .onb-t>b{color:var(--muted)}
.onb-box{flex:none;width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:calc(13px*var(--ts,1));border:2px solid var(--accent);color:var(--accent)}
.onb-box.done{background:var(--accent);color:var(--surface)}
.onb-box svg{width:15px;height:15px;stroke-width:2.6}
.coach-tip{font-size:calc(13.5px*var(--ts,1));font-weight:600;color:var(--accent);margin:2px 2px -4px}
.quick.coach{border-radius:16px;outline:2px dashed var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:no-preference){.quick.coach{animation:coachPulse 2.4s ease-in-out 3}}
@keyframes coachPulse{50%{outline-offset:5px}}
.empty-state{text-align:center;align-items:center;padding:26px 18px;gap:10px}
.empty-state h3{margin:0}
.empty-state p{margin:0;max-width:34em}
.es-icon{display:inline-flex;width:44px;height:44px;border-radius:50%;align-items:center;justify-content:center;background:var(--surface-2);color:var(--accent)}
.es-icon svg{width:22px;height:22px}

/* Photos: "All together" view, like the iPhone camera roll */
.pgrid.roll{grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;margin:0 -4px}
@media (min-width:560px){.pgrid.roll{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}}
.pgrid.roll .ph{border-radius:0}
.pgrid.roll .ph.selecting[aria-pressed="true"] img{border-radius:4px}
