:root {
  --bg: #0a0c0b;
  --surface: #141715;
  --surface2: #1c211e;
  --border: rgba(255,255,255,0.08);
  --text: #f2f4f2;
  --text2: #8a9390;
  --accent: #4ade80;
  --accent-soft: rgba(74,222,128,0.12);
  --accent-line: rgba(74,222,128,0.32);
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 16px;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.22, 0.9, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 16px;
}
/* Halo d'ambiance vert très léger en haut de l'app */
body {
  background:
    radial-gradient(120% 50% at 50% -8%, rgba(74,222,128,0.06), transparent 60%),
    var(--bg);
}

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

.view {
  display: none; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(80px + var(--safe-bottom));
  padding-top: calc(64px + var(--safe-top));
}
.view.active { display: block; }

/* ── Header ── */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: calc(64px + var(--safe-top)); padding-top: var(--safe-top);
  background: rgba(10,12,11,0.78);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 20px; padding-right: 16px;
}
.header h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(66px + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: rgba(14,17,15,0.82);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-top: 1px solid var(--border);
  display: flex;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px; background: none; border: none;
  cursor: pointer; color: var(--text2); font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.25s var(--ease-out);
}
.nav-btn.active { color: var(--accent); }
.nav-btn svg.nav-icon {
  width: 23px; height: 23px;
  transition: transform 0.3s var(--ease-spring);
}
.nav-btn.active svg.nav-icon { transform: translateY(-1px) scale(1.08); }
.nav-btn:active svg.nav-icon { transform: scale(0.9); }

/* ── Cards ── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0) 50%), var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.card-title {
  font-size: 11px; color: var(--text2); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

/* Pastille des titres — icône line mise en scène */
.t-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 9px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(74,222,128,0.18), rgba(74,222,128,0.04));
  border: 1px solid rgba(74,222,128,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.t-ico .ic { width: 16px; height: 16px; }

/* Icône générique : alignement vertical propre dans le texte */
.ic { display: inline-block; vertical-align: middle; }

/* Icône dans les chips de métrique (poids/calories/taille) */
.chip-ic { display: inline-flex; align-items: center; }
.chip-ic .ic { width: 15px; height: 15px; }

/* Petite icône inline (label vidéo, etc.) */
.ti-inline { display: inline-flex; align-items: center; color: var(--accent); vertical-align: -3px; }

/* Icône dans le slot (touche pour voir l'historique) */
.slot-name-ic { display: inline-flex; align-items: center; }
.slot-name-ic .ic { width: 12px; height: 12px; }

/* Icône dans les boutons d'action (Regarder/Modifier) */
.cpq-ic { display: inline-flex; align-items: center; vertical-align: -4px; margin-right: 4px; }

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 20px; border-radius: 14px; border: none;
  font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: var(--font-display); letter-spacing: 0.01em;
  transition: transform 0.2s var(--ease-spring), opacity 0.15s, box-shadow 0.2s; width: 100%;
}
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary {
  background: linear-gradient(180deg, #5ce695, var(--accent));
  color: #052e12;
  box-shadow: 0 6px 18px -8px rgba(74,222,128,0.5);
}
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-icon {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.08);
  border: 1px solid var(--border); cursor: pointer; font-size: 18px; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}
.btn-icon:active { transform: scale(0.9); background: rgba(255,255,255,0.16); }

/* ── Stats ── */
.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0) 50%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 8px 13px; text-align: center;
}
.stat-value {
  font-size: 22px; font-weight: 700; line-height: 1.2;
  font-family: var(--font-display); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value.green { color: var(--accent); }
.stat-label {
  font-size: 9.5px; color: var(--text2); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
}

/* ── Section header ── */
.section-header {
  font-size: 26px; font-weight: 700; padding: 20px 0 4px;
  letter-spacing: -0.02em; font-family: var(--font-display);
}
.section-sub { font-size: 14px; color: var(--text2); margin-bottom: 18px; }

/* ── Chart ── */
.chart-wrap { position: relative; height: 180px; }
.chart-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--text2); font-size: 14px; text-align: center;
  padding: 20px;
}

/* ── Photo slots ── */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-slot {
  aspect-ratio: 3/4; border-radius: var(--radius);
  border: 2px dashed var(--border); overflow: hidden; position: relative;
  cursor: pointer; background: var(--surface2);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; transition: border-color 0.2s;
}
.photo-slot:active { opacity: 0.8; }
.photo-slot.has { border-style: solid; border-color: var(--accent); }
.photo-slot img, .photo-slot video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.slot-icon { font-size: 32px; }
.slot-label { font-size: 12px; color: var(--text2); text-align: center; line-height: 1.3; }
.slot-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75)); padding: 8px 6px 6px;
  font-size: 11px; color: #fff; text-align: center; font-weight: 500;
}

/* ── Inputs ── */
.input-group { margin-bottom: 14px; }
.input-label { font-size: 13px; color: var(--text2); display: block; margin-bottom: 6px; }
.input-field {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; font-size: 20px; font-weight: 600;
  color: var(--text); outline: none; -webkit-appearance: none;
  transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--accent); }
/* Placeholder bien estompé (pour ne pas croire que c'est déjà rempli) */
.input-field::placeholder { color: #5a5a5a; font-weight: 400; opacity: 1; }

/* ── Toggle section ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-top: 1px solid var(--border); cursor: pointer;
}
.toggle-row-label { font-size: 15px; font-weight: 500; }
.chevron { font-size: 20px; color: var(--text2); transition: transform 0.25s; display: inline-block; }
.chevron.open { transform: rotate(90deg); }
.toggle-body { display: none; padding-top: 12px; }
.toggle-body.open { display: block; }

/* ── Timelapse ── */
.tl-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.tl-tab {
  padding: 11px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2); font-size: 14px;
  font-weight: 600; cursor: pointer; text-align: center; transition: all 0.2s;
}
.tl-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }

.tl-frame {
  width: 100%; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden;
  background: var(--surface2); position: relative; margin-bottom: 12px;
}
.tl-frame img { width: 100%; height: 100%; object-fit: cover; }
.tl-badge {
  position: absolute; bottom: 12px; left: 12px;
  background: rgba(0,0,0,0.65); padding: 4px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 600; color: #fff;
}

.tl-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tl-play {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent);
  border: none; cursor: pointer; font-size: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.tl-slider {
  flex: 1; -webkit-appearance: none; height: 4px;
  border-radius: 2px; background: var(--border); outline: none; cursor: pointer;
}
.tl-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
  box-shadow: 0 0 0 4px rgba(74,222,128,0.2);
}
.speed-row { display: flex; align-items: center; gap: 6px; }
.speed-chip {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.speed-chip.active { background: var(--surface2); color: var(--text); border-color: var(--text2); }

/* ── History ── */
.hist-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 12px; margin-bottom: 8px;
}
.hist-thumbs { display: flex; gap: 5px; flex-shrink: 0; }
.hist-thumb {
  width: 69px; height: 93px; border-radius: 8px; object-fit: cover;  /* +50% */
  background: var(--surface2); display: flex; align-items: center;
  justify-content: center; font-size: 22px; overflow: hidden;
}
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hist-thumb.miss { background: repeating-linear-gradient(45deg, #1a1a1a, #1a1a1a 6px, #222 6px, #222 12px); }
.hist-noimg { opacity: 0.5; }
.hist-item.missed { opacity: 0.55; }
.hist-missed-lbl { font-size: 13px; color: var(--text2); font-style: italic; margin-top: 4px; }
.hist-item[data-date] { cursor: pointer; }
.hist-item[data-date]:active { background: var(--surface2); }

/* ── Profil : chip header ── */
.profile-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 22px; padding: 4px 10px 4px 4px; cursor: pointer;
  max-width: 60%;
}
.profile-av {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); font-size: 17px; flex-shrink: 0;
}
.profile-av img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 14px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-caret { font-size: 11px; color: var(--text2); }

/* ── Profil : overlay ── */
.profile-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.6); display: none; align-items: flex-end;
}
.profile-overlay.active { display: flex; }
.profile-sheet {
  width: 100%; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + var(--safe-bottom));
  max-height: 85vh; overflow-y: auto;
}
.ps-head { font-size: 19px; font-weight: 900; margin-bottom: 8px; text-align: center; }
.ps-desc { font-size: 13px; color: var(--text2); line-height: 1.5; margin-bottom: 16px; text-align: center; }
.ps-desc strong { color: var(--accent); }
.ps-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.ps-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px; cursor: pointer;
}
.ps-row.active { border-color: var(--accent); background: rgba(74,222,128,0.08); }
.ps-av {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 24px;
}
.ps-av img { width: 100%; height: 100%; object-fit: cover; }
.ps-name { flex: 1; font-size: 16px; font-weight: 700; }
.ps-badge { font-size: 12px; font-weight: 800; color: var(--accent); }
.ps-switch { font-size: 13px; color: var(--text2); font-weight: 600; }
.ps-del { background: none; border: none; font-size: 17px; cursor: pointer; padding: 4px; }
.ps-max-note { font-size: 12px; color: var(--text2); text-align: center; margin-top: 8px; }
.ps-sub { font-size: 13px; color: var(--text2); font-weight: 700; margin: 14px 0 8px; }
.ps-avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ps-avopt {
  aspect-ratio: 1; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface2); font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ps-avopt.sel { border-color: var(--accent); background: rgba(74,222,128,0.15); }
.ps-photo-btn {
  display: block; text-align: center; margin-top: 10px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.ps-photo-preview { text-align: center; margin-top: 10px; }
.ps-photo-preview img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.ps-chev { font-size: 22px; color: var(--text2); font-weight: 300; margin-left: auto; }

/* Détail profil */
.ps-back {
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-size: 14px; font-weight: 700;
  padding: 4px 0; margin-bottom: 8px;
}
.ps-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ps-detail-av {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 30px;
}
.ps-detail-av img { width: 100%; height: 100%; object-fit: cover; }
#ps-detail-name { flex: 1; font-size: 18px; padding: 12px; }
.ps-stats { background: var(--surface2); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.ps-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 15px; }
.ps-stat-row + .ps-stat-row { border-top: 1px solid var(--border); }
.ps-stat-lbl { color: var(--text2); }
.ps-stat-row b { font-weight: 800; color: var(--text); }

/* ── Sélecteurs de graphique ── */
.metric-chips { display: flex; gap: 6px; margin-bottom: 10px; }
.mchip {
  flex: 1; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); color: var(--text2);
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.mchip.active { background: var(--accent); color: #000; border-color: var(--accent); }
.range-chips { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: nowrap; }
.range-lbl { font-size: 12px; color: var(--text2); margin-right: 2px; white-space: nowrap; }
.rchip {
  padding: 5px 13px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface2); color: var(--text2); font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.rchip.active { background: var(--accent); color: #000; border-color: var(--accent); }
.rchip.reset { margin-left: auto; color: var(--text2); padding: 5px 11px; font-size: 14px; line-height: 1; }
.chart-j1 { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.opt-tag { font-size: 11px; color: var(--text2); font-weight: 500; }

/* ── Hints (textes d'aide) ── */
.today-hint, .save-hint {
  font-size: 12px; color: var(--text2); line-height: 1.5;
}
.today-hint {
  background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.2);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.save-hint { text-align: center; margin-top: 8px; }

/* ── Streak (jours d'affilée) ── */
.streak-card {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(74,222,128,0.1), var(--surface) 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 8px;
}
.streak-fire { font-size: 24px; animation: flamePulse 2.6s ease-in-out infinite; }
@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12) rotate(-2deg); }
}
.streak-num {
  font-size: 26px; font-weight: 800; color: var(--accent);
  font-family: var(--font-display); font-variant-numeric: tabular-nums;
}
.streak-lbl { font-size: 14px; color: var(--text2); font-weight: 600; }

/* ── Contrôles historique ── */
.hist-controls {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 12px;
}
.hist-ctrl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-ctrl-lbl { font-size: 13px; font-weight: 700; color: var(--text2); }
.hist-select {
  flex: 1; min-width: 80px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.hist-toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--text); cursor: pointer; }
.hist-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.hist-info { flex: 1; min-width: 0; }
.hist-date { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.hist-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hist-stat { font-size: 13px; color: var(--text2); }
.hist-stat strong { color: var(--text); }
.badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.badge {
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-g { background: rgba(74,222,128,0.15); color: var(--accent); }
.badge-o { background: rgba(245,158,11,0.15); color: var(--warning); }

/* ── Empty state ── */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text2);
}
.empty-icon { font-size: 56px; display: block; margin-bottom: 14px; }
.empty p { font-size: 15px; line-height: 1.6; }

/* ── Camera overlay ── */
.camera-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: #000; display: none; flex-direction: column;
}
.camera-overlay.active { display: flex; }
.camera-preview-wrap { flex: 1; position: relative; overflow: hidden; background: #000; }
/* Plein écran type Insta/TikTok : la preview remplit tout (cover) */
#cam-video { width: 100%; height: 100%; object-fit: cover; }

.cam-top {
  position: absolute; top: calc(16px + var(--safe-top)); left: 0; right: 0;
  display: flex; justify-content: center; gap: 8px;
}
.cam-mode-btn {
  padding: 7px 18px; border-radius: 20px; border: none; font-size: 14px;
  font-weight: 600; cursor: pointer; background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.6);
}
.cam-mode-btn.active { background: rgba(255,255,255,0.9); color: #000; }

.rec-badge {
  position: absolute; top: calc(16px + var(--safe-top)); left: 16px;
  display: none; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.6); padding: 4px 10px; border-radius: 20px;
}
.rec-badge.show { display: flex; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.rec-time { font-size: 13px; color: #fff; font-weight: 600; }

/* Contrôles flottants par-dessus la preview plein écran (gradient comme Insta) */
.cam-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 40px 32px calc(26px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.28) 55%, transparent);
  display: flex; align-items: center; justify-content: space-between;
}
.cam-shutter {
  width: 72px; height: 72px; border-radius: 50%; background: #fff;
  border: 4px solid rgba(255,255,255,0.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  transition: transform 0.1s;
}
.cam-shutter:active { transform: scale(0.88); }

/* ── Toast ── */
.toast {
  position: fixed; top: calc(72px + var(--safe-top)); left: 16px; right: 16px;
  background: rgba(28,33,30,0.92); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 16px; font-size: 14px; font-weight: 600; z-index: 400;
  transform: translateY(-16px) scale(0.97); opacity: 0;
  transition: transform 0.35s var(--ease-spring), opacity 0.25s; text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.6);
}
.toast.show { transform: translateY(0) scale(1); opacity: 1; }
.toast.ok { border-color: var(--accent); color: var(--accent); }
.toast.err { border-color: var(--danger); color: var(--danger); }

/* ── Delta ── */
#weight-delta { font-size: 13px; color: var(--text2); margin-bottom: 12px; min-height: 18px; }

/* ── Named slots grid ── */
.slots-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px;
}
.slot-named {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: opacity 0.15s;
}
.slot-named:active { opacity: 0.7; }
.slot-thumb {
  width: 100%; aspect-ratio: 3/4; border-radius: 10px;
  background: var(--surface2); border: 2px dashed var(--border);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.slot-named.has .slot-thumb {
  border: 2px solid var(--accent); border-style: solid;
}
.slot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot-thumb .add-plus {
  font-size: 28px; color: var(--text2); line-height: 1; font-weight: 300;
}
/* Le texte sous la case = bouton cliquable (ouvre la galerie/calendrier) — pastille sobre */
.slot-name {
  font-size: 11px; color: #dfe8e2; font-weight: 700;
  text-align: center; letter-spacing: 0.2px;
  font-family: inherit; cursor: pointer;
  background: var(--surface2);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 11px; padding: 4px 9px 4px 10px; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 5px;
}
.slot-name:active { background: rgba(74,222,128,0.16); transform: scale(0.96); }
/* icône en gris doux → bien visible (plus de vert sur vert) */
.slot-name-ic { display: inline-flex; align-items: center; color: var(--text2); }
.slot-name-ic .ic { width: 14px; height: 14px; }
.photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.75); color: #fff;
  border: none; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.count-pill {
  float: right; font-size: 11px; color: var(--text2); font-weight: 600;
  background: var(--surface2); padding: 2px 10px; border-radius: 20px;
  letter-spacing: 0; text-transform: none; margin-top: -3px;
}

/* ── Timer overlay (countdown) ── */
.timer-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 140px; font-weight: 800; color: #fff;
  text-shadow: 0 0 40px rgba(0,0,0,0.9);
  pointer-events: none; opacity: 0;
}
.timer-overlay.show { opacity: 1; }
@keyframes pulseCount {
  0%   { transform: scale(1.6); opacity: 0; }
  20%  { transform: scale(1);   opacity: 1; }
  100% { transform: scale(0.6); opacity: 0; }
}

/* ── Timer toggle button ── */
.cam-timer-btn {
  position: absolute; top: calc(16px + var(--safe-top)); right: 16px;
  padding: 7px 14px; border-radius: 20px; border: none;
  font-size: 13px; font-weight: 700; cursor: pointer;
  background: rgba(0,0,0,0.55); color: rgba(255,255,255,0.6);
  display: flex; align-items: center; gap: 4px;
}
.cam-timer-btn.active { background: rgba(74,222,128,0.95); color: #000; }

/* ── Slot label in camera (premium, 2 lignes) ── */
.cam-slot-label {
  position: absolute; top: calc(14px + var(--safe-top)); left: 50%;
  transform: translateX(-50%);
  padding: 7px 16px; border-radius: 16px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  pointer-events: none; z-index: 16;
  display: none; flex-direction: column; align-items: center; gap: 1px;
}
.csl-type {
  font-size: 9px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--accent);
}
.csl-main { font-size: 13px; font-weight: 800; color: #fff; letter-spacing: 0.3px; }

/* Badge de zoom (apparaît pendant le pinch) */
.zoom-badge {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 22px; font-weight: 800;
  padding: 8px 18px; border-radius: 24px;
  pointer-events: none; opacity: 0; z-index: 14;
  transition: opacity 0.2s;
}
.zoom-badge.show { opacity: 1; }

/* ── Review overlay (post-capture) ── */
.adjust-overlay {
  position: absolute; inset: 0;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 15; overflow: hidden;
}
.review-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Vue comparaison : slider avant/après */
.review-split {
  position: absolute; inset: 0;
  overflow: hidden; background: #000;
  touch-action: none;
}
.rs-img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transform-origin: center center;
}
.rs-clip {            /* overlay : photo précédente, clippée à gauche */
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 5%; overflow: hidden; z-index: 2;
}
.split-line {
  position: absolute; top: 0; bottom: 0; left: 5%;
  width: 3px; background: rgba(255,255,255,0.95);
  transform: translateX(-50%); pointer-events: none; z-index: 4;
}
.split-handle {
  position: absolute; top: 50%; left: 5%;
  transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; color: #000; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.6);
  z-index: 5; cursor: ew-resize; touch-action: none;
}
/* Labels verticaux collés à la barre blanche */
.rh-label {
  position: absolute; top: calc(70px + var(--safe-top));
  writing-mode: vertical-rl; text-orientation: mixed;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 8px 4px; border-radius: 9px;
  z-index: 6; pointer-events: none;
  opacity: 1; transition: opacity 0.6s;
}
.rh-left  { transform: translateX(calc(-100% - 5px)); pointer-events: auto; cursor: pointer; border: 1px solid rgba(74,222,128,0.5); opacity: 0.5; } /* cliquable, 50% */
.rh-right { transform: translateX(5px); }               /* à droite de la barre */
.review-split.labels-dim .rh-label { opacity: 0.2; }
.review-split.labels-dim .rh-left  { opacity: 0.5; }    /* HIER reste à 50% */

/* "clique ici" sous le libellé HIER (même flux vertical, clignotant) */
.lh-tap {
  font-size: 10px; font-weight: 700; color: var(--accent);
  animation: tapBlink 1.1s ease-in-out infinite;
}
@keyframes tapBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ── Popup choix de comparaison ── */
.compare-picker {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.6);
  display: none; align-items: flex-end;
}
.compare-picker.active { display: flex; }
.cp-sheet {
  width: 100%; background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  max-height: 75vh; overflow-y: auto;
}
.cp-title { font-size: 18px; font-weight: 800; margin-bottom: 14px; text-align: center; }
.cp-quick {
  width: 100%; padding: 14px; margin-bottom: 8px;
  border: none; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #000;
  font-size: 15px; font-weight: 700; text-align: left;
}
.cp-sub { font-size: 12px; color: var(--text2); font-weight: 700; margin: 14px 4px 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.cp-list { display: flex; flex-direction: column; gap: 6px; }
.cp-date {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  background: var(--surface2); color: var(--text);
  font-size: 14px; font-weight: 600; text-align: left; text-transform: capitalize;
}
.cp-date.current { border-color: var(--accent); color: var(--accent); }
.cp-cancel {
  width: 100%; padding: 14px; margin-top: 14px;
  border: none; border-radius: 12px; cursor: pointer;
  background: var(--surface2); color: var(--text2);
  font-size: 15px; font-weight: 700;
}
#restore-input { font-family: monospace; font-size: 14px; margin-top: 8px; }

/* 🧪 Test Next Day (dev only) */
#test-nextday {
  position: fixed; top: calc(8px + var(--safe-top)); left: 12px;
  background: rgba(255, 200, 0, 0.9); color: #000;
  border: none; border-radius: 18px;
  padding: 6px 12px; font-size: 12px; font-weight: 800;
  cursor: pointer; z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.restore-msg { font-size: 13px; color: var(--danger); margin-top: 8px; min-height: 18px; text-align: center; }
.review-compare-btn {
  position: absolute; bottom: calc(120px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95); color: #000;
  border: none; border-radius: 24px;
  padding: 12px 22px; font-size: 15px; font-weight: 800;
  cursor: pointer; z-index: 10;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* ── Adjust action buttons ── */
.cam-controls#cam-controls-adjust { gap: 10px; padding-left: 16px; padding-right: 16px; }
.cam-adj-btn {
  flex: 1; padding: 14px 8px; border: none; border-radius: 16px;
  font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.cam-adj-btn.exit      { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); flex: 0.7; }
.cam-adj-btn.secondary { background: rgba(255,255,255,0.18); color: #fff; }
.cam-adj-btn.primary   { background: var(--accent); color: #000; }

/* ── Slot announce transition ── */
.slot-announce {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; z-index: 18; pointer-events: none;
}
.announce-icon { font-size: 52px; }
.announce-name {
  font-size: 38px; font-weight: 900; color: #fff;
  letter-spacing: 3px; text-transform: uppercase;
}
.announce-prog {
  font-size: 18px; color: var(--accent); font-weight: 700;
}
.slot-announce.pop {
  animation: announceIn 1.1s ease-out forwards;
}
@keyframes announceIn {
  0%   { opacity: 0; transform: scale(0.75); }
  20%  { opacity: 1; transform: scale(1.05); }
  40%  { transform: scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.05); }
}


/* ── Camera flash on capture ── */
.cam-flash {
  position: absolute; inset: 0;
  background: #fff; opacity: 0;
  pointer-events: none; z-index: 20;
}
.cam-flash.go {
  animation: flashOut 0.45s ease-out forwards;
}
@keyframes flashOut {
  0%   { opacity: 0.85; }
  100% { opacity: 0; }
}

/* ── History num badge (multi photo) ── */
.hist-thumb { position: relative; }
.num-badge {
  position: absolute; bottom: 2px; right: 2px;
  background: rgba(74,222,128,0.95); color: #000;
  font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 8px;
  line-height: 1.3;
}

/* ── Persistence hint ── */
.hint-card {
  background: rgba(74,222,128,0.06);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px;
  font-size: 13px; line-height: 1.5; color: var(--text);
}
.hint-card strong { color: var(--accent); }

/* ── Settings / Profile ── */
.user-id-box {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px; word-break: break-all;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
  margin-top: 10px; color: var(--accent);
  letter-spacing: 0.5px;
}

.sync-pill {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; background: var(--text2);
  transition: background 0.3s, box-shadow 0.3s;
}
.sync-pill.sync-ok      { background: var(--accent);  box-shadow: 0 0 8px rgba(74,222,128,0.6); }
.sync-pill.sync-pending { background: var(--warning); animation: pulse-pill 1.4s infinite; }
.sync-pill.sync-err     { background: var(--danger); }
.sync-pill.sync-off     { background: var(--text2); }
@keyframes pulse-pill {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}

/* ── Misc ── */
.mt-8 { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.label-sm { font-size: 13px; color: var(--text2); }

/* ── Vue détaillée d'un angle ── */
.angle-detail {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: none; flex-direction: column;
  padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
}
.angle-detail.active { display: flex; }
.ad-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.ad-title { font-size: 17px; font-weight: 800; }
.ad-tabs {
  display: flex; gap: 8px; padding: 0 16px 12px;
}
.ad-tab {
  flex: 1; padding: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2);
  border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.ad-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }
.ad-body { flex: 1; overflow-y: auto; padding: 0 16px 12px; }
.ad-empty { text-align: center; color: var(--text2); padding: 48px 16px; line-height: 1.7; }

/* Galerie */
.ad-gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.ad-gcard { position: relative; cursor: pointer; }
.ad-gcard img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  border-radius: 10px; display: block; background: var(--surface2);
}
.ad-gdate {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 10px; font-weight: 700; text-align: center;
  padding: 2px 4px; border-radius: 6px;
}

/* Calendrier */
.ad-cal-month { margin-bottom: 24px; }
.ad-cal-title { font-size: 15px; font-weight: 800; margin-bottom: 10px; text-transform: capitalize; }
.ad-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 42px; gap: 6px; }
.ad-cal-dow { text-align: center; font-size: 10px; color: var(--text2); font-weight: 700; padding-bottom: 4px; }
.ad-cal-cell {
  height: 42px; display: flex; align-items: center; justify-content: center;
}
.ad-cal-cell.empty { visibility: hidden; }
.ad-cal-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text2); font-weight: 600;
}
/* Jour avec photo : entouré en vert + cliquable */
.ad-cal-cell.has { cursor: pointer; }
.ad-cal-cell.has .ad-cal-num {
  color: var(--accent); font-weight: 800;
  border: 2px solid var(--accent);
  background: rgba(74,222,128,0.15);
}
.ad-cal-cell.has:active .ad-cal-num { background: rgba(74,222,128,0.35); }
.ad-cal-num.is-today { outline: 2px dotted var(--text2); outline-offset: 1px; }
#ad-take { margin: 8px 16px calc(8px + var(--safe-bottom)); }

/* ── Calendrier accueil ── */
.home-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.home-cal-title { font-size: 15px; font-weight: 800; text-transform: capitalize; }
.cal-nav {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface2); color: var(--text); font-size: 18px; font-weight: 700;
}
.home-cal-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); margin-top: 12px; }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); background: rgba(74,222,128,0.15); display: inline-block; }

/* ── Détail d'un jour ── */
.dd-card { background: var(--surface2); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.dd-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 15px; }
.dd-row span { color: var(--text2); }
.dd-row b { font-size: 16px; }
.dd-sec-title { font-size: 14px; font-weight: 800; margin: 8px 0 10px; }
.dd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.dd-photo { cursor: pointer; }
.dd-photo img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; display: block; background: var(--surface2); }
.dd-photo-lbl { display: block; text-align: center; font-size: 11px; color: var(--text2); font-weight: 600; margin-top: 4px; }

/* ── Visionneuse plein écran ── */
.photo-viewer {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.96);
  display: none; align-items: center; justify-content: center;
}
.photo-viewer.active { display: flex; }
.photo-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
#pv-close {
  position: absolute; top: calc(12px + var(--safe-top)); right: 16px; z-index: 2;
  background: rgba(255,255,255,0.15);
}
.pv-date {
  position: absolute; bottom: calc(20px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 14px; font-weight: 700; padding: 8px 16px; border-radius: 20px;
  text-transform: capitalize;
}

/* ══════════════════════════════════════════════════════
   V1.6 — Partage · Rappels · Design premium
   ══════════════════════════════════════════════════════ */

/* ── Typo display sur les éléments forts ── */
.ps-head, .cp-title, .ad-title, .home-cal-title, .ad-cal-title { font-family: var(--font-display); }

/* ── Animation d'entrée des vues (navigation) ── */
/* Cascade d'entrée des vues — relancée à chaque affichage (classe .anim-in, pure CSS) */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.view.anim-in > * { animation: viewIn 0.5s var(--ease-out) both; }
.view.anim-in > *:nth-child(1) { animation-delay: 0.02s; }
.view.anim-in > *:nth-child(2) { animation-delay: 0.07s; }
.view.anim-in > *:nth-child(3) { animation-delay: 0.12s; }
.view.anim-in > *:nth-child(4) { animation-delay: 0.17s; }
.view.anim-in > *:nth-child(5) { animation-delay: 0.22s; }
.view.anim-in > *:nth-child(6) { animation-delay: 0.27s; }
.view.anim-in > *:nth-child(n+7) { animation-delay: 0.31s; }

/* Feuilles modales : glissement doux depuis le bas */
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.profile-overlay.active .profile-sheet,
.compare-picker.active .cp-sheet { animation: sheetUp 0.35s var(--ease-out) both; }

/* ── Partage : visionneuse plein écran ── */
.pv-actions {
  position: absolute; bottom: calc(66px + var(--safe-bottom)); left: 0; right: 0;
  display: flex; justify-content: center; gap: 10px; z-index: 2;
}
.pv-action {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.12); color: #fff;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 22px;
  padding: 11px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: var(--font-display);
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}
.pv-action:active { transform: scale(0.94); background: rgba(255,255,255,0.24); }
.pv-action svg { width: 17px; height: 17px; }

/* ── Partage du collage avant/après (vue comparaison) ── */
.share-compare-btn {
  position: absolute; bottom: calc(120px + var(--safe-bottom)); right: 14px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.95); color: #000; border: none;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  transition: transform 0.2s var(--ease-spring);
}
.share-compare-btn:active { transform: scale(0.9); }
.share-compare-btn svg { width: 20px; height: 20px; }

/* ── Rappels : bannière d'état (Accueil) ── */
.rem-banner {
  display: flex; width: 100%; align-items: stretch; gap: 2px;
  padding: 4px; border-radius: var(--radius); margin-bottom: 12px;
  font-size: 13px; font-family: inherit; color: var(--text); line-height: 1.35;
}
.rem-main {
  flex: 1; display: flex; align-items: center; gap: 11px;
  text-align: left; cursor: pointer; padding: 9px 6px 9px 10px;
  background: none; border: none; color: inherit; font-family: inherit;
  border-radius: 12px; transition: transform 0.18s var(--ease-spring);
}
.rem-main:active { transform: scale(0.98); }
.rem-banner.on {
  background: linear-gradient(135deg, rgba(74,222,128,0.14), rgba(74,222,128,0.03));
  border: 1px solid var(--accent-line);
}
.rem-banner.on b { color: var(--accent); }
.rem-banner.off {
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.02));
  border: 1px solid rgba(245,158,11,0.35);
}
.rem-banner.off b { color: var(--warning); }
.rem-ic { font-size: 20px; flex-shrink: 0; }
.rem-txt { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rem-txt b { font-size: 13.5px; }
.rem-sub { font-size: 12px; font-weight: 500; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rem-banner.off .rem-sub { color: rgba(245,158,11,0.85); }
.rem-go { color: var(--text2); font-size: 20px; font-weight: 300; flex-shrink: 0; }
.rem-hide {
  flex-shrink: 0; align-self: center; width: 30px; height: 30px; margin-right: 5px;
  border-radius: 9px; border: none; cursor: pointer;
  background: rgba(255,255,255,0.06); color: var(--text2); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s var(--ease-spring), background 0.2s;
}
.rem-hide:active { transform: scale(0.9); background: rgba(255,255,255,0.12); }

/* Icône dans les boutons principaux (Ajouter/Modifier, Passer, Sauvegarder…) */
.btn-ic { display: inline-flex; align-items: center; }
.btn-ic .ic { width: 19px; height: 19px; }

/* ── Rappels : carte de réglage ── */
.rem-row { display: flex; justify-content: space-between; align-items: center; }
.rem-row-lbl { font-size: 15px; font-weight: 600; }
.switch input { display: none; }
.switch-track {
  display: block; width: 50px; height: 30px; border-radius: 15px;
  background: var(--surface2); border: 1px solid var(--border);
  position: relative; cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff;
  transition: transform 0.3s var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }

.rem-modes { display: flex; gap: 6px; }
.rem-mode {
  flex: 1; padding: 10px 4px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface2); color: var(--text2);
  font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.rem-mode.active { background: var(--accent); color: #052e12; border-color: var(--accent); }
.rem-days { display: flex; gap: 6px; margin-top: 10px; }
.rem-day {
  flex: 1; aspect-ratio: 1; max-height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text2);
  font-size: 13px; font-weight: 800; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.rem-day.active { background: var(--accent); color: #052e12; border-color: var(--accent); }

/* ── Chips & sélecteurs : transitions douces partout ── */
.mchip, .rchip, .ad-tab, .speed-chip, .tl-tab {
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.mchip:active, .rchip:active, .ad-tab:active, .speed-chip:active { transform: scale(0.95); }

/* ── Calendrier : pop du jour rempli au toucher ── */
.ad-cal-cell.has .ad-cal-num { transition: transform 0.2s var(--ease-spring), background 0.2s; }
.ad-cal-cell.has:active .ad-cal-num { transform: scale(0.85); }

/* ── Inputs : focus ring vert doux ── */
.input-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,222,128,0.12); }

/* ── Historique : touche d'entrée ── */
.hist-item { transition: transform 0.15s var(--ease-spring); }
.hist-item[data-date]:active { transform: scale(0.985); }

/* ── Accessibilité : motion réduite ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════
   V1.7 — premium polish + partage
   ════════════════════════════════════════════════ */

/* ── Accueil : carte résumé (jour de départ → œil : premiers relevés) ── */
.recap-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; text-align: left; width: 100%;
  font-family: inherit; cursor: pointer;
  transition: transform 0.18s var(--ease-spring);
}
.recap-card:active { transform: scale(0.985); }
.recap-start { display: flex; align-items: center; gap: 10px; }
.recap-start .t-ico { width: 32px; height: 32px; }
.recap-start-txt { display: flex; flex-direction: column; line-height: 1.2; }
.recap-start-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text2); }
.recap-start-date { font-size: 17px; font-weight: 800; font-family: var(--font-display); color: var(--text); }
.recap-eye {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent); border-radius: 20px; padding: 7px 13px;
  font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.recap-eye .ic { width: 15px; height: 15px; }

/* Liste « Mes premiers relevés » (œil du résumé) */
.firsts-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.first-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.first-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; color: var(--accent);
  background: linear-gradient(135deg, rgba(74,222,128,0.18), rgba(74,222,128,0.04));
  border: 1px solid rgba(74,222,128,0.22);
}
.first-main { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.first-lbl { font-size: 13.5px; font-weight: 700; color: var(--text); }
.first-date { font-size: 11.5px; color: var(--text2); text-transform: capitalize; }
.first-val { font-size: 16px; font-weight: 800; font-family: var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.first-row.empty .first-ic { color: var(--text2); background: rgba(255,255,255,0.03); border-color: var(--border); }
.first-row.empty .first-date { font-style: italic; }
.first-row.empty .first-val { color: var(--text2); }

/* ── En-tête du graphique : boutons légende + partage ── */
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.chart-head-btns { display: flex; gap: 8px; flex-shrink: 0; }
.chart-icon-btn {
  width: 36px; height: 36px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
  cursor: pointer; transition: transform 0.18s var(--ease-spring), background 0.2s;
}
.chart-icon-btn:active { transform: scale(0.9); background: rgba(74,222,128,0.2); }

/* ── Popup légende du graphique ── */
.legend-rows { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 4px; }
.legend-row { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; color: var(--text); line-height: 1.4; }
.legend-row b { font-weight: 800; }
.legend-row .cl-dot { width: 12px; height: 12px; margin-top: 4px; }
.legend-emo { font-size: 16px; width: 12px; text-align: center; flex-shrink: 0; }
.legend-sep { height: 1px; background: var(--border); margin: 2px 0; }
.cl-dot { border-radius: 50%; flex-shrink: 0; }
.cl-dot.green { background: #4ade80; }
.cl-dot.blue  { background: #3b82f6; }
.cl-dot.grey  { background: #3a3f3c; }

/* Icône dans les boutons d'action génériques (story/pdf/timelapse) */
.ce-ic { display: inline-flex; align-items: center; }
