/* Caractères d'écriture, servis par le site lui-même : aucune visite n'est signalée à un tiers.
   Inter et Space Grotesk, sous licence libre SIL Open Font License (voir assets/polices/). */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(polices/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(polices/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-display: swap; font-weight: 300 700; src: url(polices/space-grotesk-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-display: swap; font-weight: 300 700; src: url(polices/space-grotesk-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Numithèque : feuille de style. Pensée d'abord pour le téléphone, puis élargie. */
:root {
  --fond: #F4F4F0; --blanc: #FFFFFF; --encre: #18201C; --gris: #5A635E; --gris-pale: #EEEEE8;
  --vert: #2E6A4E; --vert-fonce: #1F4D38; --vert-pale: #E3EEE7;
  --ocre: #7A4A00; --ocre-pale: #FBEFD9; --rouge: #A33A2B; --rouge-pale: #F8E1DC;
  --trait: #DCDDD6; --rayon: 16px;
  --titre: 'Space Grotesk', system-ui, sans-serif; --texte: Inter, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: 16px; line-height: 1.55; padding-bottom: 76px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--vert); }
a:hover { color: var(--vert-fonce); }
h1, h2, h3 { font-family: var(--titre); letter-spacing: -0.3px; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(28px, 6vw, 46px); font-weight: 700; }
h2 { font-size: clamp(21px, 3.4vw, 28px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--vert); outline-offset: 2px; border-radius: 6px; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.saut { position: absolute; left: -999px; top: 8px; background: var(--encre); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.saut:focus { left: 8px; }

.cadre { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.etroit { max-width: 720px; }
.bloc { padding-top: 36px; display: flex; flex-direction: column; gap: 16px; }
.bloc-haut { padding-top: 24px; }
.bloc-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.surtitre { font-size: 13px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--vert); }
.chapo { font-size: 17px; color: var(--gris); max-width: 62ch; }
.discret { font-size: 13.5px; color: var(--gris); }
.note { font-size: 14px; background: var(--ocre-pale); color: #5A3700; padding: 10px 14px; border-radius: 12px; }
.alerte { background: var(--rouge-pale); color: #6E2418; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; }
.carte { background: var(--blanc); border-radius: var(--rayon); padding: 16px; display: flex; flex-direction: column; gap: 10px; }

/* Boutons et pastilles */
.bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--trait); background: var(--blanc); color: var(--encre); font: 600 15px var(--texte); text-decoration: none; cursor: pointer; }
.bouton:hover { border-color: var(--encre); color: var(--encre); }
.bouton-plein { background: var(--vert); border-color: var(--vert); color: #fff; }
.bouton-plein:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); color: #fff; }
.bouton-grand { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.pastille { display: inline-block; font: 600 12px var(--texte); padding: 3px 9px; border-radius: 999px; white-space: nowrap; vertical-align: middle; letter-spacing: 0; }
.pastille-verte { background: var(--vert-pale); color: var(--vert-fonce); }
.pastille-ocre { background: var(--ocre-pale); color: var(--ocre); }

/* En-tête */
.haut { position: sticky; top: 0; z-index: 20; background: rgba(244, 244, 240, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--trait); }
.haut-rang { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.marque { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--encre); font: 700 20px var(--titre); letter-spacing: -0.4px; }
.menu { display: none; gap: 4px; margin-left: 8px; }
.menu a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--gris); font-weight: 600; font-size: 15px; }
.menu a:hover, .menu a[aria-current] { color: var(--encre); background: var(--gris-pale); }
.haut-action { margin-left: auto; display: none; }

/* Barre du bas, sur téléphone */
.barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--blanc); border-top: 1px solid var(--trait); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.barre a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 68px; padding: 5px 0; text-decoration: none; color: var(--gris); font-size: 11.5px; font-weight: 500; border-radius: 10px; }
.barre a[aria-current] { color: var(--vert); font-weight: 600; }

.pied { margin-top: 48px; border-top: 1px solid var(--trait); padding: 18px 0; font-size: 13px; color: var(--gris); }
.pied-rang { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }

/* Accueil */
.hero { background: var(--encre); color: #F4F4F0; }
.hero-rang { display: grid; gap: 28px; padding-top: 36px; padding-bottom: 40px; }
.hero .surtitre { color: #9CC7AE; }
.hero h1 { margin-top: 10px; }
.hero .chapo { color: #C9CEC9; margin-top: 14px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero .bouton:not(.bouton-plein) { background: transparent; color: #F4F4F0; border-color: #4A524D; }
.hero .bouton:not(.bouton-plein):hover { border-color: #F4F4F0; }
.hero-pieces { position: relative; height: 200px; max-width: 420px; }
.hp { position: absolute; border-radius: 50%; object-fit: cover; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.7); }
.hp1 { width: 150px; height: 150px; left: 34%; top: 0; z-index: 3; }
.hp2 { width: 120px; height: 120px; left: 4%; top: 46px; z-index: 2; }
.hp3 { width: 112px; height: 112px; left: 66%; top: 70px; z-index: 2; }
.hp4 { width: 84px; height: 84px; left: 26%; top: 116px; z-index: 4; }
.piliers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.piliers p { color: var(--gris); font-size: 15px; }

/* Vignettes de pièces */
.grille-pieces { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vignette { background: var(--blanc); border-radius: var(--rayon); padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; text-decoration: none; color: var(--encre); border: 1px solid transparent; }
.vignette:hover { border-color: var(--vert); color: var(--encre); }
.vignette img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 6px; }
.vignette-nom { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.vignette-sous { font-size: 12.5px; color: var(--gris); }

/* Fiche d'une pièce */
.fil { font-size: 13.5px; color: var(--gris); }
.fil a { color: var(--gris); }
.fiche-tete { display: grid; gap: 18px; }
.fiche-photos { display: flex; gap: 14px; justify-content: center; }
.fiche-photos figure { margin: 0; text-align: center; }
.fiche-photos img { width: 148px; height: 148px; border-radius: 50%; object-fit: cover; background: var(--blanc); }
.fiche-photos figcaption { font-size: 12.5px; color: var(--gris); margin-top: 6px; }
.fiche-titre { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.reperes { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 4px 0 0; width: 100%; }
.reperes div { background: var(--blanc); border-radius: 12px; padding: 9px 12px; }
.reperes dt { font-size: 12px; color: var(--gris); }
.reperes dd { margin: 0; font-weight: 600; font-size: 14.5px; }
.sommaire { display: flex; gap: 6px; flex-wrap: wrap; }
.sommaire a { font-size: 13.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--blanc); border: 1px solid var(--trait); text-decoration: none; color: var(--encre); }
.sommaire a:hover { border-color: var(--vert); }
.fiche-corps { display: grid; gap: 12px; }
.pistes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.piste { border: 1px solid var(--trait); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.piste-tete { border: 2px solid var(--vert); }
.piste-ligne { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.piste-pct { font: 600 16px var(--titre); color: var(--vert); white-space: nowrap; }
.jauge { height: 5px; border-radius: 3px; background: var(--gris-pale); overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--vert); border-radius: 3px; }
.conseil { background: var(--vert-pale); color: var(--vert-fonce); padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.cotes { width: 100%; border-collapse: collapse; font-size: 15px; }
.cotes th, .cotes td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--gris-pale); }
.cotes thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--gris); font-weight: 600; }
.cotes tbody th { font-family: var(--titre); }
.cotes .estime { background: var(--vert-pale); }
.cote-prix { font: 600 15.5px var(--titre); white-space: nowrap; text-align: right !important; }
.chapitres { display: grid; gap: 22px; }
.chapitres section { display: flex; flex-direction: column; gap: 8px; }
.chapitres h3 { color: var(--vert-fonce); }
.chapitres p { font-size: 15.5px; max-width: 70ch; }
.voisines { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; justify-items: center; margin-top: 8px; font-size: 14.5px; }

/* Album */
.album-outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.champ { flex: 1 1 220px; }
.champ input { width: 100%; height: 46px; border-radius: 14px; border: 1px solid var(--trait); background: var(--blanc); padding: 0 14px; font: 15px var(--texte); color: var(--encre); }
.groupe { display: flex; background: #E6E8E1; border-radius: 12px; padding: 3px; }
.choix { height: 38px; padding: 0 14px; border: none; border-radius: 9px; background: transparent; color: var(--gris); font: 600 14px var(--texte); cursor: pointer; }
.choix[aria-pressed="true"] { background: var(--blanc); color: var(--encre); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.album-filtres { display: flex; flex-direction: column; gap: 8px; }
.puces { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.puces .discret { min-width: 62px; }
.puce { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--trait); background: var(--blanc); color: var(--encre); font: 600 13px var(--texte); cursor: pointer; }
.puce[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: #fff; }
.vide { color: var(--gris); padding: 20px 0; }
.album-pieces { display: grid; gap: 10px; }
.piece { background: var(--blanc); border-radius: var(--rayon); text-decoration: none; color: var(--encre); border: 1px solid transparent; }
.piece:hover { border-color: var(--vert); color: var(--encre); }
.piece[hidden] { display: none !important; }
.piece img { border-radius: 50%; object-fit: cover; }
.piece-nom { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.piece-sous { font-size: 12.5px; color: var(--gris); }
.piece-cote { font: 600 15px var(--titre); white-space: nowrap; }
.piece-annee { display: none; }
.vue-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vue-grille .piece { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 10px; }
.vue-grille .piece img { width: 88px; height: 88px; }
.vue-grille .piece-texte { display: flex; flex-direction: column; gap: 2px; }
.vue-grille .piece-nom { font-size: 14px; }
.vue-liste .piece { display: flex; align-items: center; gap: 12px; padding: 9px 14px 9px 9px; }
.vue-liste .piece img { width: 48px; height: 48px; flex-shrink: 0; }
.vue-liste .piece-texte { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.vue-frise { gap: 0; border-left: 2px solid #CFD3C6; margin-left: 8px; padding-left: 0; }
.vue-frise .piece { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 12px 10px 20px; background: transparent; border-radius: 0; position: relative; }
.vue-frise .piece::before { content: ''; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--vert); border: 2px solid var(--fond); }
.vue-frise .piece-annee { display: block; grid-column: 1 / -1; font: 700 12.5px var(--titre); color: var(--vert-fonce); letter-spacing: 0.3px; margin-bottom: 4px; }
.vue-frise .piece img { width: 44px; height: 44px; }
.vue-frise .piece-texte { display: flex; flex-direction: column; }
.vue-frise .piece-cote { display: none; }

/* Identifier */
.envoi { gap: 16px; }
.envoi-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.depot { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.depot-titre { font-weight: 600; font-size: 14.5px; }
.depot-zone { aspect-ratio: 1; border: 2px dashed #B8BCAD; border-radius: var(--rayon); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--gris); font-size: 14px; background: var(--fond) center / cover no-repeat; padding: 8px; }
.depot-zone.pleine { border-style: solid; border-color: var(--vert); color: transparent; }
.depot input { font-size: 13px; max-width: 100%; }
.conseils { margin: 0; padding-left: 20px; color: var(--gris); font-size: 14.5px; }
.resultat { gap: 12px; align-items: flex-start; }
.resultat .pistes { width: 100%; }

/* Valeur de la collection et réglage de visibilité */
.valeur { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; background: var(--blanc); border-radius: var(--rayon); padding: 16px 20px; margin: 14px 0 10px; }
.valeur-titre { display: block; font-size: 13px; color: var(--gris); }
.valeur-montant { display: block; font: 700 30px/1.15 'Space Grotesk', var(--texte); }
.valeur-notes { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; max-width: 420px; font-size: 13.5px; }
.options { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; }
.formulaire label.option { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--trait); border-radius: 12px; cursor: pointer; font-weight: 400; }
.formulaire label.option:has(input:checked) { border-color: var(--vert); background: var(--vert-pale); }
.option input { margin-top: 4px; accent-color: var(--vert); }
.option strong { font-weight: 600; }
.option span { grid-column: 2; font-weight: 400; color: var(--gris); font-size: 14px; }
.lien-copie { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--trait); background: var(--gris-pale); padding: 8px 12px; font: 14px ui-monospace, Consolas, monospace; color: var(--encre); }

.options legend { font-weight: 600; font-size: 14.5px; padding: 0; margin-bottom: 8px; }
.formulaire label.case { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.case input { margin-top: 4px; accent-color: var(--vert); }
.signaler { float: right; margin: 0; }
.signaler a, a.discret { color: var(--gris); }

/* Vente : annonce, offres, dossier à imprimer */
.annonce { border: 1px solid var(--ocre-pale); }
.offres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.offres li { border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; }
.offres p { margin: 6px 0; overflow-wrap: anywhere; }
.dossier-cadre { overflow-x: auto; background: var(--blanc); border-radius: var(--rayon); padding: 6px 14px; margin: 14px 0; }
.dossier-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.dossier-table th, .dossier-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.dossier-table thead th { font-size: 12.5px; color: var(--gris); font-weight: 500; }
.dossier-table tfoot th, .dossier-table tfoot td { border-bottom: 0; font-weight: 700; }
.dossier-photos { white-space: nowrap; }
.dossier-photos img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-right: 4px; }
@media print {
  .haut, .pied, .barre, .saut, .sans-impression, .bandeau { display: none !important; }
  body { background: #fff; }
  .dossier-cadre { padding: 0; overflow: visible; }
  .dossier-table tr { break-inside: avoid; }
}

/* Pages légales */
.legal h2 { font-size: 19px; margin: 26px 0 8px; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal mark, mark { background: var(--ocre-pale); color: var(--ocre); padding: 1px 6px; border-radius: 6px; font-weight: 600; }
.tableau { overflow-x: auto; background: var(--blanc); border-radius: var(--rayon); padding: 4px 14px; }
.tableau table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tableau th, .tableau td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau thead th { font-size: 12.5px; color: var(--gris); font-weight: 500; }
.pied-liens { flex-basis: 100%; }

/* Comptes et formulaires */
.rang { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bandeau { margin-top: 14px; background: var(--vert-pale); color: var(--vert-fonce); padding: 10px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 500; }
.haut-compte { margin-left: auto; font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--encre); padding: 8px 10px; border-radius: 10px; }
.haut-compte:hover { background: var(--gris-pale); color: var(--encre); }
.formulaire { display: flex; flex-direction: column; gap: 14px; }
.formulaire label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14.5px; }
.formulaire input[type="email"], .formulaire input[type="text"], .formulaire input[type="password"], .formulaire select, .formulaire textarea { width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--trait); background: var(--blanc); padding: 10px 12px; font: 16px var(--texte); color: var(--encre); }
.formulaire textarea { resize: vertical; }
.formulaire .discret { font-weight: 400; }
.deux { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.bouton-danger { background: var(--blanc); border-color: var(--rouge); color: var(--rouge); align-self: flex-start; }
.bouton-danger:hover { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.lien-bouton { background: none; border: none; padding: 0; font: 14px var(--texte); color: var(--gris); text-decoration: underline; cursor: pointer; }
.lien-bouton:hover { color: var(--rouge); }

/* Écrans larges */
@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .barre { display: none; }
  .menu { display: flex; }
  .haut-action { display: inline-flex; margin-left: 0; }
  .cadre { padding: 0 28px; }
  .bloc { padding-top: 52px; gap: 20px; }
  .bloc-haut { padding-top: 32px; }
  .hero-rang { grid-template-columns: 1.15fr 0.85fr; align-items: center; padding-top: 64px; padding-bottom: 72px; }
  .hero-pieces { height: 300px; justify-self: end; width: 100%; }
  .hp1 { width: 210px; height: 210px; } .hp2 { width: 160px; height: 160px; top: 70px; }
  .hp3 { width: 150px; height: 150px; top: 110px; } .hp4 { width: 110px; height: 110px; top: 180px; }
  .grille-pieces { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .grille-large { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .fiche-tete { grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
  .fiche-photos img { width: 190px; height: 190px; }
  .fiche-corps { grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .fiche-large { grid-column: 1 / -1; }
  .chapitres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 36px; }
  .carte { padding: 22px; }
  .voisines { grid-template-columns: 1fr auto 1fr; }
  .voisines > :first-child { justify-self: start; } .voisines > :last-child { justify-self: end; }
  .vue-grille { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .vue-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-filtres { flex-direction: row; flex-wrap: wrap; gap: 10px 28px; }
  .puces .discret { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Pièces détourées (images d'exemple, sur fond transparent) : leur vrai contour, sans rond ni fond.
   Les photos envoyées par les membres ne sont pas détourées : elles gardent le cadrage rond défini plus haut. */
img[src^="/img/"][src$=".webp"] { border-radius: 0; object-fit: contain; background: none; box-shadow: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22)); }
.hero img[src^="/img/"][src$=".webp"] { filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.55)); }
@media print { img[src^="/img/"][src$=".webp"] { filter: none; } }

/* Personnages : fiches, arbres illustrés, éventail des ancêtres, frise des règnes.
   Les portraits sont des médaillons ronds, cerclés comme une monnaie (bord doré et grènetis). */
:root { --or: #B08A3E; --or-pale: #F3E9D2; --bronze: #8A6A4A; }
img[src^="/img/portraits/"][src$=".webp"] { border-radius: 50%; object-fit: cover; filter: none; background: var(--gris-pale); }
.lien-personne { font-weight: 600; text-decoration-color: rgba(46, 106, 78, 0.4); text-underline-offset: 2px; }

.perso-tete { display: grid; gap: 18px; justify-items: center; text-align: center; }
.perso-portrait { width: 168px; height: 168px; border-radius: 50%; padding: 6px; background: var(--or); box-shadow: 0 0 0 2px var(--or-pale) inset, 0 6px 18px rgba(24, 32, 28, 0.18); position: relative; }
.perso-portrait::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1.5px dotted rgba(255, 255, 255, 0.75); pointer-events: none; }
.perso-portrait img { width: 156px; height: 156px; }
.perso-portrait-vide span { display: flex; width: 156px; height: 156px; border-radius: 50%; align-items: center; justify-content: center; background: var(--or-pale); font: 700 52px var(--titre); color: var(--bronze); }
.perso-titre { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.perso-titre .reperes { text-align: left; }
.perso-pieces { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.perso-pieces a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; text-decoration: none; color: var(--encre); border: 1px solid var(--trait); }
.perso-pieces a:hover { border-color: var(--vert); }
.perso-pieces img { width: 64px; height: 64px; flex: none; }
.perso-pieces a > span { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }

.defile { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 6px 16px 10px; scrollbar-width: thin; }
.defile:focus-visible { outline-offset: -3px; }
.defile svg { display: block; max-width: none; height: auto; }
.defile-centre svg { margin: 0 auto; }

/* Médaillons dans les dessins */
.med text { text-anchor: middle; font-family: var(--texte); }
.med-bord { fill: var(--or); }
.med-grenetis { fill: none; stroke: #fff; stroke-opacity: 0.8; stroke-width: 1.3; stroke-dasharray: 1.4 2.6; }
.med-fond { fill: var(--or-pale); }
.med-f .med-fond { fill: #F6E4E0; }
.med-h .med-fond { fill: #E4ECE6; }
.med .med-init { fill: var(--bronze); font-family: var(--titre); font-weight: 700; }
.med-nom { font-size: 13px; font-weight: 600; fill: var(--encre); }
.med-dates { font-size: 11.5px; fill: var(--gris); }
.med-petit .med-nom { font-size: 12px; }
.med-centre .med-bord { fill: var(--vert); }
.med-centre .med-nom { font-size: 15px; font-weight: 700; }
.med-sans .med-bord { fill: #C9CAC2; }
.med-sans .med-nom { fill: var(--gris); font-weight: 500; }
.med-liaison .med-bord { fill: #C9B48A; }
.med-pastille circle { fill: var(--or); stroke: #fff; stroke-width: 2; }
.med-pastille .med-pastille-int { fill: none; stroke: #fff; stroke-width: 1; stroke-dasharray: 1 1.6; }
.med-suite { text-anchor: middle; font-size: 11px; fill: var(--vert); font-weight: 600; }
a:hover .med-bord { fill: var(--vert-fonce); }
svg a:focus-visible { outline: none; }
svg a:focus-visible .med-bord { stroke: var(--vert); stroke-width: 4; }
.trait { fill: none; stroke: #A9AAA2; stroke-width: 1.6; }
.trait-union { stroke: var(--or); stroke-width: 2.4; }
.trait-pointille { stroke: #C9B48A; stroke-width: 2; stroke-dasharray: 5 4; }
.union { text-anchor: middle; font-size: 12px; font-weight: 700; fill: var(--bronze); }
.legende-arbre { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.cle { display: inline-block; vertical-align: middle; margin-right: 3px; }
.cle-piece { width: 12px; height: 12px; border-radius: 50%; background: var(--or); box-shadow: 0 0 0 2px #fff inset; }
.cle-union { width: 22px; height: 3px; background: var(--or); }
.cle-liaison { width: 22px; height: 0; border-top: 2px dashed #C9B48A; }

/* Éventail des ancêtres */
.secteur { stroke: #fff; stroke-width: 1.5; fill: var(--vert); fill-opacity: 0.9; transition: fill-opacity 0.15s; }
.secteur-neutre { fill: #DCD7C6; }
.secteur-vide { fill: var(--gris-pale); fill-opacity: 0.6; }
a:hover .secteur { fill-opacity: 0.7; }
svg a:focus-visible .secteur { stroke: var(--encre); stroke-width: 3; }
.secteur-texte { text-anchor: middle; fill: var(--encre); font-weight: 600; font-family: var(--texte); pointer-events: none; }
.secteur-texte.texte-clair { fill: #fff; }
.secteur-dates { font-weight: 400; opacity: 0.85; }
.eventail-legende { text-anchor: middle; font: 700 15px var(--titre); fill: var(--encre); }
.eventail-cote { font: 500 12px var(--texte); fill: var(--gris); }
.legende-dynasties { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.pastille-couleur { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }

/* Monnaies liées */
.monnaies { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.proches-monnaies { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.proches-monnaies section { border: 1px solid var(--trait); border-radius: 12px; padding: 10px 12px; }
.proches-monnaies h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 600 15px var(--texte); margin: 0 0 6px; }
.proches-monnaies h4 img { width: 36px; height: 36px; }
.proches-monnaies ul { margin: 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.personnage h3 { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Chemins de parenté */
.parente { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--trait); }
.carte.parente { border-top: 0; padding-top: 16px; }
.chaine { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chaine li { display: flex; align-items: center; gap: 6px; }
.chaine-lien { font-size: 12px; color: var(--bronze); font-weight: 600; }
.chaine-lien::before { content: "→ "; color: var(--gris); }
.chaine-personne { display: inline-flex; align-items: center; gap: 6px; background: var(--fond); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 13.5px; font-weight: 600; }
.chaine-personne img, .chaine-init { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.chaine-init { display: inline-flex; align-items: center; justify-content: center; background: var(--or-pale); color: var(--bronze); font: 700 12px var(--titre); }
.liens-grille { display: grid; gap: 12px; }
.fonctions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.fonctions-dates { display: inline-block; min-width: 92px; color: var(--gris); font-variant-numeric: tabular-nums; }
.sources { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }

/* Galerie et cartes de personnages */
.galerie-perso { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.galerie-perso a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px; background: var(--blanc); border-radius: var(--rayon); text-decoration: none; color: var(--encre); height: 100%; border: 1px solid transparent; }
.galerie-perso a:hover { border-color: var(--vert); }
.galerie-perso strong { font-size: 14.5px; line-height: 1.25; }
.galerie-med { display: inline-flex; width: 96px; height: 96px; border-radius: 50%; padding: 4px; background: #C9CAC2; flex: none; margin-bottom: 4px; }
.galerie-med-piece { background: var(--or); }
.galerie-med img, .galerie-med > span { width: 88px; height: 88px; border-radius: 50%; }
.galerie-med > span { display: flex; align-items: center; justify-content: center; background: var(--or-pale); color: var(--bronze); font: 700 28px var(--titre); }
.perso-cartes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.perso-cartes a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--trait); text-decoration: none; color: var(--encre); }
.perso-cartes a:hover { border-color: var(--vert); }
.perso-cartes .galerie-med { width: 70px; height: 70px; padding: 3px; margin: 0; }
.perso-cartes .galerie-med img, .perso-cartes .galerie-med > span { width: 64px; height: 64px; font-size: 22px; }
.perso-cartes-texte { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.perso-cartes-suite { color: var(--vert); font-weight: 600; font-size: 13.5px; }

/* Frise des règnes */
.frise-grille { stroke: var(--trait); stroke-width: 1; }
.frise-an { text-anchor: middle; font-size: 11px; fill: var(--gris); font-family: var(--texte); }
.frise-rond { fill: var(--or); }
.frise-init { text-anchor: middle; font: 700 12px var(--titre); fill: #fff; }
.frise-nom { font: 600 13.5px var(--texte); fill: var(--encre); }
.frise-dates { font: 11.5px var(--texte); fill: var(--gris); }
.frise-vie { stroke: var(--or-pale); stroke-width: 12; stroke-linecap: round; }
.frise-regne { stroke: var(--vert); stroke-width: 12; stroke-linecap: round; }
.frise-piece { fill: #fff; stroke: var(--or); stroke-width: 3; }
a:hover .frise-nom { fill: var(--vert); }
a:hover .frise-piece { fill: var(--or); }

@media (min-width: 720px) {
  .perso-tete { grid-template-columns: auto 1fr; justify-items: start; text-align: left; gap: 32px; align-items: center; }
  .perso-titre { align-items: flex-start; }
  .perso-portrait { width: 196px; height: 196px; }
  .perso-portrait img, .perso-portrait-vide span { width: 184px; height: 184px; }
  .defile { margin: 0 -22px; padding: 6px 22px 10px; }
  .liens-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print { .defile { overflow: visible; } }
.frise-loin { text-anchor: end; font: 600 11.5px var(--texte); fill: var(--bronze); }

/* Accueil : les dernières pièces identifiées, rangées par époque. */
.epoque { display: flex; flex-direction: column; gap: 10px; }
.epoque + .epoque { margin-top: 8px; }
.epoque-titre { display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--trait); }
.epoque-titre .discret { font-family: var(--texte); font-weight: 400; letter-spacing: 0; }

/* Fiche d'une pièce : monnaies liées, et nombre d'utilisateurs qui possèdent chaque pièce. */
.liees h3 { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.liees .proches-monnaies li { line-height: 1.45; }
.vignette-possede { color: var(--vert-fonce); }

/* Fiches-types : numéro Numithèque, fiche technique, exemplaires des membres. */
.pastille-numero { background: var(--encre); color: #fff; letter-spacing: 0.4px; }
.vignette-numero { font-weight: 600; letter-spacing: 0.4px; }
.technique h3 { margin-top: 8px; }
.faces { display: grid; gap: 12px; }
.faces section { border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.faces h3 { margin-top: 0; }
.legende, .mesures { margin: 0; display: grid; gap: 6px; }
.legende div, .mesures div { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px; font-size: 14.5px; }
.legende dt, .mesures dt { color: var(--gris); font-size: 13.5px; }
.legende dd, .mesures dd { margin: 0; }
.legende-texte { font-weight: 600; letter-spacing: 0.6px; }
.mesures div { padding: 7px 0; border-bottom: 1px solid var(--gris-pale); }
.mesures div:last-child { border-bottom: 0; }
.citer { border-top: 1px solid var(--trait); padding-top: 12px; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.exemplaires { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.exemplaires a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; text-decoration: none; padding: 10px 6px; border: 1px solid var(--trait); border-radius: 12px; }
.exemplaires a:hover { border-color: var(--vert); }
.exemplaires img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.perso-pieces.proches li { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 720px) {
  .faces { grid-template-columns: 1fr 1fr; }
}

/* Haut de l'accueil : les dernières monnaies identifiées, cliquables. Une photo de membre reste ronde, une pièce détourée garde son contour. */
.hero-vitrine { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.hero-legende { font-size: 13px; text-align: center; }
.hero-legende a { color: #9CC7AE; }
a.hp { display: block; box-shadow: none; }
a.hp:hover, a.hp:focus-visible { z-index: 5; }
a.hp img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.7); }
@media (min-width: 720px) {
  .hero-vitrine { justify-self: end; }
}
@media (prefers-reduced-motion: reduce) { a.hp { transition: none; } }

/* Copies et monnaies fautées. */
.particuliere { box-shadow: inset 4px 0 0 var(--ocre); }
.deux-cartes { display: grid; gap: 12px; }
.deux-cartes .mesures div { grid-template-columns: 1fr; gap: 2px; }
.deux-cartes .mesures dt { color: var(--encre); font-weight: 600; font-size: 14.5px; }
.vignette .pastille { white-space: normal; text-align: center; }
@media (min-width: 720px) {
  .deux-cartes { grid-template-columns: 1.2fr 0.8fr; align-items: start; }
}

/* Recherche par thème. */
.themes-puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce-theme { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--trait); background: var(--blanc); color: var(--encre); font: 600 13.5px var(--texte); text-decoration: none; }
.puce-theme:hover { border-color: var(--vert); color: var(--encre); }
.puce-theme span { color: var(--gris); font-weight: 400; }
.puce-theme-active { background: var(--encre); border-color: var(--encre); color: #fff; }
.puce-theme-active:hover { color: #fff; }
.puce-theme-active span { color: #C9CEC9; }
.puce-theme-vide { color: var(--gris); border-style: dashed; }
.themes-fiche { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.themes-fiche .puce-theme { padding: 4px 10px; font-size: 13px; }

/* Haut de l'accueil, animation. Chaque pièce arrive à son tour, flotte à peine, et se retourne au survol :
   son revers est collé à son dos. Trois enveloppes, une par mouvement, pour qu'ils ne se gênent pas. */
a.hp { perspective: 700px; animation: hp-arrive 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hp1 { animation-delay: 0.05s; } .hp2 { animation-delay: 0.2s; } .hp3 { animation-delay: 0.35s; } .hp4 { animation-delay: 0.5s; }
.hp-flotte, .hp-tour { display: block; width: 100%; height: 100%; }
.hp-flotte { animation: hp-flotte 7s ease-in-out 1.4s infinite; }
.hp2 .hp-flotte { animation-duration: 8s; animation-delay: 2.1s; } .hp3 .hp-flotte { animation-duration: 9s; animation-delay: 1.7s; } .hp4 .hp-flotte { animation-duration: 6.5s; animation-delay: 2.6s; }
.hp-tour { position: relative; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(0.3, 0.7, 0.2, 1); }
.hp-tour img { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.hp-dos { transform: rotateY(180deg); }
/* L'ombre est un disque flou posé derrière la pièce. Un filtre d'ombre sur les images ou sur leurs enveloppes
   empêcherait le revers d'apparaître quand la pièce se retourne. */
.hero .hp-tour img[src] { filter: none; box-shadow: none; }
a.hp::before { content: ""; position: absolute; inset: 5%; border-radius: 50%; background: rgba(0, 0, 0, 0.6); filter: blur(12px); transform: translateY(9%); }
.hp3 { left: auto; right: 0; }
a.hp:hover .hp-tour, a.hp:focus-visible .hp-tour { transform: rotateY(180deg); }
@keyframes hp-arrive { from { opacity: 0; transform: translateY(28px) rotate(-16deg) scale(0.86); } to { opacity: 1; transform: none; } }
@keyframes hp-flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  a.hp, .hp-flotte { animation: none; }
  .hp-tour { transition: none; }
}

/* Haut de l'accueil : les trois promesses de l'album. */
.hero-points { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; max-width: 62ch; }
.hero-points li { color: #C9CEC9; font-size: 15px; padding-left: 14px; border-left: 2px solid #3E7A5E; }
.hero-points strong { color: #F4F4F0; display: block; font-family: var(--titre); font-size: 16px; }
@media (min-width: 720px) {
  .hero-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
}
