/* Layout: the iOS app as a web product — one phone-width column (white, iOS system type, grey tiles, black CTA, indigo accent)
   centred on a soft grey page; floating capsule tab bar; bottom sheets; full-screen meal-plan builder.
   Deliberately single-theme (light), exactly like the app. */
:root {
  color-scheme: light;
  --page: #ECECF1; --bg: #FFFFFF; --surface: #F4F4F6; --raised: #FFFFFF; --muted: #E8E8EC; --sep: #E5E5EA;
  --ink: #111111; --t2: #8E8E93; --t3: #B4B4BA;
  --accent: #5E5CE6; --accent-soft: #E9E8FD; --cta: #111111;
  --protein: #F2994A; --carbs: #E9B949; --fiber: #34C759; --cal: #FF6B4A; --water: #2F80ED; --water-soft: #E3EEFD;
  --dose: #5E5CE6; --sage: #34A853; --warn: #E0A100; --danger: #E5484D;
  --r: 22px; --rs: 16px; --rb: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --col: 440px;
}
* { box-sizing: border-box; }
html, body { background: var(--page); color: var(--ink); }
body { margin: 0; font: 400 17px/1.3 var(--font); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--ink); }
h1, h2, p { margin: 0; }
small { font-size: inherit; }
hr { border: 0; border-top: 1px solid var(--sep); margin: 0; }
a { color: var(--accent); }
.app { max-width: var(--col); margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
.art { display: block; flex: none; object-fit: contain; user-select: none; }
.ic { display: block; flex: none; }
.grow { flex: 1; min-width: 0; }

/* type */
.lt { font-size: 30px; font-weight: 700; letter-spacing: -.01em; line-height: 1.12; text-wrap: balance; }
.lt2 { font-size: 22px; font-weight: 700; padding: 24px 0 8px; }
.h3 { font-size: 20px; font-weight: 700; }
.s22 { font-size: 22px; font-weight: 700; } .s20 { font-size: 20px; } .s17 { font-size: 17px; font-weight: 600; } .s15 { font-size: 15px; } .s13 { font-size: 13px; } .s12 { font-size: 12px; } .s11 { font-size: 11px; }
.w5 { font-weight: 500; } .w6 { font-weight: 600; } .w7 { font-weight: 700; }
.t2 { color: var(--t2); } .t3 { color: var(--t3); } .accent { color: var(--accent); } .sage { color: var(--sage); }
.tnum { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .07em; color: var(--t2); }
.eyebrow.c2 { font-size: 11px; letter-spacing: .05em; }
.eyebrow.wide { letter-spacing: .1em; }
.big26 { font-size: 26px; font-weight: 700; line-height: 1.15; }
.clamp1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.struck { text-decoration: line-through; color: var(--t2); }
.disclaimer { font-size: 11px; color: var(--t3); text-align: center; padding-top: 4px; }
.disclaimer.foot { font-size: 12px; line-height: 1.6; }
small { display: block; }

/* layout helpers */
.gap2,.gap3,.gap4,.gap6,.gap8,.gap10,.gap12,.gap14,.gap16,.gap18,.gap20,.gap22,.gap26 { display: flex; flex-direction: column; }
.gap2{gap:2px}.gap3{gap:3px}.gap4{gap:4px}.gap6{gap:6px}.gap8{gap:8px}.gap10{gap:10px}.gap12{gap:12px}.gap14{gap:14px}.gap16{gap:16px}.gap18{gap:18px}.gap20{gap:20px}.gap22{gap:22px}.gap26{gap:26px}
.row4,.row6,.row8,.row12,.row14 { display: flex; align-items: center; }
.row4{gap:4px}.row6{gap:6px}.row8{gap:8px}.row12{gap:12px}.row14{gap:14px}
.wrap { flex-wrap: wrap; }
.row-top { display: flex; align-items: flex-start; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.between.base { align-items: flex-end; }
.center { text-align: center; align-items: center; justify-content: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.screen { padding: 0 max(16px, env(safe-area-inset-left, 0px)) 120px max(16px, env(safe-area-inset-right, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* cards & controls */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
button.card { flex-direction: row; align-items: center; }
.card.raised, .rcard { background: var(--raised); box-shadow: 0 3px 12px rgba(0,0,0,.08); }
.rcard { border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; }
.card.row12, .card.row14 { flex-direction: row; align-items: center; }
.card.gap10 { gap: 10px; }
.btn-primary { width: 100%; min-height: 56px; border-radius: var(--rb); background: var(--cta); color: #fff; font-size: 17px; font-weight: 600; text-align: center; transition: transform .1s; }
.btn-primary:active:not(:disabled) { transform: scale(.98); opacity: .9; }
.btn-primary:disabled { background: var(--t3); }
.btn-secondary { width: 100%; min-height: 52px; border-radius: var(--rb); background: var(--muted); font-size: 17px; font-weight: 600; text-align: center; }
.pill { min-height: 36px; padding: 0 14px; border-radius: 99px; background: var(--raised); font-size: 15px; font-weight: 600; }
.pill.filled { background: var(--cta); color: #fff; }
.link { color: var(--accent); font-size: 15px; font-weight: 600; }
.titlerow .chip-btn { min-height: 32px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; background: var(--surface); font-size: 15px; font-weight: 600; white-space: nowrap; }
.chip-btn:disabled { opacity: .45; }
.rplus { display: grid; place-items: center; border-radius: 50%; background: var(--raised); flex: none; }
.chev { color: var(--t3); flex: none; }
.go { background: var(--cta); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 99px; flex: none; }
.lp { width: 100%; border-radius: 99px; overflow: hidden; }
.lp u { display: block; height: 100%; border-radius: 99px; transition: width .3s; }
.sh { display: flex; align-items: baseline; justify-content: space-between; padding-top: 6px; }
.sh h2 { font-size: 20px; font-weight: 700; }
.wchip, .pchip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--raised); white-space: nowrap; }
.pchip { background: var(--surface); padding: 6px 10px; }
.hscroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: 0 max(16px, env(safe-area-inset-left, 0px)); }
.card .hscroll, .prefill .hscroll { margin: 0; padding: 0; }
.hscroll::-webkit-scrollbar { display: none; }
.thumb { display: grid; place-items: center; flex: none; overflow: hidden; }
.thumb .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble, .bubble44, .bubble46, .bubble48 { display: grid; place-items: center; border-radius: 50%; flex: none; background: var(--raised); }
.bubble { width: 36px; height: 36px; background: var(--surface); }
.bubble44 { width: 44px; height: 44px; } .bubble44.muted { background: var(--muted); }
.bubble46 { width: 46px; height: 46px; background: var(--surface); }
.bubble48 { width: 48px; height: 48px; }
.circ { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--t3); }
.xbtn, .mini-x { width: 30px; height: 30px; display: grid; place-items: center; color: var(--t2); flex: none; }
.mini-x { width: 26px; height: 26px; color: var(--t3); }

/* welcome / sign in */
.route { min-height: 100dvh; display: flex; flex-direction: column; gap: 16px; padding: 12px max(24px, env(safe-area-inset-right, 0px)) 16px max(24px, env(safe-area-inset-left, 0px)); }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; }
.logo img { border-radius: 8px; }
.collage { position: relative; display: grid; place-items: center; overflow: hidden; margin: 0 -24px; }
.collage > * { grid-area: 1 / 1; }
.collage .blob { width: 230px; height: 230px; border-radius: 50%; background: var(--accent-soft); }
.collage .sat { padding: 10px; background: #fff; border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.cchip { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.cchip.tl { place-self: start start; margin: 6px 18px; } .cchip.tr { place-self: start end; margin: 6px 18px; } .cchip.bl { place-self: end start; margin: 6px 18px; } .cchip.br { place-self: end end; margin: 6px 18px; }
.cchip small { font-size: 11px; color: var(--t2); } .cchip b { font-size: 13px; }
.cdot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.wtext { text-align: center; display: flex; flex-direction: column; gap: 12px; padding: 0 4px; }
.wtext h1 { font-size: 32px; font-weight: 700; line-height: 1.12; text-wrap: balance; }
.wtext p { color: var(--t2); }
.wfoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.fine { font-size: 11px; color: var(--t3); text-align: center; }
.back { width: 44px; height: 44px; border-radius: 50%; background: var(--raised); box-shadow: 0 2px 6px rgba(0,0,0,.06); display: grid; place-items: center; margin-bottom: 8px; }
.sub { font-size: 15px; color: var(--t2); }
.field { min-height: 56px; border-radius: var(--rs); border: 1px solid var(--sep); background: var(--raised); padding: 0 16px; font-size: 17px; width: 100%; }
.field.pw { display: flex; align-items: center; padding-right: 8px; }
.field.pw input { flex: 1; border: 0; outline: 0; background: transparent; min-height: 54px; min-width: 0; }
.field:focus, .field.pw:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.eye { width: 36px; height: 36px; display: grid; place-items: center; color: var(--t2); }
.err { color: var(--danger); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tests { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.tests .cap { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--t3); }
.testacc { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--surface); border-radius: 12px; }
.testacc b { font-size: 15px; display: block; } .testacc small { font-size: 12px; color: var(--t2); }
.vp .center { display: flex; justify-content: center; }
.vptext { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.vptext h1 { font-size: 27px; font-weight: 700; } .vptext p { color: var(--t2); }
.dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: rgba(180,180,186,.5); transition: width .2s; }
.dots i.on { width: 22px; background: var(--ink); }
.notifs { background: var(--surface); border-radius: 28px; padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.notif { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: rgba(255,255,255,.95); border-radius: 18px; box-shadow: 0 3px 8px rgba(0,0,0,.06); }
.nicon { width: 38px; height: 38px; border-radius: 9px; background: var(--muted); display: grid; place-items: center; flex: none; }
.notif > div { flex: 1; min-width: 0; } .nrow { display: flex; justify-content: space-between; font-size: 11px; color: var(--t2); font-weight: 600; }
.notif b { font-size: 15px; } .notif p { font-size: 13px; color: var(--t2); }
.textbtn { min-height: 44px; text-align: center; color: var(--t2); font-size: 15px; font-weight: 600; }
.group { background: var(--surface); border-radius: var(--r); padding: 0 16px; }
.group.raised { background: var(--raised); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.group hr { margin-left: 0; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-weight: 600; cursor: pointer; gap: 12px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { width: 51px; height: 31px; border-radius: 99px; background: var(--muted); position: relative; flex: none; transition: background .2s; }
.toggle-row i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.toggle-row input:checked + i { background: var(--accent); }
.toggle-row input:checked + i::after { transform: translateX(20px); }
.toggle-row input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Today */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 0; }
.streak { display: flex; align-items: center; gap: 3px; font-size: 15px; }
.daystrip { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; scroll-behavior: auto; margin: 0; padding: 0 2px; }
.daystrip::-webkit-scrollbar { display: none; }
.dcell { width: 44px; height: 62px; border-radius: 14px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.dcell small { font-size: 11px; font-weight: 600; color: var(--t2); }
.dcell b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dcell.fut b { color: var(--t3); }
.dcell.on small { color: rgba(255,255,255,.85); } .dcell.on b { color: #fff; }
.dcell .mk { height: 9px; display: grid; place-items: center; }
.dcell .dot { display: block; width: 5px; height: 5px; border-radius: 50%; }
.dcell .ring-dot { display: block; width: 5px; height: 5px; border-radius: 50%; border: 1px solid; }
.titlerow { display: flex; align-items: center; justify-content: space-between; }
.titlerow h2 { font-size: 20px; font-weight: 700; }
.dc-head { display: flex; align-items: center; gap: 10px; }
.dc-head > b { font-size: 17px; flex: 1; font-weight: 600; }
.dc-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--t2); }
.dc-btns { display: flex; align-items: center; gap: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 8px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; background: var(--surface); min-width: 0; text-align: center; }
.tile.open { background: var(--raised); outline: 1.5px dashed var(--sep); outline-offset: -1.5px; }
.tile b { font-size: 12px; font-weight: 700; white-space: nowrap; }
.tile small { font-size: 11px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile .tick { position: absolute; top: 6px; right: 6px; }
.prefill { display: flex; flex-direction: column; gap: 6px; }
.prefill > span { display: inline-flex; align-items: center; gap: 4px; }
.cl-list { display: flex; flex-direction: column; gap: 4px; }
.cl-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 14px; width: 100%; }
.cl-row.next { background: var(--raised); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cl-ic { width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.cl-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cl-tx b { font-size: 15px; } .cl-tx small { font-size: 12px; color: var(--t2); }
.tipcard { border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--sage) 16%, white)); }
.tiptag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--accent); background: rgba(255,255,255,.8); padding: 5px 10px; border-radius: 99px; }
.tipdo { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.85); }
.tipdo small { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--sage); }
.tipdo b { font-size: 15px; font-weight: 600; display: block; }
.nut { flex-direction: row; align-items: center; gap: 14px; }
.kring { position: relative; width: 104px; height: 104px; flex: none; display: grid; place-items: center; }
.kring > * { grid-area: 1 / 1; }
.kring span { text-align: center; } .kring b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; } .kring small { font-size: 11px; color: var(--t2); }
.ncol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ntile { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--surface); width: 100%; }
.mealrow { flex-direction: row; align-items: center; gap: 12px; }
.mr-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.mr-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mr-tx b { font-size: 15px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.eat { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.eat .ring24 { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--t3); display: block; }
.eat.on { background: var(--sage); }
.planned { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 99px; flex: none; }
.fade { -webkit-mask-image: linear-gradient(#000, #000 55%, rgba(0,0,0,.15)); mask-image: linear-gradient(#000, #000 55%, rgba(0,0,0,.15)); }
.exrow { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 14px; background: var(--raised); }
.noplan { gap: 12px; }
.also { background: var(--surface); border-radius: var(--r); padding: 12px 14px; }
.also-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.also-row.sep { border-top: 1px solid var(--sep); margin-left: 34px; padding-left: 0; }
.also-row.sep > img { margin-left: -34px; }

/* Meals */
.goalchip { font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.gauge { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; }
.gauge > svg { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); }
.gauge span { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; } .gauge b { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; } .gauge small { font-size: 13px; color: var(--t2); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.macro b, .macro2 b, .noplan b { font-weight: 600; }
.macro { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.gentle { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--sage); padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--sage) 12%, white); }
.swap { align-self: flex-end; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--t2); padding-right: 8px; }
.recipes-link { gap: 14px; }
.stack { display: flex; }
.stack span { width: 46px; height: 46px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.stack span + span { margin-left: -14px; }
.recipes-link .grow { display: flex; flex-direction: column; gap: 2px; }
.navbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 0; }
.navbar b { font-size: 17px; text-align: center; }
.navback { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; }
.navright { justify-self: end; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.iconbtn.on { background: var(--accent-soft); color: var(--accent); }
.search { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px; background: var(--muted); color: var(--t2); }
.search input { flex: 1; border: 0; background: transparent; outline: 0; font-size: 17px; min-width: 0; }
.tagchip { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 99px; background: var(--muted); white-space: nowrap; flex: none; }
.tagchip.on { background: var(--accent); color: #fff; }
.chips { gap: 8px; }
.cards { gap: 12px; }
.reccard { width: 170px; flex: none; display: flex; flex-direction: column; gap: 8px; }
.reclist { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--rs); background: var(--surface); }
.reclist .grow { display: flex; flex-direction: column; gap: 2px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 60px 16px; color: var(--t2); }
.empty b { color: var(--ink); font-size: 20px; }
.shop { display: flex; align-items: center; gap: 12px; min-height: 48px; width: 100%; }

/* Progress */
.wstatus { gap: 12px; }
.sdot { width: 7px; height: 7px; border-radius: 50%; display: block; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--muted); border-radius: 9px; padding: 2px; }
.seg button { text-align: center; font-size: 13px; font-weight: 600; padding: 6px 4px; border-radius: 7px; white-space: nowrap; }
.seg button.on { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.seg.small { width: 110px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border-radius: var(--rs); padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart { width: 100%; height: auto; display: block; }
.axis { font: 500 11px var(--font); fill: var(--t2); }
.legend { display: block; width: 12px; height: 2px; background: color-mix(in srgb, var(--dose) 40%, white); }
.bigs { flex-direction: row; }
.big { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.big b { font-weight: 700; }
.selectrow { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px; background: var(--raised); font-size: 15px; font-weight: 600; }
.selectrow select { flex: 1; text-align: right; border: 0; background: transparent; font-weight: 600; appearance: auto; }

/* Doses */
.hist { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.hdot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--dose) 12%, white); flex: none; }
.hist .right { text-align: right; } .hist .right b { display: block; }
.hist .grow b { display: block; }
.allrow { display: flex; align-items: center; gap: 8px; min-height: 48px; width: 100%; font-size: 15px; font-weight: 600; color: var(--accent); }

/* Profile */
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 700; flex: none; }
.pro { font-size: 11px; font-weight: 800; color: #fff; background: var(--accent); padding: 2px 6px; border-radius: 99px; }
.prow { display: flex; align-items: center; gap: 12px; min-height: 52px; width: 100%; font-size: 17px; }
.prow > .ic:first-child { width: 24px; }
.pgroup hr { margin-left: 36px; }
.prow.danger { color: var(--danger); }

/* Sheets */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
.scrim.center { display: grid; place-items: center; padding: 24px; }
.sheet { position: fixed; z-index: 21; left: 50%; transform: translateX(-50%); bottom: 0; width: min(var(--col), 100%); max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px)); height: calc(100dvh - 24px - env(safe-area-inset-top, 0px)); background: var(--bg); border-radius: 22px 22px 0 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom, 0px); }
.sheet.short { height: auto; }
.sheet.anim { animation: up .32s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translate(-50%, 40%); opacity: .4; } to { transform: translate(-50%, 0); opacity: 1; } }
.grabber { display: block; width: 36px; height: 5px; border-radius: 99px; background: var(--muted); margin: 6px auto 0; }
.sheet-body { min-height: calc(100% - 11px); display: flex; flex-direction: column; }
.sheet.short .sheet-body { min-height: 0; }
.pad16 { padding: 0 max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.pad20 { padding: 0 20px 20px; }
.shead { position: relative; display: flex; align-items: center; justify-content: center; min-height: 42px; padding-top: 8px; }
.shead b { font-size: 17px; }
.shead .closebtn, .shead > .link:last-child { position: absolute; right: 0; }
.shead > .link:first-child { position: absolute; left: 0; }
.closebtn { width: 34px; height: 34px; border-radius: 50%; background: var(--muted); display: grid; place-items: center; }
.lmrow { display: flex; align-items: center; gap: 14px; padding: 8px 0; width: 100%; }
.lmrow b { font-size: 17px; font-weight: 600; display: block; }
.qcard { background: var(--raised); border-radius: var(--r); padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.05); display: flex; flex-direction: column; gap: 12px; }
.qring { position: relative; display: grid; place-items: center; padding: 6px 0; }
.qring > * { grid-area: 1 / 1; }
.qring span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qring b { font-size: 36px; font-weight: 700; }
.steps { display: flex; align-items: center; justify-content: center; gap: 22px; }
.stepbtn { width: 48px; height: 48px; border-radius: 50%; background: var(--muted); display: grid; place-items: center; }
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qtile { min-height: 86px; border-radius: 14px; border: 1px solid var(--sep); background: var(--raised); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.qtile b { font-size: 12px; font-weight: 600; white-space: nowrap; }
.stickybtn { position: sticky; bottom: 0; background: var(--bg); padding-top: 12px; padding-bottom: 4px; margin-top: auto; z-index: 2; }
.fstatus, .fgood { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 16px; border-radius: var(--rs); background: var(--muted); width: 100%; }
.fgood { justify-content: center; gap: 10px; background: var(--accent-soft); font-size: 17px; }
.fdots { display: flex; gap: 6px; }
.fdots button { width: 30px; height: 30px; border-radius: 50%; background: var(--muted); }
.fdots button.on { background: var(--accent); }
.fslider { display: grid; grid-template-columns: 22px 100px 1fr 36px; align-items: center; gap: 10px; }
.fslider span { text-align: right; font-size: 15px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: var(--c, var(--accent)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 99px; background: var(--c, var(--accent)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.25); margin-top: -11px; }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.25); }
.bigfield { background: var(--raised); border-radius: var(--r); padding: 22px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 0 0 1px var(--sep) inset; }
.bigfield.soft { background: var(--surface); box-shadow: none; padding: 18px 12px; }
.bigfield span { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.bigfield input { border: 0; outline: 0; background: transparent; font-size: 52px; font-weight: 700; text-align: center; width: 4.2ch; font-variant-numeric: tabular-nums; }
.bigfield.soft input { font-size: 44px; }
.bigfield em { font-style: normal; font-size: 22px; font-weight: 600; color: var(--t2); }
.bigfield small { font-size: 13px; }
.daterow, .frow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-weight: 500; width: 100%; }
.daterow { background: var(--raised); border-radius: var(--r); padding: 0 16px; box-shadow: 0 0 0 1px var(--sep) inset; }
.daterow input, .frow input, .frow select, .soft input, .rcard input[type=datetime-local] { border: 0; background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: 15px; max-width: 60%; }
.group .frow select, .group .frow input { background: var(--muted); }
.frow > span:last-child:not(.rlabel) { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rlabel { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.choice { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--rs); background: var(--raised); box-shadow: 0 0 0 1px var(--sep) inset; width: 100%; }
.choice.on { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent) inset; }
.choice b { font-size: 17px; font-weight: 600; display: block; } .choice small { font-size: 13px; color: var(--t2); }
.cmark { flex: none; display: grid; place-items: center; width: 24px; }
.cmark .circ { width: 22px; height: 22px; }
.sites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sites button { min-height: 44px; border-radius: 12px; background: var(--raised); box-shadow: 0 0 0 1px var(--sep) inset; text-align: center; font-size: 15px; font-weight: 600; }
.sites button.on { background: var(--accent); color: #fff; box-shadow: none; }
.note { border: 0; resize: vertical; font-size: 17px; }
.two .cap { min-height: 46px; border-radius: 99px; background: var(--raised); box-shadow: 0 0 0 1px var(--sep) inset; text-align: center; font-size: 15px; font-weight: 600; }
.two .cap.on { background: var(--cta); color: #fff; box-shadow: none; }
.soft { padding: 14px; border-radius: 14px; background: var(--surface); }
.ing { display: flex; gap: 8px; font-size: 15px; align-items: baseline; }
.stepline { display: flex; gap: 12px; align-items: flex-start; }
.snum { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; display: grid; place-items: center; flex: none; }
.macros4 { flex-direction: row; }
.macro2 { flex: 1; text-align: center; display: flex; flex-direction: column; } .macro2 b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* Moment / pass */
.moment { min-height: calc(100% - 11px); }
.pass { border-radius: var(--r); overflow: hidden; background: var(--raised); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.pass-h { display: flex; align-items: flex-end; justify-content: space-between; padding: 16px; color: #fff; }
.pass-h small { font-size: 11px; font-weight: 700; letter-spacing: .05em; opacity: .8; }
.pass-h b { font-size: 24px; font-weight: 700; display: block; }
.perf { display: flex; align-items: center; height: 18px; margin: 2px 0; }
.perf i { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); flex: none; }
.perf i:first-child { margin-left: -9px; } .perf i:last-child { margin-right: -9px; }
.perf u { flex: 1; border-top: 1.5px dashed var(--sep); }
.pass-f { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 16px 16px; }
.pass-f small { font-size: 11px; font-weight: 600; letter-spacing: .03em; color: var(--t2); } .pass-f b { font-size: 15px; }
.pass-s { display: flex; gap: 5px; padding: 0 12px 8px; }
.pass-s span { flex: 1; text-align: center; padding: 7px 0; border-radius: 10px; background: var(--surface); color: var(--t2); }
.pass-s span.soft { background: color-mix(in srgb, var(--sage) 14%, white); color: var(--sage); }
.pass-s small { font-size: 11px; font-weight: 600; } .pass-s b { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pass-s span.hl b, .pass-s span.soft b { color: inherit; }
.pass-n { font-size: 12px; color: var(--t2); padding: 0 16px 14px; }
.timeline { display: flex; flex-direction: column; padding-top: 8px; }
.tl-row { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding-bottom: 16px; }
.tl-row:last-child { padding-bottom: 0; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); margin: 3px 3px 0; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sep); z-index: 1; }
.tl-dot.first { box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; color: var(--sage); }
.tl-line { position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--sep); }

/* Builder */
.full { min-height: 100dvh; display: flex; flex-direction: column; }
.bhead { display: flex; align-items: center; gap: 14px; padding: 8px 16px; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 3; }
.iconbtn.plain { width: 40px; height: 40px; }
.fbody { flex: 1; padding: 16px max(16px, env(safe-area-inset-left, 0px)) 24px; }
.ffoot { position: sticky; bottom: 0; background: var(--bg); padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.artgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.arttile { position: relative; min-height: 104px; border-radius: var(--rs); background: var(--raised); box-shadow: 0 0 0 1px var(--sep) inset; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 6px; text-align: center; }
.arttile b { font-size: 13px; font-weight: 600; }
.arttile.on { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent) inset; }
.atick { position: absolute; top: 8px; right: 8px; }
.spark { width: 84px; height: 84px; border-radius: 24px; background: var(--accent); display: grid; place-items: center; }
.brow { display: flex; align-items: center; gap: 14px; transition: opacity .3s; text-align: left; }
.brow .grow { display: flex; flex-direction: column; gap: 2px; }
.indet { display: block; height: 4px; border-radius: 99px; background: var(--muted); overflow: hidden; margin-top: 4px; }
.indet u { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 99px; animation: slide 1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Tab bar, toast, dialog */
.tabbar { position: fixed; z-index: 10; bottom: calc(4px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); width: calc(min(var(--col), 100%) - 32px); height: 66px; padding: 0 6px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; border-radius: 99px; background: rgba(250,250,252,.82); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: 0 6px 18px rgba(0,0,0,.12), inset 0 0 0 1px rgba(255,255,255,.7); }
.tb { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 54px; justify-content: center; color: var(--t2); }
.tb span { font-size: 10px; font-weight: 500; }
.tb.on { color: var(--ink); } .tb.on span { font-weight: 700; }
.fab { justify-self: center; width: 52px; height: 52px; border-radius: 50%; background: var(--cta); color: #fff; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0,0,0,.2); }
.toast { position: fixed; z-index: 40; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: calc(min(var(--col), 100%) - 32px); display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--raised); box-shadow: 0 6px 14px rgba(0,0,0,.12); animation: drop .35s cubic-bezier(.2,.8,.2,1); }
.toast b { font-size: 15px; display: block; } .toast small { font-size: 13px; color: var(--t2); }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.dialog { width: min(300px, 100%); background: var(--raised); border-radius: 16px; padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.dialog .two { margin-top: 8px; }
.dbtn { min-height: 44px; border-radius: 12px; background: var(--surface); text-align: center; font-weight: 600; color: var(--accent); }
.dbtn.danger { color: var(--danger); }
.scrim.center { z-index: 50; }

@media (min-width: 520px) {
  body { padding-block: 0; }
  .app { box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 20px 60px rgba(30,30,60,.08); }
}
@media (max-width: 360px) { .qgrid { grid-template-columns: repeat(3, 1fr); } .fslider { grid-template-columns: 22px 80px 1fr 32px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Телефон: фон страницы белый, как у приложения — без серой полосы под статус-баром. */
@media (max-width: 480px) { html, body { background: var(--bg); } }
