/* =====================================================================
   Kosso Nutrition — Keuzehulp
   Mobile-first, app-feel UI matching kossonutrition.nl branding.
   - Background: white  (matches site --color-background: 255,255,255)
   - Text:       near-black  (--color-foreground: 34,34,34)
   - Heading:    pure black  (--color-heading: 0,0,0)
   - Accent:     sky-blue    (--color-button alt: 101,190,236 = #65BEEC)
   - Buttons:    pill-shaped, uppercase, condensed
   - Heading typeface: Barlow Condensed (free alt to Acumin Pro Condensed)
   - Body typeface:    Inter (paired sans, neutral)
   ===================================================================== */

:root {
  --bg:           #ffffff;
  --surface:      #ffffff;
  --surface-2:    #f8f8f8;
  --surface-3:    #efefef;
  --border:       #dedede;
  --border-strong:#222222;
  --text:         #222222;
  --text-strong:  #000000;
  --text-dim:     #666666;
  --text-muted:   #999999;
  --accent:       #65BEEC;       /* sky blue – Kosso signature */
  --accent-2:     #2DA9DC;
  --accent-soft:  rgba(101,190,236,0.16);
  --accent-tint:  rgba(101,190,236,0.08);
  --success:      #4cb242;       /* Kosso cart green */
  --danger:       #DA3F3F;

  --topbar-h:     56px;
  --footer-h:     calc(76px + env(safe-area-inset-bottom));
  --radius:       12px;
  --radius-sm:    8px;
  --radius-pill:  100px;          /* Kosso btn-border-radius */

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
  --shadow-pop:   0 8px 24px rgba(0,0,0,0.08);

  --ease:         cubic-bezier(.2,.7,.2,1);

  --font-heading: "Barlow Condensed", "Acumin Pro Condensed", "Oswald", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body:    "Inter", "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; }

button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }   /* iOS no-zoom */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0;
}

/* ---------- App shell ----------- */

.wizard {
  position: relative;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}
.wizard.has-footer { padding-bottom: var(--footer-h); }

/* ---------- Sticky top app bar ----------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.appbar__back,
.appbar__action {
  appearance: none;
  background: transparent;
  border: 0;
  height: var(--topbar-h);
  width: 56px;
  display: inline-grid;
  place-items: center;
  color: var(--text-strong);
  cursor: pointer;
  transition: opacity .15s var(--ease);
}
.appbar__back[disabled],
.appbar__action[disabled] { opacity: 0; pointer-events: none; }
.appbar__back svg,
.appbar__action svg { width: 22px; height: 22px; }

.appbar__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  text-decoration: none;
  user-select: none;
}
.appbar__brand img {
  height: 30px;
  width: auto;
  display: block;
}
.appbar__sub {
  display: inline-block;
  padding: 3px 7px;
  border: 1.5px solid var(--text-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-strong);
  line-height: 1;
  white-space: nowrap;
}
@media (min-width: 720px) {
  .appbar__sub { font-size: 11px; padding: 4px 9px; }
}

/* Progress hairline directly under appbar */
.progress-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 29;
  height: 3px;
  background: var(--surface-3);
}
.progress-bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--text-strong);
  transition: width .45s var(--ease);
}

/* ---------- Stage / steps ----------- */

.stage {
  flex: 1;
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 8px;
}

.step { display: none; }
.step.is-active {
  display: block;
  animation: stepIn .32s var(--ease) both;
}
.step.is-leaving {
  display: block;
  animation: stepOut .22s var(--ease) both;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-12px); }
}
@keyframes stepInBack {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.step.is-active.is-back { animation-name: stepInBack; }

.step__eyebrow {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 600;
  margin: 0 0 10px;
}
.step__title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  letter-spacing: -0.005em;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
.step__lead {
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.5;
}

/* ---------- Cards (single-select tiles) ----------- */

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cards--single { grid-template-columns: 1fr; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 16px;
  min-height: 120px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .12s var(--ease);
  text-align: left;
}
.card:active { transform: scale(0.985); }
.card input { position: absolute; opacity: 0; pointer-events: none; }

.card__icon {
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 6px;
}
.card__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-strong);
  line-height: 1.05;
}
.card__text {
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.4;
}

.card.is-selected {
  border-color: var(--text-strong);
  background: var(--accent-tint);
  box-shadow: 0 0 0 1.5px var(--text-strong) inset;
}
.card.is-selected::after {
  content: "";
  position: absolute;
  top: 12px; right: 12px;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--text-strong);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 12.5 10 17.5 19 7.5'/></svg>");
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
  animation: pop .25s var(--ease);
}
@keyframes pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* List style (vertical) */
.cards--vertical { display: flex; flex-direction: column; gap: 8px; }
.card--row {
  flex-direction: row;
  align-items: flex-start;
  gap: 4px 12px;
  min-height: auto;
  padding: 16px 18px;
  padding-right: 48px;
}
.card--row .card__title { min-width: 0; flex: 0 0 auto; }
.card--row .card__text { flex: 1 1 100%; margin-top: 2px; }

/* ---------- Pills (chips) ----------- */

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
  flex: 1 1 auto;
}
.pill:active { transform: scale(0.97); }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill.is-selected {
  border-color: var(--text-strong);
  background: var(--text-strong);
  color: #fff;
}
.pill-group--equal .pill { flex: 1 1 0; }

/* ---------- Form inputs ----------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.form-grid--two { grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-group--full { grid-column: 1 / -1; }

.form-group > label,
.form-group > legend {
  display: block;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input-wrap:focus-within {
  border-color: var(--text-strong);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.input-wrap input {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 16px 14px;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 600;
  outline: none;
  letter-spacing: -0.01em;
}
.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap input[type=number] { -moz-appearance: textfield; }
.input-wrap .suffix {
  padding-right: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
  text-transform: lowercase;
}

.hint {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text-strong);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hint span { color: var(--text-dim); }
.hint strong { font-weight: 700; }

/* ---------- Result step ----------- */

.result-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.result-card--accent {
  background: var(--text-strong);
  color: #fff;
  border-color: var(--text-strong);
}
.result-card--accent .result-card__label,
.result-card--accent .result-card__unit,
.result-card--accent .result-card__hint { color: rgba(255,255,255,0.74); }
.result-card--accent .result-card__value { color: #fff; }
.result-card__label {
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 600;
}
.result-card__value {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-strong);
}
.result-card__unit { color: var(--text-dim); font-size: 0.85rem; }
.result-card__hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 6px; }

.macros {
  margin-top: 20px;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.macros h3 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 600;
}
/* Mobile: stacked rows so the labels (incl. "Koolhydraten") have
   room. On >=720px we go back to a 3-column card grid. */
.macros__grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.macros__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.macros__label {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  flex: 0 0 auto;
}
.macros__value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  white-space: nowrap;
}
.macros__value strong { font-weight: inherit; }
.macros__note { font-size: 0.82rem; color: var(--text-dim); margin: 12px 0 0; }

@media (min-width: 720px) {
  .macros__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .macros__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .macros__value { font-size: 1.5rem; }
}

/* ---------- Summary ----------- */

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0 24px;
}
.summary__item {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.summary__item span {
  font-family: var(--font-heading);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.summary__item strong { font-size: 0.95rem; font-weight: 700; color: var(--text-strong); }

/* ---------- Recommendations: sections + 2-col grid ----------- */

.recommendations {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 16px;
}
.rec-section-header {
  margin: 4px 0 -4px;
}
.rec-section-header__title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--text-strong);
  margin: 0 0 4px;
  line-height: 1.1;
}
.rec-section-header__desc {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.rec-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .rec-section-grid { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
}

/* Essentieel section gets a subtle accent treatment */
.product--essential {
  border-color: var(--text-strong);
  box-shadow: 0 0 0 1px var(--text-strong) inset;
}

/* ---------- Multi-label chips on the card ----------- */

.product__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 6px;
}
.label {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  line-height: 1.2;
  white-space: nowrap;
}
.label--essential   { background: var(--text-strong); color: #fff; }
.label--featured    { background: var(--accent); color: #000; }
.label--upgrade     { background: #2a2a2a; color: #fff; }
.label--protein     { background: #fef3c7; color: #92400e; }
.label--performance { background: #dbeafe; color: #1e40af; }
.label--goal        { background: #fee2e2; color: #991b1b; }
.label--recovery    { background: #e0e7ff; color: #3730a3; }
.label--health      { background: #d1fae5; color: #065f46; }
.label--timing      { background: var(--surface-2); color: var(--text-dim); }

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  overflow: hidden;
  transition: border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.product:active { transform: scale(0.985); }
.product:hover { border-color: var(--text-strong); box-shadow: 0 6px 18px rgba(0,0,0,0.06); }

.product__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product__media img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
}

.product__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-heading);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.product__badge--alt {
  background: var(--text-strong);
  color: #fff;
}

.product__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 12px;
  min-width: 0;
}
.product__cat {
  font-family: var(--font-heading);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.product__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin: 2px 0 4px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-strong);
  line-height: 1.05;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product__price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-top: auto;
  padding-top: 4px;
}
.product__info {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  border: 1px solid var(--border);
}
@media (min-width: 720px) {
  .recommendations { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .product__title { font-size: 1.05rem; }
}

/* ---------- Product detail modal (PDP) ----------- */

.modal__panel--info {
  max-width: 460px;
  padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
}

.modal__panel--product {
  max-width: 540px;
  max-height: 92vh;
  padding: 0;
  overflow: hidden;             /* keep rounded corners over the image */
  display: flex;
  flex-direction: column;
}
/* The PDP scrolls internally so the absolute-positioned close button
   above it stays visible no matter how long the product copy is. */
.pdp {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.pdp__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.pdp__media img { width: 60%; height: 80%; object-fit: contain; }
.pdp__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-heading);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.pdp__head { padding: 18px 22px 6px; }
.pdp__cat {
  display: block;
  font-family: var(--font-heading);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.pdp__title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  text-transform: uppercase;
  margin: 2px 0 4px;
  letter-spacing: -0.005em;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.05;
}
.pdp__price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}
.pdp__why {
  margin: 12px 22px 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}
.pdp__section {
  margin: 16px 22px 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.pdp__heading {
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 700;
  margin: 0 0 10px;
}
.pdp__reasons {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pdp__reasons li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-strong);
  line-height: 1.4;
}
.pdp__reasons li::before {
  content: "✓";
  color: var(--accent-2);
  font-weight: 800;
  flex: 0 0 14px;
  text-align: center;
}
.pdp__personal {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.pdp__goal,
.pdp__usage {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.55;
}
.pdp__goal { white-space: pre-line; }
.modal__panel--product .btn {
  margin: 18px 22px 0;
  width: calc(100% - 44px);
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- Sticky footer CTA ----------- */

.footer-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform .3s var(--ease);
}
.footer-cta.is-visible { transform: translateY(0); }
.footer-cta__inner { max-width: 720px; margin: 0 auto; }

/* ---------- Buttons ----------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 56px;
  padding: 0 24px;
  border: 1px solid var(--text-strong);
  border-radius: var(--radius-pill);
  background: var(--text-strong);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .1s var(--ease), background .15s var(--ease), opacity .15s var(--ease), color .15s var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn:disabled {
  background: var(--surface-3);
  color: var(--text-muted);
  border-color: var(--surface-3);
  cursor: not-allowed;
}
.btn--secondary {
  background: transparent;
  color: var(--text-strong);
  border: 1.5px solid var(--text-strong);
}
.btn--secondary:active { transform: scale(0.985); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-family: var(--font-body);
}

.step__nav-end {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* ---------- Info-tip pill (BMR/TDEE/macro tooltips) ----------- */

.info-tip {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0;
  border: 1.4px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  vertical-align: -2px;
  opacity: 0.55;
  transition: opacity .15s var(--ease), background .15s var(--ease);
  /* Don't let the pill shrink at low font sizes */
  flex-shrink: 0;
}
.info-tip:hover { opacity: 1; }
.info-tip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  opacity: 1;
}
.info-tip:active { transform: scale(0.92); }
.info-tip--invert { color: rgba(255,255,255,0.78); }

/* Generous tap-target overlay so the small "i" still feels easy to
   tap on mobile without changing the visual size. */
.info-tip::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
}
.info-tip { position: relative; }

/* ---------- Modal ----------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
  transform: translateY(100%);
  transition: transform .3s var(--ease);
}
.modal.is-open .modal__panel { transform: translateY(0); }

.modal__close {
  position: absolute;
  top: max(env(safe-area-inset-top, 0px), 12px);
  right: 16px;
  z-index: 65;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: var(--text-strong);
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  transition: transform .1s var(--ease), background .15s var(--ease);
}
.modal__close:hover { background: #222; }
.modal__close:active { transform: scale(0.92); }
/* Anchored to the .modal root (which is position:fixed; inset:0) — NOT
   to the panel — so the button stays glued to the viewport's top-right
   even when the panel scrolls or fills the full screen. position:fixed
   wouldn't work from inside the panel because the panel has a transform. */

.modal__title {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: clamp(1.4rem, 5vw, 1.7rem);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--text-strong);
  font-weight: 800;
}
.modal__lead {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.modal__form { display: flex; flex-direction: column; gap: 14px; }
.modal__status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--text-dim);
  text-align: center;
}
.modal__status.is-error { color: var(--danger); }
.modal__status.is-success { color: var(--success); font-weight: 600; }

@media (min-width: 720px) {
  .modal { align-items: center; padding: 24px; }
  .modal__panel {
    border-radius: 18px;
    transform: scale(0.96) translateY(8px);
  }
  .modal.is-open .modal__panel { transform: scale(1) translateY(0); }
}

.site-footer {
  padding: 18px 20px 28px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.5;
}
.site-footer p { margin: 0 0 6px; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer__disclaimer {
  font-size: clamp(0.66rem, 2.6vw, 0.78rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-footer a { color: var(--text-dim); text-decoration: underline; }
.site-footer__copy {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 12px !important;
}
img.site-footer__tag {
  display: inline-block !important;
  width: 110px !important;
  max-width: 110px !important;
  height: auto !important;
  margin-top: 10px;
  transform: rotate(-3deg);
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(2px 3px 4px rgba(0,0,0,0.12));
}
@media (min-width: 720px) {
  img.site-footer__tag { width: 130px !important; max-width: 130px !important; }
}

/* ---------- Tablet / desktop scale-up ----------- */

@media (min-width: 720px) {
  :root { --topbar-h: 64px; }
  .appbar__brand img { height: 36px; }
  .stage { padding: 40px 32px 16px; }
  .step__title { font-size: 3rem; }
  .step__lead { font-size: 1.05rem; max-width: 56ch; }
  .cards { grid-template-columns: 1fr 1fr; gap: 14px; }
  .form-grid--two { gap: 16px; }
  .summary { grid-template-columns: repeat(4, 1fr); }
  .result-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .result-grid > .result-card--accent { grid-column: 1 / -1; }
  .recommendations { display: grid; grid-template-columns: 1fr 1fr; }
  .footer-cta { padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); }
}

@media (min-width: 960px) {
  .recommendations { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- Reduced motion ----------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* ---------- Crosslink to the other tool ---------- */
.crosslink {
  margin: 26px 0 0;
  padding: 18px 18px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crosslink__eyebrow {
  font-family: var(--font-heading);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  font-weight: 600;
}
.crosslink__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-strong);
  margin: 0;
  line-height: 1.1;
}
.crosslink__text {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.crosslink__btn {
  align-self: flex-start;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--text-strong);
  background: transparent;
  color: var(--text-strong);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.crosslink__btn:hover {
  background: var(--text-strong);
  color: #fff;
}

/* ---------- Focus states ----------- */
button:focus-visible,
.card:focus-visible,
.pill:focus-visible,
.product:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.input-wrap:focus-within { outline: none; }

/* ----- Soft unlock state (shared across Kosso tools) ----- */
.is-locked {
  filter: blur(8px) saturate(0.7);
  pointer-events: none;
  user-select: none;
}
.soft-unlock-prompt {
  margin: 18px 0 14px;
  padding: 22px 22px 24px;
  background: var(--surface);
  border: 1.5px solid var(--text-strong);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-pop);
  position: relative;
  z-index: 6;
}
.soft-unlock-prompt__lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text-strong);
  color: #fff;
  margin-bottom: 10px;
}
.soft-unlock-prompt__title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  text-transform: uppercase;
}
.soft-unlock-prompt__text {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}
