/*
Polices de la bible de Dynastie.
Alegreya : Copyright 2011 The Alegreya Project Authors (github.com/huertatipografica/Alegreya).
Alegreya Sans : Copyright 2013 The Alegreya Sans Project Authors (github.com/huertatipografica/Alegreya-Sans).
IBM Plex Mono : Copyright 2017 IBM Corp. with Reserved Font Name "Plex".

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
*/
@font-face { font-family: "Alegreya"; font-weight: 500; font-style: normal; font-display: swap; src: url(polices/alegreya-latin-500-normal.woff2) format("woff2") }
@font-face { font-family: "Alegreya"; font-weight: 700; font-style: normal; font-display: swap; src: url(polices/alegreya-latin-700-normal.woff2) format("woff2") }
@font-face { font-family: "Alegreya"; font-weight: 500; font-style: italic; font-display: swap; src: url(polices/alegreya-latin-500-italic.woff2) format("woff2") }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(polices/AlegreyaSans-Regular.woff2) format("woff2") }
@font-face { font-family: "Alegreya Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url(polices/AlegreyaSans-Medium.woff2) format("woff2") }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(polices/AlegreyaSans-Bold.woff2) format("woff2") }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url(polices/AlegreyaSans-Italic.woff2) format("woff2") }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url(polices/IBMPlexMono-Regular.woff2) format("woff2") }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url(polices/IBMPlexMono-Medium.woff2) format("woff2") }

/* Registre de colonie : sommaire à gauche comme un cahier de lignée, page au centre, renvois à droite.
   Un carré plein = bâti (implémenté), un carré cerné = validé, un carré pointillé = à bâtir (brouillon). */
:root {
  --bg: #eceee9;
  --paper: #f8f9f5;
  --ink: #1d2320;
  --muted: #5b6660;
  --line: #d2d8d1;
  --accent: #5b3f9c;
  --accent-soft: #ebe5f5;
  --p1: #8a6a24;
  --p2: #a1453a;
  --p3: #3a7748;
  --p4: #2a6892;
  --ok: #2f6b3f;
  --warn: #9a6a12;
  --ombre: rgb(20 30 25 / .18);
  --f-display: "Alegreya", Georgia, "Times New Roman", serif;
  --f-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121614; --paper: #191e1b; --ink: #e1e6e0; --muted: #98a39b; --line: #2c3530;
  --accent: #b7a0ec; --accent-soft: #2a2440; --p1: #d6b062; --p2: #e38a7c; --p3: #85c493; --p4: #79b4dd;
  --ok: #8fcf9d; --warn: #e0b45a; --ombre: rgb(0 0 0 / .5); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #121614; --paper: #191e1b; --ink: #e1e6e0; --muted: #98a39b; --line: #2c3530;
  --accent: #b7a0ec; --accent-soft: #2a2440; --p1: #d6b062; --p2: #e38a7c; --p3: #85c493; --p4: #79b4dd;
  --ok: #8fcf9d; --warn: #e0b45a; --ombre: rgb(0 0 0 / .5); color-scheme: dark }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 17px; line-height: 1.55; }
a { color: var(--accent) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
button { font: inherit; color: inherit }
[data-pil="durer"] { --pc: var(--p1) } [data-pil="transmettre"] { --pc: var(--p2) }
[data-pil="vivre"] { --pc: var(--p3) } [data-pil="découvrir"] { --pc: var(--p4) }

.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh }
aside.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); height: calc(100vh - env(safe-area-inset-top, 0px));
  overflow-y: auto; background: var(--paper); border-right: 1px solid var(--line);
  padding-block: 20px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.marque { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink) }
.vox { display: grid; grid-template-columns: repeat(3, 7px); gap: 2px; flex: none }
.vox i { width: 7px; height: 7px; background: var(--pc, var(--line)) }
.marque b { font-family: var(--f-display); font-size: 1.45rem; line-height: 1; letter-spacing: .01em }
.marque small { display: block; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 3px }
.recherche input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: .95rem;
}
.menu-bouton { display: none }
nav { display: flex; flex-direction: column; gap: 14px }
nav h4 { margin: 0 0 4px; font-family: var(--f-mono); font-size: .66rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px }
nav a {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 5px;
  color: var(--ink); text-decoration: none; font-size: .96rem; line-height: 1.3;
}
nav a:hover { background: var(--bg) }
nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 500 }
nav a .n { margin-left: auto; font-family: var(--f-mono); font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums }
.st { width: 10px; height: 10px; flex: none; display: inline-block; vertical-align: -1px }
.st-i { background: var(--pc, var(--ink)) }
.st-v { border: 2px solid var(--pc, var(--ink)) }
.st-b { border: 1.5px dashed var(--pc, var(--muted)) }
.legende { margin-top: auto; font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px }
.legende span { display: flex; align-items: center; gap: 8px }
.legende code { font-family: var(--f-mono); font-size: .72rem }
.legende .pils { display: flex; flex-wrap: wrap; gap: 4px 10px }

main { min-width: 0; padding-block: 24px 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.barre { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto 20px; font-size: .85rem; color: var(--muted) }
.barre code { font-family: var(--f-mono); font-size: .78rem }
.bascule { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper) }
.bascule button { border: 0; background: none; padding: 4px 12px; cursor: pointer; font-size: .82rem; color: var(--muted) }
.bascule button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 500 }
.vue { max-width: 1180px; margin: 0 auto }

h1, h2, h3, h4 { font-family: var(--f-display); text-wrap: balance; line-height: 1.15 }
h1 { font-size: 2.4rem; margin: 0 0 10px; font-weight: 700 }
.oeil { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px }
.oeil code { text-transform: none; letter-spacing: 0 }
.chapeau { font-size: 1.2rem; color: var(--muted); max-width: 62ch; margin: 0 0 18px }
.chapeau code { font-family: var(--f-mono); font-size: .8em }

/* Page d'un sujet */
.grille-page { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 40px; align-items: start }
article { min-width: 0 }
.fiche { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 0; border-block: 1px solid var(--line); margin-bottom: 16px; font-size: .92rem }
.fiche > div { display: flex; flex-direction: column; gap: 2px }
.fiche .k { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.fiche .v { display: flex; align-items: center; gap: 6px; font-weight: 500; font-variant-numeric: tabular-nums }
.fiche code { font-family: var(--f-mono); font-size: .8rem; font-weight: 400 }
.note { font-size: .88rem; color: var(--muted); margin: -4px 0 14px }
.liens { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; font-size: .9rem }
.liens > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center }
.liens .k { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-width: 74px }
.puce-page {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; font-size: .86rem; cursor: pointer;
}
.puce-page:hover { border-color: var(--accent) }
.puce-page em { font-style: normal; font-family: var(--f-mono); font-size: .68rem; color: var(--muted) }
details.chemins { margin-bottom: 20px; font-size: .88rem }
details.chemins summary { cursor: pointer; color: var(--muted) }
details.chemins code { display: block; font-family: var(--f-mono); font-size: .78rem; color: var(--muted); padding: 1px 0; overflow-wrap: anywhere }

.prose { max-width: 74ch; overflow-wrap: break-word }
.prose h2 { font-size: 1.6rem; margin: 1.8em 0 .5em; padding-top: .5em; border-top: 1px solid var(--line) }
.prose h3 { font-size: 1.22rem; margin: 1.6em 0 .4em }
.prose h4 { font-size: 1.08rem; margin: 1.2em 0 .3em }
.prose p, .prose li { margin: .45em 0 }
.prose ul, .prose ol { padding-left: 1.3em }
.prose li > ul { margin-top: .2em }
.prose strong { font-weight: 700 }
.prose del, .tbl del { color: var(--muted); text-decoration-thickness: 1px }
.rw { color: var(--muted); font-size: .9em }
.prose blockquote { margin: 1em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--line); color: var(--muted) }
.prose code, .tbl code { font-family: var(--f-mono); font-size: .84em; background: var(--bg); padding: 1px 4px; border-radius: 3px; overflow-wrap: anywhere }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0 }
.en-vigueur del, .en-vigueur .rw, .en-vigueur .barre-entier { display: none }
li.def { scroll-margin-top: 30vh; border-radius: 4px }
li.def.eclair { animation: eclair 1.8s ease-out }
@keyframes eclair { from { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft) } to { background: transparent; box-shadow: 0 0 0 6px transparent } }

.tbl { overflow-x: auto; margin: 1em 0; border: 1px solid var(--line); border-radius: 6px; background: var(--paper) }
.tbl table { border-collapse: collapse; width: 100%; font-size: .9rem; line-height: 1.4 }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--line) }
.tbl th { font-family: var(--f-mono); font-size: .66rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--bg) }
.tbl tr:last-child td { border-bottom: 0 }
.prose .tbl { max-width: none }

.code {
  display: inline; font-family: var(--f-mono); font-size: .78em; font-weight: 500; letter-spacing: .01em; line-height: 1.3;
  padding: 0 4px; border-radius: 3px; border: 0; background: var(--accent-soft); color: var(--accent); cursor: pointer; white-space: nowrap;
}
button.code:hover { outline: 1px solid var(--accent) }
.code.ext { background: transparent; color: var(--muted); cursor: help; outline: 1px dashed var(--line) }
.code.chantier { background: transparent; color: var(--muted); cursor: default }

.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 24px); font-size: .86rem; max-height: calc(100vh - 48px); overflow-y: auto }
.toc h4 { margin: 0 0 6px; font-family: var(--f-mono); font-size: .64rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
.toc a { display: block; padding: 3px 0 3px 10px; border-left: 1px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.3 }
.toc a:hover { color: var(--ink); border-color: var(--accent) }

/* Accueil */
.hero { padding: 6px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 30px }
.hero h1 { font-size: 3.4rem; margin-bottom: 12px }
.hero .pitch { font-family: var(--f-display); font-style: italic; font-size: 1.45rem; line-height: 1.35; max-width: 46ch; margin: 0 }
.chiffres { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 24px 0 0; padding: 0; list-style: none }
.chiffres li { display: flex; flex-direction: column }
.chiffres b { font-family: var(--f-display); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums }
.chiffres span { font-size: .82rem; color: var(--muted) }
section.bloc { margin: 0 0 40px }
section.bloc > h2 { font-size: 1.5rem; margin: 0 0 4px }
section.bloc > p.aide { margin: 0 0 16px; color: var(--muted); max-width: 70ch }
.aide code { font-family: var(--f-mono); font-size: .8em }
.piliers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px }
.pilier { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0 }
.pilier h3 { margin: 0; font-size: 1.35rem; display: flex; align-items: center; gap: 8px }
.pilier h3 .st { width: 14px; height: 14px; background: var(--pc) }
.pilier .oui { margin: 0; font-size: .95rem }
.pilier .non { margin: 0; font-size: .88rem; color: var(--muted); font-style: italic }
.pilier ul { list-style: none; margin: auto 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; font-size: .9rem }
.pilier ul a { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 7px; cursor: pointer }
.pilier ul a:hover { color: var(--accent) }
.couches { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper) }
.couche { display: grid; grid-template-columns: 150px minmax(0, 1fr); border-bottom: 1px solid var(--line) }
.couche:last-child { border-bottom: 0 }
.couche > .nom { padding: 14px; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--bg); border-right: 1px solid var(--line) }
.couche > .nom small { display: block; text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-size: .82rem; margin-top: 4px }
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 12px }
.carte { text-align: left; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; min-width: 0 }
.carte:hover { border-color: var(--accent) }
.carte b { font-family: var(--f-display); font-size: 1.1rem; display: flex; align-items: center; gap: 7px }
.carte p { margin: 0; font-size: .86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.carte .meta { margin-top: auto; font-family: var(--f-mono); font-size: .68rem; color: var(--muted); display: flex; gap: 4px 10px; flex-wrap: wrap }
.carte .meta .exc { color: var(--warn) }
.journal { list-style: none; margin: 0; padding: 0 }
.journal li { display: grid; grid-template-columns: 92px 70px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; align-items: baseline }
.journal time, .journal code { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums }
.marque-v, .marque-r { font-family: var(--f-mono); font-size: .66rem; padding: 0 6px; border-radius: 3px; margin-left: 6px; white-space: nowrap }
.marque-v { border: 1px solid var(--ok); color: var(--ok) }
.marque-r { border: 1px dashed var(--warn); color: var(--warn) }
.fraicheur { font-size: .85rem; color: var(--muted); max-width: 80ch }
.apercu { max-width: 1180px; margin: 0 auto 16px; padding: 10px 14px; border: 1px dashed var(--warn); border-radius: 6px; color: var(--warn); font-size: .9rem }
.apercu code { font-family: var(--f-mono); font-size: .8rem }
.aide-relire { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--warn); font-size: .9rem }
.fraicheur code { font-family: var(--f-mono); font-size: .78rem }

/* Index, filtres */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; align-items: center }
.filtres input[type="search"], .filtres select { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: .9rem; min-width: 0; max-width: 100% }
.filtres input[type="search"] { flex: 1 1 220px }
.filtres label { font-size: .88rem; display: flex; gap: 6px; align-items: center }
.filtres .compte { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums }
.tbl td.c { white-space: nowrap }
.tbl td .pg { color: var(--ink); text-decoration: none; cursor: pointer }
.tbl td .pg:hover { color: var(--accent) }
.tbl td small { display: block; color: var(--muted); font-size: .8rem }
.barres { display: flex; flex-direction: column; gap: 6px; max-width: 640px }
.barres button { display: grid; grid-template-columns: 190px minmax(0, 1fr) 28px; gap: 10px; align-items: center; border: 0; background: none; padding: 2px 0; cursor: pointer; text-align: left; font-size: .92rem }
.barres button:hover span:first-child { color: var(--accent) }
.barres .rail { height: 14px; background: var(--paper); border: 1px solid var(--line); display: flex; gap: 2px; padding: 1px }
.barres .rail i { width: 10px; flex: none; background: var(--warn) }
.barres .nb { font-family: var(--f-mono); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums }
.mantra { font-family: var(--f-display); font-style: italic; font-size: 1.4rem; max-width: 40ch; margin: 0 0 10px }
.groupe { margin: 0 0 30px }
.groupe > h3 { font-size: 1.3rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center }
.groupe > h3 a { color: inherit; text-decoration: none; cursor: pointer }
.res { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column }
.res li { padding: 9px 0; border-bottom: 1px solid var(--line) }
.res li .ext { font-size: .9rem; color: var(--muted); margin: 4px 0 0 }
.rangee { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px }
.rangee .st { width: 18px; height: 18px }
.etapes { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); max-width: 860px }
.etapes li { display: grid; grid-template-columns: 28px 14px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 12px; border-bottom: 1px solid var(--line) }
.etapes li:last-child { border-bottom: 0 }
.etapes .num { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums }
.etapes .nom { font-weight: 500 }
.etapes .nom a { color: inherit }
.etapes .nom small { display: block; font-weight: 400; color: var(--muted); font-size: .84rem }
.etapes .etat { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); white-space: nowrap }
/* Les formes d'une étape viennent de son RANG (0 à 3), jamais de son nom : pointillé, cerné, demi-plein, plein. */
.rang-0 { border: 1.5px dashed var(--muted) }
.rang-1 { border: 2px solid var(--accent) }
.rang-2 { border: 2px solid var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%) }
.rang-3 { border: 2px solid var(--ok); background: var(--ok) }
.etapes li[data-rang="1"] .etat, .etapes li[data-rang="2"] .etat { color: var(--accent) }
.etapes li[data-rang="3"] .etat { color: var(--ok) }
.manque { color: var(--warn); max-width: 80ch }
.manque code, .chapeau code { font-family: var(--f-mono); font-size: .8em }
.signaux { max-width: 860px; margin: 0 0 16px; padding: 10px 14px; border: 1px dashed var(--warn); border-radius: 6px; color: var(--warn); font-size: .9rem }
.signaux ul { margin: 4px 0 0; padding-left: 1.2em }
details.regles { margin: 0 0 30px; font-size: .9rem; color: var(--muted); max-width: 80ch }
details.regles summary { cursor: pointer }
details.regles h3 { font-size: 1.05rem; margin: 14px 0 4px; color: var(--ink) }
details.regles ul { list-style: none; margin: 0; padding: 0 }
details.regles li { display: grid; grid-template-columns: 14px 8.5em minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 2px 0 }
details.regles li b { color: var(--ink); font-weight: 500 }
details.regles li.hors { opacity: .55 }
mark { background: var(--accent-soft); color: var(--ink); padding: 0 1px }

/* Bulle d'une décision */
#bulle {
  position: fixed; z-index: 50; width: min(440px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 34px var(--ombre);
  padding: 14px 16px; font-size: .92rem; line-height: 1.45;
}
#bulle .def + .def { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line) }
#bulle .tete { display: flex; align-items: baseline; gap: 8px; margin: 0 22px 4px 0 }
#bulle .tete .code { font-size: .85rem; cursor: default }
#bulle .tete b { font-family: var(--f-display); font-size: 1.1rem; line-height: 1.2 }
#bulle .ou { font-size: .82rem; color: var(--muted); margin: 0 0 8px }
#bulle .txt { margin: 0 0 8px }
#bulle .rel { font-size: .84rem; margin: 6px 0 }
#bulle .rel > span { color: var(--muted) }
#bulle .aller { margin-top: 6px; border: 1px solid var(--accent); color: var(--accent); background: none; border-radius: 5px; padding: 4px 10px; cursor: pointer; font-size: .85rem }
#bulle .fermer { position: absolute; top: 6px; right: 8px; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: 2px 6px }

@media (max-width: 1180px) { .grille-page { grid-template-columns: minmax(0, 1fr) } .toc { display: none } .piliers { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr) }
  aside.nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 14px }
  .tete-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px }
  .menu-bouton { display: inline-block; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: .9rem }
  aside.nav:not(.ouvert) nav, aside.nav:not(.ouvert) .legende { display: none }
  .legende { margin-top: 0 }
  h1 { font-size: 2rem } .hero h1 { font-size: 2.5rem } .hero .pitch { font-size: 1.2rem }
  .couche { grid-template-columns: minmax(0, 1fr) } .couche > .nom { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px }
}
@media (max-width: 560px) {
  .piliers { grid-template-columns: minmax(0, 1fr) }
  .journal li { grid-template-columns: 84px minmax(0, 1fr) } .journal code { display: none }
  .barres button { grid-template-columns: 120px minmax(0, 1fr) 24px }
  #bulle { left: 12px !important; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); top: auto !important; width: auto }
}
@media (prefers-reduced-motion: reduce) { li.def.eclair { animation: none; background: var(--accent-soft) } }
.mat{display:inline-block;padding:0 7px;border:1px solid var(--c);color:var(--c);font-size:.82em}
ul.arbre{list-style:none;padding-left:18px;border-left:2px solid var(--line);margin:6px 0}
ul.arbre ul.arbre{margin:6px 0 2px}
.arbre .ms{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0}
.arbre .mec{border:1px solid var(--line);padding:0 6px;font-size:.85em}
.arbre .mec.ext{border-style:dotted;color:var(--muted)}

/* Propres au dossier : aucun JavaScript, deux cases à cocher. */
.case { position: absolute; opacity: 0; pointer-events: none }
#historique:not(:checked) ~ .shell del, #historique:not(:checked) ~ .shell .rw, #historique:not(:checked) ~ .shell .barre-entier { display: none }
#historique:focus-visible ~ .shell .voir { outline: 2px solid var(--accent); outline-offset: 2px }
.cadre { max-width: 1180px; margin: 0 auto 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-size: .92rem }
.voir { cursor: pointer; font-size: .9rem; display: inline-flex; gap: 6px; align-items: center }
.voir::before { content: ""; width: 12px; height: 12px; border: 1.5px solid var(--muted); border-radius: 2px }
#historique:checked ~ .shell .voir::before { background: var(--accent); border-color: var(--accent) }
a.code, a.carte { text-decoration: none; color: inherit }
a.code { color: var(--accent) }
.pilier h3 .st { background: var(--pc, var(--muted)) }
a.code:hover { outline: 1px solid var(--accent) }
.menu-bouton { cursor: pointer }
@media (max-width: 900px) { #menu:not(:checked) ~ .shell aside.nav nav { display: none } #menu:checked ~ .shell aside.nav nav { display: flex } }
/* La carte des systèmes : le dessin et son accès. */
.dessin-bande{--dessin-f0:#efe3d4;--dessin-t0:#8a6440;--dessin-f1:#e3ecd6;--dessin-t1:#5f8a3c;--dessin-f2:#dde8f3;--dessin-t2:#4a78a8;--dessin-f3:#f6e3cf;--dessin-t3:#c9782f;--dessin-f4:#e8e0f2;--dessin-t4:#7a5aa8;--dessin-fx:#e6e6e3;--dessin-tx:#7d8188;--dessin-exc:#b23a3a;--dessin-q:#c9782f;--dessin-ink:var(--ink,#24271f);--dessin-line:var(--line,#cfcbbd);--dessin-trait:var(--muted,#646a5c);overflow-x:auto}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .dessin-bande{--dessin-f0:#33291f;--dessin-t0:#c49468;--dessin-f1:#283321;--dessin-t1:#8fbf62;--dessin-f2:#1f2b36;--dessin-t2:#7fb0dc;--dessin-f3:#3a2a1b;--dessin-t3:#e69a52;--dessin-f4:#2a2440;--dessin-t4:#b7a0ec;--dessin-fx:#2a2c29;--dessin-tx:#a6abb3;--dessin-exc:#e06a6a;--dessin-q:#e69a52;}}
:root[data-theme="dark"] .dessin-bande{--dessin-f0:#33291f;--dessin-t0:#c49468;--dessin-f1:#283321;--dessin-t1:#8fbf62;--dessin-f2:#1f2b36;--dessin-t2:#7fb0dc;--dessin-f3:#3a2a1b;--dessin-t3:#e69a52;--dessin-f4:#2a2440;--dessin-t4:#b7a0ec;--dessin-fx:#2a2c29;--dessin-tx:#a6abb3;--dessin-exc:#e06a6a;--dessin-q:#e69a52;}
.dessin-bande svg{display:block;width:100%;min-width:540px;max-width:760px}
.dessin-bande text{fill:var(--dessin-ink);font-family:var(--f-body,"Alegreya Sans","Segoe UI",system-ui,sans-serif)}
.dessin-bande .dessin-n{font-family:var(--f-mono,Consolas,"Courier New",monospace)}
.dessin-bande .dessin-nom{paint-order:stroke;stroke:var(--bg,#f3f1ea);stroke-width:5px;stroke-linejoin:round}
.dessin-bande .dessin-couche{font-size:11.5px;letter-spacing:.08em;fill:var(--dessin-trait)}
.dessin-bande .dessin-cadre{fill:none;stroke:var(--dessin-line);stroke-dasharray:3 4}
.dessin-bande .dessin-trait{fill:none;stroke:var(--dessin-trait);stroke-opacity:.55;stroke-linecap:round}
.dessin-bande .dessin-faible{display:none}
.dessin-bande.allume .dessin-faible.on{display:inline}
.dessin-bande .dessin-sys{outline:none}
.dessin-bande .dessin-sys[role="button"]{cursor:pointer}
.dessin-bande .dessin-lien{cursor:pointer}
.dessin-bande .dessin-sys:hover .dessin-face,.dessin-bande .dessin-sys:focus .dessin-face,.dessin-bande .dessin-lien:focus .dessin-face{stroke-width:3}
.dessin-bande .dessin-lien:focus{outline:none}
.dessin-bande .dessin-face{stroke-width:1.5}
.dessin-bande .dessin-tuile-exc{fill:var(--dessin-exc)}
.dessin-bande .dessin-tuile-q{fill:var(--dessin-q)}
.dessin-bande .dessin-c0 .dessin-face{fill:var(--dessin-f0);stroke:var(--dessin-t0)}.dessin-bande .dessin-c0 .dessin-ombre{fill:var(--dessin-t0);opacity:.35}
.dessin-bande .dessin-c1 .dessin-face{fill:var(--dessin-f1);stroke:var(--dessin-t1)}.dessin-bande .dessin-c1 .dessin-ombre{fill:var(--dessin-t1);opacity:.35}
.dessin-bande .dessin-c2 .dessin-face{fill:var(--dessin-f2);stroke:var(--dessin-t2)}.dessin-bande .dessin-c2 .dessin-ombre{fill:var(--dessin-t2);opacity:.35}
.dessin-bande .dessin-c3 .dessin-face{fill:var(--dessin-f3);stroke:var(--dessin-t3)}.dessin-bande .dessin-c3 .dessin-ombre{fill:var(--dessin-t3);opacity:.35}
.dessin-bande .dessin-c4 .dessin-face{fill:var(--dessin-f4);stroke:var(--dessin-t4)}.dessin-bande .dessin-c4 .dessin-ombre{fill:var(--dessin-t4);opacity:.35}
.dessin-bande .dessin-cx .dessin-face{fill:var(--dessin-fx);stroke:var(--dessin-tx)}.dessin-bande .dessin-cx .dessin-ombre{fill:var(--dessin-tx);opacity:.35}
.dessin-acces { margin: 0 0 12px }
