/* ==========================================================================
   Colton's Plant Companion — Warm Earth Theme
   Mobile-first botanical garden journal aesthetic
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
  /* Backgrounds */
  --bg-primary: #f5f0e8;
  --bg-secondary: #ede6d8;
  --bg-card: #fffdf8;
  --bg-card-hover: #fff9f0;

  /* Text */
  --text-primary: #2a2018;
  --text-secondary: #7a6a52;
  --text-tertiary: #a89878;

  /* Accents */
  --accent-green: #4a7a38;
  --accent-green-light: #e8f2d8;
  --accent-terracotta: #c06830;
  --accent-terracotta-light: #fae8d8;

  /* Borders & Shadows */
  --border-soft: #e0d8c8;
  --shadow-warm: rgba(80, 60, 30, 0.08);
  --shadow-warm-lg: rgba(80, 60, 30, 0.14);

  /* Pill variants */
  --pill-shade-bg: #d8eef0;
  --pill-shade-text: #1a5a6a;
  --pill-sun-bg: #fef4d8;
  --pill-sun-text: #6a5000;
  --pill-heat-bg: #fde4d8;
  --pill-heat-text: #7a2a10;
  --pill-cool-bg: #d8e4f4;
  --pill-cool-text: #1a3a6a;
  --pill-zone-bg: #ece4f4;
  --pill-zone-text: #3a1870;
  --pill-bee-bg: #fef8e0;
  --pill-bee-text: #6a5000;
  --pill-perennial-bg: #d8f0e0;
  --pill-perennial-text: #0d5a30;
  --pill-annual-bg: #fde8d8;
  --pill-annual-text: #7a2a10;

  /* Tabs */
  --tab-active: var(--accent-terracotta);
  --tab-inactive: #a89878;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-display: swap;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Organic paper texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(120, 90, 40, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(120, 90, 40, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(80, 60, 30, 0.02) 0.5px, transparent 0.5px);
  background-size: 4px 4px, 6px 6px, 3px 3px;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: "Fraunces", "Georgia", serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

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

.scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.scroll-x::-webkit-scrollbar {
  display: none;
}

/* ---------- App Shell ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  overflow: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 var(--space-md);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.app-header h1 {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.app-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ---------- Views & Page Transitions ---------- */
.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-md);
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.view.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.view-scroll {
  min-height: 100%;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.view-title {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.scroll-x {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }

.clickable { cursor: pointer; }
.clickable:hover { opacity: 0.8; }

/* ---------- Buttons: Variants ---------- */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-danger-icon:hover {
  background: var(--pill-heat-bg);
  color: var(--pill-heat-text);
  border-color: var(--pill-heat-text);
}

/* ---------- Zone Card Sub-components ---------- */
.zone-card-name {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.zone-card-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.zone-card-notes {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: 4px;
}

.zone-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.zone-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-soft);
}

.zone-plant-thumb {
  flex-shrink: 0;
  text-align: center;
  width: 68px;
  cursor: pointer;
}

.zone-plant-thumb img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--bg-primary);
  transition: border-color 0.15s;
}

.zone-plant-thumb:hover img {
  border-color: var(--accent-green);
}

.zone-plant-thumb span {
  display: block;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  margin-top: 3px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-card-count {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  padding: var(--space-xs) var(--space-md) var(--space-md);
}

/* ---------- Zone/Planner Pills ---------- */
.zone-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.zone-pill:hover {
  border-color: var(--accent-terracotta);
  color: var(--accent-terracotta);
}

.zone-pill.active {
  background: var(--accent-terracotta);
  border-color: var(--accent-terracotta);
  color: #fff;
}

/* ---------- Tab Bar ---------- */
.tab-bar {
  position: sticky;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(245, 240, 232, 0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  padding: var(--space-sm) 0;
  color: var(--tab-inactive);
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.tab-item.active {
  color: var(--tab-active);
}

.tab-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.tab-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

/* ---------- Search Bar ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.search-bar:focus-within {
  border-color: var(--accent-terracotta);
  box-shadow: 0 0 0 3px var(--accent-terracotta-light);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.search-bar input::placeholder {
  color: var(--text-tertiary);
}

.search-bar svg,
.search-bar .search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ---------- Filter Chips ---------- */
.filter-chips {
  display: flex;
  gap: var(--space-sm);
  padding-bottom: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.filter-chip:hover {
  border-color: var(--accent-terracotta);
  color: var(--accent-terracotta);
}

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

/* ---------- Plant Count ---------- */
.plant-count {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

/* ---------- Plant Grid ---------- */
.plant-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

/* ---------- Plant Card ---------- */
.plant-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow-warm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  cursor: pointer;
  animation: fadeSlideUp 0.5s var(--ease-out) both;
}

.plant-card:nth-child(1) { animation-delay: 0ms; }
.plant-card:nth-child(2) { animation-delay: 60ms; }
.plant-card:nth-child(3) { animation-delay: 120ms; }
.plant-card:nth-child(4) { animation-delay: 180ms; }
.plant-card:nth-child(5) { animation-delay: 240ms; }
.plant-card:nth-child(6) { animation-delay: 300ms; }
.plant-card:nth-child(7) { animation-delay: 360ms; }
.plant-card:nth-child(8) { animation-delay: 420ms; }
.plant-card:nth-child(9) { animation-delay: 480ms; }
.plant-card:nth-child(10) { animation-delay: 540ms; }

.plant-card:hover,
.plant-card:active {
  background: var(--bg-card-hover);
  box-shadow: 0 6px 20px var(--shadow-warm-lg);
  transform: scale(1.01);
}

.plant-card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-secondary);
}

.plant-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.plant-card:hover .plant-card-img img {
  transform: scale(1.04);
}

.plant-card-body {
  padding: var(--space-md);
}

.plant-card-name {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}

.plant-card-latin {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  line-height: 1.5;
}

.plant-card-body .pill {
  margin-right: 4px;
  margin-bottom: 4px;
}

.pill-shade {
  background: var(--pill-shade-bg);
  color: var(--pill-shade-text);
}

.pill-sun {
  background: var(--pill-sun-bg);
  color: var(--pill-sun-text);
}

.pill-heat {
  background: var(--pill-heat-bg);
  color: var(--pill-heat-text);
}

.pill-cool {
  background: var(--pill-cool-bg);
  color: var(--pill-cool-text);
}

.pill-zone {
  background: var(--pill-zone-bg);
  color: var(--pill-zone-text);
}

.pill-bee {
  background: var(--pill-bee-bg);
  color: var(--pill-bee-text);
}

.pill-perennial {
  background: var(--pill-perennial-bg);
  color: var(--pill-perennial-text);
}

.pill-annual {
  background: var(--pill-annual-bg);
  color: var(--pill-annual-text);
}

/* ---------- Bee Badge ---------- */
.bee-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 6px var(--shadow-warm);
  font-size: 1rem;
  line-height: 1;
}

/* ---------- FAB (Floating Action Button) ---------- */
.fab {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  right: var(--space-md);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent-terracotta);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(192, 104, 48, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: fabPulse 2s var(--ease-out) 1s 1;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(192, 104, 48, 0.45);
}

.fab:active {
  transform: scale(0.95);
}

/* ---------- Modal / Bottom Sheet ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(30, 22, 10, 0);
  pointer-events: none;
  transition: background var(--transition-base);
}

.modal-overlay.open {
  background: rgba(30, 22, 10, 0.45);
  pointer-events: auto;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--transition-slow);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

/* Drag handle */
.modal-sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: var(--space-sm) auto var(--space-xs);
  background: var(--border-soft);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.modal-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px var(--shadow-warm);
  font-size: 1.1rem;
  z-index: 10;
  transition: background var(--transition-fast);
}

.modal-close:hover {
  background: #fff;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-lg);
}

.modal-name {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.modal-latin {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.modal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-lg);
}

.modal-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.modal-section {
  margin-bottom: var(--space-lg);
}

.modal-section-title {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.stats-grid > div {
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.stat-value {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Pair / Prop Tags ---------- */
.pair-tag,
.prop-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-right: 6px;
  margin-bottom: 6px;
}

.pair-tag {
  background: var(--accent-green-light);
  color: var(--accent-green);
}

.prop-tag {
  background: var(--accent-terracotta-light);
  color: var(--accent-terracotta);
}

/* ---------- Bee Callout ---------- */
.bee-callout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--pill-bee-bg);
  border-radius: var(--radius-md);
  border-left: 3px solid #daa520;
  font-size: 0.9rem;
  color: var(--pill-bee-text);
  line-height: 1.6;
}

/* ---------- Garden / Zone View ---------- */
.zone-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.zone-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow-warm);
  animation: fadeSlideUp 0.4s var(--ease-out) both;
}

.zone-card-plants {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.zone-card-plants::-webkit-scrollbar {
  display: none;
}

.zone-card-plants img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--bg-primary);
}

.zone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-tertiary);
}

.zone-empty p {
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 260px;
}

/* ---------- Forms ---------- */
.zone-form,
.add-plant-form {
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
}

.add-plant-form {
  position: fixed;
  inset: 0;
  z-index: 210;
  border-radius: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeSlideUp 0.35s var(--ease-out);
}

.form-field {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px var(--space-md);
  font-size: 0.95rem;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-terracotta);
  box-shadow: 0 0 0 3px var(--accent-terracotta-light);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%237a6a52' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-terracotta);
  border: none;
  border-radius: var(--radius-full);
  min-height: 44px;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 2px 8px rgba(192, 104, 48, 0.2);
}

.btn-primary:hover {
  background: #a85828;
  box-shadow: 0 4px 14px rgba(192, 104, 48, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-terracotta);
  background: transparent;
  border: 1.5px solid var(--accent-terracotta);
  border-radius: var(--radius-full);
  min-height: 44px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--accent-terracotta-light);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #a03020;
  background: transparent;
  border: 1.5px solid #d04030;
  border-radius: var(--radius-full);
  min-height: 44px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-danger:hover {
  background: #fde8e4;
  color: #801810;
}

.btn-danger:active {
  transform: scale(0.97);
}

/* ---------- Planner View ---------- */
.zone-selector {
  display: flex;
  gap: var(--space-sm);
  padding-bottom: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.zone-selector::-webkit-scrollbar {
  display: none;
}

.zone-pill {
  flex-shrink: 0;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.zone-pill.active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.planner-section {
  margin-bottom: var(--space-xl);
}

.planner-section-title {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.suggestion-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  margin-bottom: var(--space-sm);
  box-shadow: 0 1px 4px var(--shadow-warm);
  transition: box-shadow var(--transition-fast);
}

.suggestion-card:hover {
  box-shadow: 0 4px 12px var(--shadow-warm-lg);
}

.suggestion-img {
  flex-shrink: 0;
  cursor: pointer;
}

.suggestion-img img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--border-soft);
}

.suggestion-body {
  flex: 1;
  min-width: 0;
}

.suggestion-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 2px;
}

.suggestion-name {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.suggestion-name:hover {
  color: var(--accent-terracotta);
}

.suggestion-latin {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-tertiary);
  margin-bottom: var(--space-xs);
}

.suggestion-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.match-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-pill);
}

.match-badge[data-match="great"],
.match-badge.match-great {
  background: var(--accent-green-light);
  color: var(--accent-green);
}

.match-badge[data-match="good"],
.match-badge.match-good {
  background: var(--pill-sun-bg);
  color: var(--pill-sun-text);
}

.match-badge[data-match="poor"],
.match-badge.match-poor {
  background: var(--pill-heat-bg);
  color: var(--pill-heat-text);
}

.companion-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--accent-green-light);
  color: var(--accent-green);
}

.spacing-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-style: italic;
}

.conflict-warning {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  background: #fef8e0;
  border-left: 3px solid #d4a800;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: #6a5000;
  margin-bottom: var(--space-md);
}

.add-to-zone-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-terracotta);
  border: 1.5px solid var(--accent-terracotta);
  border-radius: var(--radius-full);
  background: transparent;
  transition: all var(--transition-fast);
  min-height: 36px;
  white-space: nowrap;
}

.add-to-zone-btn:hover {
  background: var(--accent-terracotta);
  color: #fff;
}

/* ---------- Explore View ---------- */
.explore-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 16px var(--shadow-warm);
}

.explore-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.explore-hero .explore-hero-content {
  padding: var(--space-lg);
}

.explore-hero h2,
.explore-hero h3,
.explore-hero-title {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.explore-hero-eyebrow {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-terracotta);
  margin-bottom: var(--space-xs);
}

.explore-hero p,
.explore-hero-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.explore-hero-tasks {
  list-style: none;
  padding: 0;
  margin: 0;
}

.explore-hero-tasks li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: var(--space-xs) 0;
  padding-left: 1.2em;
  position: relative;
  line-height: 1.5;
}

.explore-hero-tasks li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--accent-green);
  font-weight: 600;
}

.explore-section {
  margin-bottom: var(--space-xl);
}

.explore-section-title {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.combo-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  margin-bottom: var(--space-sm);
  box-shadow: 0 1px 4px var(--shadow-warm);
}

.combo-plants {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-xs);
}

.combo-plants::-webkit-scrollbar { display: none; }

.combo-name {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.combo-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.combo-plant-thumb {
  flex-shrink: 0;
  text-align: center;
  width: 64px;
  cursor: pointer;
}

.combo-plant-thumb img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--border-soft);
  transition: border-color 0.15s;
}

.combo-plant-thumb:hover img {
  border-color: var(--accent-green);
}

.combo-plant-thumb span {
  display: block;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  margin-top: 3px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  margin-bottom: var(--space-sm);
  box-shadow: 0 1px 4px var(--shadow-warm);
  align-items: center;
}

.discovery-card img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.discovery-info {
  flex: 1;
  min-width: 0;
}

.discovery-name {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.discovery-latin {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.discovery-reason {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.discovery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-xs);
}

.tip-card {
  padding: var(--space-md);
  background: var(--accent-green-light);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-green);
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.tip-category {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-green);
  margin-bottom: 2px;
}

.tip-title {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tip-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pollinator-report {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--pill-bee-bg);
  border-radius: var(--radius-md);
  border: 1px solid #ece0b0;
}

.pollinator-report .stat-label {
  color: var(--pill-bee-text);
}

.pollinator-report .stat-value {
  color: var(--text-primary);
}

/* ---------- Keyframe Animations ---------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fabPulse {
  0% {
    box-shadow: 0 4px 14px rgba(192, 104, 48, 0.35);
  }
  50% {
    box-shadow: 0 4px 28px rgba(192, 104, 48, 0.55), 0 0 0 8px rgba(192, 104, 48, 0.1);
  }
  100% {
    box-shadow: 0 4px 14px rgba(192, 104, 48, 0.35);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ---------- Responsive: 2-column grid at 640px ---------- */
@media (min-width: 640px) {
  .plant-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .view {
    padding: var(--space-lg);
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .modal-sheet {
    max-width: 560px;
    margin: 0 auto;
  }

  .stats-grid {
    gap: var(--space-md);
  }

  .explore-hero h2 {
    font-size: 1.5rem;
  }

  .pollinator-report {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Responsive: 3-column grid at 1024px ---------- */
@media (min-width: 1024px) {
  .plant-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }

  .view {
    padding: var(--space-xl) var(--space-2xl);
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .app-header {
    height: 64px;
  }

  .app-header h1 {
    font-size: 1.3rem;
  }

  .modal-sheet {
    max-width: 640px;
    border-radius: var(--radius-xl);
    margin-bottom: 5vh;
    max-height: 85vh;
  }

  .modal-overlay {
    align-items: center;
  }

  .modal-overlay.open .modal-sheet {
    animation: slideUp 0.4s var(--ease-out);
  }

  .search-bar {
    max-width: 480px;
  }

  .fab {
    right: var(--space-xl);
    width: 64px;
    height: 64px;
    font-size: 1.8rem;
  }

  .zone-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .explore-hero {
    display: flex;
    align-items: stretch;
  }

  .explore-hero img {
    width: 50%;
    aspect-ratio: auto;
  }

  .explore-hero .explore-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-xl);
  }

  .explore-hero h2 {
    font-size: 1.7rem;
  }
}

/* ---------- Accessibility: Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .view {
    transition: none;
  }

  .modal-overlay,
  .modal-sheet {
    transition: none;
  }
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--accent-terracotta);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent-terracotta-light);
  color: var(--text-primary);
}

/* ---------- Scrollbar (non-hidden containers) ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ---------- Planner: Current Plants Grid ---------- */
.current-plants-grid {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  -webkit-overflow-scrolling: touch;
}

.current-plants-grid::-webkit-scrollbar { display: none; }

.current-plant-card {
  flex-shrink: 0;
  width: 100px;
  text-align: center;
  position: relative;
}

.current-plant-card img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--border-soft);
  cursor: pointer;
  transition: border-color 0.2s;
}

.current-plant-card img:hover {
  border-color: var(--accent-green);
}

.current-plant-name {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-plant-btn {
  position: absolute;
  top: -4px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--accent-terracotta);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.current-plant-card:hover .remove-plant-btn {
  opacity: 1;
}

.planner-empty-text {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  padding: var(--space-md) 0;
}

/* ---------- Planner: Browse All Grid ---------- */
.browse-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.browse-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
}

.browse-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.browse-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-row .conflict-warning {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.browse-row .add-to-zone-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 0.7rem;
}

/* ---------- Pollinator Report (app.js classes) ---------- */
.pollinator-stat {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.pollinator-number {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent-green);
  line-height: 1;
}

.pollinator-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pollinator-bar {
  width: 100%;
  height: 10px;
  background: var(--border-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.pollinator-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), #7aba4a);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.pollinator-pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-green);
  letter-spacing: 0.03em;
}
