/* ═══════════════════════════════════════════
   SKARATH — Codex de table
   Palette illustrations : ocre, rouille, charbon, os
═══════════════════════════════════════════ */
:root {
  --or-brule:        #C8873A;
  --or-chaud:        #E8A84C;
  --rouille:         #8B3A1A;
  --rouille-sombre:  #5C2010;
  --parchemin:       #F2EBD9;
  --parchemin-clair: #FAF5EC;
  --parchemin-sombre:#E0D2B8;
  --cicatrice:       #7EB8C9;
  --cicatrice-vive:  #A8D4E0;
  --noir-charbon:    #1C1410;
  --gris-cendre:     #4A3F35;
  --texte-principal: #2A1F14;
  --texte-secondaire:#5C4A35;
  --fond-sombre:     #0a0806;
  --fond-nav:        #14100c;
  --fond-nav-elev:   #1c1410;
  --fond-panel:      #242018;
  --fond-panel-hover:#2e241c;
  --bleu-nuit:       var(--fond-panel);
  --bleu-profond:    var(--fond-nav);
  --font-titre: 'Source Serif 4', Georgia, serif;
  --font-deco:  'Source Serif 4', Georgia, serif;
  --font-corps: 'Source Sans 3', system-ui, sans-serif;
  --surface:       #2A1F14;
  --surface-elevated: #352820;
  --texte-sur-sombre: #F2EBD9;
  --texte-muted-sombre: #D4C8B4;
  --surface-lecture: #FAF5EC;
  --surface-lecture-elev: #F2EBD9;
  --masthead-h: 3.75rem;
  --chapitre-h: 3rem;
  --page-max: 52rem;
  --ombre-page: 0 12px 40px rgba(12, 8, 4, 0.45);
  --nav-border: rgba(200, 135, 58, 0.22);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  position: relative;
  background-color: #12100e;
  font-family: var(--font-corps);
  color: var(--texte-sur-sombre);
  min-height: 100vh;
  isolation: isolate;
}

/* Fond global sobre — lisibilité prioritaire */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: #12100e;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(139, 58, 26, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #100e0c 0%, #161412 45%, #141210 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

a { color: var(--rouille); }
a:hover { color: var(--or-brule); }

/* ── Masthead (bandeau de campagne) ── */
.codex-masthead {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(180deg, var(--fond-nav-elev) 0%, var(--fond-nav) 100%);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  min-height: var(--masthead-h);
}

.masthead-brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.masthead-logo {
  font-family: var(--font-deco);
  font-size: 1.45rem;
  color: var(--or-brule);
  letter-spacing: 0.14em;
  line-height: 1.1;
}

.masthead-tag {
  font-family: var(--font-corps);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--texte-muted-sombre);
}

.masthead-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-corps);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--texte-muted-sombre);
}

.masthead-meta a,
.masthead-meta .search-trigger {
  color: var(--texte-sur-sombre);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--nav-border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  font: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.masthead-meta a:hover,
.masthead-meta .search-trigger:hover {
  border-color: var(--or-brule);
  color: var(--or-chaud);
  background: var(--fond-panel-hover);
}

.masthead-user {
  color: var(--or-brule);
  font-style: normal;
  padding: 0.35rem 0.5rem;
  border: none;
  background: transparent;
}

.nav-toggle {
  display: none;
  font-family: var(--font-titre);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid rgba(200, 135, 58, 0.5);
  color: var(--or-chaud);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}

/* ── Rail de chapitres (menu principal) ── */
.chapter-rail {
  background: var(--fond-nav);
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: var(--masthead-h);
  z-index: 150;
}

.chapter-rail-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: var(--chapitre-h);
}

.chapter-rail-home {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-corps);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--texte-sur-sombre);
  text-decoration: none;
  border: 1px solid var(--nav-border);
  border-radius: 4px;
  background: var(--fond-panel);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.chapter-rail-home:hover,
.chapter-rail-home.active {
  color: var(--or-chaud);
  border-color: var(--or-brule);
  background: var(--fond-panel-hover);
}

.chapter-rail-scroll {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.chapter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  padding: 0.2rem 0.5rem 0.2rem 0;
  border-left: 1px solid var(--nav-border);
}

.chapter-group:first-of-type {
  border-left: none;
  padding-left: 0;
}

.chapter-group--mj {
  margin-left: auto;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(139, 58, 26, 0.35);
}

.chapter-label {
  font-family: var(--font-corps);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--or-brule);
  opacity: 0.85;
  padding: 0 0.35rem 0 0;
  white-space: nowrap;
}

.chapter-rail a {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.65rem;
  font-family: var(--font-corps);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--texte-muted-sombre);
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.chapter-rail a:hover {
  color: var(--texte-sur-sombre);
  background: var(--fond-panel);
  border-color: var(--nav-border);
}

.chapter-rail a.active {
  color: var(--or-chaud);
  background: rgba(200, 135, 58, 0.15);
  border-color: rgba(200, 135, 58, 0.45);
  font-weight: 600;
}

/* Compat ancienne nav (legacy HTML statique) */
nav.doc-nav { display: none; }

/* ── Zone de page ── */
main.doc-main {
  margin-left: 0;
  padding: 1.75rem 1rem 3rem;
}

.doc-main--hub {
  padding-top: 1.25rem;
}

body:has(.doc-main--hub) .chapter-rail,
body:has(.skarath-main--index) .chapter-rail {
  display: none;
}

.codex-page {
  max-width: 72rem;
  margin: 0 auto;
}

.codex-sheet {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  background: var(--surface-lecture);
  color: var(--texte-principal);
  padding: 2.25rem 2rem 2.75rem;
  box-shadow: var(--ombre-page);
  border: 1px solid var(--parchemin-sombre);
  border-radius: 8px;
}

.codex-sheet::before,
.codex-sheet::after {
  content: '';
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border-color: var(--or-brule);
  border-style: solid;
  opacity: 0.55;
  pointer-events: none;
}

.codex-sheet::before {
  top: 0.5rem;
  left: 0.5rem;
  border-width: 2px 0 0 2px;
}

.codex-sheet::after {
  bottom: 0.5rem;
  right: 0.5rem;
  border-width: 0 2px 2px 0;
}

.codex-sheet-narrow { max-width: 28rem; }

.codex-page--builder {
  max-width: 56rem;
}

.codex-page--builder .codex-sheet--builder {
  max-width: none;
}

.content-wrap {
  background: transparent;
  min-height: auto;
  padding: 0;
}

/* ── Sommaire (hub) ── */
.hub-spread {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.hub-cover {
  background: linear-gradient(165deg, var(--fond-nav-elev) 0%, var(--fond-panel) 55%, var(--rouille-sombre) 100%);
  border: 1px solid var(--nav-border);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hub-cover::before {
  content: '◆ ◆ ◆';
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.45rem;
  letter-spacing: 0.8em;
  color: var(--or-brule);
  opacity: 0.35;
}

.hub-cover h1 {
  font-family: var(--font-deco);
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  color: var(--or-brule);
  letter-spacing: 0.18em;
  margin-top: 0.5rem;
}

.hub-cover .hub-lead {
  font-family: var(--font-corps);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--texte-muted-sombre);
  margin-top: 0.75rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hub-cover .hub-version {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--font-corps);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--or-brule);
  border: 1px solid var(--nav-border);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.hub-toc {
  background: var(--parchemin-clair);
  border: 1px solid var(--parchemin-sombre);
  border-top: none;
  padding: 1.5rem 1.75rem 2rem;
  box-shadow: var(--ombre-page);
}

.hub-toc-title {
  font-family: var(--font-titre);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rouille);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--or-brule);
}

.hub-toc-group {
  margin-bottom: 1.5rem;
}

.hub-toc-group h3 {
  font-family: var(--font-titre);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gris-cendre);
  margin-bottom: 0.5rem;
}

.toc-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.25rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background 0.12s, border-color 0.12s;
}

.toc-entry:hover {
  background: rgba(200, 135, 58, 0.08);
  border-color: var(--parchemin-sombre);
}

.toc-entry:hover .toc-name { color: var(--or-brule); }

.toc-num {
  font-family: var(--font-deco);
  font-size: 0.85rem;
  color: var(--or-brule);
  opacity: 0.5;
  min-width: 1.5rem;
}

.toc-name {
  font-family: var(--font-titre);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--rouille);
  transition: color 0.1s;
}

.toc-desc {
  grid-column: 2;
  font-size: 0.88rem;
  color: var(--texte-secondaire);
  line-height: 1.45;
  margin-top: -0.15rem;
}

.toc-badge {
  font-family: var(--font-titre);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  white-space: nowrap;
  align-self: start;
}

/* Legacy hub classes */
.hub-hero { display: none; }
.hub-grid { display: none; }
.hub-card { display: none; }

/* ── Sections règles ── */
.section {
  max-width: none;
  margin: 0 auto 2.75rem;
  padding-left: 0.25rem;
}

.section:last-child { margin-bottom: 0; }

.section-header {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.5rem 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--parchemin-sombre);
  position: relative;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 4rem;
  height: 3px;
  background: var(--or-brule);
}

.section-number {
  font-family: var(--font-deco);
  font-size: 2rem;
  color: var(--or-brule);
  line-height: 1;
  text-align: right;
  opacity: 0.45;
}

.section-title {
  font-family: var(--font-titre);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rouille);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.section-title span {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gris-cendre);
  letter-spacing: 0.12em;
  margin-top: 0.2rem;
  text-transform: uppercase;
}

h3.sous-titre {
  font-family: var(--font-titre);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--rouille);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 1.85rem 0 0.65rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--or-brule);
}

h4.sous-sous-titre {
  font-family: var(--font-titre);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gris-cendre);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1.35rem 0 0.45rem;
}

p, li {
  font-size: 1.05rem;
  line-height: 1.72;
}

.codex-sheet p,
.codex-sheet li,
.skarath-prose p,
.skarath-prose li {
  color: var(--texte-principal);
}

p { margin-bottom: 0.7rem; }
strong { font-weight: 600; color: var(--noir-charbon); }
em { color: var(--rouille); font-style: italic; }

ol.rules-list, ul.rules-list {
  margin: 0.5rem 0 1rem 1.5rem;
}

ol.rules-list li, ul.rules-list li {
  margin-bottom: 0.4rem;
  padding-left: 0.25rem;
}

/* ── Encadrés (blocs de règle / stat block) ── */
.regle-principale {
  background: var(--noir-charbon);
  border: 1px solid rgba(200, 135, 58, 0.35);
  border-top: 3px solid var(--or-brule);
  padding: 1.35rem 1.5rem;
  margin: 1.35rem 0;
  position: relative;
  border-radius: 4px;
}

.regle-principale::before {
  content: 'JET';
  position: absolute;
  top: -0.55rem;
  left: 1rem;
  font-family: var(--font-corps);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: var(--or-brule);
  color: var(--noir-charbon);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.regle-principale p {
  color: var(--parchemin);
  text-align: center;
  margin: 0;
  font-size: 1.08rem;
}

.regle-principale .formule {
  font-family: var(--font-titre);
  font-size: 1.05rem;
  color: var(--or-chaud);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.encadre-regle,
.encadre-exemple,
.encadre-mj,
.encadre-wip {
  margin: 1.1rem 0;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  position: relative;
}

.encadre-regle {
  background: rgba(200, 135, 58, 0.06);
  border: 1px solid rgba(200, 135, 58, 0.4);
  border-left: 4px solid var(--or-brule);
}

.encadre-exemple {
  background: var(--parchemin);
  border: 1px dashed var(--gris-cendre);
  font-size: 0.98rem;
}

.encadre-mj {
  background: rgba(92, 32, 16, 0.06);
  border: 1px solid rgba(139, 58, 26, 0.35);
  border-left: 4px solid var(--rouille);
}

/* Contenu MJ : masqué pour les joueurs (HTML + liens croisés) */
body:not(.kerath-mj) .encadre-mj,
body:not(.kerath-mj) .kerath-mj-only {
  display: none !important;
}

.encadre-wip {
  background: rgba(139, 58, 26, 0.05);
  border: 2px dashed var(--rouille);
  text-align: center;
  padding: 1.25rem;
}

.encadre-wip p { margin: 0; color: var(--texte-secondaire); }

.box-label {
  font-family: var(--font-titre);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 0.4rem;
  padding: 0.1rem 0.35rem;
}

.encadre-regle .box-label {
  color: var(--parchemin-clair);
  background: var(--or-brule);
}

.encadre-exemple .box-label {
  color: var(--gris-cendre);
  border: 1px solid var(--gris-cendre);
}

.encadre-mj .box-label {
  color: var(--parchemin);
  background: var(--rouille);
}

/* ── Tableaux (grilles de référence) ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--parchemin-sombre);
  font-size: 0.95rem;
}

thead tr {
  background: var(--rouille);
  border-bottom: 2px solid var(--rouille-sombre);
}

thead th {
  font-family: var(--font-titre);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--parchemin);
  padding: 0.7rem 0.85rem;
  text-align: left;
}

tbody tr {
  border-bottom: 1px solid var(--parchemin-sombre);
}

tbody tr:nth-child(odd) { background: var(--parchemin-clair); }
tbody tr:nth-child(even) { background: rgba(224, 210, 184, 0.45); }
tbody tr:hover { background: rgba(200, 135, 58, 0.08); }

tbody td {
  padding: 0.6rem 0.85rem;
  vertical-align: top;
}

td.val {
  font-family: var(--font-titre);
  font-weight: 700;
  color: var(--or-brule);
  font-size: 1rem;
  white-space: nowrap;
}

/* ── Tags ── */
.tag,
.tag-joueur,
.tag-mj,
.tag-wip,
.tag-ready,
.tag-skill,
.tag-commune,
.tag-specialisee {
  font-family: var(--font-titre);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border: 1px solid transparent;
}

.tag-joueur, .tag-ready { background: rgba(200, 135, 58, 0.12); color: var(--rouille); border-color: rgba(200, 135, 58, 0.3); }
.tag-mj { background: rgba(126, 184, 201, 0.12); color: #2d5a68; border-color: rgba(126, 184, 201, 0.35); }
.tag-wip { background: rgba(139, 58, 26, 0.08); color: var(--rouille-sombre); border-color: rgba(139, 58, 26, 0.25); }
.tag-commune { background: rgba(90, 120, 60, 0.12); color: #3d5230; border-color: rgba(90, 120, 60, 0.3); }
.tag-a-verifier {
  background: rgba(160, 72, 40, 0.14);
  color: #7a3018;
  border-color: rgba(160, 72, 40, 0.35);
}
.tag-specialisee { background: rgba(139, 58, 26, 0.1); color: var(--rouille-sombre); border-color: rgba(139, 58, 26, 0.25); }

/* ── Fiche personnage ── */
.fiche-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1rem 0;
}

.fiche-piste {
  font-size: 0.95rem;
  margin: 0.5rem 0 1rem;
}

@media (max-width: 700px) {
  .fiche-layout { grid-template-columns: 1fr; }
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 1rem 0;
  border: 2px solid var(--rouille);
  background: var(--parchemin);
}

.sheet-stat {
  border: 1px solid var(--parchemin-sombre);
  padding: 0.65rem 0.5rem;
  text-align: center;
  background: var(--parchemin-clair);
}

.sheet-stat:nth-child(odd) { background: var(--parchemin); }

.sheet-stat label {
  font-family: var(--font-titre);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rouille);
  display: block;
  border-bottom: 1px solid var(--or-brule);
  padding-bottom: 0.25rem;
  margin-bottom: 0.35rem;
}

.sheet-stat input[type="number"] {
  width: 2.75rem;
  font-family: var(--font-deco);
  font-size: 1.35rem;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--noir-charbon);
}

.sheet-stat .mod {
  font-family: var(--font-titre);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--or-brule);
  margin-top: 0.15rem;
}

.sheet-stat .mod.negative { color: var(--rouille); }

.sheet-skills {
  margin: 1rem 0;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin-clair);
  padding: 0.5rem 0.75rem;
}

.sheet-skills h4 {
  font-family: var(--font-titre);
  font-size: 0.72rem;
  color: var(--rouille);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0.75rem 0 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--or-brule);
}

.sheet-skills h4:first-child { margin-top: 0.25rem; }

.sheet-reputations {
  margin: 1rem 0;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin-clair);
  padding: 0.5rem 0.75rem 0.75rem;
}

.sheet-rep-kind {
  font-family: var(--font-titre);
  font-size: 0.72rem;
  color: var(--rouille);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0.85rem 0 0.35rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--or-brule);
}

.sheet-rep-kind:first-of-type { margin-top: 0.35rem; }

.sheet-rep-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sheet-rep-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.75rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(224, 210, 184, 0.75);
  font-size: 0.88rem;
}

.sheet-rep-row-secret .sheet-rep-label {
  color: var(--rouille);
}

.sheet-rep-label {
  grid-column: 1;
  grid-row: 1;
  font-weight: 500;
}

.sheet-rep-controls {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sheet-rep-value {
  min-width: 2rem;
  text-align: center;
  font-family: var(--font-titre);
  font-size: 0.95rem;
  color: var(--texte-principal);
}

.sheet-rep-hint {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 0.75rem;
  color: var(--texte-secondaire);
}

.sheet-rep-btn {
  min-width: 2rem;
  padding: 0.15rem 0.35rem;
  line-height: 1.2;
}

.skill-check-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr 2.5rem 2.5rem;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(224, 210, 184, 0.8);
}

.skill-check-row.specialisee { opacity: 0.5; }
.skill-check-row.specialisee.maitrise { opacity: 1; }
.skill-check-row input[type="checkbox"] { accent-color: var(--or-brule); }

.skill-check-row .carac-abr {
  font-family: var(--font-titre);
  font-size: 0.62rem;
  color: var(--or-brule);
  text-align: center;
}

.skill-check-row .skill-bonus {
  font-family: var(--font-titre);
  font-size: 0.78rem;
  color: var(--texte-secondaire);
  text-align: center;
}

.sheet-field { margin-bottom: 0.85rem; }

.sheet-field label {
  font-family: var(--font-titre);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rouille);
  display: block;
  margin-bottom: 0.25rem;
}

.sheet-field input,
.sheet-field textarea,
.sheet-field select,
form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="number"],
form select,
form textarea {
  width: 100%;
  font-family: var(--font-corps);
  font-size: 1.02rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin-clair);
  color: var(--texte-principal);
}

.sheet-field textarea,
form textarea { min-height: 80px; resize: vertical; }

form p { margin-bottom: 0.85rem; }
form label { font-family: var(--font-titre); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rouille); }

.btn {
  font-family: var(--font-titre);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.15rem;
  border: 2px solid var(--or-brule);
  background: var(--or-brule);
  color: var(--parchemin-clair);
  cursor: pointer;
  margin-top: 0.5rem;
  text-decoration: none;
  display: inline-block;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover {
  background: var(--rouille);
  border-color: var(--rouille);
  color: var(--parchemin-clair);
}

.btn-secondary {
  background: transparent;
  color: var(--rouille);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.auth-actions .btn { margin-top: 0; }

.auth-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ── Charte graphique ── */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.swatch {
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin-clair);
}

.swatch-color { height: 3.5rem; border-bottom: 2px solid var(--noir-charbon); }

.swatch-info {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}

.swatch-info code {
  font-size: 0.78rem;
  color: var(--rouille);
}

.type-sample {
  margin: 1rem 0;
  padding: 1.25rem;
  background: var(--parchemin);
  border: 2px solid var(--rouille);
  border-top-width: 4px;
}

.type-deco {
  font-family: var(--font-deco);
  font-size: 2rem;
  color: var(--or-brule);
  margin-bottom: 0.35rem;
}

.type-titre {
  font-family: var(--font-titre);
  font-size: 1.1rem;
  color: var(--rouille);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.type-corps {
  font-family: var(--font-corps);
  font-size: 1.05rem;
}

/* ── Messages Django ── */
.flash-messages {
  max-width: 72rem;
  margin: 0 auto 0.5rem;
  padding: 0 1rem;
}

.flash-messages .encadre-regle {
  margin: 0.25rem auto;
  max-width: 72rem;
  background: var(--surface-lecture);
  color: var(--texte-principal);
  border-color: var(--or-brule);
}

.flash-messages .encadre-regle,
.flash-messages .encadre-regle p {
  color: var(--texte-principal);
}

/* ── Pied de page ── */
footer.doc-footer {
  max-width: 72rem;
  margin: 2rem auto 0;
  padding: 1rem 1.25rem;
  text-align: center;
  border-top: 1px solid rgba(200, 135, 58, 0.2);
}

footer.doc-footer p {
  font-style: italic;
  font-size: 0.82rem;
  color: var(--texte-muted-sombre);
  margin: 0.2rem 0;
}

footer.doc-footer a {
  color: var(--or-brule);
  text-decoration: none;
  font-style: normal;
  font-family: var(--font-titre);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

footer.doc-footer a:hover { color: var(--or-chaud); }

footer.doc-footer.hub-footer {
  background: transparent;
  border-top-color: rgba(200, 135, 58, 0.15);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--fond-nav); }
::-webkit-scrollbar-thumb { background: var(--rouille); }

/* ── Responsive ── */
@media (min-width: 861px) {
  .nav-toggle { display: none !important; }
}

@media (max-width: 860px) {
  .sheet-grid { grid-template-columns: repeat(2, 1fr); }

  .nav-toggle { display: block; }

  .chapter-rail-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 1rem;
  }

  .chapter-rail-home {
    width: 100%;
    justify-content: center;
  }

  .chapter-rail-scroll {
    flex-direction: column;
    align-items: stretch;
  }

  .chapter-group {
    border-left: none;
    border-top: 1px solid var(--nav-border);
    padding: 0.5rem 0 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .chapter-group--mj {
    margin-left: 0;
    padding-left: 0;
  }

  .chapter-label {
    width: 100%;
    padding-bottom: 0.25rem;
  }

  .chapter-rail.is-collapsed .chapter-rail-scroll {
    display: none;
  }

  .chapter-rail.is-collapsed .nav-toggle { display: block; }

  .codex-sheet { padding: 1.5rem 1.15rem 2rem; }
}

@media (min-width: 861px) {
  .hub-spread {
    grid-template-columns: 1fr 1.4fr;
  }

  .hub-cover {
    border-right: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
  }

  .hub-toc { border-top: 1px solid var(--parchemin-sombre); }
}

.magie-toc .rules-list {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.magie-toc a {
  color: var(--rouille);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.magie-toc a:hover {
  border-bottom-color: var(--or-brule);
}

.class-detail-table td:first-child {
  font-weight: 600;
}

.etincelle-count {
  font-size: 0.75rem;
  font-family: var(--font-titre);
  letter-spacing: 0.06em;
  color: var(--rouille);
  opacity: 0.85;
}

.class-detail-table td:nth-child(2),
.class-detail-table td:nth-child(3) {
  font-size: 0.88rem;
  line-height: 1.45;
}

.catalogue-meta {
  font-size: 0.88rem;
  color: var(--rouille);
  font-style: italic;
}

.catalogue-table td:nth-child(3) {
  max-width: 22rem;
  line-height: 1.45;
}

.race-detail-table td:last-child {
  line-height: 1.5;
  font-size: 0.92rem;
}

.maitrises-overview-table td {
  vertical-align: top;
  font-size: 0.9rem;
  line-height: 1.45;
}

.maitrises-sub-list {
  max-width: 18rem;
}

.maitrises-classe-block {
  margin: 1.5rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--parchemin-sombre);
}

.maitrises-classe-block:first-child {
  border-top: none;
  padding-top: 0;
}

.maitrises-choix {
  font-size: 0.92rem;
  color: var(--encre);
  margin: 0.35rem 0 0.75rem;
}

.rules-list.compact {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.2rem;
}

.rules-list.compact li {
  margin-bottom: 0.15rem;
}

.fiche-maitrises-classe {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  background: rgba(200, 135, 58, 0.08);
  border: 1px solid var(--parchemin-sombre);
}

.fiche-maitrises-classe .sheet-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.fiche-maitrises-choix {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.88rem;
}

.fiche-maitrises-resume {
  font-size: 0.88rem;
  margin: 0.5rem 0;
  color: var(--rouille);
}

/* ── Accessibilité & navigation ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.65rem 1rem;
  background: var(--fond-nav);
  color: var(--or-chaud);
  font-family: var(--font-corps);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--or-brule);
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--or-brule);
  outline-offset: 2px;
}

.codex-sheet {
  font-size: 1.125rem;
  line-height: 1.72;
}

.codex-sheet p,
.codex-sheet li,
.codex-sheet td {
  line-height: 1.65;
}

.codex-lead {
  font-size: 1.05rem;
  color: var(--texte-secondaire);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--parchemin-sombre);
}

.codex-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-family: var(--font-titre);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.codex-breadcrumb li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
  color: var(--gris-cendre);
  opacity: 0.7;
}

.codex-breadcrumb a {
  color: var(--rouille);
  text-decoration: none;
}

.codex-breadcrumb a:hover {
  text-decoration: underline;
}

.chapter-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.chapter-pager a {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--parchemin-sombre);
  background: var(--fond-panel);
  text-decoration: none;
  color: var(--texte-sur-sombre);
  border-top: 2px solid var(--or-brule);
  border-radius: 4px;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}

.chapter-pager a:hover {
  border-color: var(--or-brule);
  border-top-color: var(--or-chaud);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.chapter-pager a:hover .chapter-pager-title {
  color: var(--or-chaud);
}

.chapter-pager-next {
  text-align: right;
  grid-column: 2;
}

.chapter-pager-label {
  display: block;
  font-family: var(--font-titre);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(242, 235, 217, 0.5);
}

.chapter-pager-title {
  display: block;
  font-family: var(--font-titre);
  font-size: 0.9rem;
  color: var(--or-chaud);
  margin-top: 0.15rem;
  transition: color 0.12s;
}

.chapter-pager-spacer {
  display: block;
}

.chapter-pager-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.codex-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 15.5rem) minmax(0, 1fr);
  gap: 1.5rem 2.25rem;
  align-items: start;
}

.codex-layout .codex-sheet {
  max-width: none;
  width: 100%;
}

.codex-layout .codex-quick-nav {
  display: none;
}

.page-toc {
  position: sticky;
  top: calc(var(--masthead-h) + var(--chapitre-h) + 0.75rem);
  max-height: calc(100vh - var(--masthead-h) - var(--chapitre-h) - 2rem);
  overflow-y: auto;
  scrollbar-width: thin;
}

.page-toc-panel {
  background: var(--parchemin);
  border: 1px solid var(--parchemin-sombre);
  border-left: 3px solid var(--or-brule);
  padding: 0.65rem 0.85rem 0.85rem;
  box-shadow: 0 4px 16px rgba(28, 20, 16, 0.08);
  border-radius: 4px;
}

.page-toc-toggle {
  font-family: var(--font-corps);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rouille);
  cursor: pointer;
  list-style: none;
  padding: 0.35rem 0;
}

.page-toc-toggle::-webkit-details-marker {
  display: none;
}

.page-toc-toggle::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s;
}

.page-toc-panel[open] .page-toc-toggle::before {
  transform: rotate(90deg);
}

.page-toc-nav {
  margin-top: 0.5rem;
}

.page-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc-list a {
  display: block;
  padding: 0.32rem 0.5rem;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--texte-secondaire);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 2px;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.page-toc-list a:hover,
.page-toc-list a.is-active,
.page-toc-list a[aria-current="location"] {
  color: var(--rouille);
  border-left-color: var(--or-brule);
  background: rgba(200, 135, 58, 0.12);
  font-weight: 600;
}

.page-toc-level-2 a {
  font-weight: 600;
  color: var(--texte-principal);
}

.page-toc-level-3 { padding-left: 0.35rem; }
.page-toc-level-4 { padding-left: 0.75rem; font-size: 0.82rem; }
.page-toc-level-5 { padding-left: 1.1rem; font-size: 0.8rem; }

.page-toc-group-label {
  font-family: var(--font-corps);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--or-brule);
  margin: 0.65rem 0 0.35rem;
  padding-left: 0.5rem;
}

.page-toc-group-label:first-child {
  margin-top: 0.15rem;
}

.codex-quick-nav {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  background: rgba(200, 135, 58, 0.07);
  border: 1px solid var(--parchemin-sombre);
}

.codex-quick-nav-label {
  font-family: var(--font-titre);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gris-cendre);
  margin-bottom: 0.45rem;
}

.codex-quick-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.codex-quick-nav a {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.88rem;
  text-decoration: none;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin-clair);
  border-radius: 2px;
}

.codex-quick-nav a:hover {
  border-color: var(--or-brule);
  color: var(--rouille);
}

.codex-quick-nav-classes ul {
  gap: 0.3rem 0.45rem;
}

.codex-collapse {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--parchemin-sombre);
  background: rgba(250, 245, 236, 0.6);
}

.codex-collapse-summary {
  font-family: var(--font-titre);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--rouille);
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  list-style: none;
}

.codex-collapse-summary::-webkit-details-marker {
  display: none;
}

.codex-collapse-summary::before {
  content: '▸ ';
  color: var(--or-brule);
  margin-right: 0.25rem;
}

.codex-collapse[open] > .codex-collapse-summary::before {
  content: '▾ ';
}

.codex-collapse-body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--parchemin-sombre);
}

.codex-expand-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--parchemin-sombre);
  color: var(--rouille);
  font-family: var(--font-titre);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--or-brule);
  color: var(--or-brule);
}

.hub-collapse {
  margin-bottom: 0.75rem;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin-clair);
}

.hub-collapse-summary {
  font-family: var(--font-titre);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rouille);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  list-style: none;
}

.hub-collapse-summary::-webkit-details-marker {
  display: none;
}

.hub-collapse-summary::before {
  content: '▸ ';
  color: var(--or-brule);
}

.hub-collapse[open] > .hub-collapse-summary::before {
  content: '▾ ';
}

.hub-collapse-body {
  padding: 0 0.5rem 0.5rem;
}

@media (max-width: 960px) {
  .codex-layout {
    grid-template-columns: 1fr;
  }

  .page-toc {
    position: static;
    max-height: none;
  }

  .page-toc-panel {
    margin-bottom: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .page-toc-toggle::before,
  .codex-collapse-summary::before {
    transition: none;
  }
}

@media (max-width: 520px) {
  .section-header {
    grid-template-columns: 2.5rem 1fr;
  }

  .section-number { font-size: 1.5rem; }

  .toc-entry {
    grid-template-columns: auto 1fr;
  }

  .toc-badge { grid-column: 2; justify-self: start; margin-top: 0.2rem; }
}

/* ——— Hub : cartes outils (insp. compendium digital) ——— */
.hub-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0 0.25rem;
}

.hub-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  background: var(--parchemin);
  border: 1px solid var(--parchemin-sombre);
  border-left: 3px solid var(--or-brule);
  border-radius: 4px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.hub-tool-card:hover {
  border-color: var(--or-chaud);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.hub-tool-card:hover .hub-tool-title {
  color: var(--or-chaud);
}

.hub-tool-icon {
  font-family: var(--font-deco);
  font-size: 1.1rem;
  color: var(--or-brule);
  opacity: 0.9;
}

.hub-tool-title {
  font-family: var(--font-titre);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--parchemin);
  transition: color 0.12s;
}

.hub-tool-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(242, 235, 217, 0.55);
  margin: 0;
}

/* ——— Roster personnages ——— */
.roster-actions {
  margin-bottom: 1.25rem;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.roster-card-wrap {
  display: flex;
  flex-direction: column;
  background: var(--parchemin-clair);
  border: 1px solid var(--parchemin-sombre);
  transition: box-shadow 0.12s;
}

.roster-card-wrap:hover {
  box-shadow: 0 6px 20px rgba(28, 20, 16, 0.08);
}

.roster-card-wrap .roster-card {
  border: none;
  border-left: 4px solid var(--or-brule);
  flex: 1;
}

.roster-card-wrap:hover .roster-card {
  border-left-color: var(--rouille);
}

.roster-card-wrap .roster-card-links {
  padding: 0 1.1rem 0.75rem;
  margin-top: 0;
  border-top: none;
}

.roster-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  background: var(--parchemin);
  border: 1px solid var(--parchemin-sombre);
  border-left: 4px solid var(--or-brule);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.roster-card:hover {
  border-left-color: var(--rouille);
  background: var(--parchemin-clair);
  box-shadow: 0 6px 20px rgba(28, 20, 16, 0.08);
}

.roster-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.roster-card-name {
  font-family: var(--font-titre);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--rouille);
  margin: 0;
}

.roster-card-meta {
  font-size: 0.88rem;
  color: var(--texte-secondaire);
  margin: 0;
  line-height: 1.45;
}

.roster-card-eclats {
  font-family: var(--font-titre);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--or-brule);
}

.roster-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px dotted var(--parchemin-sombre);
  font-size: 0.82rem;
}

.roster-card-links a {
  font-family: var(--font-titre);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.roster-empty {
  text-align: center;
  padding: 2rem 1.5rem;
}

/* ——— Assistant création PJ (insp. Character Builder) ——— */
.pj-builder-wizard {
  margin: 1.25rem 0 2rem;
  padding: 0;
  border: none;
  background: transparent;
}

.builder-header {
  margin-bottom: 1.25rem;
}

.builder-intro {
  margin: 0 0 0.85rem;
  color: var(--texte-secondaire);
  font-size: 1rem;
  line-height: 1.55;
}

.builder-progress {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.builder-progress-label {
  font-family: var(--font-titre);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gris-cendre);
}

.builder-progress-track {
  height: 4px;
  background: var(--parchemin-sombre);
  border-radius: 2px;
  overflow: hidden;
}

.builder-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rouille), var(--or-brule));
  border-radius: 2px;
  transition: width 0.25s ease;
}

.builder-shell {
  display: grid;
  grid-template-columns: minmax(10.5rem, 13rem) minmax(0, 1fr);
  gap: 1.25rem 1.75rem;
  align-items: start;
}

.builder-step-rail {
  position: sticky;
  top: calc(var(--masthead-h) + var(--chapitre-h) + 0.75rem);
  background: var(--parchemin);
  border: 1px solid var(--parchemin-sombre);
  border-left: 3px solid var(--or-brule);
  padding: 0.85rem 0.65rem;
  box-shadow: 0 4px 16px rgba(28, 20, 16, 0.08);
  border-radius: 4px;
}

.builder-main {
  padding: 1.35rem 1.5rem;
  background: var(--parchemin-clair);
  border: 1px solid var(--parchemin-sombre);
  position: relative;
  min-height: 16rem;
}

.builder-main::before,
.builder-main::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border-color: var(--or-brule);
  border-style: solid;
  opacity: 0.4;
  pointer-events: none;
}

.builder-main::before {
  top: 0.4rem;
  left: 0.4rem;
  border-width: 2px 0 0 2px;
}

.builder-main::after {
  bottom: 0.4rem;
  right: 0.4rem;
  border-width: 0 2px 2px 0;
}

.builder-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
}

.builder-save-status {
  font-size: 0.85rem;
  color: var(--or-brule);
}

/* ——— Chapitre combat (jets opposés) ——— */
.combat-resume {
  margin-bottom: 1.25rem;
}

.combat-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px dashed var(--parchemin-sombre);
  background: rgba(26, 31, 60, 0.04);
}

.combat-flow-step {
  text-align: center;
  padding: 0.5rem 1rem;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin-clair);
  min-width: 12rem;
}

.combat-flow-step strong {
  display: block;
  font-family: var(--font-titre);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rouille);
}

.combat-flow-step span {
  font-size: 0.9rem;
  color: var(--encre-fade);
}

.combat-flow-arrow {
  font-size: 1.25rem;
  color: var(--or-brule);
  line-height: 1;
}

.combat-flow-branch {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-style: dashed;
}

.combat-flow-win {
  color: var(--rouille);
  font-size: 0.88rem;
}

.combat-flow-lose {
  color: var(--encre-fade);
  font-size: 0.88rem;
}

.combat-recap-table {
  width: 100%;
  margin: 0.75rem 0 1rem;
}

.formule-inline {
  font-family: var(--font-titre);
  font-size: 0.95rem;
  color: var(--rouille-sombre);
  margin: 0.5rem 0;
}

.combat-tags {
  font-size: 0.88rem;
  color: var(--encre-fade);
  line-height: 1.6;
  margin: 0.35rem 0 0.75rem;
}

.monster-stat-table {
  width: 100%;
  margin: 0.75rem 0 1rem;
  font-size: 0.92rem;
}

.monster-stat-table th {
  text-align: left;
  width: 7rem;
  color: var(--rouille-sombre);
  font-weight: 600;
}

.sheet-combat-block {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(139, 58, 26, 0.2);
  border-radius: 4px;
  background: rgba(242, 235, 217, 0.5);
}

.sheet-combat-equip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0.5rem 0;
}

.sheet-combat-states-title {
  font-family: var(--font-titre);
  font-size: 0.85rem;
  margin: 0.75rem 0 0.35rem;
  color: var(--rouille-sombre);
}

.sheet-combat-states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.sheet-state-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(28, 20, 16, 0.15);
  border-radius: 3px;
  cursor: pointer;
}

.sheet-state-chip input:checked + span {
  color: var(--rouille-sombre);
  font-weight: 600;
}

.sheet-inventory-list {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
}

.builder-equip-weapons,
.builder-equip-packs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.builder-equip-card {
  min-width: 10rem;
  text-align: left;
}

.builder-step-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.builder-step-nav li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.35rem;
  font-family: var(--font-corps);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--texte-secondaire);
  border-left: 2px solid transparent;
  position: relative;
}

.builder-step-nav li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0.95rem;
  top: 100%;
  width: 1px;
  height: 0.35rem;
  background: rgba(200, 135, 58, 0.25);
}

.builder-step-nav li.is-active {
  color: var(--rouille);
  border-left-color: var(--or-brule);
  background: rgba(200, 135, 58, 0.12);
  font-weight: 600;
}

.builder-step-nav li.is-done {
  color: var(--gris-cendre);
}

.builder-step-nav li.is-done .builder-step-num {
  background: rgba(200, 135, 58, 0.15);
  border-color: var(--or-brule);
}

.builder-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.62rem;
}

.builder-step-panel {
  min-height: 10rem;
  margin-bottom: 1rem;
}

.builder-step-panel .sous-titre {
  margin-top: 0;
}

.builder-hint,
.builder-points {
  font-size: 0.9rem;
  color: var(--encre-fade);
}

.builder-points.is-error {
  color: #8B3A1A;
}

.builder-validation {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(139, 58, 26, 0.08);
  border-left: 3px solid #8B3A1A;
  color: #8B3A1A;
  font-size: 0.9rem;
}

.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.builder-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.builder-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.65rem;
}

.builder-card {
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  position: relative;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.builder-card strong {
  font-family: var(--font-titre);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--rouille);
  display: block;
}

.builder-card:hover {
  border-color: var(--or-brule);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(28, 20, 16, 0.08);
}

.builder-card.is-selected {
  border-color: var(--rouille);
  border-left-width: 4px;
  background: rgba(200, 135, 58, 0.1);
  box-shadow: 0 4px 14px rgba(139, 58, 26, 0.12);
}

.builder-card.is-selected::after {
  content: '✓';
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  font-family: var(--font-titre);
  font-size: 0.7rem;
  color: var(--or-brule);
}

.builder-card-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--encre-fade);
}

.builder-carac-grid {
  display: grid;
  gap: 0.5rem;
  max-width: 28rem;
}

.builder-carac-row {
  display: grid;
  grid-template-columns: 3.5rem 2rem 2.5rem 3rem 2rem 2.5rem;
  align-items: center;
  gap: 0.35rem;
}

.builder-carac-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.builder-carac-bonus {
  font-size: 0.8rem;
  color: var(--or-brule);
}

.btn-carac {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.btn-carac:hover {
  border-color: var(--or-brule);
}

.builder-choix-group {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid var(--parchemin-sombre);
}

.builder-choix-label {
  display: block;
  margin: 0.25rem 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.builder-skill-carac {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: var(--encre-fade);
  letter-spacing: 0.05em;
}

.builder-skill-pick {
  columns: 2;
  column-gap: 1.5rem;
}

.builder-skill-pick h4 {
  column-span: all;
  margin: 0.75rem 0 0.35rem;
}

.builder-recap-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: 0.92rem;
}

.builder-recap-table th {
  text-align: left;
  padding: 0.35rem 0.75rem 0.35rem 0;
  color: var(--rouille);
  font-weight: 600;
  vertical-align: top;
  white-space: nowrap;
}

.builder-recap-table td {
  padding: 0.35rem 0;
}

.builder-recap-caracs {
  font-size: 0.9rem;
  line-height: 1.5;
}

.builder-sheet-toolbar {
  margin: 0 0 1rem;
}

.sheet-field-notes textarea {
  width: 100%;
  min-height: 8rem;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem;
  border: 1px solid var(--parchemin-sombre);
  background: var(--parchemin);
  resize: vertical;
}

.sheet-resource-block[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .builder-shell {
    grid-template-columns: 1fr;
  }

  .builder-step-rail {
    position: static;
  }

  .builder-step-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .builder-step-nav li {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.35rem 0.5rem;
  }

  .builder-step-nav li.is-active {
    border-bottom-color: var(--or-brule);
    background: rgba(200, 135, 58, 0.12);
  }

  .builder-step-nav li:not(:last-child)::after {
    display: none;
  }

  .hub-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .builder-skill-pick {
    columns: 1;
  }

  .builder-carac-row {
    grid-template-columns: 3rem 2rem 2rem 2.5rem 2rem 2rem;
    font-size: 0.85rem;
  }
}

/* ── Prompts MJ & figures doc ── */
pre.prompt-block {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  background: var(--noir-charbon);
  color: var(--parchemin-clair);
  border: 1px solid rgba(126, 184, 201, 0.25);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  margin: 0.75rem 0 1.25rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

figure.doc-figure {
  margin: 1.5rem 0;
  text-align: center;
}

figure.doc-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--parchemin-sombre);
  box-shadow: var(--ombre-page);
}

figure.doc-figure figcaption {
  font-size: 0.88rem;
  color: var(--texte-secondaire);
  margin-top: 0.5rem;
  font-style: italic;
}

article.map-node {
  margin-bottom: 0.5rem;
}

.map-player-visible-list li {
  margin-bottom: 0.35rem;
}

/* ── MJ illustration (prompt + import) ── */
.mj-art-slot {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px dashed rgba(126, 184, 201, 0.45);
  border-radius: 4px;
  background: rgba(26, 31, 60, 0.06);
}

.mj-art-slot.mj-art-highlight {
  outline: 2px solid var(--or-brule);
  outline-offset: 4px;
}

.mj-art-slot-label {
  margin-bottom: 0.75rem;
}

.mj-art-preview {
  margin-bottom: 0.75rem;
  text-align: center;
}

.mj-art-img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--parchemin-sombre);
  box-shadow: var(--ombre-page);
}

.mj-art-slot--wide .mj-art-img {
  width: 100%;
  max-width: 20rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.mj-art-placeholder {
  padding: 2rem 1rem;
  text-align: center;
  font-style: italic;
  color: var(--texte-secondaire);
  background: rgba(224, 210, 184, 0.35);
  border-radius: 4px;
}

.mj-art-prompt-label {
  font-family: var(--font-titre);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rouille);
  margin: 0.5rem 0 0.25rem;
  display: block;
}

.mj-art-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.mj-art-file-label {
  cursor: pointer;
  display: inline-block;
}

.mj-art-hint {
  font-size: 0.82rem;
  color: var(--texte-secondaire);
  margin-top: 0.5rem;
  font-style: italic;
}

.mj-art-dock {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 500;
  max-width: 16rem;
}

.mj-art-dock-toggle {
  font-family: var(--font-titre);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.85rem;
  background: var(--fond-panel);
  color: var(--texte-sur-sombre);
  border: 1px solid var(--or-brule);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.mj-art-dock-panel {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--parchemin-clair);
  border: 1px solid var(--or-brule);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.mj-art-dock-lead {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--texte-secondaire);
}

.mj-art-dock-item {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.35rem;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-corps);
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--parchemin-sombre);
  border-radius: 3px;
  cursor: pointer;
}

.mj-art-dock-item:hover {
  background: rgba(200, 135, 58, 0.12);
  border-color: var(--or-brule);
}

/* ── Recherche codex ── */
.hub-masthead-inner {
  justify-content: space-between;
}

.hub-masthead-brand {
  text-align: center;
}

.search-trigger {
  font-family: var(--font-titre);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--parchemin);
  background: transparent;
  border: 1px solid rgba(200, 135, 58, 0.35);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.search-trigger:hover {
  border-color: var(--or-brule);
  color: var(--or-chaud);
}

.search-trigger::before {
  content: "⌕ ";
  opacity: 0.85;
}

body.search-open {
  overflow: hidden;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1rem 1rem;
  background: rgba(10, 8, 6, 0.78);
  backdrop-filter: blur(3px);
}

.search-overlay[hidden] {
  display: none !important;
}

.search-dialog {
  width: min(36rem, 100%);
  background: var(--parchemin-clair);
  border: 2px solid var(--or-brule);
  border-radius: 6px;
  box-shadow: var(--ombre-page);
  overflow: hidden;
}

.search-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-lecture-elev);
  border-bottom: 1px solid var(--parchemin-sombre);
}

.search-input {
  flex: 1;
  font-family: var(--font-corps);
  font-size: 1.05rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--parchemin-sombre);
  border-radius: 3px;
  background: var(--parchemin);
  color: var(--texte-principal);
}

.search-input:focus {
  outline: 2px solid var(--or-brule);
  outline-offset: 1px;
}

.search-close {
  font-size: 1.35rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--parchemin-sombre);
  background: transparent;
  color: var(--texte-principal);
  cursor: pointer;
  border-radius: 3px;
}

.search-close:hover {
  color: var(--or-chaud);
  border-color: var(--or-brule);
}

.search-results {
  max-height: min(52vh, 28rem);
  overflow-y: auto;
  padding: 0.35rem;
}

.search-result {
  display: block;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.25rem;
  text-decoration: none;
  color: var(--texte-principal);
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
}

.search-result:hover,
.search-result.is-active {
  border-color: var(--or-brule);
  background: rgba(200, 135, 58, 0.12);
}

.search-result-title {
  display: block;
  font-family: var(--font-titre);
  font-size: 0.95rem;
  color: var(--rouille);
}

.search-result-meta {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-secondaire);
  margin-top: 0.15rem;
}

.search-result-excerpt {
  display: block;
  font-size: 0.92rem;
  color: var(--texte-secondaire);
  margin-top: 0.25rem;
  line-height: 1.35;
}

.search-result-excerpt mark {
  background: rgba(200, 135, 58, 0.35);
  color: inherit;
  padding: 0 0.1em;
}

.search-empty {
  padding: 1.25rem 0.85rem;
  font-style: italic;
  color: var(--texte-secondaire);
  text-align: center;
}

.search-hint {
  margin: 0;
  padding: 0.45rem 0.75rem 0.65rem;
  font-size: 0.78rem;
  color: var(--texte-secondaire);
  border-top: 1px solid var(--parchemin-sombre);
  background: var(--parchemin);
}

.search-hint kbd {
  font-family: var(--font-titre);
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--parchemin-sombre);
  border-radius: 3px;
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Fiches classe / peuple (style Aidedd) ── */
.entity-layout .entity-sheet {
  max-width: none;
}

.entity-sidebar {
  position: sticky;
  top: calc(var(--masthead-h) + var(--chapitre-h) + 0.75rem);
  max-height: calc(100vh - var(--masthead-h) - var(--chapitre-h) - 2rem);
  overflow-y: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.entity-chapter-nav {
  background: var(--parchemin);
  border: 1px solid var(--parchemin-sombre);
  border-left: 3px solid var(--or-brule);
  padding: 0.65rem 0.85rem 0.85rem;
  box-shadow: 0 4px 16px rgba(28, 20, 16, 0.08);
  border-radius: 4px;
}

.entity-chapter-nav-title {
  font-family: var(--font-corps);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rouille);
  margin: 0 0 0.5rem;
}

.entity-chapter-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.entity-chapter-nav-list a {
  display: block;
  padding: 0.3rem 0.45rem;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--texte-secondaire);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 2px;
}

.entity-chapter-nav-list a:hover,
.entity-chapter-nav-list a.is-active,
.entity-chapter-nav-list a[aria-current="page"] {
  color: var(--rouille);
  background: rgba(200, 135, 58, 0.12);
  border-left-color: var(--or-brule);
  font-weight: 600;
}

.entity-sidebar .page-toc[hidden] {
  display: none;
}

.entity-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--parchemin-sombre);
}

.entity-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.entity-hero-visual .mj-art-slot {
  margin: 0;
}

.entity-personnage-list li {
  margin-bottom: 0.35rem;
}

.entity-hero-media {
  margin: 0;
  border: 2px solid var(--or-brule);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--ombre-page);
  background: var(--noir-charbon);
}

.entity-hero-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.entity-title {
  font-family: var(--font-deco);
  font-size: 2rem;
  color: var(--rouille);
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.entity-tagline {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--texte-secondaire);
  margin-bottom: 0.75rem;
}

.entity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.entity-meta-pill {
  font-size: 0.88rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--parchemin-sombre);
  border-radius: 3px;
  background: var(--parchemin-clair);
}

.entity-flavor {
  font-size: 1.08rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.entity-stat-block {
  margin: 1.25rem 0 1.75rem;
}

.entity-stat-table th {
  text-align: left;
  width: 38%;
  font-weight: 600;
  padding: 0.35rem 0.75rem 0.35rem 0;
}

.entity-section-title {
  margin-top: 2rem;
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--parchemin-sombre);
}

.entity-subclass {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--parchemin-sombre);
}

.entity-subclass:last-of-type {
  border-bottom: none;
}

.entity-subclass-header {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1rem;
}

.entity-subclass-visual {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.entity-subclass-visual .mj-art-slot {
  margin: 0;
}

.entity-subclass-visual .entity-subclass-display-img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.entity-subclass-header .entity-hero-media {
  border-width: 1px;
}

.entity-subclass-title {
  margin-top: 0;
}

.entity-card-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
  padding: 0;
}

.entity-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 2px solid var(--parchemin-sombre);
  border-radius: 4px;
  overflow: hidden;
  background: var(--parchemin-clair);
  transition: border-color 0.15s, box-shadow 0.15s;
  height: 100%;
}

.entity-card:hover {
  border-color: var(--or-brule);
  box-shadow: 0 6px 20px rgba(28, 20, 16, 0.2);
  color: inherit;
}

.entity-card-media {
  display: block;
  background: var(--noir-charbon);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.entity-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-card-body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.entity-card-title {
  font-family: var(--font-titre);
  font-size: 1.1rem;
  color: var(--rouille);
}

.entity-card-tagline {
  font-size: 0.95rem;
  color: var(--texte-secondaire);
  line-height: 1.35;
}

.entity-card-meta {
  font-size: 0.82rem;
  color: var(--texte-secondaire);
}

.entity-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.entity-hub-card {
  display: block;
  padding: 1.25rem 1.35rem;
  border: 2px solid var(--or-brule);
  border-radius: 4px;
  background: linear-gradient(145deg, var(--parchemin-clair), var(--parchemin));
  text-decoration: none;
  color: inherit;
}

.entity-hub-card:hover {
  background: #fff;
  color: inherit;
}

.entity-hub-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texte-secondaire);
}

.entity-hub-card-title {
  display: block;
  font-family: var(--font-titre);
  font-size: 1.25rem;
  margin: 0.35rem 0;
  color: var(--rouille);
}

.entity-hub-card-meta {
  font-size: 0.9rem;
  color: var(--texte-secondaire);
}

.entity-index-footer {
  margin-top: 1.5rem;
  font-style: italic;
}

.entity-related {
  margin-top: 2rem;
}

@media (max-width: 720px) {
  .entity-hero,
  .entity-subclass-header {
    grid-template-columns: 1fr;
  }
}

/* ─── Arbres d'efforts (fiche PJ) ─── */
.sheet-effort-trees {
  margin: 1.25rem 0 2rem;
  padding: 1rem 1.15rem;
  background: rgba(139, 58, 26, 0.04);
  border: 1px solid rgba(139, 58, 26, 0.18);
  border-radius: 4px;
}

.effort-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 1rem;
}

.effort-tab {
  font-family: var(--font-titre);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(139, 58, 26, 0.25);
  background: var(--parchemin, #f5f0e6);
  color: var(--encre, #2c1810);
  cursor: pointer;
  border-radius: 2px;
}

.effort-tab.is-active {
  background: var(--rouille, #8b3a1a);
  color: #fff;
  border-color: var(--rouille, #8b3a1a);
}

.effort-tab-panel {
  min-height: 8rem;
}

.effort-tree-nodes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.effort-tree-nodes--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.5rem;
}

.effort-node {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(44, 24, 16, 0.2);
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.effort-node:disabled {
  cursor: default;
  opacity: 0.85;
}

.effort-node.is-owned {
  border-color: var(--or-brule, #c8873a);
  background: rgba(200, 135, 58, 0.08);
}

.effort-node.is-available:hover:not(:disabled) {
  border-color: var(--rouille, #8b3a1a);
  box-shadow: 0 2px 8px rgba(139, 58, 26, 0.15);
}

.effort-node.is-locked {
  opacity: 0.55;
  background: rgba(44, 24, 16, 0.03);
}

.effort-node-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--rouille-sombre, #5c2412);
}

.effort-node-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--encre-fade, #6b5344);
  margin: 0.15rem 0;
}

.effort-node-effect {
  display: block;
  font-size: 0.8rem;
  color: var(--texte-secondaire, #4a3728);
  line-height: 1.35;
}

.effort-live-summary {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  border-left: 3px solid var(--or-brule, #c8873a);
}

.effort-summary-text {
  margin: 0.35rem 0 0;
  font-family: var(--font-corps, 'EB Garamond', serif);
  font-size: 0.88rem;
  white-space: pre-wrap;
  line-height: 1.45;
}

.effort-maneuver-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgba(139, 58, 26, 0.2);
}

.effort-maneuver-name {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.effort-free-hint {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--rouille, #8b3a1a);
}

.sheet-effort-abilities {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(139, 58, 26, 0.15);
}

/* Catalogue classes / peuples → static/kerath/entity-catalog.css */

.entity-related-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.entity-related-link {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(200, 135, 58, 0.35);
  border-radius: 3px;
  font-size: 0.85rem;
  text-decoration: none;
}

.entity-related-badge {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cicatrice);
  margin-left: 0.25rem;
}

.builder-card-stats {
  font-size: 0.8rem;
  color: var(--texte-secondaire);
}
