.app{max-width:560px;margin:0 auto;min-height:100vh;padding-bottom:calc(76px + env(safe-area-inset-bottom))}
.top{display:flex;justify-content:space-between;align-items:center;padding:calc(12px + env(safe-area-inset-top)) 16px 10px;position:sticky;top:0;
  background:rgba(0,0,0,.92);backdrop-filter:blur(12px);z-index:5}
.top img{height:20px}
.gear{width:36px;height:36px;display:grid;place-items:center;border-radius:10px;color:var(--mute)}
.gear svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.gear:hover{color:var(--white);background:var(--ink3)}
a.task{color:var(--white)}
.sheet{position:fixed;inset:0;z-index:40;background:rgba(0,0,0,.6);display:flex;align-items:flex-end;justify-content:center;padding:16px 16px calc(16px + env(safe-area-inset-bottom))}
.sheet .card{width:100%;max-width:528px}
main{padding:6px 16px 20px}
.tabbar{position:fixed;left:0;right:0;bottom:0;display:flex;justify-content:center;background:rgba(19,19,22,.96);backdrop-filter:blur(14px);
  border-top:1px solid var(--line);padding:6px 0 calc(6px + env(safe-area-inset-bottom));z-index:10}
.tabbar a{flex:1;max-width:112px;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10.5px;font-weight:700;color:var(--mute2);padding:4px 0;position:relative}
.tabbar svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tabbar a.on{color:var(--brand3)}
.pip{position:absolute;top:2px;right:calc(50% - 16px);width:9px;height:9px;border-radius:50%;background:var(--brand3);border:2px solid var(--ink2)}

.hello{margin:8px 0 14px}
.hello h1{font-size:24px}
.stack{display:grid;gap:12px;grid-template-columns:minmax(0,1fr)} /* minmax(0): широкі стрічки з прокруткою не розпирають екран */
.card h2{margin-bottom:10px}
.hero{background:linear-gradient(140deg,#2a0722,#120910 60%);border-color:rgba(227,92,196,.25)}
.hero .big{font-size:40px;font-weight:800;letter-spacing:-.03em;line-height:1}
.hero .big small{font-size:16px;color:var(--mute);font-weight:600}
.ring{--p:0;width:86px;height:86px;border-radius:50%;flex:none;display:grid;place-items:center;
  background:conic-gradient(var(--brand3) calc(var(--p)*1%),rgba(255,255,255,.08) 0)}
.ring>div{width:70px;height:70px;border-radius:50%;background:#170a14;display:grid;place-items:center;text-align:center;font-size:11px;color:var(--mute);line-height:1.2}
.ring b{display:block;font-size:17px;color:var(--white)}

.task{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line);cursor:pointer;user-select:none}
.task:last-child{border-bottom:none}
.task .box{width:24px;height:24px;border-radius:8px;border:1.5px solid var(--line2);flex:none;display:grid;place-items:center;transition:.15s}
.task.done .box{background:var(--brand);border-color:var(--brand)}
.task.done .box::after{content:'';width:6px;height:11px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg) translate(-1px,-1px)}
.task.done span{color:var(--mute2);text-decoration:line-through}

.meal{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.meal:last-child{border-bottom:none}
.meal .slot{width:74px;flex:none;font-size:11.5px;color:var(--brand3);font-weight:700;padding-top:2px;text-transform:uppercase;letter-spacing:.04em}
.meal .dish{font-weight:700;font-size:14.5px}
.meal .meta{font-size:12px;color:var(--mute2)}
.meal p{font-size:13px;color:var(--mute);margin-top:3px}

.water{display:flex;align-items:center;gap:12px}
.water .glass{flex:1;height:12px;border-radius:7px;background:var(--ink4);overflow:hidden}
.water .glass i{display:block;height:100%;background:#4aa3ff;border-radius:7px;transition:width .3s}

.quick{display:flex;gap:8px;align-items:flex-end}
.quick .in{margin:0}
.seg{display:flex;gap:6px;overflow-x:auto}
.seg button{flex:1;border:1px solid var(--line2);background:var(--ink3);border-radius:10px;padding:8px 6px;font-weight:700;font-size:13px;cursor:pointer;white-space:nowrap}
.seg button.on{background:var(--brand);border-color:var(--brand)}
.moods{display:flex;gap:6px}
.moods button{flex:1;height:40px;border-radius:10px;border:1px solid var(--line2);background:var(--ink3);cursor:pointer;font-weight:800}
.moods button.on{background:var(--brand);border-color:var(--brand)}
.two-in{display:grid;grid-template-columns:1fr 1fr;gap:10px}

.signed{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ok);margin-bottom:10px}
.signed::before{content:'';width:14px;height:14px;border-radius:50%;background:var(--okBg);box-shadow:inset 0 0 0 1.5px var(--ok)}
.note{background:var(--brandBg);border-radius:12px;padding:10px 12px;font-size:13.5px;margin-top:10px}
.note b{color:var(--brand3);font-size:11px;letter-spacing:.06em;text-transform:uppercase;display:block;margin-bottom:2px}
.goal{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line);font-size:14px}
.goal:last-child{border-bottom:none}
.goal .to{color:var(--ok);font-weight:700}
details.acc{border-top:1px solid var(--line)}
details.acc summary{cursor:pointer;padding:12px 0;font-weight:700;list-style:none;display:flex;justify-content:space-between}
details.acc summary::-webkit-details-marker{display:none}
details.acc summary::after{content:'+';color:var(--mute2);font-size:18px;line-height:1}
details.acc[open] summary::after{content:'−'}
.sup{padding:12px 0;border-bottom:1px solid var(--line)}
.sup:last-child{border-bottom:none}
.sup .row{justify-content:space-between}
.chips{display:flex;flex-wrap:wrap;gap:6px}

.chat{display:flex;flex-direction:column;gap:8px;min-height:50vh;padding-bottom:70px}
.msg{max-width:82%;padding:9px 13px;border-radius:16px;font-size:14.5px;background:var(--ink3);border-bottom-left-radius:5px}
.msg.patient{align-self:flex-end;background:var(--brand);border-bottom-left-radius:16px;border-bottom-right-radius:5px}
.msg time{display:block;font-size:11px;color:var(--mute2);margin-top:2px}
.msg.patient time{color:rgba(255,255,255,.6)}
.composer{position:fixed;left:0;right:0;bottom:calc(64px + env(safe-area-inset-bottom));display:flex;justify-content:center;padding:8px 16px;background:rgba(0,0,0,.95)}
.composer form{display:flex;gap:8px;width:100%;max-width:528px}
.composer .in{margin:0}
/* Їжа: програми, дні меню, страви з фото порції */
.pill{flex:none;border:1px solid var(--line2);background:var(--ink3);border-radius:100px;padding:8px 14px;font-weight:700;font-size:13px;cursor:pointer;white-space:nowrap}
.pill.on{background:var(--brand);border-color:var(--brand)}
.daystrip{display:flex;gap:6px;overflow-x:auto;padding-bottom:6px;scroll-snap-type:x mandatory}
.daystrip button{flex:none;width:58px;scroll-snap-align:start;border:1px solid var(--line2);background:var(--ink2);border-radius:14px;padding:7px 0;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:1px}
.daystrip button b{font-size:18px;line-height:1.2}
.daystrip button small{font-size:10.5px;color:var(--mute2);font-weight:700}
.daystrip button.on{background:var(--brand);border-color:var(--brand)}
.daystrip button.on small{color:rgba(255,255,255,.75)}
.dishcard{padding:0;overflow:hidden;cursor:pointer}
/* Фото з постерів широкі (~2,5:1) — показуємо в близькій пропорції, щоб страва не обрізалась */
.dish-img{display:block;width:100%;aspect-ratio:2.2/1;object-fit:cover;background:var(--ink3)}
.dish-photo{position:relative;cursor:zoom-in}
.dish-photo .tag{position:absolute;left:10px;bottom:10px;font-style:normal;font-size:10.5px;font-weight:700;letter-spacing:.03em;
  background:rgba(0,0,0,.72);color:rgba(240,240,240,.85);border-radius:100px;padding:3px 9px;backdrop-filter:blur(6px)}
.dish-photo .tag.ok{color:var(--ok)}
.seg.mini{gap:4px}
.seg.mini button{flex:none;padding:5px 10px;font-size:12px;border-radius:9px}
.grid14{display:grid;gap:8px}
.g-row{display:grid;grid-template-columns:42px minmax(0,1fr);gap:8px;align-items:stretch}
.g-day{display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:12px;
  background:linear-gradient(160deg,#5a1a4f,#2a0a24);color:#fff}
.g-day b{font-size:17px;line-height:1.1}
.g-day small{font-size:9.5px;color:rgba(255,255,255,.7);font-weight:700}
.g-meals{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.g-cell{border:none;background:none;padding:0;cursor:pointer;display:flex;flex-direction:column;gap:2px;align-items:center;min-width:0}
.g-cell img,.g-cell i{display:block;width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px;background:repeating-linear-gradient(135deg,var(--ink3) 0 8px,#1c1c23 8px 16px)}
.g-cell span{font-size:9.5px;color:var(--mute2);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.g-cell:active img{transform:scale(.96)}
.lightbox{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.92);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;gap:12px;cursor:zoom-out}
.lightbox img{max-width:100%;max-height:70vh;border-radius:14px;object-fit:contain}
.lightbox p{font-weight:700;text-align:center;max-width:520px}
.lightbox span{font-size:12px;color:var(--mute2)}
.empty-img{display:grid;place-items:center;text-align:center;font-size:12.5px;color:var(--mute2);
  background:repeating-linear-gradient(135deg,var(--ink3) 0 12px,#1c1c23 12px 24px)}
.dish-body{padding:12px 14px 14px}
.dish-body .slot{font-size:11px;color:var(--brand3);font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.dish-body .dish{font-weight:700;font-size:15px;margin-top:3px;padding:0;cursor:inherit;background:none;border:none}
.dish-body .meta{font-size:12px;color:var(--mute2);margin-top:2px}
.thumbs{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.thumbs div{display:flex;flex-direction:column;gap:3px;align-items:center;font-size:10px;color:var(--mute2)}
.thumbs img,.thumbs i{width:100%;aspect-ratio:1;border-radius:10px;object-fit:cover;background:var(--ink3);display:block}
.seg button div{margin-top:1px}

.sectitle{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--brand3);font-weight:800;margin:18px 0 8px}
table.mini{width:100%;border-collapse:collapse;font-size:13px}
table.mini th{font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--mute2);text-align:left;padding:6px 4px;font-weight:700}
table.mini td{padding:8px 4px;border-top:1px solid var(--line)}
