*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #fafaf8;
  color: #1a1a1a;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

main {
  width: 100%;
  max-width: 380px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label:not(.radio) {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .875rem;
  font-weight: 500;
}

input[type="number"],
input[type="password"] {
  padding: .55rem .75rem;
  border: 1px solid #d0d0cc;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  width: 100%;
}

input[type="number"]:focus,
input[type="password"]:focus {
  outline: 2px solid #4a7c59;
  outline-offset: 1px;
  border-color: transparent;
}

fieldset {
  border: 1px solid #d0d0cc;
  border-radius: 6px;
  padding: .75rem 1rem;
}

legend {
  font-size: .875rem;
  font-weight: 500;
  padding: 0 .25rem;
}

.radio {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9375rem;
  cursor: pointer;
  margin-top: .5rem;
}

button[type="submit"] {
  padding: .65rem 1.25rem;
  background: #4a7c59;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: .25rem;
}

button[type="submit"]:hover { background: #3d6b4b; }

.error {
  color: #c0392b;
  font-size: .875rem;
}

/* Result page */
.result-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid #d0d0cc;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  margin-bottom: 1.25rem;
}

.water-amount {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  color: #4a7c59;
}

.water-label {
  font-size: 1rem;
  color: #555;
  margin-top: .35rem;
}

.detail {
  font-size: .875rem;
  color: #555;
  margin-bottom: .75rem;
}

.hint {
  font-size: .8125rem;
  color: #888;
  margin-bottom: 1.5rem;
}

.btn-link {
  display: inline-block;
  padding: .55rem 1.25rem;
  background: #4a7c59;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 500;
}

.btn-link:hover { background: #3d6b4b; }

p { margin-bottom: 1rem; }

/* Claude assessment card */
.assessment {
  background: #f3f6f2;
  border: 1px solid #d7e0d3;
  border-radius: 10px;
  padding: .9rem 1rem;
  margin-bottom: 1.5rem;
}

.assessment-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}

.assessment-title {
  font-size: .8125rem;
  font-weight: 600;
  color: #4a7c59;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.assessment-body {
  font-size: .9375rem;
  line-height: 1.5;
  color: #333;
  margin: 0;
  white-space: pre-wrap;
}

.assessment-body.assessment-error { color: #888; font-style: italic; }

/* Result chart */
.chart-card {
  margin: 0 0 1.25rem;
  background: #fff;
  border: 1px solid #d0d0cc;
  border-radius: 12px;
  padding: .75rem .5rem .25rem;
}

.chart-card svg { width: 100%; height: auto; display: block; overflow: visible; }

.chart-title {
  font-size: .8125rem;
  font-weight: 600;
  color: #4a7c59;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: center;
  padding: .15rem 0 .35rem;
}
.chart-note {
  font-size: .75rem;
  line-height: 1.45;
  color: #666;
  padding: .35rem .6rem .15rem;
  text-align: center;
}
.chart-note strong { color: #333; }

.chart-card svg .grid { stroke: #ecefe9; stroke-width: 1; }
.chart-card svg .tick { fill: #888; font-size: 11px; font-family: system-ui, sans-serif; }
.chart-card svg .tick-y { text-anchor: end; }
.chart-card svg .tick-x { text-anchor: middle; }
.chart-card svg .axis-title { fill: #555; font-size: 12px; font-weight: 500; text-anchor: middle; font-family: system-ui, sans-serif; }

.chart-card svg .model-line { fill: none; stroke: #4a7c59; stroke-width: 2; stroke-dasharray: 6 4; opacity: .85; }
.chart-card svg .baseline-line { stroke: #b6bcb2; stroke-width: 1.5; stroke-dasharray: 2 4; }

.chart-card svg .obs { stroke: #fff; stroke-width: 1.5; transition: r .12s ease; cursor: pointer; }
.chart-card svg .obs:hover { r: 7.5; }

.chart-card svg .crosshair { stroke: #2c6fb0; stroke-width: 1; stroke-dasharray: 3 3; opacity: .5; }
.chart-card svg .current-ring { fill: none; stroke: #2c6fb0; stroke-width: 2.5; }
.chart-card svg .current-dot { fill: #2c6fb0; }
.chart-card svg .current-label { fill: #2c6fb0; font-size: 12px; font-weight: 700; font-family: system-ui, sans-serif; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  justify-content: center;
  font-size: .75rem;
  color: #555;
  padding: .6rem .25rem .3rem;
}
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart-legend .dot.great { background: #4a7c59; }
.chart-legend .dot.soft { background: #e6a23c; }
.chart-legend .dot.hard { background: #c0392b; }
.chart-legend .dot.current { background: #2c6fb0; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #2c6fb0; }
.chart-legend .dash { width: 16px; height: 0; border-top: 2px dashed #4a7c59; display: inline-block; }
.chart-legend .dash.gray { border-top-color: #b6bcb2; }

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #c2d2bd;
  border-top-color: #4a7c59;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
