:root {
  --bg: #f7f4ef;
  --surface: #fff;
  --surface-alt: #f0ebe3;
  --text: #1f1f1f;
  --muted: #66625d;
  --border: #ded7cd;
  --accent: #a7342d;
  --accent-dark: #7d241f;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(33, 26, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.calculator-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.calculator-hero {
  max-width: 760px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

h3 {
  margin-bottom: 8px;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.calculator-hero > p:last-child,
.field-help,
.results-heading p,
.formula-notes,
.flour-details {
  color: var(--muted);
}

/* =========================================================
   CALCULATOR LAYOUT
   ========================================================= */

.calculator-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(340px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.calculator-panel,
.results-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calculator-panel {
  padding: clamp(20px, 4vw, 36px);
}

.results-panel {
  padding: clamp(20px, 4vw, 34px);
  position: sticky;
  top: 24px;
}

/* =========================================================
   FIELDS
   ========================================================= */

.field + .field,
.advanced {
  margin-top: 26px;
}

.field label,
.advanced label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: #fff;
  color: var(--text);
}

select:focus-visible,
input:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(167, 52, 45, 0.22);
  outline-offset: 2px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.label-row,
.live-weight,
.total-dough {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.range-labels {
  display: flex;
  justify-content: space-between;

  margin-top: 3px;

  color: var(--muted);
  font-size: 0.82rem;
}

.live-weight {
  margin-top: 14px;
  padding: 14px 16px;

  border-radius: 12px;

  background: var(--surface-alt);
}

.live-weight strong,
.total-dough strong {
  font-size: 1.35rem;
}

.field-help,
.recommendation,
.flour-details {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.recommendation {
  min-height: 1.35em;
  color: var(--accent-dark);
  font-weight: 650;
}

.flour-details {
  padding: 12px 14px;

  border-left: 3px solid var(--border);

  background: #faf8f5;
}

#diameterField[hidden],
#detroitPanField[hidden] {
  display: none;
}

/* =========================================================
   QUANTITY STEPPER
   ========================================================= */

.stepper {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
}

.stepper button {
  min-height: 48px;

  border: 0;
  border-radius: 10px;

  background: var(--text);
  color: #fff;

  font-size: 1.35rem;

  cursor: pointer;
}

.stepper button:hover {
  background: #333;
}

.stepper input {
  text-align: center;
}

/* =========================================================
   ADVANCED FORMULA
   ========================================================= */

.advanced {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.advanced summary {
  cursor: pointer;
  font-weight: 800;
}

.advanced-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;

  margin-top: 18px;
}

/* =========================================================
   RESULTS
   ========================================================= */

.results-heading {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.total-dough {
  margin: 22px 0;
  padding: 18px;

  border-radius: 14px;

  background: var(--text);
  color: #fff;
}

.ingredient-results {
  margin: 0;
}

.ingredient-results > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;

  padding: 13px 0;

  border-bottom: 1px solid var(--border);
}

.ingredient-results dt {
  font-weight: 700;
}

.ingredient-results dd {
  margin: 0;
  text-align: right;
}

.ingredient-results small {
  display: block;
  color: var(--muted);
}

.formula-notes {
  margin-top: 22px;
  font-size: 0.88rem;
}

.formula-notes p:last-child {
  margin-bottom: 0;
}

/* =========================================================
   LOADED RECIPE NOTICE
   ========================================================= */

.calculator-preset-notice {
  max-width: 1180px;

  margin: 0 auto 32px;
  padding: clamp(20px, 3vw, 28px);

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-left: 5px solid var(--accent);
  border-radius: 12px;

  background: #fff8ed;
  color: #171717;
}

.calculator-preset-notice[hidden] {
  display: none;
}

.calculator-preset-notice .eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
}

.calculator-preset-notice h2 {
  margin: 0 0 8px;

  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.15;
}

.calculator-preset-notice p:last-child {
  margin-bottom: 0;
}

/* =========================================================
   RECIPE GUIDE
   ========================================================= */

.recipe-guide {
  margin-top: 32px;
  padding: clamp(24px, 4vw, 40px);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: var(--shadow);
}

.recipe-guide[hidden] {
  display: none;
}

.recipe-guide__header {
  max-width: 800px;

  margin-bottom: 26px;
  padding-bottom: 24px;
}

.recipe-guide__header h2 {
  margin-bottom: 10px;
}

.recipe-guide__header p:last-child {
  max-width: 720px;
  margin-bottom: 0;

  color: var(--muted);
}

/* =========================================================
   RECIPE INSTRUCTIONS
   ========================================================= */

.recipe-instructions {
  margin: 0;
  padding: 0;

  list-style: none;

  counter-reset: recipe-step;
}

.recipe-instructions li {
  position: relative;

  counter-increment: recipe-step;

  min-height: 56px;

  margin: 0;
  padding:
    16px 18px
    16px 72px;

  border-bottom: 1px solid var(--border);

  font-size: 1rem;
  line-height: 1.6;
}

.recipe-instructions li:first-child {
  border-top: 1px solid var(--border);
}

.recipe-instructions li::before {
  content: counter(recipe-step);

  position: absolute;
  left: 10px;
  top: 13px;

  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;

  border-radius: 50%;

  background: var(--accent);
  color: #fff;

  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}

/* =========================================================
   RECIPE VIDEO
   ========================================================= */

.recipe-video {
  margin-top: 36px;
  padding-top: 30px;

  border-top: 1px solid var(--border);
}

.recipe-video[hidden] {
  display: none;
}

.recipe-video__heading {
  max-width: 720px;
  margin-bottom: 18px;
}

.recipe-video__heading h3 {
  margin-bottom: 8px;
}

.recipe-video__heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.recipe-video__embed {
  position: relative;

  width: 100%;
  aspect-ratio: 16 / 9;

  overflow: hidden;

  border-radius: 14px;

  background: #111;
}

.recipe-video__embed iframe {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  border: 0;
}

/* =========================================================
   STATUS MESSAGE
   ========================================================= */

.status-message {
  position: fixed;

  left: 50%;
  bottom: 24px;

  transform:
    translateX(-50%)
    translateY(120px);

  z-index: 1000;

  max-width: calc(100% - 32px);

  padding: 12px 18px;

  border-radius: 999px;

  background: var(--text);
  color: #fff;

  opacity: 0;

  transition: 0.25s ease;

  pointer-events: none;

  text-align: center;
}

.status-message.is-visible {
  opacity: 1;

  transform:
    translateX(-50%)
    translateY(0);
}

/* =========================================================
   DOUGH PRODUCT RECOMMENDATIONS
   ========================================================= */

.recipe-products {
  margin-top: 40px;
  padding-top: 34px;

  border-top: 1px solid var(--border);
}

.recipe-products__header {
  max-width: 760px;
  margin-bottom: 24px;
}

.recipe-products__header h2 {
  margin-bottom: 10px;
}

.recipe-products__header p:last-child {
  margin-bottom: 0;

  color: var(--muted);
}


/* =========================================================
   PRODUCT GRID
   ========================================================= */

.recipe-products__grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 18px;
}


/* =========================================================
   PRODUCT CARD
   ========================================================= */

.calculator-product-card {
  min-width: 0;

  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: var(--surface);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.calculator-product-card:hover {
  transform: translateY(-3px);

  border-color: #cbc2b6;

  box-shadow:
    0 14px 30px
    rgba(33, 26, 20, 0.09);
}

.calculator-product-card a {
  display: flex;
  flex-direction: column;

  height: 100%;

  color: inherit;

  text-decoration: none;
}


/* =========================================================
   PRODUCT IMAGE
   ========================================================= */

.calculator-product-card__image {
  position: relative;

  width: 100%;
  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: var(--surface-alt);
}

.calculator-product-card__image img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  transition:
    transform 0.25s ease;
}

.calculator-product-card:hover
.calculator-product-card__image img {
  transform: scale(1.025);
}


/* =========================================================
   PRODUCT CONTENT
   ========================================================= */

.calculator-product-card__category {
  margin:
    18px 18px
    5px;

  color: var(--accent);

  font-size: 0.72rem;
  font-weight: 800;

  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.calculator-product-card h3 {
  margin:
    0 18px
    8px;

  font-size: 1rem;
  line-height: 1.3;
}

.calculator-product-card h3:first-child {
  margin-top: 18px;
}

.calculator-product-card h3 + p {
  margin:
    0 18px
    18px;

  color: var(--muted);

  font-size: 0.88rem;
  line-height: 1.5;
}

.calculator-product-card__link {
  display: block;

  margin:
    auto 18px
    18px;

  padding-top: 4px;

  color: var(--accent-dark);

  font-size: 0.88rem;
  font-weight: 800;
}


/* =========================================================
   LOADING
   ========================================================= */

.recipe-products__grid
.loading-message {
  grid-column: 1 / -1;

  margin: 0;

  color: var(--muted);
}


/* =========================================================
   PRODUCT PROMO CODE
   ========================================================= */

.calculator-product-card__promo {
  margin: 0 18px 18px;
  padding: 12px 14px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--surface-alt);

  font-size: 0.86rem;
  line-height: 1.4;
}

.calculator-product-card__promo strong {
  display: block;
  margin-bottom: 3px;

  color: var(--accent-dark);
  font-weight: 800;
}

.calculator-product-card__promo span {
  display: block;
  color: var(--muted);
}

.calculator-product-card__promo b {
  color: var(--text);
  font-weight: 800;
}


/* =========================================================
   PRODUCT RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

  .recipe-products__grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


@media (max-width: 560px) {

  .recipe-products {
    margin-top: 30px;
    padding-top: 26px;
  }

  .recipe-products__grid {
    grid-template-columns: 1fr;
  }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 820px) {

  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

  .recipe-guide {
    margin-top: 24px;
  }

}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

  .calculator-preset-notice {
    margin-bottom: 24px;
  }

}

@media (max-width: 520px) {

  .calculator-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 28px;
  }

  .calculator-panel,
  .results-panel,
  .recipe-guide {
    border-radius: 14px;
  }

  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .recipe-guide {
    padding: 22px 18px;
  }

  .recipe-guide__header {
    margin-bottom: 18px;
    padding-bottom: 18px;
  }

  .recipe-instructions li {
    min-height: 52px;

    padding:
      14px 8px
      14px 58px;

    font-size: 0.95rem;
  }

  .recipe-instructions li::before {
    left: 4px;
    top: 12px;

    width: 34px;
    height: 34px;

    font-size: 0.82rem;
  }

  .recipe-video {
    margin-top: 28px;
    padding-top: 24px;
  }

  .recipe-video__embed {
    border-radius: 10px;
  }

}









