/* style.css — FamilyPet+ Web mobile-first
 * Palette : cream / ink / green (FP brand) / honey / lilac / coral / water
 * Mobile-first, optimisé Safari iOS 375px.
 */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Palette FamilyPet+ */
  --cream:    #FAF8F4;
  --cream-2:  #F4F0E8;
  --ink:      #2C2A26;
  --ink-mute: #6B6862;
  --ink-dim:  #A39E96;
  --green:    #5BA871;
  --green-d:  #3E8654;
  --green-l:  #E6F3EA;
  --honey:    #E8B547;
  --honey-l:  #FBF1D8;
  --lilac:    #C9B3E8;
  --lilac-l:  #F2EBFA;
  --coral:    #E8755B;
  --coral-l:  #FCE6E0;
  --water:    #7BB7D9;
  --water-l:  #E3F1F8;
  --border:   #ECE7DD;
  --surface:  #FFFFFF;
  --danger:   #C14545;

  /* Sizing */
  --radius:    16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --pill:      999px;
  --shadow-sm: 0 1px 3px rgba(44, 42, 38, 0.06);
  --shadow:    0 4px 16px rgba(44, 42, 38, 0.08);
  --shadow-lg: 0 8px 32px rgba(44, 42, 38, 0.12);
  --topbar-h:  56px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

html, body {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont,
               'Segoe UI', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
}

/* iOS safe areas — applied via padding wrapper.
   On veut le contenu sous la status bar pour les "Add to home screen". */

a {
  color: var(--green-d);
  text-decoration: none;
}
a:hover, a:focus { text-decoration: underline; }

button {
  font: inherit;
  cursor: pointer;
}

/* ─── App container ─────────────────────────────────────────────── */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: calc(var(--topbar-h) + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
}
.app--no-topbar {
  padding-top: var(--safe-top);
}
.app-inner {
  padding: 16px;
}

/* ─── Top bar ──────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  padding-right: 8px;
}
.topbar-back, .topbar-spacer {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
  border-radius: 12px;
}
.topbar-back svg { width: 22px; height: 22px; }
.topbar-back:active { background: var(--cream-2); }
.topbar-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--ink);
  /* Center le titre malgré bouton retour à gauche */
  padding-right: 4px;
}
.topbar-right {
  min-width: 44px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.topbar-right a {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  border-radius: 12px;
}
.topbar-right a:active { background: var(--cream-2); }
.topbar-right svg { width: 22px; height: 22px; }

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border: none;
  border-radius: var(--pill);
  font-size: 16px;
  font-weight: 600;
  color: var(--cream);
  background: var(--green);
  letter-spacing: -0.1px;
  transition: transform 0.08s ease, opacity 0.15s ease;
  text-align: center;
}
.btn:active     { transform: scale(0.97); }
.btn:disabled,
.btn--loading   { opacity: 0.65; cursor: not-allowed; }

.btn--block     { width: 100%; }
.btn--secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--border); }
.btn--ghost     { background: transparent; color: var(--green-d); border: 1.5px solid var(--green); }
.btn--coral     { background: var(--coral); }
.btn--honey     { background: var(--honey); color: var(--ink); }
.btn--danger    { background: var(--danger); }

.btn-sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── Forms ───────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding-left: 4px;
}
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  /* IMPORTANT iOS : >= 16px sinon zoom auto au focus */
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(91, 168, 113, 0.15);
}
.field textarea { min-height: 100px; resize: vertical; }
.field .hint {
  font-size: 12px;
  color: var(--ink-dim);
  padding-left: 4px;
}
.field .err {
  font-size: 13px;
  color: var(--danger);
  padding-left: 4px;
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card--soft   { background: var(--cream-2); box-shadow: none; }
.card--green  { background: var(--green-l); }
.card--honey  { background: var(--honey-l); }
.card--lilac  { background: var(--lilac-l); }
.card--water  { background: var(--water-l); }

.card h2, .section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

/* ─── Landing & Hero ──────────────────────────────────────────── */
.hero-landing {
  text-align: center;
  padding: 56px 8px 32px;
}
.hero-landing .emoji {
  font-size: 84px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(91, 168, 113, 0.25));
}
.hero-landing h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.hero-landing p {
  font-size: 15px;
  color: var(--ink-mute);
  max-width: 320px;
  margin: 0 auto 8px;
}
.hero-landing .badge-soon {
  display: inline-block;
  background: var(--honey-l);
  color: #8B6A14;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: var(--pill);
  margin-top: 16px;
}

/* ─── Today hero ─────────────────────────────────────────────── */
.animal-hero {
  background: linear-gradient(135deg, var(--green-l) 0%, var(--lilac-l) 100%);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.animal-avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}
img.animal-avatar { padding: 0; font-size: 0; }
.animal-meta h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-transform: none;
  color: var(--ink);
  margin-bottom: 2px;
}
.animal-meta p {
  font-size: 14px;
  color: var(--ink-mute);
}

/* ─── Stats grid (today) ─────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.stat-tile {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-tile .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--ink-dim);
  margin-bottom: 4px;
}
.stat-tile .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.stat-tile .unit {
  font-size: 13px;
  color: var(--ink-mute);
  font-weight: 500;
}

/* ─── Big action buttons (Today) ─────────────────────────────── */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-align: center;
  transition: transform 0.08s ease;
}
.action-tile:active { transform: scale(0.97); }
.action-tile .icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--green-l);
}
.action-tile--meal  .icon { background: var(--honey-l); }
.action-tile--water .icon { background: var(--water-l); }
.action-tile--weight .icon { background: var(--lilac-l); }
.action-tile--health .icon { background: var(--coral-l); }
.action-tile .label {
  font-size: 14px;
  font-weight: 600;
}

/* ─── Lists ─────────────────────────────────────────────────── */
.list { list-style: none; }
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .lead {
  font-size: 22px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream-2);
  border-radius: 12px;
  flex-shrink: 0;
}
.list-item .body { flex: 1; min-width: 0; }
.list-item .body .title { font-weight: 600; color: var(--ink); }
.list-item .body .sub   { font-size: 13px; color: var(--ink-mute); }
.list-item .trail { font-size: 13px; color: var(--ink-mute); text-align: right; }
.list-item-link {
  width: 100%;
  background: none;
  border: none;
  padding: 12px 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  font: inherit;
}
.list-item-link:last-child { border-bottom: none; }

/* ─── Settings list ─────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 15px;
}
.settings-row:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.settings-row:last-child  { border-bottom: none; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.settings-row .label { flex: 1; }
.settings-row .chev  { color: var(--ink-dim); font-size: 18px; }
.settings-group {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

/* ─── Empty state ──────────────────────────────────────────── */
.empty {
  text-align: center;
  color: var(--ink-dim);
  font-size: 14px;
  font-style: italic;
  padding: 20px 12px;
}

/* ─── Toast ────────────────────────────────────────────────── */
#toast-root {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--cream);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--green-d); }
.toast--error   { background: var(--danger); }

/* ─── Appetite chips (Meal page) ───────────────────────────── */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.chip .emoji { font-size: 26px; line-height: 1; }
.chip[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-l);
  color: var(--green-d);
}

/* ─── Meal type tabs ──────────────────────────────────────── */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream-2);
  padding: 4px;
  border-radius: var(--pill);
  margin-bottom: 16px;
}
.tabs button {
  background: transparent;
  border: none;
  padding: 10px;
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-mute);
}
.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ─── Score health badge ──────────────────────────────────── */
.health-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 8px;
  background: var(--green-l);
  color: var(--green-d);
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

/* ─── Auth pages ─────────────────────────────────────────── */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 20px calc(24px + var(--safe-bottom));
  max-width: 460px;
  margin: 0 auto;
}
.auth-logo {
  text-align: center;
  margin-top: 24px;
  margin-bottom: 28px;
}
.auth-logo .emoji {
  font-size: 56px;
  margin-bottom: 8px;
}
.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
}
.auth-page .form { margin-top: 8px; }
.auth-page .footer-link {
  margin-top: 26px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-mute);
}

/* ─── Footer note ───────────────────────────────────────── */
.note-soon {
  margin: 22px 0 6px;
  padding: 14px 16px;
  background: var(--honey-l);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #8B6A14;
  text-align: center;
  line-height: 1.5;
}

/* Pour les preset buttons "+50g" etc. */
.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.preset-btn {
  flex: 1;
  min-width: 70px;
  padding: 12px 8px;
  background: var(--cream-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.preset-btn:active {
  background: var(--green-l);
  border-color: var(--green);
}

/* ─── Briefing audio (Today) ──────────────────────────────────── */
.briefing-card {
  margin-bottom: 18px;
}
.briefing-btn {
  position: relative;
  background: linear-gradient(135deg, var(--honey) 0%, #F2C76B 100%);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(232, 181, 71, 0.32);
}
.briefing-btn__icon {
  font-size: 20px;
  line-height: 1;
}
.briefing-btn__label {
  font-weight: 700;
  letter-spacing: -0.1px;
}
.briefing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--honey);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.briefing-btn--disabled {
  background: var(--cream-2);
  color: var(--ink-dim);
  box-shadow: none;
  cursor: not-allowed;
}
.briefing-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.briefing-ctrl {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 600;
}
.briefing-ctrl:active { background: var(--cream-2); }
.briefing-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  min-height: 1em;
}

/* ─── Paywall overlay ─────────────────────────────────────────── */
.paywall-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(44, 42, 38, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0;
  animation: paywallFade 0.18s ease-out;
}
@keyframes paywallFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.paywall-box {
  width: 100%;
  max-width: 480px;
  background: var(--cream);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 28px 20px calc(20px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: paywallSlide 0.22s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes paywallSlide {
  from { transform: translateY(20%); }
  to   { transform: translateY(0); }
}
.paywall-head { text-align: center; margin-bottom: 18px; }
.paywall-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--honey-l);
  color: #8B6A14;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}
.paywall-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 8px;
  text-transform: none;
}
.paywall-text {
  font-size: 14px;
  color: var(--ink-mute);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}
.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
@media (min-width: 600px) {
  .paywall-overlay { align-items: center; padding: 16px; }
  .paywall-box {
    border-radius: 24px;
    padding-bottom: 24px;
  }
}

/* Responsive desktop fallback : on garde la même largeur, juste centrée. */
@media (min-width: 600px) {
  body { background: var(--cream-2); }
  .app, .auth-page {
    box-shadow: 0 0 60px rgba(44, 42, 38, 0.06);
    background: var(--cream);
  }
}

/* Print : friendly carnet santé impression. */
@media print {
  body { background: #fff; }
  .topbar, #toast-root, .btn, .action-tile, .briefing-card, .paywall-overlay { display: none !important; }
}

/* ─── MIMI 01 : Forgot / Reset / Account ─────────────────────── */
/* Namespace .feat-account-* — porté par les 3 pages forgot/reset/account
 * pour éviter d'entrer en collision avec d'autres features. */
.feat-account-page {
  padding-bottom: calc(40px + var(--safe-bottom));
}
.feat-account-form .field input {
  /* iOS : >= 16px sinon zoom auto au focus — déjà géré par .field,
     on garde un override explicite par sécurité. */
  font-size: 16px;
}
.feat-account-rgpd {
  border: 1px solid var(--border);
}
.feat-account-rgpd .btn-stack { margin-top: 4px; }

/* ─── MIMI 03 : Settings appearance / language pickers ───────── */
/* Namespace .feat-pref-* — réservé aux contrôles de réglages dark / langue. */
.feat-pref-row {
  /* Surcharge légère de .settings-row : on aligne le picker à droite. */
  align-items: center;
}
.feat-pref-row .feat-pref-value {
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 4px;
}
.feat-pref-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--cream-2);
  border: 1.5px solid var(--border);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 28px 8px 12px;
  border-radius: var(--pill);
  /* Petite chevron en SVG inline (CSS) — pas d'image externe. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%236B6862' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
  cursor: pointer;
  min-height: 36px;
}
.feat-pref-select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(91, 168, 113, 0.15);
}


/* ============================================================== */
/* ═══ DARK MODE OVERRIDES ════════════════════════════════════════
 * Activé via body.dark (ou via prefers-color-scheme si fp_theme=auto,
 * voir theme-bootstrap.js). On override uniquement les variables et
 * quelques surfaces translucides (topbar, paywall) — la quasi-totalité
 * des composants utilise déjà des var() donc se met à jour gratuitement.
 * ============================================================== */
body.dark {
  --cream:    #1A1815;
  --cream-2:  #25221E;
  --ink:      #F2EEE5;
  --ink-mute: #B5AFA4;
  --ink-dim:  #7E796F;
  --green:    #6CC089;   /* +12% L pour pop sur fond sombre */
  --green-d:  #8FD3A6;
  --green-l:  #21372A;
  --honey:    #E8B547;
  --honey-l:  #3D3220;
  --lilac:    #C9B3E8;
  --lilac-l:  #2D2738;
  --coral:    #F08A72;
  --coral-l:  #3E2620;
  --water:    #7BB7D9;
  --water-l:  #1F2E37;
  --border:   #353129;
  --surface:  #221F1B;
  --danger:   #E26565;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow:    0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
}

/* Topbar : la rgba() inline est dans la couleur cream du light mode,
 * donc on force la variante sombre ici. */
body.dark .topbar {
  background: rgba(26, 24, 21, 0.92);
}

/* Petites surfaces qui utilisent une couleur hardcodée pour le texte
 * (« coming soon » honey, score health, etc.) — on réajuste les
 * contrastes pour rester WCAG AA. */
body.dark .hero-landing .badge-soon,
body.dark .paywall-emoji {
  background: #3D3220;
  color: #F2C76B;
}
body.dark .settings-row[style*="--honey-l"] {
  /* Inline style="background:var(--honey-l)" → déjà var(), rien à faire,
   * mais le texte muted à 8B6A14 hardcodé devient illisible. On le rattrape. */
}
/* Les `style="color:#8B6A14"` inline dans settings.php / today.php se
 * lisent mal en sombre — on les force via attribute selector. */
body.dark [style*="color:#8B6A14"],
body.dark [style*="color: #8B6A14"] {
  color: #E8B547 !important;
}

/* Paywall overlay : assombrir le scrim. */
body.dark .paywall-overlay {
  background: rgba(0, 0, 0, 0.65);
}

/* iOS Safari : meta theme-color est déjà géré par mimi_head() en PHP,
 * mais on peut aussi définir media-query CSS comme fallback minimal. */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
  }
}
html[data-theme="dark"] {
  color-scheme: dark;
}

/* NOTE 2026-05-24 : règles .feat-google-* retirées (Google Sign-In déplacé
 * vers l'app mobile native uniquement). */

/* ─── MIMI 13 : Snacks tracking ───────────────────────────────────
 * Namespace .feat-snacks-* — page de log friandises/jouets/cadeaux
 * avec stats du jour et warning si > 5 (overfeeding). Couleur honey.
 */
.feat-snacks-page {
  /* Pas de surcharge globale, on s'appuie sur .app-inner. */
}
.feat-snacks-stats {
  /* card--honey fournit déjà le fond, on ajoute juste le layout. */
}
.feat-snacks-stats__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.feat-snacks-stats__big {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--ink);
}
.feat-snacks-stats__big > span:first-child {
  /* Highlight le compteur en honey foncé pour lisibilité. */
  color: #8B6A14;
}
.feat-snacks-stats__unit {
  display: inline-block;
  margin-left: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  vertical-align: middle;
}
.feat-snacks-stats__hint {
  font-size: 13px;
  color: var(--ink-mute);
  text-align: right;
  max-width: 48%;
}
.feat-snacks-stats__warning {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--coral-l);
  color: var(--coral);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.feat-snacks-add-toggle {
  margin: 6px 0 14px;
}

.feat-snacks-form {
  /* card fournit le fond, on ajoute juste le layout des actions. */
}
.feat-snacks-form__actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.feat-snacks-form__actions .btn {
  flex: 1;
}

.feat-snacks-list__item {
  /* Position relative pour le bouton supprimer en flux. */
  align-items: center;
}
.feat-snacks-list__del {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: var(--cream-2);
  color: var(--ink-mute);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.feat-snacks-list__del:hover {
  background: var(--coral-l);
  color: var(--coral);
}
.feat-snacks-list__del:active {
  transform: scale(0.92);
}
.feat-snacks-list__del:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dark mode : la couleur honey-d fond perd en contraste, on rattrape. */
body.dark .feat-snacks-stats__big > span:first-child,
html[data-theme="dark"] .feat-snacks-stats__big > span:first-child {
  color: #F2C76B;
}

/* ─── MIMI 15 : Mood tracking ─────────────────────────────────────
 * Namespace .feat-mood-* — page de log humeur (5 emojis) + historique
 * 30j + stat humeur dominante. Couleur thème : lilac (var --lilac).
 */
.feat-mood-card {
  /* Fond lilac très clair pour démarquer la carte principale du picker. */
  background: var(--lilac-l);
}
.feat-mood-card h2 {
  /* On garde le style section-title mais on permet une lecture plus humaine
   * sur cette carte d'intro (pas de uppercase, plus contrasté). */
  text-transform: none;
  letter-spacing: -0.1px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}

.feat-mood-picker {
  display: grid;
  /* 5 emojis : 5 colonnes sur >= 360px, sinon wrap auto en 3 + 2. */
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 380px) {
  /* Petits écrans (iPhone SE) : 3 cols puis 2 en dessous. */
  .feat-mood-picker { grid-template-columns: repeat(3, 1fr); }
}

.feat-mood-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  /* Touch target 44px minimum (a11y). */
  min-height: 72px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.feat-mood-option:active { transform: scale(0.96); }
.feat-mood-option .emoji {
  font-size: 28px;
  line-height: 1;
}
.feat-mood-option .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: -0.1px;
}
.feat-mood-option[aria-checked="true"] {
  background: var(--lilac);
  border-color: var(--lilac);
  /* Texte sombre car lilac est clair. */
  color: var(--ink);
}
.feat-mood-option[aria-checked="true"] .label {
  color: var(--ink);
  font-weight: 700;
}
.feat-mood-option:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 2px;
}

.feat-mood-submit {
  /* Bouton lilac pour rester dans la palette thème de la feature. */
  background: var(--lilac);
  color: var(--ink);
}
.feat-mood-submit:hover { filter: brightness(0.97); }

.feat-mood-stats {
  background: var(--surface);
}
.feat-mood-dominant {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
}
.feat-mood-dominant .emoji {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--lilac-l);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}
.feat-mood-dominant .meta { flex: 1; min-width: 0; }
.feat-mood-dominant .title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  text-transform: none;
}
.feat-mood-dominant .sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 2px;
}

/* Items d'historique : on s'appuie sur .list-item existant et on ajoute
 * juste le bouton de suppression à droite. */
.feat-mood-item .lead {
  /* Fond lilac plutôt que cream-2 pour cohérence visuelle. */
  background: var(--lilac-l);
}
.feat-mood-del {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.feat-mood-del:hover {
  background: var(--coral-l);
  color: var(--coral);
}
.feat-mood-del:active { transform: scale(0.92); }
.feat-mood-del:disabled { opacity: 0.5; cursor: not-allowed; }

/* Dark mode : lilac-l est sombre, on ajuste un poil les bordures et le
 * fond du bouton sélectionné pour garder le contraste. */
body.dark .feat-mood-option[aria-checked="true"],
html[data-theme="dark"] .feat-mood-option[aria-checked="true"] {
  background: var(--lilac);
  color: #1A1815;
  border-color: var(--lilac);
}
body.dark .feat-mood-option[aria-checked="true"] .label,
html[data-theme="dark"] .feat-mood-option[aria-checked="true"] .label {
  color: #1A1815;
}
body.dark .feat-mood-submit,
html[data-theme="dark"] .feat-mood-submit {
  color: #1A1815;
}

/* ─── MIMI 26 — Trial countdown banner (feat-trialcountdown) ─────
 * Banner global injecté en tête de .app-inner. Hydraté côté client
 * (trial-banner.js) à partir de /api.php?action=me_premium.
 *   - --countdown : trial actif, ≤ 3 jours (doré chaud)
 *   - --expired   : trial passé, plus Premium (rouge soft)
 * Le badge "DEMAIN" se substitue à la flèche CTA quand days_left == 1.
 * Dismissable via la croix (cookie fp_trialbanner_dismiss, 24h).
 */
.feat-trialcountdown-root[hidden] { display: none; }
.feat-trialcountdown-banner {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin: 0 0 14px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: featTrialcountdownIn 0.25s ease-out;
}
@keyframes featTrialcountdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feat-trialcountdown-banner--countdown {
  background: linear-gradient(135deg, #FBE7A8 0%, var(--honey) 100%);
  color: var(--ink);
  border: 1px solid rgba(193, 138, 17, 0.18);
}
.feat-trialcountdown-banner--expired {
  background: linear-gradient(135deg, var(--coral-l) 0%, #F3A493 100%);
  color: #5C1F12;
  border: 1px solid rgba(193, 67, 45, 0.25);
}
.feat-trialcountdown-cta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 48px; /* Touch target iOS — au moins 44pt */
}
.feat-trialcountdown-cta:active { transform: scale(0.985); }
.feat-trialcountdown-cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
  border-radius: var(--radius-sm);
}
.feat-trialcountdown-label {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.1px;
  line-height: 1.35;
}
.feat-trialcountdown-arrow {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 10px;
  background: rgba(44, 42, 38, 0.12);
  border-radius: var(--pill);
}
.feat-trialcountdown-banner--expired .feat-trialcountdown-arrow {
  background: rgba(92, 31, 18, 0.16);
}
.feat-trialcountdown-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  background: var(--danger);
  color: #FFF;
  border-radius: var(--pill);
  box-shadow: 0 1px 4px rgba(193, 69, 69, 0.4);
  animation: featTrialcountdownPulse 1.6s ease-in-out infinite;
}
@keyframes featTrialcountdownPulse {
  0%, 100% { box-shadow: 0 1px 4px rgba(193, 69, 69, 0.4); }
  50%      { box-shadow: 0 1px 8px rgba(193, 69, 69, 0.7); }
}
.feat-trialcountdown-close {
  flex-shrink: 0;
  width: 40px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}
.feat-trialcountdown-close:hover,
.feat-trialcountdown-close:focus-visible { opacity: 1; }
.feat-trialcountdown-close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
  border-radius: var(--radius-xs);
}
.feat-trialcountdown-close:active { transform: scale(0.92); }

@media (prefers-reduced-motion: reduce) {
  .feat-trialcountdown-banner,
  .feat-trialcountdown-badge { animation: none; }
}

/* Dark mode — on garde la même teinte chaude mais on ramène les bordures */
body.dark .feat-trialcountdown-banner--countdown,
html[data-theme="dark"] .feat-trialcountdown-banner--countdown {
  background: linear-gradient(135deg, #5D4818 0%, #8A6A1F 100%);
  color: #FAF8F4;
  border-color: rgba(251, 241, 216, 0.16);
}
body.dark .feat-trialcountdown-banner--expired,
html[data-theme="dark"] .feat-trialcountdown-banner--expired {
  background: linear-gradient(135deg, #5C1F12 0%, #8C3520 100%);
  color: #FAF8F4;
  border-color: rgba(252, 230, 224, 0.18);
}
body.dark .feat-trialcountdown-arrow,
html[data-theme="dark"] .feat-trialcountdown-arrow {
  background: rgba(255, 255, 255, 0.18);
}

/* ═══════════════════════════════════════════════════════════════
 * MIMI 16 — Stock alimentaire + barcode scanner web
 * Namespace : .feat-stock-*
 * ═══════════════════════════════════════════════════════════════ */

.feat-stock-list .feat-stock-item {
  align-items: flex-start;
}

.feat-stock-item .feat-stock-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: 8px;
  flex-shrink: 0;
}

.feat-stock-act {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.feat-stock-act:active { transform: scale(0.94); }
.feat-stock-act--minus { color: var(--ink-mute); }
.feat-stock-act--plus  { color: var(--green-d); background: var(--green-l); border-color: transparent; }
.feat-stock-act--del   { color: var(--danger); font-size: 15px; }

.feat-stock-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: var(--pill);
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.feat-stock-badge--ok   { background: var(--green-l); color: var(--green-d); }
.feat-stock-badge--low  { background: var(--honey-l); color: #8B6A14; }
.feat-stock-badge--out  { background: var(--coral-l); color: var(--danger); }

.feat-stock-form .feat-stock-row {
  display: flex;
  gap: 10px;
}
.feat-stock-form .feat-stock-row .field { margin: 0; }

.feat-stock-scan-btn { font-size: 15px; }

.feat-stock-scan-hint {
  background: var(--honey-l);
  color: #8B6A14;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* Preview produit (Open Food Facts) */
.feat-stock-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.feat-stock-preview img {
  width: 56px; height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}
.feat-stock-preview-meta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.feat-stock-preview-brand {
  font-size: 13px;
  color: var(--ink-mute);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feat-stock-preview-clear {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.feat-stock-preview-clear:active { color: var(--danger); }

/* ─── Scanner plein écran ───────────────────────────────────── */
.feat-stock-scanner {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.feat-stock-video {
  flex: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.feat-stock-scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.feat-stock-scanner-frame {
  width: min(80vw, 320px);
  aspect-ratio: 4 / 3;
  border: 3px solid var(--green);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}
.feat-stock-scanner-hint {
  margin-top: 18px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--pill);
  text-align: center;
}
.feat-stock-scanner-actions {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(20px + var(--safe-bottom));
  padding: 0 20px;
  display: flex;
  justify-content: center;
}
.feat-stock-scanner-actions .btn {
  min-width: 200px;
  background: var(--surface);
  color: var(--ink);
}

/* Dark mode */
body.dark .feat-stock-act,
html[data-theme="dark"] .feat-stock-act {
  background: var(--surface);
  border-color: var(--border);
}
body.dark .feat-stock-preview,
html[data-theme="dark"] .feat-stock-preview {
  background: var(--cream-2);
}
body.dark .feat-stock-scan-hint,
html[data-theme="dark"] .feat-stock-scan-hint {
  background: rgba(232, 181, 71, 0.15);
  color: var(--honey);
}

/* ─── MIMI 25 — Paywall (page standalone + modal réutilisable) ─────
 * Namespacé `.feat-paywall-*` pour éviter toute collision avec les
 * pages existantes. Mobile-first (≤480 px). Le wrapper modal pose un
 * overlay full-screen avec scroll interne sur le panel.
 *
 * Triggers JS : voir paywall.js (data-feat-paywall-open / -close).
 */

/* Quand le modal est ouvert, on bloque le scroll de l'arrière-plan. */
.feat-paywall-locked { overflow: hidden !important; }

/* App container override pour la page standalone — on garde max-width 480 */
.feat-paywall-app { padding-bottom: calc(40px + var(--safe-bottom)); }
.feat-paywall-inner { padding: 16px 16px 0; }

/* Hero — gradient honey/coral */
.feat-paywall-hero {
  position: relative;
  text-align: center;
  padding: 28px 18px 24px;
  background: linear-gradient(135deg, var(--honey-l) 0%, var(--coral-l) 100%);
  border-radius: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.feat-paywall-hero::before {
  /* halo doré discret en haut-droite */
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(232,181,71,0.35) 0%, rgba(232,181,71,0) 70%);
  pointer-events: none;
}
.feat-paywall-hero-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(232, 117, 91, 0.25));
}
.feat-paywall-hero-eyebrow {
  display: inline-block;
  background: var(--surface);
  color: var(--coral);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 5px 12px;
  border-radius: var(--pill);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.feat-paywall-hero-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.15;
}
.feat-paywall-hero-sub {
  font-size: 14px;
  color: var(--ink-mute);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Section titles internes au paywall (différent du global .section-title
 * parce qu'on veut un peu plus d'air dans le contexte premium). */
.feat-paywall-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-mute);
  margin: 0 4px 12px;
}

/* Pricing block */
.feat-paywall-pricing {
  text-align: center;
  padding: 18px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.feat-paywall-price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.feat-paywall-price-amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
  line-height: 1;
}
.feat-paywall-price-period {
  font-size: 16px;
  color: var(--ink-mute);
  font-weight: 600;
}
.feat-paywall-price-hint {
  font-size: 12px;
  color: var(--ink-dim);
}

/* Compare table */
.feat-paywall-compare { margin-bottom: 22px; }
.feat-paywall-table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.feat-paywall-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.feat-paywall-table thead tr {
  background: var(--cream-2);
}
.feat-paywall-table th,
.feat-paywall-table td {
  padding: 11px 10px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.feat-paywall-table tbody tr:last-child th,
.feat-paywall-table tbody tr:last-child td {
  border-bottom: none;
}
.feat-paywall-th-feat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-mute);
}
.feat-paywall-th-free,
.feat-paywall-th-prem {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: center;
  width: 28%;
}
.feat-paywall-th-prem { color: var(--coral); }
.feat-paywall-td-feat {
  font-weight: 600;
  color: var(--ink);
  font-size: 13.5px;
}
.feat-paywall-td-free,
.feat-paywall-td-prem {
  text-align: center;
  color: var(--ink-mute);
  font-size: 13px;
}
.feat-paywall-td-prem {
  color: var(--ink);
  font-weight: 600;
  background: rgba(232, 117, 91, 0.04);
}

/* Testimonials */
.feat-paywall-testis { margin-bottom: 24px; }
.feat-paywall-testi-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}
.feat-paywall-testi {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.feat-paywall-testi-avatar {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 14px;
  background: var(--lilac-l);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}
.feat-paywall-testi-quote {
  flex: 1;
  min-width: 0;
}
.feat-paywall-testi-quote p {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 4px;
}
.feat-paywall-testi-quote footer {
  font-size: 12px;
  color: var(--ink-mute);
}
.feat-paywall-testi-quote footer strong {
  color: var(--ink);
  font-weight: 700;
}

/* CTA */
.feat-paywall-cta {
  position: sticky;
  bottom: 0;
  /* Sur la page standalone uniquement — le modal a son propre stacking. */
  padding: 16px 0 calc(8px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent 0%, var(--cream) 30%);
  margin-top: 12px;
  z-index: 5;
}
.feat-paywall-cta-btn {
  width: 100%;
  /* Le btn--honey hérite déjà du background; on garde min-height pour tap. */
  min-height: 56px;
  font-size: 16px;
  font-weight: 700;
}
.feat-paywall-cta-btn--soon {
  background: var(--cream-2);
  color: var(--ink-mute);
  border: 1.5px solid var(--border);
}
.feat-paywall-cta-note {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* FAQ accordéon */
.feat-paywall-faq {
  margin: 14px 0 8px;
}
.feat-paywall-faq-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.feat-paywall-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.feat-paywall-faq-item summary::-webkit-details-marker { display: none; }
.feat-paywall-faq-item summary::after {
  content: '+';
  color: var(--ink-mute);
  font-weight: 400;
  font-size: 18px;
  transition: transform 0.2s ease;
}
.feat-paywall-faq-item[open] summary::after {
  transform: rotate(45deg);
}
.feat-paywall-faq-item[open] summary {
  border-bottom: 1px solid var(--border);
}
.feat-paywall-faq-item p {
  padding: 12px 16px 16px;
  font-size: 13.5px;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* ─── Modal (overlay réutilisable depuis n'importe quelle page) ──── */
.feat-paywall-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.feat-paywall-modal[hidden] { display: none; }
.feat-paywall-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 42, 38, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: featPaywallFade 0.22s ease;
}
.feat-paywall-modal-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  background: var(--cream);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  outline: none;
  display: flex;
  flex-direction: column;
  animation: featPaywallSlide 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.feat-paywall-modal-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(18px + var(--safe-bottom));
}
/* En modal, on neutralise le sticky du CTA (le panel scroll naturellement). */
.feat-paywall-modal-scroll .feat-paywall-cta {
  position: static;
  background: transparent;
  padding-top: 12px;
  padding-bottom: 4px;
}
/* Petit grip visuel pour indiquer le drag mobile (esthétique only). */
.feat-paywall-modal-panel::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--ink-dim);
  opacity: 0.35;
  border-radius: 4px;
  margin: 8px auto 0;
  flex-shrink: 0;
}
.feat-paywall-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}
.feat-paywall-close:active { transform: scale(0.92); }
.feat-paywall-close svg { width: 16px; height: 16px; }

/* Animations */
@keyframes featPaywallFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes featPaywallSlide {
  from { transform: translateY(100%); opacity: 0.5; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Reduced motion : pas d'animation. */
@media (prefers-reduced-motion: reduce) {
  .feat-paywall-modal-backdrop,
  .feat-paywall-modal-panel { animation: none; }
}

/* Desktop : centrer le modal au lieu du sheet bottom. */
@media (min-width: 600px) {
  .feat-paywall-modal { align-items: center; padding: 24px; }
  .feat-paywall-modal-panel {
    border-radius: 22px;
    max-height: 88vh;
  }
  .feat-paywall-modal-panel::before { display: none; }
}

/* Print : on n'imprime pas un paywall (sécu + sens). */
@media print {
  .feat-paywall-hero,
  .feat-paywall-cta,
  .feat-paywall-modal { display: none !important; }
}

/* ─── MIMI 12 — Weight tracking (page /weight) ─────────────────── */

/* Banner d'anomalie (variation > 5% sur 7 jours). */
.feat-weight-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--coral-l);
  border-left: 4px solid var(--coral);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.feat-weight-alert__icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.feat-weight-alert__body { flex: 1; min-width: 0; }
.feat-weight-alert__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: 2px;
}
.feat-weight-alert__sub {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
}

/* Stats : 2 tuiles (poids actuel + variation 30j). */
.feat-weight-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.feat-weight-stat {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
  min-width: 0; /* permet le truncate des labels longs */
}
.feat-weight-stat--current {
  background: linear-gradient(135deg, var(--green-l) 0%, var(--lilac-l) 100%);
}
.feat-weight-stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.feat-weight-stat__value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.feat-weight-stat__unit {
  font-size: 13px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-left: 2px;
}
.feat-weight-stat__sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Coloration variation : vert si stable/up, coral si baisse marquée. */
.feat-weight-stat--up .feat-weight-stat__value   { color: var(--green-d); }
.feat-weight-stat--down .feat-weight-stat__value { color: var(--coral); }

/* Container Chart.js. Hauteur fixe pour éviter le layout shift au render. */
.feat-weight-chart {
  position: relative;
  width: 100%;
  height: 220px;
}
.feat-weight-chart canvas {
  width: 100% !important;
  height: 100% !important;
}
.feat-weight-chart__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.5;
  padding: 16px;
}

/* Historique : list-item avec bouton supprimer aligné à droite. */
.feat-weight-history__item {
  gap: 12px;
}
.feat-weight-history__delete {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ink-dim);
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.feat-weight-history__delete:hover,
.feat-weight-history__delete:focus {
  background: var(--coral-l);
  color: var(--coral);
  outline: none;
}
.feat-weight-history__delete:active { transform: scale(0.92); }

/* Modal d'ajout (sheet bottom mobile, centered desktop). */
.feat-weight-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* mobile-first : sheet bottom */
  justify-content: center;
}
.feat-weight-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 42, 38, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.feat-weight-modal__sheet {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px 20px calc(24px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: feat-weight-modal-up 0.22s ease;
}
@keyframes feat-weight-modal-up {
  from { transform: translateY(40px); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1; }
}
.feat-weight-modal__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  text-align: center;
  /* override .card h2 / .section-title styling (uppercase). */
  text-transform: none;
  letter-spacing: -0.2px;
}
.feat-weight-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

/* Tablet/desktop : modal centrée. */
@media (min-width: 540px) {
  .feat-weight-modal { align-items: center; }
  .feat-weight-modal__sheet {
    border-radius: 20px;
    width: 92%;
    padding-bottom: 24px;
  }
}

/* Dark mode overrides. */
body.dark .feat-weight-stat,
html[data-theme="dark"] .feat-weight-stat {
  background: var(--surface);
}
body.dark .feat-weight-stat--current,
html[data-theme="dark"] .feat-weight-stat--current {
  background: linear-gradient(135deg,
    rgba(91, 168, 113, 0.18) 0%,
    rgba(201, 179, 232, 0.18) 100%);
}
body.dark .feat-weight-alert,
html[data-theme="dark"] .feat-weight-alert {
  background: rgba(232, 117, 91, 0.15);
}
body.dark .feat-weight-modal__sheet,
html[data-theme="dark"] .feat-weight-modal__sheet {
  background: var(--surface);
}
body.dark .feat-weight-history__delete:hover,
body.dark .feat-weight-history__delete:focus,
html[data-theme="dark"] .feat-weight-history__delete:hover,
html[data-theme="dark"] .feat-weight-history__delete:focus {
  background: rgba(232, 117, 91, 0.18);
}

/* ─── MIMI 11 : Balades GPS + carte Leaflet ───────────────────────
 * Namespace .feat-walks-* pour ne pas polluer le reste de l'app.
 * Leaflet impose ses propres règles globales (.leaflet-container…) :
 * on les surcharge minimalement pour matcher la palette FP.
 */
.feat-walks-stats {
  margin-bottom: 14px;
}
.feat-walks-map-card {
  padding: 0;
  overflow: hidden;
}
.feat-walks-map {
  width: 100%;
  height: 60vh;
  min-height: 320px;
  max-height: 540px;
  background: var(--cream-2);
  position: relative;
}
/* Réajuste l'attribution OSM pour rester lisible et discret. */
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  color: var(--ink-mute) !important;
}
.leaflet-control-attribution a { color: var(--green-d) !important; }

.feat-walks-live-bar {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 12px 14px;
  background: var(--green-l);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feat-walks-live-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.feat-walks-live-stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--green-d);
}
.feat-walks-live-stat .value {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.feat-walks-actions {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feat-walks-hint {
  margin: 0 16px 16px;
  padding: 12px 14px;
  background: var(--honey-l);
  color: #8B6A14;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.feat-walks-hint--error {
  background: var(--coral-l);
  color: #8B2D1A;
}

.feat-walks-list .feat-walks-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.feat-walks-list .feat-walks-item:last-child { border-bottom: none; }
.feat-walks-list .feat-walks-item:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 8px;
}
.feat-walks-list .feat-walks-item:active { background: var(--cream-2); }

.feat-walks-del {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--cream-2);
  color: var(--ink-mute);
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.feat-walks-del:hover, .feat-walks-del:focus-visible {
  background: var(--coral-l);
  color: var(--danger);
  outline: none;
}

/* Dark mode : les tuiles OSM standard ne sont pas adaptées au sombre, donc on
 * garde un fond clair pour que la carte reste lisible. On retouche juste la
 * live-bar et l'attribution pour qu'elles soient cohérentes. */
body.dark .feat-walks-live-bar,
html[data-theme="dark"] .feat-walks-live-bar {
  background: var(--green-d);
}
body.dark .feat-walks-live-stat .label,
html[data-theme="dark"] .feat-walks-live-stat .label { color: var(--green-l); }
body.dark .feat-walks-live-stat .value,
html[data-theme="dark"] .feat-walks-live-stat .value { color: var(--cream); }
body.dark .leaflet-control-attribution,
html[data-theme="dark"] .leaflet-control-attribution {
  background: rgba(44, 42, 38, 0.86) !important;
  color: var(--cream) !important;
}
body.dark .leaflet-control-attribution a,
html[data-theme="dark"] .leaflet-control-attribution a { color: var(--green-l) !important; }

/* Print : on imprime le tracé mais pas les boutons live. */
@media print {
  .feat-walks-actions,
  .feat-walks-live-bar,
  .feat-walks-del { display: none !important; }
}

/* ─── MIMI 14 : Litière — namespace .feat-litter-* (couleur coral) ─── */

.feat-litter { /* root container marker, no extra style needed */ }

/* Boutons rapides "+ Pipi" / "+ Caca" — 2 tap zones imposantes,
   coral comme couleur principale (cf. brief MIMI 14). */
.feat-litter-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.feat-litter-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 12px;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.1px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, background 0.15s ease;
  /* Hit-target >= 44px (a11y). */
  min-height: 88px;
}
.feat-litter-quick-btn:active { transform: scale(0.97); }

/* Variante "Pipi" = liquid — accent water (bleu doux). */
.feat-litter-quick-btn--liquid {
  background: var(--water-l);
  color: #1F567A;
}
.feat-litter-quick-btn--liquid:active { background: #D2E5F0; }

/* Variante "Caca" = solid — accent coral (couleur principale MIMI 14). */
.feat-litter-quick-btn--solid {
  background: var(--coral-l);
  color: #8A3920;
}
.feat-litter-quick-btn--solid:active { background: #F7CFC4; }

.feat-litter-quick-emoji {
  font-size: 32px;
  line-height: 1;
}
.feat-litter-quick-label {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

/* Form qualité — chips alignés sur la grille existante (.chip-grid). */
.feat-litter-quality {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.feat-litter-quality-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.feat-litter-quality-chip .feat-litter-quality-emoji {
  font-size: 22px;
  line-height: 1;
}
.feat-litter-quality-chip[aria-pressed="true"] {
  border-color: var(--coral);
  background: var(--coral-l);
  color: #8A3920;
}

/* Stats card — petit grid 2x1 (liquid + solid moyennes). */
.feat-litter-stats {
  /* Hérite de .card--soft, on customise juste le grid. */
}
.feat-litter-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.feat-litter-stat {
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  box-shadow: var(--shadow-sm);
}
.feat-litter-stat-emoji {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 6px;
}
.feat-litter-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--coral);
  line-height: 1.1;
  margin-bottom: 2px;
}
.feat-litter-stat-label {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.feat-litter-stats-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
}

/* Liste des passages du jour — élément tap-to-delete. */
.feat-litter-item {
  cursor: pointer;
  transition: background 0.12s ease;
}
.feat-litter-item:active {
  background: var(--cream-2);
}
.feat-litter-item .lead {
  /* Override : pas de fond gris quand on est dans cette liste, l'emoji
     compose déjà visuellement (ex: 💧💦). */
  background: transparent;
  font-size: 24px;
}
.feat-litter-item--anomaly .lead {
  background: var(--coral-l);
}
.feat-litter-item-del {
  color: var(--ink-dim);
  font-size: 18px;
  font-weight: 600;
  padding: 0 4px;
}
.feat-litter-item:hover .feat-litter-item-del,
.feat-litter-item:focus-visible .feat-litter-item-del {
  color: var(--danger);
}

.feat-litter-foot {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-dim);
  text-align: center;
  line-height: 1.5;
}

/* Print : on imprime la liste du jour mais pas les boutons d'action. */
@media print {
  .feat-litter-quick,
  .feat-litter-quality,
  #submit-quality,
  .feat-litter-item-del { display: none !important; }
}

/* ───────────────────────────────────────────────────────────────
 * MIMI 09 — Compare animaux (Premium)
 * Namespace: `.feat-compare-*`
 * Mobile-first : on garde le tableau en 3 colonnes (val A | label | val B)
 * même sur petit écran ; les valeurs raccourcissent ("4.2 kg") plutôt que
 * de wrapper. Pas de scroll horizontal — c'est lisible jusqu'à 320px.
 * ─────────────────────────────────────────────────────────────── */

.feat-compare-loading {
  text-align: center;
  padding: 48px 12px;
  color: var(--ink-dim);
}

/* ── Empty (< 2 animaux) ── */
.feat-compare-empty {
  text-align: center;
  padding: 48px 16px;
}
.feat-compare-empty__emoji {
  font-size: 56px;
  line-height: 1;
  letter-spacing: 4px;
  margin-bottom: 12px;
}
.feat-compare-empty__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}
.feat-compare-empty__sub {
  color: var(--ink-mute);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Premium-locked screen ── */
.feat-compare-locked {
  text-align: center;
  padding: 48px 20px 40px;
  max-width: 360px;
  margin: 0 auto;
}
.feat-compare-locked__icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--honey) 0%, #D69A2A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(232, 181, 71, 0.45);
}
.feat-compare-locked__sparkle {
  font-size: 44px;
  color: var(--cream);
  line-height: 1;
  /* L'étoile ✦ tombe sur ~36px de hauteur effective ; on remonte
     légèrement pour centrer optiquement dans le cercle. */
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}
.feat-compare-locked__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 10px;
  color: var(--ink);
}
.feat-compare-locked__sub {
  color: var(--ink-mute);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 24px;
}
.feat-compare-locked__cta {
  background: var(--honey);
  color: var(--ink);
  display: inline-flex;
  /* "Découvrir Premium" doit attirer l'œil sans hurler — honey plein +
     texte ink (cohérent avec btn--honey du design system). */
}
.feat-compare-locked__hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-dim);
}

/* ── Pickers (2 dropdowns côte à côte) ── */
.feat-compare-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.feat-compare-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px 8px;
  cursor: pointer;
}
.feat-compare-picker__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-dim);
}
.feat-compare-picker__select {
  width: 100%;
  min-height: 36px;
  border: none;
  background: transparent;
  /* >= 16px pour éviter le zoom auto iOS au focus. */
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  /* Caret custom (svg inline) pour cohérence avec le reste du form. */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6862' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 16px;
  padding-right: 20px;
}
.feat-compare-picker__select:focus { outline: none; }

/* ── Header avatars (2 cards) ── */
.feat-compare-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.feat-compare-header__card {
  background: linear-gradient(135deg, var(--green-l) 0%, var(--lilac-l) 100%);
  border-radius: 16px;
  padding: 16px 12px 14px;
  text-align: center;
}
.feat-compare-header__avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 8px;
  display: block;
  object-fit: cover;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.feat-compare-header__avatar--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
}
.feat-compare-header__name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--ink);
  /* Tronque proprement les noms longs (Mr. Bigglesworth Esq.) plutôt que
     de wrapper et casser l'alignement vertical entre les 2 cards. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feat-compare-header__sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 2px;
}

/* ── Tableau comparatif ── */
.feat-compare-table {
  padding: 8px 4px;
  margin-bottom: 14px;
}
.feat-compare-table__loading {
  padding: 24px 12px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 14px;
}
.feat-compare-table__inner {
  display: flex;
  flex-direction: column;
}
.feat-compare-row {
  display: grid;
  /* Colonne centrale légèrement plus large pour le label "Vaccins à jour". */
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}
.feat-compare-row:last-child { border-bottom: none; }
.feat-compare-row__val {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
/* "Best" cell : vert subtil, pas un fond plein (lisible sur les 2 valeurs
   sans dominer la cellule "label"). */
.feat-compare-row__val--best {
  color: var(--green-d);
}
.feat-compare-row__val--best::after {
  content: "✓";
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--green-d);
  /* Aligne le check avec la baseline du chiffre. */
  transform: translateY(-1px);
}
.feat-compare-row__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.2;
}
.feat-compare-row__icon {
  font-size: 18px;
  line-height: 1;
}

/* ── Narratives cohorte ── */
.feat-compare-narratives {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.feat-compare-narrative {
  padding: 14px 16px;
}
.feat-compare-narrative__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.feat-compare-narrative__cohort {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-left: 4px;
}
.feat-compare-narrative__body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-mute);
}

/* Très petit écran (320px) : on resserre encore les paddings du tableau
   pour garder les 3 colonnes lisibles sans débordement horizontal. */
@media (max-width: 360px) {
  .feat-compare-row {
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 4px;
    padding: 10px 4px;
  }
  .feat-compare-row__val { font-size: 14px; }
  .feat-compare-row__icon { font-size: 16px; }
}

/* Dark mode parité avec le reste de l'app. */
body.dark .feat-compare-header__card,
html[data-theme="dark"] .feat-compare-header__card {
  /* Le gradient cream→lilac perd toute son intelligibilité en dark.
     On bascule sur des teintes plus sourdes. */
  background: linear-gradient(135deg,
              rgba(91, 168, 113, 0.22) 0%,
              rgba(201, 179, 232, 0.18) 100%);
}
body.dark .feat-compare-header__avatar,
html[data-theme="dark"] .feat-compare-header__avatar {
  background: var(--cream-2);
}


/* ─── MIMI 20 — Vétérinaires / Contacts ────────────────────────── */
.feat-vets-list { list-style: none; padding: 0; margin: 0; }

.feat-vets-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
}
.feat-vets-card--urgence {
  border-color: var(--coral);
  background: linear-gradient(180deg, var(--coral-l) 0%, var(--surface) 30%);
}

.feat-vets-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.feat-vets-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.feat-vets-name {
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}
.feat-vets-sub {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.4;
}

.feat-vets-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--cream-2);
  color: var(--ink-mute);
  line-height: 1.3;
}
.feat-vets-badge--urgence {
  background: var(--coral);
  color: #fff;
}

.feat-vets-meta {
  font-size: 14px;
  color: var(--ink);
  padding: 2px 0;
  line-height: 1.5;
  word-break: break-word;
}
.feat-vets-notes {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-mute);
  background: var(--cream-2);
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  white-space: pre-wrap;
  word-break: break-word;
}

.feat-vets-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.feat-vets-action {
  flex: 1;
  min-width: 120px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.feat-vets-action--call {
  background: var(--green);
  color: #fff;
}
.feat-vets-action--maps {
  /* hérite .btn--secondary */
}

.feat-vets-row-actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.feat-vets-link {
  background: none;
  border: none;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--ink-mute);
  cursor: pointer;
  font-weight: 500;
}
.feat-vets-link:active { color: var(--ink); }
.feat-vets-delete { color: var(--danger); }

.feat-vets-add-btn { /* hérite .btn .btn--block */ }

.feat-vets-form { /* hérite .card */ }

.feat-vets-urgence-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.feat-vets-urgence-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--coral);
  cursor: pointer;
}
.feat-vets-urgence-label {
  font-size: 14px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.4;
}

/* ─── MIMI 19 : Notes santé (.feat-notes-*) ─────────────────────── */
/* Couleur thématique : --water (bleu carnet). Aucune dépendance JS, juste
   utilitaire visuel pour le form + liste + filtres. */

.feat-notes-form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.feat-notes-controls {
  /* Sticky pour que la recherche reste accessible en scrollant la liste. */
  position: sticky;
  top: calc(var(--topbar-h) + var(--safe-top) + 8px);
  z-index: 5;
}

.feat-notes-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feat-notes-tag {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--pill);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.feat-notes-tag[aria-pressed="true"] {
  background: var(--water-l);
  border-color: var(--water);
  color: var(--ink);
}

.feat-notes-list .feat-notes-item {
  align-items: flex-start;
}

.feat-notes-tag-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--cream-2);
  color: var(--ink-mute);
  border-radius: var(--pill);
  margin-left: 2px;
}

.feat-notes-preview {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.45;
  /* Garde le wrap dans une ligne soft, tronqué par le CSS si plus de 3 lignes. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feat-notes-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.feat-notes-icon-btn {
  background: var(--cream-2);
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease;
}
.feat-notes-icon-btn:hover { background: var(--border); }
.feat-notes-icon-btn--danger:hover { background: var(--coral-l); }

/* ============================================================== */
/* ═══ MIMI 30 — Support form + history + settings polish ════════
 * Namespaces : .feat-support-*  (form + history)
 *              .feat-settings-* (sections enrichies)
 * Tout réutilise les variables --cream/--ink/--green etc., donc le
 * dark mode est gratuit via les overrides body.dark plus bas.
 * ============================================================== */

/* ─── Support page (form + intro) ────────────────────────────── */
.feat-support-page {
  padding-bottom: 24px;
}
.feat-support-intro {
  margin-bottom: 14px;
}
.feat-support-form {
  margin-bottom: 0;
}
.feat-support-form select {
  background: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%236B6862' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 7px;
  padding-right: 38px;
}
.feat-support-submit {
  margin-top: 4px;
}
.feat-support-history-link {
  /* On reprend l'apparence d'une .settings-row mais en standalone (pas group). */
  border-radius: var(--radius);
  background: var(--surface);
  border-bottom: none;
}

/* ─── Support history (liste des messages user) ──────────────── */
.feat-support-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feat-support-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease;
}
.feat-support-card[data-unread="1"] {
  border-color: var(--honey);
}
.feat-support-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.feat-support-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-mute);
  flex-wrap: wrap;
}
.feat-support-card-cat {
  font-weight: 600;
}
.feat-support-card-date {
  font-variant-numeric: tabular-nums;
}
.feat-support-badge-unread {
  display: inline-flex;
  align-items: center;
  background: var(--honey);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: var(--pill);
  white-space: nowrap;
}
.feat-support-card-subject {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.1px;
  margin-bottom: 6px;
  text-transform: none;
}
.feat-support-card-body {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.feat-support-card-body[hidden] {
  display: none;
}
.feat-support-card-message {
  font-size: 14px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  margin-bottom: 12px;
}
.feat-support-reply {
  background: var(--green-l);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.feat-support-reply-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-d);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.feat-support-reply-date {
  font-weight: 500;
  color: var(--ink-mute);
  text-transform: none;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.feat-support-reply p {
  font-size: 14px;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.55;
}
.feat-support-reply-pending {
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
  padding: 8px 0 4px;
}
.feat-support-card-status {
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: 4px;
}
.feat-support-card-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  padding: 8px 4px 2px;
  background: transparent;
  border: none;
  color: var(--green-d);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.feat-support-card-toggle:active {
  opacity: 0.7;
}
.feat-support-card-toggle-chev {
  font-size: 14px;
  margin-left: 6px;
  transition: transform 0.15s ease;
}

/* ─── Settings polish (sections enrichies MIMI 30) ───────────── */
.feat-settings-account .settings-row .label > div:first-child,
.feat-settings-help    .settings-row .label > div:first-child,
.feat-settings-data    .settings-row .label > div:first-child {
  /* Titre principal de la row "rich" (avec sous-titre dessous). */
  font-weight: 500;
  line-height: 1.3;
}

/* ─── Dark mode overrides ────────────────────────────────────── */
body.dark .feat-support-card,
html[data-theme="dark"] .feat-support-card {
  background: var(--surface);
}
body.dark .feat-support-card[data-unread="1"],
html[data-theme="dark"] .feat-support-card[data-unread="1"] {
  border-color: var(--honey);
}
body.dark .feat-support-reply,
html[data-theme="dark"] .feat-support-reply {
  background: var(--green-l);
}
body.dark .feat-support-badge-unread,
html[data-theme="dark"] .feat-support-badge-unread {
  background: var(--honey);
  color: var(--ink);
}
body.dark .feat-support-form select,
html[data-theme="dark"] .feat-support-form select {
  background-color: var(--surface);
}

/* ─── MIMI 10 : Hydratation — namespace .feat-water-* (couleur water) ─── */
/* Couleur principale : --water #7BB7D9 (blue) avec fond clair --water-l. */

.feat-water { /* root marker, no extra style needed */ }

/* Header objectif + progress bar */
.feat-water-goal {
  background: linear-gradient(180deg, var(--water-l) 0%, var(--surface) 100%);
  /* Hérite du padding/h2 standard de .card. */
}
.feat-water-goal-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.feat-water-goal-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.feat-water-goal-amount {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.feat-water-goal-sep {
  margin: 0 4px;
  color: var(--ink-dim);
  font-weight: 600;
}
.feat-water-goal-unit {
  font-size: 14px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-left: 4px;
}
.feat-water-goal-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--water);
  background: var(--surface);
  padding: 4px 12px;
  border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  letter-spacing: -0.4px;
  flex-shrink: 0;
}

/* Progress bar */
.feat-water-progress {
  height: 12px;
  background: var(--cream-2);
  border-radius: var(--pill);
  overflow: hidden;
  position: relative;
}
.feat-water-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--water);
  border-radius: var(--pill);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.25s ease;
}
/* < 50 % : ton plus pâle pour suggérer "pas assez". */
.feat-water-progress-fill--low  { background: #B0D4E5; }
/* 50-99 % : couleur de marque. */
.feat-water-progress-fill--ok   { background: var(--water); }
/* >= 100 % : ton plus saturé pour "objectif atteint". */
.feat-water-progress-fill--full { background: #4C8FB3; }

.feat-water-goal-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.45;
}

/* Boutons rapides +50/+100/+250 — 3 colonnes, tap-target >= 48px. */
.feat-water-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.feat-water-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--water-l);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 88px;
  transition: transform 0.08s ease, background-color 0.15s ease,
              border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.feat-water-quick-btn:active {
  transform: scale(0.97);
  background: #D2E5F0;
  border-color: var(--water);
}
.feat-water-quick-emoji { font-size: 28px; line-height: 1; }
.feat-water-quick-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.2px;
}

/* Bouton "Logger l'eau" du form custom — variante water (override .btn). */
.feat-water-btn { background: var(--water); color: #fff; }
.feat-water-btn:active { background: #4C8FB3; }

/* Mini-graph 7 jours (SVG sparkline + labels jours). */
.feat-water-trend-wrap { margin: 4px 0 10px; }
.feat-water-trend-svg {
  width: 100%;
  height: 80px;
  display: block;
}
.feat-water-trend-bar {
  fill: var(--water);
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.feat-water-trend-bar:hover { opacity: 0.9; }
.feat-water-trend-bar--today { fill: var(--water); opacity: 1; }
.feat-water-trend-goalline {
  stroke: var(--ink-dim);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.55;
}

.feat-water-trend-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-top: 4px;
  padding: 0 4px;
}
.feat-water-trend-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-dim);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.feat-water-trend-label--today { color: var(--water); }
.feat-water-trend-hint {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 6px;
}

/* Liste du jour : entrées tap-pour-supprimer + bouton "Annuler dernière". */
.feat-water-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.feat-water-undo {
  background: var(--cream-2);
  border: none;
  border-radius: var(--pill);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.feat-water-undo:active {
  background: var(--coral-l);
  color: var(--coral);
}

.feat-water-row {
  /* Hérite de .list-item, on ajoute juste le hover/active mobile. */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}
.feat-water-row:active { background: var(--coral-l); }
.feat-water-row-lead { background: var(--water-l); color: var(--water); }
.feat-water-row-trail {
  font-size: 16px;
  color: var(--ink-dim);
  padding-left: 4px;
}
.feat-water-row:active .feat-water-row-trail { color: var(--coral); }

.feat-water-foot {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-dim);
  text-align: center;
  line-height: 1.5;
}

/* Dark mode parité (suit le pattern litière/vétos). */
body.dark .feat-water-goal,
html[data-theme="dark"] .feat-water-goal {
  background: linear-gradient(180deg,
              rgba(123, 183, 217, 0.18) 0%,
              rgba(123, 183, 217, 0.04) 100%);
}
body.dark .feat-water-quick-btn,
html[data-theme="dark"] .feat-water-quick-btn {
  background: rgba(123, 183, 217, 0.15);
}
body.dark .feat-water-quick-btn:active,
html[data-theme="dark"] .feat-water-quick-btn:active {
  background: rgba(123, 183, 217, 0.28);
}

/* ─── MIMI 24 : Partage vétérinaire (Premium) ─────────────────────
 * Namespace .feat-vetshare-* — couleur principale --water (bleu doux,
 * cohérent avec l'idée "lien externe sécurisé / médical").
 */

/* Paywall card (user free) */
.feat-vetshare-paywall {
  text-align: center;
  padding: 28px 20px 22px;
  background: linear-gradient(180deg, var(--water-l) 0%, var(--surface) 80%);
}
.feat-vetshare-paywall-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 12px rgba(123, 183, 217, 0.35));
}
.feat-vetshare-paywall-title {
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -0.3px !important;
  text-transform: none !important;
  color: var(--ink) !important;
  margin-bottom: 8px !important;
}
.feat-vetshare-paywall-body {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.55;
  margin-bottom: 14px;
  text-align: left;
}
.feat-vetshare-paywall-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.feat-vetshare-paywall-features li {
  font-size: 13.5px;
  color: var(--ink);
  padding: 10px 14px 10px 36px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.feat-vetshare-paywall-features li:last-child { border-bottom: none; }
.feat-vetshare-paywall-features li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 10px;
  color: var(--green-d);
  font-weight: 800;
  font-size: 14px;
}
.feat-vetshare-paywall-cta { margin-top: 6px; }
.feat-vetshare-paywall-trial {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-mute);
}

/* Duration chips */
.feat-vetshare-duration {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.feat-vetshare-duration-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.feat-vetshare-duration-chip:active { transform: scale(0.97); }
.feat-vetshare-duration-chip[aria-pressed="true"] {
  border-color: var(--water);
  background: var(--water-l);
  color: var(--ink);
}
.feat-vetshare-duration-emoji {
  font-size: 22px;
  line-height: 1;
}
.feat-vetshare-duration-value {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.feat-vetshare-duration-hint {
  font-size: 10px;
  color: var(--ink-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Toggle "inclure photos" */
.feat-vetshare-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  user-select: none;
}
.feat-vetshare-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.feat-vetshare-toggle-slider {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.feat-vetshare-toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(44, 42, 38, 0.18);
  transition: transform 0.2s ease;
}
.feat-vetshare-toggle input:checked + .feat-vetshare-toggle-slider {
  background: var(--green);
}
.feat-vetshare-toggle input:checked + .feat-vetshare-toggle-slider::after {
  transform: translateX(18px);
}
.feat-vetshare-toggle input:focus-visible + .feat-vetshare-toggle-slider {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.feat-vetshare-toggle-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feat-vetshare-toggle-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.feat-vetshare-toggle-sub {
  font-size: 12px;
  color: var(--ink-mute);
}

/* Advanced (vet name / email) */
.feat-vetshare-advanced {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.feat-vetshare-advanced > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  padding: 6px 0;
  list-style: none;
}
.feat-vetshare-advanced > summary::-webkit-details-marker { display: none; }
.feat-vetshare-advanced > summary::before {
  content: "+ ";
  font-weight: 800;
  color: var(--ink-dim);
}
.feat-vetshare-advanced[open] > summary::before { content: "− "; }

/* Résultat (carte affichée après création) */
.feat-vetshare-result {
  border: 1.5px solid var(--water);
  background: var(--water-l);
}
.feat-vetshare-url {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 12px;
}
.feat-vetshare-url input {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: 'Courier New', Consolas, monospace;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  word-break: break-all;
}
.feat-vetshare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feat-vetshare-actions .btn,
.feat-vetshare-actions .btn-sm {
  flex: 1 1 auto;
  min-width: 100px;
}

/* Lignes shares actifs */
.feat-vetshare-row {
  position: relative;
}
.feat-vetshare-revoke {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--cream-2);
  color: var(--ink-mute);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.feat-vetshare-revoke:hover,
.feat-vetshare-revoke:focus-visible {
  background: var(--coral-l);
  color: var(--danger);
  outline: none;
}

/* Note de bas de page */
.feat-vetshare-foot {
  margin: 18px 4px 4px;
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.55;
}

/* Dark mode — préserver la lisibilité de la card paywall et de l'url. */
body.dark .feat-vetshare-paywall,
html[data-theme="dark"] .feat-vetshare-paywall {
  background: linear-gradient(180deg, rgba(123, 183, 217, 0.18) 0%, var(--surface) 80%);
}
body.dark .feat-vetshare-result,
html[data-theme="dark"] .feat-vetshare-result {
  background: rgba(123, 183, 217, 0.16);
}
body.dark .feat-vetshare-url,
html[data-theme="dark"] .feat-vetshare-url {
  background: rgba(44, 42, 38, 0.4);
}
body.dark .feat-vetshare-duration-chip[aria-pressed="true"],
html[data-theme="dark"] .feat-vetshare-duration-chip[aria-pressed="true"] {
  background: rgba(123, 183, 217, 0.22);
}

/* Print : pas d'intérêt à imprimer un partage véto, mais on cache au moins
 * les boutons d'action pour avoir une trace propre du lien. */
@media print {
  .feat-vetshare-actions,
  .feat-vetshare-revoke { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════
 * MIMI 08 — News carousel + Daily summaries history
 * Namespace: .feat-news-*  /  .feat-daily-*
 * Ne pas réutiliser ces classes en dehors de ces deux features.
 * ═══════════════════════════════════════════════════════════════════ */

/* ─── News carousel (today.php) ─────────────────────────────────── */
.feat-news-section {
  margin: 4px 0 18px;
}
.feat-news-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-mute);
  margin: 0 4px 10px;
}
.feat-news-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 10px;
  margin: 0 -4px;
  scrollbar-width: none;
}
.feat-news-carousel::-webkit-scrollbar { display: none; }

.feat-news-card {
  scroll-snap-align: start;
  border: none;
  padding: 0;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  font: inherit;
}
.feat-news-card:active { transform: scale(0.98); }
.feat-news-card:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.feat-news-card__img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--cream-2);
  overflow: hidden;
}
.feat-news-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feat-news-card__img--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: var(--ink-dim);
}

/* Bandeau couleur en haut, suit banner_color de l'API. */
.feat-news-card--green .feat-news-card__img  { box-shadow: inset 0 4px 0 0 var(--green); }
.feat-news-card--honey .feat-news-card__img  { box-shadow: inset 0 4px 0 0 var(--honey); }
.feat-news-card--coral .feat-news-card__img  { box-shadow: inset 0 4px 0 0 var(--coral); }
.feat-news-card--blue  .feat-news-card__img,
.feat-news-card--water .feat-news-card__img  { box-shadow: inset 0 4px 0 0 var(--water); }
.feat-news-card--purple .feat-news-card__img,
.feat-news-card--lilac  .feat-news-card__img { box-shadow: inset 0 4px 0 0 var(--lilac); }

.feat-news-card__meta {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.feat-news-card__date {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--ink-dim);
}
.feat-news-card__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  /* clamp à 2 lignes pour éviter les cards trop hautes. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── News dialog (fullscreen détail) ───────────────────────────── */
.feat-news-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(44, 42, 38, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}
.feat-news-dialog[hidden] { display: none; }

.feat-news-dialog__inner {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--cream);
  min-height: 100%;
  padding-bottom: calc(40px + var(--safe-bottom, 0px));
}

.feat-news-dialog__close {
  position: sticky;
  top: 12px;
  margin-left: auto;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 1;
}
.feat-news-dialog__close:active { transform: scale(0.95); }

.feat-news-dialog__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--cream-2);
  overflow: hidden;
  margin-top: -52px; /* tucks under the close button */
}
.feat-news-dialog__image[hidden] { display: none; }
.feat-news-dialog__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feat-news-dialog__content {
  padding: 22px 22px 32px;
}
.feat-news-dialog__date {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--ink-mute);
  margin: 0 0 8px;
}
.feat-news-dialog__h {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.25;
}
.feat-news-dialog__body p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 14px;
}
.feat-news-dialog__body p:last-child { margin-bottom: 0; }

/* ─── Daily summaries history (daily_summaries.php) ─────────────── */
.feat-daily-loading {
  text-align: center;
  padding: 48px 12px;
  color: var(--ink-dim);
  font-size: 14px;
}
.feat-daily-error,
.feat-daily-empty {
  text-align: center;
  padding: 56px 16px;
}
.feat-daily-error[hidden],
.feat-daily-empty[hidden],
.feat-daily-list[hidden] { display: none; }

.feat-daily-error__emoji,
.feat-daily-empty__emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
}
.feat-daily-error__title,
.feat-daily-empty__title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}
.feat-daily-error__sub,
.feat-daily-empty__sub {
  font-size: 14px;
  color: var(--ink-mute);
  max-width: 320px;
  margin: 0 auto 18px;
  line-height: 1.5;
}

.feat-daily-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 24px;
}

.feat-daily-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
}
.feat-daily-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.feat-daily-card__date {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-transform: capitalize;
  letter-spacing: -0.1px;
}
.feat-daily-card__text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  margin: 0 0 10px;
  /* clamp à 3 lignes par défaut */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feat-daily-card__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-l);
  color: var(--green-d);
  border: none;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
}
.feat-daily-card__toggle:active { transform: scale(0.97); }
.feat-daily-card__toggle[aria-expanded="true"] {
  background: var(--cream-2);
  color: var(--ink);
}
.feat-daily-card__panel[hidden] { display: none; }
.feat-daily-card__panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.feat-daily-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.feat-daily-detail__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
}
.feat-daily-detail__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--ink-mute);
}
.feat-daily-detail__val {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

/* Score badge — couleur selon palier care_score. */
.feat-daily-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.feat-daily-score__num {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.feat-daily-score__lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.feat-daily-score--green  { background: var(--green-l);  color: var(--green-d); }
.feat-daily-score--honey  { background: var(--honey-l);  color: #8B6A14; }
.feat-daily-score--water  { background: var(--water-l);  color: #2A6985; }
.feat-daily-score--coral  { background: var(--coral-l);  color: #8E3221; }

/* ═══════════════════════════════════════════════════════════════════
 *  MIMI 28 — Galerie photos
 *  Namespace : .feat-gallery-*
 *  Grid mobile 3 cols (carrés), viewer fullscreen, FAB upload, sheets.
 * ═══════════════════════════════════════════════════════════════════ */

/* Loading + empty state */
.feat-gallery-loading {
  text-align: center;
  padding: 32px 12px;
  color: var(--ink-dim);
  font-size: 14px;
}
.feat-gallery-empty {
  text-align: center;
  padding: 48px 12px 24px;
}
.feat-gallery-empty__icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 14px;
  opacity: 0.85;
}
.feat-gallery-empty__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.feat-gallery-empty__sub {
  font-size: 14px;
  color: var(--ink-mute);
}

/* Memory banner (Premium) */
.feat-gallery-memory {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--lilac-l) 0%, var(--honey-l) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.feat-gallery-memory__icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.feat-gallery-memory__body { flex: 1; min-width: 0; }
.feat-gallery-memory__title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6B4D9C;
}
.feat-gallery-memory__sub {
  font-size: 14px;
  color: var(--ink);
  margin-top: 2px;
}

/* Quota banner (free) */
.feat-gallery-quota {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-mute);
}
.feat-gallery-quota #feat-gallery-quota-text { flex: 1; }
.feat-gallery-quota__cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-d);
  background: var(--green-l);
  padding: 6px 12px;
  border-radius: var(--pill);
  text-decoration: none;
  white-space: nowrap;
}
.feat-gallery-quota__cta:hover,
.feat-gallery-quota__cta:focus { text-decoration: none; }

/* Grid 3 colonnes carré */
.feat-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 80px; /* place pour le FAB */
}
.feat-gallery-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  background: var(--cream-2);
  border-radius: var(--radius-xs);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.feat-gallery-tile:active { transform: scale(0.97); }
.feat-gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* FAB upload (fixed bottom-right) */
.feat-gallery-fab {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: var(--cream);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease;
}
.feat-gallery-fab:active { transform: scale(0.92); }
.feat-gallery-fab__plus {
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  margin-top: -3px;
}

/* Center FAB on wider phones (max-width app = 480px) */
@media (min-width: 600px) {
  .feat-gallery-fab {
    right: max(calc(16px + env(safe-area-inset-right, 0px)),
               calc(50% - 240px + 16px));
  }
}

/* ─── Viewer fullscreen ──────────────────────────────────────────── */
.feat-gallery-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  flex-direction: column;
}
.feat-gallery-viewer[hidden] { display: none; }
.feat-gallery-viewer__close,
.feat-gallery-viewer__delete {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feat-gallery-viewer__close { left: 16px; }
.feat-gallery-viewer__delete { right: 16px; }
.feat-gallery-viewer__close:active,
.feat-gallery-viewer__delete:active { background: rgba(255, 255, 255, 0.32); }
.feat-gallery-viewer__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
}
.feat-gallery-viewer__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.feat-gallery-viewer__caption {
  padding: 12px 18px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
}
.feat-gallery-viewer__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px calc(14px + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}
.feat-gallery-viewer__prev,
.feat-gallery-viewer__next {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}
.feat-gallery-viewer__prev:disabled,
.feat-gallery-viewer__next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.feat-gallery-viewer__prev:active:not(:disabled),
.feat-gallery-viewer__next:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.28);
}
.feat-gallery-viewer__counter {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}

/* ─── Upload modal (bottom sheet) ────────────────────────────────── */
.feat-gallery-upload,
.feat-gallery-paywall {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.feat-gallery-upload[hidden],
.feat-gallery-paywall[hidden] { display: none; }
.feat-gallery-upload__sheet,
.feat-gallery-paywall__sheet {
  width: 100%;
  max-width: 480px;
  background: var(--cream);
  border-radius: 20px 20px 0 0;
  padding: 16px 18px calc(20px + var(--safe-bottom));
  max-height: 92vh;
  overflow-y: auto;
}
.feat-gallery-upload__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.feat-gallery-upload__cancel {
  background: none;
  border: none;
  color: var(--ink-mute);
  font-size: 15px;
  font-weight: 600;
  padding: 4px 0;
}
.feat-gallery-upload__title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}
.feat-gallery-upload__spacer { width: 60px; }
.feat-gallery-upload__preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--cream-2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feat-gallery-upload__preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.feat-gallery-upload__quality {
  margin-bottom: 16px;
}
.feat-gallery-upload__qlabel {
  display: block;
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.feat-gallery-upload__qlabel strong { color: var(--ink); }
#feat-gallery-upload-quality {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--cream-2);
  border-radius: 3px;
  outline: none;
}
#feat-gallery-upload-quality::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
#feat-gallery-upload-quality::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
}
.feat-gallery-upload__qhint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-dim);
  text-align: center;
}

/* ─── Paywall sheet ──────────────────────────────────────────────── */
.feat-gallery-paywall__sheet {
  text-align: center;
}
.feat-gallery-paywall__icon {
  font-size: 56px;
  line-height: 1;
  margin: 8px 0 12px;
  color: var(--honey);
}
.feat-gallery-paywall__title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}
.feat-gallery-paywall__body {
  font-size: 14px;
  color: var(--ink-mute);
  margin-bottom: 22px;
  line-height: 1.55;
}
.feat-gallery-paywall__close { margin-top: 8px; }

/* ─── Dark mode (parité avec les autres feat-*) ──────────────────── */
body.dark .feat-gallery-tile,
html[data-theme="dark"] .feat-gallery-tile {
  background: var(--cream-2);
}
body.dark .feat-gallery-quota,
html[data-theme="dark"] .feat-gallery-quota {
  background: var(--cream-2);
  color: var(--ink-mute);
}
body.dark .feat-gallery-upload__sheet,
html[data-theme="dark"] .feat-gallery-upload__sheet,
body.dark .feat-gallery-paywall__sheet,
html[data-theme="dark"] .feat-gallery-paywall__sheet {
  background: var(--cream);
}
body.dark .feat-gallery-upload__preview,
html[data-theme="dark"] .feat-gallery-upload__preview {
  background: var(--cream-2);
}

/* ─── MIMI 21 : Documents santé (carnet santé numérique) ──────────
 * Namespace .feat-documents-* — palette honey (ordonnance/papier),
 * mobile-first avec viewer modal plein écran pour les PDF/images.
 */

.feat-documents-page {
  padding-bottom: 24px;
}

.feat-documents-upload {
  margin-bottom: 16px;
}
.feat-documents-details .field {
  margin-bottom: 10px;
}
.feat-documents-details .field:last-of-type {
  margin-bottom: 4px;
}

/* Liste des documents — chaque item est un row tap-pour-prévisualiser
 * + 2 boutons trailing (télécharger / supprimer). On garde la structure
 * .list mais on prend le contrôle du layout pour aligner le bouton main
 * sur toute la zone tap. */
.feat-documents-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.feat-documents-item {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.feat-documents-item:last-child { border-bottom: none; }

.feat-documents-item__main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 4px 14px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.feat-documents-item__main:active {
  background: var(--cream-2);
  border-radius: var(--radius-xs);
}
.feat-documents-item__main:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.feat-documents-item__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--honey-l);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.feat-documents-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.feat-documents-item__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.1px;
  /* Tronquer proprement les noms de fichiers longs (radio_animal_2026-05-23.pdf). */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feat-documents-item__meta {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.4;
}
.feat-documents-item__notes {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-mute);
  background: var(--cream-2);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  white-space: pre-wrap;
  word-break: break-word;
  /* Limite à 2 lignes pour ne pas exploser la hauteur du row. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feat-documents-item__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 8px 0;
}
.feat-documents-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--cream-2);
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.feat-documents-icon-btn:hover,
.feat-documents-icon-btn:focus-visible {
  background: var(--honey-l);
  color: #8B6A14;
  outline: none;
}
.feat-documents-icon-btn--danger:hover,
.feat-documents-icon-btn--danger:focus-visible {
  background: var(--coral-l);
  color: var(--danger);
}

/* ── Viewer modal (fullscreen PDF/image) ──────────────────────── */
.feat-documents-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 18, 14, 0.92);
  display: flex;
  flex-direction: column;
  /* iOS safe areas — sinon la barre supérieure va sous le notch et le
     bouton fermer devient inaccessible. */
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.feat-documents-viewer[hidden] { display: none; }

.feat-documents-viewer__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  /* Tap-target = 44px min, on garde un bar dense mais ergonomique. */
}

.feat-documents-viewer__title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feat-documents-viewer__btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.feat-documents-viewer__btn:hover,
.feat-documents-viewer__btn:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.feat-documents-viewer__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2C2A26;
  overflow: auto;
  min-height: 0; /* permet à flex de scroller correctement */
}

.feat-documents-viewer__iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  /* iOS Safari rejoue avec une hauteur 0 sinon → on force display block. */
  display: block;
}

.feat-documents-viewer__img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  /* Évite que la grosse radio prenne plus que l'écran avant scale. */
}

.feat-documents-viewer__nopreview {
  color: var(--cream);
  text-align: center;
  padding: 40px 24px;
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.85;
}

/* Sur très petit écran (≤360px) le bar viewer se compresse, on retire le
 * padding pour gagner de la place. */
@media (max-width: 360px) {
  .feat-documents-viewer__bar { padding: 8px 8px; gap: 8px; }
  .feat-documents-viewer__btn { width: 40px; height: 40px; }
}

/* Dark mode parité — la card upload garde son look honey, mais on assombrit
 * le fond du details et des icon-btns. */
body.dark .feat-documents-item__icon,
html[data-theme="dark"] .feat-documents-item__icon {
  background: rgba(232, 181, 71, 0.18);
}
body.dark .feat-documents-icon-btn,
html[data-theme="dark"] .feat-documents-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
}
body.dark .feat-documents-icon-btn:hover,
body.dark .feat-documents-icon-btn:focus-visible,
html[data-theme="dark"] .feat-documents-icon-btn:hover,
html[data-theme="dark"] .feat-documents-icon-btn:focus-visible {
  background: rgba(232, 181, 71, 0.22);
  color: var(--honey);
}
body.dark .feat-documents-icon-btn--danger:hover,
body.dark .feat-documents-icon-btn--danger:focus-visible,
html[data-theme="dark"] .feat-documents-icon-btn--danger:hover,
html[data-theme="dark"] .feat-documents-icon-btn--danger:focus-visible {
  background: rgba(232, 117, 91, 0.22);
  color: var(--coral);
}
body.dark .feat-documents-item__notes,
html[data-theme="dark"] .feat-documents-item__notes {
  background: rgba(255, 255, 255, 0.04);
}

/* Print : pas d'intérêt à imprimer la viewer, mais on peut imprimer la
 * liste pour archivage. On masque juste les boutons d'action. */
@media print {
  .feat-documents-upload,
  .feat-documents-item__actions,
  .feat-documents-viewer { display: none !important; }
}

/* ─── MIMI 22 — Export PDF carnet santé (Premium) ─────────────────── */
.feat-export-card {
  margin-top: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.feat-export-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--honey) 0%, #F2C76B 100%);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(232, 181, 71, 0.28);
}
.feat-export-btn:active { transform: scale(0.98); }
.feat-export-btn__icon {
  font-size: 18px;
  line-height: 1;
}
.feat-export-btn__label {
  font-weight: 700;
  letter-spacing: -0.1px;
}
.feat-export-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--honey);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.feat-export-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.4;
}
.feat-export-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  min-height: 1em;
}

body.dark .feat-export-card,
html[data-theme="dark"] .feat-export-card {
  background: var(--cream-2);
}
body.dark .feat-export-sub,
html[data-theme="dark"] .feat-export-sub,
body.dark .feat-export-status,
html[data-theme="dark"] .feat-export-status {
  color: var(--ink-mute);
}

/* Print : on cache le bouton export (le PDF EST déjà le rendu impression). */
@media print {
  .feat-export-card { display: none !important; }
}

/* ──────────────────────────────────────────────────────────────────
 * MIMI 23 — Famille + invites + activity log
 * Namespace .feat-family-*
 *
 * Préfixe systématique pour éviter de polluer les classes communes
 * (.card, .btn) — chaque sous-élément a son nom complet.
 * ────────────────────────────────────────────────────────────────── */

.feat-family-loading {
  text-align: center;
  padding: 48px 16px;
  color: var(--ink-dim);
  font-size: 14px;
}

/* ─── État FREE : paywall plein écran ───────────────────────────── */
.feat-family-paywall {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 22px;
  margin-top: 12px;
  box-shadow: var(--shadow);
  text-align: center;
}
.feat-family-paywall-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--honey-l);
  color: #8B6A14;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 16px;
}
.feat-family-paywall-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 10px;
  color: var(--ink);
}
.feat-family-paywall-text {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.55;
  margin: 0 auto 18px;
  max-width: 340px;
}
.feat-family-paywall-list {
  list-style: none;
  padding: 0;
  margin: 0 auto 22px;
  max-width: 320px;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
}
.feat-family-paywall-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.feat-family-paywall-list li:last-child { border-bottom: none; }
.feat-family-paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── État PREMIUM : contenu ────────────────────────────────────── */
.feat-family-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.feat-family-hero-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--green-l);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.feat-family-hero-meta { min-width: 0; flex: 1; }
.feat-family-hero-label {
  font-size: 12px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.feat-family-hero-meta h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 2px 0 0;
  color: var(--ink);
}

.feat-family-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.feat-family-section-head h2 {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.feat-family-count {
  background: var(--green-l);
  color: var(--green-d);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--pill);
  min-width: 24px;
  text-align: center;
}
.feat-family-refresh {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.feat-family-refresh:active {
  transform: rotate(180deg);
  background: var(--cream-2);
}

/* ─── Liste membres ─────────────────────────────────────────────── */
.feat-family-members { list-style: none; padding: 0; margin: 0; }
.feat-family-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.feat-family-member:last-child { border-bottom: none; }

.feat-family-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--ink-dim);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feat-family-avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.feat-family-member-meta { flex: 1; min-width: 0; }
.feat-family-member-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feat-family-you {
  color: var(--ink-mute);
  font-weight: 500;
  font-size: 12px;
}
.feat-family-member-email {
  font-size: 12px;
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feat-family-role-badge {
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.feat-family-role-owner    { background: var(--green-l); color: var(--green-d); }
.feat-family-role-coparent { background: var(--water-l); color: #2A6E91; }
.feat-family-role-viewer   { background: var(--cream-2); color: var(--ink-mute); }

.feat-family-remove-btn {
  background: transparent;
  border: 1px solid var(--coral-l);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  color: var(--danger);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 4px;
  transition: background 0.12s ease;
}
.feat-family-remove-btn:hover { background: var(--coral-l); }
.feat-family-remove-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.feat-family-invite-btn {
  margin-top: 14px;
  background: var(--green-l);
  color: var(--green-d);
  border: 1.5px dashed var(--green);
  font-weight: 700;
}
.feat-family-invite-btn:active { background: #DDF0E2; }

/* ─── Activity feed ─────────────────────────────────────────────── */
.feat-family-activity { display: flex; flex-direction: column; gap: 10px; }
.feat-family-activity-item {
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px;
}
.feat-family-activity-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.feat-family-activity-text { flex: 1; min-width: 0; }
.feat-family-activity-line {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}
.feat-family-activity-line strong { font-weight: 700; }
.feat-family-activity-details {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.feat-family-activity-time {
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.feat-family-activity-reactions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.feat-family-react-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--cream-2);
  border: 1px solid transparent;
  border-radius: var(--pill);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.12s ease;
}
.feat-family-react-chip:hover { background: var(--border); }
.feat-family-react-chip.is-active {
  background: var(--green-l);
  border-color: var(--green);
  color: var(--green-d);
}
.feat-family-react-count { font-variant-numeric: tabular-nums; font-size: 11px; }
.feat-family-activity-comments {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 600;
}

/* ─── Modale invite ─────────────────────────────────────────────── */
.feat-family-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(44, 42, 38, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0;
  animation: paywallFade 0.18s ease-out;
}
.feat-family-modal[hidden] { display: none; }

.feat-family-modal-box {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--cream);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 32px 20px calc(20px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: paywallSlide 0.22s cubic-bezier(.2,.8,.3,1.1);
  max-height: 90vh;
  overflow-y: auto;
}
.feat-family-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--ink-mute);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
}
.feat-family-modal-close:hover {
  background: var(--cream-2);
  color: var(--ink);
}
.feat-family-modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  color: var(--ink);
}
.feat-family-modal-sub {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.5;
  margin-bottom: 18px;
}

.feat-family-field { display: block; margin-bottom: 16px; }
.feat-family-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.feat-family-field-hint {
  display: block;
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 4px;
}
.feat-family-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color 0.12s ease;
}
.feat-family-input:focus { outline: none; border-color: var(--green); }

.feat-family-roles { border: none; padding: 0; margin: 0 0 18px; }
.feat-family-roles legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  padding: 0;
}
.feat-family-role { display: block; margin-bottom: 8px; cursor: pointer; }
.feat-family-role input { position: absolute; opacity: 0; pointer-events: none; }
.feat-family-role-card {
  display: block;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.12s ease;
}
.feat-family-role-card strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.feat-family-role-card em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.feat-family-role input:checked + .feat-family-role-card {
  border-color: var(--green);
  background: var(--green-l);
}
.feat-family-role input:checked + .feat-family-role-card strong { color: var(--green-d); }
.feat-family-role input:focus-visible + .feat-family-role-card {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ─── Étape 2 invite : code + share ─────────────────────────────── */
.feat-family-code-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
  word-break: break-all;
}
.feat-family-share-url {
  flex: 1;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-all;
  min-width: 0;
}
.feat-family-copy-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease;
}
.feat-family-copy-btn:active { background: var(--green-d); }

.feat-family-code-label {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.feat-family-code {
  display: block;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  margin-bottom: 18px;
  user-select: all;
  word-break: break-all;
}

/* ─── invite.php page (accept) ──────────────────────────────────── */
.feat-family-accept-card {
  text-align: center;
  padding: 28px 22px;
}
.feat-family-accept-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 14px;
}
.feat-family-accept-card h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 10px;
  color: var(--ink);
}
.feat-family-accept-text {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.55;
  margin-bottom: 14px;
}
.feat-family-accept-warn {
  font-size: 12px;
  color: var(--ink-mute);
  background: var(--honey-l);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* Desktop centering (cohérent avec .paywall-overlay) */
@media (min-width: 600px) {
  .feat-family-modal { align-items: center; padding: 16px; }
  .feat-family-modal-box {
    border-radius: 24px;
    padding-bottom: 24px;
  }
}

/* Dark mode (cohérent avec autres .feat-* features) */
body.dark .feat-family-paywall,
html[data-theme="dark"] .feat-family-paywall,
body.dark .feat-family-modal-box,
html[data-theme="dark"] .feat-family-modal-box {
  background: var(--surface);
}
body.dark .feat-family-activity-item,
html[data-theme="dark"] .feat-family-activity-item {
  background: var(--cream-2);
}
body.dark .feat-family-react-chip,
html[data-theme="dark"] .feat-family-react-chip {
  background: var(--cream-2);
  color: var(--ink);
}
body.dark .feat-family-input,
html[data-theme="dark"] .feat-family-input,
body.dark .feat-family-role-card,
html[data-theme="dark"] .feat-family-role-card {
  background: var(--cream-2);
}

/* ─── MIMI 17 : Vaccins CRUD (.feat-vaccins-*) ─────────────────── */
.feat-vaccins { }

/* Bandeau résumé (compteurs par statut). */
.feat-vaccins-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.feat-vaccins-summary__pill {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.feat-vaccins-summary__pill > span {
  font-size: 18px;
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
}
.feat-vaccins-summary__pill--green { background: var(--green-l); color: var(--green-d); }
.feat-vaccins-summary__pill--honey { background: var(--honey-l); color: #8B6A14; }
.feat-vaccins-summary__pill--coral { background: var(--coral-l); color: #B83E26; }

/* Liste des vaccins (override .list pour cards plus riches). */
.feat-vaccins-list { display: flex; flex-direction: column; gap: 10px; list-style: none; padding: 0; }
.feat-vaccins-item {
  padding: 12px 14px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  list-style: none;
}
.feat-vaccins-item--edit {
  background: var(--surface);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(91, 168, 113, 0.15);
}
.feat-vaccins-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.feat-vaccins-item__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.feat-vaccins-item__name {
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}
.feat-vaccins-item__meta {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.5;
  margin-bottom: 8px;
}
.feat-vaccins-item__meta > div { word-break: break-word; }

/* Badges statut (vert / orange / rouge). */
.feat-vaccins-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.feat-vaccins-badge--green { background: var(--green-l); color: var(--green-d); }
.feat-vaccins-badge--honey { background: var(--honey-l); color: #8B6A14; }
.feat-vaccins-badge--coral { background: var(--coral-l); color: #B83E26; }
.feat-vaccins-badge--mute  { background: var(--cream);   color: var(--ink-dim); }

/* Actions row : rappel / éditer / supprimer. */
.feat-vaccins-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.feat-vaccins-icon-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--ink);
  cursor: pointer;
  min-height: 36px;
}
.feat-vaccins-icon-btn:active { background: var(--cream-2); }
.feat-vaccins-icon-btn--danger { color: var(--danger); border-color: var(--coral-l); }

/* Édition inline (date_given + next_due). */
.feat-vaccins-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.feat-vaccins-edit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.feat-vaccins-edit input[type="date"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  outline: none;
}
.feat-vaccins-edit input[type="date"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(91, 168, 113, 0.15);
}
.feat-vaccins-edit__actions { display: flex; gap: 8px; }
.feat-vaccins-edit__actions .btn-sm { flex: 1; }

/* Formulaire ajout (collapsible). */
.feat-vaccins-toggle { margin: 8px 0 14px; }
.feat-vaccins-form { margin-top: 0; }
.feat-vaccins-form .field textarea { min-height: 80px; }

/* Note de bas de page (hint .ics). */
.feat-vaccins-help {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--lilac-l);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.5;
  text-align: center;
}

/* Desktop : meta + actions un peu plus larges. */
@media (min-width: 600px) {
  .feat-vaccins-item__actions { gap: 8px; }
  .feat-vaccins-summary__pill { min-width: 110px; }
}

/* ─── MIMI 18 : Traitements (médicaments) ────────────────────────
   Namespace .feat-treatments-* — couleur primaire green/coral.
   - Calendar visuel "prochaines doses" en tête (card green).
   - Form ajout collapsible.
   - Liste items avec chevron + modal actions (administrer / stop / suppr).
   ──────────────────────────────────────────────────────────────── */

.feat-treatments .empty {
  text-align: center;
  color: var(--ink-dim);
  font-size: 13px;
  font-style: italic;
  padding: 12px 4px;
}

/* ─── Calendar : prochaines doses ─────────────────────────────── */
.feat-treatments-calendar h2 {
  /* Surcharge le h2 standard pour rester lisible sur fond green-l. */
  color: var(--green-d);
}
.feat-treatments-upcoming {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feat-treatments-upcoming-row {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}
.feat-treatments-upcoming-when {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--green-d);
  margin-bottom: 2px;
}
.feat-treatments-upcoming-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.feat-treatments-upcoming-dose {
  font-weight: 500;
  color: var(--ink-mute);
  font-size: 13px;
}

/* ─── Form ajout ──────────────────────────────────────────────── */
.feat-treatments-form {
  /* card par défaut, juste un peu plus de gap interne pour les selects. */
}
.feat-treatments-form .form { gap: 16px; }
.feat-treatments-form .btn--secondary { margin-top: 6px; }

.feat-treatments-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.feat-treatments-dates input[type="date"] {
  /* iOS rend les date inputs en colonne ; on force largeur 100%. */
  width: 100%;
}

/* ─── Liste items ─────────────────────────────────────────────── */
.feat-treatments-item {
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background 0.12s ease;
  position: relative;
  padding-right: 8px;
}
.feat-treatments-item:active { background: var(--cream-2); }
.feat-treatments-item .feat-treatments-note {
  margin-top: 2px;
  font-style: italic;
}
.feat-treatments-chev {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 22px;
  line-height: 1;
  padding: 0 6px;
  margin-left: 4px;
  pointer-events: none; /* le tap est géré par le <li> parent */
}

/* Historique repli (details/summary natif). */
.feat-treatments-history {
  margin-top: 14px;
}
.feat-treatments-history summary {
  cursor: pointer;
  padding: 12px 14px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  list-style: none;
  text-align: center;
}
.feat-treatments-history summary::-webkit-details-marker { display: none; }
.feat-treatments-history[open] summary {
  background: var(--cream);
  border: 1px solid var(--border);
}
.feat-treatments-history ul {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 4px 14px;
  margin-top: 8px;
}

.feat-treatments-foot {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--lilac-l);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.5;
}

/* ─── Modal actions (administrer / stop / supprimer) ──────────── */
.feat-treatments-modal {
  position: fixed;
  inset: 0;
  background: rgba(44, 42, 38, 0.45);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}
.feat-treatments-modal--open { display: flex; }
.feat-treatments-modal-inner {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 18px calc(14px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: feat-treatments-slide-up 0.22s ease;
}
@keyframes feat-treatments-slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.feat-treatments-modal-inner h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
  margin-bottom: 2px;
  text-align: center;
}
.feat-treatments-modal-sub {
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
  margin-bottom: 8px;
}

/* Desktop : modal centrée (au lieu de bottom sheet). */
@media (min-width: 600px) {
  .feat-treatments-modal { align-items: center; padding-bottom: 16px; }
  .feat-treatments-modal-inner { border-radius: 20px; }
}


/* ════════════════════════════════════════════════════════════════════
   MIMI 27 — Stats & Monthly insights (Premium gated)
   Namespace : .feat-stats-*
   Composants : paywall card, rings (SVG), score bar, chart cards,
                heatmap grid, anomalies list.
   ════════════════════════════════════════════════════════════════════ */

/* ─── Section title (réutilisé partout dans la page) ───────────── */
.feat-stats-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.2px;
}

/* ─── Paywall card ──────────────────────────────────────────────── */
.feat-stats-paywall-card {
  padding: 26px 22px 22px;
  background: linear-gradient(180deg, var(--honey-l) 0%, var(--surface) 60%);
  border: 1.5px solid rgba(232, 181, 71, 0.35);
  position: relative;
  overflow: hidden;
}
.feat-stats-paywall-hero {
  text-align: center;
  margin-bottom: 18px;
}
.feat-stats-paywall-emoji {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 8px;
}
.feat-stats-paywall-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
  color: var(--ink);
}
.feat-stats-paywall-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-mute);
  margin: 0 6px;
}
.feat-stats-paywall-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feat-stats-paywall-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.feat-stats-paywall-ico {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.feat-stats-paywall-list li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.feat-stats-paywall-list strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.feat-stats-paywall-list span {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.4;
}
.feat-stats-paywall-cta {
  margin-top: 6px;
}
.feat-stats-paywall-fineprint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: 10px;
}

/* ─── Rings card (Apple Health style) ──────────────────────────── */
.feat-stats-rings-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
}
.feat-stats-rings {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
#feat-stats-rings-svg {
  width: 180px;
  height: 180px;
  display: block;
}
.feat-stats-rings-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feat-stats-rings-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feat-stats-rings-legend-item .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.feat-stats-rings-legend-item > div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.feat-stats-rings-legend-item .lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.feat-stats-rings-legend-item .val {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
@media (max-width: 400px) {
  .feat-stats-rings { grid-template-columns: 1fr; justify-items: center; }
  #feat-stats-rings-svg { width: 160px; height: 160px; }
  .feat-stats-rings-legend { width: 100%; }
}

/* ─── Score santé card ─────────────────────────────────────────── */
.feat-stats-score-card {
  padding: 16px;
}
.feat-stats-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.feat-stats-score-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 0 2px;
}
.feat-stats-score-sub {
  font-size: 12px;
  color: var(--ink-dim);
  margin: 0;
}
.feat-stats-score-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -1px;
  line-height: 1;
}
.feat-stats-score-value .unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-left: 2px;
}
.feat-stats-score-bar {
  width: 100%;
  height: 8px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
}
.feat-stats-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral) 0%, var(--honey) 40%, var(--green) 80%);
  border-radius: 999px;
  transition: width 700ms cubic-bezier(.4,.0,.2,1);
}
.feat-stats-score-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--cream-2);
  color: var(--ink);
}
.feat-stats-tag-good { background: var(--green-l);  color: var(--green-d); }
.feat-stats-tag-ok   { background: var(--green-l);  color: var(--green-d); }
.feat-stats-tag-warn { background: var(--honey-l);  color: #8B6A14;        }
.feat-stats-tag-bad  { background: var(--coral-l);  color: var(--danger);  }

/* ─── Chart cards (line + bar) ─────────────────────────────────── */
.feat-stats-chart-card {
  padding: 16px;
}
.feat-stats-chart-sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 2px 0 12px;
}
.feat-stats-chart-wrap {
  position: relative;
  width: 100%;
  height: 200px;
}
.feat-stats-chart-empty {
  font-size: 13px;
  color: var(--ink-dim);
  text-align: center;
  padding: 24px 12px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
}

/* ─── Heatmap (30 cases) ───────────────────────────────────────── */
.feat-stats-heatmap-card {
  padding: 16px;
}
.feat-stats-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.feat-stats-heatmap-cell {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  background: var(--cream-2);
  border: 1px solid transparent;
  cursor: default;
  transition: transform 120ms ease;
}
.feat-stats-heatmap-cell:hover {
  transform: scale(1.08);
  border-color: var(--ink-dim);
}
.feat-stats-heat-0 { background: var(--cream-2);                 color: var(--ink-dim); }
.feat-stats-heat-1 { background: #DCEEE2;                        color: var(--ink-mute); }
.feat-stats-heat-2 { background: #B4DBC1;                        color: var(--green-d); }
.feat-stats-heat-3 { background: #7EC298;                        color: #fff; }
.feat-stats-heat-4 { background: var(--green-d);                 color: #fff; }
.feat-stats-heatmap-scale {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-dim);
  justify-content: flex-end;
}
.feat-stats-heatmap-scale .cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.feat-stats-heatmap-scale .cell[data-i="0"] { background: var(--cream-2); }
.feat-stats-heatmap-scale .cell[data-i="1"] { background: #DCEEE2; }
.feat-stats-heatmap-scale .cell[data-i="2"] { background: #B4DBC1; }
.feat-stats-heatmap-scale .cell[data-i="3"] { background: #7EC298; }
.feat-stats-heatmap-scale .cell[data-i="4"] { background: var(--green-d); }

/* ─── Anomalies card ───────────────────────────────────────────── */
.feat-stats-anomalies-card {
  padding: 16px;
}
.feat-stats-anomalies-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feat-stats-anomalies-list .empty {
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
  padding: 14px 6px;
}
.feat-stats-anomaly {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.feat-stats-anomaly--critical {
  border-color: rgba(193, 69, 69, 0.3);
  background: var(--coral-l);
}
.feat-stats-anomaly--warning {
  border-color: rgba(232, 181, 71, 0.45);
  background: var(--honey-l);
}
.feat-stats-anomaly--info {
  border-color: rgba(123, 183, 217, 0.45);
  background: var(--water-l);
}
.feat-stats-anomaly-ico {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.feat-stats-anomaly-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.feat-stats-anomaly-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.feat-stats-anomaly-msg {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.4;
}

/* ─── Dark mode tweaks ─────────────────────────────────────────── */
body.dark .feat-stats-paywall-card {
  background: linear-gradient(180deg, rgba(232, 181, 71, 0.08) 0%, var(--surface) 60%);
  border-color: rgba(232, 181, 71, 0.25);
}
body.dark .feat-stats-heat-0 { background: rgba(255,255,255,0.04); }
body.dark .feat-stats-heat-1 { background: rgba(91, 168, 113, 0.18); }
body.dark .feat-stats-heat-2 { background: rgba(91, 168, 113, 0.34); }
body.dark .feat-stats-heat-3 { background: rgba(91, 168, 113, 0.55); }
body.dark .feat-stats-heat-4 { background: var(--green-d); }
body.dark .feat-stats-anomaly--critical { background: rgba(193, 69, 69, 0.12); }
body.dark .feat-stats-anomaly--warning  { background: rgba(232, 181, 71, 0.10); }
body.dark .feat-stats-anomaly--info     { background: rgba(123, 183, 217, 0.10); }
body.dark .feat-stats-score-bar         { background: rgba(255,255,255,0.06); }

/* ─── MIMI 06 : Animals CRUD + switcher + photo upload ─────────────
   Namespace .feat-animals-* — listing, form add/edit, photo block,
   pet switcher dropdown réutilisable.
   ───────────────────────────────────────────────────────────────── */

/* — Liste animaux (page /animals) — */
.feat-animals-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feat-animals-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.feat-animals-card--selected {
  border: 1.5px solid var(--green);
  box-shadow: 0 0 0 4px rgba(91, 168, 113, 0.15);
}
.feat-animals-card-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--ink);
  text-decoration: none;
}
.feat-animals-card-link:hover,
.feat-animals-card-link:focus {
  background: var(--cream-2);
  text-decoration: none;
}
.feat-animals-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  object-fit: cover;
}
.feat-animals-avatar--emoji { font-size: 30px; }
.feat-animals-body { flex: 1; min-width: 0; }
.feat-animals-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.1px;
  color: var(--ink);
}
.feat-animals-sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feat-animals-chev {
  color: var(--ink-dim);
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.feat-animals-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--green-l);
  color: var(--green-d);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.feat-animals-select-btn {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--pill);
  background: var(--cream-2);
  color: var(--ink);
  border: none;
  cursor: pointer;
}
.feat-animals-select-btn:active { background: var(--green-l); color: var(--green-d); }
.feat-animals-select-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.feat-animals-empty { color: var(--ink-mute); }
.feat-animals-add--locked { opacity: 0.7; }
.feat-animals-locked {
  color: var(--ink-mute);
  line-height: 1.5;
}

/* — Form add / edit — */
.feat-animals-form .field input,
.feat-animals-form .field select {
  background: var(--surface);
}
.feat-animals-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.feat-animals-toggle {
  min-height: 48px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.feat-animals-toggle[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-l);
  color: var(--green-d);
}

/* — Photo upload block — */
.feat-animals-photo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0 20px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.feat-animals-photo-preview {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  background: var(--cream-2);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.feat-animals-photo-preview--filled { font-size: 0; background-color: transparent; }
.feat-animals-photo-btn,
.feat-animals-photo-clear { min-height: 38px; }
.feat-animals-photo-status { font-size: 12px; color: var(--ink-dim); min-height: 16px; }

/* — Bouton "Supprimer" — */
.feat-animals-delete-btn {
  background: var(--surface);
}

/* — Pet switcher (dropdown header) — */
.feat-animals-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.feat-animals-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--cream-2);
  border: none;
  border-radius: var(--pill);
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  max-width: 60vw;
}
.feat-animals-switcher__btn:active { background: var(--green-l); }
.feat-animals-switcher__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  object-fit: cover;
  flex-shrink: 0;
}
.feat-animals-switcher__name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feat-animals-switcher__chev {
  font-size: 12px;
  color: var(--ink-mute);
  margin-left: 2px;
}
.feat-animals-switcher__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: 80vw;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
  display: none;
}
.feat-animals-switcher--open .feat-animals-switcher__menu { display: block; }
.feat-animals-switcher__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.feat-animals-switcher__item:hover,
.feat-animals-switcher__item:focus { background: var(--cream-2); outline: none; }
.feat-animals-switcher__item--active { background: var(--green-l); color: var(--green-d); font-weight: 600; }
.feat-animals-switcher__item-meta { font-size: 12px; color: var(--ink-dim); }
.feat-animals-switcher__sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.feat-animals-switcher__action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--green-d);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-xs);
}
.feat-animals-switcher__action:hover,
.feat-animals-switcher__action:focus {
  background: var(--green-l);
  text-decoration: none;
}

/* Dark mode tweaks pour la feature animals */
body.dark .feat-animals-card { background: var(--surface); }
body.dark .feat-animals-card-link:hover,
body.dark .feat-animals-card-link:focus { background: rgba(255,255,255,0.04); }
body.dark .feat-animals-toggle { background: var(--surface); }
body.dark .feat-animals-toggle[aria-pressed="true"] {
  background: rgba(91, 168, 113, 0.18);
  color: #C5E8CF;
}
body.dark .feat-animals-photo-preview { background: rgba(255,255,255,0.04); }
body.dark .feat-animals-switcher__btn { background: rgba(255,255,255,0.06); color: var(--ink); }
body.dark .feat-animals-switcher__menu { background: #232220; }
body.dark .feat-animals-switcher__item:hover,
body.dark .feat-animals-switcher__item:focus { background: rgba(255,255,255,0.05); }
body.dark .feat-animals-switcher__item--active { background: rgba(91, 168, 113, 0.18); color: #C5E8CF; }
