body {
  background:
    linear-gradient(135deg, rgb(217 95 67 / 12%), transparent 34%),
    var(--jph-bg);
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 520px);
  align-items: center;
  gap: 48px;
  min-height: 100vh;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 max(56px, env(safe-area-inset-bottom));
}

.intro {
  max-width: 620px;
}

.kicker {
  margin: 0 0 14px;
  color: var(--jph-coral);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.tool {
  display: grid;
  gap: 24px;
  min-width: 0;
  border: 1px solid var(--jph-border);
  border-radius: var(--jph-radius);
  background: var(--jph-panel);
  box-shadow: var(--jph-shadow);
  padding: clamp(22px, 4vw, 36px);
}

.field {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: var(--jph-muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.field strong,
.field legend {
  color: var(--jph-ink);
}

.field legend {
  margin: 0 0 10px;
  padding: 0;
}

input[type="date"],
input[type="number"],
select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 58px;
  appearance: none;
  border: 1px solid var(--jph-border);
  border-radius: var(--jph-radius);
  background: white;
  color: var(--jph-ink);
  padding: 0 14px;
  font-size: 16px;
  font-weight: 800;
  line-height: 58px;
}

input[type="date"] {
  text-align: center;
}

input[type="date"]::-webkit-date-and-time-value {
  min-height: 58px;
  line-height: 58px;
  text-align: center;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--jph-muted) 50%),
    linear-gradient(135deg, var(--jph-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px;
  padding-right: 34px;
}

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

.cutoff-field {
  border: 0;
  margin: 0;
  padding: 0;
}

.cutoff-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 0.35fr);
  gap: 12px;
}

.cutoff-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.cutoff-grid span {
  font-size: 0.85rem;
}

.result {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--jph-border);
  padding-top: 22px;
}

.result b {
  display: block;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.05;
}

.result span {
  color: var(--jph-muted);
  line-height: 1.45;
}

@media (max-width: 820px) {
  .calculator-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    width: min(100% - 28px, 1120px);
    padding: 36px 0 max(96px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: clamp(2.35rem, 12vw, 4rem);
  }

  .tool {
    padding: 22px 18px;
  }

  .result b {
    font-size: clamp(1.75rem, 8vw, 2.4rem);
  }
}
