/* Finalna warstwa UX dla kalkulatora doboru: mniej technicznie, więcej oddechu i zero nachodzenia. */

.dishwasher-calculator {
  border-width: 5px;
  box-shadow: 9px 9px 0 #111;
}

.dwcalc-head {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
  padding: clamp(26px, 4vw, 42px);
  border-bottom-width: 5px;
}

.dwcalc-head h2 {
  max-width: 760px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: .94;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.dwcalc-head p:last-child {
  max-width: 720px;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.45;
}

/* Presety są skrótem, nie drugim hero. */
.dwpreset {
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border-width: 3px;
  background: #fff5e9;
  box-shadow: none;
}

.dwpreset-head h3 {
  max-width: 760px;
  margin-top: 3px;
  font-family: var(--text);
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 950;
  line-height: 1.08;
  text-wrap: balance;
}

.dwpreset-head p {
  font-size: 12px;
}

.dwpreset-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dwpreset-chip {
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border-width: 2px;
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

/* Fieldsety przestają używać legendy jako elementu leżącego na ramce. */
fieldset.dwcalc-card {
  min-inline-size: 0;
}

fieldset.dwcalc-card > legend {
  float: left;
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 0;
  line-height: 1.18;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

fieldset.dwcalc-card > legend + .dwcalc-help {
  clear: both;
}

.dwcalc-grid {
  gap: 14px;
}

.dwcalc-card {
  min-width: 0;
  padding: 20px;
  border-width: 4px;
  overflow: hidden;
}

.dwcalc-label,
.dwcalc-card legend {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.18;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.dwcalc-help {
  max-width: 58ch;
  margin-bottom: 15px;
  font-size: 12px;
  line-height: 1.4;
}

.dwcalc-option {
  min-width: 0;
  min-height: 54px;
  padding: 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dwcalc-submit {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  border-width: 4px;
}

.dwcalc-submit p {
  max-width: 620px;
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 1050px) {
  .dwpreset-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dwcalc-grid {
    grid-template-columns: 1fr;
  }

  .dwcalc-options--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .dishwasher-calculator {
    width: calc(100% - 16px);
    box-shadow: 6px 6px 0 #111;
  }

  .dwcalc-head {
    padding: 22px 16px;
  }

  .dwcalc-head h2 {
    font-size: clamp(38px, 12vw, 58px);
  }

  .dwpreset {
    padding: 14px;
  }

  .dwpreset-chips,
  .dwcalc-options--three {
    grid-template-columns: 1fr;
  }

  .dwcalc-card {
    padding: 16px;
  }

  .dwcalc-submit {
    grid-template-columns: 1fr;
  }
}
