:root {
  --bg: #f0f7ef;
  --ink: #13271f;
  --muted: #587064;
  --card: #ffffff;
  --line: #d3e1d3;
  --accent: #1f6b4b;
  --accent-strong: #174f38;
  --warning: #c96d25;
  --danger: #b53d3d;
  --radius: 20px;
  --shadow: 0 12px 32px rgba(20, 55, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

body {
  display: grid;
  place-items: center;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(59, 136, 97, 0.28), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(241, 189, 113, 0.3), transparent 35%),
    linear-gradient(145deg, #eef8ec 20%, #deefde 90%);
  z-index: 0;
}

.app-shell {
  width: min(100vw, 480px);
  min-height: 100dvh;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(18px + env(safe-area-inset-top)) 16px 8px;
}

.topbar h1 {
  margin: 0;
  font: 600 1.65rem/1.1 "Fraunces", Georgia, serif;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

main {
  padding: 10px 16px 14px;
  overflow-y: auto;
}

.view {
  display: none;
  gap: 12px;
}

.view.active {
  display: grid;
}

.hero-card,
.setting-card,
.plant-card,
.timeline-item,
.urgent-card,
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 18px;
  background:
    linear-gradient(120deg, rgba(49, 113, 83, 0.95), rgba(27, 84, 57, 0.96)),
    url("./assets/leaf.svg");
  color: #f8fff8;
}

.hero-card h2 {
  margin: 0;
  font-size: 1.3rem;
}

.hero-card p {
  margin: 8px 0 14px;
  font-size: 0.93rem;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 12px;
}

.stat-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.stat-card strong {
  font-size: 1.4rem;
  font-weight: 800;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 1.04rem;
}

.search-wrap {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
}

.card-list,
.timeline,
.settings-stack,
.chip-row {
  display: grid;
  gap: 10px;
}

.chip-row {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  min-height: 36px;
}

.chip.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.plant-card,
.timeline-item,
.urgent-card,
.setting-card {
  padding: 14px;
}

.compact-form {
  gap: 10px;
  display: grid;
}

.plant-header,
.plant-meta,
.plant-actions,
.row-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.plant-header h3 {
  margin: 0;
  font-size: 1rem;
}

.plant-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.small-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.quick-care-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.care-btn {
  padding: 8px;
}

.tag {
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
  background: #edf6ef;
  color: var(--accent-strong);
}

.tag.warning {
  color: #8f4a19;
  background: #fde8d8;
}

.tag.danger {
  color: #8f1f1f;
  background: #fbe0e0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  min-height: 44px;
}

.primary-btn,
.ghost-btn {
  border-radius: 12px;
  padding: 10px 13px;
  font-weight: 700;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.primary-btn:active {
  background: var(--accent-strong);
}

.ghost-btn {
  background: #f2f7f1;
  color: var(--accent-strong);
  border: 1px solid var(--line);
}

.fake-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  background: rgba(239, 247, 238, 0.94);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  backdrop-filter: blur(7px);
}

.nav-btn {
  background: transparent;
  border-radius: 12px;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
  min-height: 42px;
}

.nav-btn.active {
  color: var(--accent-strong);
  background: #dff0e3;
}

.sheet {
  border: 0;
  width: min(100vw, 480px);
  border-radius: 22px 22px 0 0;
  margin-top: auto;
  padding: 0;
}

.sheet::backdrop {
  background: rgba(8, 26, 19, 0.55);
}

.sheet-content {
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  background: #fbfefb;
}

.timeline-item {
  display: grid;
  gap: 6px;
}

.timeline-item p,
.setting-card p,
.urgent-card p,
.diag-result {
  margin: 0;
  color: var(--muted);
}

.diag-result {
  margin-top: 8px;
  font-size: 0.9rem;
}

@media (min-width: 700px) {
  .app-shell {
    margin: 18px;
    min-height: calc(100dvh - 36px);
    border: 1px solid #cde1cd;
    border-radius: 28px;
    overflow: hidden;
  }
}
