/* Section «Разбор»: only what kit.css does not already give the stack, the diary, the result and the video screens. */

/* stack header */
#ph .st-top h3{font-size:20px;letter-spacing:-.01em;margin:0}
#ph .st-top .ibtn.flat{margin-left:-10px}
.rv-gchip svg{width:14px;height:14px}
.rv-gchip{min-height:40px}
.st-top .seg button{min-height:40px}
/* reviewed share of the stack: a quiet line, the count pill keeps the number */
.rv-prog{height:4px;border-radius:2px;background:var(--surface-3);overflow:hidden;margin-top:-2px}
.rv-prog i{display:block;height:100%;border-radius:2px;background:var(--ink);transition:width var(--t) var(--ease)}
#rvZone:focus-visible{outline:2px solid var(--focus);outline-offset:4px;border-radius:var(--r-card)}

/* card header «⋯» */
.ch .rv-more{margin:-6px -8px 0 0;align-self:flex-start;color:var(--ink-2)}
.ch .hdur{margin-left:auto}
.wacc .chev{display:inline-grid;place-items:center}
.wacc .chev svg{width:16px;height:16px}

/* in-card link to a deeper screen */
.rv-link{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:48px;border:0;border-radius:14px;background:var(--surface-2);color:var(--ink);font:600 15px/1.2 var(--font);padding:0 12px 0 14px;cursor:pointer;text-align:left}
.rv-link svg{width:18px;height:18px;color:var(--ink-3);flex:none}
.rv-link:active{background:var(--surface-3)}
/* «Можно спросить» quote is a button that opens the composer with the phrase */
.rv-ask{display:block;width:100%;border:0;text-align:left;color:var(--ink);font:14.5px/1.4 var(--font);cursor:pointer;min-height:44px}
.rv-ask:active{background:var(--surface-3)}

/* composer and lists inside the bottom sheet */
.rv-qt{border-left:3px solid var(--accent);background:var(--surface-2);border-radius:0 12px 12px 0;padding:8px 10px;font-size:14px}
.rv-qt small{display:block;font-size:12px;color:var(--ink-3);font-weight:600}
.rv-chips{display:flex;gap:6px;flex-wrap:wrap}
.rv-chips .chip{min-height:40px;white-space:normal;text-align:left}
.rv-ta{width:100%;min-height:88px;border:0;border-radius:14px;background:var(--surface-2);padding:12px;font:16px/1.4 var(--font);color:var(--ink);resize:none}
.rv-ta::placeholder{color:var(--ink-3)}
.rv-menu{display:flex;flex-direction:column}
.rv-row{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;border:0;border-top:1px solid var(--line);background:none;color:var(--ink);padding:8px 2px;text-align:left;cursor:pointer}
.rv-row:first-child{border-top:0}
.rv-row .tx{flex:1;min-width:0}
.rv-row .tx b{display:block;font-size:16px;font-weight:600}
.rv-row .tx span{display:block;font-size:14px;color:var(--ink-2)}
.rv-row>svg{width:18px;height:18px;color:var(--ink-3);flex:none}
.rv-row .ck{width:28px;height:28px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;flex:none}
.rv-row .ck svg{width:16px;height:16px}
.rv-mynote{background:var(--info);color:var(--ink);border-radius:10px;padding:6px 10px;margin-top:6px}
.rv-mynote b{color:var(--info-ink);font-weight:600}
.psheet .mhero{flex:none}

/* diary: meal rows with a missing slot */
.meal.miss .th{font-size:14px}
.i-none{outline-offset:-1px}

/* video review: the whole top is the dark viewer, status bar included */
#ph[data-screen="review.video"]{background-color:#0B0B0C}
#ph[data-screen="review.video"]>.sb{color:#F4F4F5}
.vtop .hd{padding-top:6px}
.vtop .hd .ibtn svg{color:#F4F4F5}
.rv-vsheet{overflow-y:auto;gap:12px}
.rv-vsheet>*{flex:none}
.rv-tl{touch-action:none}
.rv-tl:focus-visible{outline:2px solid var(--focus);outline-offset:4px;border-radius:8px}
.rv-vrow{display:flex;align-items:flex-start;gap:4px;border-top:1px solid var(--line)}
.rv-vrow:first-child{border-top:0}
.rv-vcm{flex:1;min-width:0;border:0;border-top:0!important;background:none;color:var(--ink);text-align:left;font:inherit;padding:10px 0;display:grid;grid-template-columns:auto 1fr;gap:10px;min-height:44px}
.rv-vtx{min-width:0}
.rv-vtx small{display:block;font-size:12px;color:var(--ink-3);margin-bottom:2px}
.rv-vtx .p{display:block;font-size:15px;line-height:1.35}
.rv-vrow.now .t{background:var(--accent);color:var(--on-accent)}
.rv-vv,.rv-vdel{width:44px;height:44px;flex:none;border:0;border-radius:12px;background:none;display:grid;place-items:center;cursor:pointer;color:var(--ink-3);margin-top:2px}
.rv-vv svg{width:20px;height:20px;fill:currentColor}
.rv-vv.up{color:var(--ok)}.rv-vv.dn{color:var(--out-ink)}
.rv-vdel svg{width:18px;height:18px}
.rv-dot{width:14px;height:14px;border-radius:50%;border:1.5px dashed var(--ink-3)}
.rv-vsheet .inp .ibtn{flex:none}

@media (prefers-reduced-motion:reduce){.rv-prog i{transition:none}}

/* undo toast: on the stack it sits at the top so it never covers the card's «На контроль / Просмотрено»;
   on the nested screens it clears the bottom dock */
#ph[data-screen="review"] .ptoast{top:44px;bottom:auto!important;right:16px!important}
#ph[data-screen^="review."]:has(>.body>.dock):not(:has(>.psheet.open)) .ptoast{bottom:84px!important}
@media (max-width:520px){
  #ph[data-screen="review"] .ptoast{top:calc(8px + env(safe-area-inset-top,0px))}
  #ph[data-screen^="review."]:has(>.body>.dock):not(:has(>.psheet.open)) .ptoast{bottom:calc(84px + env(safe-area-inset-bottom,0px))!important}
}
/* night: the stack ground is the board itself, so the toast steps up one plate to stay visible */
.app[data-scheme="night"] #ph[data-screen="review"] .ptoast{background:var(--board-plate)}

/* The card handles every gesture itself (swipe to commit, drag to scroll, strip scroll): without this iOS starts a native pan, fires pointercancel and the swipe never lands. */
#ph .card:not(.peek),#ph .card:not(.peek) *{touch-action:none}
#ph .card:not(.peek) :is(textarea,input){touch-action:manipulation}

/* Day marks (owner 27.09): the big mark is the trainer's review, the corner pin is the athlete's adherence. */
#ph .dm{width:20px;height:20px;border-radius:50%;display:inline-grid;place-items:center;flex:none;font-style:normal}
#ph .dm svg{width:12px;height:12px}
#ph .dm-seen{background:var(--ink);color:var(--surface-1)}
#ph .dm-todo{box-shadow:inset 0 0 0 2px var(--ink-3);background:transparent}
#ph .dm-none{background:transparent;outline:1.5px dashed var(--ink-3);outline-offset:-1.5px;opacity:.55}
#ph .pin{width:8px;height:8px;border-radius:50%;display:inline-block;flex:none}
#ph .pin-ok{background:var(--ok)}
#ph .pin-attn{background:var(--danger)}
#ph .week.dmw button{position:relative;min-height:60px;gap:3px}
#ph .week.dmw button .dm{margin-top:2px}
#ph .week.dmw button .pin{position:absolute;top:7px;right:7px}
#ph .week.dmw button.on .dm-seen{background:var(--on-accent);color:var(--accent)}
#ph .week.dmw button.on .dm-todo,#ph .week.dmw button.on .dm-none{box-shadow:inset 0 0 0 2px currentColor;opacity:.7}
#ph .week.dmw button.on .pin{box-shadow:0 0 0 2px var(--accent)}
#ph .legend.dml{gap:6px 12px}
#ph .legend.dml span{gap:6px}
#ph .legend.dml .dm{width:16px;height:16px}#ph .legend.dml .dm svg{width:10px;height:10px}

/* Meal row: long meals fold after three items; comment sits next to the verdict. */
#ph .rv-more{border:0;background:none;padding:6px 0 0;font:600 14px var(--font-b,inherit);color:var(--ink-2);text-decoration:underline;text-underline-offset:3px;cursor:pointer;text-align:left;min-height:32px}
#ph .rv-mact{margin-top:4px;gap:8px}
#ph .rv-cbtn{display:inline-flex;align-items:center;gap:6px;border:0;background:var(--surface-2);color:var(--ink);border-radius:12px;min-height:44px;padding:0 12px;font:600 14px inherit;cursor:pointer}
#ph .rv-cbtn svg{width:18px;height:18px}
#ph .rv-its>div{align-items:flex-start;padding:6px 0;border-top:1px solid var(--line)}
#ph .rv-its>div:first-child{border-top:0}
#ph .rv-its>div>span{display:flex;flex-direction:column;gap:2px;min-width:0}
#ph .rv-its>div>span:last-child{align-items:flex-end;text-align:right;white-space:nowrap}
#ph .rv-its b{font-weight:500}
#ph .rv-its small{font-size:13px;color:var(--ink-3)}

/* Food calendar. */
#ph .rc-nav{display:flex;align-items:center;justify-content:space-between;gap:8px}
#ph .rc-nav b{font:700 18px var(--font-d)}
#ph .rc-nav .ibtn[disabled]{opacity:.35;pointer-events:none}
#ph .rc-sum{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
#ph .rc-sum div{background:var(--surface-2);border-radius:12px;padding:8px 10px;display:flex;flex-direction:column}
#ph .rc-sum b{font:700 20px var(--font-d)}
#ph .rc-sum span{font-size:13px;color:var(--ink-2)}
#ph .rc-seen{display:flex;flex-direction:column;gap:6px;margin-top:12px}
#ph .rc-bar{height:6px;border-radius:3px;background:var(--track);overflow:hidden}
#ph .rc-bar i{display:block;height:100%;background:var(--ink);border-radius:3px}
#ph .rc-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
#ph .rc-h{text-align:center;font-size:12px;font-weight:600;color:var(--ink-3);text-transform:uppercase;padding-bottom:2px}
#ph .rc-d{position:relative;border:0;background:var(--surface-2);border-radius:12px;min-height:52px;padding:6px 0;display:flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer;color:var(--ink)}
#ph .rc-d b{font:600 15px/1 var(--font-d)}
#ph .rc-d .pin{position:absolute;top:6px;right:6px}
#ph .rc-d.fut{background:transparent;color:var(--ink-3);opacity:.5;cursor:default}
#ph .rc-d.td{box-shadow:inset 0 0 0 2px var(--ink)}
#ph .rc-wk .rc-row{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-top:10px}
#ph .rc-wk b{font-size:16px}
.psheet .dm{width:20px;height:20px;border-radius:50%;display:inline-grid;place-items:center}
.psheet .dm svg{width:13px;height:13px}
.psheet .rc-dock{flex-wrap:nowrap}.psheet .rc-dock .btn:first-child,.psheet .rc-dock .btn:last-child{flex:0 0 52px;padding:0}.psheet .rc-dock .btn:nth-child(2){flex:1}
