/* ===== Grow — earthy garden log ===== */

:root {
  /* Earthy palette */
  --bg: oklch(0.965 0.012 85);          /* warm cream */
  --bg-2: oklch(0.945 0.018 80);        /* slightly deeper cream */
  --card: oklch(0.99 0.006 85);         /* near-white card */
  --card-2: oklch(0.96 0.012 85);
  --ink: oklch(0.22 0.03 145);          /* deep moss ink */
  --ink-2: oklch(0.42 0.025 140);       /* secondary text */
  --ink-3: oklch(0.62 0.02 130);        /* tertiary / labels */
  --line: oklch(0.88 0.015 90);
  --line-2: oklch(0.92 0.012 90);

  --moss: oklch(0.36 0.06 145);         /* primary deep green */
  --moss-2: oklch(0.46 0.08 145);
  --moss-soft: oklch(0.92 0.04 145);
  --sage: oklch(0.62 0.10 145);         /* thriving */
  --honey: oklch(0.78 0.13 80);         /* okay */
  --clay: oklch(0.62 0.13 35);          /* struggling */
  --soil: oklch(0.45 0.07 55);          /* warm soil accent */
  --soil-soft: oklch(0.93 0.03 70);

  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(58, 47, 30, 0.04), 0 1px 1px rgba(58, 47, 30, 0.03);
  --shadow:    0 1px 2px rgba(58, 47, 30, 0.05), 0 6px 18px -8px rgba(58, 47, 30, 0.10);
  --shadow-lg: 0 1px 2px rgba(58, 47, 30, 0.05), 0 24px 48px -16px rgba(58, 47, 30, 0.18);

  --font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dusk"] {
  --bg: oklch(0.22 0.018 145);
  --bg-2: oklch(0.26 0.02 145);
  --card: oklch(0.27 0.022 145);
  --card-2: oklch(0.30 0.022 145);
  --ink: oklch(0.95 0.015 90);
  --ink-2: oklch(0.80 0.02 90);
  --ink-3: oklch(0.62 0.02 90);
  --line: oklch(0.34 0.025 145);
  --line-2: oklch(0.32 0.022 145);
  --moss-soft: oklch(0.34 0.04 145);
  --soil-soft: oklch(0.34 0.03 60);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; color: inherit; }

/* ===== Layout ===== */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--moss);
  display: grid; place-items: center;
  color: var(--bg);
}
.brand-name {
  font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 4px;
  padding-top: 2px;
}

.topbar-actions {
  display: flex; align-items: center; gap: 10px;
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: all 120ms ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--moss); background: var(--moss-soft); }

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 120ms ease;
}
.btn:hover { border-color: var(--moss); background: var(--moss-soft); }
.btn-primary {
  background: var(--moss);
  border-color: var(--moss);
  color: oklch(0.98 0.01 90);
}
.btn-primary:hover { background: var(--moss-2); border-color: var(--moss-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--moss-soft); border-color: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

/* ===== Dashboard ===== */

.main {
  flex: 1;
  padding: 32px 28px 80px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}
.hero-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 8px 0;
}
.hero-sub {
  color: var(--ink-2);
  font-size: 15px;
  margin: 0;
  max-width: 460px;
}
.hero-stats {
  display: flex; gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 88px;
}
.stat-num {
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 36px 0 16px;
}
.section-head:first-child { margin-top: 0; }
.section-title {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0;
}
.section-title h2 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  margin: 0;
}
.section-title .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
}
.section-title-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--moss-soft);
  color: var(--moss);
  display: grid; place-items: center;
  margin-right: 4px;
  position: relative;
  top: 4px;
}

/* ===== Plant grid ===== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.grid.dense {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.plant-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 180ms cubic-bezier(.2,.7,.2,1), box-shadow 180ms ease, border-color 180ms ease;
  display: flex; flex-direction: column;
  cursor: pointer;
}
.plant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklch, var(--moss) 30%, var(--line));
}

.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--moss-soft);
}
.thumb-label {
  position: absolute; left: 10px; bottom: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.18);
  padding: 3px 6px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}
.health-pill {
  position: absolute; top: 10px; left: 10px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 252, 245, 0.92);
  backdrop-filter: blur(6px);
  padding: 4px 9px 4px 7px;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 500;
  color: oklch(0.22 0.02 145);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.dot {
  width: 7px; height: 7px;
  border-radius: 99px;
  display: inline-block;
}
.dot.thriving { background: var(--sage); box-shadow: 0 0 0 3px color-mix(in oklch, var(--sage) 25%, transparent); }
.dot.okay { background: var(--honey); box-shadow: 0 0 0 3px color-mix(in oklch, var(--honey) 25%, transparent); }
.dot.struggling { background: var(--clay); box-shadow: 0 0 0 3px color-mix(in oklch, var(--clay) 25%, transparent); }

.card-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 12px;
  flex: 1;
}
.plant-name {
  font-size: 16.5px; font-weight: 600; letter-spacing: -0.012em;
  margin: 0;
  line-height: 1.2;
}
.plant-species {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  font-style: italic;
  letter-spacing: 0.01em;
  margin: 3px 0 0 0;
}
.water-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.water-label {
  display: flex; align-items: center; gap: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
}
.water-label .drop {
  color: oklch(0.6 0.10 235);
}
.water-label .urgent { color: var(--clay); font-weight: 500; }

.btn-water {
  background: var(--moss-soft);
  border: 1px solid color-mix(in oklch, var(--moss) 20%, transparent);
  color: var(--moss);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 120ms ease;
}
.btn-water:hover {
  background: var(--moss);
  color: oklch(0.98 0.01 90);
  border-color: var(--moss);
}
.btn-water.just-watered {
  background: oklch(0.85 0.10 235);
  color: oklch(0.25 0.07 235);
  border-color: oklch(0.7 0.10 235);
}

/* ===== Profile page ===== */

.profile {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 80px;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  background: none; border: none;
  padding: 6px 10px 6px 4px;
  border-radius: 8px;
  margin-bottom: 18px;
  transition: all 120ms ease;
}
.back-link:hover { color: var(--moss); background: var(--moss-soft); }

.profile-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.profile-title h1 {
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.05;
}
.profile-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 12px;
  align-items: center;
}
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.profile-actions {
  display: flex; gap: 8px;
  flex-wrap: wrap;
}

/* Timeline filmstrip */
.timeline {
  margin-bottom: 28px;
}
.timeline-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.timeline-title {
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.filmstrip {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 16px 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.filmstrip::-webkit-scrollbar { height: 8px; }
.filmstrip::-webkit-scrollbar-track { background: transparent; }
.filmstrip::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.film {
  flex: 0 0 200px;
  scroll-snap-align: start;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 150ms ease;
  cursor: pointer;
}
.film:hover { transform: translateY(-2px); }
.film-img {
  width: 100%; aspect-ratio: 1 / 1;
  position: relative;
}
.film-meta {
  padding: 8px 10px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.film-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.film-mini-dot {
  width: 6px; height: 6px;
  border-radius: 99px;
}
.film.add {
  display: grid; place-items: center;
  border-style: dashed;
  color: var(--ink-3);
  cursor: pointer;
  background: var(--card-2);
  min-height: 200px;
}
.film.add:hover { border-color: var(--moss); color: var(--moss); }
.film.add-inner {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Profile two-column */
.profile-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
}
@media (max-width: 880px) {
  .profile-cols { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.panel-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 9px;
  margin: 0;
}
.panel-title .ico {
  color: var(--moss);
}

/* Health log */
.log-entries {
  display: flex; flex-direction: column;
  gap: 0;
}
.log-entry {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px dashed var(--line);
}
.log-entry:first-child { border-top: none; padding-top: 4px; }
.log-marker {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 4px;
}
.log-marker .dot { width: 10px; height: 10px; }
.log-marker .line {
  flex: 1;
  width: 1px;
  background: var(--line);
  margin-top: 6px;
  min-height: 12px;
}
.log-entry:last-child .line { display: none; }
.log-content {}
.log-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.log-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.log-status {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.01em;
}
.log-status.thriving { color: var(--sage); }
.log-status.okay { color: var(--honey); }
.log-status.struggling { color: var(--clay); }
.log-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}

.log-add {
  margin-top: 14px;
  display: flex; gap: 8px;
}
.log-add textarea {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  min-height: 40px;
  resize: vertical;
  outline: none;
}
.log-add textarea:focus { border-color: var(--moss); }
.log-add-row {
  display: flex; gap: 8px;
  margin-top: 8px;
  justify-content: space-between;
  align-items: center;
}
.status-picker {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.status-picker button {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 5px;
}
.status-picker button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Water calendar */
.cal-summary {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.streak-num {
  font-size: 32px; font-weight: 600; letter-spacing: -0.025em;
  line-height: 1;
  color: oklch(0.5 0.13 235);
}
.streak-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.cal-meta {
  text-align: right;
  font-size: 13px;
  color: var(--ink-2);
}
.cal-meta strong { color: var(--ink); font-weight: 600; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding-bottom: 6px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  position: relative;
  transition: all 120ms ease;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.watered {
  background: color-mix(in oklch, oklch(0.6 0.10 235) 30%, var(--bg));
  border-color: color-mix(in oklch, oklch(0.6 0.10 235) 50%, var(--line));
  color: oklch(0.3 0.10 235);
}
.cal-cell.watered.heavy {
  background: oklch(0.55 0.12 235);
  border-color: oklch(0.45 0.12 235);
  color: oklch(0.98 0.02 235);
}
.cal-cell.today {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}
.cal-cell.future { opacity: 0.4; }

.cal-legend {
  display: flex; gap: 12px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  justify-content: flex-end;
  align-items: center;
}
.cal-legend .swatches { display: flex; gap: 3px; }
.cal-legend .sw {
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 1px solid var(--line-2);
}

/* AI Assessment */
.ai-panel {
  background: linear-gradient(135deg,
    color-mix(in oklch, var(--moss) 6%, var(--card)),
    var(--card) 60%);
  border: 1px solid color-mix(in oklch, var(--moss) 20%, var(--line));
}
.ai-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.ai-title-wrap {
  display: flex; gap: 12px;
  align-items: flex-start;
}
.ai-badge {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--moss);
  color: oklch(0.96 0.02 90);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ai-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.ai-sub {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
  max-width: 520px;
  line-height: 1.45;
}

.ai-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}
@media (max-width: 700px) {
  .ai-body { grid-template-columns: 1fr; }
}
.ai-upload {
  display: flex; flex-direction: column; gap: 8px;
}
.ai-upload image-slot {
  width: 100%;
  aspect-ratio: 1 / 1;
  --is-radius: 14px;
  --is-bg: var(--bg-2);
  --is-border: 1.5px dashed color-mix(in oklch, var(--moss) 30%, var(--line));
  --is-color: var(--moss);
}
.ai-upload-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.ai-result {
  display: flex; flex-direction: column;
}
.ai-result-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.ai-diagnosis {
  font-weight: 600;
  font-size: 15px;
}
.ai-confidence {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--bg-2);
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}
.ai-suggestions {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px;
}
.ai-sug {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--card-2);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.ai-sug-ico {
  width: 22px; height: 22px;
  background: var(--moss-soft);
  color: var(--moss);
  border-radius: 6px;
  display: grid; place-items: center;
  margin-top: 1px;
}
.ai-sug-title {
  font-weight: 600;
  font-size: 13.5px;
  margin: 0 0 2px;
}
.ai-sug-body {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.45;
}
.ai-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  padding: 20px;
  letter-spacing: 0.03em;
  line-height: 1.6;
}
.ai-loading {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 140px;
  justify-content: center;
}
.ai-shimmer {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line-2), var(--bg-2), var(--line-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.ai-shimmer.w-50 { width: 50%; }
.ai-shimmer.w-80 { width: 80%; }
.ai-shimmer.w-65 { width: 65%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Photo Uploader ===== */
.uploader {
  position: relative;
  width: 100%;
  border-radius: 14px;
  border: 1.5px dashed color-mix(in oklch, var(--moss) 30%, var(--line));
  background: var(--bg-2);
  color: var(--moss);
  display: grid; place-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 150ms ease;
}
.uploader:hover { background: var(--moss-soft); border-color: var(--moss); }
.uploader.dragging {
  background: var(--moss-soft);
  border-color: var(--moss);
  transform: scale(1.01);
}
.uploader.has-image { border-style: solid; border-color: var(--line); background: var(--card); }
.uploader img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.uploader-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  padding: 12px;
}
.uploader-empty > span:first-of-type {
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  margin-top: 4px;
}
.uploader-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.uploader-clear {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.uploader-clear:hover { background: rgba(0,0,0,0.8); }

/* ===== Add Plant modal ===== */

.modal-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in oklch, oklch(0.2 0.03 145) 50%, transparent);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 60;
  padding: 20px;
  animation: fadeIn 180ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.modal {
  background: var(--bg);
  border-radius: 22px;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  animation: slideUp 220ms cubic-bezier(.2,.7,.2,1);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 0;
}
.modal-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.modal-body {
  padding: 18px 24px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.field input, .field textarea {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color 120ms ease;
}
.field input:focus, .field textarea:focus { border-color: var(--moss); }
.field textarea { resize: vertical; min-height: 70px; }

.seg {
  display: inline-flex;
  background: var(--card-2);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  width: fit-content;
}
.seg button {
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 7px;
  transition: all 120ms ease;
}
.seg button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.modal-upload {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  border: 1.5px dashed var(--line);
  background: var(--card-2);
  display: grid; place-items: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 150ms ease;
  position: relative;
  overflow: hidden;
}
.modal-upload:hover { border-color: var(--moss); color: var(--moss); }
.modal-upload .upload-preview {
  position: absolute; inset: 0;
}
.modal-actions {
  display: flex; gap: 8px;
  justify-content: flex-end;
  padding-top: 8px;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
  animation: slideUp 220ms cubic-bezier(.2,.7,.2,1);
}

/* Empty section state */
.empty-section {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--card-2);
  text-align: center;
}
.empty-section-title {
  font-size: 15px; font-weight: 500;
  color: var(--ink-2);
}
.empty-section-hint {
  font-size: 13px; color: var(--ink-3);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Filter chips */
.chips {
  display: flex; gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 120ms ease;
}
.chip:hover { border-color: var(--moss); color: var(--moss); }
.chip.active {
  background: var(--moss);
  color: oklch(0.98 0.02 90);
  border-color: var(--moss);
}

/* ===== Card next-action hint ===== */
.card-next-action {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
  display: flex; align-items: flex-start; gap: 5px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line-2);
}
.card-next-action svg { flex-shrink: 0; margin-top: 2px; color: var(--moss); }

.card-care {
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--ink-3);
  font-family: var(--font-mono);
}
.card-care span { display: flex; align-items: center; gap: 3px; }

/* ===== Care Guide panel ===== */
.care-facts {
  display: flex; flex-direction: column;
  gap: 11px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 16px;
}
.care-fact {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px;
}
.care-fact-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  flex-shrink: 0;
}
.care-fact-val {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}
.next-action { display: flex; flex-direction: column; gap: 8px; }
.next-action-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.next-action-text:hover { border-color: var(--moss); background: var(--moss-soft); }
.next-action-text.empty { color: var(--ink-3); font-style: italic; }
.next-action-input {
  border: 1px solid var(--moss);
  background: var(--card);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 22, 18, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out;
  animation: lb-in 0.15s ease;
}
@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-img {
  max-width: min(92vw, 900px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  cursor: default;
  user-select: none;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 20px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 99px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 99px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-nav:disabled { opacity: 0.25; pointer-events: none; }
.lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}
.film.has-photo { cursor: zoom-in; }
.film.has-photo:hover .film-img { opacity: 0.88; }

@media (max-width: 640px) {
  .topbar { padding: 14px 18px; }
  .main, .profile { padding-left: 18px; padding-right: 18px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-stats { justify-content: flex-start; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .film { flex: 0 0 160px; }
}
