:root {
  color-scheme: light;
  --green-950: #0b3d2a;
  --green-800: #125b3d;
  --green-700: #16734a;
  --green-600: #188557;
  --green-100: #dff3e8;
  --green-50: #f0faf4;
  --aqua-100: #dff5f3;
  --ink: #15261f;
  --muted: #5d6f67;
  --line: #dbe7e0;
  --surface: #ffffff;
  --canvas: #f7faf8;
  --shadow: 0 18px 50px rgba(17, 67, 46, 0.09);
  --radius-lg: 24px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 95% 2%, rgba(112, 206, 164, 0.16), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

input, select {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid #bfd0c6;
  border-radius: 14px;
  background: white;
  color: var(--ink);
}

input { padding: 0.75rem 3rem 0.75rem 0.9rem; }
select { padding: 0.75rem 2.5rem 0.75rem 0.9rem; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--green-950);
  color: white;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--green-950);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  background: var(--green-700);
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(22, 115, 74, 0.22);
}

.header-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-shell {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 7rem;
}

.view { animation: reveal 220ms ease-out both; }
.view[hidden] { display: none; }

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

.hero { max-width: 47rem; padding: 2rem 0 2.25rem; }

.eyebrow, .card-kicker {
  margin: 0 0 0.6rem;
  color: var(--green-700);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.35rem, 10vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 36rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 3vw, 1.35rem);
}

.choice-grid, .tool-grid { display: grid; gap: 1rem; }

.feature-card {
  position: relative;
  overflow: hidden;
  min-height: 20rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-card::after {
  position: absolute;
  right: -3.5rem;
  bottom: -4.5rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: var(--aqua-100);
  content: "";
}

.feature-card--garden::after { background: #eaf2dc; }

.feature-icon {
  display: grid;
  width: 3.75rem;
  height: 3.75rem;
  margin-bottom: 2rem;
  place-items: center;
  border-radius: 18px;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 2rem;
  font-weight: 800;
}

.feature-card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.feature-card p:not(.card-kicker) { max-width: 29rem; color: var(--muted); }

.primary-button, .secondary-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  min-height: 3.5rem;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 15px;
  font-weight: 800;
}

.primary-button { background: var(--green-700); color: white; cursor: pointer; }
.primary-button:hover { background: var(--green-800); }
.primary-button:active { transform: translateY(1px); }
.secondary-button { background: #edf2ef; color: #74827b; }

.back-button {
  min-height: 2.75rem;
  margin-bottom: 2rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--green-800);
  font-weight: 750;
  cursor: pointer;
}

.section-heading { max-width: 42rem; margin-bottom: 2rem; }
.section-heading h1 { font-size: clamp(2.2rem, 8vw, 4rem); }
.section-heading > p:last-child { color: var(--muted); }

.tool-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  min-height: 8rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 30px rgba(17, 67, 46, 0.06);
  cursor: pointer;
}

.tool-card:hover { border-color: #9ac6ae; transform: translateY(-1px); }
.tool-number { color: var(--green-600); font-size: 0.75rem; font-weight: 850; }
.tool-copy { display: grid; gap: 0.25rem; }
.tool-copy strong { font-size: 1.05rem; }
.tool-copy small { color: var(--muted); line-height: 1.35; }
.tool-arrow { color: var(--green-700); font-size: 1.35rem; }

.calculator-layout { display: grid; gap: 1rem; align-items: start; }

.form-card, .result-card, .guidance-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-card h2 { margin-bottom: 0; font-size: 1.35rem; letter-spacing: -0.025em; }
.step-label { margin: 0 0 0.2rem; color: var(--green-700); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }

.unit-field {
  display: grid;
  gap: 0.25rem;
  width: 5.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.unit-field select { min-height: 2.8rem; padding: 0.5rem 0.65rem; }

.dimension-grid { display: grid; gap: 1rem; }
.dimension-grid label, .manual-volume-field, .select-product-field { display: grid; gap: 0.45rem; color: var(--ink); font-size: 0.9rem; font-weight: 750; }

.input-with-suffix { position: relative; display: block; }
.input-with-suffix > span {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
  pointer-events: none;
}

.setup-fieldset, .source-fieldset {
  display: grid;
  gap: 0.65rem;
  margin: 1.75rem 0;
  padding: 0;
  border: 0;
}

.setup-fieldset legend, .source-fieldset legend {
  margin-bottom: 0.65rem;
  padding: 0;
  font-size: 1rem;
  font-weight: 800;
}

.setup-fieldset legend .step-label, .source-fieldset legend .step-label { display: block; }

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.7rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
}

.radio-card:has(input:checked) { border-color: var(--green-600); background: var(--green-50); }
.radio-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.radio-card > span:nth-child(2) { display: grid; gap: 0.1rem; }
.radio-card small { color: var(--muted); font-size: 0.78rem; }

.radio-dot {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  border: 2px solid #9eb4a8;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px white;
}

.radio-card:has(input:checked) .radio-dot { border-color: var(--green-700); background: var(--green-700); }

.form-error {
  margin: 0 0 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: #fff0ed;
  color: #9b342b;
  font-size: 0.88rem;
  font-weight: 700;
}

.result-card { overflow: hidden; min-height: 17rem; }
.result-card--empty { display: grid; align-content: center; text-align: center; background: linear-gradient(145deg, var(--green-50), #eef8f8); }
.result-label { margin: 0 0 0.45rem; color: var(--green-700); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }
.result-placeholder { max-width: 20rem; margin: 0 auto; color: var(--muted); }

.volume-result-shell { display: grid; gap: 1.5rem; }
.volume-total { display: grid; gap: 0.15rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.volume-total strong { color: var(--green-800); font-size: clamp(2.7rem, 13vw, 4.6rem); line-height: 1; letter-spacing: -0.06em; }
.volume-total span { color: var(--muted); }
.volume-breakdown { display: grid; gap: 0.8rem; }
.volume-breakdown div { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); }
.volume-breakdown strong { color: var(--ink); white-space: nowrap; }
.result-note { margin: 0; padding: 0.85rem; border-radius: 14px; background: var(--green-50); color: var(--green-950); font-size: 0.86rem; }

.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; padding: 0.25rem; border-radius: 15px; background: #edf2ef; }
.segmented-control label { position: relative; cursor: pointer; }
.segmented-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented-control span { display: grid; min-height: 2.8rem; place-items: center; padding: 0.45rem; border-radius: 11px; color: var(--muted); font-size: 0.8rem; font-weight: 800; text-align: center; }
.segmented-control input:checked + span { background: white; color: var(--green-800); box-shadow: 0 4px 12px rgba(17, 67, 46, 0.08); }

.saved-volume-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  align-items: center;
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--green-50);
}

.saved-volume-panel span { color: var(--muted); font-size: 0.78rem; }
.saved-volume-panel strong { grid-row: 1 / 3; grid-column: 2; color: var(--green-800); font-size: 1.3rem; white-space: nowrap; }
.text-button { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--green-700); font-size: 0.8rem; font-weight: 800; text-decoration: underline; cursor: pointer; }
.manual-volume-field { margin: 1rem 0 1.5rem; }
.select-product-field { margin: 1.5rem 0; }
.select-product-field .step-label { margin-bottom: -0.15rem; }

.product-result-shell { display: grid; gap: 1.2rem; }
.product-result-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.product-result-head h2 { margin: 0.15rem 0 0; font-size: 1.6rem; letter-spacing: -0.035em; }
.brand-chip, .status-chip { display: inline-flex; width: fit-content; padding: 0.3rem 0.55rem; border-radius: 999px; font-size: 0.68rem; font-weight: 850; letter-spacing: 0.05em; text-transform: uppercase; }
.brand-chip { background: var(--green-100); color: var(--green-800); }
.status-chip { background: #fff3d8; color: #815d0a; }
.dose-display { display: grid; gap: 0.25rem; }
.dose-display strong { color: var(--green-800); font-size: 2.4rem; line-height: 1; letter-spacing: -0.05em; }
.dose-display span, .water-volume-row span { color: var(--muted); font-size: 0.82rem; }
.water-volume-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; }
.pending-notice, .safety-notice { padding: 1rem; border-radius: 15px; }
.pending-notice { background: #fff8e9; color: #6b5113; }
.pending-notice strong, .pending-notice span { display: block; }
.pending-notice span { margin-top: 0.25rem; font-size: 0.87rem; }
.guidance-section h3 { margin-bottom: 0.6rem; font-size: 1rem; }
.guidance-section p { margin-bottom: 0; color: var(--muted); font-size: 0.9rem; }
.guidance-list, .action-list { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.guidance-list li + li, .action-list li + li { margin-top: 0.45rem; }
.buy-button-disabled { opacity: 0.55; cursor: not-allowed; }
.purchase-note { margin: -0.65rem 0 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

.problem-options { display: flex; gap: 0.6rem; margin: 0 -1.25rem 1.5rem; padding: 0 1.25rem 0.5rem; overflow-x: auto; scrollbar-width: thin; }
.problem-chip { min-height: 2.8rem; flex: 0 0 auto; padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); font-size: 0.84rem; font-weight: 750; cursor: pointer; }
.problem-chip[aria-pressed="true"] { border-color: var(--green-700); background: var(--green-700); color: white; }

.guidance-card { min-height: 20rem; }
.empty-guidance { display: grid; place-items: center; background: linear-gradient(145deg, #fff, var(--green-50)); text-align: center; }
.guidance-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.guidance-header h2 { margin-bottom: 0.45rem; font-size: 1.7rem; letter-spacing: -0.035em; }
.guidance-header p, .guidance-block p { margin-bottom: 0; color: var(--muted); }
.guidance-block + .guidance-block { margin-top: 1.5rem; }
.guidance-block h3 { margin-bottom: 0.6rem; font-size: 1rem; }
.safety-notice { margin-top: 1.5rem; background: #eef8f8; color: #174b4e; }
.safety-notice strong { display: block; margin-bottom: 0.25rem; }
.safety-notice p { margin: 0; font-size: 0.86rem; }
.category-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.category-pill { padding: 0.35rem 0.65rem; border-radius: 999px; background: var(--green-100); color: var(--green-800); font-size: 0.75rem; font-weight: 800; }
.related-grid { display: grid; gap: 0.65rem; }
.related-product { display: flex; justify-content: space-between; gap: 1rem; align-items: center; width: 100%; min-height: 4rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.related-product span { display: grid; }
.related-product small { color: var(--muted); }

.section-heading--products { display: grid; gap: 0.5rem; }
.product-list { display: grid; gap: 0.8rem; }
.product-card { display: grid; grid-template-columns: 1fr auto; gap: 0.7rem 1rem; align-items: center; width: 100%; min-height: 8.5rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; color: var(--ink); text-align: left; box-shadow: 0 8px 25px rgba(17, 67, 46, 0.05); cursor: pointer; }
.product-card:hover { border-color: #9ac6ae; transform: translateY(-1px); }
.product-card-main { display: grid; gap: 0.3rem; }
.product-card h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.025em; }
.product-card p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.product-card-arrow { grid-row: 1 / 3; grid-column: 2; color: var(--green-700); font-size: 1.35rem; }
.product-card .status-chip { grid-column: 1; }
.loading-message { color: var(--muted); }
.load-error { display: grid; gap: 0.2rem; margin-bottom: 1rem; padding: 1rem; border-radius: 15px; background: #fff0ed; color: #8f3128; }
.load-error span { font-size: 0.85rem; }

.site-footer { width: min(100% - 2.5rem, 69.5rem); margin: 0 auto; padding: 2rem 0 7rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }
.site-footer p { margin-bottom: 0.35rem; }
.site-footer a { color: var(--green-700); font-weight: 800; }

.app-message { position: fixed; top: 4.5rem; right: 1rem; left: 1rem; z-index: 30; max-width: 28rem; margin: auto; padding: 0.9rem 1rem; border-radius: 14px; background: var(--green-950); color: white; box-shadow: var(--shadow); text-align: center; font-size: 0.85rem; font-weight: 700; }

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.55rem max(0.75rem, env(safe-area-inset-right)) calc(0.55rem + env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
}

.nav-item {
  display: grid;
  gap: 0.1rem;
  justify-items: center;
  min-height: 3.25rem;
  padding: 0.4rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

.nav-item > span:first-child { font-size: 1.15rem; line-height: 1; }
.nav-item.is-active { background: var(--green-50); color: var(--green-800); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(24, 133, 87, 0.35);
  outline-offset: 3px;
}

@media (min-width: 46rem) {
  .site-header { padding: 1.4rem 2rem; }
  .app-shell { padding: 3.5rem 2rem 8rem; }
  .choice-grid { grid-template-columns: 1.25fr 0.75fr; }
  .feature-card { padding: 2rem; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-card { grid-template-columns: 1fr auto; min-height: 12rem; align-content: space-between; }
  .tool-number { grid-column: 1 / -1; }
  .tool-copy { align-self: end; }
  .form-card, .result-card, .guidance-card { padding: 1.7rem; }
  .dimension-grid { grid-template-columns: repeat(3, 1fr); }
  .problem-options { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
  .product-list { grid-template-columns: repeat(2, 1fr); }
  .section-heading--products { grid-template-columns: 1fr 0.75fr; align-items: end; }
}

@media (min-width: 62rem) {
  .bottom-nav {
    right: 1.5rem;
    bottom: 1.5rem;
    left: auto;
    width: 20rem;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
  }
  .calculator-layout { grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.92fr); gap: 1.25rem; }
  .result-card { position: sticky; top: 1.5rem; }
  .site-footer { padding-bottom: 3rem; }
}

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