/* ═══════════════════════════════════════════════════════════
   AetherGarden v2.0 — De tuin waarin alles tot leven komt
   Design System & Styles
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   Cozy 3D Color Tokens — pastel-natuurlijk · golden-hour · warm
   ═══════════════════════════════════════════════════════════ */
:root {
  /* ── Palet: kernkleuren (licht / basis / donker) ── */
  --sage-light:        #c5d4c0;
  --sage:              #8faf88;
  --sage-dark:         #5f7d5a;
  --moss-light:        #a8bd9a;
  --moss:              #6f8f5e;
  --moss-dark:         #4a6340;
  --olive-light:       #c9c79a;
  --olive:             #9b9a5f;
  --olive-dark:        #6d6c3e;
  --brown-light:       #c4a888;
  --brown:             #9c7a55;
  --brown-dark:        #6d543a;
  --cream-light:       #faf6ec;
  --cream:             #f2ead8;
  --cream-dark:        #e3d7bf;
  --yellow-light:      #f5e3a8;
  --yellow:            #e8c766;
  --yellow-dark:       #c79f3c;
  --peach-light:       #f8d9c0;
  --peach:             #f0b48c;
  --peach-dark:        #d68a5c;
  --lavender-light:    #ddd3e8;
  --lavender:          #b9a8cf;
  --lavender-dark:     #8d7aa6;
  --terracotta-light:  #e6b59a;
  --terracotta:        #c97e5a;
  --terracotta-dark:   #9e5a3c;

  /* ── Warme neutralen (tekst & aarde, nooit puur zwart/grijs) ── */
  --ink:               #3a342a;
  --ink-muted:         #7a7060;
  --ink-light:         #a89c88;

  /* ── Semantische app-tokens (bestaande namen behouden) ── */
  --color-bg:          var(--cream);
  --color-bg-card:     #fffdf7;
  --color-bg-elevated: var(--cream-light);
  --color-text:        var(--ink);
  --color-text-muted:  var(--ink-muted);
  --color-text-light:  var(--ink-light);
  --color-border:      var(--cream-dark);
  --color-border-light:#ece2cf;

  --color-primary:       var(--sage);
  --color-primary-dark:  var(--sage-dark);
  --color-primary-light: var(--sage-light);
  --color-secondary:     var(--brown);
  --color-accent:        var(--yellow);

  --color-success:       var(--moss-dark);
  --color-success-light: var(--moss-light);
  --color-warning:       var(--yellow-dark);
  --color-warning-light: var(--yellow-light);
  --color-danger:        var(--terracotta-dark);
  --color-danger-light:  var(--terracotta-light);
  --color-info:          var(--lavender-dark);
  --color-info-light:    var(--lavender-light);

  /* Tuin-specifiek */
  --color-soil:        var(--brown);
  --color-soil-dark:   var(--brown-dark);
  --color-kas:         rgba(189, 214, 226, 0.30);
  --color-kas-border:  #aac4d0;

  /* ── Gradients ── */
  --gradient-sky:   linear-gradient(180deg, #fbf3df 0%, #f7e9cf 45%, #f6d9bd 100%);
  --gradient-soil:  linear-gradient(180deg, #ab8762 0%, #8c6a48 55%, #6d543a 100%);
  --gradient-grass: linear-gradient(170deg, #a6c39c 0%, #8faf88 50%, #6f8f5e 100%);
  --gradient-sun-glow: radial-gradient(circle at 50% 40%,
                       rgba(248,230,168,0.95) 0%,
                       rgba(240,200,140,0.55) 35%,
                       rgba(240,180,140,0.18) 65%,
                       rgba(240,180,140,0) 100%);
  --gradient-card:  linear-gradient(160deg, #faf6ec 0%, #f2ead8 100%);

  /* ── Schaduwen: warm getint (58,42,28), gelaagd, soft 3D ── */
  --shadow-xs:    0 1px 2px rgba(58,42,28,0.06);
  --shadow-sm:    0 1px 2px rgba(58,42,28,0.07), 0 2px 4px rgba(58,42,28,0.05);
  --shadow-md:    0 2px 4px rgba(58,42,28,0.08), 0 6px 12px rgba(58,42,28,0.08);
  --shadow-lg:    0 4px 8px rgba(58,42,28,0.09), 0 12px 24px rgba(58,42,28,0.10);
  --shadow-xl:    0 8px 16px rgba(58,42,28,0.10), 0 20px 40px rgba(58,42,28,0.14);
  --shadow-glow:  0 0 0 4px rgba(232,199,102,0.30), 0 4px 12px rgba(58,42,28,0.10);
  --shadow-inset: inset 0 2px 4px rgba(58,42,28,0.12);
  --shadow-cozy:  0 1px 1px rgba(70,50,25,0.10),
                  0 3px 4px rgba(70,50,25,0.10),
                  0 8px 14px -4px rgba(70,50,25,0.18);

  /* ── Spacing (behouden) ── */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* ── Border-radius: organisch & afgerond ── */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --radius-xl:   32px;
  --radius-blob: 42% 58% 56% 44% / 48% 42% 58% 52%;
  --radius-full: 9999px;

  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', monospace;
  --font-xs: 0.7rem;
  --font-sm: 0.8rem;
  --font-lg: 1.1rem;
  --font-2xl: 1.6rem;
  --transition: 200ms ease;
  --transition-slow: 400ms ease;
}

/* ═══ Dark mode — avond-tuin (warm, niet koud-grijs) ═══ */
[data-theme="dark"] {
  --color-bg:          #1f241b;
  --color-bg-card:     #2a3024;
  --color-bg-elevated: #333a2c;
  --color-text:        #ece6d6;
  --color-text-muted:  #a59c87;
  --color-text-light:  #74705f;
  --color-border:      #3e4636;
  --color-border-light:#343b2c;

  --color-primary:       var(--sage);
  --color-primary-dark:  var(--sage-dark);
  --color-primary-light: var(--sage-light);
  --color-secondary:     #b8946b;
  --color-accent:        #e8c766;

  --color-success:       #8faf88;
  --color-warning:       #e8c766;
  --color-warning-light: #4a4220;
  --color-danger:        #d88a63;
  --color-danger-light:  #4a2c20;
  --color-info:          #a596bd;
  --color-info-light:    #34304a;

  --color-soil:        #8c6a48;
  --color-soil-dark:   #5c4632;
  --color-kas:         rgba(170, 196, 208, 0.12);

  --gradient-sky:   linear-gradient(180deg, #2c3326 0%, #353426 60%, #3d3024 100%);
  --gradient-soil:  linear-gradient(180deg, #6d543a 0%, #5c4632 55%, #43331f 100%);
  --gradient-grass: linear-gradient(170deg, #6f8f5e 0%, #547049 50%, #3c5236 100%);
  --gradient-sun-glow: radial-gradient(circle at 50% 40%,
                       rgba(232,199,102,0.45) 0%,
                       rgba(216,138,99,0.22) 45%,
                       rgba(216,138,99,0) 100%);

  /* Warm-zwart (cozy-regel: schaduwen nooit puur zwart, ook niet in dark mode) */
  --shadow-xs:    0 1px 2px rgba(24,16,8,0.30);
  --shadow-sm:    0 1px 2px rgba(24,16,8,0.32), 0 2px 4px rgba(24,16,8,0.28);
  --shadow-md:    0 2px 4px rgba(24,16,8,0.35), 0 6px 12px rgba(24,16,8,0.35);
  --shadow-lg:    0 4px 8px rgba(24,16,8,0.40), 0 12px 24px rgba(24,16,8,0.45);
  --shadow-xl:    0 8px 16px rgba(24,16,8,0.45), 0 20px 40px rgba(24,16,8,0.55);
  --shadow-glow:  0 0 0 4px rgba(232,199,102,0.22), 0 4px 12px rgba(24,16,8,0.40);
  --shadow-cozy:  0 2px 4px rgba(24,16,8,0.35), 0 8px 16px -4px rgba(24,16,8,0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  padding-bottom: 80px; /* Ruimte voor chatbot */
}
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ═══ HEADER ═══ */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-bg-card);
  border-bottom: 2px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}
.logo { font-size: 1.3rem; font-weight: 400; color: var(--color-primary); display: flex; align-items: center; gap: var(--space-sm); }
.logo-icon { font-size: 1.5rem; }
.logo-text strong { font-weight: 700; }
.tagline { font-size: 0.7rem; color: var(--color-text-muted); font-style: italic; }
.header-right { display: flex; align-items: center; gap: var(--space-sm); }
.weather-mini { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); background: var(--color-bg-elevated); border-radius: var(--radius-sm); font-size: 0.8rem; }

/* ═══ NAVIGATION ═══ */
.main-nav { display: flex; background: var(--color-bg-card); border-bottom: 1px solid var(--color-border); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--space-sm) var(--space-sm);
  background: none; border: none; border-bottom: 3px solid transparent;
  color: var(--color-text-muted); cursor: pointer; transition: all var(--transition);
  font-size: 0.75rem; min-width: 0; white-space: nowrap;
}
.nav-tab:hover { color: var(--color-primary); background: var(--color-bg-elevated); }
.nav-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
.nav-icon { font-size: 1.1rem; }

/* ═══ MAIN ═══ */
.app-main { max-width: 1400px; margin: 0 auto; padding: var(--space-md); }
.tab-content { display: none; }
.tab-content.active { display: grid; gap: var(--space-lg); }

/* ═══ CARDS ═══ */
.card {
  background: var(--color-bg-card); border-radius: var(--radius-lg);
  padding: var(--space-lg); box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light); transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.card-header h2, .card-header h3 { font-size: 1rem; font-weight: 600; }

/* ═══ BADGES ═══ */
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--radius-full); font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; background: var(--color-primary-dark); color: white; }
.badge-zaai { background: #6da67d; }
.badge-water { background: #5b9bd5; }
.badge-oogst { background: #e8a838; }
.badge-onderhoud { background: #8B7355; }
.badge-kas { background: #87CEEB; color: #333; }
.badge-notitie { background: #9c7a55; }

/* ═══ TIP CARD ═══ */
.tip-card { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); color: white; border: none; }
.tip-card .card-header h2 { color: white; }
.tip-card .badge { background: rgba(255,255,255,0.2); color: white; }
.tip-text { font-size: 1rem; line-height: 1.7; margin-bottom: var(--space-md); }
.tip-actions { display: flex; gap: var(--space-sm); }

/* ═══ WEATHER ═══ */
.weather-current { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); margin-bottom: var(--space-md); }
.weather-main { display: flex; flex-direction: column; }
.weather-temp { font-size: 2.2rem; font-weight: 700; color: var(--color-primary); line-height: 1; }
.weather-desc { font-size: 0.85rem; color: var(--color-text-muted); text-transform: capitalize; }
.weather-details { display: flex; gap: var(--space-lg); }
.weather-detail { display: flex; flex-direction: column; align-items: center; }
.detail-label { font-size: 0.65rem; color: var(--color-text-muted); text-transform: uppercase; }
.detail-value { font-size: 1rem; font-weight: 600; }
.weather-forecast { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-sm); padding-top: var(--space-md); border-top: 1px solid var(--color-border-light); }
.forecast-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-sm); border-radius: var(--radius-sm); background: var(--color-bg-elevated); font-size: 0.75rem; }
.forecast-day__name { font-weight: 600; font-size: 0.65rem; text-transform: uppercase; }
.forecast-day__icon { font-size: 1.2rem; }
.forecast-day__temp { font-weight: 600; }
.frost-alert { margin-top: var(--space-md); padding: var(--space-sm) var(--space-md); background: var(--color-danger-light); border: 1px solid var(--color-danger); border-radius: var(--radius-sm); color: var(--color-danger); font-size: 0.85rem; }

/* ═══ STATS ═══ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); }
.stat { display: flex; flex-direction: column; align-items: center; padding: var(--space-sm); background: var(--color-bg-elevated); border-radius: var(--radius-md); }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--color-primary); line-height: 1; }
.stat-label { font-size: 0.7rem; color: var(--color-text-muted); text-transform: uppercase; margin-top: 2px; }

/* ═══ ACTIVITY ═══ */
.activity-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.activity-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); background: var(--color-bg-elevated); font-size: 0.85rem; }
.activity-item__icon { font-size: 1.1rem; flex-shrink: 0; }
.activity-item__text { flex: 1; }
.activity-item__date { font-size: 0.7rem; color: var(--color-text-muted); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════
   PLANNER — Tuinplattegrond v2.0
   ═══════════════════════════════════════════════════════════ */

#tab-planner.active {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-md);
  align-items: start;
}

/* Toolbar */
.planner-toolbar {
  background: var(--color-bg-card); border-radius: var(--radius-lg);
  padding: var(--space-sm); box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px); overflow-y: auto;
}

.toolbar-section { margin-bottom: var(--space-md); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--color-border-light); }
.toolbar-section:last-child { border-bottom: none; margin-bottom: 0; }
.toolbar-section h3 { font-size: 0.75rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-xs); }
.toolbar-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-xs); }

/* Tool modes */
.tool-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.tool-mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 2px; background: var(--color-bg-elevated);
  border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 1.1rem; transition: all var(--transition);
}
.tool-mode-btn small { font-size: 0.55rem; color: var(--color-text-muted); }
.tool-mode-btn:hover { border-color: var(--color-primary-light); }
.tool-mode-btn.active { border-color: var(--color-primary); background: rgba(74, 124, 89, 0.1); }

/* Surface palette */
.surface-palette { display: flex; flex-direction: column; gap: 2px; }
.surface-btn {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 4px 8px; background: var(--color-bg-elevated);
  border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition); font-size: 0.75rem;
}
.surface-btn:hover { border-color: var(--color-primary-light); }
.surface-btn.active { border-color: var(--color-primary); background: rgba(74, 124, 89, 0.1); }
.surface-btn__color { width: 18px; height: 18px; border-radius: 3px; flex-shrink: 0; }
.surface-btn__label { font-size: 0.7rem; }

/* Element palette */
.element-palette { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.element-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 2px; background: var(--color-bg-elevated);
  border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.6rem; transition: all var(--transition);
}
.element-btn:hover { border-color: var(--color-primary-light); }
.element-btn.active { border-color: var(--color-primary); background: rgba(74, 124, 89, 0.1); }
.element-btn__icon { font-size: 1.2rem; }
.element-btn__label { font-size: 0.55rem; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Plant palette */
.plant-category-tabs { display: flex; gap: 2px; margin-bottom: var(--space-xs); flex-wrap: wrap; }
.cat-tab {
  padding: 3px 6px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-bg-elevated); cursor: pointer; font-size: 0.8rem;
  transition: all var(--transition);
}
.cat-tab:hover { border-color: var(--color-primary-light); }
.cat-tab.active { border-color: var(--color-primary); background: rgba(74, 124, 89, 0.15); }

.plant-palette { display: grid; grid-template-columns: 1fr; gap: 2px; max-height: 250px; overflow-y: auto; }
.plant-btn {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: 4px 6px; background: var(--color-bg-elevated);
  border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition); font-size: 0.75rem;
  text-align: left; position: relative;
}
.plant-btn:hover { border-color: var(--color-primary-light); }
.plant-btn.selected { border-color: var(--color-primary); background: rgba(74, 124, 89, 0.1); }
.plant-btn__icon { font-size: 1.1rem; flex-shrink: 0; }
.plant-btn__label { font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.plant-btn__fav {
  font-size: 0.6rem; opacity: 0.3; cursor: pointer; flex-shrink: 0;
  transition: opacity var(--transition);
}
.plant-btn__fav:hover { opacity: 0.7; }
.plant-btn__fav.active { opacity: 1; }

.palette-legend { padding-top: var(--space-sm); }
.legend-title { font-size: 0.65rem; color: var(--color-text-muted); margin-bottom: var(--space-xs); }
.selected-plant { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); background: var(--color-bg-elevated); border-radius: var(--radius-sm); }
.selected-plant__icon { font-size: 1.3rem; }
.selected-plant__name { font-weight: 600; font-size: 0.8rem; }

/* Garden canvas */
/* ── Diorama-frame: warme "tafel/aarde"-rand rondom het bord ── */
.planner-canvas-wrapper {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% 0%, #efe2c8 0%, #e3d3b0 55%, #d4c098 100%);
  border-radius: 22px 26px 20px 24px / 24px 20px 26px 22px;
  padding: 18px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.55),
    var(--shadow-cozy);
  border: 1px solid var(--color-border-light); overflow: auto;
  max-height: calc(100vh - 120px);
}
[data-theme="dark"] .planner-canvas-wrapper {
  background: radial-gradient(120% 90% at 50% 0%, #353c2c 0%, #2c3224 55%, #242a1d 100%);
}
.planner-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.planner-header h2 { font-size: 1rem; }
.planner-controls { display: flex; gap: var(--space-xs); }

.garden-canvas {
  position: relative; overflow: visible;
  transition: transform var(--transition);
  cursor: crosshair;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.garden-grid { user-select: none; border-radius: var(--radius-md); overflow: hidden; }

.garden-cell {
  border: 1px solid rgba(90,70,50,0.05);
  display: flex; align-items: center; justify-content: center;
  cursor: crosshair; transition: border-color 100ms, transform 100ms;
  font-size: 0.85rem; position: relative;
  background-color: var(--color-bg-elevated);
}
.garden-cell:hover { border-color: var(--color-primary); z-index: 1; }

/* Warme ambient-occlusion i.p.v. harde lijn — surfaces "zakken" in de aarde */
.garden-cell.has-surface {
  border-color: transparent;
  box-shadow: inset 0 0 6px rgba(60,40,20,0.16);
}
/* Painterly CSS-gradient surfaces (geërfd via data-surface, geen JS per cel) */
.garden-cell[data-surface="gras"] {
  background-image:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.12), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(40,80,20,0.20), transparent 45%);
  background-size: 14px 14px, 18px 18px;
}
.garden-cell[data-surface="grond"] {
  background-image:
    radial-gradient(circle at 60% 40%, rgba(60,40,25,0.22), transparent 50%),
    radial-gradient(circle at 20% 70%, rgba(255,235,200,0.12), transparent 45%);
  background-size: 16px 16px, 20px 20px;
}
.garden-cell[data-surface="zand"] {
  background-image:
    radial-gradient(circle at 35% 30%, rgba(255,245,225,0.18), transparent 45%),
    radial-gradient(circle at 75% 75%, rgba(150,120,90,0.16), transparent 50%);
  background-size: 12px 12px, 16px 16px;
}
.garden-cell[data-surface="pad"],
.garden-cell[data-surface="stenen"] {
  background-image:
    radial-gradient(circle at 40% 35%, rgba(255,255,255,0.10), transparent 45%),
    radial-gradient(circle at 70% 75%, rgba(70,55,40,0.18), transparent 50%);
  background-size: 15px 15px, 19px 19px;
}
.garden-cell[data-surface="hout"] {
  background-image:
    linear-gradient(95deg, rgba(255,235,205,0.14) 0%, transparent 35%, rgba(70,45,25,0.16) 100%);
  background-size: 22px 100%;
}
.garden-cell[data-surface="water"] {
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.22), transparent 55%),
    radial-gradient(circle at 65% 70%, rgba(20,80,120,0.20), transparent 55%);
  background-size: 20px 20px, 24px 24px;
}

/* Verheven structuur (kas/schuur): top-licht + bodem-AO = volume */
.garden-cell.has-structure {
  cursor: pointer;
  box-shadow:
    inset 0 2px 2px rgba(255,250,235,0.50),
    inset 0 -3px 4px rgba(50,30,10,0.28);
}

/* Grondschaduw onder emoji's — planten/objecten "staan" i.p.v. zweven */
.garden-cell.has-element { font-size: 1rem; cursor: pointer; }
.garden-cell.has-plant   { font-size: 1rem; cursor: pointer; }
.garden-cell.has-plant,
.garden-cell.has-element {
  filter: drop-shadow(0 2px 1.5px rgba(40,30,15,0.35));
}
.garden-cell[data-element-id] { filter: drop-shadow(0 3px 2px rgba(40,30,15,0.40)); }

/* Plaats-feedback: korte pop bij neerzetten */
@keyframes plant-pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.garden-cell.just-placed { animation: plant-pop 250ms ease-out; }

/* PERF: tijdens slepend tekenen alle filters/schaduwen/animaties strippen */
.garden-canvas.is-drawing .garden-cell {
  filter: none !important;
  animation: none !important;
}

[data-theme="dark"] .garden-cell { border-color: rgba(255,255,255,0.05); background-color: var(--color-bg-elevated); }
[data-theme="dark"] .garden-cell.has-surface { border-color: transparent; box-shadow: inset 0 0 6px rgba(24,16,8,0.30); }
[data-theme="dark"] .garden-cell.has-structure { opacity: 0.88; }

/* ── Ambient sfeerlaag: zonlicht + vignet (klikt nergens doorheen) ── */
.garden-ambient {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 5;
  border-radius: var(--radius-md);
  background:
    radial-gradient(70% 55% at 50% 16%, rgba(255,244,214,0.38), transparent 70%),
    radial-gradient(140% 120% at 50% 100%, transparent 55%, rgba(40,30,15,0.26));
  mix-blend-mode: soft-light;
  animation: ambient-breathe 12s ease-in-out infinite;
}
[data-theme="dark"] .garden-ambient {
  background:
    radial-gradient(60% 50% at 50% 20%, rgba(232,199,102,0.20), transparent 70%),
    radial-gradient(150% 130% at 50% 100%, transparent 45%, rgba(0,0,0,0.45));
}
.garden-ambient::before {
  content: ""; position: absolute; inset: 0;
  background: #fff;
  filter: url(#paperGrain);
  opacity: 0.05;
  mix-blend-mode: multiply;
  pointer-events: none;
}
@keyframes ambient-breathe { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }

/* ── Verplicht: respecteer reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .garden-ambient,
  .garden-cell.just-placed { animation: none !important; }
}
@media (max-width: 700px) {
  .garden-ambient::before { opacity: 0.03; }
}

/* ═══ BAKKEN TAB ═══ */
.bakken-header { display: flex; align-items: center; justify-content: space-between; }
.bakken-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-md); }
.bak-card { background: var(--color-bg-card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border-light); cursor: pointer; transition: all var(--transition); }
.bak-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bak-card__header { padding: var(--space-sm) var(--space-md); color: white; display: flex; align-items: center; justify-content: space-between; }
.bak-card__name { font-weight: 700; font-size: 1rem; }
.bak-card__location { font-size: 0.7rem; opacity: 0.8; }
.bak-card__body { padding: var(--space-sm) var(--space-md); }
.bak-card__stats { display: flex; gap: var(--space-lg); font-size: 0.8rem; color: var(--color-text-muted); }
.bak-card__plants { display: flex; flex-wrap: wrap; gap: 3px; margin-top: var(--space-xs); }
.bak-card__plant-icon { font-size: 1.1rem; padding: 1px; border-radius: 3px; background: var(--color-bg-elevated); }

/* Bak detail */
.bak-detail { position: fixed; top: 0; right: 0; width: 380px; height: 100vh; background: var(--color-bg-card); box-shadow: var(--shadow-lg); z-index: 200; overflow-y: auto; }
.bak-detail__header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; background: var(--color-bg-card); z-index: 1; }
.bak-detail__content { padding: var(--space-md); }
.bak-detail__actions { display: flex; gap: var(--space-sm); margin: var(--space-md) 0; }
.bak-plants-list { display: flex; flex-direction: column; gap: var(--space-xs); }
.bak-plant-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); background: var(--color-bg-elevated); border-radius: var(--radius-sm); }
.bak-plant-item__icon { font-size: 1.2rem; }
.bak-plant-item__name { font-weight: 600; font-size: 0.85rem; }
.bak-plant-item__date { font-size: 0.7rem; color: var(--color-text-muted); }
.bak-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); margin-top: var(--space-md); }
.bak-photo { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.bak-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ═══ LOGBOEK ═══ */
.logboek-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); }
.logboek-actions { display: flex; gap: var(--space-sm); }
.logboek-filters { display: flex; gap: var(--space-sm); }
.timeline { display: flex; flex-direction: column; gap: var(--space-sm); }
.timeline-item { display: flex; gap: var(--space-md); padding: var(--space-md); background: var(--color-bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border-left: 4px solid var(--color-primary); }
.timeline-item--water { border-left-color: #5b9bd5; }
.timeline-item--zaai { border-left-color: #6da67d; }
.timeline-item--oogst { border-left-color: #e8a838; }
.timeline-item--bemest { border-left-color: #c0853f; }
.timeline-item--snoei { border-left-color: #7dab6e; }
.timeline-item--notitie { border-left-color: #999; }
.timeline-item--voice { border-left-color: #9b59b6; }
.timeline-item--foto { border-left-color: #e67e73; }
.timeline-item__icon { font-size: 1.3rem; flex-shrink: 0; }
.timeline-item__content { flex: 1; }
.timeline-item__header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: 3px; }
.timeline-item__title { font-weight: 600; font-size: 0.85rem; }
.timeline-item__date { font-size: 0.7rem; color: var(--color-text-muted); }
.timeline-item__note { font-size: 0.8rem; color: var(--color-text-muted); }
.timeline-item__photos { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: var(--space-xs); }
.timeline-photo { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; }
.timeline-item__add-photo { margin-top: var(--space-xs); font-size: 0.7rem !important; padding: 2px 8px !important; }

/* ═══ SEIZOEN ═══ */
.seizoen-header { display: flex; align-items: center; justify-content: space-between; }
.seizoen-controls { display: flex; align-items: center; gap: var(--space-sm); }
.seizoen-year { font-size: 1.2rem; font-weight: 700; color: var(--color-primary); }
.season-calendar { overflow-x: auto; }
.season-calendar table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.season-calendar th { padding: var(--space-xs); text-align: center; font-weight: 600; color: var(--color-text-muted); font-size: 0.65rem; text-transform: uppercase; }
.season-calendar td { padding: 3px; text-align: center; border: 1px solid var(--color-border-light); }
.season-bar { height: 8px; border-radius: 4px; }
.season-bar--zaai { background: #6da67d; }
.season-bar--groei { background: #a0d468; }
.season-bar--oogst { background: #e8a838; }
.data-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* ═══ BUTTONS ═══ */
.btn { display: inline-flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border: none; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition); font-family: var(--font-body); }
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-bg-elevated); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-border-light); }
.btn-small { padding: 3px var(--space-sm); font-size: 0.7rem; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; border-radius: var(--radius-sm); background: var(--color-bg-elevated); color: var(--color-text); cursor: pointer; transition: all var(--transition); font-size: 1rem; }
.btn-icon:hover { background: var(--color-border-light); }
.btn-icon.btn-small { width: 26px; height: 26px; font-size: 0.85rem; }
.btn-tiny { width: 22px; height: 22px; font-size: 0.7rem; }
.btn-voice { background: var(--color-primary); color: white; }
.btn-voice:hover { background: var(--color-primary-dark); }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* ═══ FORMS ═══ */
.input-search, .input-text, .input-number, .input-date, .input-select, .input-textarea {
  width: 100%; padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 0.8rem; transition: border-color var(--transition);
}
.input-search:focus, .input-text:focus, .input-number:focus, .input-date:focus, .input-select:focus, .input-textarea:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15); }
.input-color { width: 40px; height: 32px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; }
.input-file { width: 100%; padding: var(--space-xs); font-size: 0.8rem; }
.form-group { margin-bottom: var(--space-sm); }
.form-group label { display: block; font-size: 0.7rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }

/* ═══ MODALS ═══ */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 300; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(30,20,10,0.5); }
.modal-content { position: relative; background: var(--color-bg-card); border-radius: var(--radius-lg); padding: var(--space-lg); width: 90%; max-width: 440px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.modal-header h3 { font-size: 1.1rem; }
.modal-actions { display: flex; gap: var(--space-sm); justify-content: flex-end; margin-top: var(--space-md); }

/* Voice */
.voice-interface { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); padding: var(--space-md); }
.voice-status { text-align: center; color: var(--color-text-muted); font-size: 0.85rem; }
.btn-voice-record { width: 70px; height: 70px; border-radius: var(--radius-full); border: none; background: var(--color-primary); color: white; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; justify-content: center; }
.btn-voice-record:hover { background: var(--color-primary-dark); transform: scale(1.05); }
.btn-voice-record.recording { background: var(--color-danger); animation: pulse 1.5s infinite; }
.voice-record-icon { font-size: 1.8rem; }
.voice-transcript { width: 100%; }
.voice-actions { display: flex; gap: var(--space-sm); width: 100%; }
.voice-actions .input-select { flex: 1; }

/* Plant info popup */
.plant-info { position: fixed; z-index: 250; background: var(--color-bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: var(--space-md); min-width: 200px; max-width: 280px; border: 1px solid var(--color-border); }
.plant-info.hidden { display: none; }
.plant-info__header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.plant-info__icon { font-size: 1.4rem; }
.plant-info__name { font-weight: 700; flex: 1; font-size: 0.9rem; }
.plant-info__date { font-size: 0.75rem; color: var(--color-text-muted); }
.plant-info__tip { font-size: 0.75rem; color: var(--color-primary); font-style: italic; }
.plant-info__photos { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--color-border-light); }
.plant-info__photo { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); }

/* Photo preview */
.photo-preview { margin-top: var(--space-sm); border-radius: var(--radius-sm); overflow: hidden; max-height: 180px; }
.photo-preview img { width: 100%; object-fit: cover; }

/* ═══════════════════════════════════════════════════════════
   CHATBOT — Stekkie de Tuincoach
   ═══════════════════════════════════════════════════════════ */

.chatbot-mascot {
  position: fixed; bottom: 20px; right: 20px; z-index: 400;
  width: 65px; height: 65px; border-radius: var(--radius-full);
  background: var(--color-primary); border: 3px solid white;
  box-shadow: var(--shadow-lg); cursor: pointer;
  transition: all var(--transition); padding: 0;
  display: flex; align-items: center; justify-content: center;
  animation: mascot-bounce 3s ease-in-out infinite;
}
.chatbot-mascot:hover { transform: scale(1.1); box-shadow: 0 8px 30px rgba(74, 124, 89, 0.4); }
.chatbot-mascot.active { animation: none; }
@media (prefers-reduced-motion: reduce) { .chatbot-mascot { animation: none; } }
.mascot-svg { width: 50px; height: 50px; }
.mascot-badge {
  position: absolute; top: -4px; right: -4px;
  width: 20px; height: 20px; border-radius: var(--radius-full);
  background: var(--color-accent); color: white;
  font-size: 0.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Chat panel */
.chatbot-panel {
  position: fixed; bottom: 95px; right: 20px; z-index: 399;
  width: 340px; max-height: 480px;
  background: var(--color-bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: chat-slide-up 300ms ease;
}
.chatbot-panel.hidden { display: none; }

@keyframes chat-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary); color: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.chatbot-header__left { display: flex; align-items: center; gap: var(--space-sm); }
.chatbot-header__avatar { width: 32px; height: 32px; background: rgba(255,255,255,0.2); border-radius: var(--radius-full); }
.chatbot-header__name { font-weight: 700; font-size: 0.9rem; display: block; }
.chatbot-header__status { font-size: 0.65rem; opacity: 0.8; display: block; }
.chatbot-header__close { background: rgba(255,255,255,0.2) !important; color: white !important; }
.chatbot-header__close:hover { background: rgba(255,255,255,0.3) !important; }

.chatbot-messages {
  flex: 1; overflow-y: auto; padding: var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-sm);
  min-height: 280px; max-height: 340px;
  background: var(--color-bg);
}

.chatbot-msg { display: flex; flex-direction: column; max-width: 85%; }
.chatbot-msg--user { align-self: flex-end; align-items: flex-end; }
.chatbot-msg--bot { align-self: flex-start; align-items: flex-start; }

.chatbot-bubble {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.8rem; line-height: 1.5;
  white-space: pre-line;
}
.chatbot-msg--user .chatbot-bubble { background: var(--color-primary); color: white; border-bottom-right-radius: 4px; }
.chatbot-msg--bot .chatbot-bubble { background: var(--color-bg-card); border: 1px solid var(--color-border-light); border-bottom-left-radius: 4px; }
.chatbot-time { font-size: 0.55rem; color: var(--color-text-light); margin-top: 2px; }

.chatbot-input-bar {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-sm); border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-card);
}
.chatbot-input {
  flex: 1; border: 1px solid var(--color-border); border-radius: 20px;
  padding: 6px 14px; font-size: 0.8rem; background: var(--color-bg);
  color: var(--color-text); outline: none; font-family: var(--font-body);
}
.chatbot-input:focus { border-color: var(--color-primary); }
.chatbot-mic-btn {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  border: none; background: var(--color-bg-elevated);
  cursor: pointer; font-size: 0.9rem; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.chatbot-mic-btn:hover { background: var(--color-primary-light); color: white; }
.chatbot-mic-btn.listening { background: var(--color-danger); color: white; animation: pulse 1.5s infinite; }
.chatbot-send-btn {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  border: none; background: var(--color-primary); color: white;
  cursor: pointer; font-size: 1rem; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.chatbot-send-btn:hover { background: var(--color-primary-dark); }
.chatbot-photo-btn {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  border: none; background: var(--color-bg-elevated);
  cursor: pointer; font-size: 0.9rem; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.chatbot-photo-btn:hover { background: var(--color-primary-light); color: white; }
.chatbot-photo-input { display: none; }
.chatbot-photo {
  display: block; max-width: 180px; width: 100%; height: auto;
  border-radius: var(--radius-sm); margin-bottom: 6px;
}
.chatbot-bubble-text:empty { display: none; }

/* ═══ UTILITY ═══ */
.hidden { display: none !important; }
.empty-state { text-align: center; color: var(--color-text-muted); padding: var(--space-lg); font-style: italic; font-size: 0.85rem; }

/* ═══ FOOTER ═══ */
.app-footer { text-align: center; padding: var(--space-lg); color: var(--color-text-muted); font-size: 0.75rem; border-top: 1px solid var(--color-border-light); margin-top: var(--space-xl); }
.footer-sub { font-size: 0.65rem; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  #tab-planner.active { grid-template-columns: 1fr; }
  .planner-toolbar { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-sm); }
  .toolbar-section { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
  .plant-palette { max-height: 150px; }
  .bak-detail { width: 100%; }
}

@media (max-width: 640px) {
  .app-header { padding: var(--space-xs) var(--space-sm); }
  .tagline { display: none; }
  .app-main { padding: var(--space-sm); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .weather-current { flex-direction: column; align-items: flex-start; gap: var(--space-sm); }
  .weather-details { width: 100%; justify-content: space-between; }
  .weather-forecast { grid-template-columns: repeat(3, 1fr); }
  .logboek-header { flex-direction: column; align-items: flex-start; }
  .bakken-grid { grid-template-columns: 1fr; }
  .nav-label { font-size: 0.6rem; }
  .nav-icon { font-size: 0.95rem; }
  .modal-content { width: 95%; padding: var(--space-md); }

  /* Vinger-vriendelijke tap-targets op mobiel (streef ≥40px, WCAG-min 24px) */
  .btn-icon { width: 40px; height: 40px; }
  .btn-icon.btn-small { width: 36px; height: 36px; }
  .btn-tiny { width: 32px; height: 32px; }
  .btn-small { padding: 8px var(--space-sm); min-height: 36px; min-width: 36px; }
  .btn { min-height: 40px; }

  /* Chatbot mobile */
  .chatbot-panel { width: calc(100vw - 24px); right: 12px; bottom: 85px; max-height: 60vh; }
  .chatbot-mascot { bottom: 12px; right: 12px; width: 56px; height: 56px; }
  .mascot-svg { width: 42px; height: 42px; }

  /* Planner mobile: toolbar als horizontale strip */
  .planner-toolbar { padding: var(--space-xs); }
  .tool-modes { grid-template-columns: repeat(4, 1fr); }
  .surface-palette { flex-direction: row; flex-wrap: wrap; gap: 3px; }
  .surface-btn__label { display: none; }
  .element-palette { grid-template-columns: repeat(4, 1fr); }
  .element-btn__label { display: none; }

  .planner-canvas-wrapper { max-height: 60vh; }
}

@media (max-width: 400px) {
  .logo-text { font-size: 1rem; }
  .weather-mini { display: none; }
  .logo-icon { font-size: 1.2rem; }
}

/* ═══ Scrollbar styling ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ── Stekkie typ-indicator ── */
.chatbot-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.chatbot-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-text-muted);
  opacity: 0.4; animation: stekkie-typing 1.2s infinite ease-in-out;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes stekkie-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* ── Locatie-kiezer ── */
.card-header__actions { display: flex; gap: var(--space-xs); align-items: center; }
.form-hint { font-size: 0.78rem; color: var(--color-text-muted); margin: var(--space-xs) 0 var(--space-sm); }
.location-results { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.location-result { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); border: 1px solid transparent; }
.location-result:hover { background: var(--color-bg-elevated); border-color: var(--color-border-light); }
.location-result--muted { color: var(--color-text-muted); cursor: default; }
.location-result--muted:hover { background: transparent; border-color: transparent; }

/* ── Seizoenscoach: "Deze week in je tuin" ── */
.season-coach-card .card-header h2 { display: flex; align-items: center; gap: var(--space-xs); }
.season-coach-loading { color: var(--color-text-muted); font-style: italic; }

.coach-alert {
  display: flex; gap: var(--space-sm); align-items: flex-start;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem; line-height: 1.4;
  margin-bottom: var(--space-md);
}
.coach-alert--frost { background: var(--lavender-light); color: var(--lavender-dark); }
.coach-alert--heat  { background: var(--peach-light);    color: var(--terracotta-dark); }

.coach-section { margin-bottom: var(--space-md); }
.coach-section:last-child { margin-bottom: 0; }
.coach-section__title {
  font-size: 0.82rem; font-weight: 700; color: var(--color-text-muted);
  margin: 0 0 var(--space-sm); display: flex; align-items: center; gap: 6px;
}

.coach-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.coach-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem; color: var(--color-text);
  box-shadow: var(--shadow-xs);
}
/* Quick-wins springen er warm uit */
.coach-chip--win {
  background: var(--color-warning-light);
  border-color: var(--color-accent);
  font-weight: 600;
}
.coach-chip--more { background: transparent; border-style: dashed; color: var(--color-text-muted); box-shadow: none; }
.coach-empty { color: var(--color-text-muted); font-size: 0.9rem; line-height: 1.5; margin: 0; }

.season-coach-actions { margin-top: var(--space-md); }
.season-coach-actions .btn { width: 100%; }

/* ── Gamification: groeistadia van gewassen ── */
.has-plant .plant-glyph {
  display: inline-block;
  line-height: 1;
  transform-origin: bottom center;
  transition: transform 0.6s cubic-bezier(.34,1.56,.64,1), filter 0.4s ease;
}
.has-plant .plant-glyph[data-stage="0"] { transform: scale(0.45); opacity: 0.8; }
.has-plant .plant-glyph[data-stage="1"] { transform: scale(0.62); }
.has-plant .plant-glyph[data-stage="2"] { transform: scale(0.80); }
.has-plant .plant-glyph[data-stage="3"] { transform: scale(0.92); }
.has-plant .plant-glyph[data-stage="4"] { transform: scale(1); }
.has-plant.is-ripe .plant-glyph {
  filter: drop-shadow(0 0 3px var(--color-accent)) drop-shadow(0 0 6px var(--color-accent));
  animation: ag-ripe-pulse 2.2s ease-in-out infinite;
}
@keyframes ag-ripe-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.14); }
}
@media (prefers-reduced-motion: reduce) {
  .has-plant .plant-glyph { transition: none; }
  .has-plant.is-ripe .plant-glyph { animation: none; }
}

/* ── Community-tab ── */
.community-intro { margin-bottom: var(--space-lg); }
.community-intro h2 { font-size: 1.4rem; margin-bottom: var(--space-sm); }
.community-intro p { color: var(--color-text-muted); max-width: 60ch; }
.community-note {
  margin-top: var(--space-sm); padding: var(--space-sm) var(--space-md);
  background: var(--color-info-light); color: var(--color-info);
  border-radius: var(--radius-md); font-size: 0.88rem;
}

.community-list {
  display: grid; gap: var(--space-lg);
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.community-card { display: flex; flex-direction: column; }
.community-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.community-card__head h3 { font-size: 1.08rem; line-height: 1.3; }
.community-badge--volks { background: var(--moss); color: #fff; }
.community-badge--stad  { background: var(--lavender-dark); color: #fff; }
.community-card__blurb { color: var(--color-text); font-size: 0.92rem; margin-bottom: var(--space-sm); }
.community-card__meta { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 2px; }
.community-card__section { margin-top: var(--space-md); }
.community-card__section h4 { font-size: 0.82rem; font-weight: 700; color: var(--color-text-muted); margin-bottom: var(--space-xs); }
.community-card__section ul { list-style: none; padding: 0; }
.community-card__section li { font-size: 0.88rem; padding: 3px 0 3px 16px; position: relative; }
.community-card__section li::before { content: '•'; position: absolute; left: 2px; color: var(--color-primary); }
.community-card__btn { margin-top: var(--space-md); align-self: flex-start; }

/* ── Toast ── */
.ag-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  max-width: 90vw; padding: var(--space-sm) var(--space-lg);
  background: var(--color-text); color: var(--color-bg-card);
  border-radius: var(--radius-full); box-shadow: var(--shadow-lg);
  font-size: 0.9rem; z-index: 2000; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.ag-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .ag-toast { transition: opacity .3s ease; } }

/* ═══ Stekkie komt tot leven ═══ */

/* Intro: 6x grote Stekkie hopt/vliegt 1x (~6s) over het scherm en landt in z'n hoekje */
.stekkie-intro {
  position: fixed; left: 0; bottom: 20px; z-index: 500;
  pointer-events: none; will-change: transform;
  animation: stekkie-journey 6s ease-in-out forwards;
}
.stekkie-intro__svg {
  width: 300px; height: 300px; display: block;
  filter: drop-shadow(0 12px 22px rgba(58,42,28,0.28));
}
.chatbot-mascot.is-hidden { opacity: 0; pointer-events: none; }

@keyframes stekkie-journey {
  0%   { transform: translate(-42vw, 0)     scale(1)   rotate(-10deg); opacity: 0; }
  8%   { opacity: 1; }
  18%  { transform: translate(2vw, -46vh)   scale(1)   rotate(10deg); }
  30%  { transform: translate(16vw, -4vh)   scale(1)   rotate(-8deg); }
  45%  { transform: translate(34vw, -50vh)  scale(0.96) rotate(8deg); }
  58%  { transform: translate(50vw, -5vh)   scale(0.9) rotate(-6deg); }
  72%  { transform: translate(67vw, -42vh)  scale(0.78) rotate(7deg); }
  86%  { transform: translate(82vw, -7vh)   scale(0.46) rotate(-4deg); }
  100% { transform: translate(89vw, -1vh)   scale(0.15) rotate(0deg); opacity: 1; }
}

/* Hulp-balkje bij de mascotte */
.stekkie-helpbar {
  position: fixed; right: 20px; bottom: 94px; z-index: 401;
  background: var(--color-bg-card); color: var(--color-text);
  border: 2px solid var(--color-primary); border-radius: var(--radius-lg);
  padding: 10px 16px; font-size: 0.9rem; line-height: 1.3; cursor: pointer;
  box-shadow: var(--shadow-lg); max-width: 250px; text-align: left;
  opacity: 0; transform: translateY(8px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.stekkie-helpbar--show { opacity: 1; transform: translateY(0) scale(1); }
.stekkie-helpbar::after {
  content: ''; position: absolute; right: 26px; bottom: -9px;
  width: 14px; height: 14px; background: var(--color-bg-card);
  border-right: 2px solid var(--color-primary); border-bottom: 2px solid var(--color-primary);
  transform: rotate(45deg);
}
.stekkie-helpbar__wave { display: inline-block; animation: stekkie-wave 1s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes stekkie-wave { 0%,100% { transform: rotate(0); } 50% { transform: rotate(20deg); } }

/* Gezichtsmimiek: knipperen + pratende mond tijdens een gesprek */
.stekkie-eyes, .stekkie-mouth { transform-box: fill-box; transform-origin: center; }
.is-talking .stekkie-eyes { animation: stekkie-blink 3.4s ease-in-out infinite; }
@keyframes stekkie-blink {
  0%, 90%, 100% { transform: scaleY(1); }
  94%           { transform: scaleY(0.12); }
}
.is-talking .stekkie-mouth { animation: stekkie-talk 0.85s ease-in-out infinite; }
.is-speaking .stekkie-mouth { animation-duration: 0.3s; }
@keyframes stekkie-talk {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(2.1) translateY(-0.4px); }
}

@media (max-width: 640px) {
  .stekkie-intro__svg { width: 170px; height: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-mascot,
  .stekkie-helpbar__wave,
  .is-talking .stekkie-eyes,
  .is-talking .stekkie-mouth,
  .is-speaking .stekkie-mouth,
  .stekkie-intro,
  .chatbot-panel,
  .btn-voice-record.recording,
  .chatbot-mic-btn.listening { animation: none; }
  /* Typ-indicator: geen beweging, wel zichtbaar */
  .chatbot-typing span { animation: none; opacity: 0.7; }
}

/* ── Feedback widget (links-onder) ───────────────────────────── */
.ag-feedback-btn {
  position: fixed; left: 16px; bottom: 16px; z-index: 90;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border: none; cursor: pointer;
  background: var(--color-bg-card); color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 999px; box-shadow: var(--shadow-lg);
  font-size: 0.85rem; font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ag-feedback-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(58,42,28,0.18); }
.ag-feedback-btn span[aria-hidden] { font-size: 1.05rem; }

.ag-feedback-content { max-width: 440px; }
.ag-feedback-intro { color: var(--color-text-muted); margin-bottom: var(--space-md); }
.ag-feedback-stars { display: flex; gap: 6px; margin-bottom: var(--space-md); }
.ag-feedback-star {
  background: none; border: none; cursor: pointer; padding: 2px;
  font-size: 1.9rem; line-height: 1; color: var(--color-border);
  transition: color 0.12s ease, transform 0.12s ease;
}
.ag-feedback-star:hover { transform: scale(1.15); }
.ag-feedback-star.is-active { color: var(--color-accent); }
.ag-feedback-status { min-height: 1.2em; font-size: 0.85rem; color: var(--color-danger); margin-top: 4px; }

@media (max-width: 640px) {
  .ag-feedback-btn { left: 12px; bottom: 12px; padding: 9px 12px; }
  .ag-feedback-btn__label { display: none; }
}

/* ── Auth: app verborgen tot ingelogd ───────────────────────── */
body:not(.authed) .app-header,
body:not(.authed) .main-nav,
body:not(.authed) .app-main,
body:not(.authed) .ag-feedback-btn,
body:not(.authed) .chatbot-mascot { display: none !important; }

/* ── Login-scherm ───────────────────────────────────────────── */
.ag-auth {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-md);
  background: linear-gradient(160deg, var(--color-bg) 0%, var(--color-bg-elevated) 100%);
}
.ag-auth.hidden { display: none; }
.ag-auth__card {
  width: 100%; max-width: 400px;
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 28px 26px;
}
.ag-auth__brand { text-align: center; margin-bottom: var(--space-lg); }
.ag-auth__logo { font-size: 2.4rem; display: block; }
.ag-auth__brand h1 { font-size: 1.5rem; margin: 6px 0 2px; font-weight: 600; }
.ag-auth__tagline { color: var(--color-text-muted); font-size: 0.85rem; margin: 0; }
.ag-auth__body label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--color-text-muted); margin-bottom: 12px;
}
.ag-auth__hint { font-weight: 400; color: var(--color-text-light); }
.ag-auth__body input {
  display: block; width: 100%; margin-top: 5px;
  padding: 11px 12px; font-size: 1rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-bg); color: var(--color-text);
}
.ag-auth__body input:focus { outline: none; border-color: var(--color-primary); }
.ag-auth__submit { width: 100%; margin-top: 6px; padding: 12px; font-size: 1rem; }
.ag-auth__intro { color: var(--color-text-muted); font-size: 0.9rem; margin: 0 0 var(--space-md); }
.ag-auth__msg { min-height: 1.2em; font-size: 0.85rem; margin-top: 10px; }
.ag-auth__msg.is-error { color: var(--color-danger); }
.ag-auth__msg.is-ok { color: var(--color-success); }
.ag-auth__error { color: var(--color-danger); text-align: center; }
.ag-auth__links {
  margin-top: var(--space-lg); padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
  display: flex; flex-direction: column; gap: 8px;
  text-align: center; font-size: 0.85rem; color: var(--color-text-muted);
}
.ag-auth__link {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--color-primary); font-weight: 600; font-size: 0.85rem;
}
.ag-auth__link:hover { text-decoration: underline; }

/* ── Verplichte onboarding-modal (locatie kiezen) ───────────── */
/* Overlay blijft zichtbaar én blokkerend; alleen de X verdwijnt en
   klik/Escape sluiten niet (zie _bindModals). */
.modal--mandatory .modal-header .btn-icon[data-close] { display: none !important; }

/* ═══ ADMIN-CONSOLE (alleen Super Admin) ═══════════════════ */
.admin-head { margin-bottom: var(--space-lg); }
.admin-head h2 { font-size: var(--font-2xl); color: var(--color-text); }
.admin-sub { color: var(--color-text-muted); margin-top: 2px; }
.admin-warn {
  margin-top: var(--space-xs); padding: 6px 10px; border-radius: var(--radius-sm, 8px);
  background: var(--color-warning-light); color: var(--color-text); font-size: var(--font-sm);
}
.admin-empty { color: var(--color-text-muted); padding: var(--space-md) 0; }

.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-sm); margin-bottom: var(--space-xl);
}
.admin-stat {
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 14px); padding: var(--space-md);
  box-shadow: var(--shadow-sm); text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.admin-stat__num { font-size: var(--font-2xl); font-weight: 700; color: var(--color-primary-dark); }
.admin-stat__lbl { font-size: var(--font-sm); color: var(--color-text-muted); }

.admin-section { margin-bottom: var(--space-xl); }
.admin-section h3 { font-size: var(--font-lg); margin-bottom: var(--space-sm); color: var(--color-text); }

.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-md, 14px); }
.admin-table {
  width: 100%; border-collapse: collapse; background: var(--color-bg-card);
  border: 1px solid var(--color-border); border-radius: var(--radius-md, 14px);
  overflow: hidden; font-size: var(--font-sm);
}
.admin-table th, .admin-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap;
}
.admin-table th { background: var(--color-bg-elevated); color: var(--color-text-muted); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td:first-child { white-space: normal; word-break: break-word; }

.admin-role {
  padding: 4px 8px; border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--color-border); background: var(--color-bg);
  color: var(--color-text); font-size: var(--font-sm);
}
.admin-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: var(--font-xs); font-weight: 600;
}
.admin-badge--super { background: var(--color-accent); color: var(--ink); }

.admin-feedback { display: flex; flex-direction: column; gap: var(--space-sm); }
.admin-fb {
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 14px); padding: var(--space-md); box-shadow: var(--shadow-xs);
}
.admin-fb__top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }
.admin-fb__stars { color: var(--color-accent); letter-spacing: 1px; }
.admin-fb__meta { font-size: var(--font-xs); color: var(--color-text-light); }
.admin-fb__msg { margin: 6px 0 0; color: var(--color-text); white-space: pre-wrap; }
.admin-fb__page {
  display: inline-block; margin-top: 6px; font-size: var(--font-xs);
  color: var(--color-text-muted); background: var(--color-bg-elevated);
  padding: 2px 8px; border-radius: 999px;
}

/* ═══ VLAK-OBJECTEN (siertuin, slim gerenderd) ═══════════════ */
.palette-hint {
  font-size: var(--font-xs); color: var(--color-text-muted);
  margin: -2px 0 8px; line-height: 1.35;
}

.garden-objects {
  position: absolute; inset: 0;
  pointer-events: none;           /* gaten laten kliks door naar het grid */
  z-index: 3;                     /* boven grid, onder ambient (z5) */
}

.garden-object {
  position: absolute; box-sizing: border-box;
  pointer-events: auto;
  border: 2px solid; border-radius: var(--radius-md, 14px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; overflow: hidden; cursor: pointer;
  box-shadow: 0 4px 10px rgba(58,42,28,0.16), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.garden-object:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(58,42,28,0.22), inset 0 1px 0 rgba(255,255,255,0.3);
}
.garden-object__icon {
  font-size: 1.5rem; line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(58,42,28,0.28));
}
.garden-object__label {
  font-size: 0.62rem; font-weight: 600; color: var(--ink);
  background: rgba(255,253,247,0.78); padding: 1px 7px; border-radius: 999px;
  max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.garden-object__del {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; padding: 0;
  border: none; border-radius: 50%;
  background: var(--color-danger); color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s ease;
}
.garden-object:hover .garden-object__del { opacity: 1; }
.garden-object.just-placed { animation: ag-pop .28s ease; }

.garden-object-preview {
  position: absolute; box-sizing: border-box;
  pointer-events: none; z-index: 6;
  border: 2px dashed var(--color-primary-dark);
  background: rgba(143,175,136,0.22);
  border-radius: var(--radius-md, 14px);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: var(--color-primary-dark);
  text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

@keyframes ag-pop { 0% { transform: scale(0.82); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .garden-object.just-placed { animation: none; } }

/* ═══ COMPANION PLANTING ═══════════════════════════════════ */
/* Waarschuwingsbadge op een cel met een botsende buur */
.garden-cell.has-clash::after {
  content: "⚠";
  position: absolute; top: -1px; right: 1px;
  font-size: 9px; line-height: 1;
  color: var(--color-danger);
  text-shadow: 0 0 2px #fff, 0 0 3px #fff;
  pointer-events: none; z-index: 2;
}
[data-theme="dark"] .garden-cell.has-clash::after {
  text-shadow: 0 0 2px #000, 0 0 3px #000;
}

/* Companion-sectie in de plant-info popup */
.plant-info__companion {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--color-border-light);
}
.pi-comp { font-size: 0.72rem; display: flex; flex-direction: column; line-height: 1.3; }
.pi-comp strong { font-size: 0.7rem; color: var(--color-text); }
.pi-comp span { color: var(--color-text-muted); }
.pi-comp--good strong { color: var(--color-success); }
.pi-comp--bad strong  { color: var(--color-danger); }
.pi-comp--note {
  color: var(--color-text-muted); font-style: italic;
  background: var(--color-bg-elevated);
  padding: 5px 8px; border-radius: var(--radius-sm, 8px);
}

/* ═══ SNOEIKALENDER + STEKADVIES (Fase 2) ═══════════════════ */
.snoei-calendar { overflow-x: auto; }
.snoei-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.snoei-table th, .snoei-table td {
  border: 1px solid var(--color-border-light); padding: 4px 6px; text-align: center;
}
.snoei-table th { color: var(--color-text-muted); font-weight: 600; }
.snoei-table th.is-now, .snoei-table td.is-now { background: var(--color-accent-light, rgba(232,199,102,0.18)); }
.snoei-name { text-align: left !important; white-space: nowrap; font-weight: 600; color: var(--color-text); }
.snoei-bar { height: 8px; border-radius: 4px; background: var(--color-secondary, #9c7a55); }

.snoei-tips { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.snoei-tip {
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 14px); padding: 10px 12px; box-shadow: var(--shadow-xs);
}
.snoei-tip__head { display: flex; align-items: center; gap: 6px; }
.snoei-tip__when {
  margin-left: auto; font-size: 0.7rem; color: var(--color-secondary);
  background: var(--color-bg-elevated); padding: 1px 8px; border-radius: 999px;
}
.snoei-tip__how { margin: 5px 0 0; font-size: 0.78rem; color: var(--color-text); line-height: 1.35; }
.snoei-tip__not { margin: 4px 0 0; font-size: 0.74rem; color: var(--color-danger); }
.snoei-tip__warn { margin: 4px 0 0; font-size: 0.74rem; color: var(--color-warning); }
.snoei-tip__bron {
  display: inline-block; margin-top: 6px; font-size: 0.62rem; font-style: italic;
  color: var(--color-text-light);
}
.snoei-legend { margin-top: 8px; font-size: 0.72rem; color: var(--color-text-muted); }

/* Care-sectie in de plant-info popup */
.plant-info__care {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--color-border-light);
}
.pi-care { font-size: 0.72rem; display: flex; flex-direction: column; line-height: 1.3; }
.pi-care strong { font-size: 0.7rem; color: var(--color-secondary); }
.pi-care span { color: var(--color-text-muted); }
