:root {
  color-scheme: light;
  --green-900: #183728;
  --green-700: #315c42;
  --green-500: #5e896a;
  --green-100: #e6efe7;
  --cream: #f7f5ec;
  --paper: #fffef9;
  --blue: #437994;
  --blue-light: #e5f1f5;
  --text: #203128;
  --muted: #66736b;
  --border: rgba(32, 49, 40, 0.12);
  --shadow: 0 18px 45px rgba(35, 55, 43, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top right,
      rgba(155, 190, 158, 0.28),
      transparent 38rem
    ),
    var(--cream);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 38px 0 48px;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

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

h1 {
  margin-bottom: 0;
  color: var(--green-900);
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  line-height: 1.15;
}

.eyebrow,
.card-kicker {
  margin-bottom: 7px;
  color: var(--green-700);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.updated {
  max-width: 180px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: right;
}

.watering-card,
.current-card,
.balance-card,
.rain-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.watering-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 24px;
  background: var(--paper);
}

.watering-card.neutral {
  border-left: 6px solid #a4aca6;
}

.watering-card.good {
  border-left: 6px solid var(--green-500);
  background: var(--green-100);
}

.watering-card.warning {
  border-left: 6px solid #cc8b35;
  background: #fff2dc;
}

.watering-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 18px;
  background: var(--blue-light);
  font-size: 1.7rem;
}

.watering-reason,
.muted {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.current-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 24px;
  background: var(--green-900);
  color: white;
}

.current-card .card-kicker,
.current-card .muted {
  color: rgba(255, 255, 255, 0.72);
}

.current-value {
  flex: none;
  text-align: right;
}

.current-value span {
  display: block;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  font-weight: 760;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.current-value small {
  color: rgba(255, 255, 255, 0.72);
}

.rain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.rain-card {
  padding: 21px;
  background: var(--paper);
}

.rain-card.accent {
  background: var(--blue-light);
}

.rain-card p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.rain-card strong {
  display: block;
  color: var(--green-900);
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.rain-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.balance-card {
  margin-top: 16px;
  padding: 24px;
  background: var(--paper);
}

.balance-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) 1.2fr;
  gap: 24px;
  align-items: center;
}

.balance-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.data-sources {
  margin-top: 26px;
  padding: 18px 20px;
  background: var(--paper);
  border-left: 4px solid var(--green-900);
  box-shadow: var(--shadow);
}

.data-sources > strong {
  display: block;
  margin-bottom: 8px;
}

.data-sources p {
  margin-bottom: 8px;
  line-height: 1.55;
}

.data-sources p:last-child {
  margin-bottom: 0;
}

.source-detail {
  color: var(--muted);
  font-size: 0.8rem;
}

footer {
  margin-top: 26px;
  padding: 20px 4px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

footer p {
  margin-bottom: 5px;
}

.error {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #ffe8e3;
  color: #7b2e24;
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 24px, 760px);
    padding-top: 24px;
  }

  .site-header {
    display: block;
  }

  .updated {
    max-width: none;
    margin-top: 12px;
    text-align: left;
  }

  .watering-card,
  .current-card,
  .balance-card,
  .rain-card {
    border-radius: 18px;
  }

  .watering-card,
  .current-card,
  .balance-card {
    padding: 20px;
  }

  .watering-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .rain-grid {
    gap: 12px;
  }

  .rain-card {
    padding: 18px;
  }

  .balance-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.watering-card .card-kicker {
  text-transform: none;
  letter-spacing: 0.04em;
}

.temperature-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.temperature-card h2 {
  margin-bottom: 7px;
}

.evaporation-value {
  flex: none;
  text-align: right;
}

.evaporation-value span {
  display: block;
  color: var(--blue);
  font-size: 2.2rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.04em;
}

.evaporation-value small,
.balance-content span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.balance-content strong {
  display: block;
  color: var(--green-900);
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.balance-content p {
  margin-top: 14px;
}

@media (max-width: 560px) {
  .temperature-card {
    padding: 20px;
    border-radius: 18px;
  }
}

.history-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--green-100);
  box-shadow: var(--shadow);
}

.history-card h2 {
  margin-bottom: 7px;
}

.history-value {
  flex: none;
  text-align: right;
}

.history-value span {
  display: block;
  color: var(--green-900);
  font-size: 2.2rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.04em;
}

.history-value small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.reference-rain-values {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 14px;
  text-align: right;
}

.reference-rain-values > div {
  min-width: 0;
}

.reference-rain-values span {
  display: block;
  color: var(--green-900);
  font-size: 1.35rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.03em;
}

.reference-rain-values small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.history-progress {
  width: min(300px, 100%);
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(49, 92, 66, 0.15);
}

.history-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green-700);
  transition: width 300ms ease;
}

@media (max-width: 560px) {
  .history-card {
    padding: 20px;
    border-radius: 18px;
  }
}

.legal-links {
  margin-top: 12px;
}

.legal-links a {
  color: inherit;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.legal-links a:hover,
.legal-links a:focus-visible {
  color: var(--ink);
}

/* Mobile stacked measurement cards */
@media (max-width: 560px) {
  .reference-card,
  .temperature-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .reference-card > div,
  .temperature-card > div {
    min-width: 0;
  }

  .reference-card .history-value,
  .temperature-card .evaporation-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
    max-width: 100%;
    text-align: left;
  }

  .reference-card .history-value span,
  .temperature-card .evaporation-value span {
    flex: 0 0 auto;
  }

  .reference-card .history-value small,
  .temperature-card .evaporation-value small {
    min-width: 0;
    margin-top: 0;
    text-align: left;
    overflow-wrap: anywhere;
  }
}
