/* Water in «Питание» (owner 28.09, WATER-BRIEF.md): the diary row that opens the sheet «Вода», the sheet itself and the
   target in «Нормы». Its own file so s-food.css stays untouched while another round edits it. Kit tokens only; the sheet's
   controls are drawn for the tinted ground and the kit flips them on paper (SURFACES.md). */

/* ---------- the row: one button over the whole row, «＋» above it at the right ---------- */
#ph.xfd .fdw-open{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;gap:6px;color:var(--ink);-webkit-tap-highlight-color:transparent}
#ph.xfd .fdw-open:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
#ph.xfd .fdw-open:active{background:color-mix(in srgb,var(--ink) 5%,transparent)}
#ph.xfd .fdw-h{display:flex;align-items:center;gap:8px;min-height:24px}
#ph.xfd .fdw-h b{flex:1;min-width:0;display:flex;align-items:center;gap:6px;font-size:16px;font-weight:600}
#ph.xfd .fdw-h b i{color:var(--info-ink)}
#ph.xfd .fdw-h .v{font:500 15px/1.2 var(--font);color:var(--ink-2);white-space:nowrap}
#ph.xfd .fdw-h>svg{width:18px;height:18px;flex:none;color:var(--ink-3);margin:0 -4px 0 -4px}
#ph.xfd .fdw-bar{display:block;height:10px;border-radius:999px;background:var(--track);overflow:hidden}
#ph.xfd .fdw-bar i{display:block;height:100%;border-radius:inherit;background:var(--info-ink);transition:width var(--t) var(--ease)}
#ph.xfd .fdw-plus{touch-action:manipulation}
#ph.xfd .fdw-plus svg{width:18px;height:18px}
#ph.xfd .fdw-plus:focus-visible{outline:2px solid var(--focus);outline-offset:2px}

/* variant А: the plate is the row; the bar shares its line with «＋250 мл» */
#ph.xfd .fdw-w{position:relative}
#ph.xfd .fdw-w .fdw-open{margin:-14px;padding:14px;border-radius:var(--r-plate)}
#ph.xfd .fdw-w .fdw-bar{margin:17px 120px 17px 0}
#ph.xfd .fdw-w .fdw-plus{position:absolute;right:14px;bottom:14px;width:110px;gap:4px;padding:0 10px}

/* variant Б: the last row of «Сводка дня»; «＋» is the round one the row had */
#ph.xfd .fdw-b{position:relative;border-top:1px solid var(--line)}
#ph.xfd .fdw-b .fdw-open{width:calc(100% + 28px);margin:0 -14px;padding:0 14px 6px}
#ph.xfd .fdw-b .fdw-h{min-height:52px;padding:4px 52px 0 0}
#ph.xfd .fdw-b .fdw-h .v{font:600 16px/1 var(--font);color:var(--ink)}
#ph.xfd .fdw-plus.b{position:absolute;top:4px;right:0;width:44px;height:44px;border-radius:50%;border:0;padding:0;background:var(--surface-2);color:var(--ink);display:grid;place-items:center;cursor:pointer}
#ph.xfd .fdw-plus.b:active{background:var(--surface-3)}

/* ---------- the sheet «Вода» ---------- */
/* the sheet scrolls once the log is long: its parts keep their height instead of shrinking (the bar went to 0) */
#ph.xfd .sheet-in>:is(.fdw-tot,.fdw-bar,.fdw-ok,.fdw-por,.fdw-own,.fdw-lh,.fdw-emp,.fdw-log){flex:none}
#ph.xfd .fdw-tot{display:flex;align-items:baseline;gap:8px;margin-top:2px}
#ph.xfd .fdw-tot b{font:700 32px/1 var(--font-d);letter-spacing:-.02em}
#ph.xfd .fdw-tot b small{font:600 18px var(--font);color:var(--ink-2);letter-spacing:0}
#ph.xfd .fdw-tot .of{flex:1;min-width:0;font-size:16px;color:var(--ink-2)}
#ph.xfd .fdw-tot .fd-lnk{margin:-12px 0;align-self:center}
#ph.xfd .fdw-bar.lg{height:12px;margin-top:-2px}
#ph.xfd .fdw-ok{margin:-2px 0 0;display:flex;align-items:center;gap:6px;font-size:15px;font-weight:600;color:var(--ok)}
/* portions in everyday units: tap adds, nothing stays selected */
#ph.xfd .fdw-por{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
#ph.xfd .fdw-pb{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:92px;padding:12px 6px;border-radius:16px;
  background:var(--surface-1);box-shadow:var(--sh-1);color:var(--ink);text-align:center;transition:transform var(--t-fast,.12s) var(--ease)}
#ph.xfd .fdw-pb i{color:var(--info-ink)}
#ph.xfd .fdw-pb i svg{width:26px;height:26px}
#ph.xfd .fdw-pb b{font-size:16px;font-weight:600}
#ph.xfd .fdw-pb span{font-size:14px;color:var(--ink-2)}
#ph.xfd .fdw-pb:active{transform:scale(.97)}
#ph.xfd .fdw-pb:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
/* own volume: − [ 300 мл ] +, the field takes the row; the add button under it */
#ph.xfd .fdw-own{display:flex;flex-direction:column;gap:10px;margin-top:-4px}
#ph.xfd .fdw-step .fd-numw.v{flex:1;min-width:0}
#ph.xfd .fdw-step .fd-num{width:100%;min-height:48px}
#ph.xfd .fdw-step .s:disabled{opacity:.35;cursor:default}
#ph.xfd .fdw-add{flex:none;width:100%}
/* the day's log, newest first */
#ph.xfd .fdw-lh{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-top:4px}
#ph.xfd .fdw-lh span{font:500 14px/1.2 var(--font);letter-spacing:0;text-transform:none;color:var(--ink-3)}
#ph.xfd .fdw-emp{margin:0;padding:20px 8px;text-align:center;font-size:16px;line-height:1.4;color:var(--ink-2)}
#ph.xfd .plate.fdw-log{gap:0;padding:2px 4px 2px 12px}
#ph.xfd .fdw-r{display:flex;align-items:center;gap:2px;border-top:1px solid var(--line)}
#ph.xfd .fdw-r:first-child{border-top:0}
#ph.xfd .fdw-rb{all:unset;box-sizing:border-box;cursor:pointer;flex:1;min-width:0;display:flex;align-items:center;gap:12px;min-height:58px;padding:7px 0;color:var(--ink);border-radius:10px}
#ph.xfd .fdw-rb:focus-visible,#ph.xfd .fdw-del:focus-visible{outline:2px solid var(--focus);outline-offset:1px}
#ph.xfd .fdw-r .ic{width:38px;height:38px;border-radius:12px;background:var(--surface-2);box-shadow:var(--sh-1);display:grid;place-items:center;flex:none;color:var(--info-ink)}
#ph.xfd .fdw-r .ic svg{width:20px;height:20px}
#ph.xfd .fdw-r .tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
#ph.xfd .fdw-r .tx b{font-size:16px;font-weight:600}
#ph.xfd .fdw-r .tx span{font-size:14px;color:var(--ink-2)}
#ph.xfd .fdw-r .t{font:500 15px/1 var(--font);color:var(--ink-2)}
#ph.xfd .fdw-del{color:var(--ink-3)}
#ph.xfd .fdw-del svg{width:19px;height:19px}
/* an entry being corrected opens in place: its own stepper, «Отмена» and «Сохранить N мл» */
#ph.xfd .fdw-r.ed{flex-direction:column;align-items:stretch;gap:10px;padding:12px 8px 12px 0}
#ph.xfd .fdw-eh{display:flex;align-items:center;gap:12px}
#ph.xfd .fdw-eh b{flex:1;min-width:0;font-size:16px;font-weight:600}
#ph.xfd .fdw-eh .was{font-size:14px;color:var(--ink-3)}
#ph.xfd .fdw-ea{display:flex;gap:8px}
#ph.xfd .fdw-ea .btn{flex:1 1 0;min-height:48px}
#ph.xfd .fdw-ea .btn:disabled{opacity:.45;cursor:default}

/* ---------- «Нормы»: the water target ---------- */
#ph.xfd .fdw-goal .fd-num{width:84px}

@media (prefers-reduced-motion:reduce){#ph.xfd .fdw-bar i,#ph.xfd .fdw-pb{transition:none}}
