/* phone-scroll.css: scrolling phone component (PLAN v7 section 2.1). Numbers are capture px: calc(N * var(--u)).
   Specificity is (ids, classes+attributes, elements). Page rules are narrowed to direct children by T7, so none reaches inside .ph. */

/* ---- visibility, ready flag, scheme ---- */
.ph{display:none;position:relative;width:100%;-webkit-tap-highlight-color:transparent;cursor:default;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;--ph-bg:var(--ph-bg-l)}   /* (0,1,0): hidden until ready; in flow (R2-1); nothing else on the site targets .ph */
html[data-theme="dark"] .ph{--ph-bg:var(--ph-bg-d)}   /* (0,2,1): beats .ph (0,1,0). Site dark = data-theme only (no prefers-color-scheme branch exists in chrome.css or page.css), so no second branch */
.ph *{-webkit-tap-highlight-color:transparent}   /* (0,1,0) + universal: no rule competes on this property */
html.ph-on .ph[data-ph-ready]{display:block}   /* (0,3,1): beats .ph (0,1,0); shows only once the script flagged the phone ready (R2-13) */
html.ph-on .ph__static[data-ph-ready]{display:none}   /* (0,3,1): beats narrowed .phone-frame > img (0,1,1), global img{display:block} (0,0,1) and any plain .ph__static rule */
.ph img{display:block;border-radius:0}   /* (0,1,1): base for tiles and chrome; beats global img (0,0,1); page radius rules are direct-child only and never reach here */
.ph img.ph-d{display:none}   /* (0,2,1): beats .ph img (0,1,1), .ph__drawer (0,1,0); no tile or chrome rule sets display (R2-2) */
html[data-theme="dark"] .ph img.ph-l{display:none}   /* (0,3,2): beats .ph img (0,1,1) */
html[data-theme="dark"] .ph img.ph-d{display:block}   /* (0,3,2): beats .ph img.ph-d (0,2,1); ties the rule above but they never match the same image */

/* ---- screen, scroller, spacer, tiles ---- */
.ph__screen{position:relative;width:100%;aspect-ratio:1320/2868;container-type:inline-size;overflow:hidden;border-radius:var(--ph-r);background:var(--ph-bg)}   /* (0,1,0): in flow, gives the frame its height (R2-1); no page rule targets it */
.ph__screen>*{--u:calc(100cqw/1320)}   /* (0,1,0): cqw resolves against .ph__screen at every use site below */
.ph__scroll{position:absolute;left:0;right:0;top:calc(var(--sc-top,0)*var(--u));bottom:calc(var(--bb,0)*var(--u));height:round(down,calc(100% - (var(--sc-top,0) + var(--bb,0))*var(--u)),1px);overflow-y:auto;overflow-x:hidden;scrollbar-width:none;overscroll-behavior:auto;overflow-anchor:none;touch-action:pan-y pinch-zoom}   /* (0,1,0): only .ph* classes style it; top never changes (R2-11) */
.ph__scroll::-webkit-scrollbar{display:none}   /* (0,1,1): pseudo-element, the only rule for it */
.ph__tp{height:calc(var(--tp,0)*var(--u));height:round(calc(var(--tp,0)*var(--u)),1px)}   /* (0,1,0): glyph pad, constant */
.ph__sp{height:calc(var(--sp,0)*var(--u));height:round(calc(var(--sp,0)*var(--u)),1px);transition:height 320ms cubic-bezier(.22,1,.36,1)}   /* (0,1,0): strip spacer */
.ph[data-strip=hidden] .ph__sp{height:0}   /* (0,3,0): beats .ph__sp (0,1,0) */
.ph__tiles img{width:100%;height:calc(var(--r)/.5909*var(--u));height:round(calc(var(--r)/.5909*var(--u)),1px)}   /* (0,1,1): size only, never display (R2-2); ties narrowed page rules at worst, which no longer match here */
.ph__tiles .ph__ov{margin-top:calc(-8/.5909*var(--u));margin-top:round(calc(-8/.5909*var(--u)),1px)}   /* (0,2,0): 8-row overlap (R1-29); margin only, nothing competes */
.ph__pad{height:calc(var(--h,0)*var(--u));height:round(calc(var(--h,0)*var(--u)),1px)}   /* (0,1,0): bottom pad, nothing competes */
.ph__drawer{display:block;width:100%;height:calc(180*var(--u));height:round(calc(180*var(--u)),1px)}   /* (0,1,0): cues/goals drawer, scroll content (R3-7); its display LOSES to .ph img.ph-d (0,2,1) and the dark pair (0,3,2) by design (R2-2) */

/* ---- chrome layers (never take a hit) ---- */
.ph__chrome{position:absolute;inset:0;pointer-events:none}   /* (0,1,0): covers the screen so layers place against it (R2-19) */
.ph__chrome *{pointer-events:none}   /* (0,1,0) + universal: all children; the for/ head and island rules only affect elements outside .ph */
.ph__chrome img,.ph__sg{position:absolute;left:0;top:calc(var(--row,0)*var(--u));width:100%}   /* (0,1,1) / (0,1,0): top layers at their recorded --row; narrowed page img rules (0,1,1) no longer match, so there is no tie */
.ph__chrome img{height:auto}   /* (0,1,1): height from the width/height attributes; same reasoning as above */
.ph__sg{height:calc((var(--tp,0) + var(--sp,0))*var(--u));transition:transform 320ms cubic-bezier(.22,1,.36,1),opacity 320ms cubic-bezier(.22,1,.36,1)}   /* (0,1,0): strip group, (tp + sp) rows at rest (tp and sp come from phones.json per screen; on home the body starts at row 637); only this rule sets its height and transition */
.ph[data-strip=hidden] .ph__sg{transform:translateY(calc(-1*var(--sp,0)*var(--u)));opacity:0}   /* (0,3,0): beats .ph__sg (0,1,0) */
.ph__chrome .ph__bot{top:auto;bottom:0;transition:opacity 320ms cubic-bezier(.22,1,.36,1)}   /* (0,2,0): beats .ph__chrome img (0,1,1) on top; bottom row sits at the screen bottom */
.ph__chrome .ph__band{top:auto;bottom:0}   /* (0,2,0): search bottom band (input row plus keyboard, role bottom-band); beats .ph__chrome img (0,1,1) top rule, so the layer sits at the screen bottom like .ph__bot; width and height come from .ph__chrome img; no transition, so the reduced-motion rule needs no entry */
.ph__bot--compact{opacity:0}   /* (0,1,0): default state; the two rules below change it */
.ph[data-pill=compact] .ph__bot--full{opacity:0}   /* (0,3,0): beats the implicit default opacity */
.ph[data-pill=compact] .ph__bot--compact{opacity:1}   /* (0,3,0): beats .ph__bot--compact (0,1,0) */
.ph__edge{position:absolute;left:0;right:0;top:calc(var(--sc-top,0)*var(--u));height:calc(48*var(--u));opacity:var(--fade,0);background:linear-gradient(var(--ph-bg),transparent)}   /* (0,1,0): sheet and search only (R2-16); sits on the scroller's fixed top edge; inside .ph__chrome so it takes no hit */

/* ---- for/ layers (data-ph-layer wrapper holds .ph__static and .ph) ---- */
[data-ph-layer]{pointer-events:none}   /* (0,1,0): the wrapper never takes a hit by itself (R2-3) */
[data-ph-layer]>.ph{position:absolute;inset:0;pointer-events:auto}   /* (0,2,0): beats .ph (0,1,0); inline pointer-events:none from the script (gated phone) beats this class rule */
[data-ph-layer]>.ph>.ph__screen{height:100%;aspect-ratio:auto}   /* (0,3,0): beats .ph__screen (0,1,0); the layer already has the screen-sized height */
[data-ph-layer]>div.ph__static{position:absolute;inset:0}   /* (0,2,1): static wrapper fills the layer; sets no display, so the ready-flag rule above hides it */
[data-ph-layer]>div.ph__static>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit}   /* (0,2,2): narrowed page rules (direct child of .ap-scr*) no longer match inside the wrapper */
[data-ph-layer]>div.ph__static>.th-d{display:none}   /* (0,3,1): dark twin off by default; beats global img (0,0,1) */
html[data-theme="dark"] [data-ph-layer]>div.ph__static>.th-l{display:none}   /* (0,4,2): beats the (0,3,1) rule above and the light default */
html[data-theme="dark"] [data-ph-layer]>div.ph__static>.th-d{display:block}   /* (0,4,2): beats .th-d none (0,3,1); ties the rule above, never the same image */

/* ---- focus ring inside the clip, reduced motion ---- */
.ph__screen:has(.ph__scroll:focus-visible){outline:2px solid var(--sc-accent,var(--hv,#7A8B5C));outline-offset:-3px}   /* (0,3,0): :has() takes its argument's specificity (0,2,0) plus .ph__screen; drawn inside the clip; --brand does not exist on the site, so --sc-accent (for/ pages), then --hv (index) */
@media (prefers-reduced-motion:reduce){.ph__sp,.ph__sg,.ph__chrome .ph__bot{transition:none}}   /* after the base rules; each selector has the same specificity as the transition rule it cancels ((0,1,0), (0,1,0), (0,2,0)), so source order wins */
