/* Dilution calculator: storefront paper, green result card, native controls. */
.calc-main { padding-bottom:88px; }
.calc-heading { padding:8px 0 34px; border-bottom:1px solid var(--line); margin-bottom:34px; }
.calc-heading h1 { font-size:clamp(36px,4vw,56px); line-height:1.12; }
.calc-heading>p { max-width:670px; margin-top:20px; color:#505e50; font-size:18px; line-height:1.65; }
.calc-note { max-width:760px; margin-top:24px; padding:16px 18px; border:1px solid #d8cfa6; border-left:4px solid #c9a227; border-radius:var(--radius); background:#fbf6e4; font-size:15px; line-height:1.6; color:#4a4633; }
.calc-note strong { color:#7a5c12; }

.calc-tabs { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:26px; }
.calc-tab { min-height:46px; padding:12px 20px; border:1px solid var(--line); border-radius:var(--radius); background:transparent; color:var(--ink); font-family:var(--font); font-size:15px; font-weight:600; line-height:1.25; }
.calc-tab:hover { background:var(--cream); }
.calc-tab[aria-selected=true] { background:var(--green); border-color:var(--green); color:var(--paper); }

/* `display:grid` would otherwise win over the hidden attribute and keep both panels up. */
.calc-layout[hidden] { display:none; }
.calc-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,420px); gap:clamp(28px,4vw,56px); align-items:start; }
.calc-form { display:grid; gap:26px; padding:28px; border:1px solid var(--line); border-radius:var(--radius); background:#fffef8; }
.calc-field { min-width:0; }
.calc-field>label,.calc-label { display:block; margin-bottom:9px; font-size:15px; font-weight:600; line-height:1.4; }
.calc-hint { margin-top:8px; color:var(--muted); font-size:13.5px; line-height:1.5; }
.calc-row { display:flex; gap:10px; align-items:end; }
.calc-row>* { min-width:0; flex:1; }
.calc-sub { display:block; color:var(--muted); font-size:13px; font-weight:600; line-height:1.4; }
.calc-sub input { margin-top:6px; color:var(--ink); }

.calc-chips { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.calc-chips button { min-height:40px; padding:9px 14px; border:1px solid var(--bc-control-border,#aaada5); border-radius:999px; background:#fffef8; color:var(--ink); font-family:var(--font); font-size:14px; font-weight:600; }
.calc-chips button:hover { background:var(--cream); }
.calc-chips button[aria-pressed=true] { background:var(--lime); border-color:var(--ink); }
.calc-pick { flex:0 0 auto; min-height:48px; padding:13px 18px; border:1px solid var(--ink); border-radius:var(--bc-control-radius,6px); background:var(--cream); color:var(--ink); font-family:var(--font); font-size:15px; font-weight:600; }
.calc-pick:hover { background:var(--lime); }

.calc-seg { display:flex; border:1px solid var(--bc-control-border,#aaada5); border-radius:var(--bc-control-radius,6px); overflow:hidden; flex:0 0 150px; }
.calc-seg-wide { flex:1 1 auto; }
.calc-seg button { flex:1; min-height:48px; padding:12px 8px; border:0; border-right:1px solid var(--bc-control-border,#aaada5); background:#fffef8; color:var(--ink); font-family:var(--font); font-size:14px; font-weight:600; line-height:1.2; }
.calc-seg button:last-child { border-right:0; }
.calc-seg button:hover { background:var(--cream); }
.calc-seg button[aria-pressed=true] { background:var(--green); color:var(--paper); }

/* The grid keeps its items at their natural height, so a sticky card would have no room to
   travel in: the column wrapper stretches instead and the card sticks inside it. Sticking is
   switched on from the script only when the column is taller than the card by a usable margin —
   otherwise the card would unstick almost at once and slide up under the header. */
.calc-side { align-self:stretch; min-width:0; }
.calc-result { position:static; top:118px; max-height:calc(100vh - 134px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:28px; border:2px solid var(--ink); border-radius:var(--radius); background:var(--green); color:var(--paper); box-shadow:var(--shadow); }
.calc-result-wide { position:static; max-height:none; overflow:visible; }
.calc-side.is-sticky .calc-result { position:sticky; }
.calc-units { display:block; margin:0; font-size:clamp(44px,6vw,64px); font-weight:800; line-height:1; letter-spacing:-.04em; color:var(--lime); }
.calc-units-label { display:block; margin-top:8px; font-size:15px; font-weight:600; letter-spacing:0; color:var(--paper); opacity:.9; }

.calc-syringe { margin:20px 0 0; padding:14px 12px 10px; border-radius:var(--radius); background:var(--paper); }
.calc-syringe svg { display:block; width:100%; height:auto; }
.calc-syringe figcaption { margin-top:6px; color:#5c6a58; font-size:13px; line-height:1.4; text-align:center; }

.calc-facts { margin:20px 0 0; }
.calc-facts>div { display:flex; justify-content:space-between; gap:14px; padding:10px 0; border-top:1px solid rgba(245,242,232,.25); font-size:15px; }
.calc-facts dt { color:var(--paper); opacity:.85; }
.calc-facts dd { margin:0; font-weight:700; text-align:right; }

/* The notes live outside the sticky card — a card that grew with them would be as tall as the
   form and stop sticking — and above it, because a sticky card only ever travels downwards and
   would cover whatever follows it in the column. */
.calc-notes:empty { display:none; }
.calc-notes .calc-warning:first-child { margin-top:0; }
.calc-notes { margin-bottom:16px; }
.calc-notes .calc-warning { color:var(--ink); border-color:#d8cfa6; background:#fbf6e4; }
.calc-notes .calc-warning-bad { border-color:#e0b1a0; background:#fbeee9; }
.calc-warning { margin-top:16px; padding:13px 15px; border:1px solid #e4c96a; border-radius:var(--radius); background:rgba(228,201,106,.16); font-size:14px; line-height:1.5; }
.calc-warning strong { display:block; margin-bottom:3px; font-weight:700; }
.calc-warning-bad { border-color:#e79a7f; background:rgba(231,154,127,.18); }
.calc-result-wide .calc-warning { border-color:#c9a227; background:#fbf6e4; color:#4a4633; }
.calc-cta { width:100%; margin-top:20px; }

.calc-subhead { margin:0 0 14px; font-size:22px; line-height:1.2; }
.calc-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.calc-table { width:100%; border-collapse:collapse; font-size:15px; }
.calc-table th,.calc-table td { padding:11px 10px; text-align:left; border-bottom:1px solid rgba(245,242,232,.22); }
.calc-table th { font-size:12.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; opacity:.75; }
.calc-table td:last-child,.calc-table th:last-child { text-align:right; font-weight:700; }
.calc-table tr:last-child td { border-bottom:0; }
.calc-result-wide { background:#fffef8; color:var(--ink); }
.calc-result-wide .calc-table th,.calc-result-wide .calc-table td { border-bottom-color:var(--line); }
.calc-result-wide .calc-hint { color:var(--muted); }

.calc-total { margin-top:18px; padding:20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--cream); }
.calc-total-sum { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px 18px; align-items:baseline; margin:0 0 4px; }
.calc-total-sum b { font-size:20px; font-weight:800; }
.calc-total-sum span { font-size:20px; font-weight:800; color:var(--green); }
.calc-total p { margin:10px 0 0; color:var(--muted); font-size:13.5px; line-height:1.55; }
.calc-cart { list-style:none; margin:14px 0 0; padding:0; }
.calc-cart li { display:flex; justify-content:space-between; gap:14px; padding:10px 0; border-top:1px solid var(--line); font-size:15px; }
.calc-cart a { color:var(--ink); text-decoration:underline; text-underline-offset:4px; }
.calc-cart a:hover { color:var(--green); }
.calc-cart b { white-space:nowrap; font-weight:700; }

.calc-memo { margin-top:64px; padding-top:34px; border-top:1px solid var(--line); }
.calc-memo>h2 { margin:0 0 20px; font-size:clamp(24px,2.4vw,30px); line-height:1.2; }
.calc-memo-body { max-width:820px; font-size:17px; line-height:1.75; }
.calc-memo-body details { border-bottom:1px solid var(--line); }
.calc-memo-body summary { padding:18px 0; font-size:17px; font-weight:600; line-height:1.35; cursor:pointer; list-style:none; }
.calc-memo-body summary::-webkit-details-marker { display:none; }
.calc-memo-body summary::after { content:"+"; float:right; color:var(--green); font-size:20px; line-height:1.1; }
.calc-memo-body details[open] summary::after { content:"–"; }
.calc-memo-body details>*:not(summary) { margin:0 0 18px; }

@media (max-width:980px) {
  .calc-layout { grid-template-columns:1fr; }
  .calc-result { position:static; max-height:none; overflow:visible; }
}
@media (max-width:700px) {
  .calc-main { padding-bottom:64px; }
  .calc-heading h1 { font-size:clamp(26px,7vw,34px); }
  .calc-heading>p { font-size:16px; }
  .calc-form,.calc-result { padding:20px; }
  .calc-row { flex-wrap:wrap; }
  .calc-seg { flex:1 1 100%; }
  .calc-memo { margin-top:44px; }
}
@media (prefers-reduced-motion:reduce) {
  .calc-tab,.calc-chips button,.calc-seg button { transition:none; }
}
