.tdb-calculator,
.tdb-calculator * {
  box-sizing: border-box;
}

.tdb-calculator {
  --tdb-red: #df0000;
  --tdb-red-dark: #b90000;
  --tdb-ink: #141414;
  --tdb-muted: #6f6f6f;
  --tdb-line: #e8e8e8;
  --tdb-soft: #fafafa;
  --tdb-soft-red: #fff2f2;
  --tdb-radius: 18px;
  --tdb-shadow: 0 18px 60px rgba(0, 0, 0, 0.08);
  color: var(--tdb-ink);
  font-family: inherit;
  max-width: 980px;
  margin: 24px auto;
}

.tdb-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: var(--tdb-radius);
  box-shadow: var(--tdb-shadow);
  overflow: hidden;
}

.tdb-card__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 28px;
  padding: 36px;
  min-height: 470px;
}

.tdb-main {
  min-width: 0;
}

.tdb-headline-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.tdb-step-badge {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--tdb-red);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}

.tdb-kicker {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--tdb-red);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.tdb-title {
  margin: 0 0 6px;
  color: var(--tdb-ink);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  font-weight: 850;
}

.tdb-subtitle,
.tdb-step p,
.tdb-email-box p,
.tdb-note,
.tdb-disclaimer {
  color: var(--tdb-muted);
  font-size: 15px;
  line-height: 1.45;
}

.tdb-subtitle {
  margin: 0;
}

.tdb-progress {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin: 0 0 28px;
}

.tdb-progress span {
  height: 4px;
  border-radius: 999px;
  background: #dedede;
  transition: background 0.2s ease;
}

.tdb-progress span.is-active {
  background: var(--tdb-red);
}

.tdb-form {
  position: relative;
}

.tdb-step {
  display: none;
  min-height: 220px;
  animation: tdbFade 0.22s ease;
}

.tdb-step.is-active {
  display: block;
}

@keyframes tdbFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tdb-step h3,
.tdb-email-box h3,
.tdb-section-title {
  margin: 0 0 8px;
  color: var(--tdb-ink);
  font-size: clamp(24px, 3.1vw, 34px);
  line-height: 1.12;
  font-weight: 850;
}

.tdb-step p {
  margin: 0 0 20px;
}

.tdb-field {
  display: flex;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.tdb-field:focus-within {
  border-color: var(--tdb-red);
  box-shadow: 0 0 0 4px rgba(223, 0, 0, 0.08);
}

.tdb-field input {
  width: 100%;
  border: 0 !important;
  outline: 0;
  box-shadow: none !important;
  min-height: 56px;
  padding: 0 16px;
  font-size: 16px;
  background: transparent;
  color: var(--tdb-ink);
}

.tdb-field--with-unit {
  align-items: center;
  max-width: 260px;
}

.tdb-field--with-unit span:not(.tdb-sr-only) {
  padding-right: 16px;
  color: var(--tdb-muted);
  font-weight: 700;
}

.tdb-field--number {
  max-width: 150px;
}

.tdb-inline-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.tdb-segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid #dedede;
  border-radius: 12px;
  background: var(--tdb-soft);
  gap: 4px;
}

.tdb-segmented label {
  display: inline-flex;
  cursor: pointer;
}

.tdb-segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tdb-segmented span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 84px;
  padding: 0 16px;
  border-radius: 9px;
  color: var(--tdb-muted);
  font-weight: 800;
  transition: background 0.2s ease, color 0.2s ease;
}

.tdb-segmented input:checked + span {
  background: #fff;
  color: var(--tdb-red);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.tdb-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tdb-choice-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
}

.tdb-choice-card {
  position: relative;
  display: flex;
  min-height: 130px;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  padding: 18px;
  border: 1px solid #e2e2e2;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.tdb-choice-card:hover {
  border-color: #f0b7b7;
  transform: translateY(-1px);
}

.tdb-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tdb-choice-card:has(input:checked),
.tdb-choice-card.is-selected {
  border-color: var(--tdb-red);
  background: var(--tdb-soft-red);
  box-shadow: 0 12px 28px rgba(223, 0, 0, 0.09);
}

.tdb-choice-card strong {
  color: var(--tdb-ink);
  font-size: 17px;
  line-height: 1.2;
}

.tdb-choice-card small {
  color: var(--tdb-muted);
  font-size: 13px;
  line-height: 1.35;
}

.tdb-choice-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--tdb-soft);
  color: var(--tdb-red);
  font-size: 24px;
  font-weight: 850;
}

.tdb-allergy-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tdb-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 750;
  color: var(--tdb-ink);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tdb-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tdb-chip:has(input:checked),
.tdb-chip.is-selected {
  border-color: var(--tdb-red);
  background: var(--tdb-soft-red);
  box-shadow: 0 8px 20px rgba(223, 0, 0, 0.08);
}

.tdb-error {
  min-height: 24px;
  margin-top: 14px;
  color: var(--tdb-red);
  font-weight: 800;
  font-size: 14px;
}

.tdb-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.tdb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 10px;
  padding: 0 24px;
  border: 1px solid transparent;
  font-weight: 850;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tdb-button:hover {
  transform: translateY(-1px);
}

.tdb-button--primary {
  background: var(--tdb-red);
  color: #fff !important;
  border-color: var(--tdb-red);
}

.tdb-button--primary:hover {
  background: var(--tdb-red-dark);
  border-color: var(--tdb-red-dark);
}

.tdb-button--primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tdb-button--ghost {
  background: #fff;
  color: var(--tdb-ink) !important;
  border-color: #dddddd;
}

.tdb-button--ghost:hover {
  border-color: var(--tdb-red);
  color: var(--tdb-red) !important;
}

.tdb-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.tdb-pet-stage {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tdb-pet-blob {
  position: absolute;
  inset: 8%;
  border-radius: 46% 54% 52% 48%;
  background: linear-gradient(140deg, #fff7f7 0%, #fff 70%);
  border: 1px solid #fff1f1;
}

.tdb-pet-icons {
  position: relative;
  display: flex;
  align-items: end;
  gap: 8px;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.08));
}

.tdb-pet-icons span:first-child {
  font-size: clamp(96px, 13vw, 148px);
}

.tdb-pet-icons span:last-child {
  font-size: clamp(70px, 9vw, 104px);
}

.tdb-heart {
  position: absolute;
  color: var(--tdb-red);
  font-size: 34px;
  line-height: 1;
}

.tdb-heart--one {
  right: 0;
  top: 22%;
}

.tdb-heart--two {
  left: 5%;
  bottom: 28%;
}

.tdb-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 20px 36px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  color: var(--tdb-ink);
  font-size: 14px;
  font-weight: 650;
}

.tdb-benefits div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tdb-benefits span {
  color: var(--tdb-red);
  font-size: 24px;
  line-height: 1;
}

.tdb-result h3 {
  font-size: clamp(25px, 3.4vw, 34px);
}

.tdb-result-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.tdb-result-numbers div {
  padding: 18px;
  border-radius: 16px;
  background: var(--tdb-soft-red);
  border: 1px solid #ffdada;
}

.tdb-result-numbers strong {
  display: block;
  color: var(--tdb-red);
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.05;
}

.tdb-result-numbers span {
  color: var(--tdb-muted);
  font-weight: 750;
}

.tdb-tips {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--tdb-muted);
}

.tdb-tips li + li {
  margin-top: 6px;
}

.tdb-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}

.tdb-summary-row span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--tdb-soft);
  color: var(--tdb-muted);
  font-weight: 750;
  font-size: 13px;
}

.tdb-section-title {
  margin-top: 22px;
  font-size: 22px;
}

.tdb-recipes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tdb-recipe-card {
  padding: 16px;
  border: 1px solid #e7e7e7;
  border-radius: 16px;
  background: #fff;
}

.tdb-recipe-card h4 {
  margin: 8px 0 8px;
  font-size: 18px;
  line-height: 1.2;
  color: var(--tdb-ink);
}

.tdb-recipe-card p {
  margin: 0 0 12px;
  color: var(--tdb-muted);
  font-size: 13px;
  line-height: 1.4;
}

.tdb-recipe-tag {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--tdb-soft-red);
  color: var(--tdb-red);
  font-size: 11px;
  font-weight: 850;
}

.tdb-recipe-link {
  font-size: 13px;
  font-weight: 850;
  color: var(--tdb-red) !important;
  text-decoration: none !important;
}

.tdb-recipe-link.is-disabled {
  color: var(--tdb-muted) !important;
}

.tdb-empty-recipes,
.tdb-email-box {
  border-radius: 16px;
  border: 1px solid #e8e8e8;
  background: var(--tdb-soft);
  padding: 18px;
}

.tdb-buy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 16px;
}

.tdb-disclaimer {
  padding: 14px 16px;
  border-left: 4px solid var(--tdb-red);
  background: var(--tdb-soft);
  border-radius: 10px;
}

.tdb-email-box {
  margin-top: 24px;
  background: #fff;
}

.tdb-email-box h3 {
  font-size: 24px;
}

.tdb-guides {
  margin: 14px 0;
  padding: 0;
  border: 0;
}

.tdb-guides legend {
  margin-bottom: 8px;
  font-weight: 850;
}

.tdb-guides label,
.tdb-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0;
  color: var(--tdb-ink);
  font-size: 14px;
  line-height: 1.35;
}

.tdb-guides input,
.tdb-consent input {
  margin-top: 2px;
  accent-color: var(--tdb-red);
}

.tdb-privacy {
  margin: 8px 0 14px;
  font-size: 13px !important;
}

.tdb-submit-message {
  margin-top: 12px;
  min-height: 22px;
  font-weight: 800;
}

.tdb-submit-message.is-success {
  color: #138000;
}

.tdb-submit-message.is-error {
  color: var(--tdb-red);
}

.tdb-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@supports not selector(:has(*)) {
  .tdb-choice-card input:checked ~ strong,
  .tdb-choice-card input:checked ~ small {
    color: var(--tdb-red);
  }
}

@media (max-width: 820px) {
  .tdb-card__inner {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .tdb-visual {
    order: -1;
    min-height: 180px;
  }

  .tdb-pet-stage {
    max-width: 260px;
  }

  .tdb-choice-grid,
  .tdb-choice-grid--two,
  .tdb-recipes-grid,
  .tdb-result-numbers,
  .tdb-benefits {
    grid-template-columns: 1fr;
  }

  .tdb-choice-card {
    min-height: 104px;
  }

  .tdb-benefits {
    padding: 18px 24px;
    gap: 12px;
  }
}

@media (max-width: 520px) {
  .tdb-calculator {
    margin: 12px 0;
  }

  .tdb-card {
    border-radius: 14px;
  }

  .tdb-card__inner {
    padding: 20px 16px;
    gap: 16px;
  }

  .tdb-headline-row {
    gap: 12px;
  }

  .tdb-step-badge {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 16px;
  }

  .tdb-progress {
    gap: 5px;
    margin-bottom: 22px;
  }

  .tdb-actions,
  .tdb-buy-actions {
    flex-direction: column;
  }

  .tdb-button {
    width: 100%;
  }

  .tdb-inline-inputs {
    align-items: stretch;
  }

  .tdb-field--number,
  .tdb-field--with-unit {
    max-width: none;
  }

  .tdb-segmented {
    width: 100%;
  }

  .tdb-segmented label {
    flex: 1;
  }

  .tdb-segmented span {
    width: 100%;
    min-width: 0;
  }
}
