:root {
  color-scheme: light;
  --ink: #20352b;
  --muted: #68766f;
  --cream: #f5f0e3;
  --paper: #fffdf7;
  --line: #d9ddce;
  --green: #244c3a;
  --green-light: #dce8d8;
  --blue: #85c8cf;
  --blue-deep: #2c737a;
  --almond: #c68f5f;
  --shadow: 0 28px 80px rgba(39, 54, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(133, 200, 207, 0.28), transparent 26rem),
    radial-gradient(circle at 88% 82%, rgba(198, 143, 95, 0.17), transparent 28rem),
    var(--cream);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
select {
  font: inherit;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 56px 24px;
}

.calculator {
  width: min(100%, 760px);
}

.intro {
  margin-bottom: 30px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
  color: var(--blue-deep);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.calculator-icon {
  width: 18px;
  height: 18px;
  transform: rotate(-10deg);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

h1 em {
  color: var(--almond);
  font-family: Georgia, serif;
  font-weight: 400;
}

.intro p {
  max-width: 560px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.input-panel,
.result-panel {
  border: 1px solid rgba(38, 62, 49, 0.12);
  border-radius: 24px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.input-panel {
  position: relative;
  z-index: 1;
  padding: 22px;
}

.textarea-heading,
.estimate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.textarea-heading {
  margin-bottom: 12px;
}

.textarea-heading label,
.estimate-row label {
  font-size: 0.82rem;
  font-weight: 700;
}

.textarea-heading span {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
}

.textarea-heading strong {
  color: var(--ink);
}

textarea {
  display: block;
  width: 100%;
  min-height: 176px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  padding: 18px;
  font-size: 1rem;
  line-height: 1.6;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea::placeholder {
  color: #99a29c;
}

textarea:focus {
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 4px rgba(133, 200, 207, 0.24);
}

.prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
}

.prompt-chip {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #e5e6e1;
  border-radius: 999px;
  background: #f4f4f1;
  color: #747d77;
  padding: 7px 10px;
  font-size: 0.67rem;
  font-weight: 600;
  line-height: 1.25;
}

.prompt-chip svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.prompt-chip:hover {
  border-color: #dcddd7;
  background: #eeeeea;
}

.prompt-chip:focus-visible {
  outline: 3px solid rgba(133, 200, 207, 0.28);
  outline-offset: 2px;
}

.estimate-row {
  margin-top: 16px;
  padding: 0 2px;
}

.estimate-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.estimate-controls,
.agent-toggle {
  display: flex;
  align-items: center;
}

.estimate-controls {
  gap: 14px;
}

.agent-toggle {
  cursor: pointer;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.agent-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e8e9e2;
  transition: background 160ms ease, border-color 160ms ease;
}

.toggle-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(32, 53, 43, 0.3);
  transition: transform 160ms ease;
}

.agent-toggle input:checked + .toggle-track {
  border-color: var(--blue-deep);
  background: var(--blue-deep);
}

.agent-toggle input:checked + .toggle-track i {
  transform: translateX(14px);
}

.agent-toggle input:focus-visible + .toggle-track {
  outline: 3px solid rgba(133, 200, 207, 0.35);
  outline-offset: 2px;
}

select {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 36px 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

select:focus-visible {
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 3px rgba(133, 200, 207, 0.2);
}

.result-panel {
  margin-top: -25px;
  padding-top: 24px;
  overflow: hidden;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: 0 22px 60px rgba(39, 54, 43, 0.08);
}

.water-result {
  padding: 40px 30px 32px;
  text-align: center;
}

.result-kicker,
.almond-result span,
.stats span {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.water-value {
  margin: 3px 0 0;
  color: var(--blue-deep);
  letter-spacing: -0.06em;
}

.water-value strong {
  font-size: clamp(3.2rem, 11vw, 6.25rem);
  font-weight: 700;
}

.water-value span {
  margin-left: 4px;
  font-family: "DM Mono", monospace;
  font-size: clamp(1rem, 3vw, 1.45rem);
  letter-spacing: -0.04em;
}

.liter-value {
  margin: -4px 0 0;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
}

.almond-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 24px 24px;
  border-radius: 16px;
  background: #f2e4d3;
  padding: 18px 20px;
  text-align: center;
}

.almond-image {
  display: block;
  flex: 0 0 auto;
  width: 150px;
  height: 98px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.almond-result > div:last-child {
  min-width: 0;
}

.almond-result strong,
.almond-result small {
  display: block;
}

.almond-result strong {
  margin-top: 3px;
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  letter-spacing: -0.025em;
}

.almond-result small {
  margin-top: 3px;
  color: #786650;
  font-size: 0.75rem;
  line-height: 1.45;
}

.share-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: -8px 24px 20px;
}

.share-button {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(120, 102, 80, 0.14);
  border-radius: 999px;
  background: #f2e4d3;
  color: #786650;
  padding: 10px 16px;
  font-size: 0.76rem;
  font-weight: 700;
}

.share-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.share-button:hover {
  background: #f2e4d3;
}

.share-button:focus-visible {
  outline: 3px solid rgba(133, 200, 207, 0.4);
  outline-offset: 3px;
}

.share-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.share-feedback {
  color: var(--muted);
  font-size: 0.7rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.stats div {
  padding: 18px 20px 20px;
  text-align: center;
}

.stats div + div {
  border-left: 1px solid var(--line);
}

.stats strong {
  display: block;
  margin-top: 4px;
  font-family: "DM Mono", monospace;
  font-size: 0.82rem;
  font-weight: 500;
}

.methodology {
  margin: 18px auto 0;
  border-bottom: 1px solid rgba(38, 62, 49, 0.18);
  color: var(--muted);
  font-size: 0.78rem;
}

.methodology summary {
  cursor: pointer;
  padding: 12px 2px;
  color: var(--ink);
  font-weight: 700;
  list-style-position: inside;
  text-align: center;
}

.methodology div {
  max-width: 600px;
  margin: 0 auto;
  padding: 2px 18px 15px;
  line-height: 1.6;
  text-align: center;
}

.methodology p {
  margin: 0 0 8px;
}

.development-note {
  max-width: 650px;
  margin: 15px auto 0;
  padding: 0 18px;
  color: rgba(32, 53, 43, 0.46);
  font-family: "DM Mono", monospace;
  font-size: 0.67rem;
  line-height: 1.65;
  text-align: center;
}

.development-note p {
  margin: 0;
}

.development-note strong {
  font-weight: 500;
}

@media (max-width: 600px) {
  .page-shell {
    display: block;
    padding: 36px 14px;
  }

  .intro {
    margin-bottom: 24px;
  }

  .input-panel {
    padding: 17px;
    border-radius: 19px;
  }

  .estimate-row {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .estimate-controls {
    justify-content: space-between;
    gap: 10px;
  }

  .agent-toggle {
    white-space: normal;
  }

  select {
    max-width: 148px;
  }

  .water-result {
    padding: 34px 18px 28px;
  }

  .almond-result {
    margin: 0 16px 16px;
    padding: 15px;
  }

  .almond-image {
    width: 112px;
    height: 78px;
  }

  .share-row {
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
  }

  .stats div {
    padding: 15px 7px 17px;
  }

  .stats strong {
    font-size: 0.7rem;
  }
}

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