/* ═══════════════════════════════════════════════════════════
   leafy — calm botanical: soft greens, rounded, airy
   Design system adapted from tidy ✦
   ═══════════════════════════════════════════════════════════ */

:root {
  --cream:      #FAF7F0;
  --cream-deep: #F2EDE2;
  --ink:        #39413A;
  --ink-soft:   #79806F;
  --ink-faint:  #A8AC9C;

  --leaf:       #7A9E7E;
  --leaf-deep:  #5E8264;
  --leaf-soft:  #DCE7DC;
  --leaf-tint:  #EEF4EE;
  --terracotta: #CE8B72;
  --terra-tint: #F8E9E2;
  --butter:     #E7D5A2;
  --butter-tint:#FAF3DD;
  --sky:        #9FBECB;
  --sky-tint:   #E6EFF3;
  --lilac:      #B3A9C6;
  --lilac-tint: #EDE9F2;

  --card:       #FFFFFF;
  --line:       #E9E3D4;
  --danger:     #C47A70;

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-soft: 0 1px 2px rgba(57,65,58,.04), 0 8px 24px rgba(57,65,58,.06);
  --shadow-lift: 0 2px 4px rgba(57,65,58,.05), 0 14px 34px rgba(57,65,58,.10);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", -apple-system, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  scrollbar-gutter: stable; height: 100%; }

body {
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* subtle atmosphere: two soft botanical washes */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(60% 40% at 85% -5%, var(--leaf-tint) 0%, transparent 70%),
    radial-gradient(70% 45% at 5% 100%, var(--butter-tint) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 100px);
}

.hidden { display: none !important; }
.sheet.hidden, .sheet-backdrop.hidden { display: block !important; }

/* ── type ─────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 28px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--leaf-deep);
  margin-bottom: 2px;
}

/* ── auth ─────────────────────────────────────────────────── */
.auth-card {
  margin-top: 8vh;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 36px 26px 30px;
  text-align: center;
}
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; color: var(--leaf); }
.brand h1 { font-size: 40px; font-weight: 600; }
.tagline { color: var(--ink-soft); margin: 14px 0 28px; font-size: 15px; }

#auth-form { text-align: left; }
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 7px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--leaf); background: #fff; }

/* Global date-input (date-sheet) */
input[type="date"] {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: 500 15px var(--font-body);
  background: var(--cream);
  color: var(--ink);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"]:focus {
  outline: none;
  border-color: var(--leaf);
  background: var(--card);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field-opt { font-style: normal; font-weight: 500; color: var(--ink-faint); font-size: 12px; text-transform: none; letter-spacing: 0; }

.form-error { color: var(--danger); font-size: 13.5px; min-height: 18px; margin: -6px 0 8px; }

.link-btn {
  background: none; border: none; font: inherit;
  color: var(--ink-soft); cursor: pointer; margin-top: 18px;
}
.link-btn strong { color: var(--leaf-deep); }

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  font: inherit; font-weight: 700;
  border: none; border-radius: 999px;
  padding: 14px 22px; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  width: 100%;
  background: var(--leaf); color: #fff;
  box-shadow: 0 6px 16px rgba(122,158,126,.35);
}
.btn-primary:disabled { opacity: .6; }
.btn-ghost { background: var(--cream-deep); color: var(--ink-soft); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 50%; cursor: pointer; color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ── topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px;
}
.topbar-actions { display: flex; gap: 10px; }

/* ── today: task cards ────────────────────────────────────── */
.cards { display: flex; flex-direction: column; gap: 10px; }

.task-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: var(--radius-lg);
  padding: 14px 18px 14px 14px;
  box-shadow: 0 1px 3px rgba(61,79,61,.06); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
/* visuell feedback under långtryck — skala ner gradvis tills menyn öppnas */
.task-card.pressing {
  transform: scale(.965);
  box-shadow: 0 1px 2px rgba(61,79,61,.1);
  transition: transform .22s ease, box-shadow .22s ease;
}
.task-card:nth-child(2) { animation-delay: .04s; }
.task-card:nth-child(3) { animation-delay: .08s; }
.task-card:nth-child(4) { animation-delay: .12s; }
.task-card:nth-child(5) { animation-delay: .16s; }

.plant-thumb {
  width: 72px; height: 88px; flex: none;
  border-radius: var(--radius-sm);
  overflow: hidden; background: var(--cream-deep);
  display: grid; place-items: center;
}
.plant-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}

.task-info { flex: 1; min-width: 0; }
.task-info strong { display: block; font-size: 15.5px; line-height: 1.3; }
.task-info small { color: var(--ink-faint); font-size: 12.5px; display: block; margin-top: 1px; }

.row-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.care-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-soft); background: var(--cream-deep);
  padding: 3px 9px; border-radius: 999px; flex: none;
}
.care-tag.info { background: var(--cream-deep); color: var(--ink-soft); }
.care-tag.action { background: var(--leaf-tint); color: var(--leaf-deep); }
.care-tag.danger { background: var(--terra-tint); color: var(--terracotta); }
.care-tag.done { background: var(--leaf-tint); color: var(--leaf-deep); }
.care-tag.done svg { color: var(--leaf); }

.pest-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--terracotta); background: var(--terra-tint);
  padding: 3px 9px; border-radius: 999px; flex: none;
}

.done-check { width: 24px; height: 24px; color: var(--leaf); flex: none; }

.do-btn { 
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--leaf);
  background: transparent; color: var(--leaf);
  cursor: pointer; padding: 0;
  font-size: 21px;
  transition: background .15s, color .15s, transform .12s;
}
.do-btn:active { transform: scale(.9); background: var(--leaf); color: #fff; }
.do-btn.treat { border-color: var(--butter); color: #B99A45; }
.do-btn.treat:active { background: var(--butter); color: #fff; }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-spark { width: 46px; height: 46px; margin: 0 auto 14px; color: var(--leaf); }
.empty-spark svg { width: 100%; height: 100%; }
.empty-spark.muted { color: var(--ink-faint); }

.done-section { margin-top: 28px; }
.done-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  font: inherit; background: none; border: none; padding: 0;
  cursor: pointer; margin-bottom: 10px;
}
.done-toggle svg { width: 14px; height: 14px; color: var(--ink-faint); transition: transform .22s ease; }
.done-toggle.collapsed svg { transform: rotate(-90deg); }
.done-count {
  font-size: 11px; font-weight: 700; color: var(--leaf-deep);
  background: var(--leaf-tint); border-radius: 999px; padding: 2px 8px;
}
.done-heading {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
}
#today-done-list { display: flex; flex-direction: column; gap: 10px; }
#today-done-list .task-card { cursor: default; opacity: .6; }
#today-done-list .task-card strong { text-decoration: line-through; }
#today-done-list .done-check { width: 24px; height: 24px; color: var(--leaf); flex: none; }

.do-btn { background: var(--leaf); color: #fff; }

.offline-pill {
  margin: 22px auto 0; width: fit-content;
  font-size: 12.5px; font-weight: 700;
  color: var(--ink-soft);
  background: var(--butter-tint);
  border: 1.5px dashed var(--butter);
  padding: 8px 16px; border-radius: 999px;
}

/* ── plants grid ──────────────────────────────────────────── */
.search-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}
.search-field svg { width: 17px; height: 17px; color: var(--ink-faint); flex: none; }
.search-field input {
  flex: 1; font: inherit; border: none; outline: none;
  background: transparent; color: var(--ink);
  -webkit-appearance: none;
}
.search-field input::placeholder { color: var(--ink-faint); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }

.chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; flex: none;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink-soft); cursor: pointer;
  transition: all .15s;
}
.chip.on { background: var(--leaf-tint); color: var(--leaf-deep); border-color: var(--leaf); }

.plant-grid { display: flex; flex-direction: column; gap: 10px; }
.plant-card {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s;
}
.plant-card:active { transform: scale(.97); }
.plant-card .photo {
  aspect-ratio: 4/5; background: var(--cream-deep);
  display: grid; place-items: center; font-size: 40px;
  overflow: hidden;
}
.plant-card .photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.plant-card .meta { padding: 10px 13px 12px; }
.plant-card .meta strong { display: block; font-size: 14px; line-height: 1.25; }
.plant-card .meta small { color: var(--ink-faint); font-size: 12px; display: block; margin-top: 1px; }
.plant-card .status-dot {
  position: absolute; top: 10px; right: 10px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #fff;
}
.plant-card { position: relative; }
.status-dot.overdue { background: var(--terracotta); }
.status-dot.today { background: var(--butter); }
.status-dot.ok { background: var(--leaf); }

/* ── plant detail ─────────────────────────────────────────── */
.hero {
  position: relative;
  margin: 0; padding: 0;
  height: auto; background: none;
  display: block; overflow: visible;
}
.hero-back {
  position: static; margin-bottom: 14px;
}
.detail-header img {
  width: 72px; height: 96px;
  border-radius: var(--radius-sm);
  object-fit: cover; object-position: center;
}

.detail-header {
  display: flex; align-items: center; gap: 16px;
  min-height: 84px;
}
.detail-thumb {
  width: 72px; height: 88px; flex: none;
  border-radius: var(--radius-sm);
  background: var(--cream-deep);
  display: grid; place-items: center;
  overflow: hidden;
}
.detail-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.detail-meta { flex: 1; min-width: 0; }
.detail-meta h2 { font-size: 26px; line-height: 1.2; }
.detail-meta .eyebrow { margin-bottom: 0; }
.detail-body { padding-top: 14px; }
.detail-body h2 { font-size: 30px; }
.detail-sub { color: var(--ink-soft); font-size: 14.5px; margin-top: 2px; }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.action-btn {
  flex: 1 1 calc(50% - 5px); min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 700; font-size: 14.5px;
  padding: 13px 14px; border-radius: 999px; cursor: pointer;
  border: none; white-space: nowrap;
  background: var(--leaf); color: #fff;
  box-shadow: 0 6px 16px rgba(122,158,126,.3);
  transition: transform .12s, background .15s;
}
.action-btn > span { width: 17px; height: 17px; flex: none; display: inline-block; vertical-align: 0; }
.action-btn:active { transform: scale(.96); }
.action-btn.treat { background: var(--butter); color: #6B5A22; box-shadow: 0 6px 16px rgba(231,213,162,.4); }
.action-btn.secondary {
  background: var(--card); color: var(--leaf-deep);
  border: 1.5px solid var(--leaf-soft);
  box-shadow: var(--shadow-soft);
}

.section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 26px 0 10px;
}
.log-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.log-filter {
  font: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink-soft); cursor: pointer;
}
.log-filter.on { background: var(--leaf-tint); color: var(--leaf-deep); border-color: var(--leaf); }

.log-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 11px 14px; font-size: 14px;
  cursor: pointer;
}
.log-row + .log-row { margin-top: 8px; }
.log-row .log-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--cream-deep); }
.log-row .log-icon svg { width: 16px; height: 16px; stroke-width: 1.5; }
.log-row .log-what { flex: 1; min-width: 0; }
.log-row .log-when { color: var(--ink-faint); font-size: 12.5px; flex: none; }

.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip img, .photo-strip .photo-item {
  position: relative; flex: none;
  width: 100px; height: 125px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--cream-deep);
}
.photo-item img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.photo-meta {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.35));
}
.photo-meta small {
  color: #fff; font-size: 9px; font-weight: 600;
}
.photo-delete {
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.9); color: var(--danger);
  font-size: 14px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}

.add-photo {
  width: 100px; height: 125px; flex: none;
  border: 2px dashed var(--line); border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--ink-faint); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.add-photo:hover { border-color: var(--leaf); color: var(--leaf); }

/* fullscreen gallery */
#gallery-viewer {
  position: fixed; inset: 0; z-index: 1000;
}
.gallery-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.92);
}
.gallery-content {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.gallery-img {
  max-width: 90%; max-height: 85%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.gallery-close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 28px; line-height: 1;
  cursor: pointer; z-index: 10;
}
.gallery-prev, .gallery-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 32px; line-height: 1;
  cursor: pointer; z-index: 10;
}
.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }
.gallery-counter {
  position: absolute; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  color: #fff; font-size: 14px;
  background: rgba(0,0,0,.5); padding: 6px 14px;
  border-radius: 99px;
}



/* ── tab bar ──────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 14px);
  display: flex; gap: 4px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-lift);
  z-index: 50;
}
.tabbar::before {
  content: '';
  position: absolute;
  top: 6px; bottom: 6px;
  left: var(--tab-left, 6px);
  width: var(--tab-width, 60px);
  border-radius: 999px;
  background: var(--leaf-tint);
  z-index: 0;
  transition: left .28s cubic-bezier(.32,.72,.28,1), width .28s cubic-bezier(.32,.72,.28,1);
  opacity: 0;
}
.tabbar[data-active]::before { opacity: 1; }
.tab {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: inherit; font-size: 10.5px; font-weight: 700;
  color: var(--ink-faint);
  background: none; border: none; border-radius: 999px;
  padding: 8px 16px 6px; cursor: pointer;
  transition: color .15s;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--leaf-deep); }

/* ── sheets ───────────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(57,65,58,.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility 0s .28s;
}

.sheet-backdrop:not(.hidden) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .28s ease, visibility 0s;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  margin: 0 auto; max-width: 480px;
  max-height: 92vh; max-height: 92dvh;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  padding: 14px 24px calc(var(--safe-bottom) + 26px);
  box-shadow: 0 -12px 40px rgba(57,65,58,.16);
  z-index: 100;
  transform: translateY(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.32,.72,0,1), visibility 0s .32s;
}

.sheet:not(.hidden) {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform .32s cubic-bezier(.32,.72,0,1), visibility 0s;
}

.sheet::-webkit-scrollbar { display: none; }
.sheet h3 { font-size: 24px; margin-bottom: 20px; }
.sheet-actions {
  display: flex; gap: 12px;
  position: sticky;
  bottom: calc(-26px - var(--safe-bottom));
  margin: 18px -24px calc(-26px - var(--safe-bottom));
  padding: 12px 24px calc(26px + var(--safe-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
}
.sheet-actions .btn { flex: 1; }

/* segmented controls */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 14px;
  background: var(--cream); color: var(--ink-soft);
  border: 1.5px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: all .15s;
}
.seg button.on { background: var(--leaf-tint); color: var(--leaf-deep); border-color: var(--leaf); }

.custom-interval { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.custom-interval input[type="number"] {
  width: 74px; flex: none;
  font: inherit; font-size: 16px; text-align: center;
  padding: 9px 8px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--cream); color: var(--ink); outline: none;
  -webkit-appearance: none;
}
.custom-interval input[type="number"]:focus { border-color: var(--leaf); background: #fff; }

/* popup menu */
.pop-menu {
  position: fixed; z-index: 120;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  display: flex; flex-direction: column; min-width: 200px;
  animation: pop-in .18s ease both;
}
.pop-menu button {
  font: inherit; font-size: 14.5px; font-weight: 600;
  text-align: left; padding: 11px 14px;
  background: none; border: none; border-radius: 10px;
  color: var(--ink); cursor: pointer;
}
.pop-menu button:active { background: var(--cream-deep); }
.pop-menu button.danger { color: var(--danger); }

/* toast */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 92px);
  display: flex; align-items: center; gap: 16px;
  background: var(--ink); color: var(--cream);
  font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lift);
  z-index: 200;
  animation: toast-in .3s ease both;
  white-space: nowrap;
}
.toast-action {
  font: inherit; font-size: 13.5px; font-weight: 700;
  background: none; border: none; cursor: pointer;
  color: var(--butter); letter-spacing: .02em;
}

/* settings */
.notify-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.notify-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notify-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.notify-copy small { font-size: 13px; line-height: 1.4; color: var(--ink-faint); }
.switch {
  position: relative; flex: none;
  width: 52px; height: 32px;
  border: none; border-radius: 16px;
  background: var(--line);
  cursor: pointer; padding: 0;
  transition: background .2s ease;
}
.switch[aria-checked="true"] { background: var(--leaf); }
.switch:disabled { opacity: .5; cursor: default; }
.switch-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(57,65,58,.28);
  transition: transform .22s cubic-bezier(.32,.72,.25,1);
}
.switch[aria-checked="true"] .switch-thumb { transform: translateX(20px); }
.notify-hint {
  margin-top: 10px; font-size: 13px; line-height: 1.45;
  color: var(--ink-soft); background: var(--butter-tint);
  border-radius: var(--radius-sm); padding: 10px 12px;
}

.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0; border-bottom: 1.5px solid var(--line);
  font-weight: 600; font-size: 15px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row small { color: var(--ink-faint); font-weight: 500; font-size: 13px; display: block; margin-top: 2px; }

/* stats */
.stat-card {
  background: var(--card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px; margin-bottom: 12px;
}
.stat-card h4 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.stat-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.stat-medal { width: 26px; flex: none; text-align: center; font-size: 15px; }
.stat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-val { color: var(--ink-soft); font-weight: 700; font-size: 13px; flex: none; }

/* wishlist */
.wish-card { position: relative; }
.wish-card .wish-actions { display: flex; gap: 6px; padding: 0 13px 12px; }
.wish-btn {
  flex: 1; font: inherit; font-size: 12px; font-weight: 700;
  padding: 8px 6px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--leaf-soft); background: var(--leaf-tint); color: var(--leaf-deep);
}
.wish-btn.remove { border-color: var(--line); background: var(--card); color: var(--ink-faint); }

/* image preview in forms — shrink-wraps the image, no full-width box */
.img-preview {
  display: block; width: fit-content; max-width: 100%;
  border-radius: var(--radius-sm);
  color: var(--ink-faint); font-size: 13px; font-weight: 600;
  cursor: pointer;
}
/* empty state: dashed placeholder box */
.img-preview:has(> span) {
  width: 100%; min-height: 56px;
  display: grid; place-items: center;
  background: var(--cream-deep);
  border: 1.5px dashed var(--line);
  padding: 22px 16px;
}
/* chosen image: the img carries its own border, no box around it */
.img-preview img { display: block; max-width: 100%; max-height: 220px; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-sm); }

.delete-plant {
  width: 100%; margin-top: 16px;
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 13px; border: none; border-radius: 999px;
  background: var(--terra-tint); color: var(--danger);
  cursor: pointer;
}

/* ── animations ───────────────────────────────────────────── */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── loading spinner ── */
.topbar-spinner {
  position: fixed;
  top: calc(var(--safe-top, 0px) + 10px);
  right: 14px;
  z-index: 999;
  background: rgba(255,255,255,.9);
  border-radius: 999px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid var(--line);
  border-top-color: var(--leaf-deep);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-loading {
  opacity: .6;
  pointer-events: none;
}
