/* Atlas — light mode only (Sinem's request). Colours match the plan page. */
:root{
  color-scheme: light only;
  --bg:#f5f7f9; --surface:#fff; --ink:#1d2a36; --muted:#5d6b78; --line:#e2e7ec;
  --accent:#2c6e8f; --accent-soft:#e6f0f5;
  --feed:#d98a1f; --feed-soft:#fbf0de; --feed-ink:#8a5206;
  --diaper:#23917f; --diaper-soft:#e0f3ef;
  --sleep:#5866c4; --sleep-soft:#e9ebfa;
  --care:#6a4fa3; --care-soft:#efe8f8;
  --poop:#8a6a3c;
  --warn:#b4472f; --warn-soft:#fbe9e4;
  --f-app: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--f-app);font-size:16px;line-height:1.4;
  -webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;overscroll-behavior-y:contain}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
[hidden]{display:none!important}

.app{max-width:560px;margin:0 auto;min-height:100%;background:var(--surface);display:flex;flex-direction:column}
@media (min-width:600px){ .app{border-left:1px solid var(--line);border-right:1px solid var(--line)} }
.loading{margin:auto;font-weight:800;font-size:1.4rem;color:var(--muted)}

.scr{flex:1;padding:calc(14px + var(--safe-t)) 16px 16px;display:flex;flex-direction:column;gap:14px}
.ahead{display:flex;justify-content:space-between;align-items:flex-end;gap:10px}
.ahead .n{font-size:1.7rem;font-weight:800;letter-spacing:-.01em;line-height:1.1}
.ahead .d{font-size:.85rem;color:var(--muted);font-weight:700}
.ahead .right{display:flex;align-items:center;gap:8px}
.pill{font-size:.74rem;font-weight:800;padding:4px 10px;border-radius:99px;background:var(--accent-soft);color:var(--accent);white-space:nowrap}
.pill.off{background:var(--warn-soft);color:var(--warn)}
.iconbtn{width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:var(--surface);display:grid;place-items:center;font-weight:800;color:var(--muted)}

/* now card */
.now{border-radius:20px;padding:16px 16px;display:flex;justify-content:space-between;align-items:center;gap:10px}
.now.sleep{background:var(--sleep-soft)} .now.feed{background:var(--feed-soft)} .now.awake{background:var(--bg)}
.now .k{font-size:.8rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.now.sleep .k{color:var(--sleep)} .now.feed .k{color:var(--feed-ink)} .now.awake .k{color:var(--muted)}
.now .v{font-size:1.9rem;font-weight:800;line-height:1.1;font-variant-numeric:tabular-nums}
.now .s{font-size:.85rem;color:var(--muted);font-weight:700}
.btn{font-weight:800;border:0;border-radius:14px;padding:12px 16px;font-size:.95rem;min-height:44px}
.btn.sleep{background:var(--sleep);color:#fff} .btn.feed{background:var(--feed);color:#fff}
.btn.diaper{background:var(--diaper);color:#fff} .btn.care{background:var(--care);color:#fff}
.btn.primary{background:var(--accent);color:#fff;width:100%;padding:15px;font-size:1.05rem}
.btn.ghost{background:var(--bg);color:var(--ink)}
.btn.danger{background:var(--warn-soft);color:var(--warn);width:100%}
.btn:disabled{opacity:.5}

.last{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.lc{border:1px solid var(--line);border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:2px;background:var(--surface);text-align:left}
.lc .k{font-size:.74rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.lc .v{font-size:1.25rem;font-weight:800;line-height:1.15}
.lc .s{font-size:.82rem;color:var(--muted);font-weight:700}
.k.feed{color:var(--feed)} .k.diaper{color:var(--diaper)} .k.sleep{color:var(--sleep)}

.today{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;background:var(--bg);border-radius:14px;padding:11px 6px}
.today div{display:flex;flex-direction:column;align-items:center;text-align:center}
.today b{font-size:1.2rem;font-weight:800;font-variant-numeric:tabular-nums}
.today span{font-size:.68rem;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.04em}

.care{display:flex;align-items:center;gap:6px;flex-wrap:wrap;border:1px solid var(--line);border-radius:12px;padding:8px 11px;font-size:.8rem;font-weight:700;color:var(--muted);background:var(--surface);text-align:left;width:100%}
.care b{color:var(--ink);font-weight:800}
.care .ok{color:var(--diaper)} .care .no{color:var(--muted)}
.care .lab{font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;font-weight:800;color:var(--accent)}

.big3{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.big3 button{border:0;border-radius:20px;padding:18px 4px 14px;display:flex;flex-direction:column;align-items:center;gap:6px;font-weight:800;font-size:1.02rem;color:var(--ink)}
.big3 .f{background:var(--feed-soft)} .big3 .di{background:var(--diaper-soft)} .big3 .sl{background:var(--sleep-soft)}
.big3 i{font-style:normal;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:1.3rem;font-weight:800}
.big3 .f i{background:var(--feed)} .big3 .di i{background:var(--diaper)} .big3 .sl i{background:var(--sleep)}
.morelink{align-self:center;background:none;border:0;font-size:.9rem;font-weight:800;color:var(--accent);padding:8px 12px;min-height:44px}

/* bottom bars */
.bottom{position:sticky;bottom:0;background:var(--surface);z-index:5}
.chatbar{border-top:1px solid var(--line);padding:10px 12px;display:flex;gap:8px;align-items:center}
.chatbar .in{flex:1;border:1px solid var(--line);border-radius:99px;padding:11px 15px;font-size:.92rem;color:var(--muted);background:var(--bg);text-align:left;min-height:44px}
.chatbar .go{width:44px;height:44px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:800;border:0}
.tabs{display:flex;justify-content:space-around;border-top:1px solid var(--line);padding:4px 0 calc(6px + var(--safe-b))}
.tabs button{background:none;border:0;font-size:.78rem;font-weight:800;color:var(--muted);padding:10px 12px;min-height:44px;flex:1}
.tabs .on{color:var(--accent)}

/* sheets */
.sheetbg{position:fixed;inset:0;background:rgba(29,42,54,.32);z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--surface);border-radius:24px 24px 0 0;padding:10px 18px calc(18px + var(--safe-b));display:flex;flex-direction:column;gap:14px;width:100%;max-width:560px;max-height:92vh;overflow-y:auto}
.sheetbg.anim{animation:fade .15s ease-out} .sheet.anim{animation:up .18s ease-out}
@keyframes up{from{transform:translateY(30px);opacity:.6}to{transform:none;opacity:1}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.sheet,.sheetbg{animation:none}}
.grab{width:40px;height:5px;border-radius:9px;background:var(--line);margin:0 auto}
.row{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:.95rem;font-weight:700}
.row .muted{font-weight:700;color:var(--muted)}
.sheet h2{font-size:1.25rem;font-weight:800;margin:0}
.linkbtn{background:none;border:0;color:var(--muted);font-weight:800;padding:8px;min-height:44px}
.seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;background:var(--bg);border-radius:14px;padding:3px;gap:3px}
.seg button{border:0;background:none;padding:11px 4px;border-radius:11px;font-size:.95rem;font-weight:800;color:var(--muted);min-height:44px}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(29,42,54,.14)}
.lbl{font-size:.76rem;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.field{display:flex;flex-direction:column;gap:8px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{border:1.5px solid var(--line);background:var(--surface);border-radius:99px;padding:9px 15px;font-size:.95rem;font-weight:800;min-height:44px}
.chip.on{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.feedsheet .chip.on{border-color:var(--feed);background:var(--feed-soft);color:var(--feed-ink)}
.diapersheet .chip.on,.diapersheet .seg button.on{color:var(--diaper)}
.input{border:1.5px solid var(--line);border-radius:12px;padding:11px 12px;font-size:1rem;background:var(--surface);min-height:44px;width:100%}
textarea.input{min-height:90px;resize:vertical}
.when{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1.5px solid var(--line);border-radius:12px;padding:6px 6px 6px 12px;min-height:48px}
.when span{font-weight:800}
.when input{border:0;background:var(--bg);border-radius:9px;padding:8px;font-weight:700;max-width:62%}
.hint{font-size:.85rem;color:var(--muted);font-weight:600;text-align:center}
.btnrow{display:grid;grid-template-columns:1fr 1fr;gap:9px}

.grid6{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.grid6 button{border:1px solid var(--line);background:var(--surface);border-radius:16px;padding:13px 6px;display:flex;flex-direction:column;align-items:center;gap:5px;text-align:center;font-size:.85rem;font-weight:800;min-height:96px}
.grid6 i{font-style:normal;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-size:.74rem;font-weight:800;background:var(--accent-soft);color:var(--accent)}
.grid6 .cf i{background:var(--care-soft);color:var(--care)}
.grid6 .cf.live{border-color:var(--care);box-shadow:inset 0 0 0 1px var(--care)}
.grid6 small{font-size:.72rem;color:var(--muted);font-weight:700}

/* day view */
.daynav{display:flex;justify-content:space-between;align-items:center;font-weight:800;gap:8px}
.daynav .ar{width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:var(--surface);display:grid;place-items:center;color:var(--muted);font-size:1.2rem}
.daynav .ar:disabled{opacity:.35}
.daynav label{position:relative;font-size:1.05rem;text-align:center;flex:1}
.daynav input[type=date]{position:absolute;inset:0;opacity:0;width:100%}
.ribbon{position:relative;height:52px;border-radius:10px;background:var(--bg);overflow:hidden}
.ribbon .sl{position:absolute;top:6px;bottom:22px;background:var(--sleep);opacity:.85;border-radius:3px}
.ribbon .bt{position:absolute;top:2px;height:3px;background:var(--care);opacity:.7;border-radius:2px}
.ribbon .fd{position:absolute;bottom:5px;width:8px;height:8px;margin-left:-4px;border-radius:50%;background:var(--feed)}
.ribbon .dp{position:absolute;bottom:15px;width:3px;height:7px;margin-left:-1.5px;background:var(--diaper);border-radius:2px}
.ribbon .nowline{position:absolute;top:0;bottom:0;width:2px;background:var(--ink);opacity:.5}
.ticks{display:flex;justify-content:space-between;font-size:.68rem;color:var(--muted);font-weight:800;margin-top:4px}
.legend{display:flex;gap:12px;flex-wrap:wrap;font-size:.74rem;font-weight:800;color:var(--muted)}
.legend span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:4px}
.legend .a::before{background:var(--sleep)} .legend .b::before{background:var(--feed);border-radius:50%}
.legend .c::before{background:var(--diaper)} .legend .e::before{background:var(--care)}
.list{display:flex;flex-direction:column}
.ev{display:grid;grid-template-columns:50px 10px 1fr auto;gap:10px;align-items:center;padding:11px 2px;border:0;border-bottom:1px solid var(--line);font-size:.92rem;background:none;text-align:left;width:100%;min-height:48px}
.ev:last-child{border-bottom:0}
.ev .t{font-weight:800;font-variant-numeric:tabular-nums;color:var(--muted);font-size:.84rem}
.ev .dot{width:10px;height:10px;border-radius:50%}
.dot.f{background:var(--feed)} .dot.d{background:var(--diaper)} .dot.s{background:var(--sleep)} .dot.c{background:var(--care)} .dot.h{background:var(--accent)}
.ev b{font-weight:800}
.ev .who{color:var(--muted);font-weight:700;font-size:.8rem}
.ev .chev{color:var(--line);font-weight:800}
.ev .nt{display:block;color:var(--muted);font-size:.82rem;font-weight:600}
.empty{color:var(--muted);font-weight:700;text-align:center;padding:24px 8px}

/* trends */
.rng{display:flex;gap:6px;flex-wrap:wrap}
.rng button{font-size:.85rem;font-weight:800;padding:9px 13px;border-radius:99px;background:var(--bg);color:var(--muted);border:0;min-height:40px}
.rng .on{background:var(--accent);color:#fff}
.custom{display:flex;gap:8px;align-items:center;font-weight:700;color:var(--muted);font-size:.9rem}
.custom input{flex:1}
.chart{display:flex;flex-direction:column;gap:6px}
.chart .ttl{display:flex;justify-content:space-between;font-size:.88rem;font-weight:800;gap:8px}
.chart .ttl span{color:var(--muted);font-weight:700}
.bars{display:grid;gap:5px;align-items:end;height:110px;border-bottom:1px solid var(--line);position:relative;padding-top:18px}
.bars .ref{position:absolute;left:0;right:0;border-top:1px dashed var(--line);pointer-events:none}
.bars button{border:0;padding:0;border-radius:5px 5px 2px 2px;position:relative;min-height:2px;width:100%}
.bars.s button{background:var(--sleep)} .bars.s button.part{background:var(--sleep-soft);outline:1.5px dashed var(--sleep);outline-offset:-1.5px}
.bars.f button{background:var(--feed)} .bars.f button.part{background:var(--feed-soft);outline:1.5px dashed var(--feed);outline-offset:-1.5px}
.bars.c button{background:var(--care)} .bars.c button.part{background:var(--care-soft);outline:1.5px dashed var(--care);outline-offset:-1.5px}
.bars .v{position:absolute;top:-17px;left:-6px;right:-6px;text-align:center;font-size:.66rem;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.stackbars{display:grid;gap:5px;align-items:end;height:80px;border-bottom:1px solid var(--line)}
.stackbars button{display:flex;flex-direction:column;justify-content:flex-end;gap:2px;height:100%;border:0;background:none;padding:0}
.stackbars i{display:block;border-radius:3px}
.stackbars .w{background:var(--diaper)} .stackbars .p{background:var(--poop)}
.days{display:grid;gap:5px;font-size:.66rem;color:var(--muted);font-weight:800;text-align:center}
.wlist{display:flex;flex-direction:column;gap:4px;font-size:.92rem;font-weight:700}
.wlist div{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:6px 0}

/* rules */
.rules{display:flex;flex-direction:column;gap:9px}
.rl{border:1px solid var(--line);border-radius:14px;padding:12px 13px;display:flex;flex-direction:column;gap:4px;font-size:.95rem}
.rl b{font-weight:800;line-height:1.35}
.rl span{font-size:.78rem;color:var(--muted);font-weight:700}
.rl .acts{display:flex;gap:4px;margin-left:-8px}
.rl .acts button{background:none;border:0;color:var(--accent);font-weight:800;font-size:.85rem;padding:8px;min-height:40px}
.rl.paused{background:var(--bg)} .rl.paused b{color:var(--muted)}
.note{font-size:.9rem;color:var(--muted);font-weight:600}

/* sign-in */
.signin{margin:auto;padding:24px;display:flex;flex-direction:column;gap:16px;align-items:stretch;max-width:360px;width:100%;text-align:center}
.signin img{width:84px;height:84px;align-self:center}
.signin h1{margin:0;font-size:1.6rem}

/* ask (stage 1 placeholder) */
.msgs{display:flex;flex-direction:column;gap:10px}
.ai{align-self:flex-start;background:var(--bg);border-radius:16px 16px 16px 4px;padding:12px 14px;font-size:.95rem;font-weight:600;line-height:1.45;max-width:92%}

.toast{position:fixed;left:50%;bottom:calc(130px + var(--safe-b));transform:translateX(-50%);background:var(--ink);color:#fff;font-weight:800;font-size:.9rem;padding:10px 16px;border-radius:99px;z-index:30;box-shadow:0 6px 20px rgba(0,0,0,.18);max-width:90vw;text-align:center}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
