/*
  Routine Calculator — page-specific styles. Tokens only.
  Reuses components.css (.option-tile, .category-chip, .product-card, .badge,
  .alert, .card, .progress-dots). New bits: quiz layout, results hero, step
  cards, timing pills, and the ingredient-checker bottom sheet.
*/

/* Builder hides the marketing footer; the calculator is a full-height tool too. */
.site-footer { display: none; }

/* ── Quiz ── */
.calc__quiz {
  min-height: calc(100dvh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
}
.calc__card { width: 100%; max-width: var(--quiz-max-width); }
.calc__q { margin-bottom: var(--space-2); }
.calc__hint {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}
.calc__tiles { display: flex; flex-direction: column; gap: var(--space-3); }

/* option-tile base is row-flex; this stacks the label/sub next to the icon. */
.option-tile__text { display: flex; flex-direction: column; gap: 2px; }

/* Concern grid: 2-col, icon-over-label tiles. */
.calc-concerns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.option-tile--concern {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
}
.option-tile--concern:disabled { opacity: 0.45; cursor: not-allowed; }
.option-tile--concern .option-tile__icon { width: 32px; height: 32px; }
.option-tile--concern .option-tile__label { font-size: var(--text-sm); }

.calc__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-6);
  gap: var(--space-3);
}

/* ── Results hero ── */
.calc-hero {
  background: linear-gradient(160deg, var(--color-primary-50) 0%, var(--color-accent-50) 100%);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-8) var(--space-4) var(--space-6);
  text-align: center;
}
.calc-hero__inner { max-width: var(--quiz-max-width); margin: 0 auto; }
.calc-hero h1 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.calc-hero__for {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
}
.calc-badges {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: var(--space-3); margin-bottom: var(--space-4);
}
.calc-hero__alert { text-align: left; font-size: var(--text-sm); margin-top: var(--space-2); }

/* ── Step list ── */
.calc-steps {
  max-width: var(--quiz-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-16);
}
.calc-steps__banner {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.calc-steps__banner p { margin: 0; font-size: var(--text-sm); }
.calc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.calc-manual {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 420px;
  margin: var(--space-4) auto 0;
}

/* Spinner for the share button (mirrors builder.css). */
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.calc-steps__disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  line-height: var(--leading-relaxed);
  max-width: 360px;
  margin: var(--space-6) auto 0;
}

/* ── Step card ── */
.step-card { margin-bottom: var(--space-3); overflow: hidden; }
.step-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.step-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-primary-100);
  color: var(--color-primary-700);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  display: flex; align-items: center; justify-content: center;
}
.step-card__title-wrap { flex: 1; min-width: 0; }
.step-card__title-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--space-2);
}
.step-card__name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-base);
  color: var(--color-text-primary);
}
.step-card__when {
  display: flex; align-items: center; gap: var(--space-1);
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.step-card__chev { color: var(--color-text-muted); flex-shrink: 0; }

.step-card__body {
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.step-card__what { font-size: var(--text-sm); color: var(--color-text-secondary); margin: 0; }
.step-card__tip {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-primary-400);
}
.step-card__tip p { font-size: var(--text-sm); color: var(--color-text-secondary); margin: 0; }
.step-card__ings { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Timing pill */
.timing {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}
.timing--am { color: var(--color-warning-dark); background: var(--color-warning-light); }
.timing--pm { color: var(--color-primary-600); background: var(--color-primary-50); }
.timing--both { color: var(--color-accent-600); background: var(--color-accent-100); }

/* Product row (horizontal scroll) */
.product-row {
  display: flex; gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scrollbar-width: thin;
}
.calc-product {
  min-width: 180px; max-width: 200px; flex-shrink: 0;
}
.calc-product .product-card__image {
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
}

/* ── Ingredient checker bottom sheet ── */
.sheet__overlay {
  position: fixed; inset: 0;
  background: var(--color-overlay);
  z-index: 100;
}
.sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 101;
  background: var(--color-surface);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-6) var(--space-4);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  max-height: 85dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  max-width: 640px;
  margin: 0 auto;
}
.sheet__handle {
  width: 40px; height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-neutral-300);
  margin: 0 auto var(--space-5);
}
.sheet__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-4);
}
.sheet__sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
}
.actives-grid {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.sheet__result { flex-direction: column; gap: var(--space-2); }
.sheet__result-head { display: flex; align-items: center; gap: var(--space-2); }
.sheet__result-pair { display: flex; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-xs); }
