/* ═══════════════════════════════════════════════════════
   app.css — Styles spécifiques à app.html
═══════════════════════════════════════════════════════ */


/* ── LAYOUT ───────────────────────────────────── */
#app{position:fixed;inset:0;display:flex;flex-direction:column;background:var(--cream);}
#app.loading{opacity:0;}

/* TOP BAR */
#topbar{
  height:var(--topbar);flex-shrink:0;
  display:flex;align-items:center;
  background:rgba(253,248,243,0.92);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
  z-index:100;
}
#topbar-logo{
  width:var(--sidebar);flex-shrink:0;
  display:flex;align-items:center;gap:10px;
  padding:0 20px;
}
#topbar-logo .logo-icon{
  width:34px;height:34px;border-radius:10px;
  background:var(--dark);
  display:flex;align-items:center;justify-content:center;
}
#topbar-logo .logo-text{font-family:'Bitter',serif;font-size:18px;font-weight:700;color:var(--dark);}
#topbar-logo .logo-sub{font-size:10px;color:var(--muted2);font-weight:600;letter-spacing:.5px;}

#topbar-center{
  flex:1;display:flex;align-items:center;justify-content:center;gap:6px;
}
.tab-pill{
  padding:7px 18px;border-radius:99px;border:none;cursor:pointer;
  font-family:'Nunito',sans-serif;font-size:13.5px;font-weight:600;
  background:transparent;color:var(--muted);transition:all .15s;
}
.tab-pill.active{background:var(--dark);color:#fff;}

#topbar-right{
  width:var(--sidebar);flex-shrink:0;
  display:flex;align-items:center;justify-content:flex-end;gap:10px;
  padding:0 16px;
}
#btn-pet-switcher{
  display:flex;align-items:center;gap:8px;
  padding:6px 12px 6px 8px;border-radius:12px;border:1.5px solid var(--line);
  background:white;cursor:pointer;
}
#pet-switcher-avatar{
  width:28px;height:28px;border-radius:8px;
  background:var(--mint);
  display:flex;align-items:center;justify-content:center;
  font-size:14px;overflow:hidden;
}
#pet-switcher-avatar img{width:100%;height:100%;object-fit:cover;border-radius:8px;}
#pet-switcher-name{font-size:13px;font-weight:600;color:var(--dark);max-width:80px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

#btn-profile-topbar{
  display:none;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:10px;
  border:1.5px solid var(--line);background:white;cursor:pointer;
  flex-shrink:0;transition:background .15s,border-color .15s;
}
#btn-profile-topbar:hover{background:var(--cream);border-color:var(--dark);}
#btn-profile-topbar svg{display:block;}

/* BODY */
#body{flex:1;display:flex;overflow:hidden;}

/* SIDEBAR — carte flottante façon nouvelle sidebar macOS */
#sidebar{
  width:var(--sidebar);flex-shrink:0;
  overflow-y:auto;overflow-x:hidden;
  margin:12px 0 12px 12px;
  padding:0 0 100px;
  border:none;border-radius:22px;
  background:
    linear-gradient(165deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 38%),
    var(--dark);
  box-shadow:0 10px 30px rgba(13,59,17,.18), inset 0 1px 0 rgba(255,255,255,.12);
}
#sidebar::-webkit-scrollbar{width:4px;}
#sidebar::-webkit-scrollbar-thumb{background:rgba(13,59,17,.2);border-radius:2px;}

/* Bouton replier/agrandir la sidebar */
#sidebar-toggle-btn{
  position:absolute;top:14px;right:14px;z-index:5;
  width:28px;height:28px;border-radius:50%;border:none;
  background:white;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,.3);
  transition:transform .15s;
}
#sidebar-toggle-btn:hover{transform:scale(1.1);}
#sidebar-toggle-icon{transition:transform .2s;}
#sidebar{position:relative;transition:width .2s;}

/* État replié — ne garde qu'un rail avec l'avatar de l'animal */
#sidebar.collapsed{width:64px;}
#sidebar.collapsed > *:not(#pet-hero):not(#sidebar-toggle-btn){display:none;}
#sidebar.collapsed #sidebar-toggle-icon{transform:rotate(180deg);}
#sidebar.collapsed #pet-hero{margin:50px 8px 0;height:44px;border-radius:50%;overflow:hidden;}
#sidebar.collapsed #pet-hero-inner{display:none;}
#sidebar.collapsed #pet-hero-bottom{display:none;}
/* Photo nette en rail réduit — le flou/assombrissement ne sert qu'à faire ressortir
   la carte "frosted glass" (nom/espèce), masquée en mode réduit. */
#sidebar.collapsed #pet-hero-bg-img{filter:none;transform:none;}

/* Cartes "Suivi journalier" flaggables (vue véto) — toute la carte est cliquable
   pour surveiller/déssurveiller un indicateur : léger survol violet + agrandissement au clic */
.vet-flag-card{ cursor:pointer; transition:box-shadow .18s ease, border-color .18s ease, background-color .18s ease, transform .12s ease; }
.vet-flag-card:hover{ border-color:#C9A6F5 !important; background-color:#FAF7FF !important; box-shadow:0 3px 14px rgba(124,58,237,.16) !important; }
.vet-flag-card:active{ transform:scale(1.035); }
.vet-flag-cb:hover{ transform:scale(1.15); }

/* Miniatures photo (carte Médias, Suivi journalier) — zoom léger au survol, ouvrent la lightbox au clic */
.vet-photo-thumb{ cursor:pointer; transition:transform .15s ease, box-shadow .15s ease; }
.vet-photo-thumb:hover{ transform:scale(1.08); box-shadow:0 3px 10px rgba(0,0,0,.18); }

/* Onglets Jour/Semaine/Mois (Suivi journalier) */
.jmode-tab:not(.active):hover{ background:rgba(13,59,17,.06); color:var(--dark); }

/* Cartes CSOM (Suivi journalier) — en-tête accordéon */
.csom-watch-header{ background:#fdf8f3; transition:background-color .15s ease; }
.csom-watch-header:hover{ background:#f5efe1; }

/* MAIN */
#main{flex:1;overflow:hidden;display:flex;flex-direction:column;}
#view-dossier,#view-journal{flex:1;overflow:hidden;}
#view-dossier{
  display:flex;
  gap:10px;
  margin:12px 12px 12px 12px;
  padding:10px;
  border-radius:14px;
  overflow:hidden;
  background:var(--cream-dark);
  box-shadow:0 10px 24px rgba(13,59,17,.08);
}
#view-journal{display:none;}

/* ── Cascade d'entrée — Dossier médical / Suivi journalier ── */
@keyframes viewCascadeIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}
#view-dossier > *, #view-journal > *{
  opacity:0;
  animation:viewCascadeIn .42s cubic-bezier(.16,.84,.44,1) both;
}
#view-dossier > *:nth-child(1), #view-journal > *:nth-child(1){animation-delay:.04s;}
#view-dossier > *:nth-child(2), #view-journal > *:nth-child(2){animation-delay:.1s;}
#view-dossier > *:nth-child(3), #view-journal > *:nth-child(3){animation-delay:.16s;}
#view-dossier > *:nth-child(n+4), #view-journal > *:nth-child(n+4){animation-delay:.22s;}
@media (prefers-reduced-motion: reduce){
  #view-dossier > *, #view-journal > *{animation:none;opacity:1;}
}

/* 3 COLS DOSSIER — desktop, chacune sa propre carte blanche sur le fond de la zone */
.col-wrap{
  flex:1;display:flex;flex-direction:column;overflow:hidden;
  background:white;border-radius:10px;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}
/* Tab bar Dossier — desktop caché */
#dossier-tab-bar{display:none;}
.col-head{
  display:flex;align-items:center;gap:10px;
  padding:16px 18px 10px;flex-shrink:0;
  font-family:'Bitter',serif;font-size:14.5px;font-weight:600;color:var(--dark);
}
.col-head-icon{width:32px;height:32px;border-radius:9px;display:flex;align-items:center;justify-content:center;}
.col-body{flex:1;overflow-y:auto;padding:12px;}
.col-body::-webkit-scrollbar{width:4px;}
.col-body::-webkit-scrollbar-thumb{background:var(--line);border-radius:2px;}

/* SIDEBAR CARDS */
.s-card{background:white;border-radius:16px;border:1.5px solid var(--line);padding:14px;margin-bottom:10px;}
.s-card-dark{background:var(--dark);border-radius:16px;padding:14px;margin-bottom:10px;}

/* Pet hero — fidèle à DesktopLayout.tsx */
#pet-hero{
  border-radius:16px;overflow:hidden;margin:14px 14px 0;
  position:relative;cursor:pointer;
  background:#f0e8df;
  box-shadow:0 2px 12px rgba(13,59,17,.08);
}
#pet-hero-bg-img{
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  display:none;
  filter:blur(2px) brightness(0.80);transform:scale(1.06);
}
#pet-hero-bg-gradient{
  position:absolute;inset:0;
  background:linear-gradient(165deg,#f5ede2,#eddccc);
}
/* Carte frosted-glass intérieure (logo + nom + espèce) */
#pet-hero-inner{
  position:relative;
  background:rgba(255,255,255,.28);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,.45);
  border-radius:12px;
  margin:44px 10px 0;
  padding:12px 12px 10px;
  display:flex;align-items:center;gap:10px;
}
#pet-hero-logo{
  width:38px;height:38px;border-radius:50%;
  background:var(--dark);flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
#pet-hero-logo img{width:22px;height:22px;}
#pet-hero-infos{flex:1;min-width:0;}
#pet-name{
  display:flex;align-items:center;gap:6px;
  font-family:'Bitter',serif;font-size:17px;font-weight:600;
  color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#btn-pet-settings{
  width:22px;height:22px;border-radius:6px;flex-shrink:0;
  border:1px solid rgba(13,59,17,.20);
  background:rgba(13,59,17,.08);
  cursor:pointer;padding:0;
  display:flex;align-items:center;justify-content:center;
}
#btn-pet-settings:hover{background:rgba(13,59,17,.16);}
#pet-sub{font-size:12px;color:#fff;font-family:'Nunito',sans-serif;font-weight:600;}
/* Chips row */
#pet-hero-bottom{
  position:relative;display:flex;gap:6px;
  padding:7px 10px 13px;flex-wrap:nowrap;align-items:center;
}
#pet-chips{display:flex;flex-wrap:nowrap;gap:6px;align-items:center;}
.pet-chip{
  display:flex;align-items:center;gap:4px;
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(4px);
  border-radius:12px;padding:5px 9px;
  font-size:11.5px;color:var(--dark);font-weight:700;
  font-family:'Nunito',sans-serif;
}
#btn-vacc-status{
  width:26px;height:26px;border-radius:50%;border:none;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  flex-shrink:0;transition:background .2s;background:#6c6c6c;
}
#btn-vacc-status:hover{filter:brightness(1.12);}
#btn-antipara-status{
  width:26px;height:26px;border-radius:50%;border:none;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  flex-shrink:0;transition:background .2s;background:#6c6c6c;
}
#btn-antipara-status:hover{filter:brightness(1.12);}
.vacc-tooltip{
  position:fixed;
  width:225px;background:white;border-radius:13px;
  box-shadow:0 10px 28px rgba(0,0,0,.16);
  padding:11px 12px;z-index:60;
  opacity:0;pointer-events:none;transform:translateY(-4px);
  transition:opacity .15s ease, transform .15s ease;
}
.vacc-tooltip.has-content.visible{opacity:1;pointer-events:auto;transform:translateY(0);}
.vacc-tooltip > div:last-child{margin-bottom:0 !important;}

/* Vet card */
.vet-name{font-size:13.5px;font-weight:700;color:var(--dark);margin-bottom:2px;}
.vet-clinic{font-size:11.5px;color:var(--muted);margin-bottom:8px;}
.vet-actions{display:flex;gap:6px;}
.vet-btn{
  flex:1;display:flex;align-items:center;justify-content:center;gap:5px;
  padding:8px 6px;border-radius:10px;border:1.5px solid var(--line);
  background:white;font-size:11px;font-weight:700;color:var(--dark);cursor:pointer;
  font-family:'Nunito',sans-serif;
}
.vet-btn:hover{background:var(--cream);}

/* Share links — styles inline dans le JS */

/* Treatments — styles inline dans renderTreatmentCard() */

/* Daily tip pulse */
@keyframes tipPulse{0%,100%{opacity:.25;}50%{opacity:.8;}}
@keyframes spin{to{transform:rotate(360deg);}}

/* First aid modal */
#firstaid-modal{position:fixed;inset:0;z-index:500;display:none;}
#firstaid-backdrop{position:absolute;inset:0;background:rgba(13,59,17,0.35);backdrop-filter:blur(2px);}
#firstaid-panel{position:absolute;top:0;right:0;bottom:0;width:520px;max-width:95vw;background:#fdf8f3;overflow-y:auto;box-shadow:-8px 0 40px rgba(13,59,17,0.18);animation:slideFromRight .28s cubic-bezier(.32,0,.2,1) both;}
.fa-tip-card{border-radius:18px;margin-bottom:10px;overflow:hidden;border:1.5px solid #f0e8df;background:white;transition:all .15s;}
.fa-tip-card.open{border-color:var(--open-color,#E8503A44);}

/* AI usage bar */
.ai-bar-wrap{background:white;border-radius:14px;border:1.5px solid var(--line);padding:12px;margin-bottom:10px;}

/* AI usage bar */
.ai-bar-wrap{background:white;border-radius:14px;border:1.5px solid var(--line);padding:12px;margin-bottom:10px;}
.ai-bar-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
.ai-bar-label{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;}
.ai-bar-pct{font-size:12px;font-weight:700;color:var(--dark);}
.ai-bar-track{height:6px;background:var(--cream-dark);border-radius:99px;overflow:hidden;}
.ai-bar-fill{height:100%;border-radius:99px;transition:width .4s;background:var(--mint);}
.ai-bar-fill.warn{background:var(--salm);}

/* ── JOURNAL VIEW ─────────────────────────────── */
#journal-wrap{max-width:680px;margin:0 auto;padding:20px 20px 100px;}
.journal-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;}
.journal-date-label{font-family:'Bitter',serif;font-size:17px;font-weight:700;color:var(--dark);text-transform:capitalize;}
.nav-btn{width:34px;height:34px;border-radius:10px;border:1.5px solid var(--line);background:white;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--muted);}
.nav-btn:hover{background:var(--cream);}

/* Journal entry card */
.jentry{background:white;border-radius:16px;border:1.5px solid var(--line);overflow:hidden;margin-bottom:10px;}
.jentry-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;}
.jentry-icon{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.jentry-type{font-size:11px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;}
.jentry-vet{font-size:12.5px;color:var(--muted);margin-top:1px;}
.jentry-badge{margin-left:auto;padding:3px 9px;border-radius:99px;font-size:10.5px;font-weight:800;}
.jentry-body{padding:0 14px 14px;display:none;}
.jentry-body.open{display:block;}
.jentry-notes{font-size:13px;color:var(--muted);line-height:1.6;white-space:pre-wrap;}
.jentry-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px;}
.jentry-tag{padding:3px 9px;border-radius:99px;background:var(--cream);border:1px solid var(--line);font-size:11.5px;color:var(--muted);font-weight:600;}

/* Add journal form */
.jform-card{background:white;border-radius:16px;border:2px dashed var(--line);padding:20px;margin-bottom:10px;}
.jform-title{font-family:'Bitter',serif;font-size:15px;font-weight:700;color:var(--dark);margin-bottom:14px;}
.field-label{font-size:11px;font-weight:700;color:var(--muted2);letter-spacing:.5px;text-transform:uppercase;display:block;margin-bottom:5px;}
.field-input{width:100%;padding:10px 12px;border-radius:11px;border:1.5px solid var(--line);background:white;font-family:'Nunito',sans-serif;font-size:13.5px;color:var(--text);outline:none;margin-bottom:12px;}
.field-input:focus{border-color:rgba(58,142,140,.4);}
.field-textarea{width:100%;padding:10px 12px;border-radius:11px;border:1.5px solid var(--line);background:white;font-family:'Nunito',sans-serif;font-size:13.5px;color:var(--text);outline:none;resize:vertical;min-height:80px;margin-bottom:12px;}
.field-textarea:focus{border-color:rgba(58,142,140,.4);}
.actes-presets{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:12px;}
.preset-chip{padding:5px 10px;border-radius:99px;border:1px solid var(--line);background:var(--cream);font-size:11.5px;color:var(--muted);cursor:pointer;font-family:'Nunito',sans-serif;font-weight:600;}
.preset-chip:hover{border-color:var(--teal);color:var(--teal);}

/* DOSSIER list items */
.hist-item{background:white;border-radius:14px;border:1px solid var(--line);padding:11px 12px;margin-bottom:7px;cursor:pointer;}
.hist-item:hover{border-color:rgba(58,142,140,.3);}
.hist-date{font-size:11px;color:var(--muted2);font-weight:600;margin-bottom:3px;}
.hist-actes{font-size:12.5px;font-weight:700;color:var(--dark);}
.hist-vet{font-size:11.5px;color:var(--muted);}

.med-item{background:white;border-radius:14px;border:1px solid var(--line);padding:11px 12px;margin-bottom:7px;}
.med-name{font-size:13px;font-weight:700;color:var(--dark);}
.med-detail{font-size:11.5px;color:var(--muted);margin-top:2px;}
.med-badge{display:inline-block;padding:2px 8px;border-radius:99px;font-size:10.5px;font-weight:800;}
.med-badge.actif{background:rgba(74,174,110,.15);color:#2d8a50;}
.med-badge.termine{background:rgba(176,144,112,.15);color:#8a7060;}
.med-refill{background:rgba(234,150,108,.15);color:#c0570a;font-size:11px;font-weight:700;padding:3px 9px;border-radius:99px;margin-top:5px;display:inline-block;}

.doc-cat-head{font-size:11px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;margin:12px 0 6px;padding:0 2px;}
.doc-acc{border-radius:14px;margin-bottom:6px;overflow:hidden;transition:background .15s,border-color .15s;}
.doc-acc-btn{width:100%;display:flex;align-items:center;gap:10px;padding:11px 14px;background:transparent;border:none;cursor:pointer;text-align:left;}
.doc-acc-icon{width:34px;height:34px;border-radius:9px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:16px;}
.doc-acc-title{font-size:13.5px;font-family:'Nunito',sans-serif;color:#3a2e25;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.doc-acc-sub{font-size:11px;color:#b09070;font-family:'Nunito',sans-serif;margin-top:1px;}
.doc-acc-chevron{flex-shrink:0;transition:transform .2s;}
.doc-acc-btn:hover{background:rgba(13,59,17,.03);}
.doc-acc-detail{animation:doc-acc-open .25s ease forwards;overflow:hidden;}
@keyframes doc-acc-open{from{opacity:0;max-height:0;}to{opacity:1;max-height:2000px;}}

/* Cartes "Historique des consultations" — même accordéon que CSOM */
.hist-card{transition:box-shadow .18s ease, border-color .18s ease;}
.hist-card:hover{border-color:#d8ccb8 !important;box-shadow:0 3px 12px rgba(0,0,0,.07);}

/* Boutons de téléchargement — cartes d'imagerie (colonne Documents) */
.doc-dl-btn{transition:background .15s ease, transform .12s ease;}
.doc-dl-btn:hover{background:rgba(90,80,170,.06);transform:scale(1.06);}
.doc-img-dl{transition:background .15s ease, transform .12s ease;}
.doc-img-dl:hover{background:rgba(0,0,0,.78);transform:scale(1.08);}
.doc-pdf-row button{transition:transform .12s ease;}
.doc-pdf-row button:hover{transform:scale(1.15);}

/* Chips de filtre par catégorie — colonne Documents (retour à la ligne, pas de scroll horizontal
   pour rester utilisable à la souris, sans trackpad) */
.doc-filter-chip{transition:transform .12s ease, box-shadow .15s ease, opacity .15s ease;}
.doc-filter-chip:hover{transform:scale(1.05);box-shadow:0 2px 8px rgba(0,0,0,.08);}
.doc-filter-chip:active{transform:scale(.97);}
.doc-queue-item{padding:10px 12px;border-radius:12px;margin-bottom:6px;}
.doc-queue-bar{height:4px;background:rgba(0,0,0,0.07);border-radius:3px;overflow:hidden;margin-top:8px;}
.doc-queue-fill{height:100%;border-radius:3px;transition:width 0.5s ease;}

/* ── CHAT POPUP ───────────────────────────────── */
#chat-popup{
  position:fixed;bottom:140px;right:20px;
  width:340px;height:560px;
  background:var(--cream);border-radius:20px;
  box-shadow:0 12px 48px rgba(13,59,17,.22);border:1px solid #f0e8df;
  display:none;flex-direction:column;overflow:hidden;
  z-index:200;
}
#chat-popup.open{display:flex;animation:fadeUpIn .22s cubic-bezier(.32,0,.2,1) both;}
/* Chrome header (dark, DesktopLayout) */
#chat-chrome-head{
  padding:12px 16px;background:#0D3B11;
  display:flex;align-items:center;justify-content:space-between;flex-shrink:0;
}
#chat-chrome-head span{font-family:'Bitter',serif;font-weight:600;font-size:15px;color:white;}
#btn-chat-close{background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.6);}
#btn-chat-close:hover{color:white;}
/* Chat.tsx inner header */
#chat-head{
  padding:14px 16px;
  background:linear-gradient(135deg,rgba(58,142,140,.10),rgba(58,142,140,.04));
  border-bottom:1px solid rgba(58,142,140,.15);
  display:flex;align-items:center;gap:10px;flex-shrink:0;
}
#chat-head-icon{width:40px;height:40px;border-radius:12px;background:#73C698;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
#chat-head-title{font-family:'Bitter',serif;font-size:15px;font-weight:600;color:#0D3B11;}
#chat-head-sub{font-size:11px;color:#0D3B11;font-weight:500;font-family:'Nunito',sans-serif;}
#btn-chat-clear{margin-left:auto;width:36px;height:36px;border-radius:10px;border:1.5px solid rgba(58,142,140,.2);background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#8a7060;}
#chat-msgs{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;}
#chat-msgs::-webkit-scrollbar{width:3px;}
#chat-msgs::-webkit-scrollbar-thumb{background:var(--line);border-radius:2px;}
/* bubbles */
.msg-row{display:flex;}
.msg-row.user{justify-content:flex-end;}
.msg-row.ai{justify-content:flex-start;}
.msg-bubble{max-width:82%;padding:11px 15px;}
.msg-bubble.user{background:#73C698;border-radius:20px 20px 4px 20px;box-shadow:0 4px 16px rgba(58,142,140,.30);}
.msg-bubble.ai{background:white;border:1.5px solid #f0e8df;border-radius:20px 20px 20px 4px;box-shadow:0 4px 16px rgba(0,0,0,.05);}
.msg-text{font-size:13.5px;line-height:1.55;font-family:'Nunito',sans-serif;margin:0;}
.msg-bubble.user .msg-text{color:white;}
.msg-bubble.ai .msg-text{color:#3a2e25;}
/* markdown in chat */
.msg-bubble p{font-size:14px;line-height:1.6;margin:2px 0;font-family:'Nunito',sans-serif;}
.msg-bubble.user p{color:white;}
.msg-bubble.ai p{color:#3a2e25;}
.msg-bubble ul{margin:6px 0;padding-left:18px;}
.msg-bubble li{font-size:14px;line-height:1.6;margin-bottom:2px;font-family:'Nunito',sans-serif;}
.msg-bubble.user li{color:white;}
.msg-bubble.ai li{color:#3a2e25;}
.msg-bubble hr{border:none;border-top:1px solid;margin:8px 0;}
.msg-bubble.user hr{border-color:rgba(255,255,255,.25);}
.msg-bubble.ai hr{border-color:#e8ddd4;}
.msg-bubble .md-h2{font-size:13.5px;font-weight:700;font-family:'Nunito',sans-serif;margin-top:10px;margin-bottom:4px;}
.msg-bubble.user .md-h2{color:white;}
.msg-bubble.ai .md-h2{color:#3a2e25;}
.msg-bubble .md-h3{font-size:13px;font-weight:600;font-family:'Nunito',sans-serif;margin-top:8px;margin-bottom:2px;}
.msg-bubble.user .md-h3{color:rgba(255,255,255,.75);}
.msg-bubble.ai .md-h3{color:#8a7060;}
.msg-time{font-size:10.5px;margin-top:4px;font-family:'Nunito',sans-serif;}
.msg-bubble.user .msg-time{color:rgba(255,255,255,.6);}
.msg-bubble.ai .msg-time{color:#c8b09a;}
/* welcome */
.chat-starters{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px;}
.chat-starter-btn{background:white;border:1.5px solid #f0e8df;border-radius:16px;padding:12px 13px;text-align:left;font-size:12.5px;color:#3a2e25;font-family:'Nunito',sans-serif;cursor:pointer;line-height:1.4;box-shadow:0 2px 8px rgba(0,0,0,.03);transition:border-color .15s;}
.chat-starter-btn:hover{border-color:rgba(58,142,140,.4);}
.chat-welcome{background:white;border-radius:20px;border:1.5px solid #f0e8df;padding:16px;margin-bottom:14px;box-shadow:0 4px 16px rgba(0,0,0,.04);}
.chat-welcome-title{font-family:'Bitter',serif;font-size:16px;color:#3a2e25;margin-bottom:8px;}
.chat-welcome-sub{font-size:13px;color:#8a7060;line-height:1.6;margin:0;}
.chat-starters-label{font-size:11.5px;color:#b09070;font-family:'Nunito',sans-serif;text-align:center;margin-bottom:8px;letter-spacing:.4px;text-transform:uppercase;}
/* typing */
#chat-typing{display:none;align-self:flex-start;}
#chat-typing.visible{display:flex;}
#chat-typing .typing-wrap{background:white;border:1.5px solid #f0e8df;border-radius:20px 20px 20px 4px;padding:12px 16px;display:flex;gap:5px;align-items:center;box-shadow:0 4px 16px rgba(0,0,0,.05);}
.typing-dot{width:8px;height:8px;border-radius:50%;background:#c8b09a;animation:bounce 1.2s ease-in-out infinite;}
.typing-dot:nth-child(2){animation-delay:.15s;}
.typing-dot:nth-child(3){animation-delay:.3s;}
/* error */
#chat-error-bar{margin:0 12px 8px;display:none;align-items:center;gap:8px;background:rgba(232,80,58,.07);border:1.5px solid rgba(232,80,58,.25);border-radius:14px;padding:10px 14px;font-size:13px;color:#E8503A;font-family:'Nunito',sans-serif;}
/* input */
#chat-input-wrap{padding:12px 14px;border-top:1px solid #f0e8df;display:flex;align-items:flex-end;gap:10px;flex-shrink:0;background:rgba(253,248,243,.95);backdrop-filter:blur(12px);}
#chat-input{flex:1;padding:11px 15px;border-radius:18px;border:1.5px solid #e8ddd4;background:white;font-family:'Nunito',sans-serif;font-size:14px;color:#3a2e25;resize:none;max-height:120px;outline:none;line-height:1.5;}
#chat-input:focus{border-color:rgba(58,142,140,.4);}
#btn-chat-send{width:44px;height:44px;border-radius:14px;border:none;background:#e8ddd4;cursor:default;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .15s;box-shadow:none;}
#btn-chat-send.active{background:linear-gradient(135deg,#3A8E8C,#2a6e6c);cursor:pointer;box-shadow:0 4px 12px rgba(58,142,140,.35);}
/* quota gate */
#chat-quota-gate{position:absolute;inset:0;z-index:50;background:rgba(0,0,0,.45);backdrop-filter:blur(4px);display:none;align-items:center;justify-content:center;padding:24px;}
#chat-quota-gate.visible{display:flex;}
#chat-quota-inner{background:white;border-radius:24px;padding:28px 24px;max-width:300px;width:100%;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.15);}

/* ── FABs ─────────────────────────────────────── */
#fab-chat{
  position:fixed;bottom:80px;right:20px;
  width:52px;height:52px;border-radius:50%;border:none;
  background:var(--mint);cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 20px rgba(115,198,152,.5);
  z-index:150;transition:transform .15s;
}
#fab-chat:hover{transform:scale(1.07);}
#fab-chat.chat-open{display:none;}
#fab-add{
  position:fixed;bottom:20px;right:20px;
  width:52px;height:52px;border-radius:50%;border:none;
  background:var(--salm);cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 20px rgba(234,150,108,.5);
  z-index:150;transition:transform .2s;
}
#fab-add:hover{transform:scale(1.07);}
#fab-add.open:hover{transform:rotate(45deg) scale(1.07);}

/* FAB actions */
#fab-actions{
  position:fixed;bottom:132px;right:20px;
  display:flex;flex-direction:column;align-items:stretch;
  z-index:200;
  background:white;border-radius:16px;border:1px solid #f0e8df;
  box-shadow:0 -8px 32px rgba(0,0,0,.14);
  overflow:hidden;min-width:220px;
  pointer-events:none;opacity:0;transform:translateY(8px);
  transition:opacity .18s, transform .18s;
}
#fab-actions.open{pointer-events:all;opacity:1;transform:translateY(0);}
.fab-action-btn{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:11px 16px;border:none;
  background:transparent;cursor:pointer;text-align:left;
  font-family:'Nunito',sans-serif;font-size:13px;font-weight:600;color:var(--dark);
  white-space:nowrap;
}
.fab-action-btn:hover{background:#fdf8f3;}

/* ── PET SWITCHER PANEL ───────────────────────── */
#pet-panel{
  position:fixed;inset:0;z-index:300;
  pointer-events:none;
}
#pet-panel-backdrop{
  position:absolute;inset:0;background:rgba(13,59,17,.25);
  backdrop-filter:blur(4px);
  opacity:0;transition:opacity .25s;
}
#pet-panel-drawer{
  position:absolute;top:0;right:0;bottom:0;width:min(72vw,300px);
  background:var(--cream);border-left:1px solid var(--line);
  transform:translateX(100%);transition:transform .28s cubic-bezier(.4,0,.2,1);
  display:flex;flex-direction:column;overflow:hidden;
}
#pet-panel.open{pointer-events:all;}
#pet-panel.open #pet-panel-backdrop{opacity:1;}
#pet-panel.open #pet-panel-drawer{transform:translateX(0);}
#pet-panel-head{padding:18px 16px 12px;font-family:'Bitter',serif;font-size:16px;font-weight:700;color:var(--dark);border-bottom:1px solid var(--line);flex-shrink:0;display:flex;justify-content:space-between;align-items:center;}
#pet-list{flex:1;overflow-y:auto;padding:12px;}
.pet-list-item{
  display:flex;align-items:center;gap:10px;
  padding:11px 12px;border-radius:14px;border:1.5px solid var(--line);
  background:white;cursor:pointer;margin-bottom:7px;
}
.pet-list-item.active{border-color:var(--mint);background:rgba(115,198,152,.08);}
.pet-list-avatar{width:36px;height:36px;border-radius:10px;background:var(--mint);display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;overflow:hidden;}
.pet-list-avatar img{width:100%;height:100%;object-fit:cover;}
.pet-list-name{font-size:14px;font-weight:700;color:var(--dark);}
.pet-list-sub{font-size:11.5px;color:var(--muted);}
#btn-add-pet{width:100%;padding:12px;border-radius:14px;border:2px dashed var(--line);background:transparent;cursor:pointer;font-family:'Nunito',sans-serif;font-size:13.5px;font-weight:700;color:var(--muted);margin-top:4px;}
#btn-add-pet:hover{border-color:var(--mint);color:var(--dark);}
/* ── Pet AI Slot Panel ── */
#pet-ai-slots-wrap{padding:0 12px 16px;}
#pet-ai-slots-inner{background:rgba(13,59,17,.04);border-radius:16px;padding:12px 14px;border:1.5px solid rgba(13,59,17,.08);}
#pet-ai-slots-toggle{width:100%;background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:space-between;}
.slot-row{display:flex;align-items:center;gap:8px;border-radius:10px;padding:7px 10px;margin-bottom:6px;}
.slot-row.occupied{border:1px solid rgba(115,198,152,.33);background:rgba(115,198,152,.12);}
.slot-row.deceased{border:1px solid rgba(155,142,204,.3);background:rgba(155,142,204,.12);}
.slot-row.free{border:1px dashed rgba(13,59,17,.18);background:rgba(13,59,17,.08);}
.slot-avatar{width:28px;height:28px;border-radius:50%;overflow:hidden;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:13px;}
.slot-name{font-size:12px;font-family:'Nunito',sans-serif;font-weight:700;color:#0D3B11;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.slot-sub{font-size:9.5px;font-family:'Nunito',sans-serif;color:#8a7060;font-weight:600;}
.slot-release-btn{background:none;border:none;cursor:pointer;padding:4px;border-radius:6px;display:flex;align-items:center;flex-shrink:0;}
.slot-release-btn:disabled{opacity:.35;cursor:not-allowed;}
.slot-select{width:100%;background:none;border:none;font-size:11px;font-family:'Nunito',sans-serif;color:#0D3B11;cursor:pointer;outline:none;}
#pet-ai-slots-note{margin-top:8px;font-size:9.5px;font-family:'Nunito',sans-serif;color:#8a7060;line-height:1.4;}
#pet-ai-slots-error{display:none;background:#FFF0ED;border-radius:8px;padding:7px 10px;font-size:11px;font-family:'Nunito',sans-serif;color:#E8503A;font-weight:600;margin-bottom:8px;}
#btn-add-pet:hover{border-color:var(--mint);color:var(--dark);}

/* ── JOURNAL 3-PANELS — regroupés dans la même carte que le Dossier médical ── */
#view-journal{
  gap:10px;
  margin:12px 12px 12px 12px;
  padding:10px;
  border-radius:14px;
  overflow:hidden;
  background:var(--cream-dark);
  box-shadow:0 10px 24px rgba(13,59,17,.08);
}
#journal-left{width:280px;flex-shrink:0;background:white;border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.05);display:flex;flex-direction:column;overflow:hidden;}
#journal-center{flex:1;overflow-y:auto;background:white;border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.05);min-height:0;}
#journal-center-content{min-height:0;}
#journal-right{flex:1;min-width:0;background:white;border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.05);display:flex;flex-direction:column;overflow:hidden;}
#journal-right::-webkit-scrollbar,#journal-center::-webkit-scrollbar{width:4px;}
#journal-right::-webkit-scrollbar-thumb,#journal-center::-webkit-scrollbar-thumb{background:var(--line);border-radius:2px;}
#journal-left-scroll{overflow-y:auto;flex:1;padding:10px 12px 14px;}
.jmode-tabs{display:flex;justify-content:center;gap:3px;padding:12px 12px 10px;flex-shrink:0;background:white;border-bottom:1px solid var(--line);}
.jmode-tab{padding:6px 13px;border-radius:99px;border:none;cursor:pointer;font-family:'Nunito',sans-serif;font-size:12.5px;font-weight:700;background:transparent;color:var(--muted);transition:all .15s;}
.jmode-tab.active{background:var(--dark);color:white;}
.cal-header{display:flex;align-items:center;justify-content:space-between;padding:6px 12px 8px;}
.cal-month-label{font-family:'Bitter',serif;font-size:13px;font-weight:700;color:var(--dark);}
.cal-nav{width:24px;height:24px;border:none;background:none;cursor:pointer;color:var(--muted);display:flex;align-items:center;justify-content:center;border-radius:6px;}
.cal-nav:hover{background:var(--cream);}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;padding:0 10px 10px;}
.cal-day-hd{font-size:9.5px;font-weight:800;color:var(--muted2);text-align:center;padding:2px 0;text-transform:uppercase;}
.cal-day{width:100%;aspect-ratio:1;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:600;color:var(--text);cursor:pointer;position:relative;font-family:'Nunito',sans-serif;border:none;background:none;}
.cal-day:hover{background:var(--cream);}
.cal-day.today{background:var(--dark);color:white;}
.cal-day.selected{background:var(--mint);color:white;}
.cal-day.in-range{background:rgba(115,198,152,.18);}
.cal-day.has-entry::after{content:'';position:absolute;bottom:2px;left:50%;transform:translateX(-50%);width:4px;height:4px;border-radius:50%;background:var(--salm);}
.cal-day.today.has-entry::after,.cal-day.selected.has-entry::after{background:rgba(255,255,255,.7);}
.cal-day.empty{cursor:default;color:transparent;pointer-events:none;}
.sentinelle-wrap{background:white;border-radius:14px;border:1px solid #f0e8df;padding:14px;}
.sentinelle-lbl{font-size:9.5px;font-weight:800;letter-spacing:.7px;text-transform:uppercase;color:var(--muted2);margin-bottom:8px;}
.sentinelle-btn{width:100%;padding:13px 0;border-radius:14px;border:none;background:linear-gradient(135deg,#0D3B11,#1a5c20);color:white;font-family:'Bitter',serif;font-size:14px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 4px 14px rgba(13,59,17,0.25);}
.sentinelle-btn:disabled{background:#c8d8c8;color:white;cursor:not-allowed;box-shadow:none;}
.sentinelle-hint{font-size:11px;color:var(--muted2);margin-top:7px;line-height:1.4;}
.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--line);border-radius:16px;overflow:hidden;border:1px solid var(--line);margin:16px 20px;}
.metric-field{background:white;padding:12px 14px;position:relative;min-height:54px;}
.metric-field.full{grid-column:1/-1;}
.metric-label{font-size:9px;font-weight:800;letter-spacing:.8px;text-transform:uppercase;color:var(--muted2);margin-bottom:4px;display:flex;align-items:center;gap:4px;}
.metric-value{font-size:14px;font-weight:600;color:var(--text);}
.metric-empty{font-size:13px;color:var(--muted2);font-weight:400;}
.metric-edit-btn{position:absolute;top:9px;right:9px;width:22px;height:22px;border-radius:6px;border:none;background:var(--cream);cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--muted2);opacity:0;transition:opacity .15s;}
.metric-field:hover .metric-edit-btn{opacity:1;}
.photos-section{margin:0 20px 20px;background:white;border-radius:14px;border:1.5px solid var(--line);padding:14px;}
.photos-section-title{font-size:13px;font-weight:700;color:var(--dark);margin-bottom:10px;}
.jour-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;text-align:center;}
.jour-empty-icon{font-size:42px;margin-bottom:10px;}
.jour-empty-title{font-family:'Bitter',serif;font-size:16px;font-weight:700;color:var(--dark);margin-bottom:5px;}
.jour-empty-sub{font-size:13px;color:var(--muted);margin-bottom:14px;}
.jour-add-btn{padding:11px 22px;border-radius:12px;border:none;background:var(--dark);color:white;font-family:'Nunito',sans-serif;font-size:13.5px;font-weight:700;cursor:pointer;}
.gauges-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px;}
.gauge-card{background:white;border-radius:14px;border:1px solid var(--line);padding:14px 10px;display:flex;flex-direction:column;align-items:center;}
.gauge-label{font-size:11.5px;color:var(--muted);font-weight:600;margin-top:7px;text-align:center;}
.gauge-quality{font-size:10.5px;font-weight:800;margin-top:2px;}
.chart-section{background:white;border-radius:14px;border:1px solid var(--line);padding:14px;margin-bottom:10px;}
.chart-section-title{font-size:12.5px;font-weight:700;color:var(--text);margin-bottom:10px;}
.chart-wrap{position:relative;height:110px;}
.patho-lbl{font-family:'Nunito',sans-serif;font-weight:700;font-size:11px;color:#D97757;text-transform:uppercase;letter-spacing:.7px;}
.patho-section{margin-bottom:18px;}
.patho-name{font-size:13px;font-weight:700;color:var(--dark);border-left:3px solid var(--salm);padding-left:8px;margin-bottom:8px;}
.patho-chart-lbl{font-size:10.5px;color:var(--muted);font-weight:600;margin-bottom:6px;}
.patho-chart-wrap{position:relative;height:90px;margin-bottom:10px;}
.patho-add-measure{border:1.5px dashed var(--line);border-radius:10px;padding:8px;text-align:center;font-size:11.5px;color:var(--teal);font-weight:700;cursor:pointer;font-family:'Nunito',sans-serif;background:none;width:100%;}
.jcenter-section-lbl{font-size:9.5px;font-weight:800;letter-spacing:.8px;text-transform:uppercase;color:var(--muted2);margin-bottom:2px;}
.jcenter-title{font-family:'Bitter',serif;font-size:17px;font-weight:700;color:var(--dark);}
.jcenter-subtitle{font-size:12px;color:var(--muted);margin-top:2px;}
.photo-upload-btn{display:inline-flex;align-items:center;gap:6px;padding:9px 14px;border-radius:11px;border:1.5px dashed var(--line);background:white;font-size:12.5px;font-weight:700;color:var(--muted);cursor:pointer;font-family:'Nunito',sans-serif;}
.photo-upload-btn:hover{border-color:var(--teal);color:var(--teal);}

/* ── ANIMATIONS ───────────────────────────────── */
@keyframes spin{to{transform:rotate(360deg);}}
@keyframes bounce{0%,100%{transform:translateY(0);}50%{transform:translateY(-5px);}}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}

/* ── NO PETS STATE ────────────────────────────── */
#no-pets{display:none;flex:1;align-items:center;justify-content:center;flex-direction:column;gap:12px;padding:40px;}
#no-pets.visible{display:flex;}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — app.html
   Pattern IDENTIQUE à la web app Charly (BottomNav.tsx / App.tsx)
   Breakpoint : 1024px  (même que useIsDesktop() dans App.tsx)
══════════════════════════════════════════════════════════════ */

/* ── Bottom nav — caché sur desktop ─────────────── */
#bottom-nav { display: none; }
/* Hamburger plus nécessaire — retiré du DOM */
#topbar-hamburger { display: none !important; }
/* Bouton flottant pet switcher — caché sur desktop */
#pet-float-btn { display: none; }
/* CTAs Accueil mobile — cachés sur desktop */
#dash-mobile-ctas { display: none; }
/* Dossier tab bar — caché sur desktop */
#dossier-tab-bar { display: none; }

/* ── Mobile / tablette (< 1024px) — pattern App.tsx ── */
@media (max-width: 1023px) {
  :root { --topbar: 54px; }

  /* ── Topbar simplifié */
  #topbar-logo { width: auto; flex: 1; padding: 0 16px; }
  #topbar-center { display: none; }   /* tabs → bottom nav uniquement */
  #topbar-right { display: none; }    /* pet switcher → bouton flottant */

  /* ── Layout corps : colonne unique */
  #body { flex-direction: column; overflow: hidden; }

  /* ── SIDEBAR = vue "Accueil" — visible par défaut sur mobile ──────────── */
  #sidebar {
    display: block;                       /* Accueil = vue par défaut */
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    border-right: none;
  }
  /* Cachée uniquement quand on navigue vers Dossier/Journal */
  #sidebar.mobile-hidden { display: none; }

  /* ── MAIN : caché par défaut sur mobile, visible sur Dossier/Journal */
  #main {
    display: none;
    width: 100%;
    flex-direction: column;
    overflow: hidden;
  }
  #main.mobile-active { display: flex; }

  /* ── Vues dans main */
  #view-dossier, #view-journal { flex: 1; }

  /* Dossier : flex-column pour tab bar + contenu */
  #view-dossier { flex-direction: column; overflow: hidden; }

  /* ── Tab bar Dossier — identique à MedicalRecord.tsx ── */
  #dossier-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--line);
    background: var(--cream);
    padding: 0 16px;
    flex-shrink: 0;
  }
  .dtab {
    flex: 1; padding: 14px 4px 12px;
    border: none; background: transparent; cursor: pointer;
    position: relative; display: flex; flex-direction: column;
    align-items: center; gap: 3px; border-radius: 0;
    font-family: 'Nunito', sans-serif; font-size: 11.5px; font-weight: 400;
    color: var(--muted2); -webkit-tap-highlight-color: transparent;
    transition: color .15s;
  }
  .dtab.dtab-active { color: var(--text); font-weight: 600; }
  .dtab.dtab-active::after {
    content: '';
    position: absolute; bottom: 0; left: 20%; right: 20%;
    height: 2.5px; border-radius: 2px;
    background: linear-gradient(90deg, #D97757, #b85a38);
  }
  .dtab svg { width: 18px; height: 18px; flex-shrink: 0; }

  /* Colonnes dossier : une seule visible à la fois sur mobile */
  .col-wrap { display: none; flex: 1; flex-direction: column; overflow: hidden; border-right: none; }
  .col-wrap.dtab-active { display: flex; }
  .col-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* Journal — colonne unique (pattern mobile Journal.tsx) */
  #view-journal { flex-direction: column; overflow: hidden; }
  #journal-left, #journal-right { display: none; }
  #journal-center {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  #journal-mobile-nav { display: flex !important; }

  /* Espace bottom nav */
  .col-body,
  #journal-center { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* ── FABs cachés sur mobile — remplacés par le bottom nav ── */
  #fab-chat, #fab-add, #fab-actions { display: none !important; }

  /* ── Chat plein écran sur mobile (onglet Charly) ── */
  #chat-popup {
    position: fixed;
    inset: 0;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    border: none;
    z-index: 150; /* sous le bottom nav (200) */
    display: none;
    flex-direction: column;
  }
  #chat-popup.open {
    display: flex;
    animation: none; /* pas d'animation en plein écran */
  }
  /* Cacher le bouton fermer (X) sur mobile — on utilise la bottom nav */
  #btn-chat-close { display: none; }
  /* Afficher le bouton retour sur mobile */
  #btn-chat-back { display: flex !important; }

  /* ── Bottom nav — identique à BottomNav.tsx ── */
  #bottom-nav {
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 200;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-top: 10px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(253,248,243,0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  #bottom-nav::after {
    content: '';
    position: absolute; bottom: 7px; left: 50%;
    transform: translateX(-50%);
    width: 134px; height: 5px; border-radius: 3px;
    background: rgba(0,0,0,0.15);
  }
  .bnav-btn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    border: none; background: transparent;
    font-family: 'Nunito', sans-serif;
    font-size: 10.5px; font-weight: 400;
    color: var(--dark); cursor: pointer;
    padding: 0 6px;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
  }
  .bnav-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
  .bnav-btn.active { color: var(--salm); font-weight: 600; }
  .bnav-btn.active svg path,
  .bnav-btn.active svg rect,
  .bnav-btn.active svg line,
  .bnav-btn.active svg circle { stroke: var(--salm); }

  /* ── Bouton flottant pet switcher — identique App.tsx ── */
  #pet-float-btn {
    display: block;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + var(--topbar) + 14px);
    right: 14px;
    z-index: 100;
    width: 46px; height: 46px; border-radius: 50%;
    border: 3px solid rgba(13,59,17,0.30);
    overflow: hidden;
    background: rgba(253,248,243,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer; padding: 0;
    box-shadow: 0 3px 16px rgba(13,59,17,0.20);
  }
  #pet-float-btn img { width: 100%; height: 100%; object-fit: cover; }

  /* ── Éléments Accueil (sidebar mobile) ── */
  /* Hero pet : marge latérale réduite */
  #pet-hero { margin: 10px 14px 0; }
  /* Cards CTA dashboard — visibles sur mobile */
  #dash-mobile-ctas { display: flex; flex-direction: column; }
  /* Float button — caché sur Accueil, visible sur autres onglets */
  #pet-float-btn.on-accueil { display: none; }
}

/* ── XS (≤ 380px) ── */
@media (max-width: 380px) {
  .bnav-btn { font-size: 9.5px; }
  .bnav-btn svg { width: 22px; height: 22px; }
  #pet-float-btn { width: 40px; height: 40px; top: calc(env(safe-area-inset-top, 0px) + var(--topbar) + 10px); right: 10px; }
}

/* iOS — évite le zoom sur les inputs */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px !important; }
}
