/* The Morning HRV card (views/hrv-card.js, views/hrv-morning.js, views/hrv-draw.js): the morning story on a soft
   gradient, the state map, where you stand. Colours come from the tokens in style.css only; the pictures run left to
   right in Hebrew too (.ltr), their words isolated. */
.hrv-d{gap:12px}
.hrv-d .card.flat{border-radius:var(--r)}
/* The story is the card people read: its pill's tone (data-tone: good, warn, bad, mut) colours its top edge, a glow in
   a corner, the first fact's dot, the advice box and its tick, over the violet to pink gradient; the two numbers in
   violet and pink. Tokens only (style.css), so dark mode follows. */
.hrv-story,:is(#app,#pane) .card.hrv-story{gap:8px;padding:16px;border:0;border-block-start:4px solid var(--a);
  background:radial-gradient(90% 60% at 100% 0%,color-mix(in srgb,var(--a) 24%,transparent),transparent 70%),
    linear-gradient(160deg,var(--a-soft),color-mix(in srgb,var(--b-soft) 70%,var(--surface)))}
:is(#app,#pane,body) .card.hrv-story[data-tone=good]{border-block-start-color:var(--c);
  background:radial-gradient(90% 60% at 100% 0%,color-mix(in srgb,var(--c) 24%,transparent),transparent 70%),
    linear-gradient(160deg,var(--a-soft),color-mix(in srgb,var(--b-soft) 70%,var(--surface)))}
:is(#app,#pane,body) .card.hrv-story[data-tone=warn]{border-block-start-color:var(--d);
  background:radial-gradient(90% 60% at 100% 0%,color-mix(in srgb,var(--d) 24%,transparent),transparent 70%),
    linear-gradient(160deg,var(--a-soft),color-mix(in srgb,var(--b-soft) 70%,var(--surface)))}
:is(#app,#pane,body) .card.hrv-story[data-tone=bad]{border-block-start-color:var(--red);
  background:radial-gradient(90% 60% at 100% 0%,color-mix(in srgb,var(--red) 24%,transparent),transparent 70%),
    linear-gradient(160deg,var(--a-soft),color-mix(in srgb,var(--b-soft) 70%,var(--surface)))}
.hrv-story .hrv-big b{color:var(--a)}
.hrv-story .hrv-big.sm b{color:var(--b)}
.hrv-top{display:flex;align-items:flex-end;gap:18px}
.hrv-big{display:flex;flex-direction:column;min-inline-size:0}
.hrv-big span{font-size:.74rem;font-weight:700;color:var(--mut)}
.hrv-big b{font:600 2.9rem/1 var(--serif);letter-spacing:-.03em;color:var(--ink)}
.hrv-big b small{font:700 .8rem var(--sans);letter-spacing:0;color:var(--mut);margin-inline-start:4px}
.hrv-big.sm b{font-size:1.9rem}
.hrv-story .hrv-state{margin-block-start:2px}
.hrv-story .hrv-head{display:block;text-transform:none;margin:2px 0 0;font:600 1.4rem/1.18 var(--serif);letter-spacing:-.01em;color:var(--ink)}
.hrv-story .hrv-why{gap:5px}
.hrv-story .hrv-why li{display:flex;gap:8px;font-size:.9rem}
.hrv-story .hrv-why li::before{content:'';flex:none;inline-size:8px;block-size:8px;border-radius:50%;background:var(--b);margin-block-start:.45em}
.hrv-story .hrv-why li:first-child::before{background:var(--a)}
.hrv-story .hrv-sug{margin-block-start:4px;padding:10px 12px;border-radius:var(--rm);background:var(--a-soft);border-inline-start:4px solid var(--a);color:var(--ink)}
.hrv-story .hrv-sug svg{color:var(--a)}
.hrv-story[data-tone=good] .hrv-why li:first-child::before{background:var(--c)}
.hrv-story[data-tone=good] .hrv-sug svg{color:var(--c)}
.hrv-story[data-tone=good] .hrv-sug{background:var(--c-soft);border-inline-start-color:var(--c)}
.hrv-story[data-tone=warn] .hrv-why li:first-child::before{background:var(--d)}
.hrv-story[data-tone=warn] .hrv-sug svg{color:var(--d)}
.hrv-story[data-tone=warn] .hrv-sug{background:var(--d-soft);border-inline-start-color:var(--d)}
.hrv-story[data-tone=bad] .hrv-why li:first-child::before{background:var(--red)}
.hrv-story[data-tone=bad] .hrv-sug svg{color:var(--red)}
.hrv-story[data-tone=bad] .hrv-sug{background:var(--red-t);border-inline-start-color:var(--red)}
.hrv-all{display:inline-flex;align-items:center;gap:4px;font-weight:600;min-block-size:48px;align-self:flex-start}
/* The map and where you stand: plain cards, a section title, the picture full width; where you stand is a closed
   card (lib/fold.js), so its section drops the card's own frame inside it. */
.hrv-d details.fc{border-radius:var(--r)}
details.fc .hrv-where,details.fc .hrv-xrr{display:flex;flex-direction:column;gap:8px;padding:0;margin:0;background:none}
.hrv-mapcard,.hrv-where,:is(#app,#pane) .card.hrv-mapcard,:is(#app,#pane) .card.hrv-where{background:var(--surface);display:flex;flex-direction:column;gap:8px;padding:16px}
.hrv-mapcard .sec,.hrv-where .sec{margin:0 0 2px}
.hrv-read{margin:2px 2px 0;font-size:.92rem;color:var(--ink2)}
.hrv-moved{margin:0 2px;font-size:.8rem;color:var(--mut)}
.hrv-place{margin:0 2px;font-size:.88rem;color:var(--ink2);line-height:1.45}
.hrv-where .hrv-note{margin:0 2px;font-size:.74rem;line-height:1.45;color:var(--mut)}
.hrv-mapwrap{position:relative}
.hrv-fill{position:absolute;inset-inline:16%;inset-block-start:50%;transform:translateY(-50%);margin:0;padding:10px 14px;border-radius:var(--rm);background:var(--surface);box-shadow:var(--shadow);text-align:center;font-size:.86rem;font-weight:700;color:var(--ink2)}
.hrv-map,.hrv-scale,.hrv-trend14{display:block;inline-size:100%;block-size:auto;overflow:visible}
.hrv-d svg text{font-family:var(--sans)}
/* The state map: each pill state's region in its colour (the pill's own thresholds), the axes through the usual, word
   pills, the trail and today. */
.hrv-map .bg{fill:color-mix(in srgb,var(--surface) 70%,var(--bg))}
.hrv-map .reg{stroke:var(--surface);stroke-width:1.5}
.hrv-map .f-c{fill:var(--c-soft)}.hrv-map .f-a{fill:var(--a-soft)}.hrv-map .f-d{fill:var(--d-soft)}.hrv-map .f-b{fill:var(--b-soft)}
.hrv-map .f-red{fill:color-mix(in srgb,var(--red) 18%,var(--surface))}
.hrv-map .axis{stroke:var(--mut);stroke-opacity:.35;stroke-dasharray:3 5}
.hrv-map .ax{font-size:10.5px;font-weight:700;fill:var(--mut)}
.hrv-map .pillbg{fill:var(--surface);fill-opacity:.92;stroke-width:1.5}
.hrv-map .word{font-size:12px;font-weight:800}
.hrv-map .t-c{fill:var(--c);stroke:var(--c)}.hrv-map .t-a{fill:var(--a);stroke:var(--a)}.hrv-map .t-d{fill:var(--d);stroke:var(--d)}
.hrv-map .t-b{fill:var(--b);stroke:var(--b)}.hrv-map .t-red{fill:var(--red);stroke:var(--red)}
.hrv-map .pillbg.t-c,.hrv-map .pillbg.t-a,.hrv-map .pillbg.t-d,.hrv-map .pillbg.t-b,.hrv-map .pillbg.t-red{fill:var(--surface)}
.hrv-map text.word{stroke:none}
.hrv-map circle.node{stroke:var(--surface);stroke-width:1.5}
.hrv-map .toward{fill:none;stroke-width:2.2;stroke-dasharray:1 4;stroke-linecap:round}
.hrv-map .trail-halo{fill:none;stroke:var(--surface);stroke-width:4.5;opacity:.8}
.hrv-map .trail{fill:none;stroke:var(--ink);stroke-opacity:.55;stroke-width:1.6}
.hrv-map .past{fill:var(--ink);stroke:var(--surface);stroke-width:1.5}
.hrv-map .day,.hrv-map .today{font-weight:800;paint-order:stroke;stroke:var(--surface);stroke-width:3;stroke-linejoin:round}
.hrv-map .day{font-size:9.5px;fill:var(--ink2)}
.hrv-map .today{font-size:12.5px;fill:var(--ink)}
.hrv-d .you{fill:var(--ink);stroke:var(--surface);stroke-width:3}
.hrv-d .pulse{fill:var(--a);opacity:.5;transform-box:fill-box;transform-origin:center;animation:hrv-pulse 2.4s ease-out infinite}
@keyframes hrv-pulse{0%{transform:scale(.6);opacity:.9}100%{transform:scale(2.2);opacity:0}}
@media (prefers-reduced-motion:reduce){.hrv-d .pulse{animation:none;opacity:.35;transform:scale(1.5)}}
.hrv-map.grey{filter:grayscale(1);opacity:.55}
/* The population strip. */
.hrv-scale .s-d{stop-color:var(--d)}.hrv-scale .s-c{stop-color:var(--c)}.hrv-scale .s-line{stop-color:var(--line)}
.hrv-scale .mid{fill:var(--ink);opacity:.07}
.hrv-scale .band{fill:var(--a);fill-opacity:.18;stroke:var(--a);stroke-width:1.5}
.hrv-scale .tick{stroke:var(--mut);stroke-width:1.5}
.hrv-scale .num{font-size:12px;font-weight:800;fill:var(--ink2)}
.hrv-scale .cap{font-size:10.5px;font-weight:600;fill:var(--mut)}
.hrv-scale .a{fill:var(--a);font-weight:800}
.hrv-scale .you-t{font-size:12.5px;font-weight:800;fill:var(--ink)}
.hrv-scale .grp{font-size:11px;font-weight:700;fill:var(--mut)}
/* The last 14 mornings. */
.hrv-trend14 .grid{stroke:var(--line);stroke-dasharray:2 4}
.hrv-trend14 .ax{font-size:10px;fill:var(--mut)}
.hrv-trend14 .band{fill:var(--c);fill-opacity:.16}
.hrv-trend14 .usual{fill:none;stroke:var(--c);stroke-width:1.3;stroke-dasharray:4 4;opacity:.8}
.hrv-trend14 .area{fill:var(--a);fill-opacity:.12}
.hrv-trend14 .line{fill:none;stroke:var(--a);stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.hrv-trend14 .pt{fill:var(--surface);stroke:var(--a);stroke-width:1.6}
.hrv-trend14 .last{fill:var(--a);stroke:var(--surface);stroke-width:2.5}
.hrv-trend14 .num{font-size:11px;font-weight:800;fill:var(--ink2)}
.hrv-trend14 .today{font-size:13px;font-weight:800;fill:var(--a)}
.hrv-trend14 .day{font-size:10px;font-weight:600;fill:var(--mut)}
.hrv-trend14 .day.now{font-weight:800;fill:var(--a)}
.hrv-trend14 .key{fill:var(--c);fill-opacity:.3}
.hrv-trend14 .key-t{font-size:10px;font-weight:700;fill:var(--c)}
/* The map's buttons: each pill carries a "?" and the axis labels a dotted underline, so both read as tappable; the
   explanation bubble (views/hrv-map-tips.js) sits beside the one tapped, inside the map's frame. */
.hrv-map .mpill,.hrv-map .maxis{cursor:pointer;outline:none}
.hrv-map .mpill:focus-visible .pillbg,.hrv-map .maxis:focus-visible .axhit{stroke:var(--ink);stroke-width:2.5}
.hrv-map .mpill[aria-expanded=true] .pillbg{stroke-width:2.5}
.hrv-map .q{fill-opacity:.16;stroke-width:1.2}
.hrv-map .qm{font-size:10px;font-weight:900;fill:var(--ink2)}
.hrv-map .axhit{fill:var(--surface);fill-opacity:.6;stroke:none}
.hrv-map .maxis .ax{text-decoration:underline dotted;text-underline-offset:2px}
.hrv-tip{position:absolute;z-index:3;inline-size:min(260px,82%);padding:10px 12px;border-radius:var(--rm);background:var(--ink);color:var(--surface);
  font-size:.84rem;line-height:1.4;box-shadow:var(--shadow);opacity:0;pointer-events:none;transform:translateY(-4px);transition:opacity .18s,transform .18s}
.hrv-tip.up{transform:translateY(4px)}
.hrv-tip.on{opacity:1;pointer-events:auto;transform:none}
.hrv-tip:empty{display:none}
.hrv-tip p{margin:0 0 4px}
.hrv-tip .mut{color:color-mix(in srgb,var(--surface) 72%,var(--ink))}
.hrv-tip .link{color:var(--surface);font-weight:800;text-decoration:underline;min-block-size:32px}
@media (prefers-reduced-motion:reduce){.hrv-tip{transition:none;transform:none}}
