/* ============================================================================
   Mon Impact — Design System
   Palette French Thermic : pétrole, terracotta, crème, ambre
   ============================================================================ */

/* --- Fontes locales --- */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Variables CSS --- */
:root {
  --petrole: #0A5C63;
  --petrole-light: rgba(10, 92, 99, 0.10);
  --petrole-medium: rgba(10, 92, 99, 0.20);
  --terracotta: #D9612F;
  --vert: #2d7d46;
  --terracotta-light: rgba(217, 97, 47, 0.12);
  --creme: #FDF8F0;
  --creme-dark: #F5EDE0;
  --ambre: #C99B3F;
  --ambre-light: rgba(201, 155, 63, 0.12);
  --blanc: #FFFFFF;
  --texte: #2C2C2C;
  --texte-secondaire: #6B6B6B;
  --vert: #2E8B57;
  --vert-light: rgba(46, 139, 87, 0.12);
  --rouge: #C0392B;
  --rouge-light: rgba(192, 57, 43, 0.10);

  --font-titre: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-corps: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
  --transition: 300ms ease-out;
  --transition-fast: 150ms ease-out;

  --header-height: 64px;
  --sticky-height: 80px;
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-corps);
  background: var(--creme);
  color: var(--texte);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #064B56;
  color: var(--creme);
  padding: 0 10px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.3s ease-out;
}
.header.header--hidden {
  transform: translateY(-100%);
}
.header__logo-wide {
  height: 40px;
  width: auto;
  max-width: 70%;
  display: block;
}
.header__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.header__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.header__btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--creme);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.header__btn:hover, .header__btn:active {
  background: rgba(255,255,255,0.25);
}

/* --- Navigation tabs --- */
.nav-themes {
  display: flex;
  gap: 0;
  background: var(--blanc);
  border-bottom: 1px solid var(--creme-dark);
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: top 0.3s ease-out;
}
.header.header--hidden ~ .nav-themes {
  top: 0;
}
.nav-themes::-webkit-scrollbar { display: none; }
.nav-themes__btn {
  flex: 0 0 auto;
  border: none;
  background: none;
  padding: 10px 14px;
  font-family: var(--font-corps);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--texte-secondaire);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}
.nav-themes__btn:hover {
  background: var(--creme);
}
.nav-themes__btn.active {
  color: var(--petrole);
  background: var(--petrole-light);
}
.nav-themes__btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 3px;
  background: var(--terracotta);
  border-radius: 3px 3px 0 0;
}

/* --- Sticky totals banner --- */
.sticky-totals {
  position: sticky;
  top: calc(var(--header-height) + 42px);
  z-index: 80;
  background: linear-gradient(180deg, var(--blanc) 0%, var(--creme) 100%);
  border-bottom: 1px solid var(--creme-dark);
  padding: 8px 16px;
  display: flex;
  justify-content: space-around;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: top 0.3s ease-out;
}
.header.header--hidden ~ .nav-themes ~ .sticky-totals,
.header.header--hidden ~ .sticky-totals {
  top: 42px;
}
.sticky-totals__item {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sticky-totals__value {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  transition: all var(--transition);
}
.sticky-totals__value.co2 { color: var(--terracotta); }
.sticky-totals__value.eau { color: var(--petrole); }
.sticky-totals__value.energie { color: var(--ambre); }
.sticky-totals__label {
  font-size: 0.6rem;
  color: var(--texte-secondaire);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}
.sticky-totals__sp {
  cursor: help;
  font-size: 0.7rem;
  line-height: 1;
}

/* --- Main content --- */
.main {
  padding: 16px;
  padding-bottom: 100px;
  max-width: 800px;
  margin: 0 auto;
}
.theme-page {
  display: none;
}
.theme-page.active {
  display: block;
}

/* --- Theme page header --- */
.theme-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.theme-header__icon {
  font-size: 1.8rem;
}
.theme-header__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--petrole);
}

/* --- Theme sections --- */
.theme-section {
  margin-bottom: 28px;
}
.theme-section__title {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 1rem;
  color: var(--terracotta);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--terracotta);
  display: inline-block;
}

/* --- Comparateur group within theme --- */
.comparateur-group {
  margin-bottom: 20px;
}
.comparateur-group__title {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--petrole);
  margin-bottom: 10px;
  padding-left: 2px;
  opacity: 0.8;
}

/* --- Category section --- */
.category {
  margin-bottom: 24px;
}
.category__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 0;
}
.category__icon {
  font-size: 1.3rem;
}
.category__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--petrole);
}

/* --- Action card --- */
.action-card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  border-left: 3px solid var(--petrole);
}
.action-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.action-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.action-card__title {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--petrole);
}
.action-card__impacts {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.impact-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}
.impact-badge__value {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1rem;
  transition: all var(--transition);
}
.impact-badge__value.co2 { color: var(--terracotta); }
.impact-badge__value.eau { color: var(--petrole); }
.impact-badge__value.energie { color: var(--ambre); }
.impact-badge__unit {
  font-size: 0.6rem;
  color: var(--texte-secondaire);
  text-transform: uppercase;
}

/* --- Curseurs --- */
.curseurs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.curseur-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.curseur-group__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.curseur-group__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texte);
}
.curseur-group__value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--petrole);
  min-width: 60px;
  text-align: right;
}

/* Range slider — gros et tactile */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--creme-dark);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--petrole);
  border: 2px solid var(--blanc);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--petrole);
  border: 2px solid var(--blanc);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer;
}
input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--creme-dark);
  border-radius: 3px;
}

/* Select */
.curseur-select {
  font-family: var(--font-corps);
  font-size: 0.8rem;
  padding: 8px 12px;
  border: 1.5px solid var(--creme-dark);
  border-radius: var(--radius-xs);
  background: var(--blanc);
  color: var(--texte);
  cursor: pointer;
  width: 100%;
  transition: border-color var(--transition-fast);
}
.curseur-select:focus {
  outline: none;
  border-color: var(--petrole);
}

/* --- Détail dépliable --- */
.detail-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--texte-secondaire);
  font-size: 0.75rem;
  font-family: var(--font-corps);
  cursor: pointer;
  transition: color var(--transition-fast);
}
.detail-toggle:hover {
  color: var(--petrole);
}
.detail-toggle__arrow {
  transition: transform var(--transition);
  font-size: 0.6rem;
}
.detail-toggle.open .detail-toggle__arrow {
  transform: rotate(90deg);
}
.detail-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease-out, opacity 300ms ease-out;
  opacity: 0;
}
.detail-panel.open {
  max-height: 2000px;
  opacity: 1;
}
.detail-panel__content {
  padding: 12px;
  margin-top: 8px;
  background: var(--creme);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.6;
}
.detail-panel__section {
  margin-bottom: 10px;
}
.detail-panel__section:last-child {
  margin-bottom: 0;
}
.detail-panel__title {
  font-weight: 600;
  color: var(--petrole);
  margin-bottom: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-panel__text {
  color: var(--texte-secondaire);
  white-space: pre-line;
}

/* --- ACV bar --- */
.acv-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
  background: var(--creme-dark);
}
.acv-bar__segment {
  height: 100%;
  transition: width var(--transition);
}
.acv-bar__segment--fabrication { background: var(--terracotta); }
.acv-bar__segment--transport { background: var(--ambre); }
.acv-bar__segment--usage { background: var(--petrole); }
.acv-bar__segment--fin_de_vie { background: var(--texte-secondaire); }

.acv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.acv-legend__item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: var(--texte-secondaire);
}
.acv-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Bouton réinitialiser --- */
/* --- Trajets dynamiques --- */
.trajets-section { margin-top: 10px; }
.trajets-empty {
  text-align: center; padding: 12px 0; color: var(--texte-secondaire);
  font-size: 0.8rem; font-style: italic;
}
.trajet-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--creme-dark);
}
.trajet-km {
  width: 80px; padding: 6px 8px; border: 1px solid var(--creme-dark);
  border-radius: var(--radius-xs); background: var(--blanc); color: var(--texte);
  font-family: var(--font-corps); font-size: 0.85rem; text-align: right;
}
.trajet-km:focus { border-color: var(--petrole); outline: none; }
.trajet-times {
  color: var(--texte-secondaire); font-size: 0.85rem; flex-shrink: 0;
}
.trajet-pers {
  padding: 6px 8px; border: 1px solid var(--creme-dark);
  border-radius: var(--radius-xs); background: var(--blanc); color: var(--texte);
  font-family: var(--font-corps); font-size: 0.85rem;
}
.trajet-del {
  background: none; border: none; color: var(--texte-secondaire);
  font-size: 1rem; cursor: pointer; padding: 2px 6px; line-height: 1;
}
.trajet-del:hover { color: var(--terracotta); }
.trajet-add {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-top: 8px; padding: 8px 0;
  border: 1px dashed var(--creme-dark); border-radius: var(--radius-xs);
  background: transparent; color: var(--petrole); cursor: pointer;
  font-family: var(--font-corps); font-size: 0.85rem; font-weight: 600;
}
.trajet-add:hover { border-color: var(--petrole); background: rgba(10,92,99,0.05); }

/* Bandeau gain vs voiture */
.gain-vs-voiture {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(109, 216, 151, 0.12);
  border-left: 3px solid #6dd897;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  color: var(--texte);
  line-height: 1.4;
}
.gain-vs-voiture:empty { display: none; }
.gain-vs-voiture strong { color: #2a9d5c; }
.gain-vs-voiture__icon { margin-right: 4px; }

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--creme-dark);
  border-radius: var(--radius-xs);
  background: var(--blanc);
  color: var(--texte-secondaire);
  font-family: var(--font-corps);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-reset:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

/* ============================================================================
   MODE TEMPORALITÉ
   ============================================================================ */
.temporalite {
  padding-top: 8px;
}

.temporalite__selector {
  display: flex;
  background: var(--creme-dark);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
}
.temporalite__btn {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: none;
  font-family: var(--font-corps);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texte-secondaire);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.temporalite__btn.active {
  background: var(--blanc);
  color: var(--petrole);
  box-shadow: var(--shadow);
}

/* Bilan annuel */
.bilan-annuel {
  background: linear-gradient(135deg, #074B51 0%, var(--petrole) 40%, #0B6E77 100%);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 20px;
  color: var(--blanc);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(10, 92, 99, 0.25);
}
.bilan-annuel__header {
  font-family: var(--font-titre);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 6px;
}
.bilan-annuel__value {
  font-family: var(--font-titre);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.1;
}
.bilan-annuel__unit {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.8;
  margin-left: 4px;
}
.bilan-annuel__jauge {
  margin: 14px auto 0;
  max-width: 360px;
}
.bilan-annuel__bar {
  height: 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  position: relative;
  overflow: visible;
  display: flex;
}
.bilan-annuel__bar-seg {
  height: 100%;
  transition: width 400ms ease-out;
}
.bilan-annuel__bar-seg--gestes { border-radius: 6px 0 0 6px; overflow: hidden; }
.bilan-annuel__bar-seg--sp-cible { background: #8ec5c9; }
.bilan-annuel__bar-seg--sp-delta {
  background: repeating-linear-gradient(
    -45deg,
    #5a9ea4,
    #5a9ea4 3px,
    #3d7f85 3px,
    #3d7f85 6px
  );
  border-radius: 0 6px 6px 0;
}
.bilan-annuel__bar-fill--green { background: #6dd897; }
.bilan-annuel__bar-fill--orange { background: #f0b453; }
.bilan-annuel__bar-fill--red { background: #e86c5a; }
.bilan-annuel__markers {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.65rem;
  opacity: 0.7;
}
.bilan-annuel__marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  background: rgba(255,255,255,0.6);
  border-radius: 1px;
}
.bilan-annuel__marker-label {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  white-space: nowrap;
  opacity: 0.7;
}
.bilan-annuel__legende {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  font-size: 0.7rem;
  opacity: 0.9;
}
.bilan-annuel__leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.bilan-annuel__leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.bilan-annuel__leg-dot--gestes { background: #f0b453; }
.bilan-annuel__leg-dot--sp-cible { background: #8ec5c9; }
.bilan-annuel__leg-dot--sp-delta {
  background: repeating-linear-gradient(
    -45deg,
    #5a9ea4,
    #5a9ea4 2px,
    #3d7f85 2px,
    #3d7f85 4px
  );
}
.bilan-annuel__sp-explain {
  margin-top: 10px;
  font-size: 0.68rem;
  opacity: 0.7;
  line-height: 1.45;
  text-align: center;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}
.bilan-annuel__sp-explain strong { opacity: 1; }
.bilan-annuel__services {
  margin-top: 12px;
  font-size: 0.7rem;
  opacity: 0.75;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.bilan-annuel__services-badge {
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
}
.bilan-annuel__verdict {
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Jauges */
.jauges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.jauge-card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--creme-dark);
  transition: transform var(--transition);
}
.jauge-card:hover {
  transform: translateY(-2px);
}
.jauge-card__value {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.6rem;
  transition: all var(--transition);
}
.jauge-card__value.co2 { color: var(--terracotta); }
.jauge-card__value.eau { color: var(--petrole); }
.jauge-card__value.energie { color: var(--ambre); }
.jauge-card__unit {
  font-size: 0.7rem;
  color: var(--texte-secondaire);
  margin-top: 2px;
}
.jauge-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--texte);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.jauge-card__bar {
  height: 6px;
  background: var(--creme-dark);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
  position: relative;
}
.jauge-card__bar--flex {
  display: flex;
  overflow: visible;
}
.jauge-card__seg {
  height: 100%;
  transition: width var(--transition);
}
.jauge-card__seg--gestes {
  background: var(--terracotta);
  border-radius: 3px 0 0 3px;
}
.jauge-card__seg--sp-cible { background: #8ec5c9; }
.jauge-card__seg--sp-delta {
  background: repeating-linear-gradient(135deg, #5a9ea4, #5a9ea4 2px, #3d7f85 2px, #3d7f85 4px);
  border-radius: 0 3px 3px 0;
}
.jauge-card__fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition);
}
.jauge-card__fill.co2 { background: var(--terracotta); }
.jauge-card__fill.eau { background: var(--petrole); }
.jauge-card__fill.energie { background: var(--ambre); }
.jauge-card__marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--texte);
  border-radius: 1px;
}
.jauge-card__marker-label {
  position: absolute;
  top: -16px;
  font-size: 0.55rem;
  color: var(--texte-secondaire);
  white-space: nowrap;
  transform: translateX(-50%);
}

/* Donut chart */
.donut-section {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--creme-dark);
}
.donut-section__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--petrole);
  margin-bottom: 16px;
}
.donut-container {
  display: flex;
  align-items: center;
  gap: 16px;
}
.donut-svg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}
.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.donut-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: background var(--transition-fast);
}
.donut-legend__item:hover {
  background: var(--creme);
}
.donut-legend__color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.donut-legend__label {
  flex: 1;
}
.donut-legend__value {
  font-weight: 600;
  color: var(--petrole);
}

/* Vecteurs énergie */
.vecteurs-section {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--creme-dark);
}
.vecteur-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.vecteur-bar__label {
  width: 90px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--texte);
  flex-shrink: 0;
}
.vecteur-bar__track {
  flex: 1;
  height: 16px;
  background: var(--creme-dark);
  border-radius: 8px;
  overflow: hidden;
}
.vecteur-bar__fill {
  height: 100%;
  border-radius: 8px;
  transition: width var(--transition);
  background: var(--ambre);
}
.vecteur-bar__value {
  width: 70px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: right;
  color: var(--texte-secondaire);
}

/* Équivalences */
.equivalences {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--creme-dark);
}
.equivalences__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--petrole);
  margin-bottom: 12px;
}
.equivalence-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.85rem;
}
.equivalence-item__icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
}
.equivalence-item__value {
  font-weight: 600;
  color: var(--petrole);
}

/* Scénarios "Et si" */
.scenarios-section {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--creme-dark);
}
.scenarios-section__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--petrole);
  margin-bottom: 4px;
}
.scenarios-section__subtitle {
  font-size: 0.75rem;
  color: var(--texte-secondaire);
  margin-bottom: 16px;
}
.scenario-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--creme);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
  border-left: 3px solid var(--vert);
}
.scenario-card:hover {
  border-color: var(--petrole-medium);
  border-left-color: var(--vert);
  background: var(--petrole-light);
}
.scenario-card.active {
  border-color: var(--vert);
  background: var(--vert-light);
}
.scenario-card__text {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texte);
}
.scenario-card__delta {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1rem;
  color: var(--vert);
  white-space: nowrap;
}

/* Comparaison moyenne FR */
.moyenne-section {
  background: var(--petrole-light);
  border: 1.5px solid var(--petrole-medium);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.moyenne-section__title {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--petrole);
  margin-bottom: 8px;
}
.moyenne-bar {
  position: relative;
  height: 24px;
  background: var(--creme-dark);
  border-radius: 12px;
  overflow: visible;
  margin: 16px 0 24px;
}
.moyenne-bar__fill {
  height: 100%;
  border-radius: 12px;
  transition: width var(--transition);
  background: linear-gradient(90deg, var(--vert), var(--ambre), var(--terracotta));
}
.moyenne-bar__marker {
  position: absolute;
  top: -6px;
  height: 36px;
  width: 3px;
  background: var(--texte);
  border-radius: 2px;
}
.moyenne-bar__label {
  position: absolute;
  top: 32px;
  font-size: 0.6rem;
  color: var(--texte-secondaire);
  white-space: nowrap;
  transform: translateX(-50%);
}

/* Détail par catégorie (temporalité) */
.detail-categories {
  margin-top: 16px;
}
.detail-cat-card {
  background: var(--blanc);
  border-radius: var(--radius);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.detail-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.detail-cat-header:hover {
  background: var(--creme);
}
.detail-cat-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-cat-header__title {
  font-weight: 600;
  font-size: 0.85rem;
}
.detail-cat-header__value {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--terracotta);
}
.detail-cat-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease-out;
}
.detail-cat-body.open {
  max-height: 2000px;
}
.detail-cat-body__inner {
  padding: 0 16px 12px;
}
.detail-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--creme-dark);
}
.detail-cat-row:last-child {
  border-bottom: none;
}
.detail-cat-row__label {
  color: var(--texte);
}
.detail-cat-row__values {
  display: flex;
  gap: 12px;
}
.detail-cat-row__val {
  min-width: 45px;
  text-align: right;
  font-weight: 600;
}
.detail-cat-row__val.co2 { color: var(--terracotta); }
.detail-cat-row__val.eau { color: var(--petrole); }
.detail-cat-row__val.energie { color: var(--ambre); }

/* ============================================================================
   MODE COMPARATEUR
   ============================================================================ */
.comparateur {
  padding-top: 8px;
}
.comparateur__category-title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--petrole);
  margin: 20px 0 12px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--petrole-light);
}

.duel-card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--creme-dark);
  border-left: 3px solid var(--terracotta);
}
.duel-card__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--petrole);
  margin-bottom: 4px;
}
.duel-card__description {
  font-size: 0.75rem;
  color: var(--texte-secondaire);
  margin-bottom: 12px;
}
.duel-card__point-cle {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--petrole);
  background: var(--petrole-light);
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
  line-height: 1.55;
}
.duel-card__point-cle .pc-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(10, 92, 99, 0.15);
}
.duel-card__point-cle .pc-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.duel-card__point-cle .pc-title {
  font-style: normal;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
}
.duel-card__point-cle .pc-list {
  margin: 4px 0 2px 0;
  padding-left: 16px;
  list-style: disc;
  font-style: normal;
}
.duel-card__point-cle .pc-list li {
  margin-bottom: 2px;
}
.duel-card__point-cle .pc-conclusion {
  font-style: normal;
  font-weight: 600;
  margin-top: 6px;
  display: block;
}

.duel-alternatives {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.duel-alt {
  background: var(--creme);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1.5px solid transparent;
  transition: border-color var(--transition-fast);
}
.duel-alt.winner {
  border-color: var(--vert);
  background: var(--vert-light);
}
.duel-alt__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.duel-alt__name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--texte);
}
.duel-alt__marque {
  font-size: 0.65rem;
  color: var(--terracotta);
  font-weight: 600;
}
.duel-alt__prix {
  font-size: 0.75rem;
  color: var(--texte-secondaire);
  text-align: right;
}
.duel-alt__impacts {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.duel-impact-bar {
  flex: 1;
}
.duel-impact-bar__header {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  margin-bottom: 3px;
}
.duel-impact-bar__label {
  color: var(--texte-secondaire);
}
.duel-impact-bar__value {
  font-weight: 600;
}
.duel-impact-bar__track {
  height: 6px;
  background: var(--creme-dark);
  border-radius: 3px;
  overflow: hidden;
}
.duel-impact-bar__fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition);
}

/* Verdict */
.duel-verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--creme);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}
.duel-verdict__text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texte);
  flex: 1;
}
.duel-verdict__ratio {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--petrole);
  white-space: nowrap;
}

/* Courbe croisement */
.crossover-chart {
  margin-top: 12px;
}
.crossover-svg {
  width: 100%;
  height: 120px;
}

/* ============================================================================
   ONBOARDING
   ============================================================================ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.onboarding-overlay.hidden {
  display: none;
}
.onboarding-card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.onboarding-card__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--petrole);
  margin-bottom: 4px;
}
.onboarding-card__subtitle {
  font-size: 0.85rem;
  color: var(--texte-secondaire);
  margin-bottom: 20px;
}
.onboarding-card__step {
  display: none;
}
.onboarding-card__step.active {
  display: block;
}
.onboarding-field {
  margin-bottom: 16px;
}
.onboarding-field__label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  display: block;
}
.onboarding-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* Boutons */
.btn {
  font-family: var(--font-corps);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn--primary {
  background: var(--terracotta);
  color: var(--blanc);
  box-shadow: 0 2px 8px rgba(217, 97, 47, 0.3);
}
.btn--primary:hover {
  background: #C05528;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 97, 47, 0.35);
}
.btn--primary:active {
  transform: translateY(0);
}
.btn--secondary {
  background: var(--creme);
  color: var(--texte-secondaire);
  border: 1px solid var(--creme-dark);
}
.btn--secondary:hover {
  color: var(--petrole);
  background: var(--petrole-light);
  border-color: var(--petrole-medium);
}
.btn--outline {
  background: none;
  border: 1.5px solid var(--petrole-medium);
  color: var(--petrole);
}
.btn--outline:hover {
  background: var(--petrole-light);
  transform: translateY(-1px);
}

/* ============================================================================
   MODALE À PROPOS
   ============================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden {
  display: none;
}
.modal {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--petrole);
  margin-bottom: 16px;
}
.modal__close {
  float: right;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--texte-secondaire);
}
.modal p, .modal li {
  font-size: 0.8rem;
  color: var(--texte-secondaire);
  margin-bottom: 8px;
  line-height: 1.6;
}
.modal h3 {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 1rem;
  color: var(--petrole);
  margin: 16px 0 8px;
}

/* --- Empreinte du site --- */
.site-footprint {
  margin-top: 12px;
  padding: 14px;
  background: var(--creme);
  border-radius: var(--radius);
  border-left: 3px solid var(--terracotta);
}
.footprint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin: 10px 0;
}
.footprint-table th {
  background: var(--petrole);
  color: var(--blanc);
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.footprint-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(10,92,99,0.1);
  color: var(--texte-secondaire);
}
.footprint-table tr:nth-child(even) td {
  background: rgba(10,92,99,0.03);
}
.footprint-total td {
  background: rgba(217,97,47,0.08) !important;
  border-top: 2px solid var(--terracotta);
  color: var(--petrole);
}
.footprint-equiv {
  margin-top: 12px;
  padding: 10px;
  background: var(--blanc);
  border-radius: var(--radius);
}
.footprint-equiv ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.footprint-equiv li {
  padding: 4px 0;
  font-size: 0.78rem;
  color: var(--texte-secondaire);
}
.footprint-note {
  margin-top: 10px;
  font-size: 0.65rem !important;
  font-style: italic;
  color: var(--texte-tertiaire) !important;
  line-height: 1.4;
}

/* ============================================================================
   COMPARATEUR ALIMENT VS ALIMENT
   ============================================================================ */
.food-duel-selector {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.food-duel-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.food-duel-col__label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--petrole);
  text-align: center;
}
.food-duel-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--terracotta);
  padding-top: 28px;
  min-width: 32px;
}
.food-origin {
  width: 100%;
  font-size: 0.75rem;
  padding: 5px 6px;
}
.food-search-wrapper {
  position: relative;
  width: 100%;
}
.food-search-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.78rem;
  padding: 7px 10px;
  border: 1.5px solid rgba(10, 92, 99, 0.2);
  border-radius: 8px;
  background: var(--blanc);
  color: var(--texte-primaire);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}
.food-search-input:focus {
  border-color: var(--petrole);
  box-shadow: 0 0 0 2px rgba(10, 92, 99, 0.1);
}
.food-search-input::placeholder {
  color: var(--texte-tertiaire);
}
.food-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--blanc);
  border: 1.5px solid rgba(10, 92, 99, 0.2);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.food-search-dropdown.open {
  display: block;
}
.food-search-cat {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--petrole);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px 2px;
  background: rgba(10, 92, 99, 0.04);
  position: sticky;
  top: 0;
}
.food-search-item {
  font-size: 0.75rem;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--texte-primaire);
  transition: background 0.15s;
}
.food-search-item:hover {
  background: rgba(10, 92, 99, 0.08);
}
.food-search-item.active {
  background: rgba(10, 92, 99, 0.12);
  font-weight: 600;
}
.food-search-empty {
  font-size: 0.75rem;
  padding: 12px 10px;
  color: var(--texte-tertiaire);
  text-align: center;
  font-style: italic;
}
.food-duel-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.food-duel-result {
  background: var(--surface);
  border-radius: 10px;
  padding: 10px;
  border: 2px solid transparent;
}
.food-duel-result.winner {
  border-color: var(--vert, #2d7d46);
}
.food-duel-result__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--texte-primaire);
  margin-bottom: 2px;
}
.food-duel-result__meta {
  font-size: 0.65rem;
  color: var(--texte-secondaire);
  margin-bottom: 8px;
  line-height: 1.3;
}
.food-badge {
  display: inline-block;
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 2px;
  vertical-align: middle;
}
.food-badge--saison {
  background: rgba(45, 125, 70, 0.12);
  color: var(--vert, #2d7d46);
}
.food-badge--hs {
  background: rgba(217, 97, 47, 0.12);
  color: var(--terracotta);
}
.food-transport-split {
  font-size: 0.6rem;
  color: var(--texte-tertiaire);
  margin-top: 1px;
  margin-bottom: 4px;
}

@media (max-width: 480px) {
  .food-duel-selector {
    flex-direction: column;
    gap: 4px;
  }
  .food-duel-vs {
    padding-top: 0;
    padding-bottom: 0;
  }
  .food-duel-results-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.value-updated {
  animation: pulse 400ms ease-out;
}
.sticky-totals .value-updated {
  animation: pulse 500ms ease-out;
}

/* --- Curseurs avancés collapsibles --- */
.curseurs-advanced-toggle {
  border: none;
  background: none;
  color: var(--texte-secondaire);
  font-family: var(--font-corps);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.curseurs-advanced-toggle:hover {
  color: var(--petrole);
}
.curseurs-advanced-toggle__arrow {
  transition: transform 0.2s ease;
  display: inline-block;
  font-size: 0.6rem;
}
.curseurs-advanced-toggle.open .curseurs-advanced-toggle__arrow {
  transform: rotate(90deg);
}
.curseurs-advanced {
  display: none;
  padding-top: 4px;
}
.curseurs-advanced.open {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 400ms ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 420px) {
  .sticky-totals {
    padding: 5px 10px;
  }
  .sticky-totals__value {
    font-size: 1rem;
  }
  .jauges-grid {
    gap: 8px;
  }
  .jauge-card {
    padding: 12px 8px;
  }
  .jauge-card__value {
    font-size: 1.3rem;
  }
  .action-card__impacts {
    gap: 8px;
  }
  .impact-badge__value {
    font-size: 0.85rem;
  }
  .duel-alternatives {
    gap: 8px;
  }
}

@media (min-width: 600px) {
  .main {
    padding: 20px 24px 100px;
  }
  .jauges-grid {
    gap: 16px;
  }
  .jauge-card__value {
    font-size: 2rem;
  }
  .duel-alternatives {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .duel-alt {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }
  .action-card {
    padding: 20px;
  }
}

@media (min-width: 800px) {
  .main {
    padding: 24px 32px 100px;
  }
  .category__actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--creme);
}
::-webkit-scrollbar-thumb {
  background: var(--petrole-medium);
  border-radius: 3px;
}

/* Eau empreinte indicator */
.eau-type-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--petrole-light);
  color: var(--petrole);
  margin-left: 2px;
}

/* ============================================================================
   DARK MODE
   ============================================================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --creme: #161b22;
    --creme-dark: #21272e;
    --blanc: #1c2128;
    --texte: #e6edf3;
    --texte-secondaire: #8b949e;
    --petrole-light: rgba(26, 143, 154, 0.15);
    --petrole-medium: rgba(26, 143, 154, 0.25);
    --terracotta-light: rgba(235, 120, 70, 0.15);
    --ambre-light: rgba(220, 180, 80, 0.15);
    --vert-light: rgba(80, 180, 110, 0.15);
    --rouge-light: rgba(220, 80, 70, 0.12);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
[data-theme="dark"] {
  --creme: #161b22;
  --creme-dark: #21272e;
  --blanc: #1c2128;
  --texte: #e6edf3;
  --texte-secondaire: #8b949e;
  --petrole-light: rgba(26, 143, 154, 0.15);
  --petrole-medium: rgba(26, 143, 154, 0.25);
  --terracotta-light: rgba(235, 120, 70, 0.15);
  --ambre-light: rgba(220, 180, 80, 0.15);
  --vert-light: rgba(80, 180, 110, 0.15);
  --rouge-light: rgba(220, 80, 70, 0.12);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
[data-theme="light"] {
  --creme: #FDF8F0;
  --creme-dark: #F5EDE0;
  --blanc: #FFFFFF;
  --texte: #2C2C2C;
  --texte-secondaire: #6B6B6B;
  --petrole-light: rgba(10, 92, 99, 0.10);
  --petrole-medium: rgba(10, 92, 99, 0.20);
  --terracotta-light: rgba(217, 97, 47, 0.12);
  --ambre-light: rgba(201, 155, 63, 0.12);
  --vert-light: rgba(46, 139, 87, 0.12);
  --rouge-light: rgba(192, 57, 43, 0.10);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
  color-scheme: light;
}

/* Dark mode fixes for elements with hardcoded colors */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .footprint-table th {
    background: #0d7a83;
  }
  :root:not([data-theme="light"]) .bilan-annuel {
    background: linear-gradient(135deg, #053a40 0%, #0A5C63 40%, #0d7a83 100%);
  }
  :root:not([data-theme="light"]) input[type="range"] {
    background: var(--creme-dark);
  }
  :root:not([data-theme="light"]) .curseur-select {
    background: var(--blanc);
    color: var(--texte);
    border-color: var(--creme-dark);
  }
  :root:not([data-theme="light"]) .food-search-input {
    background: var(--blanc);
    color: var(--texte);
  }
  :root:not([data-theme="light"]) .food-search-dropdown {
    background: var(--blanc);
  }
}
[data-theme="dark"] .footprint-table th { background: #0d7a83; }
[data-theme="dark"] .bilan-annuel {
  background: linear-gradient(135deg, #053a40 0%, #0A5C63 40%, #0d7a83 100%);
}
[data-theme="dark"] input[type="range"] { background: var(--creme-dark); }
[data-theme="dark"] .curseur-select {
  background: var(--blanc); color: var(--texte); border-color: var(--creme-dark);
}
[data-theme="dark"] .food-search-input { background: var(--blanc); color: var(--texte); }
[data-theme="dark"] .food-search-dropdown { background: var(--blanc); }

/* ============================================================================
   ACCESSIBILITY — Focus & ARIA
   ============================================================================ */
:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}
.header__btn:focus-visible {
  outline-color: var(--creme);
  background: rgba(255,255,255,0.3);
}
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--terracotta);
  color: var(--blanc);
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 8px;
}

/* ============================================================================
   PAGE TRANSITIONS & MICRO-ANIMATIONS
   ============================================================================ */
.theme-page.active {
  display: block;
  animation: pageIn 350ms ease-out;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.action-card {
  animation: cardIn 400ms ease-out both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.donut-section, .vecteurs-section, .equivalences, .scenarios-section,
.moyenne-section, .detail-categories {
  animation: sectionIn 450ms ease-out both;
}
@keyframes sectionIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Smooth transitions for collapsible synthesis sections */
.synth-section-collapse {
  overflow: hidden;
  transition: max-height 400ms ease-out, opacity 300ms ease-out;
  max-height: 2000px;
  opacity: 1;
}
.synth-section-collapse.collapsed {
  max-height: 0;
  opacity: 0;
}
.synth-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: none;
  padding: 12px 0 8px;
  cursor: pointer;
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--petrole);
}
.synth-section-toggle__arrow {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  color: var(--texte-secondaire);
}
.synth-section-toggle.collapsed .synth-section-toggle__arrow {
  transform: rotate(-90deg);
}

/* ============================================================================
   HISTORY SPARKLINE
   ============================================================================ */
.history-section {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--creme-dark);
}
.history-section__title {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--petrole);
  margin-bottom: 8px;
}
.history-section__subtitle {
  font-size: 0.72rem;
  color: var(--texte-secondaire);
  margin-bottom: 12px;
}
.sparkline-svg {
  width: 100%;
  height: 80px;
}
.sparkline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--texte-secondaire);
  margin-top: 4px;
}

/* ============================================================================
   NUDGES — contextual feedback
   ============================================================================ */
.nudge-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--petrole);
  color: var(--creme);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-width: 90%;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
.nudge-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================================
   METHODOLOGY PAGE
   ============================================================================ */
.methodo-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--creme-dark);
}
.methodo-section h4 {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--petrole);
  margin: 14px 0 6px;
}
.methodo-section h4:first-child {
  margin-top: 0;
}
.methodo-section p, .methodo-section li {
  font-size: 0.78rem;
  color: var(--texte-secondaire);
  line-height: 1.6;
  margin-bottom: 6px;
}
.methodo-section ul {
  padding-left: 18px;
  margin-bottom: 10px;
}
.methodo-formula {
  display: inline-block;
  background: var(--creme);
  border: 1px solid var(--creme-dark);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--petrole);
  margin: 4px 0;
}
.methodo-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.methodo-table th { text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--petrole); color: var(--petrole); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; }
.methodo-table td { padding: 5px 8px; border-bottom: 1px solid var(--creme-dark); vertical-align: top; }
.methodo-table tr:hover td { background: rgba(10,92,99,0.04); }
.methodo-table td:first-child { font-weight: 600; white-space: nowrap; }
.methodo-table td:last-child { font-size: 0.7rem; color: var(--texte-secondaire); }

/* Onboarding progress indicator */
.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}
.onboarding-progress__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--creme-dark);
  transition: all 0.3s ease;
}
.onboarding-progress__dot.active {
  background: var(--terracotta);
  width: 24px;
  border-radius: 4px;
}
.onboarding-progress__dot.done {
  background: var(--petrole);
}
.onboarding-card__step {
  display: none;
  animation: pageIn 300ms ease-out;
}
.onboarding-card__step.active {
  display: block;
}

/* old co2-budget replaced by budgets-row */

/* ===== INTERNATIONAL COMPARISON (synthesis) ===== */
.intl-compare {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.intl-compare__item {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem;
  background: var(--creme-dark);
  border-radius: 8px;
  text-align: center;
  font-size: 0.78rem;
}
.intl-compare__flag {
  font-size: 1.3rem;
  display: block;
  margin-bottom: 0.2rem;
}
.intl-compare__value {
  font-weight: 700;
  color: var(--petrole);
}
.intl-compare__label {
  display: block;
  font-size: 0.7rem;
  color: var(--texte-secondaire);
}
.intl-compare__you {
  border: 2px solid var(--terracotta);
}

/* ===== WEEKLY CHALLENGE ===== */
.weekly-challenge {
  max-width: 600px;
  margin: 0.5rem auto;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--petrole), #0d7a83);
  border-radius: 10px;
  color: #fff;
  font-size: 0.85rem;
}
.weekly-challenge__title {
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.weekly-challenge__text {
  opacity: 0.9;
}
.weekly-challenge__progress {
  display: flex;
  gap: 4px;
  margin-top: 0.4rem;
}
.weekly-challenge__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
}
.weekly-challenge__dot.done {
  background: #fff;
}

/* ===== PWA INSTALL PROMPT ===== */
.pwa-install {
  display: none;
  max-width: 600px;
  margin: 0.5rem auto;
  padding: 0.6rem 1rem;
  background: var(--blanc);
  border: 1px solid var(--petrole);
  border-radius: 8px;
  text-align: center;
  font-size: 0.82rem;
}
.pwa-install__btn {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.4rem 1.2rem;
  background: var(--petrole);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.pwa-install__btn:hover {
  background: var(--terracotta);
}

/* ===== PRINT ===== */
/* ===== JOURNAL RAPIDE ===== */
.journal {
  max-width: 600px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  background: var(--blanc);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.journal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.journal__date {
  font-weight: 700;
  font-size: 1rem;
  color: var(--texte);
}
.journal__streak {
  font-size: 0.85rem;
  color: var(--ambre);
  font-weight: 600;
}
.streak-display { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.streak-display__flame { font-size: 1.3rem; line-height: 1; }
.streak-display__count { font-weight: 700; font-size: 0.9rem; }
.streak-display--empty .streak-display__count { font-weight: 400; font-size: 0.8rem; color: var(--texte-secondaire); }
.streak-hint { font-size: 0.7rem; color: var(--texte-secondaire); font-weight: 400; }
.streak-hint--gold { color: var(--ambre); }
.journal__delta {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.6rem;
}
.journal__delta.better {
  background: rgba(109,216,151,0.15);
  color: #2d8a4e;
}
.journal__delta.worse {
  background: rgba(217,97,47,0.12);
  color: var(--terracotta);
}
.journal__delta.same {
  background: var(--creme-dark);
  color: var(--texte-secondaire);
}
.journal__grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.jcard {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: var(--creme-dark);
  border-radius: 8px;
  font-size: 0.82rem;
}
.jcard__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}
.jcard__label {
  flex: 1;
  color: var(--texte);
  font-weight: 500;
}
.jcard__input {
  width: 80px;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--creme-dark);
  border-radius: 6px;
  font-size: 0.82rem;
  text-align: center;
  background: var(--blanc);
  color: var(--texte);
}
.jcard__input:focus {
  border-color: var(--petrole);
  outline: none;
}
.jcard__select {
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--creme-dark);
  border-radius: 6px;
  font-size: 0.78rem;
  background: var(--blanc);
  color: var(--texte);
}
.jcard__unit {
  font-size: 0.72rem;
  color: var(--texte-secondaire);
  min-width: 2rem;
}
/* Voiture multi-trajets */
.jcard--voiture {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.jcard__voiture-header {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.jcard__conso-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.jcard__conso-input {
  width: 42px;
  padding: 0.2rem;
  border: 1px solid var(--creme-dark);
  border-radius: 5px;
  background: var(--blanc);
  color: var(--texte);
  font-size: 0.75rem;
  text-align: center;
}
.jcard__conso-unit {
  font-size: 0.68rem;
  color: var(--texte-secondaire);
}
.jcard__trajets {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.jcard__trajet-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.jcard__trajet-km {
  width: 52px;
  padding: 0.25rem 0.3rem;
  border: 1px solid var(--creme-dark);
  border-radius: 5px;
  background: var(--blanc);
  color: var(--texte);
  font-size: 0.82rem;
  text-align: center;
}
.jcard__trajet-sep {
  font-size: 0.7rem;
  color: var(--texte-secondaire);
}
.jcard__trajet-pass {
  width: 36px;
  padding: 0.2rem;
  border: 1px solid var(--creme-dark);
  border-radius: 5px;
  background: var(--blanc);
  color: var(--texte);
  font-size: 0.78rem;
  text-align: center;
}
.jcard__trajet-plabel {
  font-size: 0.68rem;
  color: var(--texte-secondaire);
}
.jcard__trajet-del {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--texte-secondaire);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jcard__trajet-del:hover { background: rgba(0,0,0,0.06); color: #c0392b; }
.jcard__trajets-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.15rem;
  border-top: 1px dashed var(--creme-dark);
}
.jcard__add-trajet {
  padding: 0.2rem 0.5rem;
  border: 1px dashed var(--petrole);
  background: transparent;
  color: var(--petrole);
  border-radius: 5px;
  font-size: 0.72rem;
  cursor: pointer;
}
.jcard__add-trajet:hover { background: rgba(10,92,99,0.05); }
.jcard__trajets-total {
  font-size: 0.7rem;
  color: var(--texte-secondaire);
  margin-left: auto;
}
.jcard--collapsible {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
}
.jcard__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  user-select: none;
}
.jcard__regime-tag {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--petrole);
  background: rgba(10,92,99,0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}
.jcard--changed .jcard__regime-tag {
  background: rgba(217,97,47,0.12);
  color: var(--terracotta);
}
.jcard__expand-btn {
  font-size: 0.7rem;
  color: var(--texte-secondaire);
  text-decoration: underline;
  flex-shrink: 0;
}
.jcard__detail {
  padding: 0.3rem 0.6rem 0.5rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.jcard__detail.hidden { display: none; }
.jcard__toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--creme-dark);
  border-radius: 11px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.jcard__toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.jcard__toggle.on {
  background: var(--petrole);
}
.jcard__toggle.on::after {
  transform: translateX(18px);
}
.journal__actions {
  display: flex;
  gap: 0.5rem;
}
.journal__save {
  flex: 2;
  padding: 0.6rem;
  background: var(--petrole);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.journal__save:hover { background: #0d7a83; }
.journal__save.saved {
  background: #2d8a4e;
  pointer-events: none;
}
.journal__reset-day {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  color: var(--texte-secondaire);
  border: 1px solid var(--creme-dark);
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
}
.journal__reset-day:hover { border-color: var(--texte-secondaire); }
.journal__copy {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  color: var(--petrole);
  border: 1px solid var(--petrole);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.journal__copy:hover { background: rgba(10,92,99,0.05); }
.journal__copy-picker {
  margin-top: 0.5rem;
  padding: 0.6rem;
  background: var(--creme-dark);
  border-radius: 8px;
}
.journal__copy-label {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--texte);
}
.journal__copy-presets {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.journal__copy-preset {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--petrole);
  background: transparent;
  color: var(--petrole);
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
}
.journal__copy-preset:hover { background: rgba(10,92,99,0.08); }
.journal__copy-days {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.journal__copy-day {
  width: 42px;
  padding: 0.35rem 0;
  border: 1px solid var(--texte-secondaire);
  background: var(--blanc);
  color: var(--texte);
  border-radius: 6px;
  font-size: 0.72rem;
  text-align: center;
  cursor: pointer;
}
.journal__copy-day.selected {
  background: var(--petrole);
  color: #fff;
  border-color: var(--petrole);
}
.journal__copy-day.today {
  border-color: var(--ambre);
  font-weight: 700;
}
.journal__copy-actions {
  display: flex;
  gap: 0.3rem;
}
.journal__copy-confirm {
  flex: 1;
  padding: 0.4rem;
  background: var(--petrole);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.journal__copy-cancel {
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: var(--texte-secondaire);
  border: 1px solid var(--creme-dark);
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}
/* Foyer bar */
.journal__foyer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--creme-dark);
  border-radius: 8px;
  font-size: 0.78rem;
}
.journal__foyer-icon { font-size: 1rem; }
.journal__foyer-text { flex: 1; color: var(--texte-secondaire); }
.journal__foyer-edit {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--texte-secondaire);
  background: transparent;
  color: var(--texte-secondaire);
  border-radius: 5px;
  font-size: 0.7rem;
  cursor: pointer;
}
.journal__foyer-edit:hover { border-color: var(--petrole); color: var(--petrole); }

/* ===== BUDGETS ROW ===== */
.budgets-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .budgets-row { grid-template-columns: 1fr; gap: 0.3rem; padding: 0.3rem 0.75rem; }
}
.budget-bar {
  background: var(--blanc);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.budget-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}
.budget-bar__title { font-size: 0.72rem; font-weight: 600; }
.budget-bar__ratio { font-size: 0.68rem; color: var(--texte-secondaire); }
.budget-bar__track {
  position: relative;
  height: 6px;
  background: var(--creme-dark);
  border-radius: 3px;
  overflow: visible;
}
.budget-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--petrole);
  transition: width 0.6s ease;
}
.budget-bar__fill.over-paris { background: var(--ambre); }
.budget-bar__fill.over-france { background: #e67e22; }
.budget-bar__fill.over-budget { background: #c0392b; }

.budget-bar__track--co2 { display: flex; overflow: visible; }
.budget-bar__seg {
  height: 100%;
  transition: width 0.6s ease;
}
.budget-bar__seg--gestes {
  background: var(--petrole);
  border-radius: 3px 0 0 3px;
}
.budget-bar__seg--gestes.over-paris { background: var(--ambre); }
.budget-bar__seg--gestes.over-france { background: #e67e22; }
.budget-bar__seg--gestes.over-budget { background: #c0392b; }
.budget-bar__seg--sp-cible { background: #8ec5c9; }
.budget-bar__seg--sp-delta {
  background: repeating-linear-gradient(
    135deg, #5a9ea4, #5a9ea4 2px, #3d7f85 2px, #3d7f85 4px
  );
  border-radius: 0 3px 3px 0;
}
.budget-bar__marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: var(--petrole);
  border-radius: 1px;
}
.budget-bar__marker--fr { background: var(--texte-secondaire); }
.budget-bar__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--texte-secondaire);
  margin-top: 0.15rem;
}
.budget-bar__goal { font-weight: 600; color: var(--petrole); }

/* ===== CALENDAR ===== */
.calendar {
  max-width: 500px;
  margin: 1rem auto;
  padding: 0 0.5rem;
}
.calendar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.calendar__nav-btn {
  background: transparent;
  border: 1px solid var(--creme-dark);
  color: var(--texte);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.82rem;
  cursor: pointer;
}
.calendar__nav-btn:hover { border-color: var(--petrole); }
.calendar__month {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 160px;
  text-align: center;
}
.calendar__grid { display: flex; flex-direction: column; gap: 2px; }
.calendar__row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  border-radius: 6px;
  background: var(--blanc);
  color: var(--texte);
  position: relative;
}
.calendar__cell--header {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--texte-secondaire);
  background: transparent;
}
.calendar__cell--today {
  outline: 2px solid var(--petrole);
  outline-offset: -1px;
  font-weight: 700;
}
.calendar__cell--green { background: #27ae60; color: #fff; }
.calendar__cell--amber { background: var(--ambre); color: #fff; }
.calendar__cell--red { background: #c0392b; color: #fff; }
.calendar__legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--texte-secondaire);
}
.calendar__legend-item { display: flex; align-items: center; gap: 0.25rem; }
.calendar__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.calendar__dot--green { background: #27ae60; }
.calendar__dot--amber { background: var(--ambre); }
.calendar__dot--red { background: #c0392b; }
.calendar__stats {
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--texte-secondaire);
  padding: 0.5rem;
  background: var(--blanc);
  border-radius: 8px;
}

/* ===== GESTES PAGE ===== */
.gestes-categories { max-width: 700px; margin: 0 auto; }
.gestes-category {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--creme-dark);
}
.gestes-category:last-child { border-bottom: none; }

/* ===== SERVICES PUBLICS PAGE ===== */
.sp-notice {
  max-width: 600px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  background: var(--creme-dark);
  border-left: 3px solid var(--ambre);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--texte-secondaire);
  line-height: 1.5;
}
.sp-card {
  max-width: 600px;
  margin: 0.5rem auto;
  padding: 0.75rem 1rem;
  background: var(--blanc);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.sp-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.sp-card__icon {
  font-size: 1.3rem;
}
.sp-card__label {
  font-weight: 600;
  color: var(--texte);
  flex: 1;
}
.sp-card__value {
  font-weight: 700;
  color: var(--petrole);
  font-variant-numeric: tabular-nums;
}
.sp-card__bar {
  height: 6px;
  background: var(--creme-dark);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.sp-card__fill {
  height: 100%;
  background: var(--petrole);
  border-radius: 3px;
  opacity: 0.7;
}
.sp-card__detail {
  font-size: 0.75rem;
  color: var(--texte-secondaire);
  font-variant-numeric: tabular-nums;
}
.sp-card__explain {
  font-size: 0.75rem;
  color: var(--texte-secondaire);
  margin-top: 0.25rem;
  line-height: 1.4;
  opacity: 0.8;
}
.sp-sources {
  max-width: 600px;
  margin: 1rem auto;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  color: var(--texte-secondaire);
  line-height: 1.5;
  border-top: 1px solid var(--creme-dark);
}

/* ===== PRINT ===== */
@media print {
  .header, .nav-themes, .budgets-row, .weekly-challenge, .pwa-install, .nudge-toast, .skip-link { display: none !important; }
  .main { padding-top: 0; }
  .sticky-totals { position: static; box-shadow: none; }
}

/* ============================================================================
   TENDANCES — graphique barres
   ============================================================================ */
.trends-section { margin-top: 24px; }
.trends-section__title { font-family: var(--font-titre); font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.trends-toggle { display: flex; gap: 4px; margin-bottom: 12px; }
.trends-toggle__btn {
  padding: 6px 14px; border: 1px solid var(--bordure); border-radius: 20px;
  background: transparent; color: var(--texte); font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
}
.trends-toggle__btn.active { background: var(--petrole); color: #fff; border-color: var(--petrole); }
.trends-chart { position: relative; height: 180px; display: flex; align-items: flex-end; gap: 3px; padding: 0 4px; }
.trends-bar {
  flex: 1; min-width: 8px; border-radius: 3px 3px 0 0; cursor: pointer; position: relative;
  transition: all 0.3s ease; background: var(--petrole); opacity: 0.7;
}
.trends-bar:hover { opacity: 1; }
.trends-bar--green { background: #2d7d46; }
.trends-bar--amber { background: var(--ambre); }
.trends-bar--red { background: var(--terracotta); }
.trends-bar__tooltip {
  display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--texte); color: var(--fond); font-size: 0.7rem; padding: 2px 6px; border-radius: 4px;
  white-space: nowrap; z-index: 5;
}
.trends-bar:hover .trends-bar__tooltip { display: block; }
.trends-avg {
  position: absolute; left: 0; right: 0; border-top: 2px dashed var(--terracotta);
  pointer-events: none;
}
.trends-avg__label {
  position: absolute; right: 0; top: -16px; font-size: 0.65rem; color: var(--terracotta); font-weight: 600;
}
.trends-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--texte-secondaire); margin-top: 4px; }
.trends-summary { margin-top: 8px; font-size: 0.8rem; color: var(--texte-secondaire); text-align: center; }
.trends-summary strong { color: var(--texte); }
.trends-direction { display: inline-block; margin-left: 4px; font-weight: 700; }
.trends-direction--up { color: var(--terracotta); }
.trends-direction--down { color: #2d7d46; }
.trends-direction--flat { color: var(--ambre); }

/* ============================================================================
   OBJECTIF PERSONNEL
   ============================================================================ */
.objectif-section {
  margin: 16px 0 0 0; padding: 12px 16px; background: var(--fond-carte);
  border-radius: 10px; border: 1px solid var(--bordure);
}
.objectif-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.objectif-section__title { font-weight: 700; font-size: 0.9rem; }
.objectif-section__edit {
  background: transparent; border: 1px solid var(--bordure); border-radius: 6px;
  padding: 3px 10px; font-size: 0.75rem; color: var(--texte-secondaire); cursor: pointer;
}
.objectif-section__edit:hover { border-color: var(--petrole); color: var(--petrole); }
.objectif-bar { height: 10px; background: var(--fond-alt); border-radius: 5px; overflow: hidden; position: relative; }
.objectif-bar__fill { height: 100%; border-radius: 5px; transition: width 0.4s ease; }
.objectif-bar__fill--ok { background: #2d7d46; }
.objectif-bar__fill--warn { background: var(--ambre); }
.objectif-bar__fill--over { background: var(--terracotta); }
.objectif-stats { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--texte-secondaire); margin-top: 6px; }
.objectif-stats__progress { font-weight: 600; }
.objectif-stats__progress--ok { color: #2d7d46; }
.objectif-stats__progress--over { color: var(--terracotta); }

/* ============================================================================
   COACH — recommandations concrètes
   ============================================================================ */
.coach-section { margin-top: 20px; }
.coach-section__title { font-family: var(--font-titre); font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.coach-card {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px;
  background: var(--fond-carte); border-radius: 10px; margin-bottom: 8px;
  border-left: 3px solid var(--petrole);
}
.coach-card__rank { font-size: 1.2rem; font-weight: 700; color: var(--terracotta); min-width: 28px; text-align: center; }
.coach-card__body { flex: 1; }
.coach-card__action { font-weight: 600; font-size: 0.85rem; }
.coach-card__value { font-size: 0.75rem; color: var(--texte-secondaire); margin-top: 2px; }
.coach-card__tip {
  margin-top: 6px; padding: 6px 10px; background: rgba(10,92,99,0.08); border-radius: 6px;
  font-size: 0.78rem; line-height: 1.4;
}
[data-theme="dark"] .coach-card__tip { background: rgba(10,92,99,0.2); }

/* ============================================================================
   SCORE SOCIAL & CLASSEMENT
   ============================================================================ */
.score-section { margin-top: 20px; padding: 16px; background: var(--fond-carte); border-radius: 12px; text-align: center; }
.score-section__title { font-family: var(--font-titre); font-weight: 700; font-size: 1rem; margin-bottom: 12px; }
.score-gauge { position: relative; width: 140px; height: 140px; margin: 0 auto 8px; }
.score-value { display: none; }
.score-label { display: none; }
.score-percentile { font-size: 0.85rem; margin-top: 8px; }
.score-percentile strong { color: var(--petrole); }
.niveau-progress { display: flex; align-items: center; gap: 8px; margin: 8px auto; max-width: 280px; }
.niveau-progress__label { font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.niveau-progress__bar { flex: 1; height: 6px; background: var(--fond-alt); border-radius: 3px; overflow: hidden; }
.niveau-progress__fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.niveau-progress__hint { font-size: 0.75rem; color: var(--texte-secondaire); margin-top: 4px; }
.score-compare-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; text-align: center;
}
.score-compare-item { padding: 8px 4px; background: var(--fond-alt); border-radius: 8px; }
.score-compare-item__val { font-weight: 700; font-size: 0.9rem; }
.score-compare-item__label { font-size: 0.7rem; color: var(--texte-secondaire); }
.score-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.score-actions .btn { font-size: 0.8rem; padding: 8px 16px; }

/* ============================================================================
   ONBOARDING — step 4 (guide journal)
   ============================================================================ */
.onboarding-card__step[data-step="4"] .onboarding-guide {
  text-align: center; padding: 16px 0;
}
.onboarding-guide__icon { font-size: 3rem; margin-bottom: 12px; }
.onboarding-guide__text { font-size: 0.9rem; color: var(--texte-secondaire); line-height: 1.5; }
.onboarding-guide__text strong { color: var(--texte); }
.onboarding-highlight {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 8px 16px;
  background: rgba(10,92,99,0.1); border-radius: 20px; font-weight: 600; color: var(--petrole);
}

/* ================================================================
   GROUPES
   ================================================================ */
.groupe-auth { text-align: center; padding: 40px 16px; }
.groupe-auth__icon { font-size: 3.5rem; margin-bottom: 12px; }
.groupe-auth__title { font-family: var(--font-display); font-size: 1.4rem; color: var(--petrole); margin-bottom: 8px; }
.groupe-auth__desc { color: var(--texte-secondaire); font-size: 0.9rem; margin-bottom: 24px; }
.groupe-auth__form { max-width: 300px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.groupe-auth__label { font-weight: 600; font-size: 0.85rem; text-align: left; }
.groupe-auth__input {
  padding: 10px 14px; border: 2px solid var(--bordure); border-radius: 10px;
  font-size: 1rem; background: var(--fond); color: var(--texte);
  transition: border-color 0.2s;
}
.groupe-auth__input:focus { border-color: var(--petrole); outline: none; }

.groupe-hub { padding: 0 4px; }
.groupe-hub__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; margin-bottom: 8px;
}
.groupe-hub__user { font-weight: 600; font-size: 0.95rem; }
.groupe-hub__logout {
  background: none; border: none; color: var(--texte-secondaire);
  font-size: 0.8rem; cursor: pointer; text-decoration: underline;
}

.groupe-list__title { font-family: var(--font-display); font-size: 1.1rem; color: var(--petrole); margin-bottom: 12px; }

.groupe-card {
  background: var(--fond-card); border-radius: 12px; padding: 16px;
  margin-bottom: 10px; cursor: pointer; border: 2px solid var(--bordure);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.groupe-card:hover { border-color: var(--petrole); box-shadow: 0 2px 8px rgba(10,92,99,0.12); }
.groupe-card__name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.groupe-card__code { font-size: 0.8rem; color: var(--texte-secondaire); font-family: monospace; }

.groupe-actions { display: flex; gap: 10px; margin-top: 16px; }
.groupe-actions .btn { flex: 1; font-size: 0.85rem; }

.groupe-challenges__title { font-family: var(--font-display); font-size: 1.1rem; color: var(--terracotta); margin-bottom: 12px; }
.challenge-card {
  background: var(--fond-card); border-radius: 12px; padding: 14px;
  margin-bottom: 10px; border-left: 4px solid var(--terracotta);
}
.challenge-card__from { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.challenge-card__target { font-size: 0.85rem; color: var(--petrole); font-weight: 600; }
.challenge-card__msg { font-style: italic; font-size: 0.85rem; color: var(--texte-secondaire); margin: 6px 0; }
.challenge-card__actions { display: flex; gap: 8px; margin-top: 10px; }
.btn--sm { padding: 6px 14px; font-size: 0.8rem; }

.groupe-detail__back {
  background: none; border: none; color: var(--petrole); font-weight: 600;
  font-size: 0.9rem; cursor: pointer; padding: 8px 0; margin-bottom: 8px;
}
.groupe-detail__header { margin-bottom: 16px; }
.groupe-detail__name { font-family: var(--font-display); font-size: 1.3rem; color: var(--petrole); margin: 0; }
.groupe-detail__code {
  font-size: 0.85rem; color: var(--texte-secondaire); font-family: monospace;
  margin-top: 4px; cursor: pointer;
}
.groupe-detail__code:hover { color: var(--petrole); }
.groupe-detail__leave { margin-top: 20px; width: 100%; color: var(--terracotta); border-color: var(--terracotta); }

.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.leaderboard__row {
  display: flex; align-items: center; gap: 12px;
  background: var(--fond-card); border-radius: 12px; padding: 12px 14px;
  border: 2px solid var(--bordure); transition: border-color 0.2s;
}
.leaderboard__row--me { border-color: var(--petrole); background: rgba(10,92,99,0.05); }
.leaderboard__rank { font-size: 1.3rem; min-width: 32px; text-align: center; }
.leaderboard__info { flex: 1; min-width: 0; }
.leaderboard__pseudo { font-weight: 700; font-size: 0.95rem; }
.leaderboard__avg { font-size: 0.82rem; color: var(--texte-secondaire); margin-top: 2px; }
.leaderboard__spark { display: flex; gap: 3px; margin-top: 6px; }
.spark-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.spark--green { background: #2d7d46; }
.spark--amber { background: var(--ambre); }
.spark--red { background: var(--terracotta); }
.leaderboard__challenge {
  background: none; border: 2px solid var(--bordure); border-radius: 10px;
  width: 36px; height: 36px; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.leaderboard__challenge:hover { border-color: var(--terracotta); background: rgba(217,97,47,0.08); }

/* Group history chart */
.groupe-history { margin-top: 20px; }
.groupe-history__title { font-family: var(--font-display); font-size: 1rem; color: var(--petrole); margin-bottom: 10px; }
.groupe-history__chart { position: relative; height: 160px; background: var(--fond-card); border-radius: 12px; border: 1px solid var(--bordure); padding: 8px; overflow: hidden; }
.groupe-history__chart svg { width: 100%; height: 100%; }
.groupe-history__legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 0.78rem; }
.groupe-history__legend-item { display: flex; align-items: center; gap: 4px; }
.groupe-history__legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ================================================================
   MODAL RÉGLAGES
   ================================================================ */
.modal--settings { max-width: 480px; max-height: 85vh; overflow-y: auto; }
.settings-section { margin-bottom: 20px; }
.settings-section__title {
  font-family: var(--font-display); font-size: 1rem; color: var(--petrole);
  padding-bottom: 6px; border-bottom: 2px solid var(--bordure); margin-bottom: 10px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; gap: 12px;
}
.settings-row--sub { padding-left: 16px; }
.settings-row__label { font-weight: 600; font-size: 0.9rem; }
.settings-row__desc { font-size: 0.78rem; color: var(--texte-secondaire); display: block; margin-top: 1px; }

/* Toggle group (theme) */
.settings-toggle-group { display: flex; gap: 4px; }
.settings-toggle__btn {
  padding: 5px 12px; border: 2px solid var(--bordure); border-radius: 8px;
  background: var(--fond); color: var(--texte); font-size: 0.8rem;
  cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.settings-toggle__btn.active {
  background: var(--petrole); color: #fff; border-color: var(--petrole);
}

/* Select */
.settings-select {
  padding: 6px 10px; border: 2px solid var(--bordure); border-radius: 8px;
  background: var(--fond); color: var(--texte); font-size: 0.85rem; cursor: pointer;
}
.settings-select:focus { border-color: var(--petrole); outline: none; }

/* Switch */
.settings-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.settings-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.settings-switch__slider {
  position: absolute; inset: 0; background: #b0b8bc; border-radius: 12px;
  cursor: pointer; transition: background 0.2s;
}
.settings-switch__slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform 0.2s;
}
.settings-switch input:checked + .settings-switch__slider { background: var(--petrole, #0A5C63); }
.settings-switch input:checked + .settings-switch__slider::before { transform: translateX(20px); }

/* Stepper */
.settings-stepper { display: flex; align-items: center; gap: 8px; }
.settings-stepper__btn {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--bordure);
  background: var(--fond); color: var(--texte); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s;
}
.settings-stepper__btn:hover { border-color: var(--petrole); }
.settings-stepper__val { font-weight: 700; font-size: 1.1rem; min-width: 24px; text-align: center; }

/* Time input */
.settings-input-time {
  padding: 5px 10px; border: 2px solid var(--bordure); border-radius: 8px;
  background: var(--fond); color: var(--texte); font-size: 0.85rem;
}
.settings-input-time:focus { border-color: var(--petrole); outline: none; }

/* Danger button */
.settings-danger { color: var(--terracotta) !important; border-color: var(--terracotta) !important; }

/* ================================================================
   BADGES
   ================================================================ */
.badges-grid { display: flex; flex-direction: column; gap: 4px; }
.badges-summary { font-size: 0.8rem; font-weight: 600; color: var(--petrole); padding: 4px 0 8px; text-align: center; }
.badges-cat-label { font-size: 0.7rem; font-weight: 600; color: var(--texte-secondaire); text-transform: uppercase; letter-spacing: 0.04em; margin: 8px 0 4px; }
.badges-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.badge-item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 12px 6px; border-radius: 12px; border: 2px solid var(--bordure);
  background: var(--fond-card); transition: all 0.2s;
}
.badge-item--earned { border-color: var(--petrole); background: rgba(10,92,99,0.06); }
.badge-item--locked { opacity: 0.45; filter: grayscale(1); }
.badge-item__icon { font-size: 1.8rem; margin-bottom: 4px; }
.badge-item__name { font-size: 0.72rem; font-weight: 700; line-height: 1.2; }
.badge-item__date { font-size: 0.65rem; color: var(--texte-secondaire); margin-top: 2px; }

/* Toast pour badge débloqué */
.badge-toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--petrole); color: #fff; padding: 12px 20px;
  border-radius: 12px; font-weight: 600; font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2); z-index: 9999;
  animation: badgeIn 0.4s ease, badgeOut 0.4s ease 3s forwards;
}
@keyframes badgeIn { from { opacity:0; transform: translateX(-50%) translateY(-20px); } }
@keyframes badgeOut { to { opacity:0; transform: translateX(-50%) translateY(-20px); } }

/* --- Language selector --- */
.lang-select {
  background: var(--fond-card);
  border: 1px solid var(--bordure);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.8rem;
  color: var(--texte);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}
.lang-select:focus {
  outline: 2px solid var(--petrole);
  outline-offset: 1px;
}

/* ============================================================================
   Comparateurs produits
   ============================================================================ */
.comp-filter-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.comp-filter-btn {
  background: var(--creme); border: 1px solid var(--petrole-20); border-radius: 16px;
  padding: 5px 12px; font-size: .8rem; cursor: pointer; color: var(--text);
  transition: all .2s;
}
.comp-filter-btn.active, .comp-filter-btn:hover {
  background: var(--petrole); color: #fff; border-color: var(--petrole);
}
.comp-card {
  background: var(--card-bg); border-radius: 10px; margin-bottom: 10px;
  border: 1px solid var(--petrole-10); overflow: hidden;
  transition: box-shadow .2s;
}
.comp-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.comp-card__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; cursor: pointer;
}
.comp-card__title {
  font-weight: 600; font-size: .95rem; color: var(--text);
}
.comp-card__cat {
  font-size: .72rem; color: var(--petrole); background: var(--petrole-10);
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.comp-card__body { padding: 0 14px 14px; }
.comp-card__desc {
  font-size: .82rem; color: var(--text-light); margin-bottom: 10px; line-height: 1.4;
}
.comp-card__curseurs { margin-bottom: 12px; }
.comp-curseur { margin-bottom: 6px; }
.comp-curseur__label { font-size: .8rem; color: var(--text); display: block; margin-bottom: 2px; }
.comp-curseur__range { width: 100%; accent-color: var(--petrole); }
.comp-card__pointcle {
  font-size: .78rem; color: var(--ambre-dark, #8a6b1e); background: var(--ambre-10, rgba(201,155,63,.1));
  padding: 8px 10px; border-radius: 8px; margin-top: 10px; line-height: 1.4;
}
.comp-results-grid { display: flex; flex-direction: column; gap: 8px; }
.comp-result-item {
  background: var(--creme); border-radius: 8px; padding: 10px 12px;
  border: 1px solid transparent; transition: border-color .2s;
}
.comp-result-best {
  border-color: var(--petrole); background: rgba(10,92,99,.05);
}
.comp-result-label {
  font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 4px;
}
.comp-result-marque { font-weight: 400; color: var(--text-light); font-size: .78rem; }
.comp-result-bar-wrap {
  height: 6px; background: var(--petrole-10); border-radius: 3px; margin-bottom: 6px; overflow: hidden;
}
.comp-result-bar {
  height: 100%; background: var(--terracotta); border-radius: 3px;
  transition: width .4s ease;
}
.comp-result-best .comp-result-bar { background: var(--petrole); }
.comp-result-values {
  display: flex; flex-wrap: wrap; gap: 8px; font-size: .78rem; color: var(--text-light);
}
.comp-rv { white-space: nowrap; }
.comp-result-badge {
  font-size: .75rem; color: var(--petrole); font-weight: 600; margin-top: 4px;
}
