:root {
  --bg:                #F8F9FA;   /* Nuage — fond principal */
  --bg-card:           #FFFFFF;   /* cartes (blanc pur pour différencier du fond) */
  --bg-soft:           #F1F3F5;   /* sous-arrière-plan léger */
  --fg:                #0B192C;   /* Marine profond — texte principal */
  --fg-soft:           #4B5563;   /* gris dérivé du marine — texte secondaire */
  --accent:            #0066FF;   /* Bleu Piscine — accent principal */
  --accent-soft:       #00C4FF;   /* Cyan Eau claire */
  --accent-pale:       #DBEAFE;   /* bleu très pâle pour chips et highlights */
  --border:            #E5E7EB;   /* gris neutre */
  --border-soft:       #F1F3F5;   /* gris très clair */
  --good:              #22C55E;   /* vert frais moderne */
  --warn:              #FFA951;   /* Pêche — Chaleur estivale */
  --bad:               #FF3B30;   /* Rouge Promo */
  --good-bg:           #DCFCE7;   /* vert très pâle */
  --warn-bg:           #FFEDD5;   /* pêche très pâle */
  --bad-bg:            #FEE2E2;   /* rouge très pâle */
  --radius: 10px;
  --radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0B1220;
    --bg-card:      #131C2E;
    --bg-soft:      #1A2438;
    --fg:           #E5E7EB;
    --fg-soft:      #94A3B8;
    --accent:       #3B82F6;
    --accent-soft:  #38BDF8;
    --accent-pale:  #1E3A8A;
    --border:       #2A3550;
    --border-soft:  #1F2A40;
    --good:         #34D399;
    --warn:         #FBBF24;
    --bad:          #F87171;
    --good-bg:      #064E3B;
    --warn-bg:      #422006;
    --bad-bg:       #450A0A;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 20px 100px;
}

/* ============================================================
   MASTHEAD — bandeau marine pleine largeur, identité v2
   La marque vit ici : marine + cyan, indépendante du mode clair/sombre.
   ============================================================ */
.masthead {
  background: #0B192C;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.masthead-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 3.5vw, 28px) 20px;
}
.masthead-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.masthead-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.masthead-id { flex: 1; min-width: 0; }
.masthead-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00C4FF;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masthead-brand {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(23px, 4vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #FFFFFF;
  margin: 0;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-family: 'Geist Mono', monospace;
  color: rgba(255, 255, 255, 0.6);
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  flex-shrink: 0;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
}

.sync-dot.synced { background: var(--good); }

.cycle-selector-wrap {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}
.cycle-selector-wrap label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9.5px;
  font-weight: 600;
}
.cycle-selector-wrap select {
  font-family: inherit;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  color: #FFFFFF;
  cursor: pointer;
}

/* TABS */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 11px 14px;
  font-family: 'Geist', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.tab:hover { color: var(--fg); background: var(--bg-soft); }

.tab.active {
  color: var(--accent);
  background: transparent;
  border-bottom-color: var(--accent);
  font-weight: 700;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   BOTTOM NAV — mobile uniquement (<768px)
   4 onglets fréquents + menu « Plus » (sheet). Zone du pouce,
   cible tactile ≥ 44px, safe-area iPhone respectée.
   ============================================================ */
.bottom-nav { display: none; }
.more-sheet-backdrop { display: none; }

@media (max-width: 767px) {
  /* Sur mobile, la nav haute disparaît au profit de la bottom-nav */
  .tabs { display: none; }

  /* Place pour la nav fixe (sinon le footer passe dessous) */
  .container { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1800;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 14px rgba(11, 25, 44, 0.07);
    transition: transform 0.2s ease;
  }
  /* Masquée quand un champ texte a le focus (clavier ouvert) */
  .bottom-nav.nav-hidden { transform: translateY(130%); }

  .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 7px 4px 5px;
    border: none;
    background: none;
    color: var(--fg-soft);
    font-family: 'Geist', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
  }
  .bn-item svg { width: 23px; height: 23px; }
  .bn-item.active { color: var(--accent); }
  /* Glyphe « rempli » à l'état actif (signal non-couleur) */
  .bn-item.active svg[fill="none"] { fill: var(--accent-pale); }

  /* Sheet « Plus » — onglets secondaires */
  .more-sheet-backdrop {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1850;
    background: rgba(11, 25, 44, 0.45);
    align-items: flex-end;
    animation: modalFade 0.15s ease;
  }
  .more-sheet-backdrop[hidden] { display: none; }
  .more-sheet {
    width: 100%;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
    animation: sheetUp 0.2s ease;
  }
  .more-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 8px auto 12px;
  }
  .more-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 12px 10px;
    border: none;
    background: none;
    color: var(--fg);
    font-family: 'Geist', sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
  }
  .more-item:active { background: var(--bg-soft); }
  .more-item svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
  .more-item.active { color: var(--accent); font-weight: 600; }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ============================================================
   ÉCRAN DE CHARGEMENT INITIAL — identité marine, logo ripple animé.
   Couvre l'app au démarrage, se masque dès que la sync cloud répond.
   ============================================================ */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #0B192C;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.app-loader-mark {
  width: 64px;
  height: 64px;
  animation: loaderPulse 1.4s ease-in-out infinite;
}
.app-loader-text {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #00C4FF;
  opacity: 0.85;
}
@keyframes loaderPulse {
  0%, 100% { transform: scale(1);    opacity: 0.55; }
  50%      { transform: scale(1.12); opacity: 1; }
}

/* ============================================================
   PROFILS BAIGNEURS — chips de sélection (formulaire) + liste (Config)
   ============================================================ */
.bathers-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bather-chip {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.bather-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.bather-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.bather-row .bather-name { flex: 1; min-width: 0; }
.bather-row .bather-load { width: 72px; flex-shrink: 0; }
.bather-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.bather-add-row #newBatherName { flex: 1; min-width: 0; }
.bather-add-row #newBatherLoad { width: 72px; flex-shrink: 0; }

/* SECTIONS */
.section { margin-bottom: 28px; }

.section-intro {
  font-size: 13px;
  color: var(--fg-soft);
  line-height: 1.5;
  margin-bottom: 14px;
  margin-top: -6px;
}

.section-title {
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
  color: var(--accent);
  position: relative;
  padding-left: 16px;
  display: inline-flex;
  align-items: center;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.section-intro,
.section-hint {
  display: block;
  clear: both;
}

.section-hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-soft);
  margin: -8px 0 18px 0;
  max-width: 65ch;
}
.section-hint em {
  font-style: normal;
  font-weight: 600;
  color: var(--fg);
}

.history-search {
  width: 100%;
  font-family: 'Geist', sans-serif;
  font-size: 13.5px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--fg);
  margin-bottom: 14px;
}
.history-search::placeholder {
  color: var(--fg-soft);
  opacity: 0.8;
}

/* TOAST */
.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
  max-width: 90vw;
  width: 360px;
}
.toast {
  background: var(--fg);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 6px 24px rgba(0,0,0,0.16);
  pointer-events: auto;
  animation: toastIn 0.18s ease;
  border-left: 4px solid var(--accent);
}
.toast.success { border-left-color: var(--good); }
.toast.warn    { border-left-color: var(--warn); }
.toast.error   { border-left-color: var(--bad); }
.toast.hide { animation: toastOut 0.18s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* MODALE DE CONFIRMATION */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 44, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1900;
  padding: 16px;
  animation: modalFade 0.15s ease;
}
.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22);
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
}
.modal-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg-soft);
  margin-bottom: 20px;
  white-space: pre-line;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-btn {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}
.modal-btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.modal-btn.danger {
  background: var(--bad);
  color: white;
  border-color: var(--bad);
}
@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.backup-row, .calib-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.calib-actions { margin-bottom: 0; }
.backup-stat-line {
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: var(--fg-soft);
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
}

/* CALENDRIER ENTRETIEN */
.maint-calendar-item {
  padding: clamp(14px, 2vw, 18px);
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
}
.maint-calendar-item::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: transparent;
}
.maint-calendar-item.good::before { background: var(--good); }
.maint-calendar-item.warn::before { background: var(--warn); }
.maint-calendar-item.bad::before  { background: var(--bad); }

.maint-cal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.maint-cal-label {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: var(--fg);
}
.maint-cal-status {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  white-space: nowrap;
}
.maint-calendar-item.good .maint-cal-status { color: var(--good); }
.maint-calendar-item.warn .maint-cal-status { color: var(--warn); }
.maint-calendar-item.bad  .maint-cal-status { color: var(--bad); }
.maint-cal-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-soft);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* CARTE DÉRIVE */
.drift-card {
  padding: clamp(16px, 3vw, 22px);
  margin-bottom: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.drift-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.drift-stamp {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.drift-card.warn .drift-stamp { color: var(--warn); }
.drift-card.bad  .drift-stamp { color: var(--bad); }
.drift-status {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--fg-soft);
  letter-spacing: 0.02em;
}

.drift-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.drift-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}
.drift-param {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.drift-item.bad .drift-param { color: var(--bad); }
.drift-item.warn .drift-param { color: var(--warn); }
.drift-detail {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-soft);
  text-align: right;
  letter-spacing: 0.01em;
}
.drift-detail strong {
  font-weight: 600;
  color: var(--fg);
}
.drift-tip {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-style: italic;
  color: var(--fg-soft);
  line-height: 1.4;
}

/* TENDANCES */
.trends-controls {
  margin-bottom: 22px;
}
.trend-range-row {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.trend-range-btn {
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--fg-soft);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
  min-height: 36px;
}
.trend-range-btn:hover { color: var(--fg); }
.trend-range-btn.active {
  background: var(--bg-card);
  color: var(--accent);
}

.trend-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 22px);
  margin-bottom: 16px;
}
.trend-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.trend-card-title {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}
.trend-card-summary {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--fg-soft);
  letter-spacing: 0.02em;
}
.trend-card-summary strong {
  font-weight: 600;
  color: var(--fg);
}
.trend-canvas-wrap {
  position: relative;
  width: 100%;
  height: 200px;
}
.trend-empty {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--fg-soft);
  text-align: center;
  padding: clamp(40px, 6vw, 64px) 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.5;
}

/* OVERVIEW — refonte magazine de données v1.1 */
.overview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 26px);
  margin-bottom: 14px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 20px) clamp(12px, 2.5vw, 28px);
}

.metric {
  padding: 0;
  min-width: 0;
}
.metric-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.metric-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-soft);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.metric-dot.good { background: var(--good); }
.metric-dot.warn { background: var(--warn); }
.metric-dot.bad  { background: var(--bad); }
.metric-dot.na   { background: transparent; border: 1px dashed var(--fg-soft); }

.metric-number {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(21px, 4.5vw, 28px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  margin-bottom: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-unit {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-soft);
  margin-left: 4px;
  letter-spacing: 0;
  white-space: nowrap;
}

.metric-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.metric-spark {
  display: block;
  flex-shrink: 0;
}
.metric-target {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: var(--fg-soft);
  letter-spacing: 0;
  white-space: nowrap;
}

/* CYA TRACKER */
.cya-tracker {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--fg-soft);
  margin-top: 16px;
}

.cya-tracker strong {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--fg);
  margin: 0 4px;
}

.cya-bar {
  width: 100%;
  height: 3px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--border-soft);
}

.cya-fill {
  height: 100%;
  background: linear-gradient(to right, var(--good) 0%, var(--good) 30%, var(--warn) 50%, var(--bad) 100%);
  transition: width 0.5s ease;
}

/* ANALYSE (encadré) */
.analysis {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 22px;
  position: relative;
}

.analysis-stamp {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.analysis-body {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.45;
  color: var(--fg);
  letter-spacing: -0.005em;
}

/* RECOMMENDATIONS */
.recs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
}

/* Zone Avis : visuellement distincte (fond plus tamisé, accent sourd) pour
   qu'on ne confonde plus avec les actions cochables. */
.recs.recs-notices {
  background: var(--bg-soft);
  border-style: dashed;
}

.rec-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: clamp(16px, 2vw, 22px) 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

.rec-item:hover .rec-num { color: var(--fg); }
.rec-item:last-child { border-bottom: none; padding-bottom: 6px; }
.rec-item:first-child { padding-top: 6px; }

.rec-item.done { opacity: 0.45; }
.rec-item.done .rec-num { color: var(--good); }
.rec-item.done .rec-action { text-decoration: line-through; text-decoration-thickness: 1px; }

.rec-checkbox {
  appearance: none;
  -webkit-appearance: none;
  /* padding: 0 obligatoire — la règle globale input { padding: 12px 14px }
     gonflerait la boîte au-delà des 22px déclarés (border-box ne peut pas
     avoir un content négatif) et rendrait le cercle ovale. */
  padding: 0;
  width: 22px;
  height: 22px;
  /* Centré verticalement sur la première ligne de .rec-action :
     (line-height 21px - 22px) / 2 ≈ 0. Le 1px corrige le rendu visuel
     du cercle qui paraît descendu de 1px à cause de l'optical balance. */
  margin: -1px 0 0 0;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.rec-checkbox:hover { border-color: var(--accent-soft); }
.rec-checkbox:checked {
  background: var(--good);
  border-color: var(--good);
}
.rec-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 7px;
  height: 12px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Reco "notice" — info non actionable (pas de case à cocher).
   On garde le même layout que .rec-item mais on remplace la zone checkbox
   par une pastille discrète et un curseur normal. */
.rec-item.rec-notice {
  cursor: default;
}
.rec-item.rec-notice::before {
  content: 'i';
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--fg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: -1px;
}

.rec-num {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--fg-soft);
  font-weight: 600;
  min-width: 26px;
  /* Aligner la baseline du chiffre sur la première ligne de .rec-action
     (Geist 15.5px / line-height 1.35 → baseline à ~17px du top). */
  padding-top: 5px;
  letter-spacing: 0.05em;
}

.rec-content { flex: 1; }

.rec-action {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 15.5px;
  line-height: 1.35;
  margin-bottom: 6px;
  color: var(--fg);
}

.rec-detail {
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: var(--fg-soft);
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.rec-wait {
  margin-top: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.rec-wait::before { content: ''; }
.rec-wait::before { content: '⏱  '; }

/* ============================================================
   HERO VERDICT — premier bloc du Tableau (v2)
   Répond à « je peux me baigner ? » + la prochaine action.
   ============================================================ */
.hero {
  padding: clamp(22px, 4vw, 34px);
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.hero.ok, .hero.good        { background: var(--good-bg); border-color: transparent; }
.hero.caution, .hero.warn   { background: var(--warn-bg); border-color: transparent; }
.hero.unsafe, .hero.bad     { background: var(--bad-bg);  border-color: transparent; }

.hero-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-soft);
  font-weight: 600;
  margin-bottom: 16px;
}
.hero-verdict {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 16px);
  margin-bottom: 6px;
}
.hero-glyph {
  width: clamp(30px, 6vw, 42px);
  height: clamp(30px, 6vw, 42px);
  flex-shrink: 0;
}
.hero.ok .hero-glyph,      .hero.good .hero-glyph { color: var(--good); }
.hero.caution .hero-glyph, .hero.warn .hero-glyph { color: var(--warn); }
.hero.unsafe .hero-glyph,  .hero.bad .hero-glyph  { color: var(--bad); }
.hero.na .hero-glyph { color: var(--fg-soft); }
.hero-label {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(28px, 7vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--fg);
}
.hero.ok .hero-label,      .hero.good .hero-label { color: var(--good); }
.hero.caution .hero-label, .hero.warn .hero-label { color: var(--warn); }
.hero.unsafe .hero-label,  .hero.bad .hero-label  { color: var(--bad); }

.hero-issues {
  margin: 10px 0 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--fg);
  line-height: 1.55;
}
.hero-issues li { margin-bottom: 3px; }

.hero-next {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.hero-next-eyebrow {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.hero-next-action {
  font-family: 'Geist', sans-serif;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.4;
}
.hero-next-wait {
  margin-top: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.hero-next-more {
  margin-top: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-soft);
  letter-spacing: 0.02em;
}
.hero-next.none {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--fg-soft);
}

/* PLAN DU JOUR — projection quotidienne entre deux tests */
.plan-card {
  padding: clamp(16px, 3vw, 22px);
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.plan-card.good { border-left: 3px solid var(--good); }
.plan-card.warn { border-left: 3px solid var(--warn); }
.plan-card.bad  { border-left: 3px solid var(--bad); }
.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.plan-stamp {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--accent);
}
.plan-conf {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.plan-conf.good { color: var(--good); }
.plan-conf.warn { color: var(--warn); }
.plan-conf.bad  { color: var(--bad); }
.plan-preds {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 14px;
}
.plan-pred { display: flex; flex-direction: column; gap: 2px; }
.plan-pred-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
  font-weight: 600;
}
.plan-pred-val {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
}
.plan-actions {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg);
}
.plan-actions strong { font-weight: 600; }
.plan-none {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--fg-soft);
}
.plan-reminder {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
}

/* TEST RAPIDE — saisie quotidienne 2 champs sur le Tableau */
.quicktest {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.quicktest-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-soft);
  font-weight: 600;
  flex-shrink: 0;
}
.quicktest-fields {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}
.quicktest-fields input {
  flex: 1 1 0;
  width: auto;
  padding: 9px 10px;
  font-size: 15px;
  min-width: 0;
}
.btn.quicktest-btn {
  width: auto;
  min-height: 40px;
  padding: 9px 16px;
  flex-shrink: 0;
  font-size: 12.5px;
}

/* ACCORDÉONS DU TABLEAU */
.dash-details {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}
.dash-details summary {
  list-style: none;
  cursor: pointer;
  padding: 16px clamp(16px, 3vw, 22px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-soft);
  font-weight: 600;
  user-select: none;
  transition: color 0.15s;
}
.dash-details summary:hover { color: var(--fg); }
.dash-details summary::-webkit-details-marker { display: none; }
.dash-details summary::after {
  content: '+';
  font-size: 17px;
  font-weight: 400;
  color: var(--fg-soft);
  line-height: 1;
}
.dash-details[open] summary::after { content: '−'; }
.dash-details-body {
  padding: 4px clamp(14px, 2.5vw, 18px) 14px;
}
.dash-details-body > :last-child { margin-bottom: 0; }

/* LSI (Langelier Saturation Index) — équilibre corrosion/entartrage */
.lsi-card {
  padding: clamp(16px, 3vw, 22px);
  margin-bottom: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.lsi-projected {
  font-size: 11px;
  color: var(--fg-soft);
  font-weight: 400;
  font-family: 'Geist Mono', monospace;
  font-style: italic;
}

.lsi-value {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(28px, 4.5vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  margin-bottom: 10px;
  display: inline-block;
}
.lsi-card.good .lsi-value { color: var(--good); }
.lsi-card.warn .lsi-value { color: var(--warn); }
.lsi-card.bad  .lsi-value { color: var(--bad); }

.lsi-body { }
.lsi-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  display: block;
}
.lsi-card.good .lsi-label { color: var(--good); }
.lsi-card.warn .lsi-label { color: var(--warn); }
.lsi-card.bad  .lsi-label { color: var(--bad); }
.lsi-detail {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

/* ============================================================
   SYSTÈME DE CARTES ÉDITORIALES (v1.1)
   Pattern unifié : eyebrow coloré au statut + headline Fraunces
   + corps Fraunces italic + inserts internes subtils
   ============================================================ */

.reservoir-card,
.bath-card,
.prebath-card {
  padding: clamp(16px, 3vw, 22px);
  margin-bottom: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

/* Header : eyebrow gauche + statut/timestamp droite */
.reservoir-header,
.bath-header,
.prebath-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

/* Stamp (eyebrow) : Geist Mono, statut-colorisé */
.reservoir-stamp,
.bath-stamp,
.prebath-stamp {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--accent);
}
.reservoir-card.good .reservoir-stamp,
.bath-card.good .bath-stamp { color: var(--good); }
.reservoir-card.warn .reservoir-stamp,
.bath-card.warn .bath-stamp { color: var(--warn); }
.reservoir-card.bad .reservoir-stamp,
.bath-card.bad .bath-stamp { color: var(--bad); }

/* Status / timestamp à droite */
.reservoir-status,
.bath-status,
.prebath-when {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--fg-soft);
  letter-spacing: 0.02em;
}

/* Valeur principale : Fraunces large */
.reservoir-value {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(28px, 4.5vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  margin-bottom: 14px;
}
.reservoir-unit {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-soft);
  margin-left: 4px;
  letter-spacing: 0;
}

/* Barre de progression */
.reservoir-bar {
  position: relative;
  height: 4px;
  background: var(--bg-soft);
  border-radius: 2px;
  overflow: visible;
  margin-bottom: 10px;
}
.reservoir-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.reservoir-bar-fill.good { background: var(--good); }
.reservoir-bar-fill.warn { background: var(--warn); }
.reservoir-bar-fill.bad  { background: var(--bad); }
.reservoir-bar-mark {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 10px;
  background: var(--fg-soft);
  opacity: 0.3;
}

/* Meta technique : mono compact */
.reservoir-meta,
.bath-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--fg-soft);
  margin-bottom: 14px;
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.bath-meta {
  font-family: 'Geist', sans-serif;
  font-size: 13.5px;
  color: var(--fg);
  letter-spacing: 0;
}

/* Bloc projection (chiffres) */
.bath-projection {
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: var(--fg);
  background: var(--bg-soft);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  line-height: 1.7;
}
.bath-proj-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  font-family: 'Geist Mono', monospace;
  margin-right: 4px;
}
.bath-proj-detail {
  color: var(--fg-soft);
  font-size: 10.5px;
  font-family: 'Geist Mono', monospace;
}

/* Bloc reco / action interne */
.reservoir-action,
.bath-reco {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.reservoir-action-label,
.bath-reco-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
  font-weight: 600;
}
.reservoir-action-value,
.bath-reco-value {
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.reservoir-action-detail,
.bath-reco-detail {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-soft);
  letter-spacing: 0.01em;
}

/* Tip Fraunces italique sous la carte */
.reservoir-tip {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--fg);
  line-height: 1.45;
  letter-spacing: -0.005em;
}

/* === Plan pré-bain (cartes spéciales avec phases) === */
.prebath-meta {
  font-family: 'Geist', sans-serif;
  font-size: 13.5px;
  color: var(--fg);
  margin-bottom: 12px;
  line-height: 1.4;
}
.prebath-projection {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--fg-soft);
  background: var(--bg-soft);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}
.prebath-proj-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.prebath-proj-sep {
  margin: 0 6px;
  opacity: 0.35;
}

.prebath-section {
  margin-bottom: 14px;
}
.prebath-section:last-child {
  margin-bottom: 0;
}
.prebath-section-title {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.prebath-action {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.prebath-action-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.prebath-action-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  font-weight: 600;
}
.prebath-action-value {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  text-align: right;
}
.prebath-action-detail {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-soft);
  letter-spacing: 0.01em;
}

.rec-empty {
  font-style: italic;
  font-family: 'Fraunces', serif;
  font-size: 17px;
  color: var(--fg-soft);
  text-align: center;
  padding: 24px 16px;
}

/* FORM */
/* MODE TAYLOR K-2006 */
.taylor-toggle-row { margin-bottom: 14px; }

.taylor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.taylor-intro {
  font-size: 13px;
  color: var(--fg-soft);
  line-height: 1.5;
  margin-bottom: 14px;
}

.taylor-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.taylor-picks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}
.taylor-picks input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 3px;
  -webkit-appearance: checkbox;
  appearance: checkbox;
  flex-shrink: 0;
}
.taylor-pick-hint {
  font-size: 10px;
  color: var(--fg-soft);
  font-family: 'Geist Mono', monospace;
  margin-left: 4px;
}

.taylor-test {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.taylor-test-num {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  padding-top: 2px;
  flex-shrink: 0;
}

.taylor-test-body { flex: 1; }

.taylor-test-title {
  margin: 0 0 10px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg);
  font-weight: 600;
}

.taylor-steps {
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 14px 18px;
  padding: 0;
  color: var(--fg);
}
.taylor-steps li { margin-bottom: 4px; }

.taylor-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.taylor-input-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  font-family: 'Geist Mono', monospace;
  flex-shrink: 0;
}

.taylor-input-row input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 14px;
  outline: none;
  min-width: 60px;
}

.taylor-preview {
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  min-width: 90px;
  text-align: right;
}

.taylor-note {
  font-size: 11px;
  font-style: italic;
  color: var(--fg-soft);
  margin-top: 6px;
  font-family: 'Geist Mono', monospace;
}

.taylor-warn {
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg);
  background: color-mix(in srgb, var(--warn) 12%, var(--bg-soft));
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  margin-top: 10px;
  border-radius: 4px;
}

.taylor-warn-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--warn);
  margin-right: 6px;
}

.taylor-finish {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-soft);
  font-weight: 600;
  margin-bottom: 8px;
}

input, select, textarea {
  font-family: 'Geist', sans-serif;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--fg);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Chiffres en mono pour lisibilité */
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  font-family: 'Geist Mono', monospace;
}

select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6967' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
}

textarea {
  font-family: 'Geist', sans-serif;
  resize: vertical;
  min-height: 60px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--fg); border-color: var(--fg); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-soft);
  border-color: var(--fg-soft);
}

/* EDIT BANNER */
.edit-banner {
  background: var(--accent-pale);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.edit-banner a {
  color: var(--bad);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  font-weight: 600;
  cursor: pointer;
}

/* HISTORY ACTIONS — boutons Modifier/Supprimer */
.history-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.hist-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 11px;
  font-family: 'Geist Mono', monospace;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--fg-soft);
  transition: all 0.15s;
  min-height: 32px;
}

.hist-btn:hover { color: var(--accent); border-color: var(--accent); }
.hist-btn.delete:hover { color: var(--bad); border-color: var(--bad); }

/* HISTORY ITEM — pattern éditorial unifié */
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 2.5vw, 20px);
  margin-bottom: 10px;
  cursor: default;
  transition: border-color 0.15s;
}

.history-item:hover { border-color: var(--fg-soft); }

.history-date {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-soft);
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-treated {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--good-bg);
  color: var(--good);
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Geist Mono', monospace;
}

.history-item.treated { border-color: var(--good); }

.history-values {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: baseline;
}

.history-value {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--fg);
}
.history-value strong {
  font-weight: 600;
}

.history-value-label {
  font-family: 'Geist Mono', monospace;
  color: var(--fg-soft);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-right: 6px;
}

.history-notes {
  margin-top: 12px;
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  color: var(--fg-soft);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

/* INVENTAIRE */
.inv-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 2.5vw, 20px);
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.inv-item:hover { border-color: var(--fg-soft); }
.inv-item.low {
  border-color: var(--warn);
  background: var(--warn-bg);
}

.inv-name {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.25;
}

.inv-low-badge {
  background: var(--warn);
  color: white;
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Geist Mono', monospace;
}

.inv-fields {
  display: flex;
  gap: 14px;
}

.inv-field { flex: 1; }
.inv-field label {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
  font-weight: 600;
  margin-bottom: 6px;
}

.inv-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  transition: border-color 0.15s;
}
.inv-input-row:focus-within { border-color: var(--accent); }
.inv-input-row input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Geist Mono', monospace;
  font-size: 14px;
  outline: none;
  width: 100%;
  padding: 4px 0;
}
.inv-unit {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--fg-soft);
  letter-spacing: 0.02em;
}

/* CYCLES ARCHIVÉS */
.cycle-archive-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 2.5vw, 20px);
  margin-bottom: 10px;
}
.cycle-archive-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(17px, 2vw, 20px);
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--fg);
  margin-bottom: 6px;
}
.cycle-archive-dates {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-soft);
  font-weight: 600;
  margin-bottom: 8px;
}
.cycle-archive-stats {
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: var(--fg-soft);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

/* EMPTY STATE */
.empty {
  text-align: center;
  padding: clamp(48px, 8vw, 72px) 20px;
  color: var(--fg-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--fg);
}

.empty-text {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  max-width: 380px;
  margin: 0 auto;
  color: var(--fg-soft);
}

/* DECORATIVE */
.divider-ornament {
  text-align: center;
  font-family: 'Geist Mono', monospace;
  color: var(--border);
  font-size: 14px;
  letter-spacing: 0.3em;
  margin: 28px 0 18px;
  letter-spacing: 0.5em;
}

/* FOOTER */
.footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-family: 'Geist Mono', monospace;
  color: var(--fg-soft);
  text-align: center;
}

.footer-note {
  font-style: italic;
  font-family: 'Fraunces', serif;
  margin-top: 6px;
  font-size: 12px;
}
