:root {
  --bg: #0a0708;
  --bg-2: #110c0e;
  --surface: #161013;
  --surface-2: #1d1519;
  --line: #2c2025;
  --line-2: #3a2a31;
  --text: #ebe2d9;
  --muted: #9a8a85;
  --faint: #6b5c59;
  --blood: #a3192b;
  --blood-2: #c9283d;
  --blood-glow: rgba(201, 40, 61, .18);
  --bone: #d9c9a8;
  --ok: #6f9c74;
  --warn: #c99a3c;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--sans);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(163, 25, 43, .12), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--blood-2); text-decoration: none; }
a:hover { color: #e4485b; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; line-height: 1.15; margin: 0 0 .5em; }
::selection { background: var(--blood); color: #fff; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45em; justify-content: center;
  font: 500 14px var(--sans); padding: .6em 1.1em; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--muted); color: #fff; }
.btn.primary { background: var(--blood); border-color: var(--blood); color: #fff; }
.btn.primary:hover { background: var(--blood-2); border-color: var(--blood-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: #e8798a; border-color: #5a2630; background: transparent; }
.btn.danger:hover { background: #3a1219; }
.btn.sm { padding: .35em .75em; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: .6em .8em; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blood-2); box-shadow: 0 0 0 3px var(--blood-glow); }
label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .35em; font-weight: 600; }
.field { margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: .5em; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); font-weight: 400; }
.check input { width: auto; }
.err { color: #f08a98; font-size: 14px; min-height: 1.2em; }

/* ---------- Badges ---------- */
.tag {
  display: inline-block; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em;
  padding: .42em .6em; border-radius: 3px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.tag.red { color: #f0909c; border-color: #5c2530; background: rgba(163, 25, 43, .12); }
.tag.bone { color: var(--bone); border-color: #4a4032; }
.tag.ok { color: #9cc7a0; border-color: #2f4a33; }
.tag.warn { color: #e0b862; border-color: #54431f; }
.tag.sealed { color: #fff; background: var(--blood); border-color: var(--blood); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blood-2); box-shadow: 0 0 8px var(--blood-2); }
.pill { background: var(--blood); color: #fff; font: 600 11px/1 var(--sans); padding: 3px 6px; border-radius: 10px; margin-left: 4px; }

/* ================= PAGE PUBLIQUE ================= */
.pub-hero {
  min-height: 92vh; display: grid; place-items: center; text-align: center; padding: 4rem 16px;
  position: relative; overflow: hidden;
}
.pub-hero::after {
  content: ''; position: absolute; inset: auto 0 0; height: 40%;
  background: linear-gradient(transparent, var(--bg)); pointer-events: none;
}
.sigil { width: 84px; height: 84px; color: var(--blood); filter: drop-shadow(0 0 24px rgba(201, 40, 61, .45)); margin-bottom: 1.6rem; }
.pub-hero h1 { font-size: clamp(44px, 9vw, 104px); font-weight: 600; margin: 0; letter-spacing: .02em; }
.pub-hero .devise { font: italic 500 clamp(19px, 2.6vw, 26px) var(--serif); color: var(--bone); margin-top: .8rem; }
.pub-hero .scroll { margin-top: 3.5rem; color: var(--faint); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; }
.pub-section { max-width: 760px; margin: 0 auto; padding: 4.5rem 16px; }
.pub-section h2 { font-size: clamp(30px, 4.5vw, 42px); text-align: center; }
.pub-section .ornement { display: block; text-align: center; color: var(--blood); letter-spacing: .6em; margin-bottom: 1rem; font-size: 13px; }
.pub-prose { font: 500 20px/1.75 var(--serif); color: #d8cec4; white-space: pre-line; }
.pub-prose.center { text-align: center; }
.pub-footer { text-align: center; padding: 4rem 16px 3rem; color: var(--faint); font-size: 13px; }
.pub-footer .porte { display: inline-block; margin-top: 1.4rem; color: var(--faint); opacity: .55; transition: opacity .2s, color .2s; }
.pub-footer .porte:hover { opacity: 1; color: var(--blood-2); }
.pub-footer .porte svg { width: 18px; height: 18px; }

/* Logo */
.logo-titre { margin: 0; line-height: 0; }
.logo-titre img {
  width: min(600px, 92vw); height: auto;
  -webkit-mask-image: radial-gradient(circle at center, #000 58%, transparent 71%);
  mask-image: radial-gradient(circle at center, #000 58%, transparent 71%);
  filter: drop-shadow(0 0 40px rgba(201, 40, 61, .25));
}
.pub-hero .devise { margin-top: .2rem; }
.logo-login { margin: -.6rem 0 .2rem; line-height: 0; }
.logo-login img {
  width: 210px; height: auto;
  -webkit-mask-image: radial-gradient(circle at center, #000 56%, transparent 71%);
  mask-image: radial-gradient(circle at center, #000 56%, transparent 71%);
}
.brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }

/* À la tête du clan */
.tetes-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(163, 25, 43, .07), transparent); }
.tetes { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 2rem; }
.tetes { align-items: flex-end; gap: 2.5rem; }
.tete-card { flex: 0 1 300px; margin: 0; text-align: center; padding: 1.8rem 1.4rem; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; position: relative; }
.tete-card::before { content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--blood); box-shadow: 0 0 12px var(--blood-2); }
.tete-titre { font: 500 12px var(--mono); letter-spacing: .25em; text-transform: uppercase; color: var(--blood-2); }
.tete-nom { font: 600 38px/1.15 var(--serif); color: var(--bone); margin-top: .4rem; }
/* Carte avec portrait : arche gothique, liseré os + halo sang */
.tete-card.avec-portrait { background: none; border: 0; padding: 0; flex-basis: 340px; }
.tete-card.avec-portrait::before { display: none; }
.arche {
  position: relative; aspect-ratio: 282 / 289; width: 100%;
  border-radius: 50% 50% 6px 6px / 34% 34% 6px 6px; overflow: hidden;
  padding: 6px; background: linear-gradient(160deg, #8a7a5c, #3a2a20 40%, #6e0f1c 75%, #2a1a14);
  box-shadow: 0 0 0 1px #1a0f0f, 0 0 60px rgba(201, 40, 61, .28), 0 30px 60px rgba(0, 0, 0, .7);
}
.arche img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  border-radius: 50% 50% 3px 3px / 34% 34% 3px 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6);
}
.arche::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50% 50% 3px 3px / 34% 34% 3px 3px; pointer-events: none;
  background: radial-gradient(ellipse at 50% 35%, transparent 55%, rgba(10, 7, 8, .55) 100%), linear-gradient(transparent 70%, rgba(10, 7, 8, .65));
}
.avec-portrait figcaption { position: relative; margin-top: -1.6rem; }
.avec-portrait .tete-titre { display: inline-block; background: var(--bg); padding: .45em 1.1em; border: 1px solid #5c2530; border-radius: 3px; }
.avec-portrait .tete-nom { font-size: 46px; margin-top: .5rem; text-shadow: 0 0 24px rgba(201, 40, 61, .35); }
.tete-card.principal.avec-portrait { flex-basis: 380px; }
.tete-card.avec-portrait { max-width: min(380px, 86vw); }

/* Histoire en deux volets */
.pub-section.histoire { max-width: 1080px; }
.histoire-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 2.5rem; }
.histoire-grid > div + div { border-left: 1px solid var(--line); padding-left: 3rem; }
.volet { font: 500 12px var(--mono); letter-spacing: .25em; text-transform: uppercase; color: var(--blood-2); margin-bottom: 1.2rem; }
.seigneurs { list-style: none; margin: 0; padding: 0; }
.seigneurs li { display: grid; grid-template-columns: 56px 1fr; gap: 1rem; padding-bottom: 1.8rem; }
.sg-num { font: 600 30px/1 var(--serif); color: var(--blood); text-align: center; padding-top: .15rem; border-right: 1px solid var(--line-2); padding-right: .8rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.sg-medaillon { width: 64px; height: 80px; object-fit: cover; border-radius: 32px 32px 4px 4px; border: 2px solid #5c2530; box-shadow: 0 0 18px rgba(201, 40, 61, .25); }
.seigneurs li:has(.sg-medaillon) { grid-template-columns: 96px 1fr; }
.seigneurs h4 { font: 600 28px/1.1 var(--serif); margin: 0; color: var(--bone); }
.sg-epoque { font: italic 500 16px var(--serif); color: var(--muted); }
.seigneurs p { font: 500 18px/1.7 var(--serif); color: #d8cec4; margin: .5rem 0 0; white-space: pre-line; }

/* Connexion */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 2.2rem 1.8rem; text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(163, 25, 43, .08);
}
.login .sigil { width: 46px; height: 46px; margin-bottom: 1rem; }
.login h1 { font-size: 30px; }
.login form { text-align: left; margin-top: 1.4rem; }
.login .btn { width: 100%; margin-top: .5rem; }

/* ================= ESPACE MEMBRES ================= */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(10, 7, 8, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 1.5rem; height: 60px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font: 600 21px var(--serif); white-space: nowrap; }
.brand svg { width: 22px; height: 22px; color: var(--blood); }
.nav { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); padding: .45em .8em; border-radius: var(--r); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.on { color: #fff; background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--blood); }
.nav .sep { width: 1px; background: var(--line-2); margin: 6px .4rem; flex: none; }
.who { display: flex; align-items: center; gap: .7rem; font-size: 13px; white-space: nowrap; }
.who .rang { color: var(--bone); font-family: var(--serif); font-size: 15px; font-style: italic; }
.who a { color: var(--muted); }
.main { max-width: 1280px; margin: 0 auto; padding: 2rem 16px 5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.page-head h1 { font-size: 40px; margin: 0; }
.page-head .sub { color: var(--muted); margin: .2rem 0 0; }
.kicker { font: 500 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--blood-2); margin-bottom: .4rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem; }
.card h2 { font-size: 24px; }
.card + .card { margin-top: 1rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 10px; }
.empty h3 { font-size: 24px; color: var(--text); }

/* Statistiques */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 1.6rem; }
.stat { background: var(--surface); padding: 1.1rem 1.3rem; }
.stat b { display: block; font: 600 34px/1 var(--serif); color: var(--text); }
.stat span { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat.hot b { color: var(--blood-2); }

/* Base de données */
.db-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.6rem; align-items: start; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.toolbar .search { flex: 1 1 260px; position: relative; }
.toolbar .search input { padding-left: 2.3em; font-size: 15px; }
.toolbar .search svg { position: absolute; left: .8em; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.toolbar select { width: auto; flex: 0 1 auto; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: .5em .7em; cursor: pointer; display: flex; }
.seg button.on { background: var(--surface-2); color: #fff; }
.seg svg { width: 16px; height: 16px; }
.count-line { font: 12px var(--mono); color: var(--faint); margin-bottom: .8rem; letter-spacing: .05em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.dossier {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; color: var(--text); transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative;
}
.dossier:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(163, 25, 43, .25); color: var(--text); }
.dossier .num { position: absolute; top: .7rem; left: .8rem; font: 500 10.5px var(--mono); letter-spacing: .12em; color: var(--bone); background: rgba(10, 7, 8, .7); padding: .25em .5em; border-radius: 3px; z-index: 1; }
.dossier .scelle { position: absolute; top: .7rem; right: .8rem; z-index: 1; }
.portrait {
  aspect-ratio: 4 / 3; background: linear-gradient(135deg, #1f1419, #120c0f); display: grid; place-items: center;
  font: 600 52px var(--serif); color: #3d2a31; position: relative; overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.35) contrast(1.05); }
.portrait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(22, 16, 19, .95)); }
.dossier .body { padding: .2rem 1rem 1rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; margin-top: -1.6rem; position: relative; }
.dossier h3 { font-size: 23px; margin: 0; }
.dossier .alias { font-size: 13px; color: var(--muted); font-style: italic; margin-top: -.3rem; }
.dossier .tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.dossier .foot { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font: 11.5px var(--mono); color: var(--faint); }
.dossier .foot b { color: var(--text); font-weight: 500; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--bg-2); cursor: pointer; user-select: none; }
table.data th.nosort { cursor: default; }
table.data td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { cursor: pointer; transition: background .1s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .nom { font: 600 18px var(--serif); }
table.data .mini { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: inline-grid; place-items: center; font: 600 15px var(--serif); color: var(--faint); vertical-align: middle; margin-right: .6rem; }

/* Panneau latéral */
.aside h3 { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 .8rem; }
.aside .card { padding: 1.1rem; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: .65rem 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed .qui { font: 600 16px var(--serif); }
.feed .quoi { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed .quand { font: 11px var(--mono); color: var(--faint); }
.podium { list-style: none; margin: 0; padding: 0; counter-reset: p; }
.podium li { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; counter-increment: p; }
.podium li::before { content: counter(p); font: 600 13px var(--mono); color: var(--blood-2); width: 1.2em; }
.podium .bar { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.podium .bar i { display: block; height: 100%; background: var(--blood); }
.podium b { font-weight: 500; min-width: 7em; }

/* ---------- Fiche (dossier) ---------- */
.fiche { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 1.8rem; align-items: start; }
.idcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: sticky; top: 80px; }
.idcard .portrait { aspect-ratio: 4 / 5; font-size: 90px; cursor: default; }
.idcard .portrait.edit { cursor: pointer; }
.idcard .portrait .chg { position: absolute; bottom: .7rem; right: .7rem; z-index: 2; font-size: 12px; font-family: var(--sans); color: var(--muted); background: rgba(10, 7, 8, .75); padding: .3em .6em; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.idcard .portrait:hover .chg { opacity: 1; }
.idcard .inner { padding: 1.2rem; }
.idcard dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; font-size: 14px; }
.idcard dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding-top: .2em; }
.idcard dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .3em; background: var(--surface-2); border: 1px solid var(--line-2); padding: .15em .55em; border-radius: 4px; font-size: 13px; }
.chip button { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }
.chip button:hover { color: var(--blood-2); }
.dossier-title { margin-bottom: 1.5rem; }
.dossier-title h1 { font-size: clamp(38px, 5vw, 56px); margin: 0; }
.dossier-title .alias { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 20px; }
.resume { font: 500 19px/1.65 var(--serif); color: #d8cec4; border-left: 2px solid var(--blood); padding: .2rem 0 .2rem 1.1rem; margin: 0 0 1.8rem; white-space: pre-line; }

.timeline { position: relative; }
.entry { position: relative; padding: 0 0 1.4rem 1.6rem; }
.entry::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 0; width: 1px; background: var(--line-2); }
.entry::after { content: ''; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--blood); }
.entry:last-child::before { display: none; }
.entry .meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font: 12px var(--mono); color: var(--faint); margin-bottom: .45rem; }
.entry .meta .auteur { color: var(--bone); }
.entry .txt { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1.1rem; font: 14px/1.7 var(--mono); white-space: pre-wrap; word-wrap: break-word; }
.entry .actions { display: flex; gap: .4rem; margin-top: .4rem; opacity: 0; transition: opacity .15s; }
.entry:hover .actions, .entry:focus-within .actions { opacity: 1; }
.entry .actions button { background: none; border: 0; color: var(--faint); font-size: 12px; cursor: pointer; padding: .2em .3em; }
.entry .actions button:hover { color: var(--text); }
.redacted { padding: .9rem 1.1rem; border: 1px dashed #4a2129; border-radius: 8px; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font: 12px var(--mono); color: #c46b78; }
.redacted .bars { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 140px; }
.redacted .bars i { display: block; height: 9px; background: #2a1419; border-radius: 1px; }
.quick { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1.8rem; }
.quick textarea { min-height: 80px; background: var(--bg-2); }
.quick .row { margin-top: .6rem; align-items: center; }
.quick .row select, .quick .row input { width: auto; flex: 1 1 130px; }
.section-t { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 2.2rem 0 1rem; display: flex; align-items: center; gap: .8rem; }
.section-t::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Dépôt ---------- */
.depot { max-width: 760px; margin: 0 auto; }
.depot .card { padding: 2rem; }
.big-name { font: 600 30px var(--serif) !important; padding: .4em .7em !important; }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; box-shadow: 0 20px 40px rgba(0, 0, 0, .5); }
.ac-list button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: .6em .9em; cursor: pointer; font: 600 18px var(--serif); }
.ac-list button small { font: 12px var(--sans); color: var(--muted); margin-left: .5em; }
.ac-list button:hover, .ac-list button.on { background: var(--blood-glow); }
.target { font: 13px var(--mono); margin: .5rem 0 0; min-height: 1.3em; }
.target.exist { color: #9cc7a0; }
.target.new { color: var(--bone); }
.choix { border: 1px solid #54431f; background: rgba(201, 154, 60, .06); border-radius: 8px; padding: 1rem 1.2rem; margin-top: 1rem; }
.choix p { margin: 0 0 .8rem; }
.choix .row { gap: .5rem; align-items: center; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.success { border: 1px solid #2f4a33; background: rgba(111, 156, 116, .07); border-radius: 8px; padding: 1rem 1.2rem; margin-top: 1rem; }

/* ---------- Requêtes ---------- */
.req-list { display: flex; flex-direction: column; gap: .6rem; }
.req {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1.2rem; color: var(--text);
}
.req:hover { border-color: var(--line-2); color: var(--text); background: var(--surface-2); }
.req .ico { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 18px; }
.req .ttl { font: 600 19px var(--serif); }
.req .sub { font-size: 12.5px; color: var(--muted); }
.req .right { text-align: right; display: flex; flex-direction: column; gap: .3rem; align-items: flex-end; }
.req.unread { border-color: #5c2530; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.types label {
  margin: 0; text-transform: none; letter-spacing: 0; font: 500 14px var(--sans); color: var(--text);
  border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 8px; padding: .8rem; cursor: pointer;
  display: flex; flex-direction: column; gap: .2rem; transition: border-color .15s, background .15s;
}
.types label small { color: var(--muted); font-size: 12px; font-weight: 400; }
.types input { display: none; }
.types label:has(input:checked) { border-color: var(--blood-2); background: rgba(163, 25, 43, .1); }
.types .i { font-size: 18px; }
.petition { max-width: 820px; margin: 0 auto; }
.petition .card { padding: 2rem; }
.parchemin {
  background: linear-gradient(180deg, #1a1215, #140e11); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 2rem; position: relative;
}
.parchemin .entete { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); padding-bottom: 1rem; margin-bottom: 1.2rem; font: 12px var(--mono); color: var(--muted); }
.parchemin h1 { font-size: 34px; }
.parchemin .corps { font: 500 19px/1.7 var(--serif); white-space: pre-wrap; color: #ddd2c8; }
.parchemin dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.2rem; margin: 1.2rem 0 0; padding: 1rem; background: var(--bg-2); border-radius: 8px; font-size: 14px; }
.parchemin dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding-top: .2em; }
.parchemin dd { margin: 0; }
.sceau { position: absolute; right: 1.5rem; bottom: -22px; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c9283d, #6e0f1c); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .6); color: rgba(255, 255, 255, .85); font: 700 22px var(--serif); }
.thread { margin-top: 2.5rem; display: flex; flex-direction: column; gap: .8rem; }
.msg { max-width: 85%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; }
.msg.conseil { align-self: flex-end; border-color: #5c2530; background: linear-gradient(180deg, rgba(163, 25, 43, .1), var(--surface)); }
.msg .m { font: 11.5px var(--mono); color: var(--faint); margin-bottom: .3rem; }
.msg .m b { color: var(--bone); font-weight: 500; }
.msg p { margin: 0; white-space: pre-wrap; }
.decision { border: 1px solid #5c2530; background: rgba(163, 25, 43, .06); border-radius: 10px; padding: 1.2rem; margin-top: 1.5rem; }
.statut-deposee { color: var(--bone); border-color: #4a4032; }
.statut-examen { color: #e0b862; border-color: #54431f; }
.statut-accordee { color: #9cc7a0; border-color: #2f4a33; }
.statut-refusee { color: #f0909c; border-color: #5c2530; }
.statut-close { color: var(--faint); }
.filtres { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtres button { background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); border-radius: 20px; padding: .3em .9em; font: 500 13px var(--sans); cursor: pointer; }
.filtres button.on { color: #fff; border-color: var(--blood); background: rgba(163, 25, 43, .15); }

/* Membres & réglages */
.rang-row { display: grid; grid-template-columns: 50px 1fr 2fr auto auto; gap: .6rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.rang-row .o { font: 600 18px var(--mono); color: var(--blood-2); text-align: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }

/* Toast & modale */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(30px); opacity: 0; background: var(--surface-2); border: 1px solid var(--line-2); padding: .7rem 1.1rem; border-radius: 8px; z-index: 100; transition: all .25s; font-size: 14px; pointer-events: none; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.bad { border-color: #5c2530; color: #f0909c; }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 1.5rem; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }
.modal h2 { font-size: 26px; }
.modal .row { justify-content: flex-end; margin-top: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .db-layout { grid-template-columns: 1fr; }
  .fiche { grid-template-columns: 1fr; }
  .idcard { position: static; display: grid; grid-template-columns: 160px 1fr; }
  .idcard .portrait { aspect-ratio: auto; min-height: 200px; font-size: 60px; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .topbar-in { gap: .8rem; }
  .brand span, .who .nm { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .dossier .portrait { aspect-ratio: 1; font-size: 36px; }
  .dossier h3 { font-size: 19px; }
  .dossier .tags .tag:nth-child(2) { display: none; }
  .page-head h1 { font-size: 32px; }
  .opts, .two, .histoire-grid { grid-template-columns: 1fr; }
  .histoire-grid { gap: 2.5rem; }
  .histoire-grid > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 2rem; }
  .idcard { grid-template-columns: 1fr; }
  .idcard .portrait { aspect-ratio: 4 / 3; }
  .depot .card, .petition .card, .parchemin { padding: 1.2rem; }
  .req { grid-template-columns: auto minmax(0, 1fr); }
  .req .right { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; align-items: center; }
  .rang-row { grid-template-columns: 36px 1fr; }
  .rang-row > :nth-child(n+3) { grid-column: 2; }
  .msg { max-width: 100%; }
  .entry .actions { opacity: 1; }
}
