/* ═══════════════════════════════════════════════════════════════════
   COMPAGNONS ARTISTES · Carnet de Jardin Numérique
   Design System v2 — Guide de style canonique · Mai 2026
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --paper:        #F4EFE3;
  --paper-deep:   #ECE5D2;
  --paper-edge:   #D9D0BA;
  --ink:          #1C1C1A;
  --ink-soft:     #3A3833;
  --ink-mute:     #6B6860;
  --ink-faint:    #9A958A;
  --leaf:         #2D5A1B;
  --leaf-deep:    #1F4012;
  --amber:        #C47A1E;
  --amber-deep:   #9A5E14;
  --rust:         #A8472B;
  --rust-deep:    #80331C;
  --moss:         #5C6B3A;
  --hair:         rgba(28, 28, 26, 0.10);
  --hair-strong:  rgba(28, 28, 26, 0.18);

  --serif: "Cormorant Garamond", "Libre Baskerville", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 22px;
  --sp-8: 32px;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  background-image:
    radial-gradient(rgba(140, 120, 80, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(180, 160, 110, 0.04) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}
::selection { background: rgba(45, 90, 27, 0.22); }

/* ── Layout principal ───────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
}

/* ── Barre haute ────────────────────────────────────────────────── */
#top-bar {
  position: relative;
  z-index: 20;
  background: linear-gradient(to bottom, var(--paper) 0%, var(--paper) 70%, rgba(244, 239, 227, 0) 100%);
  border-bottom: 1px solid var(--hair);
  padding: var(--sp-4) var(--sp-8) var(--sp-3);
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-shrink: 0;
}

.app-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  align-self: center;
  color: var(--leaf-deep);
  width: 18px;
  height: 18px;
}

.logo-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.logo-sep {
  width: 1px;
  height: 16px;
  background: var(--hair-strong);
  align-self: center;
  display: none;
}
@media (min-width: 560px) { .logo-sep { display: block; } }

.logo-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  white-space: nowrap;
  display: none;
}
@media (min-width: 560px) { .logo-sub { display: inline; } }

#search-container {
  flex: 1;
  position: relative;
  max-width: 420px;
}

#search-input {
  width: 100%;
  height: 38px;
  padding: 0 var(--sp-4) 0 36px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
#search-input::placeholder { color: var(--ink-faint); font-style: italic; }
#search-input:focus {
  background: #fff;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(45, 90, 27, 0.10);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mute);
  pointer-events: none;
}

#search-results {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(28, 28, 26, 0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}
#search-results.visible { display: block; }

.search-result-item {
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  border-bottom: 1px solid var(--hair);
  transition: background 0.15s;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(45, 90, 27, 0.06); }

.search-result-item .nom-commun {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
}
.search-result-item .nom-bot {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.6); color: var(--ink); border-color: rgba(28,28,26,0.28); }
.btn-icon.active { background: rgba(45, 90, 27, 0.08); border-color: var(--leaf); color: var(--leaf-deep); }

/* ── Zone carte ─────────────────────────────────────────────────── */
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
  touch-action: none;
  min-height: 0;
}

#map-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  cursor: grab;
}
#map-canvas:active { cursor: grabbing; }
#map-canvas.edit-mode { cursor: crosshair; }

#map-image {
  position: absolute;
  transform-origin: top left;
  transition: none;
  will-change: transform;
  user-select: none;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
}

#map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  color: var(--ink-mute);
  background: repeating-linear-gradient(
    45deg,
    var(--paper-deep),
    var(--paper-deep) 10px,
    var(--paper-edge) 10px,
    var(--paper-edge) 20px
  );
}
#map-placeholder .placeholder-text {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  padding: var(--sp-4) var(--sp-6);
  background: rgba(244, 239, 227, 0.92);
  border-radius: 2px;
  border: 1px solid var(--hair-strong);
}

/* ── Marqueurs ──────────────────────────────────────────────────── */
.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-inner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--paper);
  border: 1.5px solid var(--paper);
  box-shadow:
    0 1px 0 rgba(0,0,0,0.18),
    0 2px 6px rgba(31, 64, 18, 0.22);
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.18s;
  will-change: transform;
}

.marker[data-statut="bon"]        .marker-inner { background: var(--leaf); }
.marker[data-statut="surveiller"] .marker-inner {
  background: var(--amber);
  box-shadow: 0 0 0 1.5px var(--amber-deep), 0 2px 6px rgba(154, 94, 20, 0.28);
}
.marker[data-statut="critique"]   .marker-inner { background: var(--rust); }

.marker[data-remarquable="true"] .marker-inner {
  position: relative;
  width: 30px;
  height: 30px;
  font-size: 12.5px;
}
.marker[data-remarquable="true"] .marker-inner::after {
  content: "";
  position: absolute;
  top: -5px; right: -5px;
  width: 12px; height: 12px;
  background: var(--paper);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg' fill='%231F4012'%3E%3Cpath d='M6 1.2l1.4 2.9 3.2.4-2.3 2.2.6 3.1L6 8.4 3.1 9.8l.6-3.1L1.4 4.5l3.2-.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 8px;
}

.marker:hover .marker-inner,
.marker.selected .marker-inner {
  transform: scale(1.18);
  box-shadow: 0 2px 0 rgba(0,0,0,0.16), 0 6px 14px rgba(31, 64, 18, 0.28);
}
.marker.selected .marker-inner {
  box-shadow:
    0 0 0 4px rgba(244, 239, 227, 0.95),
    0 0 0 5.5px var(--leaf-deep),
    0 6px 14px rgba(31, 64, 18, 0.30);
}

.marker[data-unpositioned="true"] .marker-inner {
  width: 16px; height: 16px;
  border-style: dashed;
  background: rgba(45, 90, 27, 0.18);
  border-color: var(--leaf-deep);
  color: var(--leaf-deep);
  font-size: 8px;
}

/* Badge mode édition */
.edit-badge {
  position: absolute;
  top: var(--sp-3); right: var(--sp-3);
  background: var(--amber);
  color: #fff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: var(--sp-2) var(--sp-3);
  border-radius: 2px;
  z-index: 15;
  display: none;
  gap: var(--sp-2);
  align-items: center;
}
.edit-badge.visible { display: flex; }

/* Tooltip marqueur */
.marker-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 5px 10px;
  font-family: var(--sans);
  font-size: 12px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  z-index: 20;
}
.marker-tooltip::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--ink);
}
.marker-tooltip em {
  font-family: var(--serif);
  font-style: italic;
  color: rgba(244, 239, 227, 0.75);
  font-size: 11.5px;
  margin-left: 4px;
}
.marker:hover .marker-tooltip { opacity: 1; }

/* ── Barre bas — Invite (trigger) ────────────────────────────────── */
#bottom-bar {
  position: relative;
  z-index: 20;
  background: linear-gradient(to top, var(--paper) 0%, var(--paper) 70%, rgba(244, 239, 227, 0) 100%);
  border-top: 1px solid var(--hair);
  padding: var(--sp-3) var(--sp-6) var(--sp-4);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
#bottom-bar.chat-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
}

.ask-wrap {
  max-width: 880px;
  margin: 0 auto;
}

/* Bouton trigger — ressemble à l'input mais ouvre le chat */
.ask-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
  padding: 0;
}
.ask-trigger:hover {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(45, 90, 27, 0.08);
}
.ask-trigger span {
  flex: 1;
  height: 46px;
  padding: 0 var(--sp-3);
  display: flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-faint);
  font-style: italic;
}

#chat-photo-preview {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: #fff;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
#chat-photo-preview img {
  width: 36px; height: 36px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--hair);
}
#chat-photo-preview button {
  margin-left: auto;
  width: 22px; height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.ask-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ask-box:focus-within {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(45, 90, 27, 0.10);
}

.ask-compagnon-icon {
  width: 18px; height: 18px;
  margin: 0 6px 0 14px;
  color: var(--moss);
  flex: none;
}

#question-input {
  flex: 1;
  height: 46px;
  padding: 0 var(--sp-3);
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
}
#question-input::placeholder { color: var(--ink-faint); font-style: italic; }

#btn-photo {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  margin-right: 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  flex-shrink: 0;
}
#btn-photo:hover { color: var(--leaf-deep); }
#btn-photo svg { width: 17px; height: 17px; }

#btn-send {
  height: 32px;
  margin-right: 6px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--leaf-deep);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
#btn-send:hover { background: var(--leaf); }
#btn-send svg { width: 13px; height: 13px; }

/* ── Panneaux latéraux ──────────────────────────────────────────── */
.sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: linear-gradient(180deg, #FBF8F0 0%, var(--paper) 30%, var(--paper) 100%);
  border-radius: 2px 2px 0 0;
  border-top: 1px solid var(--hair-strong);
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet.open { transform: translateY(0); }

@media (min-width: 768px) {
  .sheet {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: auto;
    width: 440px;
    max-height: 100vh;
    border-radius: 0;
    border-top: none;
    border-left: 1px solid var(--hair-strong);
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
  }
  .sheet.open { transform: translateX(0); }
  #sheet-chat         { width: 500px; }
  #sheet-priorites    { width: 460px; }
  #sheet-memoire      { width: 480px; }
  #sheet-positionner  { width: 380px; }
}

/* ── Panneau mode édition "À positionner" ───────────────────── */
#sheet-positionner {
  max-height: 52vh; /* Laisse la carte visible au-dessus sur mobile */
}
@media (min-width: 768px) {
  #sheet-positionner {
    max-height: 100vh; /* Pleine hauteur sur desktop (panneau latéral) */
  }
}

.pe-search-wrap {
  position: relative;
  padding: var(--sp-2) var(--sp-8) var(--sp-3);
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
}
.pe-search-icon {
  position: absolute;
  left: calc(var(--sp-8) + 10px);
  top: 50%;
  transform: translateY(-50%);
  width: 13px; height: 13px;
  color: var(--ink-mute);
  pointer-events: none;
}
#pe-search-input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 30px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
#pe-search-input::placeholder { color: var(--ink-faint); font-style: italic; }
#pe-search-input:focus {
  border-color: var(--leaf);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45, 90, 27, 0.10);
}

.pe-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}
.pe-scroll::-webkit-scrollbar { width: 6px; }
.pe-scroll::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 3px; }

.pe-group-head {
  padding: 12px 32px 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px dotted var(--hair);
}
.pe-group:first-child .pe-group-head { border-top: none; }
.pe-count {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-faint);
  font-style: normal;
  letter-spacing: 0;
}

.pe-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 9px 32px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  min-height: 44px;
}
.pe-item:hover { background: rgba(255, 255, 255, 0.65); }
.pe-item.selected {
  background: rgba(45, 90, 27, 0.06);
  box-shadow: inset 2px 0 0 var(--leaf);
}

.pe-item-handle {
  width: 22px; height: 22px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  border: 1px dashed var(--hair-strong);
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pe-item:hover .pe-item-handle {
  color: var(--leaf-deep);
  border-color: var(--leaf);
  background: rgba(45, 90, 27, 0.06);
}
.pe-item.selected .pe-item-handle {
  color: var(--leaf-deep);
  border-color: var(--leaf);
  border-style: solid;
  background: rgba(45, 90, 27, 0.08);
}
.pe-item-handle svg { width: 11px; height: 11px; }

.pe-item-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.pe-item-bot {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 1px;
  line-height: 1.3;
}
.pe-item-meta {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.pe-foot {
  border-top: 1px solid var(--hair);
  padding: 10px 32px 14px;
  background: rgba(255, 255, 255, 0.25);
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-mute);
  line-height: 1.4;
  flex-shrink: 0;
}

.pe-empty {
  padding: 24px 32px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 13px;
}

.sheet-handle {
  width: 36px; height: 3px;
  background: var(--paper-edge);
  border-radius: 999px;
  margin: var(--sp-3) auto var(--sp-2);
  flex-shrink: 0;
}
@media (min-width: 768px) { .sheet-handle { display: none; } }

.sheet-header {
  padding: var(--sp-5) var(--sp-8) var(--sp-4);
  border-bottom: 1px solid var(--hair);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.sheet-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
  line-height: 1.1;
  letter-spacing: 0.005em;
}

.sheet-subtitle {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-mute);
  margin-top: 4px;
  letter-spacing: 0.005em;
}

.btn-close {
  width: 28px; height: 28px;
  background: transparent;
  border: none;
  color: var(--ink-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
  margin-top: 2px;
}
.btn-close:hover { background: var(--hair); color: var(--ink); }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5) var(--sp-8);
  -webkit-overflow-scrolling: touch;
}

/* Overlay backdrop */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(28, 28, 26, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Fiche plante ─────────────────────────────────────────────── */
.fiche-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--hair);
}
.badge-bon        { background: rgba(45, 90, 27, 0.08);   color: var(--leaf-deep); }
.badge-surveiller { background: rgba(196, 122, 30, 0.10); color: var(--amber-deep); }
.badge-critique   { background: rgba(168, 71, 43, 0.10);  color: var(--rust); }

.fiche-compagnon {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: var(--sp-4);
}

.fiche-section { margin-bottom: var(--sp-4); }

.fiche-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  margin-bottom: var(--sp-2);
}

.fiche-value {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.62;
}
.fiche-value.botanique {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-mute);
}

.fiche-notes {
  background: rgba(255, 255, 255, 0.5);
  border-left: 2px solid rgba(45, 90, 27, 0.30);
  border-radius: 0 2px 2px 0;
  padding: var(--sp-3) var(--sp-4);
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.62;
}

.btn-ask-companion {
  width: 100%;
  height: 38px;
  background: var(--leaf-deep);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background 0.15s;
  margin-top: var(--sp-4);
}
.btn-ask-companion:hover { background: var(--leaf); }

.btn-voir-plus {
  width: 100%;
  height: 34px;
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  margin-top: var(--sp-3);
}
.btn-voir-plus svg { width: 13px; height: 13px; transition: transform 0.2s; }
.btn-voir-plus:hover { background: var(--paper-deep); color: var(--ink-soft); border-color: var(--paper-edge); }
.btn-voir-plus.open svg { transform: rotate(180deg); }

.fiche-detail-rule {
  height: 1px;
  background: var(--hair);
  margin: var(--sp-4) 0;
}

.fiche-action {
  color: var(--leaf-deep);
  font-weight: 500;
}

.fiche-galerie-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
  margin-top: var(--sp-4);
}

.btn-import-photo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-import-photo svg { width: 13px; height: 13px; }
.btn-import-photo:hover { background: var(--paper-deep); color: var(--ink-soft); }

.fiche-galerie {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  min-height: 60px;
}

.fiche-galerie-empty {
  grid-column: 1 / -1;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  font-style: italic;
  padding: var(--sp-2) 0;
}

.fiche-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-deep);
}
.fiche-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fiche-photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(28, 28, 26, 0.55);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.fiche-photo-del svg { width: 10px; height: 10px; }
.fiche-photo-item:hover .fiche-photo-del { opacity: 1; }

/* ── Bouton Mémoriser (chat footer) ──────────────────────────────── */
.chat-footer {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--hair);
  margin-top: var(--sp-3);
  display: flex;
  justify-content: flex-end;
}

.btn-memoriser {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-memoriser:hover:not(:disabled) {
  background: var(--paper-deep);
  color: var(--leaf-deep);
  border-color: var(--leaf);
}
.btn-memoriser:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Panel Mémoire ───────────────────────────────────────────────── */
.memoire-section {
  margin-bottom: var(--sp-6);
}

.memoire-section-title {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--sp-3);
}

.memoire-resume {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  white-space: pre-wrap;
  padding-left: 12px;
  border-left: 2px solid var(--paper-edge);
}

.memoire-empty {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  font-style: italic;
}

.memoire-log {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.memoire-log-entry {
  position: relative;
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-3);
  background: var(--paper-deep);
  border-radius: 2px;
  border-left: 2px solid var(--paper-edge);
}

.memoire-log-date {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.memoire-log-content {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding-right: 24px;
}

.memoire-log-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.memoire-log-del svg { width: 10px; height: 10px; }
.memoire-log-entry:hover .memoire-log-del { opacity: 1; }
.memoire-log-del:hover { color: var(--rust); }

/* ── Panel Chat — layout ─────────────────────────────────────────── */

/* Le sheet-chat monte à 85vh sur mobile (place pour l'input + clavier) */
@media (max-width: 767px) {
  #sheet-chat { max-height: 85dvh; }
}

/* .sheet-body du chat ne scrolle pas globalement — les messages scrollent */
#sheet-chat .sheet-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#sheet-chat .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-6) var(--sp-2);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

#sheet-chat .chat-footer {
  flex-shrink: 0;
  padding: var(--sp-2) var(--sp-6) var(--sp-3);
}

/* Zone saisie — sibling de .sheet-body, toujours visible en bas */
.chat-input-wrap {
  flex-shrink: 0;
  border-top: 1px solid var(--hair);
  padding: 10px var(--sp-6) max(12px, env(safe-area-inset-bottom));
  background: rgba(251, 248, 240, 0.92);
}
@media (min-width: 768px) {
  .chat-input-wrap {
    padding: 12px 28px 16px;
  }
}

/* Messages globaux (hors contexte chat-sheet, si jamais réutilisés) */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-height: 60px;
}

.chat-msg {
  max-width: 100%;
  font-size: 14px;
  line-height: 1.65;
}

.chat-msg.user {
  background: rgba(45, 90, 27, 0.08);
  border: 1px solid var(--hair);
  border-radius: 2px;
  padding: var(--sp-3) var(--sp-4);
  align-self: flex-end;
  max-width: 85%;
}

.chat-msg.assistant {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--hair);
  border-radius: 2px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--ink-soft);
}
.chat-msg.assistant strong { color: var(--leaf-deep); }

.chat-msg.loading {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  color: var(--ink-mute);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  padding: var(--sp-3) 0;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
}
.typing-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--moss);
  opacity: 0.4;
  animation: typingDot 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-2px); }
}

/* Photo preview dans le chat */
.chat-photo-preview {
  position: relative;
  display: inline-block;
  margin-bottom: var(--sp-3);
}
.chat-photo-preview img {
  width: 80px; height: 60px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--hair-strong);
}
.chat-photo-preview button {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  background: var(--rust);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Panel Priorités ─────────────────────────────────────────────── */
.priorites-actions {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.btn-generer {
  flex: 1;
  height: 38px;
  background: var(--leaf-deep);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background 0.15s;
}
.btn-generer:hover { background: var(--leaf); }
.btn-generer:disabled { opacity: 0.45; cursor: default; }

.tache-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-top: 1px dotted var(--hair-strong);
  min-height: 44px;
}
.tache-item:first-child { border-top: none; }

.tache-checkbox {
  width: 18px; height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--ink-mute);
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  background: rgba(255, 255, 255, 0.5);
}
.tache-checkbox.checked {
  background: var(--leaf-deep);
  border-color: var(--leaf-deep);
}
.tache-checkbox.checked::after {
  content: '';
  display: block;
  width: 10px; height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='%23F4EFE3' stroke-width='2.4' stroke-linecap='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8.5l3.2 3.2L13.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.tache-content { flex: 1; }

.tache-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  transition: color 0.2s, text-decoration 0.2s;
}
.tache-text.done {
  text-decoration: line-through;
  color: var(--ink-faint);
}

.tache-meta {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
  flex-wrap: wrap;
  align-items: center;
}

.urgence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
}
.urgence-badge::before {
  content: '';
  display: inline-block;
  border-radius: 50%;
  flex: none;
}
.urgence-urgent::before    { width: 8px; height: 8px; background: var(--rust); box-shadow: 0 0 0 1px var(--rust-deep); }
.urgence-important::before { width: 8px; height: 8px; background: var(--amber); }
.urgence-routine::before   { width: 7px; height: 7px; background: transparent; border: 1.5px solid var(--moss); }
.urgence-urgent   { color: var(--rust); }
.urgence-important{ color: var(--amber-deep); }
.urgence-routine  { color: var(--moss); }

.tache-compagnon {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
}

/* ── Contrôles carte ─────────────────────────────────────────────── */
#map-controls {
  position: absolute;
  bottom: var(--sp-5);
  right: var(--sp-8);
  display: flex;
  flex-direction: column;
  background: rgba(244, 239, 227, 0.90);
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  overflow: hidden;
  z-index: 15;
}

.btn-map {
  width: 34px; height: 34px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hair);
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.btn-map:last-child { border-bottom: none; }
.btn-map:hover { background: rgba(255, 255, 255, 0.6); color: var(--leaf-deep); }
.btn-map svg { width: 14px; height: 14px; }
.btn-map.active { color: var(--leaf-deep); background: rgba(45, 90, 27, 0.08); }

/* Bouton ajout plante */
#btn-add-plant {
  position: absolute;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  width: 40px; height: 40px;
  background: var(--leaf-deep);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(31, 64, 18, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#btn-add-plant:hover { background: var(--leaf); }

/* ── Légende ─────────────────────────────────────────────────────── */
#legend {
  position: absolute;
  bottom: var(--sp-5);
  left: var(--sp-8);
  background: rgba(244, 239, 227, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--hair);
  border-radius: 2px;
  padding: 14px 16px;
  z-index: 15;
}

.legend-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.legend-item:last-child { margin-bottom: 0; }

.legend-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.25s var(--ease) both; }

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Toast notifications ─────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 2px;
  animation: toastIn 0.25s var(--ease) both;
  white-space: nowrap;
}
.toast.success { background: var(--leaf-deep); }
.toast.error   { background: var(--rust); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar custom ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--paper-edge); border-radius: 999px; }


/* ═══════════════════════════════════════════════════════════════════
   SPRINT 3 — Tâches persistantes · Journal · Cochage
   ═══════════════════════════════════════════════════════════════════ */

/* ── Indicateur génération ───────────────────────────────────────── */
.taches-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--leaf-deep);
  padding: var(--sp-3) 0 var(--sp-4);
}

/* ── Message état bouton ─────────────────────────────────────────── */
.taches-btn-msg {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--amber-deep);
  padding: var(--sp-2) var(--sp-3);
  background: rgba(196, 122, 30, 0.07);
  border-left: 2px solid var(--amber);
  border-radius: 0 2px 2px 0;
  margin-bottom: var(--sp-3);
  line-height: 1.5;
}

/* ── Message Jean Baptiste (panel tâches) ────────────────────────── */
.taches-msg-jb {
  background: rgba(45, 90, 27, 0.05);
  border: 1px solid rgba(45, 90, 27, 0.15);
  border-radius: 2px;
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
}
.jb-msg-leaf {
  font-size: 16px;
  margin-bottom: var(--sp-2);
}
.jb-msg-text {
  font-family: var(--serif);
  font-size: 14.5px;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink-soft);
  white-space: pre-wrap;
}
.jb-msg-sig {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: var(--sp-2);
  text-align: right;
}

/* ── Tâches vide ─────────────────────────────────────────────────── */
.taches-empty {
  text-align: center;
  color: var(--ink-mute);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  padding: var(--sp-8) var(--sp-4);
  line-height: 1.6;
}

/* ── Bucket header ───────────────────────────────────────────────── */
.tache-bucket-header {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: var(--sp-4) var(--sp-2) var(--sp-2);
  margin-top: var(--sp-2);
  border-top: 1px solid var(--hair);
}
.tache-bucket-header:first-child { margin-top: 0; border-top: none; }
.tache-bucket-faites { color: var(--ink-faint); opacity: 0.7; }

/* ── Statuts tâche ───────────────────────────────────────────────── */
.tache-statut-faite {
  opacity: 0.55;
}
.tache-statut-reportee .tache-text.reportee {
  color: var(--ink-mute);
  font-style: italic;
}
.tache-reportee-badge {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-faint);
  background: var(--paper-deep);
  border: 1px solid var(--paper-edge);
  border-radius: 999px;
  padding: 1px 6px;
}
.tache-complexe-badge {
  font-size: 11px;
  color: var(--amber);
  vertical-align: middle;
  margin-left: 3px;
}

/* ── Modal Cochage / Observation ─────────────────────────────────── */
.modal-cochage {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 480px) {
  .modal-cochage { align-items: center; }
}

.modal-cochage-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 26, 0.40);
}

.modal-cochage-card {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: 2px 2px 0 0;
  border: 1px solid var(--hair-strong);
  border-bottom: none;
  box-shadow: 0 -8px 32px rgba(28, 28, 26, 0.16);
  width: 100%;
  max-width: 500px;
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  animation: fadeIn 0.22s var(--ease) both;
}
@media (min-width: 480px) {
  .modal-cochage-card {
    border-radius: 2px;
    border-bottom: 1px solid var(--hair-strong);
    margin: var(--sp-4);
    width: calc(100% - 32px);
  }
}

.modal-cochage-check {
  font-size: 22px;
  margin-bottom: var(--sp-2);
}

.modal-cochage-titre {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: var(--sp-1);
}

.modal-cochage-plante {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: var(--sp-4);
}

.cochage-obs-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-bottom: var(--sp-2);
}
.cochage-opt {
  font-weight: 400;
  color: var(--ink-faint);
}

.cochage-textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-3);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  resize: none;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cochage-textarea:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(45, 90, 27, 0.10);
  background: #fff;
}
.cochage-textarea::placeholder { color: var(--ink-faint); font-style: italic; }

.cochage-chars {
  text-align: right;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 3px;
  margin-bottom: var(--sp-3);
}

.cochage-photo-preview {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.cochage-photo-preview img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--hair-strong);
}
.cochage-photo-del {
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
  color: var(--ink-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: color 0.15s;
}
.cochage-photo-del:hover { color: var(--rust); }
.cochage-photo-del svg { width: 11px; height: 11px; }

.cochage-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 var(--sp-3);
  background: transparent;
  border: 1px dashed var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  margin-bottom: var(--sp-5);
}
.cochage-photo-btn svg { width: 14px; height: 14px; }
.cochage-photo-btn:hover { background: var(--paper-deep); border-color: var(--leaf); color: var(--leaf-deep); }

.modal-cochage-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  border-top: 1px solid var(--hair);
  padding-top: var(--sp-4);
}

.btn-reporter {
  height: 36px;
  padding: 0 var(--sp-4);
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-reporter:hover { background: var(--paper-deep); color: var(--ink-soft); }

.btn-valider-cochage {
  height: 36px;
  padding: 0 var(--sp-5);
  background: var(--leaf-deep);
  border: none;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--paper);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-valider-cochage:hover { background: var(--leaf); }
.btn-valider-cochage:disabled { opacity: 0.5; cursor: default; }

/* ── Journal dans la fiche ───────────────────────────────────────── */
.fiche-journal-section {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--hair);
}

.fiche-journal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.btn-add-observation {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 var(--sp-3);
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-add-observation:hover {
  background: var(--paper-deep);
  color: var(--leaf-deep);
  border-color: var(--leaf);
}

.fiche-journal {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.journal-empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
  padding: var(--sp-2) 0;
}

.journal-month {
  margin-bottom: var(--sp-3);
}

.journal-month-header {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: var(--sp-3) 0 var(--sp-2);
  border-top: 1px dotted var(--hair-strong);
  cursor: default;
}
.journal-month:first-child .journal-month-header { border-top: none; }

.journal-entry {
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  border-left: 2px solid var(--hair);
  margin-left: 4px;
  padding-left: var(--sp-4);
  margin-bottom: var(--sp-2);
}
.journal-entry:last-child { margin-bottom: 0; }

.journal-entry-meta {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: 3px;
}

.journal-entry-icon {
  font-size: 12px;
  flex-shrink: 0;
}

.journal-entry-date {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  text-transform: capitalize;
}

.journal-entry-tache {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 500;
}

.journal-entry-comment {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  font-style: italic;
  margin-top: 2px;
}

.journal-entry-photo {
  display: block;
  max-width: 160px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--hair-strong);
  margin-top: var(--sp-2);
}

/* ═══════════════════════════════════════════════════════════════════
   SPRINT 4 — Aide contextuelle · Journal complet · Lightbox
   ═══════════════════════════════════════════════════════════════════ */

/* ── Bouton ⓘ aide contextuelle dans la liste des tâches ────────── */
.tache-aide-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 50%;
  font-size: 14px;
  color: var(--ink-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
}
.tache-aide-btn:hover {
  background: rgba(45, 90, 27, 0.07);
  color: var(--leaf-deep);
  border-color: var(--leaf);
}

/* ── Modal aide contextuelle ─────────────────────────────────────── */
.modal-aide {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 480px) {
  .modal-aide { align-items: center; }
}

.modal-aide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 26, 0.38);
}

.modal-aide-card {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: 2px 2px 0 0;
  border: 1px solid var(--hair-strong);
  border-bottom: none;
  box-shadow: 0 -8px 32px rgba(28, 28, 26, 0.14);
  width: 100%;
  max-width: 520px;
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
  max-height: 82vh;
  overflow-y: auto;
  animation: fadeIn 0.22s var(--ease) both;
}
@media (min-width: 480px) {
  .modal-aide-card {
    border-radius: 2px;
    border-bottom: 1px solid var(--hair-strong);
    margin: var(--sp-4);
    width: calc(100% - 32px);
    max-height: 78vh;
  }
}

.modal-aide-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.modal-aide-leaf { font-size: 20px; flex-shrink: 0; margin-top: 2px; }

.modal-aide-titre {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  flex: 1;
}

.modal-aide-plante {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 3px;
}

.modal-aide-rule {
  height: 1px;
  background: var(--hair);
  margin: var(--sp-4) 0;
}

.aide-content { display: flex; flex-direction: column; gap: var(--sp-4); }

.aide-loading {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  padding: var(--sp-3) 0;
}

.aide-section { display: flex; flex-direction: column; gap: 5px; }

.aide-section-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leaf-deep);
}

.aide-section-text {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.aide-sig {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--ink-mute);
  text-align: right;
  margin-top: var(--sp-2);
  border-top: 1px solid var(--hair);
  padding-top: var(--sp-3);
}

.aide-error {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--rust);
  padding: var(--sp-3) 0;
}

/* ── Sheet journal complet ───────────────────────────────────────── */
@media (min-width: 768px) {
  #sheet-journal { width: 480px; }
}

/* ── Filtres journal ─────────────────────────────────────────────── */
.journal-filtres {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-8);
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.journal-filtre {
  height: 26px;
  padding: 0 var(--sp-3);
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.journal-filtre:hover {
  background: var(--paper-deep);
  color: var(--ink-soft);
}
.journal-filtre.active {
  background: var(--leaf-deep);
  border-color: var(--leaf-deep);
  color: var(--paper);
}

/* ── Pied de page journal complet ────────────────────────────────── */
.journal-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-8);
  border-top: 1px solid var(--hair);
  background: rgba(251, 248, 240, 0.85);
}

.btn-retour-fiche {
  height: 28px;
  padding: 0 var(--sp-3);
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-retour-fiche:hover { background: var(--paper-deep); color: var(--ink-soft); }

/* ── Lien "Voir tout le journal" dans la fiche ───────────────────── */
.journal-voir-tout {
  padding-top: var(--sp-3);
  text-align: right;
}

.btn-voir-tout-journal {
  background: transparent;
  border: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--leaf-deep);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(45, 90, 27, 0.35);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.btn-voir-tout-journal:hover {
  color: var(--leaf);
  text-decoration-color: var(--leaf);
}

/* ── Compagnon dans les entrées journal ──────────────────────────── */
.journal-entry-compagnon {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-faint);
}

/* Photo cliquable dans le journal complet */
.journal-photo-clickable {
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.journal-photo-clickable:hover { opacity: 0.85; }

/* ── Lightbox photo ──────────────────────────────────────────────── */
.lightbox-photo {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(28, 28, 26, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox-photo img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: var(--sp-5);
  right: var(--sp-5);
  width: 36px;
  height: 36px;
  background: rgba(244, 239, 227, 0.12);
  border: 1px solid rgba(244, 239, 227, 0.25);
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(244, 239, 227, 0.22); }
