/* GardenLog — Design System */

:root {
  --bg:         #faf7f0;
  --bg-elev:    #ffffff;
  --bg-sunken:  #f3eee2;
  --bg-tint:    #ede6d3;
  --line:       #e6dfc9;
  --line-strong:#d6cbac;

  --ink:   #2a2a22;
  --ink-2: #4a4a3e;
  --ink-3: #7a7568;
  --ink-4: #a8a290;

  --moss-50:  #eef2e7;
  --moss-100: #d8e0c5;
  --moss-200: #b9c79c;
  --moss-300: #93a875;
  --moss-400: #6d8852;
  --moss-500: #4f6c3b;
  --moss-600: #3d5a2c;
  --moss-700: #2f4623;
  --moss-800: #243619;

  --terra:      #b85c3a;
  --terra-soft: #e8b89c;
  --ochre:      #c79a3f;
  --ochre-soft: #ead9a8;
  --sky:        #6b9bb3;
  --sky-soft:   #c8dde6;
  --berry:      #8a3a4a;

  /* Status colors */
  --st-planned:   #a8a290;
  --st-sown:      #c79a3f;
  --st-planted:   #93a875;
  --st-growing:   #4f6c3b;
  --st-harvest:   #b85c3a;
  --st-harvesting:#b85c3a;
  --st-done:      #7a7568;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(60,50,20,.05);
  --shadow:    0 1px 2px rgba(60,50,20,.04), 0 4px 12px rgba(60,50,20,.05);
  --shadow-lg: 0 2px 4px rgba(60,50,20,.04), 0 12px 32px rgba(60,50,20,.08);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg:         #1a1d17;
  --bg-elev:    #232720;
  --bg-sunken:  #151813;
  --bg-tint:    #2a2e26;
  --line:       #2f342a;
  --line-strong:#404635;
  --ink:   #ece8d9;
  --ink-2: #c8c3b1;
  --ink-3: #918d7d;
  --ink-4: #5e5b50;
  --moss-50:  #243619;
  --moss-100: #2f4623;
  --moss-200: #3d5a2c;
  --moss-300: #4f6c3b;
  --moss-400: #6d8852;
  --moss-500: #93a875;
  --moss-600: #b9c79c;
  --moss-700: #d8e0c5;
  --moss-800: #eef2e7;
  --terra-soft: #5a3528;
  --ochre-soft: #4a3a1c;
  --sky-soft:   #2a4250;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow:    0 1px 2px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.25), 0 12px 32px rgba(0,0,0,.5);
}

/* ── Accent colors ── */
[data-accent="sage"]      { --moss-500: #6d8852; --moss-600: #556d3e; --moss-700: #3d5a2c; --moss-50: #eef3e6; --moss-100: #d4e2c0; }
[data-accent="terra"]     { --moss-500: #b85c3a; --moss-600: #9e4a2a; --moss-700: #7a361e; --moss-50: #fdf0eb; --moss-100: #f5ccbb; }
[data-accent="ochre"]     { --moss-500: #c79a3f; --moss-600: #a87d2e; --moss-700: #7a5c1e; --moss-50: #fdf6e3; --moss-100: #f5e3a8; }
[data-accent="cedar"]     { --moss-500: #7a5a3a; --moss-600: #624829; --moss-700: #4a3418; --moss-50: #f5ede3; --moss-100: #e0ccb0; }
[data-accent="lavender"]  { --moss-500: #7a6db8; --moss-600: #6358a0; --moss-700: #4a4080; --moss-50: #f0eef8; --moss-100: #d4cfed; }

/* ── Density ── */
[data-density="compact"]   { --nav-pad: 10px 24px; --page-pad: 20px 24px 60px; --card-pad: 16px; }
[data-density="spacious"]  { --nav-pad: 18px 40px; --page-pad: 40px 48px 100px; --card-pad: 32px; }

/* ── Font size ── */
[data-fontsize="sm"] { font-size: 13px; }
[data-fontsize="lg"] { font-size: 17px; }

/* ── No-serif mode ── */
[data-serif="off"] h1, [data-serif="off"] h2, [data-serif="off"] h3,
[data-serif="off"] h4, [data-serif="off"] .gl-logo span,
[data-serif="off"] .gl-page-title { font-family: var(--sans) !important; }

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in oklch, var(--moss-100) 40%, transparent) 0%, transparent 50%),
    radial-gradient(800px 500px at 0% 100%, color-mix(in oklch, var(--ochre-soft) 30%, transparent) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 17px; }
p  { margin: 0; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
a      { color: inherit; }

/* ── Shell & nav ── */
.gl-shell { min-height: 100vh; display: flex; flex-direction: column; }

.gl-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px 32px;
  background: color-mix(in oklch, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.gl-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 500; font-size: 19px;
  letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
}

.gl-logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--moss-500), var(--moss-700));
  display: grid; place-items: center; color: var(--moss-50);
}

.gl-nav-tabs {
  display: flex; gap: 2px; padding: 4px;
  background: var(--bg-sunken); border-radius: 12px; border: 1px solid var(--line);
}

.gl-nav-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 8px;
  background: transparent; border: 0;
  color: var(--ink-3); font-weight: 500; font-size: 13.5px;
  transition: all 0.15s ease; text-decoration: none;
}
.gl-nav-tab:hover                { color: var(--ink); background: color-mix(in oklch, var(--bg-elev) 60%, transparent); }
.gl-nav-tab[aria-current="page"] { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-sm); }
.gl-nav-tab.gl-disabled          { color: var(--ink-4); pointer-events: none; }

.gl-nav-end { display: flex; align-items: center; gap: 10px; }

.gl-iconbtn {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink-2);
  display: grid; place-items: center; transition: all 0.15s ease;
}
.gl-iconbtn:hover    { border-color: var(--line-strong); color: var(--ink); }
.gl-iconbtn:disabled { opacity: 0.4; pointer-events: none; }

.gl-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ochre), var(--terra));
  color: #fff8e7; font-weight: 600; font-size: 13px;
  display: grid; place-items: center;
}

/* ── Page layout ── */
.gl-page {
  flex: 1; max-width: 1320px; width: 100%;
  margin: 0 auto; padding: 28px 32px 80px;
}

.gl-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 24px;
}
.gl-page-title { font-size: 36px; letter-spacing: -0.025em; margin-bottom: 4px; }
.gl-page-sub   { color: var(--ink-3); font-size: 14px; }

/* ── Cards ── */
.gl-card {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px;
  transition: border-color 0.15s;
}
.gl-card-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.gl-card-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ── Buttons ── */
.gl-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--ink); font-weight: 500; font-size: 13.5px;
  transition: all 0.15s; text-decoration: none; cursor: pointer;
}
.gl-btn:hover          { border-color: var(--line-strong); background: var(--bg-tint); }
.gl-btn:disabled       { opacity: 0.45; pointer-events: none; }

.gl-btn-primary        { background: var(--moss-600); color: var(--moss-50); border-color: var(--moss-700); }
.gl-btn-primary:hover  { background: var(--moss-700); border-color: var(--moss-800); }

.gl-btn-ghost          { background: transparent; border-color: transparent; color: var(--ink-2); }
.gl-btn-ghost:hover    { background: var(--bg-tint); border-color: var(--line); }

.gl-btn-sm             { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }

/* ── Form fields ── */
.gl-field {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-elev); color: var(--ink);
  font-family: var(--sans); font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.gl-field:focus {
  border-color: var(--moss-500);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--moss-500) 15%, transparent);
}
.gl-field::placeholder { color: var(--ink-4); }

textarea.gl-field  { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }

select.gl-field {
  padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

.gl-field-icon-wrap { position: relative; }
.gl-field-icon-wrap .gl-field { padding-left: 32px; }
.gl-field-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); pointer-events: none; display: flex;
}

/* ── Misc ── */
.gl-divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.gl-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-tint); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 12px; font-weight: 500;
}

/* ── Option cards (bed size, sun, soil) ── */
.gl-option-card {
  padding: 14px; border: 1px solid var(--line); background: var(--bg-elev);
  border-radius: var(--radius); cursor: pointer; text-align: left;
  font-family: var(--sans); display: flex; flex-direction: column; gap: 6px;
  transition: all 0.15s; color: var(--ink); width: 100%;
}
.gl-option-card:hover { border-color: var(--line-strong); }
.gl-option-card.selected { border: 1.5px solid var(--moss-600); background: var(--moss-50); }

.gl-option-card .opt-label { font-size: 13px; font-weight: 500; }
.gl-option-card .opt-hint  { font-size: 11.5px; color: var(--ink-3); }
.gl-option-card .opt-icon  { color: var(--ink-3); transition: color 0.15s; }
.gl-option-card.selected .opt-icon { color: var(--moss-600); }

/* ── Style pills (garden type) ── */
.gl-style-pill {
  display: inline-flex; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-elev); cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: var(--sans);
  color: var(--ink-2); transition: all 0.15s; white-space: nowrap;
}
.gl-style-pill:hover    { border-color: var(--line-strong); color: var(--ink); }
.gl-style-pill.selected { border-color: var(--moss-600); background: var(--moss-50); color: var(--moss-700); }

/* ── Wizard ── */
.wizard-step         { display: none; }
.wizard-step.active  { display: block; }

.wizard-stepper {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px;
}
.stepper-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px; border: 0;
  background: transparent; text-align: left; font-family: var(--sans);
  transition: background 0.15s; cursor: default;
}
.stepper-btn.clickable { cursor: pointer; }
.stepper-btn.active    { background: var(--moss-50); }

.stepper-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--bg-tint); color: var(--ink-3); border: 1px solid var(--line);
  transition: all 0.15s;
}
.stepper-btn.active .stepper-num,
.stepper-btn.done .stepper-num { background: var(--moss-600); color: var(--moss-50); border-color: transparent; }

.stepper-label { font-size: 13px; font-weight: 500; color: var(--ink-3); transition: color 0.15s; }
.stepper-btn.active .stepper-label { color: var(--ink); }
.stepper-btn.done  .stepper-label  { color: var(--ink-2); }
.stepper-hint { font-size: 11.5px; color: var(--ink-3); }

/* ── Welcome hero ── */
.welcome-hero {
  padding: 48px 32px 8px; text-align: center;
  background: linear-gradient(180deg, color-mix(in oklch, var(--moss-50) 80%, var(--bg)) 0%, transparent 100%);
  border-bottom: 1px solid var(--line);
}
.welcome-logo {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 18px;
  background: linear-gradient(135deg, var(--moss-500), var(--moss-700));
  display: grid; place-items: center;
  box-shadow: 0 8px 24px color-mix(in oklch, var(--moss-700) 25%, transparent);
}
.welcome-tagline {
  font-family: var(--display); font-size: 14px;
  color: var(--moss-600); font-style: italic;
}

/* ── Preview garden grid ── */
.preview-garden {
  background: color-mix(in oklch, var(--moss-50) 50%, var(--bg-sunken));
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 11px,
      color-mix(in oklch, var(--moss-200) 25%, transparent) 11px,
      color-mix(in oklch, var(--moss-200) 25%, transparent) 12px),
    repeating-linear-gradient(90deg, transparent 0, transparent 11px,
      color-mix(in oklch, var(--moss-200) 25%, transparent) 11px,
      color-mix(in oklch, var(--moss-200) 25%, transparent) 12px);
  border-radius: 8px; padding: 14px; aspect-ratio: 1;
  display: grid; gap: 10px; border: 1px solid var(--line);
  overflow: hidden;
}

/* ── Tip box ── */
.gl-tip {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px; background: var(--bg-tint); border-radius: var(--radius);
  font-size: 12.5px; color: var(--ink-2);
}
.gl-tip-icon { color: var(--moss-600); flex-shrink: 0; margin-top: 1px; }

/* ── Autocomplete dropdown ── */
.gl-autocomplete {
  position: absolute; left: 0; right: 0; z-index: 30;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); margin-top: 4px; overflow: hidden;
}
.gl-autocomplete-item {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 1px;
  padding: 10px 14px; border: 0; background: transparent;
  cursor: pointer; font-family: var(--sans); color: var(--ink);
  border-bottom: 1px solid var(--line); transition: background 0.1s;
}
.gl-autocomplete-item:last-child { border-bottom: 0; }
.gl-autocomplete-item:hover      { background: var(--bg-tint); }
.gl-autocomplete-empty { padding: 12px 14px; font-size: 13px; color: var(--ink-3); }

/* ── Section header ── */
.gl-section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.gl-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ── Bed card (dashboard + potager) ── */
.gl-bed {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 0; overflow: hidden;
  transition: all 0.15s ease; cursor: pointer;
  text-align: left; font-family: inherit; color: inherit;
  display: flex; flex-direction: column; width: 100%;
  text-decoration: none;
}
.gl-bed:hover { border-color: var(--moss-300); transform: translateY(-1px); box-shadow: var(--shadow); }
.gl-bed--active { border-color: var(--moss-500); box-shadow: 0 0 0 3px color-mix(in oklch, var(--moss-300) 35%, transparent); }

.gl-bed-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  aspect-ratio: 1; gap: 1px; background: var(--line);
}
.gl-bed-cell {
  background: var(--moss-50);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 8px; font-size: 22px; position: relative;
}
.gl-bed-cell.empty {
  background: var(--bg-sunken);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 6px,
    color-mix(in oklch, var(--ink-4) 15%, transparent) 6px,
    color-mix(in oklch, var(--ink-4) 15%, transparent) 7px);
}
.gl-bed-cell-label {
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  text-align: center; line-height: 1.1; width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gl-bed-foot {
  padding: 12px 14px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; border-top: 1px solid var(--line);
}
.gl-bed-name { font-family: var(--display); font-size: 15px; font-weight: 500; color: var(--ink); }
.gl-bed-meta { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 1px; }

/* ── Status badge (new design system) ── */
.gl-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  border: 1px solid transparent; white-space: nowrap;
}
.gl-badge::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.gl-badge-planned    { color: var(--ink-3);    background: var(--bg-tint); }
.gl-badge-sown       { color: #8a6818;          background: var(--ochre-soft); }
.gl-badge-planted    { color: var(--moss-600);  background: var(--moss-50); }
.gl-badge-growing    { color: var(--moss-50);   background: var(--moss-500); }
.gl-badge-harvest    { color: #fff;             background: var(--terra); }
.gl-badge-harvesting { color: #fff;             background: var(--terra); }
.gl-badge-done       { color: var(--ink-3);    background: var(--bg-sunken); }

/* ── Garden plan (potager schematic) ── */
.gl-garden-plan-bg {
  position: relative;
  background: color-mix(in oklch, var(--moss-50) 50%, var(--bg-sunken));
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 19px,
      color-mix(in oklch, var(--moss-200) 25%, transparent) 19px,
      color-mix(in oklch, var(--moss-200) 25%, transparent) 20px),
    repeating-linear-gradient(90deg, transparent 0, transparent 19px,
      color-mix(in oklch, var(--moss-200) 25%, transparent) 19px,
      color-mix(in oklch, var(--moss-200) 25%, transparent) 20px);
  border-radius: 12px; border: 1px solid var(--line);
  padding: 12px; min-height: 600px; overflow: auto;
}
.gl-plan-path-v {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 28px;
  transform: translateX(-50%);
  background: color-mix(in oklch, var(--ochre-soft) 70%, transparent);
  border-left: 1px dashed var(--ochre); border-right: 1px dashed var(--ochre);
}
.gl-plan-path-h {
  position: absolute; top: 50%; left: 0; right: 0; height: 28px;
  transform: translateY(-50%);
  background: color-mix(in oklch, var(--ochre-soft) 70%, transparent);
  border-top: 1px dashed var(--ochre); border-bottom: 1px dashed var(--ochre);
}
.gl-plan-compass {
  position: absolute; top: 14px; right: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-3); font-size: 10px; font-weight: 600;
}
.gl-plan-beds {
  position: relative; display: grid;
  grid-template-columns: 1fr 1fr; gap: 40px;
  height: 100%; padding: 8px 24px;
}
.gl-plan-bed {
  background: var(--bg-elev); border-radius: 8px; padding: 8px;
  cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column; gap: 4px;
  border: 1.5px solid var(--moss-300); overflow: hidden; user-select: none;
}
.gl-plan-bed:hover  { border-color: var(--moss-500); box-shadow: var(--shadow); }
.gl-plan-bed--active {
  border: 2px solid var(--moss-600);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--moss-300) 30%, transparent);
}
.plan-edit-mode .gl-plan-bed { cursor: grab; }
.plan-rotate-btn {
  display: none; position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 20px; height: 20px; border-radius: 4px; padding: 0; line-height: 1;
  border: 1px solid var(--line); background: var(--bg-elev);
  cursor: pointer; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-3);
}
.plan-rotate-btn:hover { background: var(--moss-50); border-color: var(--moss-400); color: var(--moss-600); }
.plan-edit-mode .plan-rotate-btn { display: flex; }
.gl-plan-element {
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden; user-select: none; cursor: pointer; padding: 5px;
  border: 1.5px solid; border-radius: 6px;
  transition: box-shadow 0.15s ease;
}
.plan-edit-mode .gl-plan-element { cursor: grab; }
.plan-el-selected {
  box-shadow: 0 0 0 2.5px var(--moss-500), var(--shadow) !important;
}
#plan-el-controls {
  display: none; flex-direction: row; align-items: center; gap: 4px;
  padding: 3px 7px; position: absolute; z-index: 15;
  background: var(--bg-elev); border: 1.5px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); white-space: nowrap;
  transform: translateX(-50%);
}
.plan-add-palette {
  display: none; gap: 6px; flex-wrap: wrap; align-items: center;
  padding-top: 10px; border-top: 1px solid var(--line); margin-top: 10px;
}
.plan-resize-handle {
  display: none; position: absolute; bottom: 0; right: 0; z-index: 4;
  width: 13px; height: 13px; cursor: se-resize;
  background: var(--moss-500); opacity: 0.55;
  border-radius: 3px 0 3px 0;
}
.plan-resize-handle:hover { opacity: 1; }
.plan-edit-mode .plan-el-selected .plan-resize-handle { display: block; }
/* Pour les éléments circulaires, le handle doit rester dans le cercle */
.gl-plan-element[data-circular] .plan-resize-handle { bottom: 16%; right: 16%; border-radius: 3px; }
.gl-plan-bed-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; flex: 1;
}
.gl-plan-bed-name {
  font-family: var(--display); font-size: 11px; color: var(--ink);
  text-align: center; margin-top: 2px;
}

/* ── Bed detail panel ── */
.gl-bed-detail-header {
  padding: 18px 20px;
  background: color-mix(in oklch, var(--moss-50) 60%, var(--bg-elev));
  border-bottom: 1px solid var(--line);
}
.gl-bed-detail-cell-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg-tint); border: 1px solid var(--line);
}
.gl-bed-detail-cell-row.empty {
  background: transparent;
  border: 1px dashed var(--line-strong); color: var(--ink-4);
}
.gl-bed-detail-pos {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  background: var(--bg-elev); display: grid; place-items: center;
  font-size: 10px; font-weight: 600; color: var(--ink-3);
}
.gl-bed-detail-cell-row.empty .gl-bed-detail-pos { background: var(--bg-sunken); }

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 5px;
  border: 2px solid var(--bg); background-clip: padding-box;
}
::-webkit-scrollbar-track { background: transparent; }

/* ── Potager layout ── */
.gl-potager-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}

.gl-beds-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gl-bed-section {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gl-bed-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
  gap: 12px;
}
.gl-bed-section-header--clickable {
  cursor: pointer; transition: background 0.15s;
}
.gl-bed-section-header--clickable:hover { background: var(--bg-tint); }
.gl-bed-header--active {
  background: color-mix(in oklch, var(--moss-50) 70%, var(--bg-sunken));
  border-bottom-color: var(--moss-200);
}
.gl-bed-section-name { font-size: 14px; font-weight: 600; color: var(--ink); }

/* ── Drag-and-drop cell states ── */
.gl-cell--drag-over { box-shadow: 0 0 0 2px var(--moss-400); background: var(--moss-50) !important; border-color: var(--moss-400) !important; border-style: solid !important; }
.gl-cell--dragging  { opacity: 0.45; }

/* ── Side panel (potager) ── */
.gl-side-panel-wrap {
  position: sticky;
  top: 76px;
}
.gl-side-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 240px;
}
.gl-side-panel--empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 52px 24px; text-align: center;
  color: var(--ink-4);
}
.gl-side-success {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 36px 24px; text-align: center; gap: 6px;
}

.gl-bed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.gl-bed-card {
  background: var(--bg-elev);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  min-height: 72px;
  display: flex; flex-direction: column; gap: 8px;
}
.gl-bed-card:hover          { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.gl-bed-card--active        { border-color: var(--moss-500); background: color-mix(in oklch, var(--moss-50) 60%, var(--bg-elev)); }

.gl-bed-card-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
}
.gl-bed-card-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.gl-bed-dims      { font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.gl-bed-empty     { font-size: 12px; color: var(--ink-4); font-style: italic; }

.gl-bed-pills {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.gl-planting-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.gl-pill-planned    { background: var(--bg-tint); color: var(--ink-3); }
.gl-pill-sown       { background: var(--sky-soft); color: #2e6e8e; }
.gl-pill-planted    { background: var(--ochre-soft); color: #8a6520; }
.gl-pill-growing    { background: var(--moss-50); color: var(--moss-700); }
.gl-pill-harvesting { background: color-mix(in oklch, #e8721c 18%, transparent); color: #b5520e; }
.gl-pill-done       { background: var(--bg-sunken); color: var(--ink-4); }

/* ── Bed panel ── */
.gl-bed-panel-wrap {
  position: sticky;
  top: 76px;
}
.gl-bed-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
}
.gl-bed-panel--empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 52px 24px; text-align: center;
  color: var(--ink-4);
}

.gl-bed-panel-inner { display: flex; flex-direction: column; }

.gl-bed-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}
.gl-bed-panel-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.gl-bed-panel-dims { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.gl-planting-list {
  padding: 8px 0;
}
.gl-planting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 18px;
  transition: background 0.12s;
}
.gl-planting-row:hover { background: var(--bg-tint); }

.gl-planting-row-info {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.gl-planting-emoji  { font-size: 16px; flex-shrink: 0; }
.gl-planting-name   { font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-planting-variety { color: var(--ink-3); font-weight: 400; }

.gl-status-badge {
  flex-shrink: 0; padding: 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.gl-status-planned    { background: var(--bg-tint); color: var(--ink-3); }
.gl-status-sown       { background: var(--sky-soft); color: #2e6e8e; }
.gl-status-planted    { background: var(--ochre-soft); color: #8a6520; }
.gl-status-growing    { background: var(--moss-50); color: var(--moss-700); }
.gl-status-harvesting { background: color-mix(in oklch, #e8721c 18%, transparent); color: #b5520e; }
.gl-status-done       { background: var(--bg-sunken); color: var(--ink-4); }

.gl-planting-delete {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid transparent; background: transparent;
  color: var(--ink-4); cursor: pointer;
  display: grid; place-items: center; transition: all 0.12s;
}
.gl-planting-row:hover .gl-planting-delete { border-color: var(--line); color: var(--ink-3); }
.gl-planting-delete:hover { background: color-mix(in oklch, var(--terra) 12%, transparent); border-color: var(--terra-soft); color: var(--terra); }

.gl-panel-empty {
  padding: 24px 18px 8px;
  font-size: 13px; color: var(--ink-4); font-style: italic;
}
.gl-panel-divider {
  height: 1px; background: var(--line); border: 0; margin: 8px 0 0;
}

/* ── Add planting form ── */
.gl-add-form {
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.gl-add-form-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px;
}
.gl-add-form-fields {
  display: flex; flex-direction: column; gap: 6px;
}

/* ── Bed cell grid ── */
.gl-cell-grid {
  display: grid;
  gap: 4px;
}

.gl-cell {
  border-radius: 7px;
  border: 1.5px dashed var(--line-strong);
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; text-align: center;
  padding: 4px; min-height: 60px;
  transition: all 0.13s;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.gl-cell--empty          { background: var(--bg-sunken); color: var(--ink-4); }
.gl-cell--empty:hover    { border-color: var(--moss-400); border-style: solid; background: var(--moss-50); color: var(--moss-600); }
.gl-cell--occupied       { border-style: solid; border-color: var(--moss-300); background: color-mix(in oklch, var(--moss-50) 50%, var(--bg-elev)); }
.gl-cell--occupied:hover { border-color: var(--moss-500); background: var(--moss-50); }
.gl-cell--selected       { box-shadow: 0 0 0 2px var(--moss-500); }

.gl-cell-emoji { font-size: 18px; line-height: 1.1; }
.gl-cell-name  { font-size: 10px; color: var(--ink-2); font-weight: 500; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; text-align: center; }
.gl-cell-plus  { font-size: 18px; line-height: 1; opacity: .5; }

/* ── Garden-type cell overrides (legacy) ── */
.gl-grid-inground .gl-cell        { aspect-ratio: auto; height: 38px; border-radius: 4px; }
.gl-grid-inground .gl-cell-emoji  { font-size: 16px; }
.gl-grid-container .gl-cell       { border-radius: 50%; }

/* ── Bed-type cell overrides ── */
/* Carré surélevé : default square, no override */

/* Planche (inground) : strips horizontaux */
.gl-bed-inground .gl-cell        { aspect-ratio: auto; height: 36px; border-radius: 4px; }
.gl-bed-inground .gl-cell-emoji  { font-size: 15px; }
.gl-bed-inground .gl-cell-name   { display: none; }

/* Bac : carrés arrondis */
.gl-bed-container .gl-cell       { border-radius: 12px; }

/* Pot : cellules rondes */
.gl-bed-pot .gl-cell             { border-radius: 50%; }

/* Jardinière : strips très étroits */
.gl-bed-planter .gl-cell         { aspect-ratio: auto; height: 30px; border-radius: 3px; }
.gl-bed-planter .gl-cell-emoji   { font-size: 14px; }
.gl-bed-planter .gl-cell-name    { display: none; }

/* Plan view : span & shape helpers */
.gl-plan-bed--wide               { grid-column: span 2; }

/* ── Cell detail / form ── */
.gl-cell-detail-area { padding: 8px 12px; }

.gl-cell-info {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
}
.gl-cell-info-emoji { font-size: 22px; flex-shrink: 0; }
.gl-cell-info-text  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gl-cell-info-text strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.gl-cell-info-text span   { font-size: 12px; color: var(--ink-3); }

.gl-cell-form {
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; gap: 7px;
}
.gl-cell-form-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-3);
}

.gl-unpositioned { padding-bottom: 4px; }

/* ── Dashboard mini grid ── */
.gl-mini-grid {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}
.gl-mini-cell {
  height: 18px; border-radius: 3px;
  background: var(--bg-tint);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1;
  border: 1px solid var(--line);
}
.gl-mini-cell--occupied { background: var(--moss-100); border-color: var(--moss-200); }

/* Inground mini: short horizontal strips */
.gl-mini-grid-inground .gl-mini-cell { height: 10px; border-radius: 2px; font-size: 8px; }
/* Container mini: circles */
.gl-mini-grid-container .gl-mini-cell { border-radius: 50%; aspect-ratio: 1; height: auto; }
/* Mixed / raised: default */

/* ── Responsive ── */
@media (max-width: 880px) {
  .gl-nav          { padding: 12px 18px; }
  .gl-nav-tabs     { display: none; }
  .gl-page         { padding: 20px 18px 60px; }
  .gl-potager-layout { grid-template-columns: 1fr; }
  .gl-bed-panel-wrap { position: static; }
  .gl-side-panel-wrap { position: static; }
}

/* ── Journal ── */
/* ── Journal — filter sidebar ── */
.gl-filter-chip {
  width: 100%; display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; border-radius: 8px; border: 0;
  background: transparent; color: var(--ink-2); font-size: 13px;
  font-weight: 400; cursor: pointer; text-align: left;
  font-family: var(--sans); transition: background 0.12s;
}
.gl-filter-chip:hover { background: var(--bg-tint); }
.gl-filter-chip.active {
  background: var(--bg-elev); box-shadow: var(--shadow-sm);
  color: var(--ink); font-weight: 500;
}
.gl-filter-chip-count { margin-left: auto; font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

/* ── Journal — entry card ── */
.gl-journal-card {
  display: flex; align-items: flex-start; gap: 14px; padding: 18px;
  transition: border-color 0.15s;
}
.gl-journal-card:hover { border-color: var(--line-strong); }
.gl-entry-actions {
  display: flex; gap: 4px; align-items: center; opacity: 0; transition: opacity 0.15s; flex-shrink: 0;
}
.gl-journal-card:hover .gl-entry-actions { opacity: 1; }
.gl-journal-card:hover .gl-photo-del { opacity: 1 !important; }
.gl-entry-action-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent;
  background: none; cursor: pointer; display: grid; place-items: center;
  color: var(--ink-4); transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.gl-entry-action-btn:hover { background: var(--bg-tint); border-color: var(--line); color: var(--ink-2); }
.gl-entry-action-btn--delete:hover { background: color-mix(in oklch, var(--terra) 10%, transparent); border-color: var(--terra-soft); color: var(--terra); }
.gl-journal-badge {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
}
.gl-journal-body { flex: 1; min-width: 0; }
.gl-journal-title {
  font-family: var(--display); font-size: 16px; font-weight: 500;
  color: var(--ink); margin: 0 0 4px; display: flex; align-items: baseline;
  gap: 10px; flex-wrap: wrap;
}
.gl-weight-pill {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600;
  color: var(--terra); font-variant-numeric: tabular-nums;
  background: color-mix(in oklch, var(--terra-soft) 70%, transparent);
  padding: 2px 8px; border-radius: 999px;
}
.gl-journal-meta {
  display: flex; align-items: center; gap: 10px; font-size: 12px;
  color: var(--ink-3); margin-bottom: 8px; flex-wrap: wrap;
}
.gl-journal-notes {
  font-size: 13.5px; color: var(--ink-2); margin: 0;
  line-height: 1.55; text-wrap: pretty;
}
.gl-journal-feed { display: flex; flex-direction: column; gap: 10px; }
.gl-journal-day-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-4);
  padding-top: 18px; margin-top: 4px;
}
.gl-journal-day-label:first-child { padding-top: 0; margin-top: 0; }
.gl-bilan-card { background: var(--bg-tint); border-color: var(--line-strong); margin-top: 16px; }

/* ── Calendrier mensuel ── */
.gl-cal-filter {
  font-size: 11.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer; transition: all .15s;
}
.gl-cal-week-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.gl-cal-day-header {
  padding: 9px 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-4); text-align: center;
}
.gl-cal-body {}
.gl-cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.gl-cal-week:last-child { border-bottom: 0; }
.gl-cal-day {
  min-height: 96px; padding: 7px 7px 6px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px;
  transition: background 0.12s;
}
.gl-cal-day:last-child { border-right: 0; }
.gl-cal-day:hover { background: color-mix(in oklch, var(--moss-500) 3%, transparent); }
.gl-cal-day--empty { background: color-mix(in oklch, var(--ink) 2%, var(--bg-elev)); }
.gl-cal-day--today { background: color-mix(in oklch, var(--moss-500) 6%, var(--bg-elev)); }
.gl-cal-day-num {
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; line-height: 1; flex-shrink: 0;
}
.gl-cal-day-num--today { background: var(--moss-500); color: #fff; font-weight: 700; }
.gl-cal-events { display: flex; flex-direction: column; gap: 2px; }
.gl-cal-event {
  font-size: 11px; font-weight: 500; line-height: 1.35;
  padding: 2px 6px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; width: 100%; box-sizing: border-box; cursor: default;
}

/* Alertes sidebar */
.gl-alert-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--ac-bg); border: 1px solid var(--ac-bd);
}
.gl-alert-num {
  font-family: var(--display); font-size: 20px; font-weight: 600;
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--ac-num); color: #fff; border-radius: 9px;
  flex-shrink: 0; line-height: 1;
}

@keyframes gl-slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Soil quiz ───────────────────────────────────────── */
.sq-question { margin-bottom: 12px; }
.sq-label { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.sq-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.sq-btn {
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.sq-btn:hover { border-color: var(--moss-400); color: var(--ink); }
.sq-btn.selected { background: var(--moss-500); border-color: var(--moss-500); color: #fff; font-weight: 500; }
.sq-swatches { gap: 8px; }
.sq-swatch {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 8px; border-radius: 8px; min-width: 52px; gap: 4px;
}
.sq-swatch::before {
  content: ''; display: block; width: 20px; height: 20px; border-radius: 50%;
  background: var(--sw);
  border: 2px solid color-mix(in oklch, var(--sw) 55%, transparent);
}
.sq-swatch span { font-size: 10.5px; }
.sq-swatch.selected {
  background: color-mix(in oklch, var(--sw) 18%, var(--bg-elev));
  border-color: color-mix(in oklch, var(--sw) 55%, transparent);
}
