/* «Рацион» — кухонная тетрадь: тёплая бумага, hairline вместо теней, один акцент — терракота, шалфей — «сделано». */
:root{
  --bg:#FBFAF7; --surface:#FFFFFF; --surface-2:#F5F2EE; --surface-3:#EBE6DF;
  --line:#EDE8E1; --line-2:#DDD6CC;
  --ink:#2F2A25; --ink-2:#5A534B; --muted:#7A7269; --faint:#ABA398;
  --accent:#B95A33; --accent-ink:#9C4725; --accent-soft:#F7EAE2; --on-accent:#FFFFFF;
  --done:#4E7D4F; --done-soft:#E8F0E3; --warn:#B23C35; --warn-soft:#F9E6E3;
  --p:#5874A6; --f:#C2902F; --c:#B9647C;
  --note-bg:#FBF4E6; --note-ink:#5E4A2A;
  --t-honey-bg:#FAF0D7; --t-honey:#86621A;
  --t-sage-bg:#E9F0E1;  --t-sage:#4A6838;
  --t-rose-bg:#F8E8EA;  --t-rose:#94485C;
  --t-plum-bg:#EEE9F5;  --t-plum:#5F4F88;
  --t-sky-bg:#E5EEF4;   --t-sky:#3E6580;
  --t-gray-bg:#F0ECE6;  --t-gray:#5A534B;
  --shadow-pop:0 1px 2px rgba(47,42,37,.06), 0 10px 30px rgba(47,42,37,.12);
  --scrim:rgba(30,24,18,.32);
  --sans:"Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif:"Lora", Georgia, "Times New Roman", serif;
  --r-xs:5px; --r-s:8px; --r-m:12px; --r-l:16px;
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px; --s6:24px; --s8:32px;
  --top-h:48px; --nav-h:60px; --safe-b:env(safe-area-inset-bottom,0px);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#1A1815; --surface:#22201C; --surface-2:#2A2723; --surface-3:#36322C;
  --line:#2F2B26; --line-2:#433D36;
  --ink:#EEE9E2; --ink-2:#CAC2B8; --muted:#9C948A; --faint:#6E675F;
  --accent:#E08A62; --accent-ink:#EFA482; --accent-soft:#3A2619; --on-accent:#1A1815;
  --done:#8EBB89; --done-soft:#24301F; --warn:#EC8073; --warn-soft:#3A201C;
  --p:#8FA7D6; --f:#D9AE57; --c:#D98EA3;
  --note-bg:#2D271D; --note-ink:#E3D3B5;
  --t-honey-bg:#352C17; --t-honey:#E3C276;
  --t-sage-bg:#253021;  --t-sage:#A9C891;
  --t-rose-bg:#352226;  --t-rose:#E3A3B3;
  --t-plum-bg:#2C2738;  --t-plum:#C0B1E6;
  --t-sky-bg:#1F2C34;   --t-sky:#9CC1DA;
  --t-gray-bg:#2E2A25;  --t-gray:#CAC2B8;
  --shadow-pop:0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  --scrim:rgba(0,0,0,.5);
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#1A1815; --surface:#22201C; --surface-2:#2A2723; --surface-3:#36322C;
  --line:#2F2B26; --line-2:#433D36;
  --ink:#EEE9E2; --ink-2:#CAC2B8; --muted:#9C948A; --faint:#6E675F;
  --accent:#E08A62; --accent-ink:#EFA482; --accent-soft:#3A2619; --on-accent:#1A1815;
  --done:#8EBB89; --done-soft:#24301F; --warn:#EC8073; --warn-soft:#3A201C;
  --p:#8FA7D6; --f:#D9AE57; --c:#D98EA3;
  --note-bg:#2D271D; --note-ink:#E3D3B5;
  --t-honey-bg:#352C17; --t-honey:#E3C276;
  --t-sage-bg:#253021;  --t-sage:#A9C891;
  --t-rose-bg:#352226;  --t-rose:#E3A3B3;
  --t-plum-bg:#2C2738;  --t-plum:#C0B1E6;
  --t-sky-bg:#1F2C34;   --t-sky:#9CC1DA;
  --t-gray-bg:#2E2A25;  --t-gray:#CAC2B8;
  --shadow-pop:0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  --scrim:rgba(0,0,0,.5);
  color-scheme:dark;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0; background:var(--bg); color:var(--ink); font:400 15px/1.45 var(--sans); font-feature-settings:"tnum" 1;
  min-height:100dvh; -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent}
::selection{background:var(--accent-soft)}
button,input,select,textarea{font:inherit; color:inherit}
button{cursor:pointer}
a{color:var(--accent-ink)}
svg{flex:none}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:6px}
[hidden]{display:none !important}
.sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}

h1,h2,h3{margin:0; font-weight:600}
h2{font-size:18px; line-height:1.3}
h3{font-size:15px}
.h1{font:600 26px/1.15 var(--serif); letter-spacing:-.005em; margin:0}
.muted{color:var(--muted)}
.small{font-size:13px}
.cap{font-size:12px; line-height:1.4; color:var(--muted); margin:8px 2px 0}
.caption{font-size:12px; line-height:1.4; color:var(--muted); margin:0 0 4px}
.sec-h{display:flex; align-items:baseline; gap:6px; margin:18px 0 2px; font-size:13px; line-height:1.4; font-weight:600; color:var(--ink-2)}
.sec-h span{font-weight:400; color:var(--faint)}
.sheet .sec-h{font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin:18px 0 4px}
.row{display:flex; align-items:center; gap:8px}
.spacer{flex:1}
.stack > * + *{margin-top:12px}
.mt-8{margin-top:8px} .mt-12{margin-top:12px} .mt-16{margin-top:16px}

/* ── Каркас ── */
.app{max-width:640px; margin:0 auto; padding:0 16px calc(var(--nav-h) + var(--safe-b) + 24px)}
.top{position:sticky; top:0; z-index:20; margin:0 -16px; padding:0 16px; background:color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px)}
.top-row{display:flex; align-items:center; gap:8px; height:var(--top-h)}
.brand{display:flex; align-items:center; gap:7px; margin-right:auto; font-size:15px; font-weight:600; color:var(--ink); text-decoration:none; min-width:0}
.brand svg{width:22px; height:22px}
@media (max-width:420px){ .brand.has-sel span{display:none} }
.ava{width:30px; height:30px; border-radius:50%; border:0; padding:0; background:var(--accent-soft); color:var(--accent-ink);
  display:grid; place-items:center; font-size:13px; font-weight:600; flex:none}
.client-sel{position:relative; display:flex; align-items:center; gap:6px; height:32px; padding:0 8px 0 3px; border-radius:8px; min-width:0;
  font-size:14px; font-weight:500; color:var(--ink); cursor:pointer}
.client-sel:active, .client-sel:focus-within{background:var(--surface-2)}
.client-sel .ava{width:26px; height:26px; font-size:12px}
.client-sel .nm{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:46vw}
.client-sel > svg{width:14px; height:14px; color:var(--muted)}
.client-sel select{position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; font-size:16px}

/* ── Кнопки ── */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; height:40px; padding:0 14px; border-radius:10px;
  border:1px solid var(--line-2); background:var(--surface); font-size:15px; font-weight:500; line-height:1.2; color:var(--ink); text-decoration:none; white-space:nowrap}
.btn svg{width:18px; height:18px}
.btn:active{background:var(--surface-2)}
.btn.primary{background:var(--accent); border-color:var(--accent); color:var(--on-accent)}
.btn.primary:active{filter:brightness(.94)}
.btn.ghost{background:transparent; border-color:transparent; color:var(--ink-2)}
.btn.ghost:active{background:var(--surface-2)}
.btn.danger{color:var(--warn); border-color:color-mix(in srgb, var(--warn) 30%, var(--line))}
.btn.ghost.danger{border-color:transparent}
.btn.sm{height:32px; padding:0 10px; font-size:14px; border-radius:8px}
.btn.sm svg{width:16px; height:16px}
.btn.block{width:100%}
.btn:disabled{opacity:.45; cursor:default}
.ib{width:32px; height:32px; border-radius:8px; border:0; background:transparent; padding:0; display:grid; place-items:center; color:var(--ink-2); flex:none}
.ib svg{width:18px; height:18px}
.ib:active{background:var(--surface-2)}
.ib:disabled{opacity:.45; cursor:default}

/* ── Поля ── */
.field{display:flex; flex-direction:column; gap:4px; font-size:12px; font-weight:500; color:var(--muted); min-width:0}
.input, .field input, .field select, .field textarea{width:100%; height:40px; border:1px solid var(--line-2); background:var(--surface);
  border-radius:8px; padding:8px 11px; font-size:16px; font-weight:400; line-height:1.3; color:var(--ink); outline:0}
.input::placeholder, .field input::placeholder, .field textarea::placeholder, .composer textarea::placeholder{color:var(--faint)}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus{border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent)}
.input:user-invalid, .field input:user-invalid, .field textarea:user-invalid{border-color:var(--warn)}
.field textarea, textarea.input{height:auto; min-height:72px; line-height:1.5; resize:vertical}
.field textarea.tall{min-height:120px}
.check-l{display:flex; align-items:center; gap:8px; font-size:14px; color:var(--ink); cursor:pointer}
.check-l input, .cb{appearance:none; -webkit-appearance:none; width:18px; height:18px; margin:0; border-radius:5px; border:1.5px solid var(--line-2);
  background:var(--surface); display:grid; place-items:center; flex:none; cursor:pointer}
.check-l input:checked, .cb:checked{background:var(--done); border-color:var(--done)}
.check-l input:checked::after, .cb:checked::after{content:""; width:8px; height:4px; border:2px solid var(--surface); border-top:0; border-right:0; transform:translateY(-1px) rotate(-45deg)}
.check-l input:focus-visible, .cb:focus-visible{outline:0; box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent)}
.grid2{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px}
.grid4{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px}
input{min-width:0}
.err{color:var(--warn); font-size:13px; min-height:18px}
.err:empty{min-height:0}
.search{position:relative}
.search > svg{position:absolute; left:11px; top:12px; width:16px; height:16px; color:var(--muted); pointer-events:none}
.search > input{padding-left:34px}

/* ── Чипы и переключатели ── */
.chips{display:flex; gap:6px; overflow-x:auto; scrollbar-width:none; margin:0 -16px; padding:0 16px}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none; height:30px; padding:0 12px; border-radius:8px; border:1px solid var(--line); background:var(--surface);
  font-size:13.5px; font-weight:500; color:var(--ink-2); white-space:nowrap}
.chip[aria-pressed="true"]{background:var(--accent-soft); border-color:color-mix(in srgb, var(--accent) 35%, transparent); color:var(--accent-ink)}
.seg{display:inline-flex; background:var(--surface-2); border-radius:9px; padding:2px; max-width:100%}
.seg button{height:30px; border:0; background:transparent; border-radius:7px; padding:0 12px; font-size:13.5px; font-weight:500; color:var(--ink-2); white-space:nowrap}
.seg button[aria-pressed="true"]{background:var(--surface); color:var(--ink); box-shadow:0 1px 2px rgba(0,0,0,.08)}
.seg.full{display:flex; width:100%}
.seg.full button{flex:1; padding:0 6px; min-width:0; overflow:hidden; text-overflow:ellipsis}

/* ── Навигация ── */
.nav{position:fixed; left:0; right:0; bottom:0; z-index:30; display:flex; justify-content:center; padding-bottom:var(--safe-b);
  background:color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border-top:1px solid var(--line)}
.nav-in{display:flex; width:100%; max-width:640px}
.nav a{flex:1; height:var(--nav-h); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; position:relative;
  text-decoration:none; color:var(--muted); font-size:11px; line-height:1.2; font-weight:500}
.nav .ic{width:52px; height:28px; border-radius:14px; display:grid; place-items:center}
.nav .ic svg{width:22px; height:22px}
.nav a[aria-current="page"]{color:var(--ink)}
.nav a[aria-current="page"] .ic{background:var(--accent-soft); color:var(--accent-ink)}
.nav .badge{position:absolute; top:4px; left:calc(50% + 6px); min-width:16px; height:16px; border-radius:8px; padding:0 4px;
  background:var(--accent); color:var(--on-accent); font-size:10px; font-weight:600; display:grid; place-items:center}
@media (min-width:1000px){
  .nav{top:0; bottom:0; right:auto; width:88px; border-top:0; border-right:1px solid var(--line); flex-direction:column; justify-content:flex-start; padding:64px 0 0}
  .nav-in{flex-direction:column}
  .nav a{flex:none; height:auto; padding:12px 4px}
  .app{padding-bottom:40px}
}

/* ── Неделя ── */
.week{display:grid; grid-template-columns:24px repeat(7,1fr) 24px; align-items:center; gap:2px; margin:0 -16px; padding:2px 10px 8px; border-bottom:1px solid var(--line)}
.week .arr{height:44px; border:0; background:none; padding:0; color:var(--faint); display:grid; place-items:center}
.week .arr svg{width:16px; height:16px}
.week .d{height:50px; border:0; background:none; padding:0; border-radius:10px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; min-width:0}
.d .w{font-size:11px; line-height:1.2; color:var(--muted)}
.d .n{font-size:15px; line-height:1.25; font-weight:600; color:var(--ink-2)}
.d .pg{width:18px; height:2px; border-radius:1px; background:var(--surface-3); margin-top:3px; overflow:hidden}
.d .pg i{display:block; height:100%; background:var(--done)}
.d.today .n{color:var(--accent)}
.d[aria-pressed="true"]{background:var(--surface); box-shadow:inset 0 0 0 1px var(--line-2)}
.d[aria-pressed="true"] .n{color:var(--ink)}
.d[aria-pressed="true"].today .n{color:var(--accent)}
.d.empty .n{color:var(--faint)}
.d.empty .pg{visibility:hidden}

/* ── Заголовок страницы ── */
.head{display:flex; align-items:baseline; gap:8px; margin:8px 0 12px; min-width:0}
.head.wk-on{margin-top:18px}
.head .sub{font-size:14px; color:var(--muted); min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.head .ib, .head .btn{margin-left:auto; align-self:center}

/* ── Сводка дня ── */
.sum{background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 14px}
.sum .kc{display:flex; align-items:baseline; gap:6px; flex-wrap:wrap}
.sum .kc b{font-size:20px; line-height:1.2; font-weight:600; letter-spacing:-.01em}
.sum .kc span{font-size:13px; color:var(--muted)}
.sum .kc .r{margin-left:auto}
.track{height:6px; border-radius:3px; background:var(--surface-3); margin-top:8px; position:relative; overflow:hidden}
.track > i{position:absolute; inset:0 auto 0 0; border-radius:3px; background:var(--done); transition:width .5s cubic-bezier(.2,.8,.2,1)}
.track > i.plan{background:color-mix(in srgb, var(--done) 22%, transparent)}
.macs{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:10px}
.mac{font-size:12px; line-height:1.3; color:var(--muted)}
.mac .r1{display:flex; justify-content:space-between; gap:4px; white-space:nowrap}
.mac .r1 b{font-weight:500; color:var(--ink-2)}
.mac .l{height:3px; border-radius:2px; background:var(--surface-3); margin-top:5px; overflow:hidden}
.mac .l i{display:block; height:100%; border-radius:2px; transition:width .5s cubic-bezier(.2,.8,.2,1)}
.mac.p .l i{background:var(--p)} .mac.f .l i{background:var(--f)} .mac.c .l i{background:var(--c)}
@media (max-width:360px){ .macs{gap:10px} .mac .r1{flex-direction:column; gap:0} }
@media (prefers-reduced-motion:reduce){ .track > i, .mac .l i{transition:none !important} }

/* ── Лента дня ── */
.list{display:flex; flex-direction:column; gap:8px; margin-top:16px}
.meal{background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:10px 12px 10px 10px}
.meal.now{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}
.meal.done{cursor:pointer}
.mh{display:flex; align-items:center; gap:8px; min-height:28px; min-width:0}
.ck{position:relative; width:28px; height:28px; border:0; background:none; padding:0; margin:-2px 0; display:grid; place-items:center; flex:none}
.ck::before{content:""; position:absolute; inset:-8px}
.ck i{width:20px; height:20px; border-radius:50%; border:1.5px solid var(--line-2); background:var(--surface); display:grid; place-items:center}
.ck[aria-pressed="true"] i{background:var(--done); border-color:var(--done)}
.ck[aria-pressed="true"] i::after{content:""; width:9px; height:5px; border:2px solid var(--surface); border-top:0; border-right:0; transform:translateY(-1px) rotate(-45deg)}
.now .ck i{border-color:var(--accent)}
.time{width:38px; flex:none; font-size:13px; color:var(--muted)}
.tag{display:inline-flex; align-items:center; height:22px; padding:0 8px; border-radius:6px; font-size:13px; font-weight:500;
  background:var(--t-gray-bg); color:var(--t-gray); white-space:nowrap; min-width:0; overflow:hidden; text-overflow:ellipsis}
.tag.honey{background:var(--t-honey-bg); color:var(--t-honey)}
.tag.sage{background:var(--t-sage-bg); color:var(--t-sage)}
.tag.rose{background:var(--t-rose-bg); color:var(--t-rose)}
.tag.plum{background:var(--t-plum-bg); color:var(--t-plum)}
.tag.sky{background:var(--t-sky-bg); color:var(--t-sky)}
.tag.mini{height:18px; padding:0 6px; border-radius:5px; font-size:11px; flex:none}
.tag.off{background:var(--warn-soft); color:var(--warn)}
.mh .k{margin-left:auto; font-size:13px; color:var(--muted); white-space:nowrap}
.mh .ib{width:28px; height:28px; margin:-4px -4px -4px 0; color:var(--faint)}
.mh .ib svg{width:16px; height:16px}
.meal.done .tag:not(.off){opacity:.75}
.items{list-style:none; margin:6px 0 0 36px; padding:0}
.items li{display:flex; align-items:baseline; gap:12px; padding:3px 0; font-size:14.5px; line-height:1.38}
.items .nm{flex:1; min-width:0; border:0; background:none; padding:0; text-align:left; color:var(--ink); line-height:inherit; font-size:inherit}
.items button.nm{cursor:pointer; border-radius:6px; margin:0 -6px; padding:0 6px}
.items button.nm:active{background:var(--surface-2)}
.items span.nm{cursor:default}
.items .nm small{margin-left:4px; font-size:12px; color:var(--muted)}
.items .g{font-size:13px; color:var(--muted); white-space:nowrap}
.note{margin:8px 0 0 36px; padding:7px 10px; border-radius:8px; background:var(--note-bg); color:var(--note-ink);
  font-size:13.5px; line-height:1.45; display:flex; gap:7px; white-space:pre-wrap}
.note > svg{width:14px; height:14px; flex:none; margin-top:3px; opacity:.7}
.foot{margin:6px 0 0 36px; font-size:12px; color:var(--muted); white-space:nowrap}
.collapsed{margin:2px 0 0 36px; font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.meal:not(.done) .collapsed, .meal.done.open .collapsed{display:none}
.meal.done:not(.open) :is(.items, .note, .foot){display:none}
.wk{display:flex; align-items:center; gap:8px; padding:8px 12px 8px 10px; border:1px dashed var(--line-2); border-radius:12px; flex-wrap:wrap}
.wk .ico{display:grid; flex:none}
.wk .ico svg{width:18px; height:18px; color:var(--t-sky)}

.wk b{font-size:14.5px; font-weight:500; color:var(--ink); min-width:0; flex:0 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.wk.done b{color:var(--muted)}
.wk .k{margin-left:auto; font-size:13px; color:var(--muted); white-space:nowrap}
.wk .ib{width:28px; height:28px; margin:-4px -4px -4px 0; color:var(--faint)}
.wk .ib svg{width:16px; height:16px}
.wk .note{flex-basis:100%; margin:2px 0 0 36px}
.callout{display:flex; gap:10px; padding:10px 12px; border-radius:12px; background:var(--accent-soft); font-size:14px; line-height:1.5; color:var(--ink)}
.callout .av{flex:none; width:22px; height:22px; border-radius:50%; background:var(--accent); color:var(--on-accent); font-size:11px; font-weight:600; display:grid; place-items:center; margin-top:1px}
.callout .tx{flex:1; min-width:0; white-space:pre-wrap}
.callout small{display:block; font-size:12px; color:var(--muted); margin-top:2px}
.callout .ib{width:28px; height:28px; margin:-4px -6px 0 0; color:var(--faint)}
.callout .ib svg{width:16px; height:16px}
.adds{display:flex; flex-wrap:wrap; margin-top:10px}
.adds .btn{color:var(--muted); padding:0 8px; gap:4px; font-size:13.5px}
.adds .btn svg{width:15px; height:15px}
@media (max-width:400px){ .adds .btn{padding:0 7px; font-size:13px} }
.adds .btn:first-child{margin-left:-8px}

/* ── Пустые состояния ── */
.empty{text-align:center; padding:40px 24px; color:var(--muted)}
.empty > svg{width:40px; height:40px; opacity:.9; margin:0 auto; display:block}
.empty h2{font-size:17px; color:var(--ink); margin:12px 0 4px}
.empty p{font-size:14px; max-width:300px; margin:0 auto}
.empty .acts{display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:14px}

/* ── Покупки ── */
.prog{display:flex; align-items:center; gap:10px; margin:12px 0 4px; font-size:13px; color:var(--muted)}
.prog .track{flex:1; margin:0; height:4px}
.prog .btn{height:28px; font-size:13px; padding:0 8px; margin-right:-8px}
.todo{list-style:none; margin:0; padding:0}
.todo li{border-bottom:1px solid var(--line)}
.todo li:last-child{border-bottom:0}
.todo label{display:flex; align-items:flex-start; gap:10px; padding:8px 0; cursor:pointer}
.todo .cb{margin-top:2px}
.todo .n{flex:1; min-width:0}
.todo .n b{display:block; font-size:15px; font-weight:400; line-height:1.35; color:var(--ink)}
.todo .n small{display:block; font-size:12px; line-height:1.4; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.todo .q{font-size:13px; color:var(--ink-2); white-space:nowrap; margin-top:1px}
.todo li.got .n b{color:var(--faint); text-decoration:line-through; text-decoration-color:var(--faint)}
.todo li.got .q{color:var(--faint)}
.cook details{border-bottom:1px solid var(--line)}
.cook details:last-child{border-bottom:0}
.cook summary{list-style:none; display:flex; align-items:baseline; gap:10px; padding:10px 0; cursor:pointer}
.cook summary::-webkit-details-marker{display:none}
.cook summary b{flex:1; min-width:0; font-size:15px; font-weight:500}
.cook summary small{font-size:12px; color:var(--muted); white-space:nowrap}
.cook summary > svg{width:14px; height:14px; color:var(--faint); align-self:center; transition:transform .15s}
.cook details[open] summary > svg{transform:rotate(90deg)}
.cook .in{padding:0 0 12px}
.cook .in .cap{margin:0 0 4px}

/* ── Шторка ── */
.sheet-wrap{position:fixed; inset:0; z-index:50; display:flex; align-items:flex-end; justify-content:center}
.sheet-bg{position:absolute; inset:0; background:var(--scrim)}
.sheet{position:relative; width:100%; max-width:640px; max-height:92dvh; overflow:auto; overscroll-behavior:contain; background:var(--surface);
  border-radius:16px 16px 0 0; box-shadow:var(--shadow-pop); padding:6px 16px calc(20px + var(--safe-b)); animation:up .26s cubic-bezier(.2,.8,.2,1)}
@media (min-width:700px){ .sheet-wrap{align-items:center} .sheet{border-radius:16px; max-width:560px; max-height:86dvh} }
@keyframes up{from{transform:translateY(40px); opacity:.4}}
@media (prefers-reduced-motion:reduce){ .sheet{animation:none} }
.sheet .grab{width:36px; height:4px; border-radius:2px; background:var(--surface-3); margin:0 auto 6px}
.sheet-h{position:sticky; top:-6px; z-index:3; display:flex; align-items:flex-start; gap:8px; background:var(--surface); padding:6px 0 10px}
.sheet-h h2{flex:1; min-width:0; font-size:18px; line-height:1.3; outline:0}
.sheet-h .ib{margin:-3px -6px 0 0}
.sheet:has(.sheet-f){padding-bottom:0}
.sheet-f{position:sticky; bottom:0; z-index:3; display:flex; gap:8px; align-items:center; margin:16px -16px 0;
  padding:10px 16px calc(10px + var(--safe-b)); background:var(--surface); border-top:1px solid var(--line)}
.sheet-f .btn.primary{margin-left:auto}
.sheet .err{margin-top:10px}
.sheet-sub{margin:-4px 0 0}
.tiles{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:12px; overflow:hidden}
.tile{padding:10px 6px; text-align:center; border-left:1px solid var(--line); min-width:0}
.tile:first-child{border-left:0}
.tile b{display:block; font-size:17px; line-height:1.3; font-weight:600}
.tile span{font-size:11.5px; color:var(--muted)}
.tile.p b{color:var(--p)} .tile.f b{color:var(--f)} .tile.c b{color:var(--c)}
.ing{list-style:none; padding:0; margin:4px 0 0}
.ing li{display:flex; gap:10px; padding:7px 0; border-top:1px solid var(--line); font-size:14.5px; line-height:1.38}
.ing li:first-child{border-top:0}
.ing li span:first-child{flex:1; min-width:0}
.ing li span:last-child{font-size:13px; color:var(--ink-2); white-space:nowrap}
.steps{font-size:15px; line-height:1.6; color:var(--ink)}
.steps p{margin:0 0 8px}

/* Редактор позиций */
.ed-items{margin-top:4px}
.ed-item{display:grid; grid-template-columns:minmax(0,1fr) 72px 28px; gap:8px; align-items:center; padding:6px 0; border-top:1px solid var(--line)}
.ed-item:first-child{border-top:0}
.ed-item.wk-i{grid-template-columns:minmax(0,1fr) 84px 28px}
.ed-item .nm{font-size:14.5px; line-height:1.3; min-width:0}
.ed-item .nm small{display:block; font-size:12px; color:var(--muted)}
.ed-item .gi{position:relative}
.ed-item .gi input{height:34px; text-align:right; padding:6px 22px 6px 8px}
.ed-item .gi span{position:absolute; right:9px; top:50%; transform:translateY(-38%); font-size:14px; color:var(--muted); pointer-events:none}
.ed-item.wk-i .gi input{padding-right:34px}
.ed-item > .input{height:34px}
.ed-item .ib{width:28px; height:28px; color:var(--faint)}
.ed-item .ib svg{width:16px; height:16px}
.sugg{position:absolute; left:0; right:0; top:100%; z-index:5; margin-top:4px; background:var(--surface); border:1px solid var(--line); border-radius:10px;
  box-shadow:var(--shadow-pop); max-height:280px; overflow:auto}
.sugg button{display:flex; align-items:center; width:100%; min-height:40px; gap:10px; text-align:left; border:0; background:none; padding:8px 12px; font-size:14.5px}
.sugg button.hl{background:var(--surface-2)}
.sugg button span{flex:1; min-width:0}
.sugg button small{font-size:12px; color:var(--muted); white-space:nowrap}
.opts{display:flex; flex-direction:column; gap:8px}
.opts .btn{height:44px; justify-content:flex-start; white-space:normal; text-align:left}
.psec{border-top:1px solid var(--line); margin-top:14px; padding-top:14px}
.psec > .sec-h:first-child{margin-top:0}
.psec.row > .btn.ghost:first-child{margin-left:-10px}
.psec.row > .btn.ghost:last-child{margin-right:-10px}

/* ── Прогресс ── */
.stats{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); background:var(--surface); border:1px solid var(--line); border-radius:12px}
.stat{padding:10px 12px; border-left:1px solid var(--line); min-width:0}
.stat:first-child{border-left:0}
.stat b{display:block; font-size:20px; line-height:1.2; font-weight:600}
.stat span{display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:12px; line-height:1.35; color:var(--muted)}
.sec-h.big{margin-top:24px; margin-bottom:8px}
.chart{position:relative; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 8px 6px}
.chart svg{display:block; width:100%; height:auto; overflow:visible}
.chart .axis{fill:var(--muted); font-size:11px}
.chart .grid{stroke:var(--line); stroke-width:1}
.chart .lineW{fill:none; stroke:var(--accent); stroke-width:2; stroke-linejoin:round; stroke-linecap:round}
.chart .dotW{fill:var(--accent); stroke:var(--surface); stroke-width:2}
.chart .bPlan{fill:var(--surface-3)}
.chart .bEat{fill:var(--done)}
.chart .hl{stroke:var(--muted); stroke-width:1; stroke-dasharray:3 3}
.legend{display:flex; gap:14px; font-size:12px; color:var(--ink-2); padding:0 6px 6px}
.legend i{display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:6px; vertical-align:-1px}
.tip{position:absolute; pointer-events:none; background:var(--ink); color:var(--bg); font-size:12px; padding:5px 9px; border-radius:8px; white-space:nowrap;
  transform:translate(-50%, -100%); z-index:3}
.more-t{margin-top:8px}
.more-t summary{font-size:13px; color:var(--muted); cursor:pointer; padding:4px 0}
.tbl-w{position:relative; overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:var(--surface)}
.more-t .tbl-w{margin-top:6px}
.table{width:100%; border-collapse:collapse; font-size:13px}
.table th, .table td{padding:8px 10px; text-align:right; border-top:1px solid var(--line); white-space:nowrap}
.table th{font-size:11px; font-weight:500; color:var(--muted); border-top:0}
.table th:first-child, .table td:first-child{text-align:left}
.table td:first-child{min-width:84px; white-space:normal}
.table td:last-child{padding:2px 4px}
.table .ib{width:28px; height:28px; color:var(--faint); margin-left:auto}
.table .ib svg{width:16px; height:16px}

/* ── Чат ── */
.chat{display:flex; flex-direction:column; gap:6px; margin-top:12px}
.msg{max-width:82%; padding:8px 12px; border-radius:14px; background:var(--surface); border:1px solid var(--line); white-space:pre-wrap;
  font-size:15px; line-height:1.45; border-bottom-left-radius:4px; overflow-wrap:anywhere}
.msg.me{align-self:flex-end; background:var(--accent-soft); border-color:transparent; color:var(--ink); border-bottom-left-radius:14px; border-bottom-right-radius:4px}
.msg small{display:block; text-align:right; font-size:11px; color:var(--muted); margin-top:2px}
.chat-day{align-self:center; font-size:12px; color:var(--muted); margin:10px 0 2px}
.composer{position:sticky; bottom:calc(var(--nav-h) + var(--safe-b)); display:flex; align-items:flex-end; gap:8px; margin-top:12px; background:var(--bg); padding:8px 0}
@media (min-width:1000px){ .composer{bottom:0} }
.composer textarea{flex:1; height:40px; min-height:40px; max-height:140px; resize:none; border:1px solid var(--line-2); border-radius:20px; padding:9px 14px;
  background:var(--surface); font-size:16px; line-height:1.3; outline:0; scrollbar-width:none}
.composer textarea::-webkit-scrollbar{display:none}
.composer textarea:focus{border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent)}
.send{width:40px; height:40px; border-radius:50%; border:0; background:var(--accent); color:var(--on-accent); display:grid; place-items:center; flex:none}
.send svg{width:18px; height:18px}
.send:active{filter:brightness(.94)}

/* ── Блюда ── */
.filters{display:flex; flex-direction:column; align-items:flex-start; gap:10px}
.filters .search{width:100%}
.food-list{list-style:none; padding:0; margin:8px 0 0}
.food-list li{border-bottom:1px solid var(--line)}
.food-list li:last-child{border-bottom:0}
.food-list button{display:flex; width:100%; gap:10px; align-items:baseline; text-align:left; border:0; background:none; padding:10px 0}
.food-list button:active{background:var(--surface-2)}
.food-list .fn{flex:1; min-width:0; font-size:15px; color:var(--ink)}
.food-list .fn .tag{margin-left:6px; vertical-align:2px; background:var(--t-honey-bg); color:var(--t-honey)}
.food-list small{font-size:13px; color:var(--muted); white-space:nowrap}

/* ── Вход ── */
.login{min-height:100dvh; display:grid; place-items:center; padding:24px 16px; background:var(--bg)}
.login form{width:100%; max-width:340px; display:flex; flex-direction:column; gap:12px}
.login .app-ic{width:56px; height:56px; border-radius:14px; border:1px solid var(--line); display:block}
.login .h1{font-size:30px; margin-top:4px}
.login .sub{font-size:14px; color:var(--muted); margin:-6px 0 4px}
.login .field input{height:44px}
.login .btn{height:44px; width:100%}

/* Наведение — только там, где есть мышь (на телефоне :hover «залипает» после тапа) */
@media (hover:hover){
  .client-sel:hover, .btn.ghost:hover, .ib:hover, .items button.nm:hover, .sugg button:hover, .food-list button:hover{background:var(--surface-2)}
  .btn:not(.primary):not(.ghost):hover{background:var(--surface-2)}
}

/* ── Тост, офлайн, загрузка ── */
.toast{position:fixed; left:50%; bottom:calc(var(--nav-h) + var(--safe-b) + 12px); z-index:60; display:flex; align-items:center; gap:8px;
  background:var(--ink); color:var(--bg); padding:9px 14px; border-radius:10px; font-size:14px; font-weight:500; box-shadow:var(--shadow-pop);
  max-width:calc(100vw - 32px); transform:translateX(-50%); animation:toast .18s ease-out}
.toast.ok::before{content:""; width:6px; height:6px; border-radius:50%; background:var(--done); flex:none}
@keyframes toast{from{transform:translate(-50%, 8px); opacity:0}}
@media (prefers-reduced-motion:reduce){ .toast{animation:none} }
@media (min-width:1000px){ .toast{bottom:24px} }
.loading{opacity:.55; transition:opacity .2s}
.offline{background:var(--warn-soft); color:var(--warn); font-size:12px; text-align:center; padding:6px; border-radius:8px; margin-top:8px}
