/* Morning HRV (views/hrv.js): the camera measurement's sheet and its trend card. Colours come from the tokens in
   style.css only; the ring and the wave run left to right in Hebrew too (.ltr). */
.hrv{display:flex;flex-direction:column;gap:14px}
.hrv-stage{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.hrv-ring{position:relative;flex:none;width:148px;height:148px}
.hrv-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.hrv-ring circle{fill:none;stroke-width:9}
.hrv-ring .bg{stroke:var(--line)}
.hrv-ring .fg{stroke:var(--green);stroke-linecap:round;transition:stroke-dashoffset .25s linear}
.hrv-sec{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.hrv-sec b{font-size:2.2rem;font-weight:800;line-height:1}
.hrv-sec small{color:var(--mut);font-size:.74rem;font-weight:600}
.hrv-sec .hrv-left{font-size:.7rem;margin-block-start:3px;font-variant-numeric:tabular-nums}
/* Where to put the fingertip (views/hrv-phone.js): this phone's back beside the caption and the hand toggle. The
   main lens's ring pulses and the flash glows; the finger lies over both, translucent so they show through. */
.hrv-how{display:flex;align-items:center;gap:12px;text-align:start;inline-size:100%}
.hrv-phone{flex:none;inline-size:120px;block-size:auto;max-block-size:150px}
.hrv-phone .body{fill:var(--surface2);stroke:var(--line);stroke-width:1.5}
.hrv-phone .isl{fill:var(--surface);stroke:var(--line);stroke-width:1.2}
.hrv-phone .lens{fill:var(--ink2);stroke:var(--line);stroke-width:1.2}
.hrv-phone .lens.main{fill:var(--ink)}
.hrv-phone .aux{fill:var(--mut)}
.hrv-phone .flash{fill:var(--amber)}
.hrv-phone .glow{fill:var(--amber);opacity:.35;transform-box:fill-box;transform-origin:center;animation:hrv-glow 1.6s ease-in-out infinite}
.hrv-phone .fing .skin{fill:var(--red-t);fill-opacity:.72;stroke:var(--red);stroke-width:1.2}
.hrv-phone .fing .nail{fill:var(--surface);fill-opacity:.55;stroke:var(--red);stroke-width:.8}
.hrv-phone .fing .crease{fill:none;stroke:var(--red);stroke-width:.8;stroke-linecap:round}
.hrv-phone .ring{fill:none;stroke:var(--a);stroke-width:2.2;transform-box:fill-box;transform-origin:center;animation:hrv-ring 1.6s ease-in-out infinite}
@keyframes hrv-ring{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.25);opacity:.45}}
@keyframes hrv-glow{0%,100%{opacity:.2}50%{opacity:.55}}
@media (prefers-reduced-motion:reduce){.hrv-phone .ring,.hrv-phone .glow{animation:none}}
.hrv-howt{display:flex;flex-direction:column;gap:8px;min-inline-size:0;flex:1}
.hrv-cap{margin:0}
.hrv-hand{align-self:flex-start}
.hrv-hand button{font-size:.8rem;padding-inline:10px}
/* The live finger-position guide (views/hrv-guide.js): this phone's back with the fingertip where the camera sees it
   and an arrow to where it goes, beside the words. The arrow's dashes run toward the lens and a moving finger shakes;
   both still under reduced motion. */
.hrv-guide{display:flex;align-items:center;gap:12px;inline-size:100%;box-sizing:border-box;padding:8px 12px;border:1.5px solid var(--amber);border-radius:14px;background:var(--surface);text-align:start}
.hrv-guide[hidden]{display:none}
.hrv-guide-ph{flex:none;display:flex}.hrv-guide-ph .hrv-phone{inline-size:88px;max-block-size:110px}
.hrv-guide-t{margin:0;font-weight:700;font-size:1.05rem;color:var(--ink)}
.hrv-phone .arrow path{fill:none;stroke:var(--a);stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.hrv-phone .arrow path:first-child{stroke-dasharray:5 3;animation:hrv-flow .7s linear infinite}
.hrv-guide[data-hint=still] .moved{animation:hrv-shake .5s ease-in-out infinite}
@keyframes hrv-flow{to{stroke-dashoffset:-8}}
@keyframes hrv-shake{0%,100%{transform:translate(0,0)}25%{transform:translate(-1.5px,.5px)}75%{transform:translate(1.5px,-.5px)}}
@media (prefers-reduced-motion:reduce){.hrv-phone .arrow path:first-child,.hrv-guide[data-hint=still] .moved{animation:none}}
/* The camera opened is not the main one (its label says so). */
.hrv-lens{margin:0;display:flex;gap:6px;align-items:center;color:var(--amber);font-weight:600;text-align:start}
/* the camera minute on a phone on its side asks for upright in one line and goes on (section 5.2 of ux-redesign-lld) */
.hrv-upright{display:none;margin:0;gap:6px;align-items:center;color:var(--amber);font-weight:600;text-align:start}
@media (max-height:499px) and (min-width:560px){.hrv-upright{display:flex}}
/* The technical Details: collapsed, small, the figures left to right. */
.hrv-diag{inline-size:100%;text-align:start;font-size:.8rem;color:var(--mut)}
.hrv-diag summary{min-block-size:48px;padding-block:12px;box-sizing:border-box;cursor:pointer;font-weight:600}
.hrv-diag-v{display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px 10px;margin:0 0 6px}
.hrv-diag-v dt{color:var(--mut)}
.hrv-diag-v dd{margin:0;color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
/* The preview, the ring and the live heart rate in one row; the coverage state (data-q) colours them. */
.hrv-live{display:flex;align-items:center;justify-content:center;gap:6px;inline-size:100%}
/* the beat flower around the preview (views/hrv-flower.js): 112 px, the preview on top at its centre; a spoke a beat in
   the trace's ink, the tips' outline a faint petal, a missed beat a small red X on the outer rim (live; on the result a beat the
   screening left out stays a muted one); the newest spoke draws out with the throb */
.hrv-camwrap{position:relative;flex:none;inline-size:112px;block-size:112px;display:grid;place-items:center}
.hrv-camwrap .hrv-flower{position:absolute;inset:0;inline-size:100%;block-size:100%}
.hrv-camwrap .hrv-cam{position:relative}
.hrv-flower .base{fill:none;stroke:var(--line);stroke-width:1}
.hrv-flower .spoke{fill:none;stroke:var(--paper-curve-1);stroke-width:1.6;stroke-linecap:round}
.hrv-flower .tips{fill:color-mix(in srgb,var(--paper-curve-1) 12%,transparent);stroke:color-mix(in srgb,var(--paper-curve-1) 45%,transparent);stroke-width:.8;stroke-linejoin:round}
.hrv-flower .x{fill:none;stroke:var(--mut);stroke-width:1.2;stroke-linecap:round}
.hrv-camwrap .hrv-flower .x{stroke:var(--red);stroke-width:1.1}
.hrv-flower .spoke.new{stroke-dasharray:1;animation:hrv-spoke .38s ease-out both}
@keyframes hrv-spoke{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
.hrv-flowerbox{display:flex;flex-direction:column;align-items:center;gap:6px;margin-block:4px 10px;text-align:center}
.hrv-flowerbox svg{inline-size:168px;block-size:168px}
.hrv-flowerbox p{margin:0}
.hrv-cam{flex:none;inline-size:96px;block-size:96px;border-radius:50%;overflow:hidden;background:var(--surface2);border:3px solid var(--red);transition:inline-size .35s ease,block-size .35s ease}
/* settled (views/hrv-live.js, hrv-live.yaml): the preview shrinks (its size set by the view, camSettled) and the signal bar folds away; the stage's 12 px gap
   goes with it. The bar is labelled Signal while it shows, so it is never read as the minute's progress. */
.hrv-sig{inline-size:100%;display:grid;grid-template-rows:1fr;transition:grid-template-rows .35s ease,opacity .35s ease,margin .35s ease}
.hrv-sig-in{min-block-size:0;overflow:hidden;display:flex;align-items:center;gap:8px}
.hrv-sig-in small{flex:none;color:var(--mut);font-size:.74rem;font-weight:600}
.hrv-stage[data-settled] .hrv-sig{grid-template-rows:0fr;opacity:0;margin-block-end:-12px}
/* the made-up seconds: shown a moment after each added second, then faded and folded (the hold and the fade are
   hrv-live.yaml's, set on the element by the view) */
.hrv-madeup{margin:0;overflow:hidden;max-block-size:3em}
.hrv-madeup.show{animation:hrv-madeup .6s ease 4s forwards}
@keyframes hrv-madeup{to{opacity:0;max-block-size:0;margin-block-end:-12px}}
@media (prefers-reduced-motion:reduce){.hrv-cam,.hrv-sig{transition:none}.hrv-flower .spoke.new{animation:none}.hrv-madeup.show{animation-timing-function:step-start}}
.hrv-cam video{inline-size:100%;block-size:100%;object-fit:cover;display:block}
/* the heart rate takes what the preview and the ring leave and wraps its unit (Hebrew's is two words), never past the row */
.hrv-bpm{flex:0 1 auto;min-inline-size:0;display:flex;flex-direction:column;align-items:center;text-align:center;visibility:hidden}
.hrv-bpm b{font-size:2rem;font-weight:800;line-height:1;color:var(--red)}
.hrv-bpm small{color:var(--mut);font-size:.74rem;font-weight:600;line-height:1.2}
.hrv-meter{flex:1;inline-size:100%;block-size:8px;border-radius:4px;background:var(--line);overflow:hidden}
.hrv-meter i{display:block;block-size:100%;background:var(--red);transform-origin:0 50%;transform:scaleX(.04);transition:transform .2s linear}
.hrv-q{margin:0;font-weight:700;color:var(--red)}
.hrv-note{margin:0;color:var(--mut)}
.hrv-note:empty{display:none}
.hrv-stage[data-q=almost] .hrv-cam,.hrv-stage[data-q=motion] .hrv-cam{border-color:var(--amber)}
.hrv-stage[data-q=almost] .hrv-meter i,.hrv-stage[data-q=motion] .hrv-meter i{background:var(--amber)}
.hrv-stage[data-q=almost] .hrv-q,.hrv-stage[data-q=motion] .hrv-q{color:var(--amber)}
.hrv-stage[data-q=ok] .hrv-cam{border-color:var(--green)}
.hrv-stage[data-q=ok] .hrv-meter i{background:var(--green)}
.hrv-stage[data-q=ok] .hrv-q{color:var(--green)}
.hrv-stage[data-q=ok] .hrv-bpm,.hrv-stage[data-q=motion] .hrv-bpm,.hrv-bpm[data-v]{visibility:visible}
/* a heart rate held through lost signal (views/hrv-live.js paintBpm, hrv-live.yaml bpmStaleMs): muted, not red */
.hrv-bpm[data-stale] b{color:var(--mut)}
.hrv-type{align-self:flex-start;min-block-size:48px;display:inline-flex;align-items:center;gap:6px}
.hrv-stage .btn{min-height:48px}
.hrv-result{display:flex;flex-direction:column;gap:12px}
.hrv-nums{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.hrv-nums .fact b{font-size:2rem}
.hrv-result .actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.hrv-result .actions .btn,.hrv-result .actions .link{min-height:48px}
.hrv-saved{display:flex;align-items:center;gap:8px;margin:0;flex-basis:100%;color:var(--green)}
.hrv-saved .link{margin-inline-start:auto}
.hrv-est{display:flex;gap:6px;align-items:flex-start;margin-block-start:14px}
.hrv-trend,:is(#app,#pane) .card.hrv-trend,:is(#app,#pane).screen .card.hrv-trend{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;min-height:56px;padding:14px 18px;text-align:start}
.hrv-trend .tt{display:flex;flex-direction:column;min-width:0;flex:1}
.hrv-trend .tt small{color:var(--mut);font-size:.8rem}
.hrv-spark{flex:none;width:96px;height:30px}
.hrv-spark path{fill:none;stroke:var(--a);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
/* The HRV card (views/hrv-card.js): the two numbers, the state pill with its why, the sparkline and the way in. */
.hrv-card,:is(#app,#pane) .card.hrv-card{display:flex;flex-direction:column;gap:10px;inline-size:100%;text-align:start;padding:14px 16px;cursor:pointer}
.hrv-state{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.hrv-state small{color:var(--mut);font-size:.8rem;flex-basis:100%}
.hrv-pill{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:999px;font-size:.8rem;font-weight:700;background:var(--surface2);color:var(--ink2)}
.hrv-pill.good{background:var(--green-t);color:var(--green)}
.hrv-pill.warn{background:var(--amber-t);color:var(--amber)}
.hrv-pill.bad{background:var(--red-t);color:var(--red)}
.hrv-pill svg{inline-size:14px;block-size:14px}
.hrv-back{display:inline-flex;align-items:center;gap:4px;min-block-size:48px;align-self:flex-start}
/* All HRV statistics (views/hrv-stats.js): a card per statistic, its grade on the start edge; greyed when unreliable. */
.hrv-stats{display:flex;flex-direction:column;gap:14px}
.hrv-grp{display:flex;flex-direction:column;gap:8px}
.hrv-grp .sec{margin:6px 0 0}
.hrv-scs{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;align-items:start}
.hrv-sc{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border-radius:var(--rm);background:var(--surface2);border-inline-start:4px solid var(--line);min-inline-size:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
.hrv-sc:focus-visible{outline:2px solid var(--a);outline-offset:2px}
.hrv-sc[data-g=good]{border-inline-start-color:var(--green)}
.hrv-sc[data-g=ok]{border-inline-start-color:var(--amber)}
.hrv-sc[data-g=bad]{border-inline-start-color:var(--red)}
.hrv-sc.unrel{opacity:.55}
.hrv-sc-h{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:2px 8px;font-size:.85rem;font-weight:600}
.hrv-sc-h b{font-size:1.15rem;font-variant-numeric:tabular-nums}
.hrv-sc-h small{color:var(--mut);font-size:.72rem;font-weight:600}
.hrv-sc .why{margin:0;font-size:.8rem;color:var(--mut);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.hrv-grade{margin:0;display:flex;align-items:center;gap:6px;font-size:.8rem}
.hrv-grade .dot,.hrv-q2 .dot{flex:none;inline-size:10px;block-size:10px;border-radius:50%;background:var(--mut)}
.hrv-grade[data-g=good] .dot,.hrv-q2[data-g=good] .dot{background:var(--green)}
.hrv-grade[data-g=ok] .dot,.hrv-q2[data-g=fair] .dot{background:var(--amber)}
.hrv-grade[data-g=bad] .dot,.hrv-q2[data-g=poor] .dot{background:var(--red)}
.hrv-cur{margin:14px 0 0}
.hrv-grp h4.sec{margin:6px 0 0}
.hrv-unrel{margin:0}
/* The plots: the Poincare scatter, the spectrum with LF and HF shaded, a trend with its usual band. */
.hrv-pcard,.hrv-tcard{display:flex;flex-direction:column;gap:6px;padding:12px 14px}
.hrv-plot{inline-size:100%;block-size:auto;display:block}
.hrv-poin{max-inline-size:200px;align-self:center}
.hrv-poin .frame{fill:var(--surface2);stroke:var(--line)}
.hrv-poin .id{stroke:var(--mut);stroke-dasharray:3 3;stroke-width:.8}
.hrv-poin .ell{fill:var(--a-soft);stroke:var(--a);stroke-width:1}
.hrv-poin circle{fill:var(--red);fill-opacity:.75}
.hrv-spec .band.lf{fill:var(--amber-t)}
.hrv-spec .band.hf{fill:var(--green-t)}
.hrv-spec text{font-size:8px;fill:var(--mut);text-anchor:middle;font-weight:700}
.hrv-spec .line,.hrv-tplot .line{fill:none;stroke:var(--a);stroke-width:1.6;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.hrv-tplot .band{fill:var(--a-soft)}
.hrv-tplot .mid{fill:none;stroke:var(--mut);stroke-width:1;stroke-dasharray:4 3;vector-effect:non-scaling-stroke}
.hrv-tplot .last{fill:var(--a)}
/* The daily analysis (views/hrv-card.js): headline pill, the lines why, the one suggestion. */
.hrv-cardwrap{display:flex;flex-direction:column;gap:2px;inline-size:100%}
.hrv-exp-link{align-self:flex-start;min-block-size:48px;padding-inline:4px}
.hrv-why{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px;flex-basis:100%}
.hrv-why li{font-size:.86rem;color:var(--ink2);line-height:1.4}
.hrv-sug{margin:0;flex-basis:100%;display:flex;gap:6px;align-items:flex-start;font-size:.9rem}
.hrv-sug svg{flex:none;inline-size:16px;block-size:16px;margin-block-start:2px;color:var(--green)}
.hrv-an>small{flex-basis:100%}
/* The reading's quality, HRV and heart rate apart. */
.hrv-qual{display:flex;flex-direction:column;gap:8px}
.hrv-q2{display:flex;gap:8px;align-items:flex-start}
.hrv-q2 .dot{margin-block-start:6px}
.hrv-q2 span{display:flex;flex-direction:column;min-inline-size:0}
.hrv-q2 small{color:var(--mut);font-size:.8rem}
/* What is HRV?: four small cards, the beat strips pulsing in turn. */
.hrv-exp{display:flex;flex-direction:column;gap:10px}
.hrv-exp-in{margin:0}
.hrv-exp-c{display:flex;flex-direction:column;gap:6px;padding:12px 14px}
.hrv-exp-c h3{margin:0;font-size:1rem}
.hrv-exp-c p{margin:0;font-size:.88rem;color:var(--ink2);line-height:1.45}
.hrv-beats,.hrv-bars{inline-size:100%;block-size:auto}
.hrv-beats .axis{stroke:var(--line);stroke-width:2}
.hrv-beats circle{transform-box:fill-box;transform-origin:center;animation:hrv-beat 1.2s ease-in-out infinite}
.hrv-beats circle.m{fill:var(--mut)}
.hrv-beats circle.h{fill:var(--red)}
.hrv-beats text{font-size:9px;fill:var(--mut);text-anchor:middle;font-weight:700}
.hrv-beats text.lab{text-anchor:start;font-size:10px;fill:var(--ink2)}
.hrv-bars .g{fill:var(--green)}
.hrv-bars .r{fill:var(--red)}
.hrv-bars text{font-size:11px;fill:var(--ink2);font-weight:700}
.hrv-exp-bl{display:flex;justify-content:space-between}
@keyframes hrv-beat{0%,100%{transform:scale(1)}30%{transform:scale(1.5)}}
@media (prefers-reduced-motion:reduce){.hrv-beats circle{animation:none}}
/* A statistic's detail (views/hrv-detail.js): a fixed panel over everything, grown from its card. */
.hrv-zoom{position:fixed;inset:0;z-index:25;background:color-mix(in srgb, var(--ink) 35%, transparent);display:flex}
.hrv-zoom-panel{align-self:flex-start;max-block-size:calc(100% - 20px);margin:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom));inline-size:100%;overflow-y:auto;overscroll-behavior:contain;background:var(--surface);border:1px solid var(--line);border-radius:var(--rm);box-shadow:var(--shadow);padding:12px 16px 20px;outline:0}
.hrv-zoom-in{display:flex;flex-direction:column;gap:10px;animation:hrv-fade .3s both}
.hrv-zoom-in h2{margin:0;font-size:1.3rem}
.hrv-zoom-bar{display:flex;justify-content:space-between;align-items:center}
.hrv-dt-body{margin:0;font-size:1.02rem;font-weight:700}
.hrv-dt-val{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:1.7rem}
.hrv-dt-val .hrv-grade{font-size:.9rem}
.hrv-dt-text p{margin:0 0 8px;font-size:.88rem;line-height:1.5;color:var(--ink2)}
.hrv-dt-more{display:inline-flex;align-items:center;gap:4px;font-weight:600;min-block-size:48px}
.hrv-dt-chart,.hrv-zoom .hrv-tcard{display:flex;flex-direction:column;gap:6px;padding:12px 14px}
.hrv-dt-chart h3,.hrv-zoom .hrv-tcard h3{margin:0;font-size:.9rem}
.hrv-dt-chart small{font-size:.8rem}
.hrv-rr{inline-size:100%;block-size:auto;display:block}
.hrv-rr .rr{fill:none;stroke:var(--ink2);stroke-width:1.4;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.hrv-rr .out{fill:var(--mut);opacity:.6}
.hrv-rr .dif{stroke:var(--a);stroke-width:3;stroke-linecap:round;opacity:.85;vector-effect:non-scaling-stroke}
.hrv-rr .dif.hi{stroke:var(--amber)}
.hrv-rr .dif.dim{stroke:var(--line)}
.hrv-rr .band{fill:var(--a-soft)}
.hrv-rr .mean{fill:none;stroke:var(--a);stroke-width:1.4;stroke-dasharray:5 3;vector-effect:non-scaling-stroke}
.hrv-rr .mk{fill:var(--red)}
.hrv-rr .wave{fill:none;stroke:var(--red);stroke-width:2;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.hrv-rr text{font-size:8px;fill:var(--mut);font-weight:700}
.hrv-rr text.end{text-anchor:end}
@keyframes hrv-fade{from{opacity:0}to{opacity:1}}
::view-transition-old(hrv-zoom),::view-transition-new(hrv-zoom){block-size:100%;inline-size:100%}
/* A returning user's idle screen (views/hrv-intro.js): floating napkins in the living-paper tokens of style.css, the
   middle one drawing a heart and its beat, and the help button in the top corner that opens the steps. 150 px tall,
   so Start stays above the fold at 390 x 844; under reduced motion the drawings stand finished and still. */
.hrv-hero{position:relative;block-size:150px;margin-block:-4px 2px}
.hrv-hero-art{display:block;inline-size:100%;block-size:100%;overflow:visible}
.hrv-hero-art .sh{fill:var(--napkin-shadow)}
.hrv-hero-art .nap{fill:var(--napkin);stroke:var(--napkin-edge);stroke-width:1}
.hrv-hero-art pattern path{fill:none;stroke:var(--paper-grid);stroke-width:1}
.hrv-hero-art .ink{fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 1;stroke-dashoffset:1;animation:hrv-ink 9s ease-in-out infinite both}
.hrv-hero-art .c1{stroke:var(--paper-curve-1)}
.hrv-hero-art .c2{stroke:var(--paper-curve-2)}
.hrv-hero-art .c3{stroke:var(--paper-curve-3)}
.hrv-hero-art .fl{transform-box:fill-box;transform-origin:center;animation:hrv-float 7s ease-in-out infinite}
.hrv-hero-art .n0{animation-duration:8.5s;animation-delay:-2.5s}
.hrv-hero-art .n1{animation-duration:9.5s;animation-delay:-5s}
.hrv-help{position:absolute;inset-block-start:0;inset-inline-end:0;color:var(--a)}
.hrv-help[aria-expanded=true]{background:var(--surface2);border-color:var(--a)}
.hrv-help .i{inline-size:22px;block-size:22px}
.hrv-howto{display:flex;flex-direction:column;gap:12px}
.hrv-howto[hidden]{display:none}
@keyframes hrv-float{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-5px) rotate(1.2deg)}}
@keyframes hrv-ink{0%{stroke-dashoffset:1;opacity:0}4%{opacity:1}34%{stroke-dashoffset:0}88%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@media (prefers-reduced-motion:reduce){.hrv-hero-art .ink{stroke-dashoffset:0;opacity:1}}
/* Camera access (views/hrv-access.js): why the camera did not open and the steps to fix it, the address to copy. */
.hrv-access{margin:0 0 12px}
.hrv-access>div{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.hrv-access p{margin:0}
.hrv-steps{margin:0;padding-inline-start:1.2em;font-size:.84rem;line-height:1.45;display:flex;flex-direction:column;gap:4px}
.hrv-url{width:100%;box-sizing:border-box;font:inherit;font-size:.8rem;padding:7px 9px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink2);text-align:start}
.hrv-access .actions{margin:2px 0 0;display:flex;flex-wrap:wrap;gap:8px}
.hrv-site b{font-weight:700;word-break:break-all}
.hrv-try{display:block;margin:4px auto 10px}
/* the day's reading's extra checks (views/hrv-day-view.js): the value and the pulse on one line beside the time */
.hrv-laters{margin-block:8px 4px}
.lrow.hrv-later .what{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.hrv-daynote{margin-block:0 12px}
/* the live pulse trace (views/hrv-trace.js): the camera's own wave as a pen line on the paper, the beats as dots and
   the newest intervals as arcs with their ms; grey and flat until the fingertip covers the lens */
.hrv-trace{inline-size:100%;block-size:auto;aspect-ratio:300/108;background:var(--surface2);border-radius:var(--rm)}
.hrv-trace .ink{fill:none;stroke:var(--mut);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.hrv-trace .pk{fill:var(--paper-curve-1);stroke:none}
.hrv-trace .arc{fill:none;stroke:var(--paper-curve-2);stroke-width:1.4;stroke-linecap:round;stroke-dasharray:3 2.5}
.hrv-trace .ms{font-size:10px;font-weight:700;fill:var(--ink2);text-anchor:middle}
.hrv-trace .dms{font-size:8.5px;font-weight:600;fill:var(--mut);text-anchor:middle;font-variant-numeric:tabular-nums}
.hrv-trace .mx{fill:none;stroke:var(--red);stroke-width:2.4;stroke-linecap:round}
.hrv-trace .mxl{font-size:8.5px;font-weight:700;fill:var(--red);text-anchor:middle}
.hrv-stage[data-q=ok] .hrv-trace .ink,.hrv-stage[data-q=motion] .hrv-trace .ink{stroke:var(--paper-curve-1)}
/* the heart at each beat (views/hrv-heart.js draws it, views/hrv-live.js beatHeart restarts it, its length hrv-live.yaml
   heartMs set on the element): an anatomical heart, solid at rest, 76 px tall (as tall as the heart-rate column at
   390 px leaves room for under the 148 px ring with the Hebrew unit on two lines). Each beat is a contraction: a quick
   squeeze to 0.88, drawn up toward its base (the origin near the top and a slight lift), in the first 32% of heartMs
   (about 120 ms of 380), then a relaxed refill back to its size over the rest; the light `fl` layer over the muscle
   flashes with the squeeze. Its tones (--h-*, public/style.css) mix the theme's red with black or white, so the
   same drawing holds in light and dark. Transform and opacity only: an animated filter or drop-shadow is painted again on every display frame of
   every beat, main-thread work in the frames the camera is read in. The fill mode holds the last keyframe (the
   resting heart), so the finished animation stays on the element and the next beat restarts it without a forced
   layout; the flash layer takes the element's duration. Under reduced motion only the flash. */
.hrv-heart{display:inline-flex;transform-origin:50% 20%;margin-block-end:2px}
.hrv-anat{display:block;inline-size:68px;block-size:76px;overflow:visible}
.hrv-anat .ms{fill:var(--h-ms)}
.hrv-anat .hl{fill:var(--h-lt);opacity:.22}
.hrv-anat .dp{fill:var(--h-dp);opacity:.6}
.hrv-anat .au{fill:var(--h-pa)}
.hrv-anat .vn{fill:var(--h-vn)}
.hrv-anat .ar{stroke:var(--h-ar);fill:none}
.hrv-anat .pa{stroke:var(--h-pa);fill:none}
.hrv-anat .cv{fill:none;stroke:var(--h-lt);stroke-width:2.2;stroke-linecap:round;opacity:.7}
.hrv-anat .vl{fill:none;stroke:var(--h-lt);stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
.hrv-anat .fl{fill:var(--h-lt);opacity:0;animation-duration:inherit;animation-fill-mode:both}
.hrv-heart.beat{animation-name:hrv-heartbeat;animation-fill-mode:both}
.hrv-heart.beat .fl{animation-name:hrv-heartflash}
@keyframes hrv-heartbeat{
  0%{transform:none;animation-timing-function:cubic-bezier(.4,0,.7,1)}
  32%{transform:translateY(-3px) scale(.88);animation-timing-function:cubic-bezier(.2,.7,.35,1)}
  100%{transform:none}}
@keyframes hrv-heartflash{0%{opacity:0;animation-timing-function:ease-in}32%{opacity:.5;animation-timing-function:ease-out}100%{opacity:0}}
.hrv-beatn{color:var(--mut);font-size:.74rem;font-weight:600;margin-block-start:2px}
.hrv-howfold{inline-size:100%}
.hrv-howfold>summary{cursor:pointer;color:var(--a);font-weight:700;padding-block:6px}
@media (prefers-reduced-motion:reduce){.hrv-heart.beat{animation-name:none}}
/* a result's extras (views/hrv-extras.js): Stress and the resting heart rate side by side, then the minute */
.hrv-xs{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-block:10px}
.hrv-x{background:var(--surface2);border-radius:var(--rm);padding:10px 12px;display:flex;flex-direction:column;gap:2px;min-inline-size:0}
.hrv-x>span{color:var(--mut);font-size:.78rem;font-weight:700}
.hrv-x>b{font-size:1.6rem;font-weight:800;line-height:1.1}
.hrv-x>b small{font-size:.8rem;color:var(--mut);font-weight:600}
.hrv-x .dot{display:inline-block;inline-size:8px;block-size:8px;border-radius:50%;margin-inline-end:5px;background:var(--mut)}
.hrv-x[data-band=low] .dot{background:var(--green)}.hrv-x[data-band=moderate] .dot{background:var(--amber)}.hrv-x[data-band=high] .dot{background:var(--red)}
.hrv-x p{margin:4px 0 0}
.hrv-xrr{margin-block:10px}
.hrv-siwarn{margin:4px 0 0}
/* HRV so far (views/hrv-converge.js): the estimate and its band over the minute, under the ring; the band a soft wash
   of the trace's ink, the estimate its line, the newest a dot; blank (space held) until the first estimate */
.hrv-conv{inline-size:100%;display:flex;flex-direction:column;gap:2px}
.hrv-conv-h{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.hrv-conv-h>small:first-child{color:var(--mut);font-weight:600}
.hrv-conv-n b{font-size:1.25rem;font-weight:800;color:var(--ink)}
.hrv-conv-n small{color:var(--mut);margin-inline-start:2px}
.hrv-conv-pm{color:var(--mut);font-variant-numeric:tabular-nums}
.hrv-conv-g{inline-size:100%;block-size:auto;aspect-ratio:300/40;background:var(--surface2);border-radius:var(--rm)}
.hrv-conv-g .ax{stroke:var(--line);stroke-width:1}
.hrv-conv-g .band{fill:color-mix(in srgb,var(--paper-curve-1) 18%,transparent);stroke:none}
.hrv-conv-g .est{fill:none;stroke:var(--paper-curve-1);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hrv-conv-g .dot{fill:var(--paper-curve-1)}
.hrv-conv[data-ready="0"] .hrv-conv-n b{color:var(--mut)}
