/* Zen Bliss tools: dose finder and help-me-choose additions. Loaded after zb.css (handle zb) on pages that render
   [zb_dose_finder] or [zb_help_me_choose]. The lab table needs nothing here: zb.css styles it.

   1. Dose finder: the inline <style> of sections/dosage-calculator.liquid (spec-pages 4), with two port changes:
      - Every rule sits under .zb-dose-scope (the calculator root and the method block) because zb.css is global on
        WordPress and also styles .zb-card, .zb-chips, .zb-notice and .zb-eyebrow; the live page never loaded zb.css.
      - Sizes stay in rem as written. The section was designed for a 16px root (its prototype); on Dawn's 10px root
        the live page renders them 37.5% smaller (7.8px hints). WordPress keeps the 16px root, so the designed sizes
        come back. Converting each rem to px x10 would reproduce the live sizes instead.
   2. Help me choose: guards for the wizard's <button> elements against the theme's button styles, the honeypot
      and the error line of the email step. Everything else is in zb.css. */

/* ---- 1. Dose finder ---- */
.zb-dose-scope {
  --zb-bg: #ffffff;
  --zb-fg: #14201a;
  --zb-muted: rgba(20, 32, 26, 0.68);
  --zb-line: rgba(20, 32, 26, 0.16);
  --zb-card: rgba(20, 32, 26, 0.035);
  --zb-accent: #136c00;
  --zb-accent-fg: #ffffff;
  --zb-accent-soft: rgba(19, 108, 0, 0.12);
  --zb-warn: #b8860b;
  --zb-warn-soft: rgba(184, 134, 11, 0.1);
  --zb-warn-fg: #14201a;
  --zb-font-head: var(--zb-font-heading, inherit);
  --zb-pill: 999px;
  --zb-btn-radius: 40px;
}
.zb-dose-section .zb-heading { margin: 0 0 8px; }
.zb-dose-section .zb-heading.h1 { font-size: var(--zb-h1, 33px); line-height: 1.273; letter-spacing: 0.66px; }
@media (min-width: 750px) { .zb-dose-section .zb-heading.h1 { font-size: var(--zb-h1, 44px); } }
.zb-dose-section .zb-lede { max-width: 62ch; margin: 0 0 28px; }
.zb-dose-section .zb-lede > :first-child { margin-top: 0; }
.zb-dose-section .zb-lede > :last-child { margin-bottom: 0; }

.zb-dose { font-family: var(--zb-font-body, inherit); color: var(--zb-fg); line-height: 1.45; }
.zb-dose *, .zb-dose *::before, .zb-dose *::after { box-sizing: border-box; }
.zb-dose-scope .zb-dose__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 860px) { .zb-dose-scope .zb-dose__grid { grid-template-columns: minmax(0, 1fr); } }

.zb-dose-scope .zb-form { display: grid; gap: 28px; min-width: 0; }
.zb-dose-scope .zb-step { display: grid; gap: 14px; }
.zb-dose-scope .zb-step__title { font-family: var(--zb-font-head); font-size: 1.15rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.zb-dose-scope .zb-step__n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--zb-accent); color: var(--zb-accent-fg); font-size: 0.85rem; display: inline-grid; place-items: center; font-weight: 700; }
.zb-dose-scope .zb-field { display: grid; gap: 8px; }
.zb-dose-scope .zb-field__label, .zb-dose-scope .zb-section-label, .zb-dose-scope .zb-eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--zb-muted); font-weight: 600; margin: 0; }

.zb-dose-scope .zb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0; }
.zb-dose-scope .zb-chip { position: relative; display: flex; flex: 1 1 150px; min-width: 0; cursor: pointer; }
.zb-dose-scope .zb-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.zb-dose-scope .zb-chip__body { display: grid; gap: 2px; width: 100%; padding: 10px 14px; border: 1px solid var(--zb-line); border-radius: var(--zb-pill); background: var(--zb-bg); transition: border-color 0.15s, background-color 0.15s; }
.zb-dose-scope .zb-chip__label { font-weight: 700; font-size: 0.95rem; }
.zb-dose-scope .zb-chip__hint { font-size: 0.78rem; color: var(--zb-muted); }
.zb-dose-scope .zb-chip input:checked + .zb-chip__body { border-color: var(--zb-accent); background: var(--zb-accent-soft); box-shadow: inset 0 0 0 1px var(--zb-accent); }
.zb-dose-scope .zb-chip input:focus-visible + .zb-chip__body { outline: 2px solid var(--zb-accent); outline-offset: 2px; }
.zb-dose-scope .zb-chip:hover .zb-chip__body { border-color: var(--zb-accent); }

.zb-dose-scope .zb-weight { display: grid; gap: 10px; }
.zb-dose-scope .zb-weight__row { display: flex; gap: 10px; align-items: stretch; }
.zb-dose-scope .zb-weight__num { width: 110px; font: inherit; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: 8px 12px; border: 1px solid var(--zb-line); background: var(--zb-bg); color: var(--zb-fg); border-radius: var(--zb-btn-radius); box-shadow: none; }
.zb-dose-scope .zb-weight__num:focus-visible { outline: 2px solid var(--zb-accent); outline-offset: 2px; }
.zb-dose-scope .zb-seg { display: inline-flex; border: 1px solid var(--zb-line); border-radius: var(--zb-pill); overflow: hidden; }
.zb-dose-scope .zb-seg__opt { position: relative; display: flex; cursor: pointer; margin: 0; }
.zb-dose-scope .zb-seg__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.zb-dose-scope .zb-seg__opt span { padding: 8px 16px; font-weight: 700; font-size: 0.9rem; color: var(--zb-muted); }
.zb-dose-scope .zb-seg__opt input:checked + span { background: var(--zb-accent); color: var(--zb-accent-fg); }
.zb-dose-scope .zb-seg__opt input:focus-visible + span { outline: 2px solid var(--zb-accent); outline-offset: -2px; }
.zb-dose-scope .zb-weight__range { width: 100%; accent-color: var(--zb-accent); margin: 0; }

.zb-dose-scope .zb-result { background: var(--zb-card); border: 1px solid var(--zb-line); padding: clamp(20px, 3vw, 32px); display: grid; gap: 22px; min-width: 0; }
.zb-dose-scope .zb-result__head { display: grid; gap: 4px; }
.zb-dose-scope .zb-result__big { margin: 4px 0 0; display: flex; align-items: baseline; gap: 8px; }
.zb-dose-scope .zb-result__num { font-family: var(--zb-font-head); font-size: clamp(3rem, 8vw, 4.5rem); font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--zb-accent); font-variant-numeric: tabular-nums; }
.zb-dose-scope .zb-result__unit { font-size: 1.4rem; font-weight: 700; color: var(--zb-muted); }
.zb-dose-scope .zb-result__sub { margin: 0; font-size: 0.95rem; }

.zb-dose-scope .zb-notice { margin: 0; padding: 10px 14px; border-left: 3px solid var(--zb-warn); border-radius: 0; background: var(--zb-warn-soft); color: var(--zb-warn-fg); font-size: 0.9rem; }

.zb-dose-scope .zb-plan { border-top: 1px solid var(--zb-line); padding-top: 16px; display: grid; gap: 8px; }
.zb-dose-scope .zb-plan__title { margin: 0; font-weight: 700; }
.zb-dose-scope .zb-plan__list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: 0.92rem; }

.zb-dose-scope .zb-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* zb.css's product card rule also matches .zb-card: undo its radius, overflow (it would clip the badge) and column direction. */
.zb-dose-scope .zb-card { position: relative; border: 1px solid var(--zb-line); border-radius: 0; overflow: visible; background: var(--zb-bg); padding: 18px 16px 16px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; min-width: 0; }
.zb-dose-scope .zb-card--best { border-color: var(--zb-accent); box-shadow: inset 0 0 0 1px var(--zb-accent); }
.zb-dose-scope .zb-card__badge { position: absolute; top: -10px; left: 12px; background: var(--zb-accent); color: var(--zb-accent-fg); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; font-weight: 700; }
.zb-dose-scope .zb-card__main { flex: 1 1 200px; min-width: 0; display: grid; gap: 3px; align-content: start; }
.zb-dose-scope .zb-card__dose { flex: 0 1 auto; min-width: 0; display: grid; gap: 3px; align-content: start; justify-items: start; }
@media (min-width: 480px) { .zb-dose-scope .zb-card__dose { justify-items: end; text-align: right; } }
.zb-dose-scope .zb-card__name { margin: 0; font-family: var(--zb-font-head); font-size: 1rem; font-weight: 700; line-height: 1.25; }
.zb-dose-scope .zb-card__strength { margin: 0; font-size: 0.78rem; color: var(--zb-muted); }
.zb-dose-scope .zb-card__serve { margin: 0; font-family: var(--zb-font-head); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; white-space: nowrap; }
.zb-dose-scope .zb-card__detail { margin: 0; font-size: 0.85rem; }
.zb-dose-scope .zb-card__meta { margin: 0; font-size: 0.78rem; color: var(--zb-muted); }
.zb-dose-scope .zb-card__warn { margin: 6px 0 0; font-size: 0.78rem; color: var(--zb-warn-fg); }
.zb-dose-scope .zb-btn { margin-top: 8px; display: inline-block; padding: 9px 18px; background: var(--zb-accent); color: var(--zb-accent-fg); text-decoration: none; font-weight: 700; font-size: 0.88rem; letter-spacing: 0.02em; border-radius: var(--zb-btn-radius); }
.zb-dose-scope .zb-btn--quiet { background: transparent; color: var(--zb-fg); box-shadow: inset 0 0 0 1px var(--zb-fg); }
.zb-dose-scope .zb-btn:hover { filter: brightness(1.08); color: var(--zb-accent-fg); }
.zb-dose-scope .zb-btn--quiet:hover { color: var(--zb-fg); }
.zb-dose-scope .zb-btn:focus-visible { outline: 2px solid var(--zb-accent); outline-offset: 2px; }

.zb-dose-scope .zb-how { display: grid; gap: 8px; }
.zb-dose-scope .zb-how__list { margin: 0; padding-left: 1.2em; font-size: 0.9rem; display: grid; gap: 6px; }
.zb-dose-scope .zb-disclaimer { font-size: 0.78rem; color: var(--zb-muted); border-top: 1px solid var(--zb-line); padding-top: 12px; }
.zb-dose-scope .zb-disclaimer p { margin: 0 0 6px; }

/* "How the dose finder works": the FAQ helper prints .zb-faq > details.zb-faq__item; keep the section's own look
   (rules between items, native disclosure marker) instead of the zb.css accordion cards. */
.zb-dose-scope .zb-method { margin-top: clamp(32px, 5vw, 56px); display: grid; gap: 10px; max-width: 70ch; }
.zb-dose-scope .zb-method .zb-faq { display: grid; gap: 10px; margin: 0; padding: 0; }
.zb-dose-scope .zb-method details { background: none; border: 0; border-top: 1px solid var(--zb-line); border-radius: 0; padding: 12px 0; margin: 0; box-shadow: none; }
.zb-dose-scope .zb-method details:last-child { border-bottom: 1px solid var(--zb-line); }
.zb-dose-scope .zb-method details summary { cursor: pointer; font-weight: 700; font-family: var(--zb-font-head); display: list-item; list-style: disclosure-closed inside; padding: 0; gap: 0; font-size: inherit; }
.zb-dose-scope .zb-method details[open] > summary { list-style-type: disclosure-open; }
.zb-dose-scope .zb-method details summary::after { content: none; }
.zb-dose-scope .zb-method details summary::-webkit-details-marker { display: inline; }
.zb-dose-scope .zb-method summary:focus-visible { outline: 2px solid var(--zb-accent); outline-offset: 2px; }
.zb-dose-scope .zb-method .zb-faq__answer { margin: 0; padding: 0; }
.zb-dose-scope .zb-method p { margin: 8px 0 0; font-size: 0.95rem; }
.zb-dose-scope .zb-method .zb-faq__answer p { padding: 0; max-width: none; color: inherit; }
.zb-dose-scope .zb-method table { border-collapse: collapse; margin-top: 8px; font-size: 0.88rem; font-variant-numeric: tabular-nums; width: auto; border: 0; }
.zb-dose-scope .zb-method th, .zb-dose-scope .zb-method td { text-align: left; padding: 4px 12px 4px 0; border: 0; border-bottom: 1px solid var(--zb-line); background: none; }

@media (prefers-reduced-motion: reduce) { .zb-dose * { transition: none !important; } }

/* ---- 2. Help me choose ---- */
/* The options and text links are <button>s: keep the theme's button background, colour and shadow off them. */
.zb-wiz .zb-wiz__opt { box-shadow: none; text-transform: none; letter-spacing: inherit; }
.zb-wiz .zb-wiz__opt:hover, .zb-wiz .zb-wiz__opt:focus { background: #fff; color: inherit; box-shadow: none; }
.zb-wiz .zb-wiz__opt[aria-checked="true"], .zb-wiz .zb-wiz__opt[aria-checked="true"]:hover, .zb-wiz .zb-wiz__opt[aria-checked="true"]:focus { background: var(--zb-mist); }
.zb-wiz .zb-wiz__link, .zb-wiz .zb-wiz__link:hover, .zb-wiz .zb-wiz__link:focus { background: none; color: var(--zb-ink-2); box-shadow: none; border-radius: 0; min-height: 0; min-width: 0; text-transform: none; }
/* Email step: honeypot off screen; the error line reuses the note box with the gold rule of .zb-notice. */
.zb-wiz .zb-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.zb-wiz .zb-wiz__error { border-left: 3px solid var(--zb-gold); }
