/* Calculator round 4 (Claude, 19 Nov 2026; inc/v2/v2-calc4.php, template-parts/v2/calc4.php, v2-calc4.js). Loaded only while the
   switch chv2_calc4 is on; laid over assets/v3/calc/calc.css, v2-dark.css and v2-calc.css. Every rule sits under body.chv2-calc4.
   1. mode tiles with icons (Single · Blend · Pen · Spray), the chosen one a white tile as the tab bar's chosen tab;
   2. numbered steps, one even rhythm, labels with their link on one row;
   3. Blend: each compound's remove button beside its name;
   4. Spray: the bottle and a dot per spray in the result card, its four figures in two rows. No green here. */

/* ---------- 1. mode tiles ---------- */
body.chv2-calc4 .c3-root.k3c-page .k3c4-modes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
body.chv2-calc4 .c3-root.k3c-page .k3c4-mode{-webkit-appearance:none;appearance:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:78px;margin:0;padding:12px 4px 11px;
  border:0;border-radius:18px;background:var(--tile);box-shadow:inset 0 0 0 1px var(--line);color:var(--mute);font:inherit;font-size:14px;font-weight:500;line-height:1.1;letter-spacing:-.005em;
  cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:background-color .2s,color .2s,box-shadow .2s,transform .16s cubic-bezier(.2,.7,.2,1)}
body.chv2-calc4 .c3-root.k3c-page .k3c4-mode[aria-pressed="true"]{background:var(--ink);color:#fff;box-shadow:none}
body.chv2-calc4 .c3-root.k3c-page .k3c4-mode__i{display:block;flex:none;width:28px;height:28px}
body.chv2-calc4 .c3-root.k3c-page .k3c4-mode__l{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.chv2-calc4 .c3-root.k3c-page .k3c4-mode__f{display:none}   /* the short label at every width (19 Nov review: "Single compound" was cut at 900-1366 px); the full name stays the button's name */
body.chv2-calc4 .c3-root.k3c-page .k3c4-mode:focus-visible{outline:2px solid currentColor;outline-offset:3px}
body.chv2-calc4 .c3-root.k3c-page .k3c4-mode:active{transform:scale(.965)}
/* dark look: glass tiles, the chosen one white with black (as the phone tab bar's chosen tab) */
body.chv2-calc4.chv2d .c3-root.k3c-page .k3c4-mode,body.chv2-calc4 .chv2d .c3-root.k3c-page .k3c4-mode{background:linear-gradient(180deg,rgba(255,255,255,.075) 0%,rgba(255,255,255,.035) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.1),inset 0 0 0 1px rgba(255,255,255,.1);color:#B4B5BB}
body.chv2-calc4.chv2d .c3-root.k3c-page .k3c4-mode[aria-pressed="true"],body.chv2-calc4 .chv2d .c3-root.k3c-page .k3c4-mode[aria-pressed="true"]{background:linear-gradient(180deg,#fff 0%,#eceef1 100%);color:#0E0E10;
  box-shadow:inset 0 1px 0 #fff,0 12px 26px -14px rgba(0,0,0,.9)}
body.chv2-calc4.chv2d .c3-root.k3c-page .k3c4-mode:focus-visible{outline-color:#fff}
body.chv2-calc4.chv2d .c3-root.k3c-page .k3c4-mode[aria-pressed="true"]:focus-visible{outline-color:#fff}
@media (hover:hover){
  body.chv2-calc4 .c3-root.k3c-page .k3c4-mode:not([aria-pressed="true"]):hover{color:var(--ink)}
  body.chv2-calc4.chv2d .c3-root.k3c-page .k3c4-mode:not([aria-pressed="true"]):hover{color:#fff;background:rgba(255,255,255,.1)}
}
@media (min-width:900px){
  body.chv2-calc4 .c3-root.k3c-page .k3c4-modes{gap:10px}
  body.chv2-calc4 .c3-root.k3c-page .k3c4-mode{min-height:92px;gap:10px;font-size:15px;border-radius:20px}
  body.chv2-calc4 .c3-root.k3c-page .k3c4-mode__i{width:30px;height:30px}
}
@media (max-width:359px){
  body.chv2-calc4 .c3-root.k3c-page .k3c4-modes{gap:6px}
  body.chv2-calc4 .c3-root.k3c-page .k3c4-mode{min-height:72px;font-size:13px;border-radius:16px}
  body.chv2-calc4 .c3-root.k3c-page .k3c4-mode__i{width:26px;height:26px}
}

/* ---------- 2. steps: number, label, field; one rhythm ---------- */
body.chv2-calc4 .c3-root.k3c-page .k3c-in{counter-reset:k3c4}
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f:not([hidden]){counter-increment:k3c4}
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f{margin-top:22px;padding-top:22px}
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c4-modes + .k3c-f,body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c4-modes ~ .k3c-f[hidden] + .k3c-f:not([hidden]){margin-top:26px}
body.chv2-calc4 .c3-root.k3c-page .k3c-in .k3c-l{display:flex;align-items:center;min-height:22px;margin:0 0 12px}
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f > .k3c-l:first-child::before,
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f > .k3c-lrow > .k3c-l::before,
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--parts > legend.k3c-l::before,
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--pair > .k3c-f__half:first-child > .k3c-l::before{
  content:counter(k3c4);flex:none;display:inline-grid;place-items:center;width:22px;height:22px;margin-right:10px;border-radius:50%;
  background:var(--tile-2);color:var(--ink);font-size:11.5px;font-weight:600;letter-spacing:0;line-height:1;font-feature-settings:"tnum" 1}
body.chv2-calc4.chv2d .c3-root.k3c-page .k3c-in .k3c-l::before{background:rgba(255,255,255,.1);box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);color:#fff}
/* Pen's two volumes side by side: the second label lines up with the first one's words */
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--pair > .k3c-f__half + .k3c-f__half > .k3c-l{padding-left:0}
/* the two halves share rows (label · box · error), so both boxes sit on one line whatever wraps or errors: a label on 2 lines
   ("Cartridge volume" with its number at 320-375 px) sits its last line on the same line as the other label */
body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--pair:not([hidden]){align-items:end}
@supports (grid-template-rows:subgrid){
  body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--pair:not([hidden]){grid-template-rows:auto auto auto;row-gap:0;align-items:stretch}
  body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--pair > .k3c-f__half{display:grid;grid-row:span 3;grid-template-rows:subgrid;grid-template-columns:minmax(0,1fr);align-content:start}
  body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--pair > .k3c-f__half > .k3c-l{align-self:end}
  body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--pair > .k3c-f__half > .k3c-box{grid-row:2}
  body.chv2-calc4 .c3-root.k3c-page .k3c-in > .k3c-f--pair > .k3c-f__half > .k3c-err{grid-row:3}
}
/* label row: the label left, its link (Bacteriostatic water, the chosen product) right, on one line */
body.chv2-calc4 .c3-root.k3c-page .k3c-lrow{align-items:center;gap:12px;margin:0 0 12px}
body.chv2-calc4 .c3-root.k3c-page .k3c-lrow > .k3c-l{flex:0 1 auto;min-width:0;margin:0}   /* may wrap to 2 lines at 320 px, as today */
body.chv2-calc4 .c3-root.k3c-page .k3c-lrow > .k3c-link{flex:0 0 auto;min-width:0;max-width:60%;margin:0;overflow:hidden}   /* the label wraps first; the link only cuts past 60% */
body.chv2-calc4 .c3-root.k3c-page .k3c-lrow > .k3c-link[hidden]{display:none}
body.chv2-calc4 .c3-root.k3c-page .k3c-lrow > .k3c-link > span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.chv2-calc4 .c3-root.k3c-page .k3c-lrow > .k3c-link .k3c-ico{flex:none}
/* under 360 px the chosen product's link shows its name only ("Semax"); the chosen chip right under it shows "Semax · 10 mg" */
@media (max-width:359px){body.chv2-calc4 .c3-root.k3c-page .k3c-lrow .k3c-link__amt{display:none}}
body.chv2-calc4 .c3-root.k3c-page .k3c-picks{margin-top:12px}
body.chv2-calc4 .c3-root.k3c-page .k3c-quick{margin-top:12px}
body.chv2-calc4 .c3-root.k3c-page .k3c-err:empty{display:none}
body.chv2-calc4 .c3-root.k3c-page .k3c-err:not(:empty){margin-top:8px}

/* Blend: "Amount per sample of" (which compound) and "Amount per sample" (how much) are one step: the second field takes no new
   number, keeps its label lined up (badge space kept, badge hidden) and sits 12 px under the first, no divider */
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="blend"] .k3c-in > .k3c-f[data-k3c-show="blend"]:not(.k3c-f--parts):not([hidden]) + .k3c-f{counter-increment:none;margin-top:12px;padding-top:0;border-top:0}
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="blend"] .k3c-in > .k3c-f[data-k3c-show="blend"]:not(.k3c-f--parts):not([hidden]) + .k3c-f > .k3c-l::before{visibility:hidden}

/* ---------- 3. Blend: name and remove on one row, amount under it ---------- */
@media (max-width:899px){
  body.chv2-calc4 .c3-root.k3c-page .k3c-part{grid-template-columns:minmax(0,1fr) 44px;grid-template-areas:"n x" "a a";row-gap:8px;column-gap:8px;padding-bottom:14px}
  body.chv2-calc4 .c3-root.k3c-page .k3c-part > .k3c-x{align-self:center}
  body.chv2-calc4 .c3-root.k3c-page .k3c-parts{gap:14px}
}

/* ---------- 4. Spray result ---------- */
body.chv2-calc4 .c3-root.k3c-page .k3c4-spray{display:flex;flex-direction:column;align-items:center;gap:12px;margin:0 auto 2px}
body.chv2-calc4 .c3-root.k3c-page .k3c4-spray[hidden]{display:none}
/* the render has air around the bottle (bottle 23% wide from x 38.5%, nozzle at y 12.5%, foot at y 86%): shown cropped */
body.chv2-calc4 .c3-root.k3c-page .k3c4-spray__img{display:block;width:288px;max-width:none;height:360px;margin:-40px 0 -46px;object-fit:contain;pointer-events:none;-webkit-user-select:none;user-select:none;
  -webkit-mask-image:linear-gradient(180deg,#000 0,#000 82%,transparent 88%);mask-image:linear-gradient(180deg,#000 0,#000 82%,transparent 88%)}
body.chv2-calc4 .c3-root.k3c-page .k3c4-spray__dots{display:flex;flex-wrap:wrap;justify-content:center;gap:7px;min-height:9px}
body.chv2-calc4 .c3-root.k3c-page .k3c4-spray__dots i{display:block;width:9px;height:9px;border-radius:50%;background:#fff;box-shadow:0 0 10px rgba(255,255,255,.35)}
body.chv2-calc4 .c3-root.k3c-page .k3c.is-bad .k3c4-spray__dots i{background:rgba(255,255,255,.3);box-shadow:none}
body.chv2-calc4.chv2-calc .c3-root.k3c-page .k3c-out .k3c4-spray{order:-3}
@media (max-width:899px){
  body.chv2-calc4 .c3-root.k3c-page .k3c4-spray__img{width:256px;height:320px;margin:-36px 0 -42px}
}
/* four figures in two rows: amount per spray · concentration / sprays per bottle · samples per bottle */
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="spray"] .k3c-stats{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:16px}
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="spray"] .k3c-stats > div{grid-column:auto;order:0}
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="spray"] .k3c-stats > .k3c4-st--sper{order:1}
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="spray"] .k3c-stats > div:nth-child(2){order:2}
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="spray"] .k3c-stats > .k3c4-st--sbot{order:3}
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="spray"] .k3c-stats > div:nth-child(3){order:4}
body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="spray"] .k3c-stats dt{min-height:0}
@media (max-width:359.98px){body.chv2-calc4 .c3-root.k3c-page .k3c[data-mode="spray"] .k3c-stats dt{min-height:2.6em}} /* 19 Nov polish: "Amount per spray" wraps, "Concentration" does not */
body.chv2-calc4 .c3-root.k3c-page .k3c-stats > div[hidden]{display:none}

@media (prefers-reduced-motion:reduce){
  body.chv2-calc4 .c3-root.k3c-page .k3c4-mode{transition:none}
  body.chv2-calc4 .c3-root.k3c-page .k3c4-mode:active{transform:none}
}
