/* Archives de l'Imperium : thème du wiki */
:root {
  --vide: #161a30;          /* fond : l'espace entre les tuiles */
  --vide-2: #1e2342;        /* surfaces */
  --vide-3: #283058;        /* surfaces au survol */
  --trait: #343c6b;         /* filets */
  --texte: #e6e1d4;         /* parchemin stellaire */
  --texte-doux: #a7abc4;
  --laiton: #d2ad5f;        /* or Lazax : liens, repères */
  --laiton-clair: #ecd08f;
  --fantome: #a993d8;       /* liens fantômes (aperçu d'édition) */
  --alerte: #e9967a;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mesure: 68ch;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--vide); scroll-padding-top: 5rem; }
body {
  margin: 0;
  color: var(--texte);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(210, 173, 95, 0.07), transparent 55%),
    var(--vide);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }

a { hyphens: manual; color: var(--laiton); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--laiton-clair); }
:focus-visible { outline: 2px solid var(--laiton-clair); outline-offset: 3px; border-radius: 2px; }

.evitement { position: absolute; left: -9999px; }
.evitement:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--vide-2); padding: .5rem 1rem; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Barre du haut ---------- */
.barre {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1.5rem; justify-content: space-between;
  padding: .7rem clamp(1rem, 4vw, 3rem);
  background: rgba(22, 26, 48, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--trait);
}
.marque { display: flex; align-items: center; gap: .6rem; color: var(--texte); text-decoration: none;
  font-size: 1.05rem; font-weight: 600; letter-spacing: .01em; }
.marque:hover { color: var(--laiton-clair); }

.hex { width: 1.6em; height: 1.4em; flex: none; vertical-align: -0.3em; }
.hex polygon { fill: none; stroke: var(--laiton); stroke-width: 1.6; }
.hex circle { fill: var(--laiton); }
.hex text { fill: var(--laiton); font-family: var(--serif); font-size: 15px; font-weight: 600; }
.hex-marque { width: 2.1em; height: 1.85em; }
.hex-marque text { font-size: 13px; letter-spacing: .5px; }

.recherche { position: relative; width: min(22rem, 52vw); }
.recherche input {
  width: 100%; padding: .5rem .8rem; font: inherit; font-size: 1rem;
  color: var(--texte); background: var(--vide-2);
  border: 1px solid var(--trait); border-radius: 6px;
}
.recherche input::placeholder { color: var(--texte-doux); }
.recherche input:focus { outline: none; border-color: var(--laiton); }
#resultats-recherche {
  position: absolute; right: 0; left: 0; top: calc(100% + .3rem);
  margin: 0; padding: .3rem; list-style: none;
  background: var(--vide-2); border: 1px solid var(--trait); border-radius: 6px;
  box-shadow: 0 12px 30px rgba(5, 6, 15, 0.55);
}
#resultats-recherche li a {
  display: flex; justify-content: space-between; gap: 1rem; padding: .4rem .6rem;
  color: var(--texte); text-decoration: none; border-radius: 4px; font-size: 1rem;
}
#resultats-recherche li a small { color: var(--texte-doux); font-family: var(--sans); font-size: .78rem; }
#resultats-recherche li[aria-selected="true"] a, #resultats-recherche li a:hover { background: var(--vide-3); }
#resultats-recherche { left: auto; width: max(100%, min(30rem, 92vw)); max-height: 70vh; overflow-y: auto; }
#resultats-recherche .r-titre { min-width: 0; }
#resultats-recherche small { flex-shrink: 0; text-align: right; max-width: 45%; }
#resultats-recherche .r-section .r-titre { font-size: .95rem; }
#resultats-recherche .r-extrait { display: block; margin-top: .1rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: var(--texte-doux); font-family: var(--sans); font-size: .76rem; }
#resultats-recherche .vide { padding: .4rem .6rem; color: var(--texte-doux); font-size: .95rem; }

main { padding: 0 clamp(1rem, 4vw, 3rem) 4rem; }

/* ---------- Accueil ---------- */
.accueil {
  max-width: 96rem; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) 0 2.5rem;
}
.accueil h1 {
  margin: 0 0 1.2rem; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02;
  font-weight: 600; letter-spacing: -0.02em;
}
.chapo { margin: 0; max-width: 36rem; color: var(--texte-doux); font-size: 1.2rem; line-height: 1.6; }

.mosaique { display: block; width: 100%; max-width: 34rem; height: auto; justify-self: center; overflow: visible; }
.tuile polygon { fill: var(--vide-2); stroke: var(--laiton); stroke-width: 1.4; transition: fill .15s ease; }
.tuile:hover polygon, .tuile:focus-visible polygon { fill: var(--vide-3); stroke: var(--laiton-clair); }
.tuile:focus-visible { outline: none; }
.tuile:focus-visible polygon { stroke-width: 3; }
.tuile-titre { fill: var(--texte); font-family: var(--serif); font-size: 14.5px; font-weight: 600; text-anchor: middle; }
.tuile-type { fill: var(--texte-doux); font-family: var(--sans); font-size: 9.5px; text-anchor: middle; letter-spacing: .02em; }
.tuile-faction polygon { stroke: var(--laiton); }
.tuile-espece polygon { stroke: #9fc0b4; }
.tuile-lieu polygon { stroke: #8fa6dc; }
.tuile-organisation polygon { stroke: #d49a86; }
.tuile-objet polygon { stroke: #c7b98a; }

.commandes-groupes { max-width: 96rem; margin: 0 auto; padding: 1.4rem 0 .6rem; border-top: 1px solid var(--trait);
  display: flex; gap: .6rem; }
.commandes-groupes button {
  padding: .35rem .8rem; font-family: var(--sans); font-size: .85rem; color: var(--texte-doux);
  background: transparent; border: 1px solid var(--trait); border-radius: 6px; cursor: pointer;
}
.commandes-groupes button:hover { color: var(--texte); border-color: var(--laiton); }
.index-types { max-width: 96rem; margin: 0 auto; }
.groupe { border-bottom: 1px solid var(--trait); }
.groupe summary {
  display: flex; align-items: center; gap: .8rem; padding: .7rem 0; cursor: pointer; list-style: none;
}
.groupe summary::-webkit-details-marker { display: none; }
.groupe summary::after {
  content: ""; margin-left: auto; width: .5rem; height: .5rem; flex: none;
  border-right: 1.5px solid var(--laiton); border-bottom: 1.5px solid var(--laiton);
  transform: rotate(45deg) translateY(-2px); transition: transform .15s ease;
}
.groupe[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.groupe summary:hover h2 { color: var(--laiton-clair); }
.groupe h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1.35rem; font-weight: 600; }
.compte { color: var(--texte-doux); font-family: var(--sans); font-size: .85rem; }
.groupe ul { margin: 0; padding: .2rem 0 1.4rem; list-style: none; columns: 19rem; column-gap: 3rem; }
.groupe li { margin: 0 0 1rem; break-inside: avoid; }
.groupe li > a { font-size: 1.12rem; }
.groupe li p { margin: .15rem 0 0; color: var(--texte-doux); font-size: .97rem; line-height: 1.5; }

/* ---------- Article ---------- */
.article { max-width: 96rem; margin: 0 auto; }
.entete-article { padding: clamp(2rem, 5vw, 3.5rem) 0 1.6rem; border-bottom: 1px solid var(--trait); margin-bottom: 2rem; }
.icone { width: 1.25em; height: 1.25em; flex: none; color: var(--laiton); }
.icone .icone-plein { fill: var(--vide); }
.type-article .icone { width: 1.5rem; height: 1.5rem; }
.ligne-article { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ligne-article .icone { width: 1.15rem; height: 1.15rem; color: var(--texte-doux); }
.ligne-article:hover .icone { color: var(--laiton); }
.groupe li p { padding-left: 1.65rem; }
.type-article { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; color: var(--texte-doux);
  font-family: var(--sans); font-size: .9rem; }
.entete-article h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.015em; }
.alias { margin: .7rem 0 0; color: var(--texte-doux); font-size: 1.05rem; }
.sources { margin: .3rem 0 0; color: var(--texte-doux); font-family: var(--sans); font-size: .85rem; }
.sources span { border-bottom: 1px dotted var(--trait); cursor: help; }

.disposition { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.sommaire { position: sticky; top: 5.2rem; max-height: calc(100vh - 6rem); overflow: auto; font-family: var(--sans); font-size: .9rem; }
.retour-wiki { margin: 0 0 1.2rem !important; padding: 0 0 1rem !important; border-bottom: 1px solid var(--trait); }
.retour-wiki li { margin: 0 0 .2rem; }
.retour-wiki a { color: var(--laiton) !important; }
.retour-wiki a:hover { color: var(--laiton-clair) !important; }
.fil { padding-top: 1.5rem; font-family: var(--sans); font-size: .9rem; }
.fil .retour-wiki { display: flex; gap: 1.2rem; padding: 0 !important; margin: 0 !important; border: 0; list-style: none; }
.fil a { text-decoration: none; }
.sommaire summary { color: var(--texte-doux); cursor: pointer; margin-bottom: .5rem; }
.sommaire ul { margin: 0; padding: 0; list-style: none; }
.sommaire li { margin: .15rem 0; line-height: 1.35; }
.sommaire li ul { margin: .2rem 0 .5rem .8rem; padding-left: .7rem; border-left: 1px solid var(--trait); }
.sommaire a { display: block; padding: .15rem 0; color: var(--texte-doux); text-decoration: none; }
.sommaire a:hover, .sommaire a.courant { color: var(--laiton-clair); }

.texte { max-width: var(--mesure); }
.texte > p:first-of-type, .texte > aside + p { font-size: 1.22rem; line-height: 1.65; }
.texte h3 { margin: 2.8rem 0 .6rem; font-size: 1.75rem; line-height: 1.2; font-weight: 600; }
.texte h4 { margin: 2rem 0 .4rem; font-size: 1.25rem; line-height: 1.3; font-weight: 600; color: var(--laiton-clair); }
.texte h2 { margin: 2.6rem 0 .8rem; font-size: 1.5rem; font-weight: 600; }
.texte p { margin: 0 0 1.05rem; hyphens: auto; }
.texte ul, .texte ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.texte li { margin-bottom: .45rem; }
.texte li::marker { color: var(--laiton); }
.texte strong { font-weight: 600; color: #f3efe3; }
.texte hr { border: 0; height: 14px; margin: 2.4rem 0;
  background: center / 18px 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 35'%3E%3Cpolygon points='10,1 30,1 39,17.5 30,34 10,34 1,17.5' fill='none' stroke='%23d2ad5f' stroke-width='3'/%3E%3C/svg%3E"),
  linear-gradient(var(--trait), var(--trait)) center / 100% 1px no-repeat; }
.texte blockquote { margin: 2rem 0; padding: .2rem 0 .2rem 1.4rem; border-left: 2px solid var(--laiton); font-size: 1.25rem; }
.texte blockquote p { margin: 0 0 .4rem; }
.texte table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.6rem; font-family: var(--sans); font-size: .92rem; }
.texte th, .texte td { padding: .45rem .6rem; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: top; }
.texte th { color: var(--texte-doux); font-weight: 600; }
.texte .nombre { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.texte code { font-size: .88em; background: var(--vide-2); padding: .05em .35em; border-radius: 3px; }
.texte-large { max-width: none; }
.texte-seul { padding-bottom: 2rem; }
.colonnes { columns: 2 14rem; }

.encadre { float: right; width: 18rem; margin: .3rem 0 1.5rem 2rem;
  background: var(--vide-2); border: 1px solid var(--trait); font-family: var(--sans); font-size: .9rem; }
.encadre dl { margin: 0; padding: 1rem 1.2rem; }
.encadre div + div { margin-top: .7rem; }
.encadre dt { color: var(--texte-doux); }
.encadre dd { margin: 0; line-height: 1.45; }
.illustration { margin: 0; }
.illustration { background: #0f1226; }
.illustration img { display: block; width: 100%; height: auto; max-height: 24rem; object-fit: contain; }
.illustration figcaption, .figure figcaption { padding: .6rem 1.2rem .8rem; color: var(--texte-doux); font-family: var(--sans);
  font-size: .85rem; line-height: 1.4; }
.illustration + dl { border-top: 1px solid var(--trait); }
.credit { display: block; margin-top: .2rem; font-size: .68rem; font-style: italic; opacity: .75; }
.figure { margin: 1.8rem 0; background: var(--vide-2); border: 1px solid var(--trait); }
.figure img { display: block; width: 100%; height: auto; max-height: 30rem; object-fit: contain; background: #0f1226; }
.figure.droite img, .figure.gauche img { max-height: 22rem; }
.figure figcaption { padding: .6rem .9rem; }
.figure.droite, .figure.gauche { width: 16rem; margin-top: .3rem; }
.figure.droite { float: right; margin-left: 1.8rem; }
.figure.gauche { float: left; margin-right: 1.8rem; }
.texte h3, .texte h2 { clear: both; }

.marque-canon { color: var(--laiton-clair); }
.bandeau-canon { display: inline-block; margin: .9rem 0 0; padding: .4rem .8rem; border-radius: 6px; font-family: var(--sans);
  font-size: .9rem; border: 1px solid currentColor; }
.canon-semi-canon { color: #d8b96e; }
.canon-non-canon { color: var(--alerte); }
.canon { margin: 1.6rem 0; padding: .2rem 1.2rem .4rem; border-left: 3px solid currentColor; background: rgba(30, 35, 66, .6); }
.canon > :not(.canon-etiquette) { color: var(--texte); }
.canon-etiquette { margin: .6rem 0 .4rem !important; font-family: var(--sans); font-size: .85rem; font-weight: 600; }
.note-canon { margin: 1rem 0 0; max-width: 36rem; color: var(--texte-doux); font-family: var(--sans); font-size: .9rem; }
.voir-aussi, .retroliens { clear: both; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--trait); }
.voir-aussi h2, .retroliens h2 { margin-top: 0; font-size: 1.3rem; }
.voir-aussi ul, .retroliens ul { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; padding: 0; list-style: none; }

.notes { margin-top: 3rem; border: 1px solid var(--trait); border-radius: 6px; background: rgba(30, 35, 66, 0.5); }
.notes summary { padding: .9rem 1.2rem; cursor: pointer; color: var(--texte-doux); font-family: var(--sans); font-size: .95rem; }
.notes summary:hover { color: var(--texte); }
.notes-corps { padding: 0 1.2rem 1rem; font-size: 1rem; }
.notes-corps h3 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; }

/* ---------- Aperçu d'édition ---------- */
.banniere-edition { padding: .5rem clamp(1rem, 4vw, 3rem); background: #2b2350; color: var(--texte); font-family: var(--sans); font-size: .88rem; }
.banniere-edition a { color: var(--laiton-clair); }
.lien-fantome { color: var(--fantome); text-decoration-style: dotted; }
.lien-fantome:hover { color: #c7b6ee; }
.lien-repli { text-decoration-style: dashed; }
.lien-inconnu { color: var(--alerte); text-decoration: wavy underline; }
.pastille { display: inline-block; margin-left: .5rem; padding: .05rem .5rem; border-radius: 999px; font-family: var(--sans);
  font-size: .72rem; vertical-align: .15em; border: 1px solid currentColor; }
.pastille-publie { color: #9fc0b4; }
.pastille-brouillon { color: var(--laiton); }
.pastille-prevu { color: var(--fantome); }
.pastille-wa { color: #8fb3e6; }

.pied { max-width: 96rem; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 3rem) 3rem; color: var(--texte-doux);
  font-family: var(--sans); font-size: .85rem; border-top: 1px solid var(--trait); }

/* ---------- Écrans étroits ---------- */
@media (min-width: 1380px) {
  :root { --colonne: clamp(18rem, 19vw, 26rem); --gouttiere: 3rem; --menu: 15rem; --ecart: 4rem; }
  /* La page fait la largeur de son contenu (menu, texte, colonne de droite) et se centre. */
  .article { max-width: calc(var(--menu) + var(--ecart) + var(--mesure) + var(--gouttiere) + var(--colonne)); }
  .disposition { grid-template-columns: var(--menu) minmax(0, 1fr); gap: var(--ecart); }
  .article:not(:has(.encadre)) { max-width: calc(var(--menu) + var(--ecart) + var(--mesure)); }
  .texte:has(> .encadre) { position: relative;
    max-width: calc(var(--mesure) + var(--colonne) + var(--gouttiere)); padding-right: calc(var(--colonne) + var(--gouttiere)); }
  .texte > .encadre { position: static; float: right; width: var(--colonne);
    margin: 0 calc(-1 * (var(--colonne) + var(--gouttiere))) 1.5rem 0; }
  .texte:has(> .encadre)::after { content: ""; display: block; clear: both; }
  .texte:has(> .encadre) > h2, .texte:has(> .encadre) > h3,
  .texte:has(> .encadre) > .voir-aussi, .texte:has(> .encadre) > .retroliens { clear: left; }
  .texte > .encadre .illustration img { max-height: 28rem; }
  .texte > .encadre + p, .texte > p:first-of-type { margin-top: 0; }
}
@media (min-width: 1700px) {
  :root { --mesure: 74ch; --menu: 16rem; --ecart: 5rem; }
}
@media (max-width: 900px) {
  .accueil { grid-template-columns: 1fr; }
  .mosaique { max-width: 28rem; }
  .disposition { grid-template-columns: 1fr; gap: 1rem; }
  .sommaire { position: static; max-height: none; padding: .8rem 1rem; background: var(--vide-2); border: 1px solid var(--trait); border-radius: 6px; }
  .sommaire summary { margin: 0; }
  .retour-wiki { display: flex; gap: 1.2rem; margin-bottom: .8rem !important; padding-bottom: .8rem !important; }
  .sommaire details[open] summary { margin-bottom: .5rem; }
  .encadre { float: none; width: auto; margin: 0 0 1.5rem; }
  .encadre .illustration img { max-width: 22rem; margin: 0 auto; }
  .figure.droite, .figure.gauche { float: none; width: auto; margin: 1.5rem 0; }
}
@media (max-width: 560px) {
  body { font-size: 1.06rem; }
  .barre { flex-wrap: wrap; gap: .6rem; }
  .recherche { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Navigation de l'en-tête ---------- */
.nav-outils { margin-right: auto; margin-left: 1rem; font-family: var(--sans); font-size: .92rem; }
.nav-outils a { color: var(--texte-doux); text-decoration: none; }
.nav-outils a:hover { color: var(--laiton-clair); }
.nav-outils a[aria-current="page"] { color: var(--laiton-clair); font-weight: 600; }
.page-outil .marque { color: var(--texte-doux); }
.page-outil .marque:hover { color: var(--laiton-clair); }

/* ---------- Calculateur de trajets ---------- */
body.page-outil main { padding: 0; }
body.page-outil .pied { display: none; }
.outil-trajets { display: grid; grid-template-columns: 23rem minmax(0, 1fr); height: calc(100vh - 4.3rem); }
.panneau-outil { overflow-y: auto; padding: 1.4rem 1.4rem 2rem; border-right: 1px solid var(--trait);
  font-family: var(--sans); font-size: .92rem; line-height: 1.45; }
.panneau-outil h1 { margin: 0 0 .4rem; font-family: var(--serif); font-size: 1.8rem; font-weight: 600; line-height: 1.15; }
.chapo-outil { margin: 0 0 1.2rem; color: var(--texte-doux); }
.panneau-outil fieldset { margin: 0 0 1.1rem; padding: 0 0 1.1rem; border: 0; border-bottom: 1px solid var(--trait); }
.panneau-outil legend { padding: 0; margin-bottom: .6rem; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--texte); }
.panneau-outil label { display: block; margin: .55rem 0 .25rem; color: var(--texte-doux); }
.panneau-outil label.case, .choix-regles label { display: flex; align-items: center; gap: .5rem; color: var(--texte); margin: .45rem 0; }
.panneau-outil input[type="checkbox"], .panneau-outil input[type="radio"] { accent-color: var(--laiton); width: 1rem; height: 1rem; }
.panneau-outil input:not([type]), .panneau-outil select {
  width: 100%; padding: .45rem .6rem; font: inherit; color: var(--texte); background: var(--vide-2);
  border: 1px solid var(--trait); border-radius: 6px; }
.panneau-outil select:disabled { opacity: .5; }
.panneau-outil input:focus, .panneau-outil select:focus { outline: none; border-color: var(--laiton); }
.etiquette-choix { margin: .7rem 0 .3rem; color: var(--texte-doux); }
.segments { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr)); gap: .3rem; }
.panneau-outil .segments button { display: flex; flex-direction: column; align-items: center; gap: .05rem; padding: .4rem .3rem;
  white-space: normal; line-height: 1.2; color: var(--texte); }
.panneau-outil .segments button small { font-size: .74rem; color: var(--texte-doux); }
.panneau-outil .segments button[aria-checked="true"] { background: var(--laiton); border-color: var(--laiton); color: var(--vide); }
.panneau-outil .segments button[aria-checked="true"] small { color: var(--vide); opacity: .8; }
.panneau-outil .segments button:focus-visible { outline: 2px solid var(--laiton); outline-offset: 2px; }
.segments-vide { grid-column: 1 / -1; padding: .45rem .6rem; color: var(--texte-doux); font-style: italic;
  border: 1px dashed var(--trait); border-radius: 6px; }
.ligne-champ { display: flex; gap: .4rem; }
.ligne-champ input { flex: 1; min-width: 0; }
.panneau-outil button { padding: .42rem .7rem; font: inherit; font-size: .85rem; color: var(--texte-doux); background: transparent;
  border: 1px solid var(--trait); border-radius: 6px; cursor: pointer; white-space: nowrap; }
.panneau-outil button:hover { color: var(--texte); border-color: var(--laiton); }
.panneau-outil button[aria-pressed="true"] { color: var(--vide); background: var(--laiton); border-color: var(--laiton); }
.actions-trajet { display: flex; gap: .5rem; margin-top: .8rem; }
.note-outil { margin: .5rem 0 0; color: var(--texte-doux); font-size: .82rem; }
.resultat-outil h2 { margin: 0 0 .6rem; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.resultat-vide { color: var(--texte-doux); }
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; margin: 0 0 .8rem; }
.chiffres div:first-child { grid-column: 1 / -1; }
.chiffres dt { color: var(--texte-doux); font-size: .8rem; }
.chiffres dd { margin: 0; font-family: var(--serif); font-size: 1.25rem; color: var(--texte); font-variant-numeric: lining-nums; }
.chiffres div:first-child dd { font-size: 1.9rem; color: var(--laiton-clair); }
.detail { margin: .4rem 0; color: var(--texte-doux); }
.alerte-portee { margin: .6rem 0; padding: .55rem .7rem; color: #ffd6d6; background: rgba(255, 77, 77, .12);
  border-left: 3px solid #ff5a5a; border-radius: 4px; }
.etapes { margin: .8rem 0; padding-left: 1.2rem; }
.etapes li { margin-bottom: .5rem; }
.etapes li span { display: block; }
.etapes li span + span { color: var(--texte-doux); font-size: .85rem; }
.etape-transfert span + span { color: #9fd3ff !important; }

.zone-carte { position: relative; min-width: 0; background: #070a17; }
.vue-carte { position: absolute; inset: 0; overflow: hidden; cursor: crosshair; touch-action: none; user-select: none; }
.plan-carte { position: absolute; top: 0; left: 0; width: 2480px; height: 3224px; transform-origin: 0 0; will-change: transform; }
.plan-carte img, .plan-carte svg { position: absolute; inset: 0; width: 2480px; height: 3224px; }
.plan-carte svg { overflow: visible; }
.trace-fond { stroke: rgba(5, 7, 16, .85); stroke-width: calc(9px / var(--e, 1)); stroke-linecap: round; }
.trace-ftl { stroke: #ffe08a; stroke-width: calc(4px / var(--e, 1)); stroke-linecap: round; }
.trace-ftl.hors-portee { stroke: #ff4d4d; }
.trace-transfert { stroke: #9fd3ff; stroke-width: calc(3px / var(--e, 1)); stroke-dasharray: calc(9px / var(--e, 1)) calc(7px / var(--e, 1)); }
.marque-depart, .marque-arrivee { stroke: #0b0e1e; stroke-width: calc(3px / var(--e, 1)); }
.marque-depart { fill: #7fe3a5; }
.marque-arrivee { fill: #ffcf5c; }
.repere-portee { fill: #ff4d4d; stroke: #fff; stroke-width: calc(2px / var(--e, 1)); }
.anneau-trou { fill: none; stroke: none; }
.zone-noyau { fill: rgba(233, 150, 122, .08); stroke: rgba(255, 170, 140, .8); stroke-width: calc(2px / var(--e, 1));
  stroke-dasharray: calc(10px / var(--e, 1)) calc(8px / var(--e, 1)); }
.bulle-carte { position: absolute; z-index: 2; max-width: 18rem; padding: .45rem .65rem; pointer-events: none;
  font-family: var(--sans); font-size: .82rem; line-height: 1.35; color: var(--texte); background: rgba(22, 26, 48, .95);
  border: 1px solid var(--trait); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.bulle-carte strong { display: block; font-weight: 600; }
.bulle-carte span { color: var(--texte-doux); }
.commandes-carte { position: absolute; top: .8rem; right: .8rem; display: flex; gap: .35rem; }
.commandes-carte button { min-width: 2.2rem; height: 2.2rem; padding: 0 .7rem; font-family: var(--sans); font-size: .95rem;
  color: var(--texte); background: rgba(22, 26, 48, .92); border: 1px solid var(--trait); border-radius: 6px; cursor: pointer; }
.commandes-carte button:hover { border-color: var(--laiton); }
.legende-carte { position: absolute; left: .8rem; bottom: .8rem; margin: 0; padding: .5rem .75rem; list-style: none;
  font-family: var(--sans); font-size: .8rem; color: var(--texte-doux); background: rgba(22, 26, 48, .92);
  border: 1px solid var(--trait); border-radius: 6px; }
.legende-carte li { display: flex; align-items: center; gap: .5rem; margin: .15rem 0; }
.trait { display: inline-block; width: 1.6rem; height: 0; border-top: 3px solid; }
.trait-ftl { border-color: #ffe08a; }
.trait-hors { border-color: #ff4d4d; }
.trait-transfert { border-top: 2px dashed #9fd3ff; }
li[data-legende] .pastille { display: inline-block; width: 1.6rem; height: .75rem; border-radius: 2px; }
.pastille-inconnu { background: repeating-linear-gradient(45deg, rgba(255, 196, 120, .7) 0 2px, rgba(8, 10, 24, .5) 2px 7px); }
.pastille-passage { background: rgba(120, 230, 170, .35); }

@media (max-width: 900px) {
  .outil-trajets { grid-template-columns: 1fr; grid-template-rows: 62vh auto; height: auto; }
  .zone-carte { grid-row: 1; height: 62vh; }
  .panneau-outil { grid-row: 2; border-right: 0; }
  .nav-outils { margin-left: 0; }
}
#choix-vitesse-vaisseau { grid-template-columns: repeat(5, 1fr); }
#choix-vitesse, #choix-portee { grid-template-columns: repeat(2, 1fr); }
#choix-hardburn { grid-template-columns: repeat(3, 1fr); }
#choix-descente { grid-template-columns: repeat(7, 1fr); gap: .2rem; }
#choix-descente button { padding-left: 0; padding-right: 0; font-size: .8rem; }
.calque-cartographie { pointer-events: none; }
.passage-cartographie { fill: none; stroke: rgba(120, 230, 170, .16); stroke-linejoin: round; stroke-linecap: round; }
.bulle-inconnu { display: block; margin-top: .15rem; color: #ffc478; }
.bulle-danger { display: block; margin-top: .1rem; color: #ff8a8a; }
.bulle-danger-connu { display: block; margin-top: .1rem; color: #ff6a3d; font-weight: 600; }
.danger-connu { fill: rgba(255, 80, 30, .38); stroke: #ff6a3d; stroke-width: calc(2px / var(--e, 1)); }
.pastille-danger-connu { background: rgba(255, 80, 30, .55); border: 1px solid #ff6a3d; }
.pastille-danger { background: repeating-linear-gradient(-45deg, rgba(255, 90, 90, .85) 0 2px, rgba(200, 30, 40, .35) 2px 6px); }

/* Difficulté de navigation */
.difficulte-trajet { margin: 1rem 0; padding: .8rem .9rem; background: var(--vide-2); border: 1px solid var(--trait); border-radius: 6px; }
.difficulte-trajet h3 { margin: 0 0 .6rem; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.diff-troncon { margin: 0 0 .7rem; }
.diff-titre { margin: 0 0 .2rem; color: var(--texte); }
.diff-valeur { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-weight: 600; color: var(--laiton-clair); }
.diff-troncon ul { margin: 0; padding-left: 1.1rem; color: var(--texte-doux); font-size: .84rem; }
.des { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.de { display: inline-block; width: 13px; height: 13px; }
.de-difficulte { background: #7b4fc9; transform: rotate(45deg) scale(.8); border: 1px solid #b597ff; }
.de-defi { background: #c3262f; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.de-infortune { background: #111; border: 1px solid #777; }
.de-fortune { background: #5fb8e8; border: 1px solid #b8e6ff; }

/* Grandes routes commerciales */
.calque-routes { pointer-events: none; }
.route-fond { fill: none; stroke: rgba(11, 14, 30, .6); stroke-width: calc(5px * var(--rz, 1) / var(--e, 1)); stroke-linejoin: round; stroke-linecap: round; }
.route-commerciale { fill: none; stroke: #f0c66a; stroke-width: calc(2.4px * var(--rz, 1) / var(--e, 1)); stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: calc(13px * var(--rz, 1) / var(--e, 1)) calc(6px * var(--rz, 1) / var(--e, 1)); opacity: 1; }
.trait-route { border-top: 2px dashed #f0c66a; }

#choix-priorite { grid-template-columns: repeat(3, 1fr); }
#choix-priorite button { font-size: .8rem; }
.etapes em { font-style: normal; color: #f0c66a; font-size: .85em; }
.compromis { margin: .3rem 0 .6rem; font-size: .84rem; color: var(--texte-doux); }
.compromis summary { cursor: pointer; color: var(--texte); }
.compromis ol { margin: .3rem 0 0; padding-left: 1.2rem; }
.compromis-choisi { color: var(--laiton-clair); font-weight: 600; }
.repere-escale { fill: #9fd3ff; stroke: #0b0e1e; stroke-width: calc(2px / var(--e, 1)); }
.pistes-escales { margin: .2rem 0 .6rem; padding-left: 1.1rem; font-size: .84rem; color: var(--texte-doux); }
.pistes-escales li { margin: .2rem 0; }

.liste-escales { margin: .2rem 0 .4rem; padding: 0; list-style: none; }
.liste-escales li { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin: .2rem 0; color: var(--texte); }
.liste-escales button { padding: .15rem .45rem; font-size: .75rem; }
.partie-trajet { margin: .8rem 0; }
.titre-partie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem; margin: 0 0 .3rem; padding-top: .6rem;
  border-top: 1px solid var(--trait); font-family: var(--serif); font-size: 1rem; font-weight: 600; }
.titre-partie span:last-child { color: var(--laiton-clair); font-family: var(--sans); font-size: .85rem; }
.difficulte-trajet h3 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.panneau-outil .bouton-aide { width: 1.5rem; height: 1.5rem; padding: 0; border-radius: 50%; font-weight: 700; color: var(--laiton-clair); border-color: var(--laiton); }
.fenetre-regles { max-width: 40rem; width: calc(100% - 2rem); max-height: 85vh; overflow: auto; padding: 1.4rem 1.6rem; color: var(--texte);
  background: var(--vide-2); border: 1px solid var(--trait); border-radius: 8px; font-family: var(--sans); font-size: .92rem; line-height: 1.5; }
.fenetre-regles::backdrop { background: rgba(5, 7, 16, .7); }
.fenetre-regles h2 { margin: 0 0 .6rem; font-family: var(--serif); font-size: 1.4rem; }
.fenetre-regles h3 { margin: 1rem 0 .3rem; font-family: var(--serif); font-size: 1.05rem; color: var(--laiton-clair); }
.fenetre-regles ul { margin: .2rem 0; padding-left: 1.2rem; }
.fermer-regles { position: sticky; top: 0; float: right; width: 2rem; height: 2rem; font-size: 1.3rem; line-height: 1; color: var(--texte);
  background: transparent; border: 1px solid var(--trait); border-radius: 6px; cursor: pointer; }
.rappel-acceleration { margin: .6rem 0; padding: .6rem .8rem; font-size: .86rem; background: var(--vide-2); border: 1px solid var(--trait); border-left: 3px solid #9fd3ff; border-radius: 6px; }
.rappel-acceleration p { margin: 0 0 .2rem; }
.rappel-acceleration ul { margin: 0; padding-left: 1.1rem; color: var(--texte-doux); }

.case-carte, .menu-calques summary { display: flex; align-items: center; gap: .4rem; height: 2.2rem; padding: 0 .7rem; font-family: var(--sans);
  font-size: .9rem; color: var(--texte); background: rgba(22, 26, 48, .92); border: 1px solid var(--trait); border-radius: 6px; cursor: pointer; }
.case-carte input, .liste-calques input { accent-color: var(--laiton); width: 1rem; height: 1rem; }
.menu-calques { position: relative; }
.menu-calques summary { list-style: none; }
.menu-calques summary::-webkit-details-marker { display: none; }
.menu-calques summary::after { content: "▾"; color: var(--texte-doux); }
.menu-calques[open] summary { border-color: var(--laiton); }
.liste-calques { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 3; min-width: 17rem; padding: .5rem .7rem;
  background: rgba(22, 26, 48, .97); border: 1px solid var(--trait); border-radius: 6px; font-family: var(--sans); font-size: .88rem; }
.liste-calques label { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; color: var(--texte); cursor: pointer; }
.zone-coeur { fill: rgba(120, 180, 255, .1); stroke: rgba(160, 210, 255, .85); stroke-width: calc(2px / var(--e, 1));
  stroke-dasharray: calc(6px / var(--e, 1)) calc(5px / var(--e, 1)); }
.pastille-noyau { border: 2px dashed rgba(255, 170, 140, .8); background: rgba(233, 150, 122, .12); }
.pastille-coeur { border: 2px dashed rgba(160, 210, 255, .85); background: rgba(120, 180, 255, .12); }
.outil-trajets [hidden] { display: none !important; }
.panneau-outil .segments button.option-impossible { color: #ff8080; border-color: rgba(255, 90, 90, .5); background: rgba(255, 60, 60, .08); cursor: not-allowed; text-decoration: line-through; }

/* Recherche d'un lieu sur la carte */
.recherche-carte { position: absolute; top: .8rem; left: .8rem; z-index: 3; width: min(22rem, calc(100% - 1.6rem)); font-family: var(--sans); }
.recherche-carte input { width: 100%; height: 2.2rem; padding: 0 .75rem; font: inherit; font-size: .92rem; color: var(--texte);
  background: rgba(22, 26, 48, .95); border: 1px solid var(--trait); border-radius: 6px; }
.recherche-carte input:focus { outline: none; border-color: var(--laiton); }
.suggestions-lieux { margin: .25rem 0 0; padding: .25rem 0; list-style: none; max-height: 20rem; overflow: auto;
  background: rgba(22, 26, 48, .98); border: 1px solid var(--trait); border-radius: 6px; }
.suggestions-lieux li { display: flex; flex-direction: column; padding: .35rem .7rem; cursor: pointer; }
.suggestions-lieux li strong { font-weight: 600; color: var(--texte); font-size: .9rem; }
.suggestions-lieux li span { font-size: .78rem; color: var(--texte-doux); }
.suggestions-lieux li[aria-selected="true"], .suggestions-lieux li:hover { background: var(--vide-3); }
.suggestions-lieux .aucun-lieu { cursor: default; color: var(--texte-doux); font-size: .85rem; }
.fiche-lieu { position: relative; display: flex; flex-direction: column; gap: .2rem; margin-top: .35rem; padding: .6rem .8rem;
  background: rgba(22, 26, 48, .97); border: 1px solid var(--laiton); border-radius: 6px; font-size: .85rem; color: var(--texte-doux); }
.fiche-lieu strong { color: var(--laiton-clair); font-size: 1rem; padding-right: 1.5rem; }
.fiche-alias { font-size: .78rem; }
.fiche-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; align-items: center; }
.fiche-actions a { color: var(--laiton-clair); margin-right: .3rem; }
.fiche-actions button, .fermer-fiche { padding: .2rem .55rem; font: inherit; font-size: .8rem; color: var(--texte); background: transparent;
  border: 1px solid var(--trait); border-radius: 5px; cursor: pointer; }
.fermer-fiche { position: absolute; top: .4rem; right: .4rem; padding: 0 .4rem; }
.epingle-recherche { fill: #ff5fa2; stroke: #0b0e1e; stroke-width: .15; }
.halo-recherche { fill: none; stroke: #ff5fa2; stroke-width: .15; animation: halo-recherche 1.67s ease-out 3 forwards; }
@keyframes halo-recherche { from { r: .4; opacity: 1; } to { r: 2.6; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .halo-recherche { animation: none; r: 1.6; } }

/* Onglets de la carte interactive et atlas */
.onglets-outil { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; margin: 0 0 1rem; }
.panneau-outil .onglets-outil button { padding: .5rem .3rem; font-size: .86rem; font-weight: 600; color: var(--texte); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.panneau-outil .onglets-outil button[aria-selected="true"] { background: var(--laiton); border-color: var(--laiton); color: var(--vide); }
.titre-atlas { margin: .2rem 0 .1rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.liste-atlas { margin: .6rem 0; padding: 0; list-style: none; }
.liste-atlas li { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .1rem; border-bottom: 1px solid var(--trait); }
.liste-atlas a { color: var(--laiton-clair); font-weight: 600; text-decoration: none; }
.liste-atlas a:hover { text-decoration: underline; }
.liste-atlas a::after { content: " ↗"; font-weight: 400; font-size: .8em; color: var(--texte-doux); }
.atlas-dedie { padding: .7rem .8rem !important; margin-bottom: .3rem; background: var(--vide-2); border: 1px solid var(--laiton) !important; border-radius: 6px; }
.atlas-dedie a { font-size: 1.08rem; }
.etiquette-dedie { font-size: .75rem; color: var(--texte-doux); }
.atlas-meta { font-size: .78rem; color: var(--texte-doux); }
.atlas-extrait { font-size: .82rem; color: var(--texte-doux); font-style: italic; }
.marque-atlas { fill: none; stroke: #9fd3ff; stroke-width: calc(3px / var(--e, 1)); stroke-dasharray: calc(6px / var(--e, 1)) calc(4px / var(--e, 1)); }

.selection-atlas { pointer-events: none; }
.zone-atlas { fill: rgba(159, 211, 255, .16); stroke: #9fd3ff; stroke-width: calc(2.5px / var(--e, 1)); stroke-linejoin: round; }
.zone-atlas.zone-atlas-bande { fill: none; stroke: rgba(159, 211, 255, .3); stroke-linecap: round; }
.marque-atlas-pulse { fill: none; stroke: #9fd3ff; stroke-width: calc(2px / var(--e, 1)); transform-box: fill-box; transform-origin: center;
  animation: pulse-atlas 1.67s ease-out 3 forwards; }
@keyframes pulse-atlas { from { transform: scale(1); opacity: .9; } to { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .marque-atlas-pulse { animation: none; opacity: 0; } }
.pastille-selection { background: rgba(159, 211, 255, .2); border: 2px solid #9fd3ff; }
.distance-modifiee { display: block; font-size: .72rem; font-family: var(--sans); color: var(--texte-doux); }
.etapes small { color: var(--texte-doux); }

/* Encart de données (planètes, systèmes, stations) */
.encart-donnees { clear: both; margin: 2.2rem 0 1.5rem; border: 1px solid var(--trait, rgba(212,175,95,.35));
  border-radius: 6px; background: rgba(255,255,255,.025); padding: 1.1rem 1.4rem 1.2rem; }
.encart-donnees h2 { margin: 0 0 .8rem; font-size: 1.15rem; }
.encart-donnees dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.4rem; }
.encart-donnees div { display: contents; }
.encart-donnees dt { color: var(--texte-doux); font-family: var(--sans); font-size: .85rem; letter-spacing: .02em; padding-top: .15rem; }
.encart-donnees dd { margin: 0; line-height: 1.45; }
@media (max-width: 640px) { .encart-donnees dl { grid-template-columns: 1fr; gap: .15rem; } .encart-donnees dd { margin-bottom: .6rem; } }

/* Fiche de données (planètes, systèmes, stations) : dans l'encadré, sous l'illustration */
.fiche-donnees { padding: .9rem 1.2rem 1.1rem; }
.illustration + .fiche-donnees, dl + .fiche-donnees { border-top: 1px solid var(--trait); }
.fiche-donnees h2 { margin: 0 0 .7rem; font-size: 1rem; }
.fiche-donnees dl { padding: 0; }
.fiche-donnees dt { font-family: var(--sans); font-size: .8rem; letter-spacing: .02em; }
.fiche-donnees dd { font-size: .95rem; }
