/*!
 * Bee-api.fr — Simulateur de Ruche · https://bee-api.fr
 * Simulateur pédagogique d'apiculture : gratuit, sans compte, open source.
 *
 * Copyright (C) 2026 Bee-api.fr — contact : https://bee-api.fr
 * Licence : GNU Affero General Public License v3.0 ou ultérieure (AGPL-3.0-or-later).
 * Ce programme est un logiciel libre : vous pouvez le redistribuer et/ou le modifier
 * selon les termes de la GNU AGPL telle que publiée par la Free Software Foundation.
 * Distribué SANS AUCUNE GARANTIE, ni de valeur marchande ni d'adéquation à un usage
 * particulier. Voir la licence complète dans le fichier LICENSE.
 * Toute réutilisation — y compris via un réseau (clause AGPL §13) — doit conserver
 * cette attribution et rester sous la même licence (copyleft). Code source complet
 * disponible depuis https://bee-api.fr
 */
/* =============================================================================
   styles.css — Tokens de thème (anthracite / moutarde) + composants
   -----------------------------------------------------------------------------
   Tailwind (CDN) gère l'essentiel de la mise en page ; ce fichier définit les
   variables de couleur du domaine et les quelques composants sur mesure
   (onglets, contrôles, cadre honeycomb) difficiles à faire en pur utilitaire.
   ========================================================================== */

:root {
  /* Anthracite */
  --bg: #1a1d20;
  --surface: #212528;
  --surface-2: #2a2e33;
  --line: #3d434b;
  --text: #e6e8ea;
  --dim: #949aa2;

  /* Moutarde / abeille */
  --mustard: #e0a82e;
  --mustard-bright: #f2bd45;

  /* Couleurs métier (graphiques & cadre) */
  --pop: #6fae8f;      /* abeilles adultes */
  --brood: #c98a4b;    /* couvain operculé */
  --larvae: #efe6cb;   /* larves & œufs */
  --drone: #6e4a1e;    /* couvain de mâle — brun foncé, distinct de l'operculé clair */
  --drone-line: #b0793a; /* courbe « mâles » sur le graphe population (visible sur fond sombre) */
  --pollen: #e3a93a;   /* pollen */
  --honey: #edcb56;    /* miel */
  --empty: #39403a;    /* cellule vide */
  --dead: #9c4a3c;     /* couvain mort */
  --chalk: #d2cfc6;    /* couvain plâtré (momies) */
  --mite: #d9694a;     /* charge varroa */
  --disease: #a765c9;  /* niveau d'infection (maladies) */
  --hornet: #e08a1e;   /* pression frelon asiatique */
}

body { font-feature-settings: 'tnum' 1; }

/* ---------- Onglets ---------- */
.tab-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
  border-radius: 8px;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text); background: #ffffff0a; }
.tab-btn.is-active { color: #1a1d20; background: var(--mustard); }

/* ---------- Groupes de champs ---------- */
.field-group { padding-bottom: 4px; }
.field-group h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--mustard);
  margin-bottom: 8px;
}

/* ---------- Contrôles ---------- */
.ctl { display: block; margin-bottom: 10px; }
.ctl > span:first-child {
  display: block;
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 3px;
}
.ctl input[type="number"],
.ctl input[type="date"],
.ctl-select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 13px;
  outline: none;
}
.ctl input:focus, .ctl-select:focus { border-color: var(--mustard); }

.ctl input[type="range"] {
  width: 100%;
  accent-color: var(--mustard);
  margin-top: 4px;
}
.val {
  float: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--mustard);
}

.chk {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
  cursor: pointer;
}
.chk input { accent-color: var(--mustard); margin-top: 2px; }

.hint { font-size: 11.5px; color: var(--dim); line-height: 1.5; margin-top: 4px; }

.evt-add { display: flex; gap: 6px; align-items: center; }
.evt-date { max-width: 130px; }
/* Date éditable dans les listes d'événements (Santé / Interventions) */
.evt-date-edit {
  width: 48px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 12px;
  text-align: center;
}
.evt-date-edit:focus { outline: 1px solid var(--mustard); }
.evt-add input, .evt-add select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 13px;
}

.btn-mini {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-mini:hover { border-color: var(--mustard); color: var(--mustard); }

/* Interventions par BOUTONS calés sur le curseur de la timeline */
.evt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.act-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .3s, transform .1s;
}
.act-btn:hover { border-color: var(--mustard); color: var(--mustard); }
.act-btn:active { transform: scale(.96); }
/* Confirmation visuelle brève après un clic (l'action est posée au jour du curseur) */
.act-btn.act-done {
  background: var(--mustard);
  border-color: var(--mustard);
  color: #1a1d20;
}
.act-cursor-hint {
  background: color-mix(in srgb, var(--mustard) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--mustard) 35%, transparent);
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 10px;
  color: var(--text);
}

.btn-run {
  background: var(--mustard);
  color: #1a1d20;
  border-radius: 9px;
  padding: 11px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-run:hover { background: var(--mustard-bright); }
.btn-run:disabled { opacity: .6; cursor: wait; }

/* ---------- Cartes de résultats ---------- */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
}
.stat-card .k { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .03em; }
.stat-card .v { font-size: 22px; font-weight: 800; color: var(--text); margin-top: 2px; }
.stat-card.good .v { color: var(--pop); }
.stat-card.warn .v { color: var(--mite); }

/* Bouton « Afficher l'e-mail » du footer (révélation après captcha ALTCHA) */
.footer-reveal {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: var(--mustard); font: inherit; text-decoration: underline dotted;
}
.footer-reveal:hover { text-decoration: underline; }
.footer-reveal:disabled { opacity: .6; cursor: default; }

/* ---------- Bilan économique (sous les graphes) ---------- */
.econ-panel { max-width: 520px; }
.econ-body { margin-top: 4px; }
.econ-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 7px 2px; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.econ-lbl { color: var(--text); }
.econ-val { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.econ-plus { color: var(--pop); }
.econ-minus { color: var(--dim); }
.econ-total {
  border-bottom: none; margin-top: 4px; padding-top: 10px;
  border-top: 2px solid var(--line); font-size: 16px;
}
.econ-total .econ-lbl { font-weight: 800; }
.econ-total .econ-val { font-size: 18px; }

/* ---------- Graphiques ---------- */
.chartbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
}
.chart-title { font-size: 13px; font-weight: 600; color: var(--mustard); margin-bottom: 8px; }
.frame-varroa { font-size: 12px; font-weight: 400; color: var(--dim); }
.chart-canvas { width: 100%; height: 220px; display: block; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 8px;
}
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* ---------- Cadre honeycomb (SVG) ---------- */
.frame-wrap {
  width: 100%;
  aspect-ratio: 2.2 / 1;   /* proportions d'un cadre de corps Langstroth */
  background: #15181499;
  border-radius: 8px;
  overflow: hidden;
  padding: 6px;
}
/* Pas de transition : ~1700 alvéoles se mettent à jour à chaque image de lecture. */
.frame-svg polygon { shape-rendering: geometricPrecision; }

/* Panneau d'explication au clic sur une alvéole */
.frame-info {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.5;
  min-height: 1.5em;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 7px;
  border-left: 3px solid var(--line);
}
.frame-info.active { color: var(--text); border-left-color: var(--mustard); }
.frame-info b { color: var(--mustard); }

/* Encart flottant au survol d'une alvéole */
.cell-tip {
  position: absolute;
  pointer-events: none;
  max-width: 240px;
  background: rgba(20, 22, 25, 0.97);
  border: 1px solid var(--line);
  border-left: 3px solid var(--mustard);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  z-index: 10;
  opacity: 0;
  transition: opacity .08s;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
}
.cell-tip.show { opacity: 1; }
.cell-tip b { display: block; color: var(--mustard); margin-bottom: 2px; }
.cell-tip span { color: var(--dim); }

/* Vue corps de ruche : cadres portrait côte à côte */
.box-frames {
  display: flex;
  gap: 4px;
  width: 100%;
  height: 300px;
}
.box-frame {
  flex: 1 1 0;
  min-width: 0;
  background: #15181499;
  border-radius: 5px;
  padding: 3px;
}

/* Carte de localisation (Leaflet) */
.loc-map {
  height: 220px;
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  z-index: 0;
}
.loc-map .leaflet-control-attribution { font-size: 9px; }

/* Comparaison A/B/C */
.cmp-row {
  display: grid;
  gap: 5px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: 8px;
}
.cmp-head { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.cmp-head b { color: var(--text); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp-table th, .cmp-table td { text-align: left; padding: 6px 9px; border-bottom: 1px solid var(--line); }
.cmp-table th { color: var(--dim); font-weight: 600; }
.cmp-table td .dot { margin-right: 6px; }

.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
}

/* Infobulle de survol des graphiques */
.chart-tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--surface-2, #1b1e23);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  min-width: 120px;
}
.chart-tip .ct-date { font-weight: 700; color: var(--mustard); margin-bottom: 4px; }
.chart-tip .ct-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-tip .ct-row .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chal { border-left: 3px solid var(--mustard); }
.chal-win { border-left-color: var(--pop); }
.chal-lose { border-left-color: var(--mite); }

/* Encart Défi dédié */
.challenge-card {
  background: linear-gradient(180deg, rgba(224,168,46,0.10), var(--surface));
  border: 1px solid var(--line);
  border-left: 4px solid var(--mustard);
  border-radius: 11px;
  padding: 12px 14px;
}
.challenge-card .ch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.challenge-card .ch-name { font-size: 15px; font-weight: 700; color: var(--mustard); }
.challenge-card .ch-close { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 14px; }
.challenge-card .ch-close:hover { color: var(--mite); }
.challenge-card .ch-obj { font-size: 13px; color: var(--text); margin: 5px 0 9px; line-height: 1.5; }
.challenge-card .ch-actions { display: flex; gap: 6px; margin-top: 8px; }
.menu-hint { font-size: 11.5px; color: var(--dim); display: block; }

/* Encarts repliables sous le menu (Labo) */
.side-encart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.side-encart > summary {
  cursor: pointer;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 14px;
  color: var(--mustard);
  list-style: none;
  user-select: none;
}
.side-encart > summary::-webkit-details-marker { display: none; }
.side-encart > summary::after { content: ' ▸'; color: var(--dim); }
.side-encart[open] > summary::after { content: ' ▾'; }
.side-encart-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 14px; }

/* Encarts simples sous le menu (sauvegarde, modèle & sources) */
.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
}
.side-box-title { font-size: 13px; font-weight: 700; color: var(--mustard); margin-bottom: 9px; }
.challenge-card .ch-verdict { margin-top: 9px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; }
.challenge-card .ch-verdict.win { background: rgba(111,174,143,0.15); border: 1px solid var(--pop); color: var(--pop); }
.challenge-card .ch-verdict.lose { background: rgba(217,105,74,0.13); border: 1px solid var(--mite); color: #e79079; }

/* Statut temps réel (remplace le bouton de lancement) */
.live-status { font-size: 12px; color: var(--pop); min-height: 1.2em; }

/* Vue des HAUSSES : caisses empilées qui se remplissent de miel (animé) */
.super-stack { display: flex; flex-direction: column; gap: 4px; }
.super-box {
  position: relative; height: 38px; border-radius: 6px; overflow: hidden;
  background: repeating-linear-gradient(90deg, #23262c 0 10px, #262a30 10px 20px);
  border: 1px solid var(--anthra-line, #3a3f47);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}
.super-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(180deg, #f4d658, #e6b93c);
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.35);
  transition: height 0.55s cubic-bezier(.4,0,.2,1);
}
.super-label {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%); z-index: 2;
  font-size: 11px; font-weight: 600; color: #cfd3da; letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.super-pct {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2;
  font-size: 13px; font-weight: 700; color: #f3f4f6;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.super-pct.full { color: #1b1d22; text-shadow: 0 1px 1px rgba(255,255,255,.3); }
.super-label.full { color: #3a2c05; text-shadow: 0 1px 1px rgba(255,255,255,.25); }

/* Barre de temps : repères d'essaimage cliquables */
.scrub-wrap { position: relative; }
.timeline-row { row-gap: 0; }
.swarm-marks { position: absolute; left: 0; right: 0; top: 100%; height: 16px; pointer-events: none; }
/* Axe des MOIS sous la barre de temps : situe la saison (moins « nu ») */
.month-axis { position: absolute; left: 0; right: 0; top: calc(100% + 13px); height: 14px; pointer-events: none; }
.month-tick {
  position: absolute; transform: translateX(-50%); top: 3px;
  font-size: 9px; letter-spacing: .03em; color: var(--dim, #8a9098); white-space: nowrap; text-transform: uppercase;
}
.month-tick::before {
  content: ''; position: absolute; top: -5px; left: 50%; width: 1px; height: 4px;
  background: var(--anthra-line, #3a3f47);
}
/* Tooltip clair au survol d'un événement de la timeline */
.tl-tip {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0; transform: translateX(-50%);
  transition: opacity .12s; background: #12151a; border: 1px solid var(--anthra-line, #3a3f47);
  border-radius: 6px; padding: 5px 9px; font-size: 12px; color: #e8eaed; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.5); max-width: 260px;
}
.tl-tip.show { opacity: 1; }
.tl-tip b { color: var(--mustard, #e0a82e); }
.tl-tip .tl-date { color: var(--dim, #8a9098); margin-left: 4px; }
/* Marqueurs d'INTERVENTIONS au-dessus du scrubber (traitements, nourrissement, récoltes…) */
.event-marks { position: absolute; left: 0; right: 0; bottom: 100%; height: 16px; pointer-events: none; }
.event-tick {
  position: absolute; bottom: 0; transform: translateX(-50%);
  font-size: 12px; line-height: 1; cursor: pointer; pointer-events: auto;
  filter: drop-shadow(0 0 1px #000);
}
.event-tick:hover { transform: translateX(-50%) scale(1.3); }
.swarm-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 13px; line-height: 1; cursor: pointer; pointer-events: auto;
  filter: drop-shadow(0 0 2px #e0694a);
}
.swarm-tick:hover { transform: translateX(-50%) scale(1.25); }

/* Encart essaimage dans le coach */
.coach-swarm {
  background: rgba(224, 105, 74, 0.12);
  border-left: 3px solid var(--mite);
  border-radius: 6px;
  padding: 6px 9px;
  margin-bottom: 7px;
  font-size: 12.5px;
}
/* Encart frelon asiatique */
.coach-hornet {
  background: rgba(224, 138, 30, 0.14);
  border-left: 3px solid #e08a1e;
  border-radius: 6px;
  padding: 6px 9px;
  margin-bottom: 7px;
  font-size: 12.5px;
}

/* Intitulé de section (Ce jour / Résumé de la saison) */
.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin: 2px 0 -4px;
}

/* Panneau « Tous les paramètres du modèle » */
.params-title { font-size: 18px; font-weight: 700; color: var(--mustard); margin-bottom: 4px; }
.params-sub { font-size: 12px; color: var(--dim); margin-bottom: 14px; max-width: 820px; line-height: 1.5; }
.params-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-items: start; }
.param-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.param-card.wide { grid-column: 1 / -1; }
.param-card h3 { font-size: 13px; font-weight: 700; color: var(--mustard); margin-bottom: 8px; }
.param-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.param-tbl td { padding: 3px 5px; border-bottom: 1px solid var(--line); vertical-align: top; }
.param-tbl td:first-child { color: var(--dim); }
.param-tbl td:last-child { text-align: right; color: var(--text); font-weight: 600; word-break: break-word; }
.param-tbl th { color: var(--dim); font-weight: 600; padding: 5px 6px; border-bottom: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
.param-tbl.grid td { text-align: center; white-space: nowrap; }
.param-tbl.grid td:first-child { text-align: left; color: var(--text); font-weight: 600; }
.param-tbl.grid td:last-child { text-align: center; color: var(--text); font-weight: 400; }
.param-scroll { overflow-x: auto; }

/* Éditeur de paramètres */
.params-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.prm-row { padding: 7px 0; border-bottom: 1px solid var(--line); }
.prm-row:last-child { border-bottom: none; }
.prm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prm-label { font-size: 12.5px; color: var(--text); }
.prm-input {
  width: 96px; flex-shrink: 0; text-align: right;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--mustard);
  border-radius: 6px; padding: 3px 6px; font-size: 12.5px; font-weight: 600;
}
.prm-input:focus { border-color: var(--mustard); outline: none; }
.prm-desc { font-size: 11px; color: var(--dim); line-height: 1.45; margin-top: 3px; }

/* ---------- Coach ---------- */
.coach {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--mustard);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}
.coach:empty { display: none; }
.coach-explain { color: var(--dim); }
.coach-sub { color: var(--dim); }

/* Scrollbar discrète */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =============================================================================
   Accessibilité — menu + modes (dyslexie, grande police, contraste, daltonien)
   ========================================================================== */
/* Toggle Débutant / Expert */
.mode-toggle { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mode-btn {
  flex: 1; padding: 9px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
  background: var(--surface-2); color: var(--dim); border: none; transition: all .12s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.is-on { background: var(--mustard); color: #241a05; }
/* En mode Débutant, on masque tout ce qui est marqué expert-only. */
html.mode-beginner .expert-only { display: none !important; }

/* Petit ⓘ d'aide à côté d'un réglage (survol = explication de l'impact). */
.info-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  font-size: 10px; font-weight: 700; font-style: normal;
  background: var(--surface-2); color: var(--mustard); border: 1px solid var(--line);
  cursor: help; vertical-align: middle; user-select: none;
}
.info-i:hover { background: var(--mustard); color: #241a05; }
/* Ligne de label : texte + ⓘ côte à côte (sinon le ⓘ passe à la ligne). */
.ctl > span.ctl-lbl { display: flex; align-items: center; gap: 2px; }
.ctl > span.ctl-lbl .info-i { margin-left: 3px; }

/* Barre d'icônes accessibilité : clic = activer/désactiver, l'icône s'allume. */
.a11y-bar { display: flex; gap: 5px; }
.a11y-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; cursor: pointer;
  background: var(--surface-2); color: var(--dim);
  border: 1px solid var(--line); border-radius: 8px; transition: all .12s;
}
.a11y-btn.a11y-big { font-weight: 800; font-size: 13px; }
.a11y-btn:hover { border-color: var(--mustard); color: var(--text); }
.a11y-btn.active {
  background: var(--mustard); color: #241a05; border-color: var(--mustard-bright);
  box-shadow: 0 0 0 2px rgba(224, 168, 46, .3);
}

/* Grande police : agrandit toute l'interface proportionnellement. */
html.a11y-large { font-size: 118%; }

/* Police dyslexie : OpenDyslexic (embarquée localement, licence SIL OFL) +
   espacement aéré, pas d'italique. */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../assets/fonts/opendyslexic-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../assets/fonts/opendyslexic-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
html.a11y-dyslexia, html.a11y-dyslexia body {
  font-family: 'OpenDyslexic', 'Comic Sans MS', Verdana, sans-serif;
  letter-spacing: 0.02em; word-spacing: 0.06em; line-height: 1.7;
}
html.a11y-dyslexia i, html.a11y-dyslexia em { font-style: normal; font-weight: 700; }

/* Contraste élevé : textes plus clairs, bordures nettes, fonds plus sombres. */
html.a11y-contrast {
  --text: #ffffff; --dim: #d6dbe2; --line: #6b7683;
  --surface: #0c0e11; --surface-2: #14171b;
}
html.a11y-contrast body { background: #050607; }
html.a11y-contrast .hint, html.a11y-contrast .menu-hint { color: #c3cad3; }

/* Mode DALTONIEN : palette bleu/orange/jaune/magenta sûre (deutéranopie/protanopie)
   pour distinguer couvain, pollen, miel, larves, couvain mort et varroa sans
   dépendre de l'axe rouge-vert. */
html.a11y-colorblind {
  --brood:  #2f6db0;  /* couvain operculé → BLEU */
  --larvae: #f1efe6;  /* œufs/larves → clair */
  --drone:  #14375c;  /* couvain de mâle → bleu foncé */
  --pollen: #e8871e;  /* pollen → orange */
  --honey:  #f4cf1f;  /* miel → jaune */
  --dead:   #b83c9c;  /* couvain mort → magenta */
  --chalk:  #e6e6e6;  /* couvain plâtré → blanc cassé */
  --mite:   #d6218c;  /* varroa → magenta vif */
  --brood-c: #2f6db0;
  --drone-line: #e8871e; /* courbe « mâles » → orange (distinct du bleu couvain) */
}
