:root {
  color-scheme: light;
  --ink: #18342d;
  --ink-soft: #5b6f68;
  --forest: #0f4c3a;
  --forest-deep: #0a382b;
  --lime: #cbed66;
  --mint: #e4f4dc;
  --cream: #f6f4eb;
  --paper: #fffef9;
  --line: #dce3d9;
  --danger: #b6342b;
  --shadow: 0 28px 70px rgba(33, 65, 54, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 6%, rgba(203, 237, 102, 0.34), transparent 23rem),
    radial-gradient(circle at 94% 70%, rgba(96, 169, 132, 0.2), transparent 28rem),
    var(--cream);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
  max-width: 830px;
  margin-bottom: 36px;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 17px;
  color: var(--lime);
  background: var(--forest);
  box-shadow: 0 10px 28px rgba(15, 76, 58, 0.22);
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  transform: rotate(-4deg);
}

.eyebrow {
  margin: 3px 0 11px;
  color: var(--forest);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}

.calculator-card {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(340px, 0.86fr);
  overflow: hidden;
  border: 1px solid rgba(15, 76, 58, 0.08);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 42px;
}

.panel-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 34px;
}

.panel-heading h2,
.result-prompt h2 {
  margin-bottom: 4px;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.panel-heading p,
.result-prompt p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.step-badge {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest);
  background: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field-group {
  min-width: 0;
  margin: 0 0 21px;
  padding: 0;
  border: 0;
}

.field-group > label,
.field-group legend,
.label-row label {
  display: block;
  margin-bottom: 9px;
  padding: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.input-shell {
  display: flex;
  min-height: 54px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(15, 76, 58, 0.12);
  transform: translateY(-1px);
}

.input-shell input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.05rem;
  font-weight: 650;
}

.input-shell input::placeholder {
  color: #a4afa9;
  font-weight: 450;
}

.input-affix {
  padding-left: 17px;
  color: var(--forest);
  font-weight: 850;
}

.input-affix--suffix {
  padding: 0 17px 0 8px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  white-space: nowrap;
}

.field-error {
  min-height: 1.15em;
  margin: 6px 2px 0;
  color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.3;
}

.unit-fieldset {
  margin-top: 2px;
}

.unit-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #f1f3ed;
}

.unit-toggle label {
  position: relative;
  cursor: pointer;
}

.unit-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.unit-toggle span {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  color: var(--ink-soft);
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.unit-toggle small {
  font-size: 0.74rem;
  text-transform: uppercase;
}

.unit-toggle input:checked + span {
  color: var(--forest);
  background: #fff;
  box-shadow: 0 5px 15px rgba(33, 65, 54, 0.09);
}

.unit-toggle input:focus-visible + span {
  outline: 3px solid rgba(15, 76, 58, 0.32);
  outline-offset: 2px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.default-note {
  margin-bottom: 9px;
  color: var(--forest);
  font-size: 0.76rem;
  font-weight: 700;
}

.reset-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 5px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
}

.reset-button:hover {
  color: var(--forest);
}

.reset-button:focus-visible {
  outline: 3px solid rgba(15, 76, 58, 0.28);
  outline-offset: 3px;
}

.result-panel {
  position: relative;
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 44px;
  color: #f7fbf5;
  background:
    radial-gradient(circle at 82% 16%, rgba(203, 237, 102, 0.22), transparent 13rem),
    linear-gradient(145deg, var(--forest), var(--forest-deep));
}

.result-decoration {
  position: absolute;
  top: 26px;
  right: 28px;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: var(--lime);
  font-size: 0.85rem;
  font-weight: 850;
  transform: rotate(9deg);
}

.result-prompt {
  position: relative;
  z-index: 1;
  max-width: 290px;
}

.result-prompt h2 {
  color: #fff;
  font-size: 1.65rem;
  line-height: 1.22;
}

.result-prompt p,
.cost-caption {
  color: rgba(255, 255, 255, 0.68);
}

.prompt-symbol {
  display: block;
  margin-bottom: 18px;
  color: var(--lime);
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 0.8;
}

.results {
  position: relative;
  z-index: 1;
}

.result-kicker {
  margin-bottom: 7px;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.cost-value {
  display: block;
  margin-left: -0.05em;
  color: #fff;
  font-size: clamp(3.7rem, 8vw, 5.8rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.07em;
}

.cost-caption {
  margin: 12px 0 36px;
  font-size: 0.88rem;
}

.result-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.result-details div {
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.result-details dt {
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.74rem;
}

.result-details dd {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 760;
}

.privacy-note {
  position: absolute;
  right: 44px;
  bottom: 30px;
  left: 44px;
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
}

.privacy-note span {
  margin-right: 6px;
  color: var(--lime);
  font-size: 0.54rem;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 8px 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.page-footer p {
  margin-bottom: 0;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(680px, calc(100% - 28px));
    padding-top: 44px;
  }

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

  .result-panel {
    min-height: 410px;
  }
}

@media (max-width: 540px) {
  .page-shell {
    width: min(100% - 20px, 460px);
    padding: 28px 0 24px;
  }

  .hero {
    grid-template-columns: 42px 1fr;
    gap: 13px;
    margin-bottom: 24px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 1.18rem;
  }

  .eyebrow {
    margin-top: 1px;
    font-size: 0.63rem;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .hero-copy {
    grid-column: 1 / -1;
    font-size: 0.95rem;
  }

  .calculator-card {
    border-radius: 22px;
  }

  .input-panel,
  .result-panel {
    padding: 28px 22px;
  }

  .panel-heading {
    margin-bottom: 27px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .result-panel {
    min-height: 390px;
  }

  .result-decoration {
    top: 22px;
    right: 22px;
    width: 62px;
    height: 62px;
  }

  .cost-value {
    font-size: clamp(3.6rem, 20vw, 5rem);
  }

  .result-details {
    grid-template-columns: 1fr;
  }

  .privacy-note {
    right: 22px;
    bottom: 22px;
    left: 22px;
  }

  .page-footer {
    display: block;
    padding-top: 18px;
    line-height: 1.65;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
