  :root {
    --bg: #0f1419;
    --bg-card: #1a232c;
    --bg-card-hover: #243240;
    --border: #2a3744;
    --text: #e6edf3;
    --text-dim: #8b98a5;
    --accent: #ffb454;
    --extinct: #d96570;
    --living: #6dc28f;
    --period-precambrian: #6b4f8e;
    --period-paleozoic: #5d8bb3;
    --period-mesozoic: #5fa667;
    --period-cenozoic: #c98b4e;
    --crisis: #e85c5c;
  }

  * { box-sizing: border-box; }

  /* Accessibilité : focus visible clair sur tous les éléments interactifs */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  /* Cibles tactiles min 44px (WCAG 2.5.8) — exclut les petits indicateurs */
  button:not(.crisis-icon):not(.lightbox-close):not(.phylo-node-toggle),
  [role="button"], a.header-btn { min-height: 44px; }

  html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  header {
    padding: 1.25rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
  }

  h1 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    font-weight: 600;
  }

  .header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
  }

  .header-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
  }

  .header-btn:hover { background: var(--bg-card-hover); border-color: var(--accent); }
  .header-btn img { display: block; }
  .header-btn.home-btn {
    padding: 0;
    overflow: hidden;
  }
  .header-btn.home-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.15);
    transition: filter 0.15s;
  }
  .header-btn.home-btn:hover img { filter: brightness(1.4); }

  /* Search */
  .search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
  }

  #search {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    -webkit-appearance: none;
    appearance: none;
  }

  #search::-webkit-search-cancel-button {
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    background: var(--text-dim);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19 6.4 17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z'/></svg>") no-repeat center;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19 6.4 17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z'/></svg>") no-repeat center;
    cursor: pointer;
  }

  #search:focus {
    outline: none;
    border-color: var(--accent);
  }

  .search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
    font-size: 0.9rem;
  }

  .search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 30;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  }

  .search-results[hidden] { display: none; }

  .search-result {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    color: var(--text);
    font: inherit;
  }

  .search-result:last-child { border-bottom: none; }
  .search-result:hover, .search-result.focused { background: var(--bg-card-hover); outline: none; }

  .search-result-name {
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
  }

  .search-result-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
  }

  .search-result mark {
    background: rgba(255,180,84,0.25);
    color: var(--accent);
    padding: 0 1px;
    border-radius: 2px;
  }

  .search-empty {
    padding: 0.6rem 0.75rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-style: italic;
  }

  main {
    max-width: 720px;
    margin: 0 auto;
  }

  .layout {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 0.6rem;
    padding: 0.6rem 0.6rem 0;
    align-items: start;
  }

  /* Le tree va explicitement dans la 2ᵉ colonne (la 1ʳᵉ est « occupée »
     visuellement par .timeline-wrap qui est fixed et hors-flow) */
  #tree {
    grid-column: 2;
    scroll-margin-top: calc(var(--header-h, 80px) + 8px);
  }

  /* Timeline (vertical, fixe — ne bouge pas au scroll de la page) */
  .timeline-wrap {
    position: fixed;
    top: calc(var(--header-h, 80px) + 8px);
    left: 0.6rem;
    width: 96px;
    height: calc(100vh - var(--header-h, 80px) - 24px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    z-index: 5;
  }

  .timeline-wrap::-webkit-scrollbar { display: none; }

  /* Hauteur fixe : zoom de la frise constant, indépendant de la taille
     du conteneur. Si la fenêtre est plus petite, on scrolle dedans. */
  .timeline-track {
    position: relative;
    width: 100%;
    min-height: 3400px;
  }

  @media (min-width: 700px) {
    .timeline-track { min-height: 3400px; }
  }

  /* Colonne des ères (gauche, texte vertical) */
  .era {
    position: absolute;
    left: 0;
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    letter-spacing: 0.04em;
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    z-index: 1;
    overflow: hidden;
  }

  .period {
    position: absolute;
    left: 18px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.95);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 3px;
    line-height: 1.1;
    z-index: 1;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    cursor: pointer;
  }

  .period:hover {
    filter: brightness(1.25);
  }

  /* Fiche période — réutilise le style crisis-detail */
  .period-detail { padding: 1rem; }

  .period-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .period-era-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    color: #fff;
  }

  /* Mini-arbre phylogénétique dans les pages de période */
  .period-phylo { margin-top: 0.5rem; }
  .period-phylo details {
    margin-left: 1rem;
    border-left: 1px solid var(--border);
    padding-left: 0.6rem;
  }
  .period-phylo > details { margin-left: 0; border-left: none; padding-left: 0; }
  .period-phylo summary {
    cursor: pointer;
    padding: 0.15rem 0;
    list-style: none;
    font-size: 0.85rem;
    line-height: 1.4;
  }
  .period-phylo summary::-webkit-details-marker { display: none; }
  .period-phylo summary::marker { display: none; content: ""; }
  .period-phylo summary::before { content: "▸ "; color: var(--text-dim); }
  .period-phylo details[open] > summary::before { content: "▾ "; }
  .period-phylo .phylo-name { font-weight: 600; }
  .period-phylo .phylo-sci { color: var(--text-dim); font-style: italic; font-size: 0.8rem; margin-left: 0.2rem; }
  .period-phylo .phylo-extinct { color: var(--extinct); font-size: 0.75rem; margin-left: 0.15rem; }
  .period-phylo .phylo-leaf {
    margin-left: 1rem;
    border-left: 1px solid var(--border);
    padding: 0.15rem 0 0.15rem 0.6rem;
    font-size: 0.85rem;
  }
  .period-phylo .phylo-sp {
    margin-left: 1rem;
    padding: 0.1rem 0 0.1rem 0.6rem;
    border-left: 1px solid var(--border);
    font-size: 0.78rem;
    font-style: italic;
  }
  .period-phylo .phylo-sp a { color: var(--text-dim); text-decoration: none; }
  .period-phylo .phylo-sp a:hover { color: var(--accent); text-decoration: underline; }
  .period-phylo .phylo-clade-link { color: inherit; text-decoration: none; }
  .period-phylo .phylo-clade-link:hover .phylo-name { color: var(--accent); }
  .period-phylo .phylo-thumb {
    width: 28px; height: 28px; border-radius: 4px;
    object-fit: contain; background: var(--bg); border: 1px solid var(--border);
    vertical-align: middle; margin-right: 0.3rem;
  }

  .period-duration {
    display: inline-block;
    font-size: 0.78rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    margin-top: 0.25rem;
  }

  /* Crise — pastille cliquable au bord droit du bloc périodes */
  .crisis-icon {
    position: absolute;
    right: 4px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    padding: 0;
    background: var(--crisis);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    cursor: pointer;
    z-index: 4;
    box-shadow: 0 0 6px rgba(232,92,92,0.6);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    color: white;
    font: 700 10px/1 Georgia, "Times New Roman", serif;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .crisis-icon::after { content: "!"; }

  .crisis-icon:hover,
  .crisis-icon:focus-visible {
    transform: translate(50%, -50%) scale(1.25);
    box-shadow: 0 0 10px rgba(232,92,92,0.9);
    outline: none;
  }

  /* Fiche détaillée d'une crise (remplace la vue "arbre") */
  .crisis-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--crisis);
    border-radius: 0.6rem;
    padding: 0.85rem 0.9rem;
  }

  .crisis-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
  }

  .crisis-mortality {
    display: inline-block;
    background: rgba(232,92,92,0.15);
    border: 1px solid rgba(232,92,92,0.45);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    color: var(--crisis);
    font-weight: 600;
  }

  .crisis-section { margin: 1rem 0 0; }

  .crisis-section h3 {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-dim);
    margin: 0 0 0.3rem;
    font-weight: 600;
  }

  .crisis-section p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.55;
  }

  .crisis-section ul {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .crisis-section li { margin: 0.2rem 0; }

  .scale-axis {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 26px;
  }

  /* Active node marker on timeline */
  .active-marker {
    position: absolute;
    left: -3px;
    right: -3px;
    height: 0;
    border-top: 2px dashed var(--accent);
    box-shadow: 0 0 8px rgba(255,180,84,0.6);
    pointer-events: none;
    transition: top 0.25s ease;
    opacity: 0;
    z-index: 5;
  }

  .active-marker.visible { opacity: 1; }

  .active-marker::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -5px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255,180,84,0.8);
  }

  .active-marker-label {
    position: absolute;
    right: 30px;
    top: -8px;
    font-size: 0.6rem;
    color: var(--accent);
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    border: 1px solid var(--accent);
    max-width: calc(100vw - 120px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Repère de disparition (rouge) + bande de durée de vie reliant les deux */
  .extinction-marker {
    position: absolute;
    left: -3px;
    right: -3px;
    height: 0;
    border-top: 2px dashed var(--extinct);
    box-shadow: 0 0 6px rgba(217,101,112,0.5);
    pointer-events: none;
    transition: top 0.25s ease;
    opacity: 0;
    z-index: 5;
  }

  .extinction-marker.visible { opacity: 1; }

  .extinction-marker::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -5px;
    width: 8px;
    height: 8px;
    background: var(--extinct);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(217,101,112,0.8);
  }

  .extinction-marker-label {
    position: absolute;
    right: 30px;
    top: -8px;
    font-size: 0.6rem;
    color: var(--extinct);
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    border: 1px solid var(--extinct);
    max-width: calc(100vw - 120px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lifespan-band {
    position: absolute;
    left: 50%;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent), var(--extinct));
    pointer-events: none;
    transition: top 0.25s, height 0.25s;
    opacity: 0;
    z-index: 4;
    transform: translateX(-50%);
    border-radius: 2px;
  }

  .lifespan-band.visible { opacity: 0.55; }

  /* Shared utilities */
  .node-sci {
    font-style: italic;
    font-weight: 400;
    color: var(--text-dim);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
  }

  .badge {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .badge-extinct { background: rgba(217,101,112,0.18); color: var(--extinct); }
  .badge-living  { background: rgba(109,194,143,0.16); color: var(--living); }

  .age {
    color: var(--accent);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  /* Breadcrumb */
  .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.15rem;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.65rem;
    line-height: 1.3;
  }

  .bc-link, .bc-current {
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
  }

  .bc-link {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    font: inherit;
  }

  .bc-link:hover, .bc-link:active {
    background: var(--bg-card);
  }

  .bc-current {
    color: var(--text);
    font-weight: 600;
    background: var(--bg-card);
  }

  .bc-sep {
    color: var(--text-dim);
    opacity: 0.5;
    user-select: none;
  }

  /* Current node card */
  .current-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0.6rem;
    padding: 0.85rem 0.9rem;
    margin-bottom: 0.85rem;
  }

  .current-name {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.3;
  }

  .current-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-dim);
  }

  .current-desc {
    margin: 0.55rem 0 0;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.55;
  }

  /* Encart standardisé sous le nom : badges Apparition + (Disparition) */
  .entity-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 0.7rem;
    font-size: 0.78rem;
  }

  .date-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    white-space: nowrap;
  }

  .date-badge.date-app {
    border-color: rgba(255,180,84,0.45);
    color: var(--accent);
    background: rgba(255,180,84,0.08);
  }

  .date-badge.date-ext {
    border-color: rgba(217,101,112,0.45);
    color: var(--extinct);
    background: rgba(217,101,112,0.08);
  }

  .date-badge .age {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  /* Children list */
  .children-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0.2rem 0 0.4rem;
  }

  .child-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .child-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.65rem 0.8rem;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    font: inherit;
    width: 100%;
    transition: background 0.12s, border-color 0.12s, transform 0.06s;
    -webkit-tap-highlight-color: transparent;
  }

  .child-body { flex: 1; min-width: 0; }

  .child-card:hover { background: var(--bg-card-hover); border-color: var(--accent); }
  .child-card:active { transform: scale(0.99); }
  .child-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .child-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
  }

  .child-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
  }

  .chevron {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 0.9rem;
  }

  .leaf-msg {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-style: italic;
    padding: 0.6rem 0.2rem;
    margin: 0;
  }

  /* Liste des espèces issues de PaleoBioDB (binôme italique) */
  .pbdb-species-name { font-style: italic; font-weight: 500; }

  .pbdb-filter-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0 0.6rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    flex-wrap: wrap;
  }

  .pbdb-filter {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    flex: 1;
    min-width: 150px;
    max-width: 320px;
    cursor: pointer;
  }

  .pbdb-filter:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

  /* Champ de filtre fuzzy en haut de la liste d'une page clade */
  .clade-filter-wrap { margin: 0.6rem 0 0.5rem; }

  .clade-filter {
    width: 100%;
    padding: 0.45rem 0.7rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    -webkit-appearance: none;
    appearance: none;
  }

  .clade-filter:focus { outline: none; border-color: var(--accent); }

  /* Liste d'espèces représentatives (feuilles d'arbre) */
  .species-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .species-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.83rem;
    line-height: 1.35;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    font-family: inherit;
    width: 100%;
    transition: background 0.12s, border-color 0.12s;
    -webkit-tap-highlight-color: transparent;
  }

  .species-item:hover { background: var(--bg-card-hover); border-color: var(--accent); }
  .species-item:active { transform: scale(0.99); }
  .species-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* Miniature à gauche dans les listes (pré-calculée dans thumbnails/).
     64px = doublé par rapport au 36px d'origine pour tirer parti des fichiers
     webp 144×144 (raster 2× rétina). Reste suffisamment compact pour ne pas
     casser la mise en page de `.species-item` (padding 0.45rem · gap 0.4rem). */
  .species-thumb {
    width: 64px;
    height: 64px;
    border-radius: 5px;
    object-fit: contain;       /* letterbox au lieu de crop */
    flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--border);
  }

  .species-name { font-weight: 500; }

  .species-sci {
    font-style: italic;
    color: var(--text-dim);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
  }

  .species-note {
    font-size: 0.65rem;
    color: var(--extinct);
    background: rgba(217,101,112,0.14);
    border: 1px solid rgba(217,101,112,0.3);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
  }

  .species-age {
    font-size: 0.7rem;
    color: var(--accent);
    background: rgba(255,180,84,0.13);
    border: 1px solid rgba(255,180,84,0.3);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    white-space: nowrap;
  }

  .species-chevron { margin-left: auto; color: var(--text-dim); font-size: 0.9rem; }

  /* Fiche détaillée d'une espèce (issue de Wikipédia FR) */
  .species-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0.6rem;
    padding: 0.85rem 0.9rem;
  }

  .species-detail h2 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
  }

  .species-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
  }

  .species-image-wrap {
    margin: 0.6rem 0 0.85rem;
    border-radius: 0.4rem;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
    position: relative;
    min-height: 80px;
  }

  .species-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 55vh;
    object-fit: contain;
    background: #000;
  }

  .species-loader {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
  }

  /* Marquage des illustrations générées par IA (EU AI Act, art. 50) */
  .ai-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(15, 20, 25, 0.78);
    color: #e6edf3;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 99px;
    border: 1px solid rgba(255, 180, 84, 0.35);
    pointer-events: auto;
    z-index: 1;
    backdrop-filter: blur(2px);
  }
  .ai-credit {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-align: center;
    padding: 0.4rem 0.6rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
  }
  .ai-credit a { color: var(--text-dim); text-decoration: underline; }
  .ai-credit a:hover { color: var(--accent); }

  .species-extract {
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0.5rem 0 1rem;
    white-space: pre-wrap;
    color: var(--text);
  }
  .species-fetched-at {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-left: 0.4rem;
    white-space: nowrap;
  }

  .species-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.82rem;
    border: 1px solid var(--accent);
    border-radius: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: transparent;
  }

  .species-link:hover { background: rgba(255,180,84,0.1); }

  .species-error {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.85rem;
    margin: 0.5rem 0 1rem;
  }

  .species-sources {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .species-sources a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    overflow-wrap: anywhere;
  }

  .species-sources a:hover { text-decoration: underline; }

  .species-sources li::before {
    content: "↗";
    color: var(--text-dim);
    margin-right: 0.3rem;
  }

  .species-lang-note {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-dim);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.2rem 0.5rem;
    margin-bottom: 0.5rem;
  }

  /* ---------- Onglets images espèce ---------- */
  .species-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 0.4rem 0.4rem 0 0;
    overflow-x: auto;
  }
  .species-tab {
    flex: 1;
    padding: 0.45rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
  }
  .species-tab:hover { color: var(--text); }
  .species-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }
  .species-tab-panel {
    display: none;
    position: relative;
  }
  .species-tab-panel.active {
    display: block;
  }
  .species-tab-panel img,
  .species-tab-panel video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 55vh;
    object-fit: contain;
  }
  .species-tab-panel video { background: #000; }
  .species-tab-panel.tab-phylopic img {
    background: #1a232c;
    filter: invert(1) brightness(0.95);
    padding: 0.7rem;
    box-sizing: border-box;
    max-height: 26vh;
  }
  .species-tab-panel.tab-scale img,
  .species-tab-panel.tab-dist img {
    background: #f5f5f5;
    max-height: 38vh;
  }
  .species-tab-attribution {
    font-size: 0.62rem;
    color: var(--text-dim);
    padding: 0.35rem 0.6rem;
    background: var(--bg);
  }
  .species-tab-attribution a { color: var(--accent); text-decoration: none; }
  .species-tab-attribution a:hover { text-decoration: underline; }

  /* Carte des sites fossilifères (Leaflet) */
  .fossil-map-wrap {
    margin: 0.85rem 0;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
  }

  .fossil-map-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.6rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
  }

  .fossil-map { height: 300px; background: var(--bg); }

  /* Rend la popup Leaflet conforme au thème sombre */
  .leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: var(--bg-card) !important;
    color: var(--text) !important;
  }

  .leaflet-control-attribution {
    background: rgba(0,0,0,0.6) !important;
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.6rem !important;
  }
  .leaflet-control-attribution a { color: var(--accent) !important; }

  /* Page Carte des sites fossiles (plein écran sous le header) */
  .sites-page {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h, 80px) - 24px);
  }

  .sites-page-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.7rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
  }

  .sites-page-title { font-weight: 600; }
  .sites-page-stats { color: var(--text-dim); font-size: 0.78rem; margin-left: auto; }

  .sites-filters {
    padding: 0.5rem 0.6rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .sites-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .sites-filter-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
  }

  .sites-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .sites-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    color: var(--text);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s, border-color 0.12s;
  }

  .sites-chip:hover { border-color: var(--accent); }

  .sites-chip[aria-pressed="true"] {
    background: rgba(255,180,84,0.18);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
  }

  .sites-period {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    padding: 0.25rem 0.5rem;
    flex: 1;
    min-width: 180px;
    cursor: pointer;
  }

  .sites-page-map { flex: 1; min-height: 200px; }

  /* Popup species list (sites map) */
  .site-popup-species {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 320px;
    max-height: 220px;
    overflow-y: auto;
  }

  .site-popup-species .species-thumb {
    width: 32px;
    height: 32px;
    cursor: pointer;
  }

  .site-popup-loader {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 0.4rem;
  }

  /* Bouton de zoom sur image (coin supérieur droit) */
  .image-zoom-btn {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    background: rgba(0,0,0,0.65);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.4rem;
    padding: 0.3rem 0.45rem;
    cursor: pointer;
    color: white;
    font-size: 0.95rem;
    line-height: 1;
    z-index: 5;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
  }

  .image-zoom-btn:hover, .image-zoom-btn:focus-visible {
    background: rgba(0,0,0,0.9);
    outline: none;
  }

  /* Navigation entre espèces sœurs */
  .species-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .species-nav-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.35rem 0.55rem;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    flex: 1;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .species-nav-btn:hover:not(:disabled) { background: var(--bg-card-hover); border-color: var(--accent); }
  .species-nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .species-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: var(--text-dim);
  }

  .species-nav-prev { justify-content: flex-start; }
  .species-nav-next { justify-content: flex-end; }

  .species-nav-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }

  .species-nav-pos {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    padding: 0 0.3rem;
  }

  /* Lightbox plein écran */
  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    cursor: zoom-out;
  }

  .lightbox[hidden] { display: none; }

  .lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-out;
  }

  .lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .lightbox-close:hover { background: rgba(0,0,0,0.85); }

  footer {
    text-align: center;
    /* padding-left pour ne pas être masqué par la frise fixed (96px + gap) */
    padding: 1.5rem 1rem 2rem calc(96px + 1.5rem);
    font-size: 0.7rem;
    color: var(--text-dim);
    max-width: 720px;
    margin: 0 auto;
  }

  footer a { color: var(--accent); text-decoration: none; }
  body.sites-active footer { display: none; }

  /* ── Arbre phylogénétique graphique (#phylo) ── */

  /* En mode sites, masquer la frise et occuper toute la largeur */
  body.sites-active .timeline-wrap { display: none; }
  body.sites-active main { max-width: none; padding: 0; }
  body.sites-active .layout { grid-template-columns: 1fr; padding: 0.5rem; }
  body.sites-active #tree { grid-column: 1; }

  /* Mode Home : masque la frise et l'arbre, affiche #home */
  body.home-active .timeline-wrap,
  body.home-active #tree { display: none; }
  body:not(.home-active) #home { display: none; }
  body.home-active #home { display: block; }
  body.home-active .layout { display: block; }

  /* En mode phylo, la frise s'élargit et couvre tout le fond ;
     #tree se superpose dans la même cellule de grille. */
  body.phylo-active .layout {
    grid-template-columns: 1fr;
    padding: 0.6rem;
    overflow-x: auto;
  }

  body.phylo-active .timeline-wrap {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    overflow: visible;
    grid-column: 1;
    grid-row: 1;
    border-radius: 0.6rem;
    padding: 0;
    z-index: 1;
  }

  body.phylo-active .timeline-track {
    height: 2400px;
  }

  /* Bandes de périodes pleine largeur */
  body.phylo-active .period {
    right: 0;
    justify-content: flex-start;
    padding-left: 24px;
    font-size: 0.75rem;
    opacity: 0.85;
  }

  body.phylo-active .era {
    width: 20px;
    font-size: 0.55rem;
  }

  .era-boundary-label {
    position: absolute;
    left: 20px;
    transform: translateY(-50%);
    font-size: 0.5rem;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
  }

  body.phylo-active .era-boundary-label {
    left: 22px;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.45);
  }

  body.phylo-active .scale-axis { display: none; }
  body.phylo-active .crisis-icon { display: none; }
  body.phylo-active .active-marker,
  body.phylo-active .extinction-marker,
  body.phylo-active .lifespan-band { display: none !important; }

  body.phylo-active #tree {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 3;
    pointer-events: none;
  }

  body.phylo-active #tree > * { pointer-events: auto; }


  .phylo-canvas {
    position: relative;
    width: 100%;
    pointer-events: none;
  }

  .phylo-canvas > * { pointer-events: auto; }

  /* SVG pour les lignes de connexion */
  .phylo-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
  }

  .phylo-svg line {
    stroke: var(--border);
    stroke-width: 1.5;
  }

  /* Noeuds de l'arbre */
  .phylo-node {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 3;
    cursor: pointer;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .phylo-node:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: 0 0 8px rgba(255,180,84,0.25);
    z-index: 5;
  }

  .phylo-node[data-expanded="true"] {
    border-color: var(--accent);
    background: #2a2118;
  }

  .phylo-node-name { font-weight: 600; }
  .phylo-node-sci  { color: var(--text-dim); font-size: 0.62rem; font-style: italic; margin-left: 0.2rem; }
  .phylo-node-age  { font-size: 0.58rem; color: var(--text-dim); margin-left: 0.25rem; }

  .phylo-node-toggle {
    font-size: 0.6rem;
    color: var(--accent);
    margin-right: 0.15rem;
  }

  .phylo-node.extinct { border-left: 2px solid var(--extinct); }
  .phylo-node.leaf    { border-left: 2px solid var(--living); cursor: default; }
  .phylo-node.leaf:hover { border-color: var(--living); }

  .phylo-node.leaf {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.3rem 0.4rem;
    gap: 0.15rem;
  }

  .phylo-node-thumb {
    max-width: 72px;
    max-height: 72px;
    border-radius: 4px;
    object-fit: contain;
    background: var(--bg);
    border: 1px solid var(--border);
  }

  .phylo-species {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 3;
    background: rgba(109,194,143,0.1);
    border: 1px solid rgba(109,194,143,0.3);
    border-radius: 0.3rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.6rem;
    white-space: nowrap;
    color: var(--living);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
  }

  .phylo-species.extinct-sp {
    background: rgba(217,101,112,0.1);
    border-color: rgba(217,101,112,0.3);
    color: var(--extinct);
  }

  .phylo-species:hover { background: rgba(109,194,143,0.2); border-color: rgba(109,194,143,0.5); }
  .phylo-species.extinct-sp:hover { background: rgba(217,101,112,0.2); border-color: rgba(217,101,112,0.5); }

  /* ── Mobile (< 700px) : on cache la frise pour libérer toute la largeur ──
     La frise reste affichée en mode #phylo (où elle EST le contenu principal).
     #sites cache déjà la frise via body.sites-active. */
  @media (max-width: 699px) {
    body:not(.phylo-active) .timeline-wrap { display: none; }
    body:not(.phylo-active) .layout { grid-template-columns: 1fr; }
    body:not(.phylo-active) #tree { grid-column: 1; min-width: 0; }
    body:not(.phylo-active) footer { padding-left: 1rem; }
    /* Filet anti-débordement (grid blowout, image hors classe, etc.).
       `clip` plutôt que `hidden` pour ne pas casser position:sticky du header. */
    body:not(.phylo-active) { overflow-x: clip; }
  }

  @media (min-width: 700px) {
    /* ── Desktop : typographie agrandie, marges réduites, accessibilité ── */
    html { font-size: 118%; }
    main { max-width: none; padding: 0 2rem; }
    h1 { font-size: 1.65rem; }
    header { padding: 1.1rem 1.5rem 0.7rem; }

    .layout { grid-template-columns: 140px 1fr; gap: 1.2rem; padding: 1rem 1rem 0; }
    .timeline-wrap {
      width: 140px;
      left: calc(2rem + 1rem);
    }
    .period { font-size: 0.7rem; }
    .era { font-size: 0.65rem; width: 22px; }
    .period { left: 22px; }

    /* Cartes et contenus */
    .current-card, .crisis-detail, .species-detail, .period-detail { padding: 1.2rem 1.4rem; }
    .current-name, .crisis-title, .species-detail h2 { font-size: 1.35rem; }
    .current-desc, .crisis-section p, .crisis-section ul,
    .species-extract { font-size: 1rem; line-height: 1.7; }
    .current-meta, .species-detail-meta { font-size: 0.9rem; }
    .crisis-section h3 { font-size: 0.78rem; }
    .crisis-mortality { font-size: 0.82rem; padding: 0.2rem 0.7rem; }

    /* Breadcrumb */
    .breadcrumb { font-size: 0.88rem; gap: 0.15rem 0.2rem; }

    /* Listes enfants */
    .children-label { font-size: 0.78rem; }
    .child-card { padding: 0.8rem 1rem; }
    .child-header { font-size: 1.05rem; }
    .child-meta { font-size: 0.82rem; }

    /* Espèces */
    .species-item { font-size: 0.95rem; padding: 0.55rem 0.8rem; }
    .species-thumb { width: 72px; height: 72px; }
    .species-sci { font-size: 0.88rem; }
    .species-note, .species-age { font-size: 0.78rem; }
    .species-chevron { font-size: 1rem; }
    .species-link { font-size: 0.92rem; padding: 0.4rem 0.85rem; }
    .species-sources a { font-size: 0.92rem; }
    .species-loader { font-size: 0.95rem; }
    .species-error { font-size: 0.95rem; }
    .species-lang-note { font-size: 0.8rem; }

    /* Badges */
    .badge { font-size: 0.7rem; padding: 0.08rem 0.5rem; }
    .node-sci { font-size: 0.92rem; }
    .entity-dates { font-size: 0.88rem; }
    .date-badge { padding: 0.25rem 0.7rem; }

    /* Recherche */
    #search { font-size: 1rem; padding: 0.6rem 0.85rem 0.6rem 2.2rem; }
    .search-icon { font-size: 1rem; left: 0.7rem; }
    .search-result { padding: 0.65rem 0.85rem; }
    .search-result-name { font-size: 1rem; }
    .search-result-meta { font-size: 0.8rem; }

    /* Boutons header */
    .header-btn { width: 44px; height: 44px; font-size: 1.25rem; }

    /* Navigation espèces */
    .species-nav-btn { font-size: 0.95rem; }
    .species-nav-name { font-size: 0.88rem; }
    .species-nav-pos { font-size: 0.85rem; }

    /* Filtre clade */
    .clade-filter { font-size: 0.95rem; padding: 0.55rem 0.8rem; }
    .pbdb-filter { font-size: 0.88rem; }

    /* Marqueur timeline */
    .active-marker-label, .extinction-marker-label { font-size: 0.7rem; }

    /* Footer */
    footer { padding-left: calc(140px + 2rem); padding-right: 1.5rem; font-size: 0.9rem; }

    /* Phylo */
    body.phylo-active .layout { grid-template-columns: 1fr; gap: 0; padding: 1rem; }
    body.phylo-active .timeline-wrap { left: auto; width: 100%; }
  }

  /* ----- Home ----- */
  .home {
    padding: 1rem;
    max-width: 1100px;
    margin: 0 auto;
  }

  .home-featured {
    position: relative;
    background-color: var(--bg-card);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 240px;
    text-decoration: none;
    color: inherit;
    isolation: isolate;
  }
  .home-featured::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 20, 25, 0.92) 0%, rgba(15, 20, 25, 0.65) 45%, rgba(15, 20, 25, 0.1) 100%);
    z-index: -1;
  }
  .home-featured:hover { border-color: var(--accent); }
  .home-featured .home-featured-text { padding: 1.25rem 1.5rem; }
  .home-featured .badge {
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .home-featured .name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.3rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  }
  .home-featured .desc {
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.92;
    margin-top: 0.3rem;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  }
  .home-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  .home-nav-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.9rem 0.7rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
  }
  .home-nav-card:hover { background: var(--bg-card-hover); border-color: var(--accent); }
  .home-nav-card .ico { font-size: 1.6rem; }
  .home-nav-card .ttl { font-weight: 600; font-size: 0.9rem; }
  .home-nav-card .sub { font-size: 0.75rem; color: var(--text-dim); }
  .home-periods {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.9rem 1rem;
    margin-top: 0.75rem;
  }
  .home-periods h3 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    color: var(--accent);
  }
  .home-pill {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    margin: 0.15rem 0.2rem 0.15rem 0;
    text-decoration: none;
  }
  .home-pill:hover { background: var(--bg-card-hover); }
  .home-pill.era-paleozoic { border-color: var(--period-paleozoic); color: var(--period-paleozoic); }
  .home-pill.era-mesozoic { border-color: var(--period-mesozoic); color: var(--period-mesozoic); }
  .home-bento {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .home-nav-grid { margin-top: 0; }

  .home-news {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.9rem 1rem;
  }
  .home-news h3 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    color: var(--accent);
  }
  .home-news-list { list-style: none; padding: 0; margin: 0; }
  .home-news-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
  }
  .home-news-item:last-child { border-bottom: 0; padding-bottom: 0; }
  .home-news-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.2rem;
  }
  .home-news-source {
    background: var(--bg-card-hover);
    color: var(--accent);
    padding: 0.05rem 0.45rem;
    border-radius: 99px;
    font-weight: 600;
    letter-spacing: 0.03em;
  }
  .home-news-title {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.35;
    text-decoration: none;
  }
  .home-news-title:hover { color: var(--accent); }

  .home-news-skel {
    background: var(--bg-card-hover);
    border-radius: 3px;
    height: 0.7rem;
    margin: 0.4rem 0;
    animation: skel-pulse 1.4s ease-in-out infinite;
  }
  .home-news-skel.short { width: 35%; }
  .home-news-skel.med { width: 80%; }
  @keyframes skel-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
  }

  .home-news-empty {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.8rem;
    padding: 0.5rem 0;
    text-align: center;
  }

  .home-bento-right {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  @media (min-width: 720px) {
    .home-bento {
      display: grid;
      grid-template-columns: 1.4fr 1fr;
      gap: 0.5rem;
    }
    .home-featured { min-height: 320px; }
    .home-bento-right {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    .home-nav-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
  }

/* Écran d'erreur du boot (Firestore injoignable) */
.boot-error { max-width: 32rem; margin: 4rem auto; text-align: center; padding: 1.5rem; }
.boot-error .boot-retry { margin-top: 1rem; padding: 0.5rem 1rem; cursor: pointer; }
