:root {
  --green: #3c8c5a;
  --green-soft: #e8f3ec;
  --water: #2f7fb5;
  --water-soft: #e6f1f8;
  --warn: #c2562f;
  --warn-soft: #fbeae3;
  --ink: #1f2925;
  --muted: #71807a;
  --line: #e7ebe8;
  --bg: #fbfcfb;
  --card: #ffffff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  padding-bottom: 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px calc(16px + env(safe-area-inset-top));
  padding-top: calc(16px + env(safe-area-inset-top));
}
.brand { font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.loc {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.weather-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 20px 14px;
  scrollbar-width: none;
}
.weather-strip::-webkit-scrollbar { display: none; }
.wcell {
  flex: 0 0 auto;
  min-width: 64px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
}
.wcell .wd { font-size: 12px; color: var(--muted); }
.wcell .wi { font-size: 20px; line-height: 1.4; }
.wcell .wt { font-size: 12px; }
.wcell .wt .hi { font-weight: 700; }
.wcell .wt .lo { color: var(--muted); }

main { padding: 0 20px; }

.plant-list { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  cursor: pointer;
}
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-name { font-size: 16px; font-weight: 700; }
.card-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.water { background: var(--water-soft); color: var(--water); }
.badge.skip  { background: var(--green-soft); color: var(--green); }
.badge.ok    { background: #f1f3f2; color: var(--muted); }

.card-cycle {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  background: #f6f8f7;
  border-radius: 10px;
  padding: 7px 10px;
}
.card-cycle b { color: var(--ink); font-weight: 700; }
.cnote { color: var(--warn); font-weight: 700; }

.headline { margin-top: 12px; font-size: 15px; font-weight: 600; }
.headline.water { color: var(--water); }
.headline.skip { color: var(--green); }
.headline.ok { color: var(--ink); }

.alerts { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.alert {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
}
.alert.info { background: var(--water-soft); color: var(--water); }

.card .doneRow { margin-top: 14px; }
.doneBtn {
  width: 100%;
  border: none;
  background: var(--water);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}
.doneBtn.secondary { background: var(--green-soft); color: var(--green); }

.empty { text-align: center; padding: 64px 24px; }
.empty-title { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.empty-sub { color: var(--muted); font-size: 14px; margin: 0; }

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(60, 140, 90, 0.35);
  cursor: pointer;
}

.modal {
  position: fixed; inset: 0;
  background: rgba(20, 30, 25, 0.4);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.sheet {
  background: var(--card);
  width: 100%;
  max-width: 520px;
  border-radius: 22px 22px 0 0;
  padding: 24px 22px calc(28px + env(safe-area-inset-bottom));
  animation: slideup 0.22s ease;
}
@keyframes slideup { from { transform: translateY(20px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet h2 { margin: 0 0 18px; font-size: 18px; }
.muted { color: var(--muted); font-size: 13px; margin: -8px 0 16px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

.results {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}
.result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}
.result:last-child { border-bottom: none; }
.result:active { background: var(--green-soft); }
.result .rcat { font-size: 12px; color: var(--muted); }

.chosen { margin-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 999px;
}
.chip button {
  border: none;
  background: rgba(60,140,90,0.18);
  color: var(--green);
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.chip-muted { font-size: 13px; color: var(--muted); }

.care-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 12px;
  padding: 8px 12px;
}

.actions { display: flex; gap: 10px; margin-top: 8px; }
.primary, .ghost {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  padding: 13px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
}
.primary { background: var(--green); color: #fff; }
.primary.wide { width: 100%; margin-bottom: 16px; }
.ghost { background: #f1f3f2; color: var(--muted); }
.danger {
  width: 100%;
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--warn);
  font-size: 14px;
  cursor: pointer;
}
[hidden] { display: none !important; }
