/* Chrysalis v2: the lab result card at the top of the product page (Claude, 15 Nov 2026; inc/v2/v2-coa.php, SPEC-coa.md).
   Loaded only on a product page that has a lab report, while chvc_on(). Every rule sits under body.chv2s3 (the product page's
   dark look, assets/v4/v2-product.css), so nothing here can reach another page.
   Closed: a 52 px glass pill. The green mark and the 44 px ring each sit concentric in the pill's round ends (12 + 14 = 4 + 22
   = 26 px, the pill's radius). Open: the same radius, the ring fills white and its chevron turns (the site's question-row
   motion), the body unrolls in 300 ms. Reduced motion: every change at once. No new colours: white, the card's glass, the
   page's greys and the site's green #34C28A for the mark only. */

.chv2s3 .chvc{
  --chvc-r:26px;
  --chvc-ring:rgba(255,255,255,.28);
  --chvc-t:300ms;                         /* the card grows / folds */
  --chvc-ez:cubic-bezier(.22,1,.36,1);    /* the page's own --soft curve */
  --chvc-q:180ms;                         /* ring fill, hover (the site's question rows) */
  --chvc-qez:cubic-bezier(.165,.84,.44,1);
  container:chvc/inline-size;
  position:relative;isolation:isolate;margin-top:14px;border-radius:var(--chvc-r);color:#fff;
  background:linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.028));
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12),inset 0 1px 0 rgba(255,255,255,.16)
}
.chv2s3 .chvc[hidden]{display:none}
/* Air around the card (Alik, 15 Nov 2026: "not too close"): price, 14 px, card, 14 px, the switch (was 18 px from the price).
   A card that is hidden (a size its report does not cover) leaves the switch's own margin alone. */
.chv2s3 .chvc:not([hidden])+.p3-fmtc,.chv2s3 .chvc:not([hidden])+.p3-qty{margin-top:14px}
@media (min-width:900px){ /* computer: the same rule, price, 12 px, card, 10 px, the switch (was 22 px from the price): Add to cart moves down by the row's 52 px, not more (review, 15 Nov) */
  .chv2s3 .chvc{margin-top:16px}
  .chv2s3 .chvc:not([hidden])+.p3-fmtc,.chv2s3 .chvc:not([hidden])+.p3-qty{margin-top:16px}
}

/* ---------- the row (one button) ---------- */
.chv2s3 .chvc__head{
  position:relative;display:flex;align-items:center;gap:8px;width:100%;min-height:52px;margin:0;padding:4px 4px 4px 12px;
  border:0;border-radius:var(--chvc-r);background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation
}
.chv2s3 .chvc__head::before{content:"";position:absolute;inset:0;border-radius:inherit;background:rgba(255,255,255,.04);opacity:0;pointer-events:none;
  transition:opacity var(--chvc-q) var(--chvc-qez)}
.chv2s3 .chvc__head:focus-visible{outline:2px solid #fff;outline-offset:3px}

/* the "tested" mark: the old line's green disc, a size down */
.chv2s3 .chvc__ok{flex:none;display:grid;place-items:center;width:28px;height:28px;margin-right:2px;border-radius:50%;background:#34C28A;color:#03140c;
  box-shadow:0 0 0 4px rgba(52,194,138,.14)}
.chv2s3 .chvc__ok svg{display:block;width:15px;height:15px}

.chv2s3 .chvc__m{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px;padding:3px 0}
.chv2s3 .chvc__t{font-size:15px;font-size:clamp(13.25px,4.5cqi,15px);font-weight:600;line-height:1.2;letter-spacing:-.012em;text-wrap:pretty;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis} /* one line (review, 15 Nov): on a slow line the page first showed the system
  font (the site's bold cut arrived last), which is wider: the title took two lines, the row 67 px, and the whole buy box jumped 15 px up
  when the font arrived. Now the row is 52 px from the first paint and nothing moves; v2-coa.php also fetches the bold cut early, so the
  moment in which the system font stands in (and the last letters are cut) is rare and short. */
.chv2s3 .chvc__t[hidden]{display:none}
.chv2s3 .chvc__s{font-size:12.5px;font-weight:400;line-height:1.2;color:#a6a7ad}
/* a 360 or 375 px phone (the card is under 315 px wide; review, 15 Nov: was 305, 375 px phones had 2.7 % to spare): the row
   gives its words 6 px more room, so the longer wording ("Lab-tested batch · 99.99% purity") sits on one line with room to
   spare and the row keeps its 52 px */
@container chvc (max-width:315px){
  .chv2s3 .chvc__head{gap:6px}
  .chv2s3 .chvc__ok{margin-right:0}
}
/* narrower than a 360 px phone (344, 320: rare): the longer wording needs two lines there, so it may wrap as before */
@container chvc (max-width:293px){
  .chv2s3 .chvc__t{white-space:normal;overflow:visible;text-overflow:clip}
}
/* and anywhere the words still do not fit once the page and its fonts are in (large text set on the phone, a font that failed):
   v2-coa.js sets .is-wrap and the title wraps instead of staying cut */
.chv2s3 .chvc.is-wrap .chvc__t{white-space:normal;overflow:visible;text-overflow:clip}
html.no-js .chv2s3 .chvc__t{white-space:normal;overflow:visible;text-overflow:clip} /* no script: nothing can measure, so it may wrap */

/* the chevron in its ring */
.chv2s3 .chvc__go{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;color:#fff;
  box-shadow:inset 0 0 0 1px var(--chvc-ring);
  transition:background-color var(--chvc-q) var(--chvc-qez),box-shadow var(--chvc-q) var(--chvc-qez),color var(--chvc-q) var(--chvc-qez),transform 140ms ease-out}
.chv2s3 .chvc__go svg{display:block;width:18px;height:18px;transition:transform var(--chvc-t) var(--chvc-ez)}
.chv2s3 .chvc.is-open .chvc__go{background:#fff;box-shadow:inset 0 0 0 1px #fff;color:#0E0E10}
.chv2s3 .chvc.is-open .chvc__go svg{transform:rotate(-180deg)}
.chv2s3 .chvc__head:active .chvc__go{transform:scale(.96)}
@media (hover:hover) and (pointer:fine){
  .chv2s3 .chvc__head:hover::before{opacity:1}
  .chv2s3 .chvc__head:hover .chvc__go{box-shadow:inset 0 0 0 1px #fff}
}

/* ---------- the body: unrolls from 0 to its own height (grid rows 0fr -> 1fr), hidden from taps and readers while shut ---------- */
.chv2s3 .chvc__body{display:grid;grid-template-rows:0fr;visibility:hidden;
  transition:grid-template-rows var(--chvc-t) var(--chvc-ez),visibility 0s linear var(--chvc-t)}
.chv2s3 .chvc.is-open .chvc__body{grid-template-rows:1fr;visibility:visible;transition:grid-template-rows var(--chvc-t) var(--chvc-ez),visibility 0s}
.chv2s3 .chvc__clip{min-height:0;overflow:hidden}

/* phone (and any card under 430 px): the page beside the four facts, the button under both */
.chv2s3 .chvc__in{position:relative;display:grid;grid-template-columns:104px minmax(0,1fr);grid-template-areas:"doc facts" "btn btn";
  column-gap:16px;row-gap:16px;padding:16px 12px 12px}
.chv2s3 .chvc__in::before{content:"";position:absolute;top:0;left:12px;right:12px;height:1px;background:rgba(255,255,255,.1)}
.chv2s3 .chvc__in:not(:has(.chvc__doc)){grid-template-columns:minmax(0,1fr);grid-template-areas:"facts" "btn"}
.chv2s3 .chvc__in:not(:has(.chvc__doc)) .chvc__facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px} /* no picture: two by two */

/* what is inside rises 6 px and fades in, a little after the card starts to grow; folding, it simply fades */
.chv2s3 .chvc__in>*{opacity:0;transform:translateY(6px);transition:opacity 140ms ease-out,transform 140ms ease-out}
.chv2s3 .chvc.is-open .chvc__in>*{opacity:1;transform:none;transition:opacity 220ms var(--chvc-ez),transform var(--chvc-t) var(--chvc-ez)}
.chv2s3 .chvc.is-open .chvc__in>.chvc__facts{transition-delay:40ms}
.chv2s3 .chvc.is-open .chvc__in>.chvc__btn{transition-delay:80ms}

/* the report's first page: a sheet of paper, tap = the PDF */
.chv2s3 .chvc__doc{grid-area:doc;position:relative;display:block;align-self:start;border-radius:5px;background:#fff;
  box-shadow:0 0 0 1px rgba(255,255,255,.1),0 14px 26px -12px rgba(0,0,0,.85);
  -webkit-tap-highlight-color:transparent}
.chv2s3 .chvc__doc img{display:block;width:100%;height:auto;border-radius:inherit} /* its width and height attributes keep the room */
.chv2s3 .chvc__docgo{position:absolute;right:-7px;bottom:-7px;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;
  background:#0E0E10;color:#fff;box-shadow:0 0 0 1px rgba(255,255,255,.3),0 4px 10px rgba(0,0,0,.45);
  transition:background-color var(--chvc-q) var(--chvc-qez),color var(--chvc-q) var(--chvc-qez)}
.chv2s3 .chvc__docgo svg{display:block;width:14px;height:14px}
.chv2s3 .chvc.is-open .chvc__doc{transition:opacity 220ms var(--chvc-ez),transform var(--chvc-t) var(--chvc-ez),box-shadow var(--chvc-q) var(--chvc-qez)}
@media (hover:hover) and (pointer:fine){
  .chv2s3 .chvc.is-open .chvc__doc:hover{transform:translateY(-2px);box-shadow:0 0 0 1px rgba(255,255,255,.16),0 18px 30px -12px rgba(0,0,0,.9)}
  .chv2s3 .chvc__doc:hover .chvc__docgo{background:#fff;color:#0E0E10}
}

/* the facts */
.chv2s3 .chvc__facts{grid-area:facts;display:grid;grid-template-columns:minmax(0,1fr);align-content:space-between;gap:8px;margin:0;padding:0}
.chv2s3 .chvc__f{min-width:0;margin:0}
.chv2s3 .chvc__f dt{margin:0;font-size:12px;font-weight:400;line-height:1.3;letter-spacing:.005em;color:#a6a7ad}
.chv2s3 .chvc__f dd{margin:2px 0 0;font-size:16px;font-weight:500;line-height:1.25;letter-spacing:-.01em;color:#fff;font-variant-numeric:tabular-nums}
.chv2s3 .chvc__tag{display:inline-block;margin-left:6px;padding:3px 8px;border-radius:999px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.22);
  font-size:11.5px;font-weight:500;line-height:1.2;letter-spacing:0;color:#d5d6db;vertical-align:1.5px;white-space:nowrap}

/* one button: the lab's own copy of the report */
.chv2s3 .chvc__btn{grid-area:btn;display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border-radius:999px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.32);color:#fff;font-size:16px;font-weight:500;line-height:1.2;text-decoration:none;
  -webkit-tap-highlight-color:transparent}
.chv2s3 .chvc__btn svg{display:block;flex:none;width:16px;height:16px}
.chv2s3 .chvc.is-open .chvc__btn{transition:opacity 220ms var(--chvc-ez) 80ms,transform var(--chvc-t) var(--chvc-ez) 80ms,background-color var(--chvc-q) var(--chvc-qez),box-shadow var(--chvc-q) var(--chvc-qez)}
.chv2s3 .chvc__btn:active{background:rgba(255,255,255,.1)}
.chv2s3 .chvc__btn:focus-visible,.chv2s3 .chvc__doc:focus-visible{outline:2px solid #fff;outline-offset:3px}
@media (hover:hover) and (pointer:fine){
  .chv2s3 .chvc__btn:hover{background:rgba(255,255,255,.08);box-shadow:inset 0 0 0 1px #fff}
}

/* a wide card (computer): the page on the left, the facts in two columns and the button under them, beside the page.
   Review (15 Nov): from 430 px, not 400, and the second column takes the width of its own words. On a 1280 to 1439 px wide
   window the card is 404 to 447 px and two equal columns were too narrow: "30 mg vial" fell onto its own line and the lab's
   name onto two. Under 430 px the card keeps the phone layout (one column of facts); from 560 px (tablet) two equal columns. */
@container chvc (min-width:400px){
  .chv2s3 .chvc__t{font-size:16px} /* the row's words keep their computer size from 400 px, as before */
}
@container chvc (min-width:430px){
  .chv2s3 .chvc__in{grid-template-columns:104px minmax(0,1fr);grid-template-areas:"doc facts" "doc btn";grid-template-rows:1fr auto;
    column-gap:20px;row-gap:14px;padding:18px 16px 16px}
  .chv2s3 .chvc__in::before{left:16px;right:16px}
  .chv2s3 .chvc__in:not(:has(.chvc__doc)){grid-template-columns:minmax(0,1fr);grid-template-areas:"facts" "btn";grid-template-rows:auto auto}
  .chv2s3 .chvc__facts{grid-template-columns:minmax(0,1fr) auto;align-content:start;gap:16px 18px}
  .chv2s3 .chvc__btn{align-self:end}
}
@container chvc (min-width:560px){
  .chv2s3 .chvc__facts{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* no script (rare): nothing to fold, the card simply shows everything */
html.no-js .chv2s3 .chvc__body{grid-template-rows:1fr;visibility:visible}
html.no-js .chv2s3 .chvc__in>*{opacity:1;transform:none}
html.no-js .chv2s3 .chvc__go{display:none}

/* reduced motion: every change at once */
@media (prefers-reduced-motion:reduce){
  .chv2s3 .chvc,.chv2s3 .chvc *,.chv2s3 .chvc *::before{transition:none!important}
}
html.rm .chv2s3 .chvc,html.rm .chv2s3 .chvc *,html.rm .chv2s3 .chvc *::before{transition:none!important}
