:root{color-scheme:dark;--bg:#060c18;--surface:#0a1323;--raised:#101d32;--line:#1a273c;--ink:#d9e2f1;--muted:#7e8da7;--accent:#8caeec;--danger:#e5a29e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:15px;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);line-height:1.5;-webkit-tap-highlight-color:transparent}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button{color:inherit;cursor:pointer}button:disabled{opacity:.25;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:5px}a{color:var(--accent);text-underline-offset:4px}svg.icon{width:22px;height:22px;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}#app{max-width:520px;margin:auto;padding:32px 24px calc(100px + env(safe-area-inset-bottom))}.ambient{display:none}h1,h2,h3,p{margin-top:0}h1{font-size:24px;font-weight:500;letter-spacing:-.6px}h2{font-size:15px;font-weight:500}h3{font-size:13px;font-weight:500}.muted{color:var(--muted)}.small{font-size:12px}.center{text-align:center}.intro{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:4px 0 32px}.intro h1{margin:0}.intro .subtitle{margin:5px 0 0;color:var(--muted);font-size:12px}.primary{display:flex;align-items:center;justify-content:center;gap:10px;background:#6488c8;color:#081020;border:0;border-radius:16px;min-height:60px;padding:16px 22px;font-size:15px;font-weight:600;width:100%}.primary:active{background:#7b9cd4}.secondary{border:1px solid var(--line);background:transparent;color:var(--ink);border-radius:12px;padding:10px 14px;min-height:44px;font-size:12px}.text-button{display:inline-flex;align-items:center;gap:8px;min-height:44px;background:none;border:0;padding:10px 0;color:var(--accent);font-size:12px}.text-button.muted{color:var(--muted)}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;border:0;background:none;border-radius:50%}.bottom-nav{display:flex;position:fixed;bottom:0;left:0;right:0;justify-content:center;gap:26px;z-index:3;background:#080f1ef5;border-top:1px solid #142037;padding:10px 24px calc(10px + env(safe-area-inset-bottom));backdrop-filter:blur(15px)}.bottom-nav :is(a,button){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:82px;min-height:55px;padding:4px;background:none;border:0;color:#687993;font-size:10px}.bottom-nav :is(a,button).active{color:var(--accent)}.bottom-nav svg{width:23px;height:23px}.home-stats{display:grid;grid-template-columns:1.2fr 1fr 1fr;align-items:start;gap:12px;padding:8px 0 27px;border-bottom:1px solid var(--line)}.home-stats>div{min-width:0}.home-stats>div:not(:first-child){text-align:right}.home-stat-label{display:block;font-size:10px;color:var(--muted);margin-bottom:8px;white-space:nowrap}.home-stats strong{font-size:27px;letter-spacing:-.8px;font-weight:450;line-height:1.3;font-variant-numeric:tabular-nums;white-space:nowrap}.new-bottle{text-align:center;padding-top:clamp(58px,12vh,110px)}.new-bottle h1,.active-card h1{font-size:18px;font-weight:400;letter-spacing:0;color:#a0b0c9;margin:0 0 30px}.bottle-selector{display:grid;grid-template-columns:56px 1fr 56px;align-items:center;gap:12px}.selector-arrow{display:grid;place-items:center;width:56px;height:64px;border:none;border-radius:18px;background:#0f1b2e;color:var(--accent)}.selector-arrow:active{background:#192b46}.selector-arrow svg{height:22px;width:22px}.selector-arrow.previous svg{transform:rotate(180deg)}.selected-volume{min-width:0}.selected-volume strong{display:block;font-size:94px;font-weight:300;letter-spacing:-5px;line-height:1.2;font-variant-numeric:tabular-nums}.selected-volume span{display:block;color:var(--muted);font-size:13px;margin-top:5px}.prepared-note{color:var(--muted);font-size:12px;text-align:center;margin:22px 0 0}.start-button{margin-top:58px}.start-button svg{position:absolute;right:22px;width:19px}.start-button{position:relative}.active-card{text-align:center;padding-top:48px}.active-card h1{margin-bottom:7px}.active-card .prepared-note{margin:0}.remaining-label{display:block;font-size:13px;margin:32px 0 22px;color:var(--muted)}.stepper{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 23px}.stepper button{height:60px;width:56px;border:0;border-radius:18px;background:#0f1b2e;color:var(--accent);font-size:28px}.stepper input{display:block;width:132px;text-align:center;background:none;border:0;color:var(--ink);font-size:73px;letter-spacing:-3px;font-weight:300;line-height:1.2;padding:0;-moz-appearance:textfield;font-variant-numeric:tabular-nums}.stepper input::-webkit-inner-spin-button{-webkit-appearance:none}.stepper .small{margin-top:5px}.quick-choices{display:flex;justify-content:center;gap:8px;margin:0 0 24px}.quick-choices button{border:1px solid var(--line);background:none;color:var(--muted);padding:9px 12px;border-radius:11px;min-height:44px;font-size:12px}.quick-choices button.selected{background:#14223c;border-color:#3f5c8a;color:var(--accent)}.active-result{font-size:12px;color:var(--muted);margin:0 0 20px}.active-result strong{font-weight:500;color:var(--ink)}.active-footer{display:flex;justify-content:space-between;margin-top:10px}.card{padding:0 0 25px;margin:0 0 25px;border:0;border-bottom:1px solid var(--line);background:transparent}.card:last-child{border-bottom:0;margin-bottom:0}.card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.card-heading h2{margin:0}.card-heading>.icon{color:var(--muted);width:18px;height:18px}.pill{font-size:10px;color:var(--muted)}.pill.live{color:var(--accent)}.section-description{color:var(--muted);font-size:11px;margin:-10px 0 20px}.stack{display:flex;flex-direction:column}.metric{font-size:34px;font-weight:400;letter-spacing:-1px;line-height:1.3;font-variant-numeric:tabular-nums}.metric small{font-size:13px;color:var(--muted);letter-spacing:0}.metric-explainer{font-size:11px;color:var(--muted);margin:6px 0 0}.dashboard-top{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:25px;border-bottom:1px solid var(--line)}.dashboard-top .card{border:0;padding:0 0 22px;margin:0}.dashboard-top .card:first-child{grid-column:1/-1;padding-bottom:4px}.dashboard-top .card:first-child .metric{font-size:44px}.dashboard-top .card-heading{margin-bottom:10px}.dashboard-top .card-heading h2{font-size:12px}.dashboard-top .card:not(:first-child) .metric{font-size:25px}.progress{height:3px;background:var(--line);border-radius:5px;overflow:hidden;margin:20px 0 8px}.progress span{display:block;height:100%;background:var(--accent);max-width:100%}.progress-caption{display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}.card-footer{margin-top:15px;padding-top:8px}.dashboard-top .card-footer{margin-top:4px;padding:0}.feed-list{display:flex;flex-direction:column}.feed-row{display:flex;align-items:center;gap:12px;width:100%;min-height:73px;background:none;border:0;border-top:1px solid var(--line);padding:14px 0;text-align:left}.feed-row:first-child{border-top:0}.feed-symbol{display:grid;place-items:center;color:var(--muted);width:26px}.feed-symbol svg{width:19px;height:19px}.feed-content{flex:1;min-width:0}.feed-title{font-size:13px;display:flex;gap:10px;align-items:center}.feed-sub{display:block;margin-top:5px;font-size:10px;color:var(--muted)}.feed-amount{font-size:19px;white-space:nowrap;font-variant-numeric:tabular-nums}.feed-amount small{font-size:11px;color:var(--muted)}.feed-chevron{width:12px!important;color:var(--muted)}.empty{text-align:center;padding:30px 0;color:var(--muted);font-size:12px}.empty svg{margin-bottom:8px}.empty p{margin-bottom:0}.empty small:empty{display:none}.chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:9px;margin-top:28px}.chart-col{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:0}.chart-value{font-size:10px;color:var(--muted);margin-bottom:9px;min-height:15px}.chart-track{height:150px;display:flex;align-items:flex-end;justify-content:center;width:100%}.chart-bar{width:70%;max-width:32px;min-height:2px;background:#293d5c;border-radius:5px 5px 1px 1px}.chart-col.today .chart-bar{background:var(--accent)}.chart-day{font-size:10px;color:var(--muted);margin-top:12px}.chart-col.today .chart-day{color:var(--accent)}.chart-count{font-size:8px;color:var(--muted);margin-top:5px;white-space:nowrap}.chart-legend{display:none}.week-table{width:100%;border-collapse:collapse;font-size:12px}.week-table th{text-align:left;color:var(--muted);font-size:10px;font-weight:400;padding-bottom:12px}.week-table td{padding:12px 0;border-top:1px solid var(--line)}.week-table th:not(:first-child),.week-table td:not(:first-child){text-align:right}.week-table tr:last-child{color:var(--accent)}.info-note{font-size:11px;line-height:1.8;color:var(--muted);margin:14px 0}.field{display:block;font-size:12px;color:var(--muted);margin-bottom:20px}.field input,.field select{display:block;width:100%;min-width:0;max-width:100%;min-height:50px;background:#0c1729;border:1px solid var(--line);border-radius:10px;padding:12px;color:var(--ink);margin-top:7px}.field small{display:block;font-size:10px;margin-top:7px;line-height:1.7}.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.volume-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.volume-fields .field{font-size:10px;margin-bottom:5px}.volume-fields input{padding:10px}.weight-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:13px 0;font-size:12px}.weight-row span{color:var(--muted)}.weight-row strong{font-weight:500}.form-error{color:var(--danger);font-size:12px;margin:14px 0}.danger{color:var(--danger)}.online-warning{padding:12px 0;color:var(--danger);font-size:12px}.login{max-width:360px;margin:12vh auto}.login .brand{display:flex;align-items:center;gap:12px;margin-bottom:36px;text-decoration:none}.brand-mark{color:var(--accent);font-size:44px;font-weight:300;line-height:1}.brand-name{font-size:20px}.eyebrow{color:var(--muted);font-size:11px}.loading{display:grid;align-content:center;justify-content:center;min-height:70vh;text-align:center;color:var(--muted);font-size:13px}.loading .brand-mark{margin-bottom:20px}dialog{background:#0b1526;color:var(--ink);border:1px solid #263b5b;border-radius:20px;padding:24px;max-width:420px;width:calc(100% - 28px);max-height:90dvh;box-shadow:0 24px 100px #0006}dialog::backdrop{background:#020711dd;backdrop-filter:blur(5px)}.modal-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:24px}.modal-header h2{font-size:18px;margin:0}.modal-header .icon-button{height:36px;width:36px;min-width:36px}dialog .info-note{margin-top:-8px;margin-bottom:22px}.dialog-actions{display:flex;gap:12px}.dialog-actions .primary{flex:1}.confirm-copy{font-size:13px;color:var(--muted);line-height:1.8;margin-bottom:24px}#toast{position:fixed;bottom:calc(98px + env(safe-area-inset-bottom));left:50%;transform:translate(-50%,10px);max-width:calc(100% - 32px);width:max-content;padding:12px 18px;border-radius:12px;background:#172b48;border:1px solid #365781;color:#c6d6f0;font-size:12px;opacity:0;pointer-events:none;z-index:5;transition:opacity .15s,transform .15s}#toast.visible{opacity:1;transform:translate(-50%,0)}#toast.error{background:#332128;border-color:#6e3d45;color:#f0c6c5}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
@media(min-width:800px){#app{padding-top:56px}.home-stats{padding-top:0}.new-bottle{padding-top:100px}.bottom-nav{gap:44px}.card{padding-bottom:30px;margin-bottom:30px}}
@media(max-width:360px){#app{padding:24px 20px 105px}.home-stats{gap:8px}.home-stats strong{font-size:24px}.home-stat-label{font-size:9px}.selected-volume strong{font-size:80px}.bottle-selector{grid-template-columns:50px 1fr 50px;gap:8px}.selector-arrow,.stepper button{width:50px;height:58px}.new-bottle{padding-top:58px}.start-button{margin-top:44px}.quick-choices{gap:6px}.quick-choices button{padding:9px 10px}.chart{gap:5px}}
@media(max-height:700px){.new-bottle{padding-top:45px}.start-button{margin-top:36px}.active-card{padding-top:24px}.remaining-label{margin-top:22px;margin-bottom:14px}.stepper{margin-bottom:16px}.quick-choices{margin-bottom:16px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
/* Feeding and sleep share the same quiet, mobile-first controls. */
.home-stats{grid-template-columns:1fr 1.65fr 1fr;gap:8px}.home-stats>div:first-child{text-align:left}.home-stats>div.previous-feed{text-align:center}.home-stats>div:last-child{text-align:right}.home-stat-label{font-size:10px}.home-stats strong{font-size:26px}.new-bottle{padding-top:clamp(38px,7vh,64px)}.start-button{margin-top:40px}.bottom-nav{gap:8px;padding-left:12px;padding-right:12px}.bottom-nav :is(a,button){width:80px;flex:0 1 90px}.feeding-timer{font-size:39px;font-weight:300;letter-spacing:1px;font-variant-numeric:tabular-nums;color:var(--accent);line-height:1.3;margin:4px 0 8px}.active-card{padding-top:25px}.active-card h1{margin-bottom:8px}.remaining-label{margin-top:22px;margin-bottom:15px}.stepper{margin-bottom:17px}.quick-choices{margin-bottom:16px}.active-result{margin-bottom:16px}.sleep-controls{margin-top:28px}.sleep-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.sleep-actions button{min-height:54px;display:flex;align-items:center;justify-content:center;gap:10px;border:1px solid var(--line);border-radius:14px;background:none;color:var(--muted);font-size:13px}.sleep-actions button[data-sleep=asleep] svg{color:#9bade9}.sleep-actions button[data-sleep=awake] svg{color:#d8b375}.sleep-actions button.selected{background:#111e34;border-color:#364e75;color:var(--ink);opacity:1}.sleep-controls p{font-size:11px;color:var(--muted);text-align:center;margin:12px 0 0}.current-activity .card-heading{margin-bottom:10px}.current-activity h2{display:flex;align-items:center;gap:10px}.current-activity h2 svg{width:18px;height:18px;color:var(--accent)}.activity-clock{font-size:42px;font-weight:300;letter-spacing:1px;color:var(--ink);font-variant-numeric:tabular-nums;line-height:1.3}.current-activity .sleep-controls{margin-top:22px}.sleep-totals{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:4px 0}.sleep-totals>div{display:grid;grid-template-columns:20px 1fr;gap:4px 10px;align-items:center}.sleep-totals svg{width:17px;height:17px;color:var(--muted)}.sleep-totals strong{font-size:25px;font-weight:400;font-variant-numeric:tabular-nums}.sleep-totals span{grid-column:2;color:var(--muted);font-size:11px}.sleep-legend{display:flex;gap:18px;align-items:center;font-size:10px;margin-bottom:22px;color:var(--muted)}.sleep-legend>span{display:flex;align-items:center;gap:5px}.sleep-legend svg{width:13px;height:13px}.sleep-legend .asleep{color:#9bade9}.sleep-legend .awake{color:#d8b375}.sleep-legend .unknown:before{content:'';width:8px;height:8px;border-radius:2px;background:#172236}.calendar-hours,.calendar-day{display:grid;grid-template-columns:54px minmax(0,1fr);gap:8px;align-items:center}.calendar-hours{margin-bottom:10px}.calendar-hours>div{display:flex;justify-content:space-between;color:var(--muted);font-size:9px}.calendar-day{margin-bottom:9px}.calendar-date{font-size:10px;color:var(--muted);white-space:nowrap}.calendar-day:last-child .calendar-date{color:var(--ink)}.calendar-cells{display:grid;grid-template-columns:repeat(96,minmax(0,1fr));height:25px;overflow:hidden;border-radius:3px;background:#0c1525}.calendar-slot{height:100%;min-width:0;border-right:1px solid #060c1822}.calendar-slot:nth-child(4n){border-right:1px solid #060c1855}.calendar-slot.asleep{background:#4d669f}.calendar-slot.awake{background:#c39c63}.calendar-slot.unknown{background:#101a2b}.sleep-calendar+.info-note{font-size:10px}.rhythm-row{display:flex;justify-content:space-between;gap:15px;padding:10px 0;font-size:12px}.rhythm-row span{color:var(--muted)}.rhythm-row strong{font-weight:450;font-variant-numeric:tabular-nums}.activity-row{display:flex;align-items:center;gap:12px;width:100%;min-height:68px;text-align:left;background:none;border:0;border-top:1px solid var(--line);padding:13px 0}.activity-row:first-of-type{border-top:0}.activity-row>span:first-child{color:var(--muted);display:flex}.activity-row>span:first-child svg{width:18px;height:18px}.activity-row-time{flex:1;font-size:12px}.activity-row-time small{display:block;font-size:10px;color:var(--muted);margin-top:3px}.activity-row>strong{font-size:15px;font-weight:400;white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:360px){.home-stat-label{font-size:8px}.home-stats strong{font-size:23px}.home-stats{grid-template-columns:1fr 1.65fr 1fr}.new-bottle{padding-top:38px}.start-button{margin-top:32px}.calendar-hours,.calendar-day{grid-template-columns:48px minmax(0,1fr);gap:5px}.calendar-date{font-size:9px}.sleep-legend{gap:12px}.sleep-controls{margin-top:22px}.feeding-timer{font-size:33px}.stepper input{font-size:60px}.active-card{padding-top:22px}.quick-choices{margin-bottom:14px}}
/* One viewport shell: safe-area content scrolls; navigation never scrolls. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px)}
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body{touch-action:pan-x pan-y;-webkit-text-size-adjust:100%;text-size-adjust:100%}
#app{position:fixed;inset:0;display:grid;grid-template-rows:minmax(0,1fr) auto;max-width:none;width:100%;height:auto;margin:0;padding:0;overflow:hidden}

.app-scroll{min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:calc(var(--safe-top) + 28px) max(24px,var(--safe-right)) 24px max(24px,var(--safe-left));scroll-padding-block:28px}
.app-scroll>main,.app-scroll>.intro,.app-scroll>.online-warning{max-width:472px;margin-left:auto;margin-right:auto}
.bottom-nav{position:relative;inset:auto;grid-row:2;flex-shrink:0;gap:0;margin:0;padding:8px max(8px,var(--safe-right)) max(8px,var(--safe-bottom)) max(8px,var(--safe-left));min-height:72px;background:#080f1e;backdrop-filter:none;isolation:isolate}
.bottom-nav :is(a,button){flex:1 1 0;width:auto;max-width:96px;min-width:0;min-height:52px;gap:5px;font-size:9px;padding:4px 2px}.bottom-nav svg{height:22px;width:22px}
.home{min-height:100%;display:flex;flex-direction:column}.home-stats{flex-shrink:0;padding-top:0;padding-bottom:22px}.new-bottle{flex:1;display:flex;flex-direction:column;padding-top:clamp(26px,5dvh,50px)}.new-bottle h1{margin-bottom:22px}.new-bottle .prepared-note{margin:18px 0 28px}.new-bottle .start-button{margin-top:auto}.home>.sleep-controls{margin-top:20px;margin-bottom:0;flex-shrink:0}.active-card{padding-top:24px}.feeding .home>.sleep-controls{margin-top:auto;padding-top:16px}.active-footer{margin-bottom:10px}
.field input,.field select,.field textarea{font-size:16px}.login{margin:8dvh auto 0}.app-scroll:has(>.login){padding-bottom:calc(var(--safe-bottom) + 24px)}
dialog{max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 28px);overscroll-behavior:contain}#toast{bottom:calc(88px + var(--safe-bottom))}
.formula-details{margin:8px 0 22px}.formula-details summary,.measurement-history summary{min-height:44px;padding:12px 0;color:var(--muted);font-size:12px;cursor:pointer}.measurement-summary{display:grid;grid-template-columns:1fr 1fr;gap:20px}.measurement-summary>div{display:flex;flex-direction:column;align-items:flex-start}.measurement-summary>div>span{font-size:11px;color:var(--muted);margin-bottom:7px}.measurement-summary strong{font-size:28px;font-weight:400;font-variant-numeric:tabular-nums}.measurement-summary strong small{color:var(--muted);font-size:13px;font-weight:400}.measurement-summary .text-button{margin-top:2px}
.growth-chart{display:block;width:100%;height:auto;margin:22px 0 0;overflow:visible}.chart-gridline{stroke:var(--line);stroke-width:1}.chart-axis{fill:var(--muted);font-size:10px}.growth-line{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}.growth-point{fill:var(--accent);stroke:var(--bg);stroke-width:2}.growth-section:nth-child(2) .growth-line{stroke:#c6b18e}.growth-section:nth-child(2) .growth-point{fill:#c6b18e}.measurement-history{margin-top:15px}.measurement-history summary{font-size:11px}
@media(max-width:360px){.app-scroll{padding-left:max(18px,var(--safe-left));padding-right:max(18px,var(--safe-right));padding-top:calc(var(--safe-top) + 16px)}.bottom-nav :is(a,button){font-size:8px}.bottom-nav svg{height:21px;width:21px}.new-bottle{padding-top:24px}.selected-volume strong{font-size:78px}.new-bottle .prepared-note{margin-bottom:24px}.home>.sleep-controls{margin-top:16px}}
@media(max-height:720px){.new-bottle{padding-top:22px}.new-bottle h1{margin-bottom:16px}.selected-volume strong{font-size:78px}.new-bottle .prepared-note{margin:12px 0 22px}.home>.sleep-controls{margin-top:16px}.sleep-controls p{margin-top:8px}.active-card{padding-top:18px}.feeding-timer{font-size:32px}.stepper input{font-size:58px}.active-card .remaining-label{margin-top:16px}.home-stats{padding-bottom:18px}}

.measurement-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.measurement-summary strong{font-size:25px;white-space:nowrap}.measurement-summary strong small{font-size:11px}.measurement-summary .text-button{font-size:11px;gap:5px}.measurement-summary .text-button svg{width:18px;height:18px}.growth-section:nth-child(3) .growth-line{stroke:#a4c4bc}.growth-section:nth-child(3) .growth-point{fill:#a4c4bc}
.home-stat-label{color:#a0b0c9;font-size:11px}
#toast{pointer-events:auto;display:flex;align-items:center;gap:12px;max-width:calc(100% - 24px);white-space:normal}
#toast:not(.visible){pointer-events:none}
#toast button{background:none;border:0;color:var(--accent);font-size:12px;font-weight:600;min-height:44px;padding:0 4px;flex-shrink:0}
.measurement-edit{width:100%;background:none;color:inherit;text-align:left;border:0;border-top:1px solid var(--line);min-height:56px}
.measurement-edit strong{margin-left:auto}.measurement-edit svg{height:16px;width:16px;color:var(--muted)}
/* All histories read newest first, with one row per complete period. */
.history-tabs{display:flex;gap:8px;max-width:472px;margin:0 auto 24px}.history-tabs button{flex:1;padding:10px 8px;font-size:11px;color:var(--muted)}.history-tabs button.selected{color:var(--accent);background:#111e34;border-color:#364e75}
.history-day{position:sticky;top:-1px;z-index:1;padding:14px 0;margin:14px 0 8px;background:var(--bg);border-bottom:1px solid var(--line);font-size:13px}
.agenda-period{display:flex;align-items:center;gap:12px;width:100%;min-height:88px;padding:16px 12px;margin:0 0 10px;border:1px solid #273957;border-left:3px solid #8ca1de;border-radius:10px;background:#111d34;color:var(--ink);text-align:left}
.agenda-period.awake{background:#211f1c;border-color:#3d3529;border-left-color:#d8b375}.period-icon{color:#9bade9;display:flex}.awake .period-icon{color:#d8b375}.period-copy{flex:1;min-width:0;font-size:13px}.period-copy small{display:block;color:#a0b0c9;font-size:11px;margin-top:5px}.agenda-period strong{font-size:18px;font-weight:450;white-space:nowrap;font-variant-numeric:tabular-nums}.agenda-period>.feed-chevron{width:12px;height:16px}
.full-history .feed-list+.feed-list .feed-row{border-top:1px solid var(--line)}
@media(max-width:360px){.agenda-period{gap:8px;padding:14px 10px}.agenda-period strong{font-size:16px}.period-copy small{font-size:10px}}
@media(max-width:360px){.app-scroll{padding-top:calc(var(--safe-top) + 24px)}.home-stat-label{font-size:9px}}
/* Shared reverse-time agenda: one scale for sleep, waking and overlapping feeds. */
.timeline-legend{display:flex;gap:18px;color:var(--muted);font-size:11px;margin-bottom:24px}.timeline-legend>span{display:flex;gap:6px;align-items:center}.timeline-legend svg{width:16px;height:16px}.timeline-legend>span:first-child{color:#9bade9}.timeline-legend>span:nth-child(2){color:#d8b375}.timeline-legend>span:last-child{color:#94c8b8}
.timeline-day>.history-day{margin-bottom:38px}.timeline{position:relative;margin-bottom:20px}.timeline-hours{position:absolute;inset:0;pointer-events:none}.timeline-hours>span{position:absolute;left:0;right:0;font-size:10px;color:var(--muted);border-top:1px solid var(--line);line-height:1;padding-top:4px}.timeline-lanes{position:absolute;inset:0 0 0 44px;background:repeating-linear-gradient(to top,transparent 0,transparent 29px,#1a273c55 29px,#1a273c55 30px)}
.timeline-lane-labels{position:absolute;top:-26px;left:0;right:0;display:grid;grid-template-columns:60% 40%;font-size:10px;color:var(--muted)}
.timeline-block{position:absolute;min-height:0;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:8px;overflow:hidden;padding:8px;border:0;border-bottom:1px solid var(--bg);border-radius:5px;background:#23365b;color:var(--ink);text-align:left}
.timeline-block.awake{background:#4c3e2a;color:#fff0d6}.timeline-block.feed{background:#24453f;color:#daf2ea}.timeline-block-heading{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.timeline-block svg{width:16px;height:16px}.timeline-block strong{font-size:13px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}.timeline-content{font-size:12px}.timeline-content small{display:block;font-size:10px;margin-top:4px;opacity:.8}.timeline-block.compact{padding:3px 6px;gap:1px}.timeline-block.compact .timeline-content small{display:none}.timeline-block.compact .timeline-block-heading svg{display:none}.timeline-block.compact .timeline-content{font-size:10px}.timeline-block.tiny{padding:0}.timeline-block.tiny>*{display:none}.timeline-records{margin:0 0 32px 44px}.timeline-records .activity-row,.timeline-records .feed-row{font-size:11px}.agenda-more{width:100%;margin:0 0 24px}
@media(max-width:360px){.bottom-nav :is(a,button){font-size:8px}.bottom-nav svg{width:20px;height:20px}.timeline-legend{gap:12px}.timeline-lanes{left:38px}.timeline-records{margin-left:38px}.timeline-block{padding:6px}.timeline-block strong{font-size:12px}.timeline-content{font-size:11px}}
.mqtt-settings>summary{min-height:44px;padding:12px 0;color:var(--accent);font-size:12px;cursor:pointer}.mqtt-settings form{padding-top:16px}.toggle-field{display:flex;align-items:center;gap:10px;min-height:44px;margin:0 0 18px;color:var(--ink);font-size:12px}.toggle-field input{width:20px;height:20px;accent-color:var(--accent);flex-shrink:0}.field-row>.toggle-field{align-self:center;margin:0}
/* Four quiet home indicators; keep the active feed within the phone viewport. */
.home-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding-bottom:18px}.home-stats>div,.home-stats>div.previous-feed{text-align:center}.home-stats>div:first-child{text-align:left}.home-stats>div:last-child{text-align:right}.home-stat-label{font-size:9px;margin-bottom:6px}.home-stats strong{font-size:23px;letter-spacing:-.7px}.home>.sleep-controls p{display:none}.sleep-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.sleep-actions button{gap:6px;font-size:12px}.sleep-actions svg{width:19px;height:19px}.sleep-actions button[data-sleep=restless] svg,.sleep-actions button[data-edit-state=restless] svg{color:#c8a1dd}
.app-scroll:has(>.home.has-active){overflow:hidden;padding-bottom:12px}.home.has-active{height:100%;min-height:0}.home.has-active .active-card{flex:1;min-height:0;display:flex;flex-direction:column;padding-top:14px}.home.has-active .active-card h1{font-size:15px;margin:0}.home.has-active .feeding-timer{font-size:34px;margin:2px 0}.home.has-active .remaining-label{margin:12px 0 8px}.home.has-active .stepper{margin-bottom:10px}.home.has-active .stepper input{font-size:58px}.home.has-active .quick-choices{margin-bottom:8px}.home.has-active .active-result{margin-bottom:10px}.home.has-active .active-card>.primary{margin-top:auto;min-height:50px;padding:12px}.home.has-active .active-footer{margin:2px 0 0}.home.has-active>.sleep-controls{padding:0;margin-top:8px}.home.has-active .sleep-actions button{min-height:46px}
.chart-percentage{display:block;font-size:10px;color:var(--accent);margin-top:3px}.chart-value{text-align:center}.delete-centered{display:flex;justify-content:center;width:100%;margin-top:10px}#activity-form>.sleep-actions{margin-bottom:22px}
.calendar-slot.restless{background:#91649f}.sleep-legend .restless,.timeline-legend .restless{color:#c8a1dd}.sleep-legend{gap:12px;flex-wrap:wrap}.agenda-period.restless{background:#291e32;border-color:#53365d;border-left-color:#c8a1dd}.restless .period-icon{color:#c8a1dd}
.continuous-timeline{margin-top:40px}.continuous-timeline .timeline-block{border-radius:3px;background:#23365bcc;justify-content:flex-start;padding-top:16px}.continuous-timeline .timeline-block.awake{background:#4c3e2acc}.continuous-timeline .timeline-block.restless{background:#563561cc}.continuous-timeline .timeline-block.feed{background:#24564f;z-index:2;justify-content:center;padding:4px 6px;box-shadow:0 0 0 1px #060c18}.continuous-timeline .timeline-block:not(.feed) .timeline-content,.continuous-timeline .timeline-block:not(.feed) .timeline-block-heading{max-width:54%}.continuous-timeline .timeline-lanes{background-size:auto 21px;background-image:repeating-linear-gradient(to top,transparent 0,transparent 20px,#1a273c55 20px,#1a273c55 21px)}.timeline-block.feed .timeline-content small{display:none}.compact-milk{display:none}.timeline-block.compact.feed .compact-milk{display:inline;font-size:10px;white-space:nowrap}.timeline-block.compact.feed .timeline-content{display:none}.continuous-timeline .timeline-block.compact{padding:2px 6px;justify-content:center}.continuous-timeline .timeline-block.tiny{padding:0}.timeline-day-boundary{position:absolute;left:40px;right:0;z-index:3;border-top:1px dashed #869ab277;pointer-events:none}.timeline-day-boundary>span{display:inline-block;background:var(--bg);font-size:10px;color:var(--ink);padding:2px 7px;transform:translateY(-100%)}.timeline-legend{gap:12px;flex-wrap:wrap}.timeline-legend>.feed{color:#94c8b8}
@media(max-height:740px){.home.has-active .home-stats{padding-bottom:10px}.home.has-active .active-card{padding-top:6px}.home.has-active .active-card h1{display:none}.home.has-active .feeding-timer{font-size:28px;line-height:1.2;margin:0}.home.has-active .prepared-note{font-size:10px}.home.has-active .remaining-label{margin:6px 0 4px;font-size:12px}.home.has-active .stepper input{font-size:44px}.home.has-active .stepper button{height:44px;width:48px}.home.has-active .stepper{margin-bottom:5px}.home.has-active .quick-choices{margin-bottom:5px}.home.has-active .active-result{margin-bottom:5px;font-size:11px}.home.has-active .active-card>.primary{min-height:44px;padding:9px}.home.has-active .sleep-actions button{min-height:44px}.home.has-active .active-footer .text-button{min-height:38px;padding:6px 0}.home.has-active .active-footer{margin:0}.home.has-active .home-stats strong{font-size:21px}}
@media(max-width:360px){.home-stat-label{font-size:8px}.home-stats strong{font-size:20px}.sleep-actions{gap:6px}.sleep-actions button{font-size:11px;gap:4px}.sleep-actions svg{width:17px;height:17px}.timeline-block strong{font-size:11px}.continuous-timeline .timeline-block.feed{padding:2px 4px}}

.bottom-nav a{text-decoration:none;touch-action:manipulation;-webkit-user-select:none;user-select:none}

/* Equal home columns and full-width, edge-to-edge navigation touch targets. */
.home-stats>div:nth-child(n){text-align:center}
.bottom-nav{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;justify-content:stretch;padding:0 var(--safe-right) 0 var(--safe-left);min-height:0}
.bottom-nav :is(a,button){width:100%;max-width:none;min-height:calc(68px + var(--safe-bottom));padding:8px 0 calc(8px + var(--safe-bottom));gap:5px;font-size:10px}
.bottom-nav svg{width:26px;height:26px}
@media(max-width:360px){.bottom-nav :is(a,button){font-size:9px}.bottom-nav svg{width:25px;height:25px}}

/* A rolling 24 hours fits the agenda viewport; milk amounts are callouts,
   independent of the true duration of the coloured feeding bar. */
.agenda-intro{margin-bottom:14px}.agenda-intro h1{font-size:22px}
.combined-agenda .timeline-legend{margin-bottom:14px;font-size:10px;gap:10px}
.combined-agenda .timeline-legend svg{width:13px;height:13px}
.combined-agenda .continuous-timeline{margin-top:20px}
.combined-agenda .timeline-lanes{background:repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--hour-height) - 1px),#1a273c55 calc(var(--hour-height) - 1px),#1a273c55 var(--hour-height))}
.continuous-timeline .timeline-block:not(.feed){gap:2px;padding-top:3px}
.continuous-timeline .timeline-block:not(.feed) strong{font-size:10px}
.continuous-timeline .timeline-block:not(.feed) .timeline-content{font-size:10px}
.continuous-timeline .timeline-block:not(.feed) .timeline-content small{display:none}
.continuous-timeline .timeline-block.feed{overflow:visible;padding:0;min-height:1px;border:0;border-radius:0;background:#609d89;box-shadow:none}
.feed-label{position:absolute;left:0;right:0;transform:translateY(-50%);display:flex;align-items:center;gap:4px;height:22px;padding:2px 5px;background:#153c34;color:#edfff8;border-radius:4px;white-space:nowrap}
.feed-label strong{font-size:11px}.feed-label .icon{display:block;width:13px;height:13px}
.feed-leader{position:absolute;left:7px;display:block;border-left:1px solid #94c8b8;pointer-events:none}
.home,.home-stats{background:var(--bg);background-image:none;mask-image:none;-webkit-mask-image:none;filter:none;backdrop-filter:none}
.home-stats strong{color:#e8effb;opacity:1;text-shadow:none;font-weight:500}
.home-stat-label{color:#b5c3d9;opacity:1;text-shadow:none}

.continuous-timeline .timeline-status{display:flex;align-items:center;justify-content:space-between;gap:4px;max-width:52%;font-size:10px;line-height:14px;white-space:nowrap}
.continuous-timeline .timeline-block:not(.feed){padding:2px 6px;justify-content:center}
.continuous-timeline .timeline-block.tiny:not(.feed){padding:0}.continuous-timeline .timeline-block.tiny>.timeline-status{display:none}

/* Use the actual visible viewport in Safari and installed iPhone webapps.
   Normal layout keeps painted controls and their touch coordinates aligned. */
#app{position:relative;inset:auto;top:0;height:var(--app-height,100dvh);max-height:var(--app-height,100dvh);padding-top:var(--safe-top);background:var(--bg)}
.app-scroll{position:relative;z-index:0}
.bottom-nav{z-index:10;position:relative;align-self:end}
.bottom-nav a{position:relative;isolation:isolate}
.bottom-nav a>*{pointer-events:none}
.summary-strip{display:grid;grid-template-columns:repeat(var(--summary-columns,4),minmax(0,1fr));gap:8px;padding:0 0 22px;margin:0 0 24px;border-bottom:1px solid var(--line);text-align:center}
.summary-strip>div{min-width:0}.summary-strip>div>span{display:block;color:#b5c3d9;font-size:9px;margin-bottom:8px;white-space:nowrap}.summary-strip strong{font-size:21px;line-height:1.3;font-weight:500;letter-spacing:-.6px;white-space:nowrap;font-variant-numeric:tabular-nums}.summary-strip strong small{font-size:11px;letter-spacing:0;color:var(--muted)}
.typical-durations{display:grid;grid-template-columns:1fr 1fr;gap:18px}.pattern-duration{display:flex;flex-direction:column;gap:5px}.pattern-duration>span{font-size:11px;color:var(--muted)}.pattern-duration>strong{font-size:18px;font-weight:500}.pattern-duration>small{font-size:10px;color:var(--muted);line-height:1.6}
.pattern-heading{margin:24px 0 12px}.pattern-axis{display:flex;justify-content:space-between;color:var(--muted);font-size:9px;margin-bottom:7px}.pattern-hours{display:grid;grid-template-columns:repeat(24,minmax(0,1fr));gap:2px;height:30px}.pattern-hours>span{background:#172235;border-radius:2px}.pattern-hours .awake{background:#c39c63}.pattern-hours .asleep{background:#4d669f}.pattern-legend{display:flex;flex-wrap:wrap;gap:14px;font-size:9px;color:var(--muted);margin-top:10px}.pattern-legend>span:before{content:'';display:inline-block;width:7px;height:7px;margin-right:5px;background:#172235;border-radius:1px}.pattern-legend>span:first-child:before{background:#4d669f}.pattern-legend>span:nth-child(2):before{background:#c39c63}
.pattern-explanation{margin-top:14px}.pattern-explanation>summary{font-size:11px;color:var(--muted);min-height:44px;padding:12px 0}.history-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.history-tabs>button{font-size:11px;padding:10px 4px}.current-activity .activity-clock{font-size:30px}.sleep-history-section .agenda-period{min-height:56px}.sleep-history-section .history-day{margin-top:22px}
@media(max-width:360px){.summary-strip{gap:4px}.summary-strip>div>span{font-size:8px}.summary-strip strong{font-size:17px}.summary-strip strong small{font-size:10px}}
/* Let active feeding fill the screen with three clearly aligned groups. */
.home.has-active .active-card{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;padding-top:clamp(12px,2dvh,20px)}
.home.has-active .active-card .feeding-heading h1{display:block;font-size:15px;margin:0 0 4px}
.home.has-active .active-card .feeding-heading .feeding-timer{font-size:clamp(34px,6dvh,52px);line-height:1.15;margin:0 0 7px}
.home.has-active .active-card .feeding-heading .prepared-note{font-size:12px}
.home.has-active .remaining-controls{align-self:center;min-height:0}
.home.has-active .remaining-controls .remaining-label{margin:0 0 14px;font-size:13px}
.home.has-active .remaining-controls .stepper{display:grid;grid-template-columns:60px minmax(0,1fr) 60px;gap:12px;margin:0 0 14px;align-items:center}
.home.has-active .remaining-controls .stepper button{width:60px;height:60px}
.home.has-active .remaining-controls .stepper input{width:100%;font-size:76px;line-height:1.05;letter-spacing:-2px}
.home.has-active .remaining-controls .quick-choices{margin:0 0 10px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.home.has-active .remaining-controls .quick-choices button{padding:8px 4px}
.home.has-active .remaining-controls .active-result{margin:0;font-size:13px}
.home.has-active .feeding-complete>.primary{min-height:56px;margin:0;padding:14px}
.home.has-active .feeding-complete .active-footer{margin:3px 0 0}
@media(max-height:740px){.home.has-active .active-card{gap:6px;padding-top:8px}.home.has-active .active-card .feeding-heading h1{font-size:12px;margin:0 0 2px}.home.has-active .active-card .feeding-heading .feeding-timer{font-size:32px;margin-bottom:3px}.home.has-active .active-card .feeding-heading .prepared-note{font-size:10px}.home.has-active .remaining-controls .remaining-label{margin-bottom:6px;font-size:12px}.home.has-active .remaining-controls .stepper{grid-template-columns:50px minmax(0,1fr) 50px;margin-bottom:6px}.home.has-active .remaining-controls .stepper button{height:50px;width:50px}.home.has-active .remaining-controls .stepper input{font-size:58px}.home.has-active .remaining-controls .quick-choices{margin-bottom:5px}.home.has-active .remaining-controls .active-result{font-size:11px}.home.has-active .feeding-complete>.primary{min-height:46px;padding:10px}}

#toast{max-width:min(300px,calc(100% - 40px));padding:5px 10px;gap:8px;border-radius:10px;font-size:11px;line-height:1.4}
#toast button{position:relative;min-height:32px;font-size:11px;padding:0 2px}
#toast button::after{content:'';position:absolute;inset:-6px -2px}
.agenda-range{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:16px}.agenda-range button{min-height:36px;padding:7px;font-size:11px}.agenda-range button.selected{background:#111e34;border-color:#45628e;color:var(--accent)}
.continuous-timeline .timeline-block{overflow:hidden;min-width:0;max-width:100%}
.continuous-timeline .timeline-block.feed{overflow:hidden;border-radius:4px;background:#153c34}
.continuous-timeline .timeline-block.feed .feed-label{position:static;transform:none;width:100%;max-width:100%;height:100%;padding:2px 5px;min-width:0;overflow:hidden;gap:4px;line-height:14px}
.feed-label strong{flex-shrink:0;font-size:11px;line-height:14px}.feed-label small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:9px;line-height:14px}.feed-label .icon{flex-shrink:0}
.agenda-feed-duration{position:absolute;min-height:1px;background:#609d8988;border-radius:1px;pointer-events:none;z-index:1}
.timeline-lanes>.feed-leader{z-index:1}
.continuous-timeline .timeline-status{overflow:hidden;min-width:0;max-height:100%;line-height:14px}
.timeline-status>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.timeline-status>strong{flex-shrink:0;line-height:14px}
.timeline-window-end{position:absolute;left:0;right:0;border-top:1px dashed #8caeec;pointer-events:none;z-index:3}
.timeline-window-end>span{position:absolute;right:0;bottom:0;background:var(--bg);padding:1px 4px;color:var(--accent);font-size:9px}

/* The shell reserves the status-bar area outside the scrolling content. */
.app-scroll{padding-top:12px;padding-bottom:12px}
.app-scroll.home-static{overflow:clip;overscroll-behavior:none}
.bottom-nav{background:var(--bg)}
.empty-bottle-dot{display:inline-block;width:6px;height:6px;flex-shrink:0;margin-left:5px;border-radius:50%;background:#76cfa0;vertical-align:middle}
.dashboard-summary .summary-strip{margin-bottom:18px}.dashboard-summary .card-heading{margin-bottom:16px}
.sleep-balance{padding-bottom:20px;margin-bottom:24px;border-bottom:1px solid var(--line)}
.sleep-balance>h1{font-size:11px;font-weight:400;color:var(--muted);letter-spacing:0;margin:0 0 15px}
.sleep-balance-values{display:flex;justify-content:space-between;gap:16px;margin-bottom:12px}.sleep-balance-values>div{display:flex;flex-direction:column;gap:4px}.sleep-balance-values>div:last-child{text-align:right}.sleep-balance-values span{font-size:10px;color:#b5c3d9}.sleep-balance-values strong{font-size:24px;font-weight:500;letter-spacing:-.6px}.sleep-balance-values small{font-size:12px;color:var(--muted);font-weight:400}
.sleep-balance-bar{display:flex;height:30px;border-radius:5px;overflow:hidden;background:#172235}.sleep-balance-bar>span{display:flex;align-items:center;justify-content:center;min-width:0;overflow:hidden;font-size:11px;font-weight:500;color:#f1f5ff}.sleep-balance-bar .asleep{background:#4d669f}.sleep-balance-bar .awake{background:#987541}.sleep-balance-bar .unknown{background:#172235}
.sleep-balance .metric-explainer{margin-top:9px;font-size:10px}

.dashboard-summary .summary-strip{padding-bottom:18px}.dashboard-summary .summary-strip strong{font-size:23px;letter-spacing:-.7px}.dashboard-summary .card-heading h1{margin:0;font-size:20px}
@media(max-width:360px){.dashboard-summary .summary-strip strong{font-size:20px}}

/* A solid viewport-constrained top edge prevents WebKit from extending its
   native scroll-edge blur over the first content row in installed webapps.
   Keep this outside #app so polling and page changes never remove the layer. */
.status-bar-cover{display:none;position:fixed;top:0;left:0;right:0;height:var(--safe-top);min-height:6px;background:var(--bg);z-index:20;pointer-events:none}
html.ios-standalone .status-bar-cover{display:block}
@media(display-mode:standalone){.status-bar-cover{display:block}}
