/* =========================================================
   LOU MOBILE — Apple first, extensible Android/Web
   Activation : @media (max-width: 768px) OU body.is-mobile
   ========================================================= */

@media (max-width: 768px) {

  /* ── Reset layout desktop ── */
  .icalou-modern-nav,
  .mobile-menu-btn,
  #mobile-menu-toggle,
  .mobile-nav-overlay { display: none !important; }

  body { background: var(--lou-bg); }

  html { height: 100% !important; overflow: hidden !important; }
  body.is-mobile {
    height: 100svh !important;
    overflow: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  #lou-mobile-shell {
    position: relative;
    height: 100svh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    --lou-bottom-nav-clearance: 104px;
  }

  /* ═══════════════ LOGO BAR ═══════════════ */
  #lou-logo-bar {
    background: var(--lou-card);
    border-bottom: 0.5px solid var(--lou-border);
    padding: calc(8px + var(--lou-safe-top)) 14px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1001;
  }
  .lou-logo-wrap { display: flex; align-items: center; gap: 8px; }
  .lou-logo-mark {
    width: 36px; height: 36px;
    background: transparent;
    border-radius: var(--lou-radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
  }
  .lou-logo-mark svg { width: 100%; height: 100%; display: block; }
  .lou-logo-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--lou-text-1);
    line-height: 1.2;
  }
  .lou-logo-gite {
    font-size: 10px;
    color: var(--lou-text-3);
  }
  .lou-notif-pill {
    background: var(--lou-badge-amber-bg);
    color: var(--lou-badge-amber-text);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--lou-radius-full);
    display: flex;
    align-items: center;
    gap: 3px;
  }

  /* ═══════════════ ZONE PAGES ═══════════════ */
  #lou-pages {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--lou-bottom-nav-clearance, 104px) + 16px);
    box-sizing: border-box;
  }
  .lou-page {
    display: none;
    padding: 10px 12px;
    padding-bottom: 16px;
    background: var(--lou-bg);
    box-sizing: border-box;
    overflow: visible !important;
  }
  .lou-page.active {
    display: block;
    min-height: 100%;
  }

  /* ═══════════════ BOTTOM NAV ═══════════════ */
  #lou-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gdf-cream, #F4EFE3);
    border-top: 1px solid rgba(91, 138, 45, 0.18);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 0;
    padding-bottom: calc(6px + var(--lou-safe-bottom));
    z-index: 1000;
  }
  .lou-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 4px 2px;
    border: none;
    background: none;
    color: var(--lou-text-3);
    font-size: 9px;
    font-family: sans-serif;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    line-height: 1.3;
  }
  .lou-nav-btn svg,
  .lou-nav-btn i { font-size: 20px; }
  .lou-nav-btn.active { color: var(--lou-green); }
  .lou-nav-icon-wrap { position: relative; display: inline-flex; }
  .lou-nav-badge {
    position: absolute;
    top: -3px; right: -6px;
    background: var(--lou-danger);
    color: #fff;
    font-size: 7px; font-weight: 700;
    min-width: 13px; height: 13px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 2px;
  }

  /* ═══════════════ MESSAGERIE MOBILE ═══════════════ */
  .lou-msg-conv-item {
    all: unset;
    display: block;
    cursor: pointer;
    padding: 12px 14px;
    background: var(--lou-card);
    border: 0.5px solid var(--lou-border);
    border-radius: 10px;
    margin-bottom: 8px;
    position: relative;
  }
  .lou-msg-conv-item.is-unread { background: var(--lou-card); border-color: var(--lou-border); }
  .lou-msg-conv-item.is-unread::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lou-danger);
  }
  .lou-msg-conv-title {
    font-size: 14px; font-weight: 600; color: var(--lou-text-1);
    display: flex; justify-content: space-between; gap: 8px;
    align-items: center; margin-bottom: 2px;
  }
  .lou-msg-conv-meta { font-size: 11px; color: var(--lou-text-3); margin-bottom: 4px; }
  .lou-msg-conv-preview {
    font-size: 12px; color: var(--lou-text-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .lou-msg-conv-time { font-size: 10px; color: var(--lou-text-3); }
  .lou-msg-conv-unread {
    background: var(--lou-danger); color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 999px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .lou-msg-day {
    align-self: center;
    background: var(--lou-border); color: var(--lou-text-2);
    font-size: 10px; padding: 2px 9px; border-radius: 999px; margin: 4px 0;
  }
  .lou-msg-bubble {
    max-width: 78%;
    padding: 8px 11px;
    border-radius: 14px;
    line-height: 1.35;
    font-size: 13.5px;
    word-wrap: break-word;
    white-space: pre-wrap;
  }
  .lou-msg-bubble--gerant {
    align-self: flex-end;
    background: rgba(127, 127, 127, 0.13); color: var(--lou-text-1);
    border-bottom-right-radius: 4px;
  }
  .lou-msg-bubble--client {
    align-self: flex-start;
    background: var(--lou-card); color: var(--lou-text-1);
    border: 0.5px solid var(--lou-border);
    border-bottom-left-radius: 4px;
  }
  .lou-msg-time {
    display: block; margin-top: 3px;
    font-size: 9.5px; color: var(--lou-text-3); text-align: right;
  }
  .lou-msg-bubble--client .lou-msg-time { color: var(--lou-text-3); }
  .lou-msg-empty {
    margin: auto; padding: 20px; text-align: center;
    color: var(--lou-text-3); font-size: 12px; font-style: italic;
  }

  /* Temps réel : slide-in, Vu, présence, "en train d'écrire" */
  .lou-msg-bubble { animation: louMsgSlideIn 0.18s ease-out; }
  @keyframes louMsgSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .lou-msg-read {
    align-self: flex-end;
    font-size: 9.5px; color: var(--lou-text-3);
    margin: -1px 2px 3px;
  }
  .lou-msg-presence-dot {
    display: inline-block;
    width: 8px; height: 8px; margin-left: 6px;
    border-radius: 50%; background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
    animation: louMsgPulse 1.8s infinite;
    vertical-align: middle;
  }
  @keyframes louMsgPulse {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
  }
  .lou-msg-typing {
    align-self: flex-start;
    display: inline-flex; gap: 4px; align-items: center;
    background: var(--lou-card);
    border: 0.5px solid var(--lou-border);
    border-radius: 14px; border-bottom-left-radius: 4px;
    padding: 8px 11px;
  }
  .lou-msg-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--lou-text-3);
    animation: louMsgTyping 1.2s infinite ease-in-out;
  }
  .lou-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
  .lou-msg-typing span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes louMsgTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
  }

  /* Lou Voice V2 : îlot demi-arrondi au-dessus de la bottom-nav */
  #lou-voice-island {
    position: absolute;
    top: -42px;
    left: 50%;
    width: 128px;
    height: 42px;
    transform: translateX(-50%);
    border-radius: 64px 64px 0 0;
    background: var(--lou-card);
    border: 0.5px solid var(--lou-border);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px 6px;
    z-index: 1002;
  }
  #lou-island-mic,
  #lou-island-chat {
    border: none;
    background: transparent;
    color: var(--lou-green);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  #lou-island-mic svg,
  #lou-island-chat svg {
    width: 19px;
    height: 19px;
  }
  #lou-orb {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--lou-green);
    background: var(--lou-card);
    color: var(--lou-green);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1003;
  }

  /* ═══════════════ COMPOSANTS ═══════════════ */
  .lou-section-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--lou-text-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 5px;
  }

  .lou-card-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
  }

  .lou-card {
    background: var(--lou-card);
    border-radius: var(--lou-radius-md);
    border: 0.5px solid var(--lou-border);
    padding: 10px 12px;
  }

  .lou-row-card {
    background: var(--lou-card);
    border-radius: var(--lou-radius-md);
    border: 0.5px solid var(--lou-border);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
  }

  /* Métriques */
  .lou-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
  .lou-metric-card {
    background: var(--lou-card);
    border-radius: var(--lou-radius-md);
    border: 0.5px solid var(--lou-border);
    padding: 9px 11px;
  }
  .lou-metric-label { font-size: 10px; color: var(--lou-text-2); margin: 0 0 2px; }
  .lou-metric-value {
    font-size: 20px; font-weight: 600;
    color: var(--lou-text-1); margin: 0;
  }
  .lou-metric-value.green { color: var(--lou-green); }
  .lou-metric-sub { font-size: 9px; color: var(--lou-text-3); margin: 1px 0 0; }

  /* Avatar */
  .lou-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600;
    flex-shrink: 0;
    font-family: sans-serif;
  }
  .av-green { background: var(--lou-badge-green-bg); color: var(--lou-green); }
  .av-amber { background: var(--lou-badge-amber-bg); color: var(--lou-badge-amber-text); }
  .av-blue  { background: var(--lou-badge-blue-bg);  color: var(--lou-badge-blue-text); }
  .av-pink  { background: #FBEAF0; color: #993556; }

  .lou-row-name   { font-size: 12px; font-weight: 600; color: var(--lou-text-1); margin: 0; }
  .lou-row-detail { font-size: 10px; color: var(--lou-text-2); margin: 1px 0 0; }

  .lou-badge {
    margin-left: auto;
    font-size: 9px; font-weight: 600;
    padding: 3px 7px;
    border-radius: var(--lou-radius-full);
    flex-shrink: 0; white-space: nowrap;
  }
  .badge-green { background: var(--lou-badge-green-bg); color: var(--lou-badge-green-text); }
  .badge-amber { background: var(--lou-badge-amber-bg); color: var(--lou-badge-amber-text); }
  .badge-red   { background: var(--lou-badge-red-bg);   color: var(--lou-badge-red-text); }
  .badge-blue  { background: var(--lou-badge-blue-bg);  color: var(--lou-badge-blue-text); }
  .badge-gray  { background: var(--lou-bg);             color: var(--lou-text-2); }

  /* Validation */
  .lou-val-card {
    background: var(--lou-card);
    border-radius: var(--lou-radius-md);
    border: 1.5px solid var(--lou-green);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .lou-val-actions { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
  button.lou-btn-sm,
  button.btn-val-ok,
  button.btn-val-no {
    height: 30px !important;
    line-height: 30px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    appearance: none !important;
    -webkit-appearance: none !important;
  }
  button.lou-btn-sm.primary,
  button.btn-val-ok {
    background: #0F6E56 !important;
    color: #fff !important;
  }
  button.lou-btn-sm.primary:hover,
  button.btn-val-ok:hover {
    background: #0C5A47 !important;
  }
  button.lou-btn-sm.ghost,
  button.btn-val-no {
    background: transparent !important;
    color: #64748b !important;
    border: 0.5px solid rgba(0, 0, 0, .15) !important;
  }
  button.lou-btn-sm.ghost:hover,
  button.btn-val-no:hover {
    background: rgba(15, 110, 86, .06) !important;
    color: #0F6E56 !important;
    border-color: rgba(15, 110, 86, .22) !important;
  }

  /* Alerte */
  .lou-alert {
    background: #FAECE7;
    border-radius: var(--lou-radius-md);
    border: 0.5px solid #F0997B;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #712B13;
  }

  /* Carte société ménage */
  .lou-soc-card {
    background: var(--lou-card);
    border-radius: var(--lou-radius-md);
    border: 0.5px solid var(--lou-border);
    padding: 9px 12px;
  }
  .lou-soc-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 5px;
  }
  .lou-soc-name { font-size: 11px; font-weight: 600; color: var(--lou-text-1); }
  .lou-soc-msg  { font-size: 10px; color: var(--lou-text-2); line-height: 1.45; }
  .lou-soc-footer {
    display: flex; justify-content: space-between;
    align-items: center; margin-top: 7px;
  }
  .lou-soc-date { font-size: 9px; color: var(--lou-text-3); }

  /* Planning */
  .lou-planning-row {
    background: var(--lou-card);
    border-radius: var(--lou-radius-md);
    border: 0.5px solid var(--lou-border);
    padding: 9px 12px;
    display: flex; justify-content: space-between; align-items: center;
  }
  .lou-planning-row.urgent { border: 1.5px solid var(--lou-warning); }
  .lou-status-dot { width: 7px; height: 7px; border-radius: 50%; }
  .dot-green  { background: var(--lou-success); }
  .dot-amber  { background: var(--lou-warning); }
  .dot-red    { background: var(--lou-danger); }

  /* Menu Plus */
  .lou-plus-item {
    background: var(--lou-card);
    border-radius: var(--lou-radius-md);
    border: 0.5px solid var(--lou-border);
    padding: 10px 12px;
    display: flex; justify-content: space-between;
    align-items: center; cursor: pointer;
  }
  .lou-plus-icon {
    width: 32px; height: 32px;
    border-radius: var(--lou-radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .lou-plus-label { font-size: 12px; font-weight: 600; color: var(--lou-text-1); }

  /* Onglets internes (page Tâches) */
  .lou-tab-btn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 2px; padding: 8px 0;
    border: none; background: var(--lou-card);
    color: var(--lou-text-3); font-size: 10px; cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
  }
  .lou-tab-btn.active { color: var(--lou-green); border-bottom-color: var(--lou-green); font-weight: 600; }

} /* fin @media mobile */

/* Respect des préférences de mouvement réduit (messagerie temps réel) */
@media (prefers-reduced-motion: reduce) {
  .lou-msg-bubble,
  .lou-msg-presence-dot,
  .lou-msg-typing span { animation: none !important; }
}

/* Carte « Suggestion de Lou » — padding réduit, boutons pills compacts */
body.is-mobile #lou-msg-suggest { padding: 8px 10px !important; font-size: 13px !important; }
body.is-mobile #lou-msg-suggest .lou-quick-suggest-btn {
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
  height: 28px !important;
  line-height: 28px !important;
  min-height: 0 !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

/* Activation forcée via classe (override ≥ 768px en dev) */
body.is-mobile #lou-mobile-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* Masquer la coque desktop quand le shell mobile est actif.
   La coque principale d'app.html est <div class="container"> (unique).
   ⚠️ NE PAS masquer #lou-fab / #lou-panel : chatbot Lou doit rester accessible. */
body.is-mobile > .container,
body.is-mobile > #toast,
body.is-mobile > .mobile-nav-overlay,
body.is-mobile #portrait-banner,
body.is-mobile > .theme-controls,
body.is-mobile .theme-controls,
body.is-mobile #mobile-menu-toggle,
body.is-mobile #adminDropdown {
  display: none !important;
}

/* Lou Voice V2 remplace le FAB en mobile */
body.is-mobile #lou-fab {
  display: none !important;
}
#lou-mobile-shell {
  pointer-events: none;
}
#lou-mobile-shell * {
  pointer-events: auto;
}

/* Overlay + feuille mode IA */
body.is-mobile #lou-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,32,.35);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 9998;
}
body.is-mobile #lou-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

body.is-mobile #lou-panel {
  bottom: 0 !important;
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 88vh !important;
  border-radius: 24px 24px 0 0 !important;
  z-index: 9999 !important;
  transform: translate3d(0, 105%, 0) !important;
  -webkit-transform: translate3d(0, 105%, 0);
  will-change: transform;
  opacity: 1 !important;
  transition: transform .35s cubic-bezier(.32,.72,.35,1) !important;
  pointer-events: none;
}

body.is-mobile #lou-panel button,
body.is-mobile #lou-panel .lou-suggestion {
  border: none !important;
  box-shadow: none !important;
  background-image: none !important;
}
body.is-mobile #lou-panel.lou-open {
  transform: translate3d(0, 0, 0) !important;
  -webkit-transform: translate3d(0, 0, 0);
  pointer-events: auto !important;
}

body.is-mobile #lou-sheet-overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.is-mobile #lou-sheet-handle {
  width: 38px;
  height: 4px;
  border: none;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 10px auto 8px;
  display: block;
}

body.is-mobile #lou-voice-mode {
  display: none;
  text-align: center;
  padding: 8px 16px 14px;
}
body.is-mobile #lou-panel.lou-mode-voice #lou-voice-mode {
  display: block;
}
body.is-mobile #lou-panel.lou-mode-voice #lou-panel-header {
  display: none !important;
}
body.is-mobile #lou-panel.lou-mode-voice #lou-messages,
body.is-mobile #lou-panel.lou-mode-voice #lou-suggestions,
body.is-mobile #lou-panel.lou-mode-voice #lou-quota-bar,
body.is-mobile #lou-panel.lou-mode-voice #lou-input-zone {
  display: none !important;
}
body.is-mobile #lou-panel.lou-mode-text #lou-voice-mode {
  display: none;
}
/* Dictée active en mode texte : on ré-affiche le stage vocal (retour « Je vous écoute… ») */
body.is-mobile #lou-panel.lou-listening #lou-voice-mode {
  display: block;
}
body.is-mobile #lou-panel.lou-mode-text #lou-suggestions {
  display: none !important;
}

body.is-mobile #lou-panel-header {
  background: var(--gdf-cream, #F4EFE3) !important;
  color: var(--lou-text-1) !important;
  border-bottom: 0.5px solid var(--lou-border) !important;
}
body.is-mobile #lou-panel-header .lou-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #0F6E56;
  color: #0F6E56;
  font-size: 11px;
  font-weight: 600;
  position: relative;
  overflow: visible;
}
body.is-mobile #lou-panel-header .lou-avatar::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
body.is-mobile #lou-panel-header .lou-avatar.lou-aura-idle::before { animation: louAuraIdle 3.2s ease-in-out infinite; }
body.is-mobile #lou-panel-header .lou-avatar.lou-aura-listening::before { animation: louAuraListen 1.1s ease-in-out infinite; }
body.is-mobile #lou-panel-header .lou-avatar.lou-aura-thinking::before { animation: louAuraThink 0.9s ease-in-out infinite; }
body.is-mobile #lou-panel-header .lou-avatar.lou-aura-speaking::before { animation: louAuraSpeak 1.4s ease-in-out infinite; }
body.is-mobile #lou-panel-header .lou-title {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--lou-text-1) !important;
}
body.is-mobile #lou-panel-header .lou-subtitle {
  font-size: 11px !important;
  color: var(--lou-text-3) !important;
}
body.is-mobile #lou-tts-toggle {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: #E1F5EE !important;
  color: #0F6E56 !important;
}
body.is-mobile #lou-close,
body.is-mobile #lou-clear {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: #F1F5F9 !important;
  color: #64748B !important;
}

body.is-mobile #lou-voice-orb {
  width: 84px;
  height: 84px;
  margin: 2px auto 8px;
  border-radius: 50%;
  border: 1px solid var(--lou-green);
  color: var(--lou-green);
  background: var(--lou-card);
  font-size: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: none !important;
  animation: louOrbBeat 1.1s ease-in-out infinite;
}
body.is-mobile #lou-voice-orb::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
body.is-mobile #lou-panel.lou-mode-voice #lou-voice-orb.lou-aura-listening::before {
  animation: louAuraListenBig 1.1s ease-in-out infinite;
}
body.is-mobile #lou-panel.lou-mode-voice #lou-voice-orb.lou-aura-thinking::before {
  animation: louAuraThinkBig 0.9s ease-in-out infinite;
}
body.is-mobile #lou-panel.lou-mode-voice #lou-voice-orb.lou-aura-speaking::before,
body.is-mobile #lou-panel.lou-mode-voice #lou-voice-orb.lou-transcribing::before {
  animation: louAuraSpeakBig 1.1s ease-in-out infinite;
}
body.is-mobile #lou-voice-listen-text {
  margin: 0;
  font-size: 14px;
  color: var(--lou-text-2);
}
body.is-mobile #lou-voice-transcript {
  min-height: 42px;
  margin: 8px auto 4px;
  max-width: 280px;
  font-size: 16px;
  color: var(--lou-text-1);
}
body.is-mobile #lou-voice-hint {
  margin: 0;
  font-size: 11px;
  color: var(--lou-text-3);
}

body.is-mobile #lou-input-zone {
  background: var(--gdf-cream, #F4EFE3);
  border-radius: 14px;
  margin: 0 10px 12px;
  border-top: none;
}
body.is-mobile #lou-send {
  border-radius: 10px;
}

/* Aura Jarvis */
@keyframes louAuraIdle {
  0%,100% { box-shadow: 0 0 8px 2px rgba(15,110,86,.22), 0 0 20px 6px rgba(15,110,86,.10); }
  50%     { box-shadow: 0 0 14px 5px rgba(15,110,86,.40), 0 0 30px 10px rgba(15,110,86,.16); }
}
@keyframes louAuraListen {
  0%,100% { box-shadow: 0 0 10px 3px rgba(216,90,48,.35), 0 0 24px 8px rgba(216,90,48,.14); }
  50%     { box-shadow: 0 0 18px 8px rgba(216,90,48,.55), 0 0 38px 14px rgba(216,90,48,.22); }
}
@keyframes louAuraSpeak {
  0%   { box-shadow: 0 0 8px 2px rgba(24,95,165,.32); }
  25%  { box-shadow: 0 0 16px 7px rgba(24,95,165,.50); }
  50%  { box-shadow: 0 0 10px 4px rgba(24,95,165,.30); }
  75%  { box-shadow: 0 0 18px 8px rgba(24,95,165,.52); }
  100% { box-shadow: 0 0 8px 2px rgba(24,95,165,.32); }
}

@keyframes louAuraThink {
  0%,100% { box-shadow: 0 0 10px 3px rgba(15,110,86,.34), 0 0 24px 8px rgba(15,110,86,.14); }
  50%     { box-shadow: 0 0 20px 8px rgba(15,110,86,.58), 0 0 40px 14px rgba(15,110,86,.24); }
}

@keyframes louAuraListenBig {
  0%,100% { box-shadow: 0 0 16px 5px rgba(216,90,48,.45), 0 0 40px 14px rgba(216,90,48,.18), 0 0 70px 26px rgba(216,90,48,.08); }
  50%     { box-shadow: 0 0 30px 13px rgba(216,90,48,.70), 0 0 70px 26px rgba(216,90,48,.30), 0 0 110px 40px rgba(216,90,48,.12); }
}

@keyframes louAuraSpeakBig {
  0%,100% { box-shadow: 0 0 12px 4px rgba(24,95,165,.38), 0 0 28px 10px rgba(24,95,165,.18), 0 0 48px 18px rgba(24,95,165,.08); }
  50%     { box-shadow: 0 0 22px 10px rgba(24,95,165,.58), 0 0 52px 20px rgba(24,95,165,.28), 0 0 84px 30px rgba(24,95,165,.12); }
}

@keyframes louAuraThinkBig {
  0%,100% { box-shadow: 0 0 16px 5px rgba(15,110,86,.40), 0 0 40px 14px rgba(15,110,86,.20), 0 0 70px 26px rgba(15,110,86,.08); }
  50%     { box-shadow: 0 0 28px 12px rgba(15,110,86,.68), 0 0 64px 24px rgba(15,110,86,.30), 0 0 104px 38px rgba(15,110,86,.12); }
}

@keyframes louOrbBeat {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

body.is-mobile .lou-aura-idle {
  animation: louAuraIdle 3.2s ease-in-out infinite;
  border-color: var(--lou-green) !important;
  color: var(--lou-green) !important;
}
body.is-mobile .lou-aura-listening {
  animation: louAuraListen 1.1s ease-in-out infinite;
  border-color: #993C1D !important;
  color: #993C1D !important;
}
body.is-mobile .lou-aura-thinking {
  animation: louAuraThink 0.9s ease-in-out infinite;
  border-color: var(--lou-green) !important;
  color: var(--lou-green) !important;
}
body.is-mobile .lou-aura-speaking {
  animation: louAuraSpeak 1.4s ease-in-out infinite;
  border-color: #185FA5 !important;
  color: #185FA5 !important;
}

html.theme-dark body.is-mobile .lou-aura-idle {
  animation: louAuraIdle 3.2s ease-in-out infinite;
  box-shadow: 0 0 11px 3px rgba(15,110,86,.31), 0 0 28px 9px rgba(15,110,86,.20);
}
html.theme-dark body.is-mobile .lou-aura-listening {
  animation: louAuraListen 1.1s ease-in-out infinite;
  box-shadow: 0 0 14px 4px rgba(216,90,48,.49), 0 0 30px 10px rgba(216,90,48,.24);
}
html.theme-dark body.is-mobile .lou-aura-thinking {
  animation: louAuraThink 0.9s ease-in-out infinite;
  box-shadow: 0 0 13px 4px rgba(15,110,86,.44), 0 0 32px 11px rgba(15,110,86,.24);
}
html.theme-dark body.is-mobile .lou-aura-speaking {
  animation: louAuraSpeak 1.4s ease-in-out infinite;
  box-shadow: 0 0 12px 4px rgba(24,95,165,.45), 0 0 29px 10px rgba(24,95,165,.22);
}

body.is-mobile.lou-chat-open #lou-bottom-nav {
  display: grid !important;
}

/* Sur écrans étroits, masquer aussi la coque desktop par défaut
   (sécurité si JS n'a pas eu le temps d'ajouter .is-mobile). */
@media (max-width: 768px) {
  body:not(.lou-desktop-mode) > .container { display: none !important; }
  body:not(.lou-desktop-mode) #portrait-banner { display: none !important; }
  body:not(.lou-desktop-mode):not(.is-mobile) #lou-fab,
  body:not(.lou-desktop-mode):not(.is-mobile) #lou-panel { display: none !important; }
  body:not(.lou-desktop-mode) #lou-mobile-shell { display: flex !important; }
}

/* Mode desktop forcé depuis bottom-nav (vue calendrier en plein écran) */
body.lou-desktop-mode > .container { display: block !important; }
body.lou-desktop-mode #lou-mobile-shell { display: none !important; }
body.lou-desktop-mode #portrait-banner { display: none !important; }

/* Bouton "← Retour" flottant au-dessus de la vue desktop */
#lou-back-to-mobile {
  position: fixed;
  top: env(safe-area-inset-top, 8px);
  left: 8px;
  z-index: 10000;
  background: #0F6E56;
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}
#lou-back-to-mobile:active { background: #0a5240; }

/* ========== Badges plateforme + prestation ========== */
.lou-pf-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
  background: #E5E7EB; color: #374151;
  letter-spacing: 0.2px;
}
.lou-pf-airbnb        { background: #FFE4E6; color: #FF385C; }
.lou-pf-booking       { background: #E0EBFF; color: #003580; }
.lou-pf-abritel       { background: #E1F5EE; color: #1F7A56; }
.lou-pf-gitesdefrance { background: #FAEEDA; color: #854F0B; }
.lou-pf-direct        { background: #EEF0FE; color: #534AB7; }

.lou-presta-dot {
  display: inline-block;
  font-size: 11px;
  margin-left: 3px;
  vertical-align: middle;
  filter: saturate(1.2);
}

.lou-clickable {
  cursor: pointer;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: rgba(15,110,86,0.08);
}
.lou-clickable:active {
  background: rgba(15,110,86,0.06);
}

/* ========== Drawer détail réservation ========== */
#lou-detail-panel {
  position: fixed;
  inset: 0;
  background: var(--lou-bg, #F7F6F2);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  visibility: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
#lou-detail-panel.open {
  transform: translateY(0);
  visibility: visible;
}
.lou-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}
.lou-detail-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.lou-detail-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: #F3F4F6;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #374151;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  padding: 0;
}
.lou-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}
.lou-detail-section {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.lou-detail-section h3,
.lou-detail-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.lou-detail-name {
  font-size: 16px !important;
  margin: 0 !important;
}
.lou-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 13px;
  gap: 8px;
}
.lou-detail-row:last-child { border-bottom: none; }
.lou-detail-label {
  color: #6B7280;
  font-size: 12px;
  flex-shrink: 0;
}
.lou-detail-value {
  color: #111827;
  text-align: right;
  word-break: break-word;
}
.lou-detail-sub {
  color: #6B7280;
  font-size: 11px;
  margin-left: 4px;
}
.lou-detail-empty { color: #9CA3AF; }
.lou-detail-link {
  color: #0F6E56;
  text-decoration: none;
  font-weight: 500;
}
.lou-detail-presta {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: #111827;
  border-bottom: 1px dashed #E5E7EB;
}
.lou-detail-presta:last-child { border-bottom: none; }
.lou-detail-presta-price {
  color: #0F6E56;
  font-weight: 600;
  font-size: 12px;
}

/* ── Fix V2.1 : neutraliser main.css sur l'îlot Lou (validé live) ── */
#lou-bottom-nav { overflow: visible !important; }

body.is-mobile .lou-nav-btn {
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

#lou-voice-island {
  width: 170px !important;
  height: 44px !important;
  top: -44px !important;
  border-radius: 85px 85px 0 0 !important;
  padding: 0 20px !important;
  align-items: flex-end !important;
}

body.is-mobile #lou-island-mic,
body.is-mobile #lou-island-chat {
  width: 30px !important;
  height: 36px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 0 6px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.is-mobile #lou-orb {
  border-radius: 50% !important;
  border-width: 1px !important;
}

/* ========== Page Calendrier mobile native ========== */
#lou-page-calendrier { padding-top: 8px; }
.lou-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 16px;
  color: #111827;
  text-transform: capitalize;
}
.lou-cal-header button {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  padding: 4px 12px;
  cursor: pointer;
  color: var(--lou-green, #0F6E56);
  border-radius: 8px;
}
.lou-cal-header button:active { background: rgba(15,110,86,0.08); }
.lou-cal-select {
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 9px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: #111827;
}
.lou-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 0 8px;
}
.lou-cal-grid .day-name {
  text-align: center;
  font-size: 10px;
  color: #9CA3AF;
  padding: 4px 0;
  font-weight: 600;
  text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  color: #111827;
}
.cal-day.libre  { background: #F3F4F6; }
.cal-day.resa   { background: #D4EDDA; color: #0F6E56; font-weight: 600; }
.cal-day.menage { background: #FFF3CD; color: #854F0B; font-weight: 600; }
.cal-day.today  { box-shadow: inset 0 0 0 2px var(--lou-green, #0F6E56); }
.cal-day.other-month { background: transparent; cursor: default; }
.cal-day:active:not(.other-month) { transform: scale(0.95); }

#lou-cal-legend {
  display: flex;
  gap: 14px;
  padding: 14px 16px 8px;
  font-size: 11px;
  color: #6B7280;
  align-items: center;
  flex-wrap: wrap;
}
#lou-cal-legend > span { display: inline-flex; align-items: center; }
#lou-cal-legend .dot-resa,
#lou-cal-legend .dot-libre,
#lou-cal-legend .dot-menage {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
#lou-cal-legend .dot-resa   { background: #D4EDDA; border: 1px solid #0F6E56; }
#lou-cal-legend .dot-libre  { background: #F3F4F6; border: 1px solid #CCCCCC; }
#lou-cal-legend .dot-menage { background: #FFF3CD; border: 1px solid #E6A817; }

#lou-cal-detail { padding: 0 16px 16px; }
.lou-cal-detail-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
}
.lou-cal-detail-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  text-transform: capitalize;
}
.lou-cal-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 13px;
  color: #111827;
  cursor: pointer;
}
.lou-cal-detail-row:last-child { border-bottom: none; }
.lou-cal-detail-empty { color: #9CA3AF; font-size: 12px; padding: 6px 0; }

/* ========== PWA : bouton install + hint iOS ========== */
#lou-install-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px auto 8px;
  padding: 7px 14px;
  background: transparent;
  color: var(--lou-text-3, #94a3b8);
  border: 1px solid var(--lou-border, #e5e7eb);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity .15s, background .15s;
}
#lou-install-btn:active { background: rgba(15,110,86,0.08); opacity: 1; }

#lou-ios-hint {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10001;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.lou-ios-hint-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.lou-ios-hint-card p {
  margin: 0 0 10px;
  font-size: 14px;
  color: #111827;
  line-height: 1.5;
}
.lou-ios-hint-card p:first-child { font-weight: 600; }
.lou-ios-hint-card button {
  margin-top: 10px;
  width: 100%;
  padding: 11px;
  background: var(--lou-green, #0F6E56);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ========== Header mobile : actions thème + déconnexion ========== */
.lou-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lou-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--lou-surface-2, rgba(255,255,255,0.08));
  color: var(--lou-text-1, #f8fafc);
  border: 1px solid var(--lou-border, rgba(255,255,255,0.12));
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  padding: 0;
}
.lou-header-btn:active {
  background: var(--lou-accent-soft, rgba(13,148,136,0.18));
  transform: scale(0.94);
}
.lou-spin {
  animation: lou-spin .6s linear;
}
@keyframes lou-spin {
  to { transform: rotate(360deg); }
}

/* ========== Bouton retour (← Accueil) dans chaque page sauf home ========== */
.lou-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 10px;
  padding: 6px 10px 6px 4px;
  background: transparent;
  color: var(--lou-green, #0F6E56);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
}
.lou-back-btn:active { background: rgba(15,110,86,0.1); }
body.is-mobile #lou-page-home .lou-back-btn { display: none; }

/* Masquer les suggestions Lou (mobile ET desktop) */
#lou-suggestions { display: none !important; }

/* ── Override couleurs Lou → vert GDF ── */
#lou-panel-header {
  background: linear-gradient(135deg,#085041,#0F6E56) !important;
}
body.is-mobile #lou-fab {
  background: linear-gradient(135deg,#085041,#0F6E56) !important;
}
#lou-send {
  background: #0F6E56 !important;
  border-color: #0F6E56 !important;
}
#lou-input { border-color: #0F6E56 !important; }
#lou-suggestions { display: none !important; }

/* ── Fix V2.2 : aura vivante (pseudo-élément) + libellés onglets ── */
body.is-mobile .lou-nav-btn { font-size: 10px !important; }

body.is-mobile #lou-orb {
  box-shadow: none !important;
  overflow: visible !important;
}
#lou-orb::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
body.is-mobile #lou-orb.lou-aura-idle::before      { animation: louAuraIdle 3.2s ease-in-out infinite; }
body.is-mobile #lou-orb.lou-aura-listening::before  { animation: louAuraListen 1.1s ease-in-out infinite; }
body.is-mobile #lou-orb.lou-aura-thinking::before   { animation: louAuraThink 0.9s ease-in-out infinite; }
body.is-mobile #lou-orb.lou-aura-speaking::before   { animation: louAuraSpeak 1.4s ease-in-out infinite; }

/* ── LOU MOBILE CLEAN V3 ───────────────────────────────────────────────
   Neutralise le style neo global sur le shell mobile uniquement.
   Ne touche pas #lou-bottom-nav / #lou-voice-island / #lou-orb. */
body.is-mobile #lou-logo-bar,
body.is-mobile .lou-card,
body.is-mobile .lou-row-card,
body.is-mobile .lou-metric-card,
body.is-mobile .lou-val-card,
body.is-mobile .lou-soc-card,
body.is-mobile .lou-planning-row {
  background-image: none !important;
  box-shadow: none !important;
}

body.is-mobile .lou-card,
body.is-mobile .lou-row-card,
body.is-mobile .lou-metric-card,
body.is-mobile .lou-val-card,
body.is-mobile .lou-soc-card,
body.is-mobile .lou-planning-row {
  background: #fff !important;
  border: 0.5px solid #E8E6DF !important;
  border-radius: 14px !important;
}

body.is-mobile #lou-logo-bar {
  background: #fff !important;
  border-bottom: 0.5px solid #E8E6DF !important;
}

body.is-mobile #lou-logo-bar .lou-header-btn {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: none !important;
  background: #F1F5F9 !important;
  color: #64748B !important;
}

body.is-mobile .lou-section-label {
  font-size: 9px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  color: #B4B2A9 !important;
}

body.is-mobile .lou-metric-label {
  font-size: 10px !important;
  color: #94A3B8 !important;
}

body.is-mobile .lou-metric-value {
  font-size: 20px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
}

body.is-mobile .lou-metric-value.green {
  color: #0F6E56 !important;
}

body.is-mobile .lou-row-name,
body.is-mobile .lou-soc-name {
  color: #1e293b !important;
}

body.is-mobile .lou-row-detail,
body.is-mobile .lou-soc-msg,
body.is-mobile .lou-soc-date,
body.is-mobile .lou-metric-sub {
  color: #94a3b8 !important;
}

body.is-mobile .btn-val-ok {
  background: #0F6E56 !important;
  color: #fff !important;
  border: none !important;
}

body.is-mobile .btn-val-no {
  background: transparent !important;
  color: #993C1D !important;
  border: 1px solid #F0997B !important;
}

@media (max-width: 768px) {
  /* ══════════════ KANBAN MOBILE REFONTE ══════════════ */

  /* Board : colonne unique verticale */
  .kanban-board {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* Onglets de statut (À faire / En cours / Terminé) */
  .kanban-status-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    background: var(--gdf-cream, #F4EFE3) !important;
    border-bottom: 1px solid rgba(91, 138, 45, 0.15) !important;
    margin-bottom: 0 !important;
  }
  .kanban-stab {
    padding: 8px 4px !important;
    text-align: center !important;
    cursor: pointer !important;
    border-bottom: 2px solid transparent !important;
  }
  .kanban-stab.active { border-bottom-color: #5B8A2D !important; }
  .kanban-stab-count {
    font-size: 16px !important;
    font-weight: 500 !important;
    color: var(--lou-text-3) !important;
  }
  .kanban-stab.active .kanban-stab-count { color: #5B8A2D !important; }
  .kanban-stab-label {
    font-size: 10px !important;
    color: var(--lou-text-3) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  /* Une seule colonne visible à la fois */
  .kanban-column { display: none !important; }
  .kanban-column.active { display: block !important; }

  /* En-tête colonne masqué (remplacé par les onglets) */
  .kanban-column-header { display: none !important; }

  /* Corps de colonne */
  .kanban-column-content {
    padding: 6px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* Cartes : filet coloré en haut, plus bas à gauche */
  .kanban-card {
    background: var(--lou-card) !important;
    border: 0.5px solid var(--lou-border) !important;
    border-left: none !important;
    border-radius: var(--lou-radius-md) !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }
  .kanban-card::before {
    content: '' !important;
    display: block !important;
    height: 3px !important;
    width: 100% !important;
  }
  .kanban-card[data-category='reservations']::before { background: #3b82f6 !important; }
  .kanban-card[data-category='achats']::before       { background: #f59e0b !important; }
  .kanban-card[data-category='travaux']::before      { background: #ef4444 !important; }

  .kanban-card .kcard-header,
  .kanban-card .kcard-title,
  .kanban-card .kcard-desc,
  .kanban-card .kcard-footer {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .kanban-card .kcard-header { padding-top: 12px !important; padding-bottom: 4px !important; }
  .kanban-card .kcard-title  { font-size: 13px !important; padding-bottom: 3px !important; }
  .kanban-card .kcard-desc   { font-size: 11px !important; padding-bottom: 10px !important; }
  .kanban-card .kcard-footer {
    padding-top: 8px !important;
    padding-bottom: 10px !important;
    border-top: 0.5px solid var(--lou-border) !important;
    gap: 6px !important;
  }
  .kanban-card .kcard-btn {
    flex: 1 !important;
    height: 30px !important;
    font-size: 11px !important;
    justify-content: center !important;
    border-radius: var(--lou-radius-sm) !important;
  }

  /* Filtres : scroll horizontal en pills */
  .kanban-filters .filter-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 6px !important;
    padding-bottom: 6px !important;
    scrollbar-width: none !important;
  }
  .filter-btn {
    flex-shrink: 0 !important;
    font-size: 11px !important;
    padding: 5px 11px !important;
    border-radius: 99px !important;
    white-space: nowrap !important;
  }

  /* En-tête page */
  .kanban-container .page-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }
  .kanban-container .page-title { font-size: 15px !important; }
  .kanban-container .btn--refresh { font-size: 11px !important; padding: 5px 10px !important; }

  /* ── TÂCHES MOBILE : onglets pills ── */
  #lou-taches-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    background: var(--lou-card) !important;
    border-bottom: 0.5px solid var(--lou-border) !important;
    scrollbar-width: none !important;
  }
  #lou-taches-tabs::-webkit-scrollbar { display: none !important; }

  .lou-tab-btn {
    flex: 0 0 auto !important;
    flex-direction: row !important;
    gap: 5px !important;
    padding: 6px 14px !important;
    border-radius: 99px !important;
    border: 0.5px solid var(--lou-border) !important;
    background: var(--lou-bg) !important;
    color: var(--lou-text-2) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    border-bottom: 0.5px solid var(--lou-border) !important;
    white-space: nowrap !important;
  }
  .lou-tab-btn.active {
    background: var(--gdf-cream, #F4EFE3) !important;
    border-color: #8CB85B !important;
    color: #3B6D11 !important;
    font-weight: 600 !important;
    border-bottom-color: #8CB85B !important;
  }
  .lou-tab-btn i, .lou-tab-btn svg {
    width: 13px !important;
    height: 13px !important;
  }

  /* Page Tâches : layout logo bar */
  #lou-page-taches .lou-logo-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
    flex-direction: row !important;
  }
  #lou-page-taches .lou-logo-bar p {
    flex: 1 !important;
    text-align: center !important;
  }

  #lou-taches-add {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 8px !important;
    background: var(--gdf-green, #5B8A2D) !important;
    color: white !important;
    border: none !important;
    font-size: 22px !important;
    line-height: 1 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #lou-taches-add i,
  #lou-taches-add svg {
    width: 22px !important;
    height: 22px !important;
    stroke-width: 2 !important;
  }

  #lou-taches-add-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 42px;
    min-width: 220px;
    background: var(--lou-card);
    border: 0.5px solid var(--lou-border);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .14);
    z-index: 1200;
  }
  #lou-taches-add-menu select {
    width: 100%;
    margin-top: 6px;
    margin-bottom: 8px;
    border: 0.5px solid var(--lou-border);
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    background: var(--lou-bg);
    color: var(--lou-text-1);
  }
  #lou-taches-add-menu button {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--lou-green);
    cursor: pointer;
  }
}

/* ─── À faire maintenant ─────────────────────────────────────── */
@media (max-width: 768px), body.is-mobile {
  .lou-action-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    color: #15803d;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
  }
  html.theme-dark .lou-action-empty {
    background: #052e16;
    color: #4ade80;
  }
  .lou-action-block {
    background: transparent;
    border-radius: 0;
    border: none;
    overflow: hidden;
    margin-bottom: 0;
  }
  .lou-action-card {
    background: var(--lou-card);
    border: 0.5px solid var(--lou-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 4px;
  }
  .lou-action-header {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    padding: 10px 12px;
    border-bottom: 0.5px solid var(--lou-border);
    font-size: 12px;
    font-weight: 700;
    color: var(--lou-text-1);
  }
  .lou-action-cat {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 0.5px solid var(--lou-border);
  }
  .lou-action-cat:last-child { border-bottom: none; }
  .lou-action-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    margin-top: 1px;
  }
  .lou-action-content { flex: 1; min-width: 0; }
  .lou-action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--lou-text-2);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .lou-action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
  }
  .lou-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    color: var(--lou-text-1);
    padding: 3px 0;
    flex-wrap: wrap;
  }
  .lou-action-btn {
    flex-shrink: 0;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
  }
  .lou-action-btn-blue   { background: #dbeafe; color: #1d4ed8; }
  .lou-action-btn-violet { background: #ede9fe; color: #6d28d9; }
  .lou-action-btn-amber  { background: #fef3c7; color: #b45309; }
  .lou-action-btn-gray   { background: var(--lou-border); color: var(--lou-text-2); }
}

/* ─── Notes voyageur sous les cartes semaine ─────────────────── */
@media (max-width: 768px), body.is-mobile {
  .lou-resa-notes {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
  }
  .lou-resa-note {
    font-size: 10px;
    line-height: 1.4;
    opacity: .85;
  }
}
