/* ===========================================================================
 * sourdoughy.com — v3 CRO stylesheet
 * Loaded LAST. Adds the new unified header, mobile-first above-the-fold,
 * pro-mode toggle, wizard fork, "How it works" collapsible, premium
 * sliders + buttons, and dark-mode polish.
 *
 * Philosophy: mobile-first. Every block opens with a base mobile rule,
 * then layers on @media (min-width: 768px) for desktop refinements.
 * ========================================================================= */

/* ----- 0. Token fallbacks (in case tokens.css ever fails to load) -------- */
:root {
  --hdr-h-mobile: 56px;
  --hdr-h-desktop: 64px;
}

/* Override the legacy floating-header height variables so spacing stays
   consistent with the new header. */
:root.has-floating-header,
body.has-floating-header {
  --header-h: var(--hdr-h-mobile);
}
@media (min-width: 768px) {
  :root.has-floating-header,
  body.has-floating-header {
    --header-h: var(--hdr-h-desktop);
  }
}

/* ----- 1. Hide the legacy v1/v2 floating-header AND the bridge select --- */
/* The new header lives at #siteHdr. Anything emitted with id="floatingHeader"
   from old templates is hidden. */
header.floating-header { display: none !important; }

/* The compatibility selects (id="builderLang", id="pizzaBuilderLang", ...)
   stay in the DOM for JS but never render. */
#builderLang.sr-only,
#pizzaBuilderLang.sr-only,
#focacciaBuilderLang.sr-only,
#bagelBuilderLang.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* In case some page rendered a unit toggle outside our edits, hide it. */
.unit-toggle-wrap, .unit-toggle, .hdr-control.unit-toggle-wrap { display: none !important; }


/* ===========================================================================
 * 2. The new unified header (#siteHdr)
 * ========================================================================= */

.hdr {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--hdr-h-mobile);
  background: color-mix(in srgb, var(--surface, #fff) 90%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.hdr.is-scrolled {
  box-shadow: 0 1px 0 var(--border, rgba(0,0,0,0.06)), 0 8px 24px -16px rgba(0,0,0,0.18);
}
@media (min-width: 768px) {
  .hdr { height: var(--hdr-h-desktop); }
}

/* push body content below the fixed header */
body.has-floating-header { padding-top: var(--hdr-h-mobile); }
@media (min-width: 768px) {
  body.has-floating-header { padding-top: var(--hdr-h-desktop); }
}

.hdr-inner {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
@media (min-width: 768px) {
  .hdr-inner { padding: 0 24px; gap: 16px; }
}

/* ----- 2a. Brand (logo + wordmark) ----- */
.hdr-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink, #1a1714);
  height: 44px;
  padding: 0 4px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: opacity 160ms ease;
}
.hdr-brand:hover { opacity: 0.82; }
.hdr-logo { width: 22px; height: 22px; display: block; border-radius: 4px; }
@media (min-width: 768px) {
  .hdr-logo { width: 24px; height: 24px; }
}
.hdr-wordmark {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1;
}
@media (min-width: 768px) {
  .hdr-wordmark { font-size: 20px; }
}

/* ----- 2b. Desktop horizontal nav (hidden on mobile) ----- */
.hdr-nav-desktop { display: none; }
@media (min-width: 900px) {
  .hdr-nav-desktop {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto 0 24px;
    flex: 1;
  }
  .hdr-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    color: var(--ink, #1a1714);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 160ms ease, background 160ms ease;
  }
  .hdr-link::after {
    content: '';
    position: absolute;
    left: 14px; right: 14px; bottom: 6px;
    height: 1.5px;
    background: var(--accent, #c8801f);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .hdr-link:hover { color: var(--accent, #c8801f); }
  .hdr-link:hover::after { transform: scaleX(1); }
  .hdr-link:focus-visible {
    outline: 2px solid var(--accent, #c8801f);
    outline-offset: 2px;
  }
}

/* ----- 2c. Right-side actions ----- */
.hdr-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
@media (min-width: 768px) { .hdr-actions { gap: 6px; } }

/* Language pill */
.hdr-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  min-width: 44px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 999px;
  background: transparent;
  color: var(--ink, #1a1714);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 80ms ease;
}
.hdr-lang-pill:hover { background: var(--accent-soft, rgba(200,128,31,0.08)); border-color: var(--border-strong, rgba(0,0,0,0.14)); }
.hdr-lang-pill:active { transform: scale(0.97); }
.hdr-lang-pill .hdr-flag { font-size: 14px; line-height: 1; }
.hdr-lang-pill .hdr-code { line-height: 1; }
.hdr-lang-pill .hdr-caret {
  margin-left: 1px;
  opacity: 0.55;
  transition: transform 200ms ease;
}
.hdr-lang-pill[aria-expanded="true"] .hdr-caret { transform: rotate(180deg); }
@media (min-width: 768px) {
  .hdr-lang-pill { height: 40px; padding: 0 10px 0 12px; font-size: 14px; }
}

/* Theme toggle */
.hdr-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink, #1a1714);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 80ms ease;
}
.hdr-theme:hover { background: var(--accent-soft, rgba(200,128,31,0.08)); color: var(--accent, #c8801f); }
.hdr-theme:active { transform: scale(0.94); }
@media (min-width: 768px) { .hdr-theme { width: 40px; height: 40px; } }
.hdr-icon { display: block; transition: opacity 200ms ease, transform 200ms ease; }
.hdr-icon-sun  { display: none; }
.hdr-icon-moon { display: block; }
[data-theme="dark"] .hdr-icon-sun  { display: block; }
[data-theme="dark"] .hdr-icon-moon { display: none; }

/* Burger button */
.hdr-burger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, transform 80ms ease;
}
.hdr-burger:hover { background: var(--accent-soft, rgba(200,128,31,0.08)); }
.hdr-burger:active { transform: scale(0.94); }
@media (min-width: 768px) { .hdr-burger { width: 40px; height: 40px; } }
.hdr-burger-line {
  display: block;
  width: 18px; height: 1.6px;
  background: var(--ink, #1a1714);
  border-radius: 1px;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), opacity 160ms ease;
}
.hdr-burger[aria-expanded="true"] .hdr-burger-line:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.hdr-burger[aria-expanded="true"] .hdr-burger-line:nth-child(2) { opacity: 0; }
.hdr-burger[aria-expanded="true"] .hdr-burger-line:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

/* Focus rings on header buttons */
.hdr-lang-pill:focus-visible,
.hdr-theme:focus-visible,
.hdr-burger:focus-visible {
  outline: 2px solid var(--accent, #c8801f);
  outline-offset: 2px;
}

/* ----- 2d. Lang panel (popover/sheet) ----- */
.hdr-lang-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 8px;
  min-width: 220px;
  max-height: calc(100vh - var(--hdr-h-mobile) - 32px);
  overflow-y: auto;
  padding: 6px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 14px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.18), 0 4px 12px -4px rgba(0,0,0,0.10);
  animation: hdrFadeIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 768px) {
  .hdr-lang-panel { right: 16px; }
}
@keyframes hdrFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hdr-lang-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink, #1a1714);
  font-size: 14.5px;
  line-height: 1.2;
  min-height: 44px;
  transition: background 140ms ease;
}
.hdr-lang-row .hdr-flag { font-size: 18px; line-height: 1; text-align: center; }
.hdr-lang-row .hdr-lang-name { font-weight: 500; }
.hdr-lang-row .hdr-lang-code {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft, #9c968e);
  text-transform: uppercase;
}
.hdr-lang-row:hover { background: var(--accent-soft, rgba(200,128,31,0.08)); }
.hdr-lang-row.is-current { background: var(--accent-soft, rgba(200,128,31,0.10)); color: var(--accent-strong, #b06d18); }
.hdr-lang-row:focus-visible { outline: 2px solid var(--accent, #c8801f); outline-offset: 2px; }

/* ----- 2e. Mobile burger drawer (sheet from right) ----- */
.hdr-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(360px, 88vw);
  height: 100vh;
  height: 100dvh;
  background: var(--surface, #fff);
  border-left: 1px solid var(--border, rgba(0,0,0,0.06));
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 110;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.hdr-drawer.is-open { transform: translateX(0); }
.hdr-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(0, 0, 0, 0);
  transition: background 260ms ease;
}
.hdr-drawer-scrim.is-open { background: rgba(0, 0, 0, 0.32); }
[data-theme="dark"] .hdr-drawer-scrim.is-open { background: rgba(0, 0, 0, 0.55); }

body.drawer-open { overflow: hidden; }

.hdr-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  min-height: var(--hdr-h-mobile);
}
.hdr-drawer-title {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink, #1a1714);
}
.hdr-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-muted, #6b6660);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.hdr-drawer-close:hover { background: var(--accent-soft, rgba(200,128,31,0.08)); color: var(--accent, #c8801f); }
.hdr-drawer-close:focus-visible { outline: 2px solid var(--accent, #c8801f); outline-offset: 2px; }

.hdr-drawer-nav { padding: 12px 8px 32px; flex: 1; }
.hdr-drawer-section { margin-bottom: 24px; }
.hdr-drawer-h {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft, #9c968e);
  margin: 0 0 6px;
  padding: 0 12px;
}
.hdr-drawer-link {
  display: block;
  padding: 12px;
  border-radius: 10px;
  color: var(--ink, #1a1714);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  min-height: 44px;
  transition: background 140ms ease, color 140ms ease;
}
.hdr-drawer-link:hover { background: var(--accent-soft, rgba(200,128,31,0.08)); color: var(--accent, #c8801f); }
.hdr-drawer-link:focus-visible { outline: 2px solid var(--accent, #c8801f); outline-offset: -2px; }

/* Hide drawer entirely on wide screens — desktop nav is visible */
@media (min-width: 900px) {
  .hdr-burger { display: none; }
  .hdr-drawer, .hdr-drawer-scrim { display: none !important; }
}


/* ===========================================================================
 * 3. Hero v2 — mobile-first ATF rework
 *    The legacy hero (.hero) is kept but heavily restyled.
 * ========================================================================= */

.hero {
  max-width: 720px;
  margin: 16px auto 24px;
  padding: 0 16px;
  position: relative;
}
@media (min-width: 768px) {
  .hero { margin: 32px auto 40px; padding: 0 24px; max-width: 760px; }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 768px) {
  .hero-inner { gap: 24px; }
}

.hero-copy {
  text-align: left;
  max-width: 680px;
}

.hero-headline {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.08;
  color: var(--ink, #1a1714);
  margin: 0 0 8px;
}
@media (min-width: 768px) {
  .hero-headline { font-size: clamp(36px, 4.6vw, 56px); margin-bottom: 12px; }
}

.hero-sub {
  font-size: 15px;
  color: var(--ink-muted, #6b6660);
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
}
@media (min-width: 768px) {
  .hero-sub { font-size: 17px; }
}

/* The 3-paragraph baker's-percent explainer is moved into the
   How-it-works collapsible. Hide its legacy copy here. */
.hero-explainer { display: none !important; }

/* Live recipe preview — the engagement hook */
.hero-preview {
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px -10px rgba(0,0,0,0.10);
}
@media (min-width: 768px) {
  .hero-preview { padding: 24px; border-radius: 20px; }
}
[data-theme="dark"] .hero-preview {
  background: var(--surface, #1e1b16);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.4);
}

.hero-preview-title {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft, #9c968e);
  margin: 0 0 10px;
}

/* Slider grid: 2 sliders on mobile (total + hyd), 4 on desktop */
.hero-preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (min-width: 560px) {
  .hero-preview-grid { grid-template-columns: 1fr 1fr; gap: 16px 20px; }
}

.hero-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero-slider-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted, #6b6660);
  font-weight: 500;
}
.hero-slider-label output {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent, #c8801f);
}

/* Premium custom range slider */
.hero-slider input[type="range"],
.adjust-tile input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  background: transparent;
  margin: 0;
  padding: 0;
  cursor: pointer;
  display: block;
}
.hero-slider input[type="range"]::-webkit-slider-runnable-track,
.adjust-tile input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent, #c8801f) 0%, var(--accent, #c8801f) var(--val, 50%), var(--border-strong, rgba(0,0,0,0.10)) var(--val, 50%), var(--border-strong, rgba(0,0,0,0.10)) 100%);
}
.hero-slider input[type="range"]::-moz-range-track,
.adjust-tile input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border-strong, rgba(0,0,0,0.10));
}
.hero-slider input[type="range"]::-moz-range-progress,
.adjust-tile input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent, #c8801f);
}
.hero-slider input[type="range"]::-webkit-slider-thumb,
.adjust-tile input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px; height: 26px;
  margin-top: -10px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--accent, #c8801f);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: grab;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.hero-slider input[type="range"]::-moz-range-thumb,
.adjust-tile input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--accent, #c8801f);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: grab;
}
.hero-slider input[type="range"]:active::-webkit-slider-thumb,
.adjust-tile input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.08); cursor: grabbing; }
.hero-slider input[type="range"]:focus-visible,
.adjust-tile input[type="range"]:focus-visible {
  outline: none;
}
.hero-slider input[type="range"]:focus-visible::-webkit-slider-thumb,
.adjust-tile input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--accent-soft, rgba(200,128,31,0.20)), 0 2px 6px rgba(0,0,0,0.12);
}
.hero-slider input[type="range"]:focus-visible::-moz-range-thumb,
.adjust-tile input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px var(--accent-soft, rgba(200,128,31,0.20)), 0 2px 6px rgba(0,0,0,0.12);
}

/* Recipe table — premium typography */
.hero-recipe-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 14px;
}
.hero-recipe-table tr { border-top: 1px solid var(--border, rgba(0,0,0,0.06)); }
.hero-recipe-table tr:first-child { border-top: none; }
.hero-recipe-table th {
  text-align: left;
  padding: 11px 0;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink, #1a1714);
}
.hero-recipe-table td {
  text-align: right;
  padding: 11px 0;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #1a1714);
  transition: color 200ms ease;
}
.hero-recipe-table td.is-flash { color: var(--accent, #c8801f); }
.hero-recipe-table td span { transition: color 200ms ease; }

/* Above-the-fold CTAs */
.hero-cta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 50px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--accent, #c8801f);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px -6px rgba(200,128,31,0.40);
  transition: background 160ms ease, transform 80ms ease, box-shadow 160ms ease;
}
.hero-cta:hover { background: var(--accent-strong, #b06d18); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 6px 18px -6px rgba(200,128,31,0.50); }
.hero-cta:active { transform: translateY(0); }
.hero-cta:focus-visible { outline: 2px solid var(--accent, #c8801f); outline-offset: 3px; }
.hero-cta-link {
  background: transparent;
  color: var(--ink-muted, #6b6660);
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  box-shadow: none;
  font-weight: 500;
  height: 44px;
}
.hero-cta-link:hover { background: var(--accent-soft, rgba(200,128,31,0.08)); color: var(--accent, #c8801f); border-color: var(--border-strong, rgba(0,0,0,0.10)); transform: none; box-shadow: none; }

/* Hero-preview footer (deep link + share) — hidden by default in v3,
   the primary CTA in .hero-cta-row is sufficient for ATF. The deep
   link still exists for keyboard nav. */
.hero-preview-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  margin-top: 4px;
}
.hero-preview-foot a {
  color: var(--ink-muted, #6b6660);
  text-decoration: none;
  font-weight: 500;
}
.hero-preview-foot a:hover { color: var(--accent, #c8801f); text-decoration: underline; }
.hero-preview-foot .hero-preview-deep { display: none; }
@media (min-width: 768px) { .hero-preview-foot .hero-preview-deep { display: inline-flex; } }

/* Pro mode panel — hidden by default, slides into view */
.pro-mode-panel {
  margin-top: 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  border-radius: 16px;
  padding: 18px 16px;
  display: none;
}
.pro-mode-panel:not([hidden]) { display: block; animation: proSlide 280ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes proSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .pro-mode-panel {
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
.pro-mode-title {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink, #1a1714);
}
.pro-mode-sub { font-size: 13px; color: var(--ink-muted, #6b6660); margin: 0 0 14px; }

.pro-mode-form {
  display: grid;
  gap: 14px;
}
.pro-mode-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.pro-mode-form legend {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft, #9c968e);
  margin-bottom: 4px;
}
.pro-mode-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-muted, #6b6660);
}
.pro-mode-form input[type="number"] {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border, rgba(0,0,0,0.10));
  border-radius: 8px;
  background: var(--bg, #fbfaf7);
  color: var(--ink, #1a1714);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color 160ms ease, background 160ms ease;
}
.pro-mode-form input[type="number"]:focus {
  outline: none;
  border-color: var(--accent, #c8801f);
  background: var(--surface, #fff);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(200,128,31,0.18));
}

.pro-mode-output {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  border-top: 1px solid var(--border, rgba(0,0,0,0.06));
}
.pro-mode-output tr { border-bottom: 1px solid var(--border, rgba(0,0,0,0.06)); }
.pro-mode-output th { text-align: left; padding: 10px 0; font-size: 13px; font-weight: 500; color: var(--ink-muted, #6b6660); }
.pro-mode-output td { text-align: right; padding: 10px 0; font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.pro-mode-exit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--accent, #c8801f);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 4px;
}
.pro-mode-exit:hover { text-decoration: underline; }


/* ===========================================================================
 * 4. Wizard fork (step 1: I-know vs Help-me)
 * ========================================================================= */
.wizard-fork {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.wizard-fork-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 14px;
  background: var(--surface, #fff);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink, #1a1714);
  transition: border-color 160ms ease, transform 100ms ease, box-shadow 160ms ease;
  width: 100%;
  min-height: 80px;
}
.wizard-fork-card:hover { border-color: var(--accent, #c8801f); transform: translateY(-1px); box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 6px 16px -8px rgba(200,128,31,0.20); }
.wizard-fork-card:focus-visible { outline: 2px solid var(--accent, #c8801f); outline-offset: 2px; }
.wizard-fork-icon {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft, rgba(200,128,31,0.10));
  color: var(--accent, #c8801f);
  border-radius: 10px;
  font-size: 22px;
}
.wizard-fork-label {
  display: block;
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.wizard-fork-meta { display: block; font-size: 13.5px; color: var(--ink-muted, #6b6660); line-height: 1.4; }


/* ===========================================================================
 * 5. Starter pointer (contextual link inside wizard)
 * ========================================================================= */
.starter-pointer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--accent-soft, rgba(200,128,31,0.08));
  color: var(--accent-strong, #b06d18);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 160ms ease;
}
.starter-pointer:hover { background: var(--accent-soft, rgba(200,128,31,0.16)); text-decoration: underline; }


/* ===========================================================================
 * 6. "Other dough calculators" row — now 4 cards including starter guide
 * ========================================================================= */
.other-calculators-section {
  max-width: 1080px;
  margin: 48px auto 32px;
  padding: 16px clamp(16px, 4vw, 32px) 0;
  border-top: 1px solid var(--border, rgba(0,0,0,0.06));
}
.other-calculators-heading-h2 {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
  margin: 24px 0 20px;
  color: var(--ink, #1a1714);
}
.other-calculators-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 720px) {
  .other-calculators-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}
.other-calc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink, #1a1714);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  min-height: 132px;
}
.other-calc-card:hover { border-color: var(--accent, #c8801f); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 8px 24px -8px rgba(200,128,31,0.20); }
.other-calc-card.is-guide {
  background: transparent;
  border-style: dashed;
  border-color: var(--border-strong, rgba(0,0,0,0.12));
  box-shadow: none;
}
.other-calc-card.is-guide:hover { border-color: var(--accent, #c8801f); border-style: solid; background: var(--accent-soft, rgba(200,128,31,0.06)); }
.other-calc-icon { font-size: 22px; line-height: 1; }
.other-calc-name { font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.other-calc-meta { font-size: 13px; color: var(--ink-muted, #6b6660); line-height: 1.4; }
[data-theme="dark"] .other-calc-card { box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset; }


/* ===========================================================================
 * 7. "How it works" collapsible explainer
 * ========================================================================= */
.how-it-works {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 16px;
}
.how-it-works details {
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  border-radius: 14px;
  background: var(--surface, #fff);
  overflow: hidden;
}
.how-it-works summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink, #1a1714);
  transition: background 140ms ease;
  min-height: 56px;
}
.how-it-works summary::-webkit-details-marker { display: none; }
.how-it-works summary::after {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border-right: 1.6px solid var(--ink-muted, #6b6660);
  border-bottom: 1.6px solid var(--ink-muted, #6b6660);
  transform: rotate(45deg);
  transition: transform 200ms ease;
}
.how-it-works details[open] summary::after { transform: rotate(-135deg); }
.how-it-works summary:hover { background: var(--accent-soft, rgba(200,128,31,0.06)); }
.how-it-works .hiw-body { padding: 0 18px 18px; color: var(--ink, #1a1714); font-size: 15px; line-height: 1.7; }
.how-it-works .hiw-body p { margin: 0 0 12px; }
.how-it-works .hiw-body p:last-child { margin-bottom: 0; }


/* ===========================================================================
 * 8. Path-picker (legacy "Or step through together" wizard step) —
 *    we still render the slim path picker as the wizard's step 0 inside
 *    builder.php; the v3 hero CTAs are the primary entry points.
 * ========================================================================= */

/* The wizard's step 0 visually merges with the rest of the wizard. */
.step-pathpicker { padding-top: 8px; }
.step-pathpicker .step-title-compact {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink, #1a1714);
  line-height: 1.3;
}
.step-pathpicker .step-desc { font-size: 14px; color: var(--ink-muted, #6b6660); margin-bottom: 14px; }
.step-pathpicker .options-two { display: grid; gap: 10px; }
@media (min-width: 560px) { .step-pathpicker .options-two { grid-template-columns: 1fr 1fr; gap: 12px; } }


/* ===========================================================================
 * 9. Recently-baked widget polish (kept hidden until populated)
 * ========================================================================= */
.recently-baked {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  border-radius: 14px;
  background: var(--surface, #fff);
}
.recently-baked-title { font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.recently-baked-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.recently-baked-foot { margin: 10px 0 0; font-size: 13px; }


/* ===========================================================================
 * 10. Cookie banner restyle — bottom sheet on mobile
 * ========================================================================= */
.cookie-consent {
  position: fixed !important;
  left: 12px !important;
  right: 12px !important;
  bottom: 12px !important;
  top: auto !important;
  z-index: 90 !important;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.18);
  display: none;
}
.cookie-consent.visible { display: block; animation: cookieSlideIn 280ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes cookieSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.cookie-consent-inner { display: grid; gap: 12px; }
.cookie-consent p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink, #1a1714); }
.cookie-consent a { color: var(--accent, #c8801f); }
.cookie-consent-btns { display: flex; gap: 8px; justify-content: flex-end; }
.cookie-btn { padding: 8px 14px; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--border, rgba(0,0,0,0.08)); background: transparent; color: var(--ink, #1a1714); cursor: pointer; min-height: 36px; }
.cookie-btn-accept { background: var(--accent, #c8801f); color: #fff; border-color: var(--accent, #c8801f); }
.cookie-btn:hover { background: var(--accent-soft, rgba(200,128,31,0.10)); }
.cookie-btn-accept:hover { background: var(--accent-strong, #b06d18); border-color: var(--accent-strong, #b06d18); }


/* ===========================================================================
 * 11. Smooth theme-transition for color tokens on switch
 * ========================================================================= */
:root, body {
  transition: background-color 220ms ease, color 220ms ease;
}
@media (prefers-reduced-motion: reduce) {
  :root, body, .hdr-drawer, .hdr-drawer-scrim, .pro-mode-panel,
  .hero-cta, .hero-recipe-table td span, .other-calc-card,
  .wizard-fork-card { transition: none !important; animation: none !important; }
}


/* ---------- 12. bagel water-bath guidance card ---------- */
.bagel-water-bath-tip {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--accent-soft, rgba(200,128,31,0.06));
  border: 1px solid var(--accent-soft, rgba(200,128,31,0.20));
  border-radius: 12px;
}
.bagel-water-bath-tip .water-bath-title {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--accent-strong, #b06d18);
}
.bagel-water-bath-tip .water-bath-text {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--ink, #1a1714);
  line-height: 1.5;
}
.bagel-water-bath-tip .water-bath-hint {
  margin: 0;
  color: var(--ink-muted, #6b6660);
}
