/* FitPal quiz: app shell, question screens, loading and result.
   Built on tokens.css + base.css only: no new colours. */

.page-quiz { background: var(--bg); }

.qz {
  --qz-col: 640px;
  --kb: 0px;
  --dock-h: 0px;
  --qz-p: 0;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  /* A screen slides in from 40px to the right (quiz.js animateSwap): clipped at the viewport edge, so the
     page never gets wider for that moment. clip, not hidden: no scroll box, the top bar and the result's
     sticky column keep sticking, and focus rings and shadows inside the gutters are not cut. */
  overflow-x: clip;
}

/* ---------- Ambient canvas ---------- */
.qz-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.qz-glow {
  position: absolute;
  border-radius: 50%;
  transition: transform 1.6s var(--ease-out), opacity 1.6s var(--ease-out);
}
.qz-glow-a {
  width: 120vmax;
  height: 120vmax;
  left: -62vmax;
  top: -78vmax;
  background: var(--glow-violet);
  opacity: 0.5;
  transform: translate3d(calc(var(--qz-p) * 22vmax), calc(var(--qz-p) * 8vmax), 0);
}
.qz-glow-b {
  width: 90vmax;
  height: 90vmax;
  right: -52vmax;
  bottom: -66vmax;
  background: var(--glow-volt);
  opacity: calc(0.12 + var(--qz-p) * 0.12);
  transform: translate3d(calc(var(--qz-p) * -10vmax), 0, 0);
}
.qz-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 60% 48% at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 48% at 50% 0%, #000 0%, transparent 72%);
  opacity: 0.55;
}

/* ---------- Top bar: back · brand · close, then the progress meter ---------- */
.qz-top {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  grid-template-areas:
    'back brand close'
    'meter meter meter';
  align-items: center;
  column-gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) 12px;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-3) ease, border-color var(--dur-3) ease;
}
.qz.is-scrolled .qz-top {
  background: rgba(7, 6, 6, 0.82);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
.qz-brand {
  grid-area: brand;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 6px;
  border-radius: var(--r-sm);
}
/* Same lockup size as the site header (site.css .brand): the logo does not shrink on the way in. */
.qz-brand .brand-mark { width: 30px; height: 30px; flex: none; }
.qz-wordmark {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.3125rem;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  transform: translateY(-1px);
}
.qz-close { grid-area: close; justify-self: end; }
.qz-back { grid-area: back; }

.qz-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  -webkit-tap-highlight-color: transparent;
  transition:
    color var(--dur-2) ease,
    border-color var(--dur-2) ease,
    background-color var(--dur-2) ease,
    opacity var(--dur-2) ease,
    visibility var(--dur-2) ease,
    transform var(--dur-2) var(--ease-out);
}
.qz-icon-btn svg { display: block; }
.qz-icon-btn:active { transform: scale(0.94); }
.qz-back:disabled { opacity: 0; visibility: hidden; transform: translateX(-6px); }

.qz-meter {
  grid-area: meter;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  transition: opacity var(--dur-3) ease;
}
.qz-progress {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
}
.qz-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--volt) 45%, transparent), var(--volt));
  box-shadow: 0 0 16px var(--volt-glow);
  transition: width 760ms var(--ease-out);
}
.qz-progress-fill::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -4px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--volt-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--volt) 20%, transparent), 0 0 14px var(--volt-glow);
}
.qz-count {
  flex: none;
  font-size: 0.6875rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.qz-count-now { color: var(--text); }
.qz-count-sep { margin: 0 0.35em; color: var(--text-4); }

.qz[data-phase='boot'] .qz-meter { opacity: 0; }
.qz[data-phase='loading'] .qz-meter,
.qz[data-phase='result'] .qz-meter,
.no-js .qz-meter { display: none; }
.qz[data-phase='loading'] .qz-back,
.qz[data-phase='result'] .qz-back,
.no-js .qz-back { visibility: hidden; }

/* ---------- Stage ---------- */
.qz-main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: min(100% - 2 * var(--gutter), var(--qz-col));
  margin-inline: auto;
  padding-block: clamp(14px, 3vh, 36px) 28px;
}
.qz-stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
.qz-stage > .qz-screen { grid-area: 1 / 1; min-width: 0; }
.qz-screen { display: flex; flex-direction: column; }
.qz-screen.is-leaving { pointer-events: none; }
/* Scroll room so the last field can clear the docked button, the keyboard and an open toast. */
.qz-screen.has-dock > .qz-screen-inner { padding-bottom: calc(var(--dock-h) + var(--kb) + var(--toast-h, 0px) + 8px); }

.qz-head {
  display: grid;
  gap: 10px;
  margin-bottom: clamp(20px, 3.2vh, 32px);
}
.qz-eyebrow { margin-bottom: 2px; }
.qz-title {
  font-size: clamp(1.75rem, 1.28rem + 2vw, 2.625rem);
  line-height: 1.07;
  letter-spacing: -0.042em;
  font-weight: 720;
  color: var(--text);
}
.qz-title:focus { outline: none; }
.qz-sub {
  max-width: 52ch;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-3);
}

/* ---------- Option cards (single + multi) ---------- */
.qz-native {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.qz-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.qz-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 12px 16px 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color var(--dur-2) ease,
    background-color var(--dur-2) ease,
    box-shadow var(--dur-3) var(--ease-out),
    opacity var(--dur-2) ease,
    transform var(--dur-2) var(--ease-out);
  animation: qz-in 560ms var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}
.qz-option::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid var(--volt);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
@media (hover: hover) {
  .qz-option:hover {
    border-color: var(--line-3);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
    transform: translateY(-1px);
  }
  .qz-option:hover .qz-key { border-color: var(--line-3); color: var(--text-2); }
}
.qz-option:active { transform: scale(0.99); }
.qz-option:has(.qz-native:focus-visible) { outline: 2px solid var(--volt); outline-offset: 3px; }
.qz-option.is-selected {
  border-color: var(--volt);
  border-color: color-mix(in srgb, var(--volt) 72%, transparent);
  background: linear-gradient(180deg, rgba(255, 106, 43, 0.11), rgba(255, 106, 43, 0.035));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--volt) 35%, transparent) inset, 0 18px 46px -26px var(--volt-glow);
}
.qz-option.is-confirmed { animation: qz-confirm 380ms var(--ease-out); }
.qz-option.is-confirmed::after { animation: qz-halo 560ms var(--ease-out); }
.qz-option.is-denied { animation: qz-shake 380ms var(--ease-out); }
.qz-options.is-maxed .qz-option:not(.is-selected) { opacity: 0.5; }

.qz-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-3);
  transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease, color var(--dur-2) ease;
}
.qz-option.is-selected .qz-key { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); }
/* Goal step: the landing's goal-chip icons (landing.css .goal-ic) instead of the letter tile;
   the letter shortcuts keep working. */
.qz-opt-ic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  transition: background-color var(--dur-2) ease, color var(--dur-2) ease, box-shadow var(--dur-3) ease;
}
.qz-option:has(.qz-opt-ic) .qz-key { display: none; }
.qz-option.is-selected .qz-opt-ic { background: var(--volt); color: var(--volt-ink); box-shadow: 0 0 16px var(--volt-glow); }
@media (hover: hover) {
  .qz-option:hover .qz-opt-ic { color: var(--text); }
  .qz-option.is-selected:hover .qz-opt-ic { color: var(--volt-ink); }
}
.qz-option-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.qz-option-label {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
}
.qz-option-hint { font-size: 0.875rem; line-height: 1.4; color: var(--text-3); }
/* Labels, hints, program features and the pace line break into even lines: on phones they used to leave
   one word alone on the last line ("estreme", "muscoli", "aggiorna"). Chromium's pretty does not fix
   blocks this short; balance does (up to 6 lines). */
.qz-option-label,
.qz-option-hint,
.qz-features li > span,
.qz-pace-text { text-wrap: balance; }
.qz-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-3);
  border-radius: 50%;
  color: var(--volt-ink);
  transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease, box-shadow var(--dur-3) ease;
}
.qz-option--multi .qz-mark { border-radius: 7px; }
.qz-mark .qz-ico { opacity: 0; transform: scale(0.4); transition: opacity var(--dur-1) ease, transform var(--dur-3) var(--ease-spring); }
.qz-option.is-selected .qz-mark { background: var(--volt); border-color: var(--volt); box-shadow: 0 0 16px var(--volt-glow); }
.qz-option.is-selected .qz-mark .qz-ico { opacity: 1; transform: none; }
.qz-ico { display: inline-grid; place-items: center; flex: none; }
.qz-ico svg { display: block; }

@keyframes qz-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
@keyframes qz-rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
@keyframes qz-confirm { 0% { transform: scale(1); } 40% { transform: scale(0.982); } 100% { transform: scale(1); } }
@keyframes qz-halo { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.025, 1.16); } }
@keyframes qz-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
@keyframes qz-spin { to { transform: rotate(360deg); } }
@keyframes qz-timer { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.qz-start-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.6875rem;
  color: var(--text-3);
  animation: qz-in 560ms var(--ease-out) backwards;
  animation-delay: 420ms;
}
.qz-start-note .qz-ico { color: var(--volt); }

/* ---------- Messages ---------- */
.qz-error {
  margin-top: 10px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--danger);
}
.qz-error:empty { display: none; }
.qz-note { color: var(--text-2); }
.qz-note:not(:empty)::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--warning);
  vertical-align: 2px;
}

/* ---------- Action dock: fixed on phones (above the keyboard), inline on desktop ---------- */
/* The fade covers only the top padding: behind the button and below it the bar is solid, so no text
   from the scrolled form shows through. */
.qz-dock {
  --dock-pt: 22px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--kb);
  z-index: var(--z-sticky);
  padding: var(--dock-pt) var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent 0, var(--bg) var(--dock-pt));
}
.qz.kb-open .qz-dock { --dock-pt: 10px; padding-bottom: 10px; }
/* Keyboard up (about 360px left on a phone): the top bar scrolls away instead of sticking, and the
   button and the number box get shorter, so the question, the field and its error all fit. */
.qz.kb-open .qz-top { position: relative; }
.qz.kb-open .qz-cta { --btn-h: 52px; }
.qz.kb-open .qz-big { min-height: 112px; padding: 20px 16px; }

/* Cookie sheet (analytics.js: html.consent-open + --consent-h while it is up; it steps aside while
   the keyboard is). Phones: the bar rides above the sheet, every screen gets the scroll room to clear
   it, toasts sit above both. */
@media (max-width: 767px) {
  .consent-open .qz:not(.kb-open) .qz-dock {
    bottom: calc(var(--consent-h, 0px) + var(--consent-gap, 12px));
    padding-bottom: 12px;
  }
  .consent-open .qz-screen > .qz-screen-inner {
    padding-bottom: calc(var(--consent-h, 0px) + var(--consent-gap, 12px) + 8px);
  }
  .consent-open .qz-screen.has-dock > .qz-screen-inner {
    padding-bottom: calc(var(--dock-h) + var(--kb) + var(--toast-h, 0px) + var(--consent-h, 0px) + var(--consent-gap, 12px) + 8px);
  }
  .consent-open .qz-toasts { bottom: calc(var(--kb) + var(--dock-h) + var(--consent-h, 0px) + var(--consent-gap, 12px) + 12px); }
}
/* Wider screens: the sheet is a corner card over the column; the page gets the room to scroll past it. */
@media (min-width: 768px) {
  .qz-main { padding-bottom: calc(28px + var(--toast-h, 0px)); }
  .consent-open .qz-main { padding-bottom: calc(28px + var(--toast-h, 0px) + var(--consent-h, 0px) + var(--consent-gap, 12px)); }
}
/* From 1360px the question screens have the card in the right gutter (consent.css), clear of the column:
   no scroll room needed. */
@media (min-width: 1360px) and (min-height: 541px) {
  .consent-open .qz:not([data-phase='result']) .qz-main { padding-bottom: calc(28px + var(--toast-h, 0px)); }
}
.qz-dock-inner {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, var(--qz-col));
  margin-inline: auto;
}
.qz-cta { width: 100%; }
.qz-cta .qz-cta-label, .qz-cta .arrow { position: relative; z-index: 1; }
/* Not yet available (multi-choice with nothing picked): an opaque, quiet pill instead of a see-through
   olive one. The base .btn[disabled] keeps pointer-events off. */
.qz-cta:disabled {
  opacity: 1;
  background: var(--surface-3);
  color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.qz-cta:disabled .arrow { opacity: 0.5; }
.qz-enter { display: none; }

.qz-cta--timed { overflow: hidden; }
.qz-cta--timed::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--volt-2);
  transform-origin: left center;
  transform: scaleX(0);
  animation: qz-timer var(--auto, 4800ms) linear forwards;
}

/* ---------- Number step ---------- */
.qz-form { margin: 0; }
.qz-big {
  position: relative;
  display: flex;
  /* One line, centred in the box (align-content needs wrap); the unit sits on the number's baseline. */
  flex-wrap: wrap;
  align-content: center;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  min-height: 156px;
  padding: 36px 20px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--grad-surface), var(--surface);
  box-shadow: var(--shadow-1);
  cursor: text;
  overflow: hidden;
  transition: border-color var(--dur-2) ease, box-shadow var(--dur-3) var(--ease-out);
}
.qz-big::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -60%;
  width: 70%;
  height: 100%;
  transform: translateX(-50%);
  background: var(--glow-volt);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-3) ease;
}
.qz-big:focus-within {
  border-color: color-mix(in srgb, var(--volt) 62%, transparent);
  box-shadow: 0 0 0 4px rgba(255, 106, 43, 0.1), var(--shadow-1);
}
.qz-big:focus-within::before { opacity: 0.35; }
.qz-big:has([aria-invalid='true']) { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255, 100, 100, 0.1); }
.qz-big:has([aria-invalid='true'])::before { opacity: 0; }
.qz-big.is-denied { animation: qz-shake 380ms var(--ease-out); }
/* quiz.js (renderNumber autosize) sizes the field to its text, measured on the hidden .qz-big-sizer: the
   number and its unit stay one centred group, the caret starts before the ghost "32" instead of splitting
   it, and "72,5" does not leave a gap before "kg" (ch is wider than Unbounded's tabular digits). */
.qz-big-input,
.qz-big-sizer {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(3.25rem, 2.4rem + 3.6vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.qz-big-input {
  position: relative;
  width: 2.2em;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  text-align: left;
  color: var(--text);
  caret-color: var(--volt);
}
.qz-big-sizer {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  white-space: pre;
  pointer-events: none;
}
/* The goal weight's empty-value dash sits at mid-height, not on the baseline: its unit centres on it. */
.qz-big--dash:has(.qz-big-input:placeholder-shown) .qz-big-unit { align-self: center; }
/* A hint, not an answer: the example numeral is a ghost, and it goes away next to an error. */
.qz-big-input::placeholder,
.qz-measure-input::placeholder { color: var(--text-4); opacity: 0.4; }
.qz-big-input[aria-invalid='true']::placeholder,
.qz-measure-input[aria-invalid='true']::placeholder { opacity: 0; }
.qz-big-unit {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-3);
}
.qz-ref-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.qz-ref-line .mono { color: var(--text-3); font-size: 0.6875rem; }
.qz-skip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  min-height: 44px;
  margin: 14px auto 0;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--text-2);
  transition: color var(--dur-2) ease, border-color var(--dur-2) ease, background-color var(--dur-2) ease;
}
.qz-skip .qz-ico { color: var(--text-3); transition: transform var(--dur-2) var(--ease-out), color var(--dur-2) ease; }
@media (hover: hover) {
  .qz-skip:hover { color: var(--text); border-color: var(--line-3); background: rgba(255, 255, 255, 0.06); }
  .qz-skip:hover .qz-ico { transform: translateX(3px); color: var(--text); }
}

/* ---------- Measurements ---------- */
.qz-seg {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.03);
}
.qz-seg-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border: 1px solid var(--line-3);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  box-shadow: var(--shadow-1);
  transform: translateX(calc(var(--seg, 0) * 100%));
  transition: transform var(--dur-3) var(--ease-out);
}
.qz-seg-opt {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 112px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur-2) ease;
}
.qz-seg-opt .qz-native { left: 50%; }
.qz-seg-opt.is-active, .qz-seg-opt:has(.qz-native:checked) { color: var(--text); }
.qz-seg-opt:has(.qz-native:focus-visible) { outline: 2px solid var(--volt); outline-offset: 2px; }

.qz-measures { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.qz-measure { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.qz-measure-label { font-size: 0.6875rem; color: var(--text-3); }
.qz-measure-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qz-measure-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 0 22px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--grad-surface), var(--surface);
  box-shadow: var(--shadow-1);
  cursor: text;
  transition: border-color var(--dur-2) ease, box-shadow var(--dur-3) var(--ease-out);
}
.qz-measure-box:focus-within {
  border-color: color-mix(in srgb, var(--volt) 62%, transparent);
  box-shadow: 0 0 0 4px rgba(255, 106, 43, 0.1), var(--shadow-1);
}
.qz-measure-box:has([aria-invalid='true']) { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255, 100, 100, 0.1); }
.qz-measure-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 76px;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.035em;
  color: var(--text);
  caret-color: var(--volt);
  font-variant-numeric: tabular-nums;
}
.qz-measure-unit {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- Contact ---------- */
.qz-contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.qz-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.qz-field .qz-error { margin-top: 0; }
.qz-label { font-size: 0.6875rem; color: var(--text-3); }
.qz-contact .input { min-height: 58px; }

.qz-phone {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 58px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}
.qz-phone:hover { border-color: var(--line-3); }
.qz-phone:focus-within { border-color: var(--volt); background: rgba(255, 106, 43, 0.04); box-shadow: 0 0 0 4px rgba(255, 106, 43, 0.12); }
.qz-phone:has([aria-invalid='true']) { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255, 100, 100, 0.12); }
/* A field in error keeps one colour: no volt focus tint under the red frame. */
.qz-contact .input[aria-invalid='true']:focus,
.qz-phone:has([aria-invalid='true']):focus-within { background: color-mix(in srgb, var(--danger) 5%, transparent); }
.qz-cc { position: relative; flex: none; display: flex; border-radius: var(--r-md) 0 0 var(--r-md); }
.qz-cc:has(.qz-cc-select:focus-visible) { box-shadow: inset 0 0 0 2px var(--volt); }
.qz-cc-face {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 16px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
}
.qz-cc-flag { font-size: 1.25rem; line-height: 1; }
.qz-cc-dial { font-variant-numeric: tabular-nums; }
.qz-cc-chev { color: var(--text-3); }
.qz-cc-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
}
.qz-cc-select option, .qz-cc-select optgroup { background: var(--surface); color: var(--text); }
.qz-phone-rule { flex: none; width: 1px; margin: 14px 0; background: var(--line-2); }
.qz-phone-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0 16px 0 14px;
  border: 0;
  background: none;
  outline: none;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.qz-phone-input::placeholder { color: var(--text-4); }

.qz-consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qz-consent .qz-native { top: 12px; left: 12px; }
.qz-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 1.5px solid var(--line-3);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--volt-ink);
  transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease, box-shadow var(--dur-3) ease;
}
.qz-box .qz-ico { opacity: 0; transform: scale(0.4); transition: opacity var(--dur-1) ease, transform var(--dur-3) var(--ease-spring); }
.qz-consent.is-checked .qz-box,
.qz-consent:has(.qz-native:checked) .qz-box { background: var(--volt); border-color: var(--volt); box-shadow: 0 0 14px var(--volt-glow); }
.qz-consent.is-checked .qz-box .qz-ico,
.qz-consent:has(.qz-native:checked) .qz-box .qz-ico { opacity: 1; transform: none; }
.qz-consent:has(.qz-native:focus-visible) .qz-box { outline: 2px solid var(--volt); outline-offset: 3px; }
.qz-consent:has([aria-invalid='true']) .qz-box { border-color: var(--danger); }
.qz-consent a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-2) ease;
}
.qz-consent a:hover { text-decoration-color: var(--volt); }
.qz-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.qz-reassure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-3);
  text-align: center;
}
.qz-reassure .qz-ico { color: var(--volt); }
/* Phones: under the tick, so the docked bar is just the button (96px instead of 127px). */
.qz-reassure--form { justify-content: flex-start; margin-top: -6px; text-align: left; }
.qz-reassure--dock { display: none; }

/* ---------- Rings (interstitial + loading) ---------- */
.qz-ring {
  position: relative;
  width: var(--ring);
  height: var(--ring);
  flex: none;
}
.qz-ring::before {
  content: '';
  position: absolute;
  inset: -35%;
  border-radius: 50%;
  background: var(--glow-volt);
  opacity: 0.28;
  pointer-events: none;
}
.qz-ring svg { position: relative; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.qz-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.08); }
.qz-ring-bar {
  fill: none;
  stroke: var(--volt);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--volt-glow));
}
.qz-screen--mid .qz-ring-bar { transition: stroke-dashoffset 1.2s var(--ease-out) 0.25s; }
.qz-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- Interstitial ---------- */
.qz-screen--mid .qz-ring { margin-bottom: 26px; }
.qz-sum {
  margin: 0;
  padding: 4px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--grad-surface), var(--surface);
  box-shadow: var(--shadow-1);
}
.qz-sum-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  animation: qz-in 600ms var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 130ms + 320ms);
}
.qz-sum-row:first-child { border-top: 0; }
.qz-sum dt { flex: none; font-size: 0.6875rem; color: var(--text-3); }
.qz-sum dd { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-align: right; color: var(--text); }

/* ---------- Loading ---------- */
.qz-screen--loading .qz-screen-inner {
  display: grid;
  justify-items: center;
  padding-top: clamp(16px, 7vh, 72px);
  text-align: center;
}
.qz-screen--loading .qz-ring { margin-bottom: 30px; }
.qz-screen--loading .qz-ring-label { font-size: 1.75rem; }
.qz-screen--loading .qz-head { justify-items: center; margin-bottom: 26px; }
.qz .qz-checklist {
  display: grid;
  gap: 10px;
  width: min(100%, 400px);
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.qz-check-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-3);
  transition: color var(--dur-3) ease, border-color var(--dur-3) ease, background-color var(--dur-3) ease;
}
.qz-check-item.is-active { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.045); }
.qz-check-item.is-done { color: var(--text-2); }
/* Each line reveals the person's own number as it completes. */
.qz-check-item { min-height: 64px; padding-block: 10px; }
.qz-check-text { display: grid; gap: 2px; min-width: 0; }
.qz-check-val {
  font-size: 0.6875rem;
  color: var(--volt);
  overflow-wrap: anywhere;
  opacity: 0;
  transform: translate3d(0, 3px, 0);
  transition: opacity var(--dur-3) ease, transform var(--dur-3) var(--ease-out);
}
.qz-check-item.is-done .qz-check-val { opacity: 1; transform: none; }
.qz-check-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--line-3);
  border-radius: 50%;
  color: var(--volt-ink);
  transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease;
}
.qz-check-ico .qz-ico { opacity: 0; transform: scale(0.4); transition: opacity var(--dur-1) ease, transform var(--dur-3) var(--ease-spring); }
.qz-check-item.is-active .qz-check-ico {
  border-color: color-mix(in srgb, var(--volt) 22%, transparent);
  border-top-color: var(--volt);
  animation: qz-spin 760ms linear infinite;
}
.qz-check-item.is-done .qz-check-ico { background: var(--volt); border-color: var(--volt); box-shadow: 0 0 14px var(--volt-glow); animation: none; }
.qz-check-item.is-done .qz-check-ico .qz-ico { opacity: 1; transform: none; }

/* ---------- Result ---------- */
.qz-res-head { position: relative; }
.qz-res-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border-radius: 14px;
  background: var(--volt);
  color: var(--volt-ink);
  box-shadow: var(--shadow-volt);
}
.qz-ref {
  position: absolute;
  top: 12px;
  right: 0;
  font-size: 0.6875rem;
  color: var(--text-3);
}
.qz-screen--result .qz-title { font-size: clamp(2rem, 1.35rem + 2.9vw, 3.25rem); }
/* Solid volt, like the landing's highlighted words ("Su WhatsApp."): one accent, no multicolour gradient. */
.qz-name { color: var(--volt); }

.qz-res-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.qz-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--grad-surface), var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.qz-screen--result .qz-card,
.qz-screen--result .qz-res-foot {
  animation: qz-rise 760ms var(--ease-out) backwards;
  animation-delay: calc(var(--d, 0) * 85ms + 140ms);
}
.qz-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qz-card-label { font-size: 0.6875rem; color: var(--text-3); }
.qz-card-ico { color: var(--text-3); }
.qz-card-note { margin-top: 8px; font-size: 0.9375rem; line-height: 1.45; color: var(--text-2); }
.qz-stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 12px; }
.qz-stat-num {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.qz-stat-unit {
  font-size: 1rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--text-3);
}

.qz-kcal {
  grid-column: 1 / -1;
  padding: 24px 24px 22px;
  border-color: color-mix(in srgb, var(--volt) 26%, transparent);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 106, 43, 0.12), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(122, 92, 255, 0.16), transparent 60%),
    var(--grad-surface),
    var(--surface);
}
.qz-kcal .qz-card-ico { color: var(--volt); }
.qz-kcal .qz-stat { margin-top: 18px; }
.qz-kcal .qz-stat-num { font-size: clamp(3.5rem, 2.4rem + 5vw, 5.5rem); letter-spacing: -0.05em; }
.qz-kcal .qz-stat-unit { font-size: 1.125rem; color: var(--text-2); }

.qz-macros, .qz-pace { grid-column: 1 / -1; }
.qz-macro-bar { display: flex; gap: 4px; height: 12px; margin-top: 18px; }
.qz-macro-seg {
  flex: 0 0 auto;
  width: 0;
  border-radius: var(--r-pill);
  transition: width 1.2s var(--ease-out);
}
.qz-macro-seg:nth-child(2) { transition-delay: 0.12s; }
.qz-macro-seg:nth-child(3) { transition-delay: 0.24s; }
.qz-screen--result.is-in .qz-macro-seg { width: calc(var(--w) - 3px); }
/* One accent, like the landing's "Piano di oggi" card: protein in volt, the rest in greys. */
.qz-m-protein .qz-dot, .qz-macro-seg.qz-m-protein { background: var(--volt); }
.qz-m-fat .qz-dot, .qz-macro-seg.qz-m-fat { background: var(--text-2); }
.qz-m-carbs .qz-dot, .qz-macro-seg.qz-m-carbs { background: var(--text-4); }
.qz-macro-seg.qz-m-protein { box-shadow: 0 0 14px var(--volt-glow); }
.qz .qz-macro-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.qz-macro-legend li { display: grid; gap: 4px; min-width: 0; }
.qz-macro-name { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-3); }
.qz-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.qz-macro-val {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.qz-macro-pct { font-size: 0.6875rem; font-weight: 500; color: var(--text-3); }

.qz-fromto {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--text-2);
  white-space: nowrap;
}
.qz-fromto-line {
  position: relative;
  flex: 1;
  height: 2px;
  min-width: 24px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--line-3), var(--volt));
}
.qz-fromto-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 12px var(--volt-glow);
}
.qz-fromto-to { color: var(--text); }
.qz-pace-text { margin-top: 14px; font-size: 1rem; line-height: 1.5; font-weight: 550; color: var(--text); }

.qz-program {
  margin-top: 12px;
  padding: 26px 24px 24px;
  border-color: transparent;
  background:
    radial-gradient(100% 80% at 100% 0%, rgba(122, 92, 255, 0.2), transparent 60%),
    var(--grad-surface),
    var(--surface-2);
}
.qz-program::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--grad-border);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.qz-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--volt) 32%, transparent);
  border-radius: var(--r-pill);
  background: var(--volt-tint);
  font-size: 0.6875rem;
  color: var(--volt);
}
.qz-program-name {
  margin-top: 18px;
  font-size: clamp(1.625rem, 1.3rem + 1.3vw, 2.125rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.qz-program-tag { margin-top: 6px; font-size: 1.0625rem; color: var(--text-2); }
.qz .qz-features {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.qz-features li { display: flex; align-items: flex-start; gap: 12px; line-height: 1.45; color: var(--text-2); }
.qz-features .qz-ico {
  width: 22px;
  height: 22px;
  margin-top: 0;
  border-radius: 50%;
  background: var(--volt-tint);
  color: var(--volt);
}
.qz-features .qz-ico svg { width: 14px; height: 14px; }

.qz-next { margin-top: 12px; padding: 24px; }
.qz-next-head { display: flex; align-items: center; gap: 14px; }
.qz-next-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--volt) 30%, transparent);
  border-radius: 14px;
  background: var(--volt-tint);
  color: var(--volt);
}
.qz-next-title {
  margin-top: 18px;
  font-size: clamp(1.25rem, 1.08rem + 0.8vw, 1.625rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-weight: 680;
}
.qz-phone-display { color: var(--volt); white-space: nowrap; }
.qz-next-body { margin-top: 10px; color: var(--text-2); line-height: 1.55; }
.qz-next-actions { display: grid; justify-items: center; gap: 6px; margin-top: 22px; }
.qz-next-actions .btn { width: 100%; }
.qz-home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 4px;
  transition: color var(--dur-2) ease, text-decoration-color var(--dur-2) ease;
}
.qz-home:hover { color: var(--text); text-decoration-color: var(--volt); }

/* Phones: the WhatsApp button docked like every question's action; it steps aside while the card's own
   button is on screen (is-tucked, set by an IntersectionObserver). */
.qz-dock--result {
  transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) ease, visibility var(--dur-3);
  animation: qz-dock-in 640ms var(--ease-out) 900ms backwards;
}
.qz-dock--result.is-tucked { opacity: 0; visibility: hidden; transform: translate3d(0, 24px, 0); }
@keyframes qz-dock-in { from { opacity: 0; visibility: hidden; transform: translate3d(0, 24px, 0); } }

.qz-res-foot { display: grid; justify-items: center; gap: 10px; margin-top: 26px; text-align: center; }
.qz-disclaimer { max-width: 46ch; font-size: 0.8125rem; line-height: 1.5; color: var(--text-3); }
.qz-restart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  font-size: 0.875rem;
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 4px;
  transition: color var(--dur-2) ease, text-decoration-color var(--dur-2) ease;
}
.qz-restart:hover { color: var(--text); text-decoration-color: var(--volt); }

/* ---------- Toasts ---------- */
.qz-toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--kb) + var(--dock-h) + 12px);
  z-index: var(--z-toast);
  display: grid;
  gap: 8px;
  width: min(100% - 2 * var(--gutter), 520px);
  transform: translateX(-50%);
  pointer-events: none;
}
.qz-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  padding: 6px 4px 6px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.qz-toast.is-in { opacity: 1; transform: none; }
.qz-toast-ico { color: var(--warning); }
.qz-toast-msg { min-width: 0; padding-block: 6px; font-size: 0.9375rem; line-height: 1.4; color: var(--text); }
/* The action (WhatsApp, when a number is configured) sits on its own row under the message: outlined,
   so the docked volt button stays the one primary action. */
.qz-toast-actions { grid-column: 2 / -1; display: flex; padding: 2px 12px 8px 0; }
.qz-toast-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  white-space: nowrap;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease;
}
.qz-toast-action .qz-ico { color: var(--volt); }
.qz-toast-action:hover { border-color: color-mix(in srgb, var(--volt) 55%, transparent); background: rgba(255, 255, 255, 0.07); }
.qz-toast-x {
  display: grid;
  place-items: center;
  align-self: start;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-3);
}
.qz-toast-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* ---------- Brand promise rail (very wide screens) ---------- */
.qz-aside { display: none; }

/* ---------- No JavaScript ---------- */
.no-js .qz-stage { display: none; }
.qz-noscript { display: grid; justify-items: start; gap: 18px; margin-top: 8px; padding: 28px; color: var(--text-2); }

/* ---------- Phones: no letter keys (no keyboard), tighter cards so a step fits one screen ---------- */
@media (max-width: 767px) {
  .qz-toast { column-gap: 10px; padding-left: 14px; }
  .qz-toast-msg { font-size: 0.875rem; }
  .qz-option .qz-key { display: none; }
  .qz-opt-ic { width: 38px; height: 38px; border-radius: 12px; }
  .qz-option { gap: 12px; padding: 12px 14px 12px 16px; }
  .qz-option-label { font-size: 1rem; }
  .qz-option-hint { font-size: 0.8125rem; }
  .qz-head { gap: 8px; }
  .qz-sub { font-size: 0.9375rem; }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  .qz-option { gap: 12px; min-height: 58px; padding: 10px 14px 10px 12px; }
  .qz-key { width: 26px; height: 26px; }
  .qz-option-label { font-size: 1rem; }
  .qz-option-hint { font-size: 0.8125rem; }
  .qz-big { min-height: 136px; padding: 28px 16px; }
  .qz-macro-val { font-size: 1rem; }
  .qz-card { padding: 18px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  .qz-top {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, calc(var(--qz-col) - 60px)) minmax(0, 1fr);
    grid-template-areas:
      'brand brand . close'
      '. back meter .';
    column-gap: 16px;
    padding-top: calc(env(safe-area-inset-top) + 16px);
    padding-bottom: 16px;
  }
  .qz-brand { justify-self: start; }
  /* Same row as the back button, both centred on one line (a top margin here sat the meter 11px lower). */
  .qz-meter { margin-top: 0; }
  .qz-count { font-size: 0.75rem; }
  .qz-main { padding-top: clamp(28px, 5.5vh, 64px); }

  .qz-dock { position: static; padding: 30px 0 0; background: none; }
  .qz-screen.has-dock > .qz-screen-inner { padding-bottom: 0; }
  .qz-dock-inner { display: flex; align-items: center; justify-content: flex-start; gap: 20px; width: auto; margin: 0; }
  .qz-cta { width: auto; min-width: 210px; }
  .qz-enter { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-3); }
  .qz-enter kbd {
    min-width: 26px;
    padding: 3px 7px;
    text-align: center;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.1;
    color: var(--text-2);
  }
  .qz-dock--contact .qz-dock-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .qz-dock--contact .qz-cta { width: 100%; }
  .qz-reassure--dock { display: flex; }
  .qz-reassure--form { display: none; }

  .qz-option { min-height: 66px; padding: 14px 18px 14px 16px; }
  .qz-skip { margin-inline: 0; }
  .qz-ref-line { justify-content: flex-start; }

  .qz-toasts { bottom: 32px; }
  .qz-res-grid { gap: 14px; }
  .qz-card { padding: 24px; }
  .qz-kcal { padding: 28px 28px 26px; }

  /* Result: the profile on the left, the next step (WhatsApp) as a sticky column on the right that starts
     level with the heading, so the button is on the first screen even on a 600px-tall laptop window
     instead of 1,700px down. */
  .qz-dock--result { display: none; }
  .qz[data-phase='result'] { --qz-col: 1040px; }
  .qz-screen--result .qz-screen-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 20px;
    align-items: start;
  }
  .qz-screen--result .qz-head,
  .qz-screen--result .qz-res-grid,
  .qz-screen--result .qz-program,
  .qz-screen--result .qz-res-foot { grid-column: 1; }
  .qz-screen--result .qz-next {
    grid-column: 2;
    grid-row: 1 / span 4;
    position: sticky;
    top: 140px;                    /* clear of the sticky top bar (121px from 768px) */
    margin-top: 0;
    padding: 22px;
  }
  .qz-screen--result .qz-program { margin-top: 14px; }
  .qz-next .btn { padding-inline: 1.25rem; }
}

/* ---------- Wide: the back button hangs left of the column, the meter spans it ---------- */
@media (min-width: 1024px) {
  .qz-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--qz-col)) minmax(0, 1fr);
    grid-template-areas:
      'brand . close'
      'back meter .';
  }
  .qz-back { justify-self: end; margin-right: 2px; }
  .qz-screen--result .qz-screen-inner { grid-template-columns: minmax(0, 1fr) 360px; column-gap: 24px; }
  .qz-screen--result .qz-next { padding: 26px; }
}

/* ---------- Very wide: the brand promise on the left ---------- */
@media (min-width: 1280px) and (min-height: 680px) {
  .qz-aside {
    position: fixed;
    left: calc(var(--gutter) + 4px);
    bottom: 44px;
    z-index: 1;
    display: grid;
    gap: 16px;
    width: 236px;
    transition: opacity var(--dur-3) ease, visibility var(--dur-3) ease;
  }
  .qz[data-phase='loading'] .qz-aside,
  .qz[data-phase='result'] .qz-aside { opacity: 0; visibility: hidden; }
  .qz .qz-promise { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: promise; }
  .qz-promise li {
    display: flex;
    gap: 14px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-3);
    counter-increment: promise;
  }
  .qz-promise li::before {
    content: counter(promise, decimal-leading-zero);
    flex: none;
    padding-top: 2px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    color: var(--volt);
  }
}

@media (prefers-reduced-motion: reduce) {
  .qz-glow { transition: none; }
  /* base.css shortens durations but keeps delays: with a "backwards" fill, options, summary rows, result
     cards and the docked WhatsApp button would stay invisible for up to 0.9 s before appearing. */
  .qz *, .qz *::before, .qz *::after { animation-delay: 0s !important; transition-delay: 0s !important; }
  /* The interstitial's countdown fill would jump straight to full and wash out the button: no fill, a plain
     Continue (the screen still moves on by itself). */
  .qz-cta--timed::before { display: none; }
}
