:root {
  --tsp-navy: #0b1f3a;
  --tsp-blue: #2563eb;
  --tsp-blue-dark: #1d4ed8;
  --tsp-green: #16a34a;
  --tsp-ink: #172033;
  --tsp-muted: #5d687b;
  --tsp-line: #dbe3ee;
  --tsp-surface: #f7f9fc;
  --tsp-white: #ffffff;
  --tsp-shadow: 0 20px 60px rgba(11, 31, 58, 0.12);
}

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

.tsp-calculator {
  color: var(--tsp-ink);
  font-family: "Aptos", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 1240px;
  padding: 40px 24px 64px;
}

.tsp-calculator h1,
.tsp-calculator h2,
.tsp-calculator p {
  margin-top: 0;
}

.tsp-calculator h1 {
  color: var(--tsp-navy);
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
  margin-bottom: 24px;
  max-width: 900px;
}

.tsp-calculator h2 {
  color: var(--tsp-navy);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.tsp-calculator__hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding: clamp(44px, 9vw, 104px) 20px 48px;
  text-align: center;
}

.tsp-calculator__eyebrow,
.tsp-calculator__section-label {
  color: var(--tsp-blue);
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.tsp-calculator__eyebrow {
  background: #eaf2ff;
  border: 1px solid #cbdcff;
  border-radius: 999px;
  padding: 7px 12px;
}

.tsp-calculator__lede {
  color: var(--tsp-muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  margin-bottom: 28px;
  max-width: 760px;
}

.tsp-calculator__hero-actions,
.tsp-calculator__result-actions,
.tsp-calculator__solution-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.tsp-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 750;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  text-align: center;
  text-decoration: none !important;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.tsp-button:focus-visible,
.tsp-calculator button:focus-visible,
.tsp-calculator input:focus-visible,
.tsp-calculator summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.tsp-button--primary {
  background: var(--tsp-blue);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
  color: var(--tsp-white) !important;
}

.tsp-button--primary:hover {
  background: var(--tsp-blue-dark);
}

.tsp-button--secondary {
  background: var(--tsp-white);
  border-color: var(--tsp-line);
  color: var(--tsp-navy) !important;
}

.tsp-button--light {
  background: var(--tsp-white);
  color: var(--tsp-navy);
}

.tsp-button--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.34);
  color: var(--tsp-white);
}

.tsp-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.tsp-calculator__trust-list {
  display: grid;
  gap: 10px 24px;
  grid-template-columns: repeat(4, auto);
  list-style: none;
  margin: 42px 0 0;
  padding: 18px 0 0;
  width: 100%;
}

.tsp-calculator__trust-list li {
  color: var(--tsp-muted);
  font-size: 0.9rem;
  position: relative;
}

.tsp-calculator__trust-list li::before {
  color: var(--tsp-green);
  content: "✓";
  font-weight: 900;
  margin-right: 7px;
}

.tsp-calculator__quick-start {
  align-items: center;
  background: var(--tsp-surface);
  border: 1px solid var(--tsp-line);
  border-radius: 18px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(240px, 0.9fr) minmax(300px, 1.6fr);
  margin: 0 0 28px;
  padding: 24px;
}

.tsp-calculator__quick-start p {
  color: var(--tsp-muted);
  margin-bottom: 0;
}

.tsp-calculator__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.tsp-calculator__presets button,
.tsp-calculator__text-button {
  background: var(--tsp-white);
  border: 1px solid var(--tsp-line);
  border-radius: 999px;
  color: var(--tsp-navy);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 9px 14px;
}

.tsp-calculator__presets button:hover,
.tsp-calculator__presets button.is-active {
  background: #eaf2ff;
  border-color: #9dbbff;
  color: var(--tsp-blue-dark);
}

.tsp-calculator__workspace {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  scroll-margin-top: 120px;
}

.tsp-calculator__inputs,
.tsp-calculator__results,
.tsp-calculator__email-panel {
  border: 1px solid var(--tsp-line);
  border-radius: 22px;
  padding: clamp(22px, 4vw, 36px);
}

.tsp-calculator__inputs {
  background: var(--tsp-white);
}

.tsp-calculator__panel-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tsp-field {
  border-top: 1px solid var(--tsp-line);
  display: grid;
  gap: 7px;
  padding: 18px 0;
}

.tsp-field__label,
.tsp-calculator__form-grid label > span {
  color: var(--tsp-navy);
  font-weight: 800;
}

.tsp-field__help {
  color: var(--tsp-muted);
  font-size: 0.88rem;
}

.tsp-field input,
.tsp-calculator__form-grid input {
  background: var(--tsp-white);
  border: 1px solid #b9c6d8;
  border-radius: 10px;
  color: var(--tsp-ink);
  font: inherit;
  font-size: 1rem;
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

.tsp-field__with-prefix,
.tsp-field__with-suffix {
  align-items: center;
  background: var(--tsp-surface);
  border: 1px solid #b9c6d8;
  border-radius: 10px;
  display: grid;
  font-weight: 800;
  overflow: hidden;
}

.tsp-field__with-prefix {
  grid-template-columns: 44px 1fr;
}

.tsp-field__with-suffix {
  grid-template-columns: 1fr 44px;
}

.tsp-field__with-prefix > span,
.tsp-field__with-suffix > span {
  text-align: center;
}

.tsp-field__with-prefix input,
.tsp-field__with-suffix input {
  border: 0;
  border-radius: 0;
}

.tsp-calculator__results {
  background: linear-gradient(150deg, var(--tsp-navy), #102e55);
  box-shadow: var(--tsp-shadow);
  color: var(--tsp-white);
  overflow: hidden;
  position: relative;
}

.tsp-calculator__results::after {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.52), rgba(37, 99, 235, 0));
  content: "";
  height: 360px;
  pointer-events: none;
  position: absolute;
  right: -170px;
  top: -180px;
  width: 360px;
}

.tsp-calculator__results .tsp-calculator__section-label {
  color: #9ec0ff;
}

.tsp-calculator__result-label,
.tsp-calculator__result-note {
  color: #cbd8ea;
  margin-bottom: 8px;
}

.tsp-calculator__headline-result {
  font-size: clamp(2.65rem, 6vw, 4.7rem);
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 1;
  margin-bottom: 12px;
}

.tsp-calculator__result-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 28px 0;
}

.tsp-calculator__result-grid div {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 15px;
}

.tsp-calculator__result-grid dt {
  color: #cbd8ea;
  font-size: 0.82rem;
}

.tsp-calculator__result-grid dd {
  font-size: 1.45rem;
  font-weight: 850;
  margin: 5px 0 0;
}

.tsp-calculator__math {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 24px;
  padding-top: 20px;
}

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

.tsp-calculator__math div {
  color: #cbd8ea;
  font-size: 0.9rem;
  padding-top: 12px;
}

.tsp-calculator__email-panel {
  align-items: start;
  background: #eef5ff;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.3fr);
  margin-top: 28px;
  scroll-margin-top: 120px;
}

.tsp-calculator__email-panel[hidden] {
  display: none;
}

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

.tsp-calculator__form-grid label {
  display: grid;
  gap: 6px;
}

.tsp-calculator__form-grid small {
  color: var(--tsp-muted);
  font-weight: 500;
}

.tsp-calculator__consent {
  align-items: start;
  display: grid;
  font-size: 0.88rem;
  gap: 9px;
  grid-template-columns: 20px 1fr;
  margin: 16px 0;
}

.tsp-calculator__consent input {
  margin-top: 4px;
}

.tsp-calculator__honeypot {
  left: -10000px;
  position: absolute;
  top: auto;
}

.tsp-calculator__form-status {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 12px 0 0;
}

.tsp-calculator__form-status.is-success {
  color: #166534;
}

.tsp-calculator__form-status.is-error {
  color: #b91c1c;
}

.tsp-calculator__solution {
  align-items: center;
  background: var(--tsp-surface);
  border: 1px solid var(--tsp-line);
  border-radius: 22px;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-top: 28px;
  padding: clamp(28px, 5vw, 48px);
}

.tsp-calculator__solution p {
  color: var(--tsp-muted);
  margin-bottom: 0;
}

.tsp-calculator__solution-actions {
  align-items: stretch;
  flex-direction: column;
}

.tsp-calculator__inline-link {
  color: var(--tsp-blue-dark);
  font-weight: 750;
  padding-top: 4px;
  text-align: center;
}

.tsp-calculator__disclaimer {
  color: var(--tsp-muted);
  font-size: 0.8rem;
  margin: 24px auto 0;
  max-width: 900px;
  text-align: center;
}

.tsp-calculator__powered-by {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd8ea;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  margin: 18px 0 0;
  padding-top: 16px;
  text-align: center;
}

.tsp-calculator__powered-by a {
  color: #9ec0ff;
  font-weight: 800;
  text-decoration: none;
}

.tsp-calculator__powered-by a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .tsp-calculator__trust-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .tsp-calculator__quick-start,
  .tsp-calculator__workspace,
  .tsp-calculator__email-panel,
  .tsp-calculator__solution {
    grid-template-columns: 1fr;
  }

  .tsp-calculator__presets {
    justify-content: flex-start;
  }

  .tsp-calculator__email-panel {
    scroll-margin-top: 80px;
  }
}

@media (max-width: 600px) {
  .tsp-calculator {
    padding: 24px 14px 48px;
  }

  .tsp-calculator__hero {
    padding: 42px 4px 36px;
  }

  .tsp-calculator__hero-actions,
  .tsp-calculator__result-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .tsp-button {
    width: 100%;
  }

  .tsp-calculator__trust-list,
  .tsp-calculator__result-grid,
  .tsp-calculator__form-grid {
    grid-template-columns: 1fr;
  }

  .tsp-calculator__quick-start,
  .tsp-calculator__inputs,
  .tsp-calculator__results,
  .tsp-calculator__email-panel,
  .tsp-calculator__solution {
    border-radius: 16px;
    padding: 20px;
  }
}

@media print {
  .tsp-calculator__hero-actions,
  .tsp-calculator__quick-start,
  .tsp-calculator__inputs,
  .tsp-calculator__result-actions,
  .tsp-calculator__email-panel,
  .tsp-calculator__solution,
  .tsp-calculator__disclaimer,
  .tsp-calculator__powered-by {
    display: none !important;
  }

  .tsp-calculator,
  .tsp-calculator__workspace {
    display: block;
    max-width: none;
    padding: 0;
  }

  .tsp-calculator__results {
    background: #ffffff;
    border: 2px solid #0b1f3a;
    box-shadow: none;
    color: #0b1f3a;
    margin-top: 20px;
  }

  .tsp-calculator__results .tsp-calculator__section-label,
  .tsp-calculator__result-label,
  .tsp-calculator__result-note,
  .tsp-calculator__result-grid dt,
  .tsp-calculator__math div {
    color: #334155;
  }

  .tsp-calculator__result-grid div {
    border-color: #cbd5e1;
  }
}
