/* ============================================================
   Garden Guru — Mobile App CSS
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}

/* --- CSS Variables --- */
:root {
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --primary-light: #C8E6C9;
  --secondary: #8BC34A;
  --accent: #FFEB3B;
  --accent-dark: #F9A825;
  --surface: #ffffff;
  --surface-2: #f8faf8;
  --bg: #f1f5f1;
  --text-primary: #1a2e1a;
  --text-secondary: #5a6e5a;
  --text-hint: #9aaa9a;
  --divider: #e8f0e8;
  --danger: #f44336;
  --danger-light: #ffebee;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.12);
  --shadow-md: 0 3px 10px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.15), 0 4px 10px rgba(0,0,0,.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --top-bar: 56px;
  --bottom-nav: 62px;
  --transition: 280ms cubic-bezier(.4,0,.2,1);
}

/* --- App Structure --- */
.app-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--top-bar);
  background: var(--surface);
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px 0 4px;
  box-shadow: 0 1px 0 var(--divider), var(--shadow-sm);
}
.app-bar-title {
  flex: 1; text-align: center;
  font-size: 18px; font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -.3px;
}
.app-bar-actions { display: flex; gap: 0; }

.main-content {
  position: fixed;
  top: var(--top-bar); bottom: var(--bottom-nav);
  left: 0; right: 0;
  overflow: hidden;
}
.main-content.search-open { top: calc(var(--top-bar) + 56px); }

/* --- Search Bar --- */
.search-bar-container {
  position: fixed;
  top: var(--top-bar); left: 0; right: 0; z-index: 99;
  background: var(--surface);
  padding: 8px 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,.06);
  transform: translateY(-100%);
  transition: transform var(--transition);
}
.search-bar-container.visible { transform: translateY(0); }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border-radius: 24px;
  padding: 8px 12px;
}
.search-bar input {
  flex: 1; border: none; background: transparent;
  font-size: 15px; color: var(--text-primary); outline: none;
}
.search-bar svg { color: var(--text-hint); flex-shrink: 0; }

/* --- Screens --- */
.screen {
  position: absolute; inset: 0;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateX(30px);
  transition: opacity var(--transition), transform var(--transition);
}
.screen.active {
  opacity: 1; pointer-events: all;
  transform: translateX(0);
}
.screen-scroll {
  height: 100%; overflow-y: auto;
  padding: 12px 12px 20px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.drawer-screen { background: var(--bg); }

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bottom-nav);
  background: var(--surface);
  display: flex; align-items: center;
  box-shadow: 0 -1px 0 var(--divider), 0 -2px 8px rgba(0,0,0,.06);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 6px 4px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-hint);
  transition: color var(--transition);
  min-height: 44px; position: relative; overflow: hidden;
}
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon svg { stroke: var(--primary); }
.nav-icon { transition: transform var(--transition); }
.nav-item.active .nav-icon { transform: translateY(-2px); }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: .3px; }

/* --- Drawer --- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.visible { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 201;
  width: 280px; background: var(--surface);
  transform: translateX(-100%);
  transition: transform var(--transition);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 48px 20px 24px;
}
.drawer-logo { display: flex; align-items: center; gap: 12px; }
.drawer-logo-icon { font-size: 36px; }
.drawer-title { font-size: 20px; font-weight: 700; color: white; }
.drawer-subtitle { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 2px; }

.drawer-section-label {
  padding: 16px 20px 4px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-hint);
}
.drawer-nav { list-style: none; padding: 0 8px; }
.drawer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-primary);
  font-size: 15px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}
.drawer-item:hover, .drawer-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.drawer-item-icon { color: var(--text-secondary); display: flex; }
.drawer-item.active .drawer-item-icon { color: var(--primary); }
.drawer-divider { height: 1px; background: var(--divider); margin: 8px 16px; }

/* --- Buttons --- */
.icon-btn {
  width: 44px; height: 44px; border: none; background: transparent;
  border-radius: 50%; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition);
  position: relative; overflow: hidden;
}
.icon-btn:hover { background: rgba(0,0,0,.06); }
.icon-btn-sm {
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: 50%; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-secondary); transition: background var(--transition);
}
.icon-btn-sm:hover { background: rgba(0,0,0,.06); }
.text-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--primary);
  padding: 4px 8px; border-radius: 6px;
}
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border: none; border-radius: 25px;
  background: var(--primary); color: white;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border: 2px solid var(--divider); border-radius: 25px;
  background: transparent; color: var(--text-primary);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background var(--transition);
  position: relative; overflow: hidden;
}
.btn-secondary:hover { background: var(--bg); }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: 2px solid var(--primary); border-radius: 25px;
  background: transparent; color: var(--primary);
  font-size: 14px; font-weight: 600; cursor: pointer; flex: 1;
  position: relative; overflow: hidden;
}
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: 25px;
  background: var(--danger); color: white;
  font-size: 14px; font-weight: 600; cursor: pointer; flex: 1;
  position: relative; overflow: hidden;
}
.btn-danger-sm {
  padding: 6px 14px; border: none; border-radius: 16px;
  background: var(--danger); color: white;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.w-full { width: 100%; margin-top: 8px; }

/* FAB */
.fab {
  position: fixed; bottom: calc(var(--bottom-nav) - 12px); right: 20px;
  width: 56px; height: 56px; border: none; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 4px 20px rgba(76,175,80,.45);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: white; z-index: 98;
  transition: transform 220ms cubic-bezier(.4,0,.2,1), box-shadow 220ms cubic-bezier(.4,0,.2,1);
  font-size: 24px;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(76,175,80,.5);
}
.fab:active {
  transform: scale(0.95);
}
.fab.fab-hidden {
  transform: scale(0) !important;
  opacity: 0;
  pointer-events: none;
}
.fab .material-icons-round {
  font-size: 26px;
}

/* Ripple */
.ripple { position: relative; overflow: hidden; }
.ripple::after {
  content: ''; position: absolute;
  width: 200%; height: 200%;
  top: -50%; left: -50%;
  background: rgba(255,255,255,.3);
  border-radius: 50%; transform: scale(0);
  opacity: 0; pointer-events: none;
}
.ripple:active::after { transform: scale(1); opacity: 1; transition: transform .3s, opacity .3s; }

/* --- Cards & Sections --- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px 8px;
}
.section-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

/* Stats Row */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 10px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-icon { font-size: 22px; margin-bottom: 6px; border-radius: 10px; padding: 6px; display: inline-block; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 10px; font-weight: 600; color: var(--text-hint); margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }

/* AI Tip Card */
.ai-tip-card {
  background: linear-gradient(135deg, #f0fdf0, #e8f5e9);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md); padding: 14px 16px;
  margin-bottom: 4px; position: relative;
}
.ai-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  letter-spacing: .5px; text-transform: uppercase;
  margin-bottom: 8px;
}
.ai-tip-content { font-size: 14px; line-height: 1.6; color: var(--text-primary); }
.retry-btn {
  margin-top: 8px; border: none; background: transparent;
  color: var(--primary); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0;
}
.retry-btn.hidden { display: none; }

/* AI Action Bar */
.ai-action-bar { padding: 4px 0 8px; }
.ai-action-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: none; border-radius: 25px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 10px rgba(76,175,80,.3);
  position: relative; overflow: hidden;
}

/* AI Result Card */
.ai-result-card {
  background: var(--surface); border: 1px solid var(--primary-light);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.ai-result-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ai-result-body {
  font-size: 14px; line-height: 1.7; color: var(--text-primary);
  white-space: pre-wrap;
}
.ai-result-body strong { color: var(--primary-dark); }

/* Quick Actions */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.quick-action-btn {
  background: var(--surface); border: none; border-radius: var(--radius-md);
  padding: 14px 8px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 6px; box-shadow: var(--shadow-sm);
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.quick-action-btn:active { transform: scale(.96); }
.qa-icon { font-size: 22px; }

/* Plant Cards */
.plants-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.plant-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.plant-card:active { transform: scale(.98); box-shadow: none; }
.plant-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0; overflow: hidden;
}
.plant-avatar img { width: 100%; height: 100%; object-fit: cover; }
.plant-card-info { flex: 1; min-width: 0; }
.plant-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.plant-card-species { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.plant-card-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; background: var(--primary-light);
  color: var(--primary-dark);
}
.tag.warning { background: #fff3e0; color: #e65100; }
.tag.danger { background: #ffebee; color: #c62828; }
.plant-card-chevron { color: var(--text-hint); }

/* Recent Plants (Dashboard) */
.recent-plants-list { display: flex; flex-direction: column; gap: 8px; }
.recent-plant-row {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform var(--transition);
}
.recent-plant-row:active { transform: scale(.98); }
.recent-plant-icon { font-size: 20px; }
.recent-plant-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.recent-plant-date { font-size: 11px; color: var(--text-hint); }

/* Watering List */
.watering-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.watering-row {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-sm);
}
.watering-row-icon { font-size: 18px; }
.watering-row-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.watering-row-due { font-size: 12px; font-weight: 600; color: #1565C0; background: #e3f2fd; padding: 3px 8px; border-radius: 12px; }
.watering-row-due.overdue { color: var(--danger); background: var(--danger-light); }

/* Filter Chips */
.filter-chips { display: flex; gap: 8px; padding: 8px 0 12px; overflow-x: auto; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; padding: 7px 16px;
  border: 2px solid var(--divider); border-radius: 20px;
  background: var(--surface); color: var(--text-secondary);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.chip.active {
  background: var(--primary); border-color: var(--primary);
  color: white;
}

/* Tips List */
.tips-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.tip-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 16px; box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
}
.tip-card-season {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--primary); margin-bottom: 6px;
}
.tip-card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.tip-card-body { font-size: 13px; line-height: 1.6; color: var(--text-secondary); }

/* Plant Suggestion Cards */
.suggestion-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.suggestion-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.suggestion-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.suggestion-btn {
  padding: 7px 14px; border: none; border-radius: 20px;
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 12px; font-weight: 600; cursor: pointer;
}

/* Garden Journal */
.journal-add-btn-container { padding: 12px 0; }
.journal-entries-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.journal-entry-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--secondary);
}
.journal-entry-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; flex-wrap: wrap; gap: 8px;
}
.journal-date { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-hint); letter-spacing: .5px; }
.journal-plant { font-size: 13px; font-weight: 700; color: var(--primary); }
.journal-entry-content { font-size: 14px; line-height: 1.6; color: var(--text-primary); margin-bottom: 8px; white-space: pre-wrap; }
.journal-milestone {
  display: inline-block; padding: 6px 12px; border-radius: 16px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: white; font-size: 12px; font-weight: 700; margin-bottom: 10px;
}
.journal-entry-actions { display: flex; gap: 8px; margin-top: 10px; }
.journal-edit-btn, .journal-delete-btn {
  padding: 6px 12px; border: none; border-radius: 16px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.journal-edit-btn {
  background: var(--primary-light); color: var(--primary-dark);
}
.journal-delete-btn {
  background: var(--danger-light); color: var(--danger);
}

/* --- Charts --- */
.chart-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 4px; box-shadow: var(--shadow-sm);
}
.chart-svg { width: 100%; height: 160px; display: block; }
.chart-bar { fill: var(--primary); rx: 4; }
.chart-bar-bg { fill: var(--bg); }
.chart-label { font-size: 9px; fill: var(--text-hint); font-family: 'Inter', sans-serif; }
.chart-value { font-size: 9px; fill: var(--text-primary); font-family: 'Inter', sans-serif; font-weight: 600; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.chart-dot { fill: var(--primary); }

.hbar-chart { display: flex; flex-direction: column; gap: 10px; }
.hbar-item { display: flex; align-items: center; gap: 10px; }
.hbar-label { width: 80px; font-size: 12px; color: var(--text-secondary); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { flex: 1; height: 20px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 10px; transition: width .6s ease; }
.hbar-count { font-size: 12px; font-weight: 700; color: var(--text-primary); width: 24px; }

.donut-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-svg { width: 160px; height: 160px; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-label { font-size: 12px; color: var(--text-secondary); }
.legend-val { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-left: auto; }

/* Adherence */
.adherence-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.adherence-item { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-sm); }
.adherence-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.progress-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width .6s ease; }
.adherence-pct { font-size: 12px; font-weight: 700; color: var(--primary); margin-top: 4px; text-align: right; }

/* --- Chat --- */
.chat-container { display: flex; flex-direction: column; height: 100%; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.chat-bubble { display: flex; flex-direction: column; max-width: 85%; }
.chat-bubble.user { align-self: flex-end; align-items: flex-end; }
.chat-bubble.assistant { align-self: flex-start; align-items: flex-start; }
.bubble-content {
  padding: 10px 14px; border-radius: 18px;
  font-size: 14px; line-height: 1.6;
}
.chat-bubble.user .bubble-content {
  background: var(--primary); color: white;
  border-bottom-right-radius: 4px;
}
.chat-bubble.assistant .bubble-content {
  background: var(--surface); color: var(--text-primary);
  border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm);
}
.bubble-time { font-size: 10px; color: var(--text-hint); margin-top: 4px; padding: 0 4px; }

.chat-typing {
  display: flex; align-items: center; gap: 4px; padding: 10px 14px;
  background: var(--surface); border-radius: 18px; border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm); width: fit-content;
}
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-hint); animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

.chat-input-area {
  border-top: 1px solid var(--divider);
  background: var(--surface); padding: 10px 12px;
}
.chat-input-row { display: flex; gap: 8px; align-items: center; }
.chat-input-row input {
  flex: 1; padding: 10px 16px; border: 2px solid var(--divider);
  border-radius: 25px; font-size: 14px; outline: none;
  background: var(--bg); color: var(--text-primary);
  transition: border-color var(--transition);
}
.chat-input-row input:focus { border-color: var(--primary); background: white; }
.chat-send-btn {
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: var(--primary); color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(76,175,80,.4);
  position: relative; overflow: hidden;
}

/* --- Forms --- */
.form-field { position: relative; margin-bottom: 20px; }
.form-input {
  width: 100%; padding: 16px 14px 6px;
  border: 2px solid var(--divider); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text-primary);
  background: var(--surface); outline: none;
  font-family: inherit;
  transition: border-color var(--transition);
  appearance: none;
}
.form-input:focus { border-color: var(--primary); }
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: 7px; font-size: 11px; color: var(--primary);
}
select.form-input + .form-label {
  top: 7px; font-size: 11px; color: var(--text-hint);
}
select.form-input:focus + .form-label {
  color: var(--primary);
}
.form-label {
  position: absolute; top: 14px; left: 14px;
  font-size: 15px; color: var(--text-hint);
  pointer-events: none; transition: all var(--transition);
  background: var(--surface); padding: 0 2px;
}
.form-textarea { min-height: 88px; resize: none; padding-top: 20px; }
.form-error { display: block; font-size: 12px; color: var(--danger); margin-top: 4px; padding-left: 4px; min-height: 16px; }
.form-input.error { border-color: var(--danger); }

/* AI Suggestion in Form */
.ai-suggestion-bar {
  background: #f0fdf0; border: 1px solid var(--primary-light);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px;
}
.ai-suggestion-content { font-size: 13px; color: var(--text-primary); margin-top: 8px; line-height: 1.6; }
.ai-suggest-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: 2px solid var(--primary); border-radius: 20px;
  background: transparent; color: var(--primary);
  font-size: 13px; font-weight: 600; cursor: pointer; margin-bottom: 16px;
  position: relative; overflow: hidden;
}

/* Icon Picker */
.icon-picker {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px; margin-bottom: 16px; padding: 12px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.icon-option {
  aspect-ratio: 1; border: 2px solid var(--divider);
  border-radius: var(--radius-sm); background: var(--surface);
  font-size: 28px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all var(--transition);
  position: relative;
  color: inherit; line-height: 1; padding: 0;
}
.icon-option:hover {
  border-color: var(--primary); transform: scale(1.05);
}
.icon-option.selected {
  border-color: var(--primary); background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

/* --- Modals & Bottom Sheets --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end;
  justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal-overlay.hidden { display: none; }

.bottom-sheet {
  width: 100%; max-width: 480px; max-height: 92vh;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform var(--transition);
}
.modal-overlay.visible .bottom-sheet { transform: translateY(0); }
.tall-sheet { max-height: 96vh; }
.sheet-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--divider); margin: 12px auto 0;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
}
.sheet-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.sheet-body { padding: 8px 16px 16px; overflow-y: auto; max-height: calc(92vh - 80px); }
.tall-sheet .sheet-body { max-height: calc(96vh - 80px); }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }

/* Confirm Dialog */
.confirm-dialog {
  background: var(--surface); border-radius: var(--radius-xl);
  padding: 28px 24px; width: calc(100% - 48px); max-width: 320px;
  text-align: center; align-self: center;
  transform: scale(.85); opacity: 0;
  transition: transform var(--transition), opacity var(--transition);
}
.modal-overlay.visible .confirm-dialog { transform: scale(1); opacity: 1; }
.confirm-icon { font-size: 40px; margin-bottom: 12px; }
.confirm-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.confirm-msg { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* Plant Detail */
.plant-detail-image {
  width: 100%; height: 160px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 60px; margin-bottom: 16px; overflow: hidden;
}
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.detail-info-item { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; }
.detail-info-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-hint); margin-bottom: 4px; }
.detail-info-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.detail-notes { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; }

/* --- Settings --- */
.settings-section { margin-bottom: 20px; }
.settings-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-hint); margin-bottom: 10px; }
.settings-hint { font-size: 12px; color: var(--text-hint); line-height: 1.5; margin-top: -8px; margin-bottom: 16px; padding: 0 4px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--divider); }

/* --- Snackbar --- */
.snackbar {
  position: fixed; bottom: calc(var(--bottom-nav) + 12px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: #323232; color: white;
  padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
  white-space: nowrap; max-width: calc(100vw - 32px);
}
.snackbar.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Skeleton Loading --- */
.skeleton-lines { display: flex; flex-direction: column; gap: 8px; }
.skeleton-line {
  height: 14px; background: linear-gradient(90deg, #e8f0e8 25%, #d4e8d4 50%, #e8f0e8 75%);
  background-size: 200% 100%; border-radius: 7px;
  animation: shimmer 1.5s infinite;
}
.skeleton-line.short { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; gap: 12px; align-items: center;
}
.skeleton-avatar { width: 52px; height: 52px; border-radius: 14px; background: #e8f0e8; flex-shrink: 0; animation: shimmer 1.5s infinite; background-size: 200% 100%; background-image: linear-gradient(90deg, #e8f0e8 25%, #d4e8d4 50%, #e8f0e8 75%); }
.skeleton-info { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* --- AI Loading Spinner --- */
.ai-spinner {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-hint); font-size: 13px; padding: 4px 0;
}
.spinner-ring {
  width: 18px; height: 18px; border: 2px solid var(--divider);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Empty States --- */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 24px; text-align: center;
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.empty-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }

/* --- Utility --- */
.hidden { display: none !important; }
