/* ADV Academy — style « haute finance » : bandeaux marine, filets or, titres serif,
   chiffres en colonnes comme un relevé. Layout : colonne éditoriale + bandeaux pleine largeur. */
:root {
  --bg: #F7F5EF;
  --surface: #FFFFFF;
  --fg: #0D1B2E;
  --muted: #5B6473;
  --line: #E2DDD2;
  --navy: #0B1E36;
  --navy-2: #12294A;
  --on-navy: #F1ECE1;
  --on-navy-muted: #A9B3C2;
  --gold: #9C7631;
  --gold-bright: #C9A75A;
  --accent: var(--gold);
  --accent-soft: #F2EADA;
  --mark: #E9D8A6;
  --mark-fg: #0D1B2E;
  --up: #2E7D4F;
  --down: #B0413E;
  --warn: #A15C00;
  --font-display: "Playfair Display", "Didot", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 2px;
  --max: 1140px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08121F; --surface: #0F1C2E; --fg: #ECE7DC; --muted: #9AA4B2; --line: #1F2E44;
    --navy: #050D18; --navy-2: #0C1A2D; --on-navy: #ECE7DC; --on-navy-muted: #8E99A8;
    --gold: #C9A75A; --gold-bright: #D9BB72; --accent-soft: #231E12; --mark: #6B5624; --mark-fg: #F5EEDC;
    --up: #5BBF85; --down: #E07A73; --warn: #E3A048; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08121F; --surface: #0F1C2E; --fg: #ECE7DC; --muted: #9AA4B2; --line: #1F2E44;
  --navy: #050D18; --navy-2: #0C1A2D; --on-navy: #ECE7DC; --on-navy-muted: #8E99A8;
  --gold: #C9A75A; --gold-bright: #D9BB72; --accent-soft: #231E12; --mark: #6B5624; --mark-fg: #F5EEDC;
  --up: #5BBF85; --down: #E07A73; --warn: #E3A048; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 17.5px; line-height: 1.65;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--navy); }
a { color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold-bright); outline-offset: 3px;
}
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; text-wrap: balance; margin: 0; font-weight: 600; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.28rem; }
h1 em, h2 em { font-style: italic; color: var(--gold); font-weight: 500; }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
mark { background: var(--mark); color: var(--mark-fg); padding: 0 0.15em; }

.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.prose { max-width: 68ch; }

/* En-tête marine */
.site-header { background: var(--navy); color: var(--on-navy); border-bottom: 1px solid var(--gold); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--on-navy); }
.brand-mark {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; color: var(--gold-bright);
  border: 1px solid var(--gold-bright); padding: 4px 8px; letter-spacing: 0.12em;
}
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; letter-spacing: 0.04em; }
.nav { display: flex; gap: 2px; overflow-x: auto; max-width: 100%; }
.nav a {
  text-decoration: none; color: var(--on-navy-muted); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; padding: 8px 12px; white-space: nowrap;
}
.nav a:hover { color: var(--on-navy); }
.nav a[aria-current="page"] { color: var(--gold-bright); box-shadow: inset 0 -1px 0 var(--gold-bright); }

main { display: block; }
.section { padding-block: 72px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 28px; margin-bottom: 32px; padding-bottom: 18px; border-bottom: 1px solid var(--fg); }
.section-head > div { display: grid; gap: 10px; }
.section-head p { color: var(--muted); max-width: 60ch; }
.section-head a { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; }
.stack { display: grid; gap: 16px; }

/* Héros marine */
.hero { background: radial-gradient(120% 140% at 85% 0%, var(--navy-2) 0%, var(--navy) 60%); color: var(--on-navy); padding-block: 72px 0; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.07;
  background-image: repeating-linear-gradient(90deg, var(--gold-bright) 0 1px, transparent 1px 96px);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; gap: 22px; max-width: 860px; }
.hero h1 { color: var(--on-navy); }
.hero h1 em { color: var(--gold-bright); }
.hero .eyebrow { color: var(--gold-bright); }
.hero .lead { font-size: 1.22rem; color: var(--on-navy-muted); max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 13px 22px; border-radius: var(--radius); border: 1px solid var(--fg);
  background: var(--fg); color: var(--bg); text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--fg); }
.btn.ghost:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.hero .btn { background: var(--gold-bright); border-color: var(--gold-bright); color: var(--navy); }
.hero .btn:hover { background: var(--on-navy); border-color: var(--on-navy); }
.hero .btn.ghost { background: transparent; color: var(--on-navy); border-color: var(--on-navy-muted); }
.hero .btn.ghost:hover { border-color: var(--gold-bright); color: var(--gold-bright); }

/* Chaîne documentaire = relevé */
.chain-scroll { overflow-x: auto; margin-top: 56px; }
.chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); min-width: 920px; counter-reset: step; border-top: 1px solid rgba(201,167,90,.45); }
.chain li { position: relative; padding: 16px 16px 22px; border-right: 1px solid rgba(201,167,90,.18); }
.chain li:last-child { border-right: 0; }
.chain li::before {
  counter-increment: step; content: counter(step, upper-roman) ".";
  font-family: var(--font-display); font-style: italic; font-size: 0.95rem; color: var(--gold-bright);
}
.chain li.hot::after { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--gold-bright); }
.chain .doc { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; margin-top: 4px; color: var(--on-navy); }
.chain .ref { display: block; font-family: var(--font-mono); font-size: 0.76rem; color: var(--on-navy-muted); margin-top: 2px; }
.chain .who { display: block; font-size: 0.8rem; color: var(--on-navy-muted); margin-top: 10px; letter-spacing: 0.04em; }

/* Bandeau indicateurs façon téléscripteur */
.ticker { background: var(--navy); border-top: 1px solid rgba(201,167,90,.35); color: var(--on-navy); overflow: hidden; position: relative; z-index: 1; }
.ticker-track { display: flex; width: max-content; animation: tick 48s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: flex; align-items: baseline; gap: 10px; padding: 12px 28px; border-right: 1px solid rgba(201,167,90,.18); white-space: nowrap; font-family: var(--font-mono); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.ticker-item b { font-weight: 500; color: var(--on-navy-muted); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.72rem; }
.ticker-item .up { color: #6FCF97; }
.ticker-item .down { color: #EB8C86; }
.ticker-label { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 100%; font-size: 0.7rem; color: var(--on-navy-muted); }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Cartes articles */
.grid-3 { display: grid; gap: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.post {
  display: grid; gap: 12px; align-content: start; padding: 28px 26px 30px; background: var(--surface);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg);
  position: relative; transition: background .2s;
}
.post::before { content: ""; position: absolute; top: -1px; left: 0; width: 0; height: 2px; background: var(--gold); transition: width .35s; }
a.post:hover::before { width: 100%; }
a.post:hover h3 { color: var(--gold); }
.post h3 { transition: color .2s; }
.post .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.post p { color: var(--muted); font-size: 0.98rem; }
.tag {
  display: inline-block; font-family: var(--font-body); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 3px 9px; border: 1px solid var(--gold); color: var(--gold); background: transparent;
}
.tag.soon { color: var(--muted); border: 1px solid var(--line); }

/* Liste outils */
.tool-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 8px 28px; align-items: center;
  padding-block: 24px; border-bottom: 1px solid var(--line);
}
.tool-row .fmt { font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--gold); }
.tool-row p { color: var(--muted); font-size: 0.97rem; margin-top: 4px; }
.tool-row > div { min-width: 0; }
@media (max-width: 640px) { .tool-row { grid-template-columns: 1fr; } }

/* Parcours */
.modules { list-style: none; margin: 0; padding: 0; display: grid; }
.modules li { display: grid; grid-template-columns: 80px 1fr auto; gap: 6px 24px; padding-block: 24px; border-bottom: 1px solid var(--line); align-items: start; }
.modules li > div { min-width: 0; }
.modules .num { font-family: var(--font-display); font-style: italic; font-size: 2.1rem; font-weight: 500; color: var(--gold); line-height: 1; }
.modules p { color: var(--muted); font-size: 0.97rem; margin-top: 4px; }
@media (max-width: 560px) { .modules li { grid-template-columns: 56px 1fr; } .modules li .tag { grid-column: 2; justify-self: start; } }

/* Bandeau newsletter */
.band { background: var(--navy); color: var(--on-navy); border-top: 1px solid var(--gold); }
.band .wrap { padding-block: 64px; display: grid; gap: 24px 48px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: center; }
.band h2 em { color: var(--gold-bright); }
.band p { color: var(--on-navy-muted); }
.band form { display: flex; flex-wrap: wrap; gap: 10px; }
.band input {
  flex: 1 1 220px; min-width: 0; font: inherit; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--on-navy-muted); background: transparent; color: var(--on-navy);
}
.band input::placeholder { color: var(--on-navy-muted); }
.band .btn { background: var(--gold-bright); color: var(--navy); border-color: var(--gold-bright); }
.band .btn:hover { background: var(--on-navy); border-color: var(--on-navy); }
.band .note { font-size: 0.88rem; flex-basis: 100%; }

/* En-tête de page intérieure */
.page-head { background: var(--navy); color: var(--on-navy); border-bottom: 1px solid var(--gold); }
.article-head { padding-block: 56px 44px; display: grid; gap: 16px; }
.page-head h1 { color: var(--on-navy); }
.page-head .eyebrow, .page-head a.eyebrow { color: var(--gold-bright); }
.page-head p { color: var(--on-navy-muted) !important; }
.article-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--on-navy-muted); }
.page-head .tag { color: var(--gold-bright); border-color: var(--gold-bright); }
.page-head .hint { color: var(--on-navy-muted); }

/* Article */
.article-body { padding-block: 48px 72px; display: grid; gap: 20px; }
.article-body > p:first-child::first-letter { font-family: var(--font-display); float: left; font-size: 3.6em; line-height: 0.85; padding: 6px 10px 0 0; color: var(--gold); }
.article-body h2 { margin-top: 28px; font-size: 1.7rem; padding-top: 18px; border-top: 1px solid var(--line); }
.article-body ul, .article-body ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.article-body li::marker { color: var(--gold); }
.callout { border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); background: var(--accent-soft); padding: 18px 22px; }
.callout strong { display: block; margin-bottom: 4px; font-family: var(--font-display); font-size: 1.1rem; }
.mail {
  background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--gold);
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6; padding: 20px; white-space: pre-wrap; overflow-x: auto;
}
.mail-tools { display: flex; justify-content: flex-end; }
.table-wrap { overflow-x: auto; border-top: 2px solid var(--fg); border-bottom: 1px solid var(--fg); }
table { border-collapse: collapse; width: 100%; font-size: 0.96rem; background: var(--surface); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Outil : calculateur */
.tool { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--gold); padding: 28px; display: grid; gap: 24px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input, .field select {
  font: inherit; font-family: var(--font-mono); padding: 10px 2px; border: 0; border-bottom: 1px solid var(--fg);
  border-radius: 0; background: transparent; color: var(--fg); width: 100%; min-width: 0;
}
.field input:focus, .field select:focus { border-bottom-color: var(--gold); outline: none; box-shadow: 0 1px 0 var(--gold); }
.results { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); border-top: 2px solid var(--fg); }
.result { padding: 16px 16px 6px 0; border-bottom: 1px solid var(--line); }
.result .k { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.result .v { font-family: var(--font-display); font-variant-numeric: lining-nums tabular-nums; font-size: 1.75rem; font-weight: 500; margin-top: 4px; }
.result.main .v { color: var(--gold); }
.hint { font-size: 0.9rem; color: var(--muted); }
.warn { color: var(--warn); }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: chk; }
.checklist label { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; cursor: pointer; border-bottom: 1px solid var(--line); }
.checklist input { margin-top: 5px; accent-color: var(--gold); width: 18px; height: 18px; flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--gold); }
.progress { height: 3px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.progress-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }

/* Glossaire */
.search { font: inherit; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--on-navy-muted); background: transparent; color: var(--on-navy); width: 100%; max-width: 440px; }
.search::placeholder { color: var(--on-navy-muted); }
.glossary { display: grid; margin: 0; }
.glossary div { display: grid; grid-template-columns: minmax(150px, 240px) 1fr; gap: 4px 28px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.glossary dt { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.glossary dt .abbr { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold); font-weight: 400; display: block; letter-spacing: 0.06em; }
.glossary dd { margin: 0; color: var(--muted); min-width: 0; }
@media (max-width: 560px) { .glossary div { grid-template-columns: 1fr; } }

/* Pied de page */
.site-footer { background: var(--navy); color: var(--on-navy-muted); font-size: 0.88rem; border-top: 1px solid var(--gold); }
.site-footer .wrap { padding-block: 32px; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { color: var(--on-navy-muted); text-decoration: none; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.76rem; font-weight: 600; }
.site-footer a:hover { color: var(--gold-bright); }

.placeholder { background: var(--mark); color: var(--mark-fg); padding: 0 4px; font-family: var(--font-mono); font-size: 0.9em; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .ticker-track { animation: none; }
}

/* Communauté : accroche + engagements */
.teaser-grid { display: grid; gap: 40px 64px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.teaser-grid > * { min-width: 0; }
.pact { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--fg); }
.pact li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.pact li > span { font-family: var(--font-display); font-style: italic; font-size: 1.5rem; color: var(--gold); line-height: 1.1; }
.pact strong { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 2px; }
.pact div { color: var(--muted); }
.pact strong { color: var(--fg); }

/* Fiche dossier */
.dossier { background: var(--surface); border: 1px solid var(--line); border-top: 3px double var(--gold); display: grid; gap: 0; position: relative; }
.dossier-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding: 24px 28px; border-bottom: 1px solid var(--fg); }
.dossier-kind { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.dossier-sub { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }
.dossier-ref { display: flex; gap: 28px; margin: 0; }
.dossier-ref dt { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.dossier-ref dd { margin: 2px 0 0; font-size: 1rem; }
.dossier-part { border: 0; margin: 0; padding: 26px 28px; border-bottom: 1px solid var(--line); display: grid; gap: 18px; min-width: 0; }
.dossier-part legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; display: flex; align-items: baseline; gap: 12px; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.dossier-part legend span { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; color: var(--surface); background: var(--fg); padding: 2px 7px; }
.dossier-part legend + * { clear: both; }
.field textarea {
  font: inherit; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--fg); border-radius: 0;
  background: transparent; color: var(--fg); width: 100%; min-width: 0; resize: vertical; line-height: 1.55;
}
.field textarea:focus { border-bottom-color: var(--gold); outline: none; box-shadow: 0 1px 0 var(--gold); }
.field ::placeholder { color: var(--muted); opacity: 0.75; }
.field-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.chips, .scale { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input, .scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span, .scale span {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line); font-size: 0.9rem; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s; background: var(--bg);
}
.chip span:hover, .scale span:hover { border-color: var(--gold); }
.chip input:checked + span, .scale input:checked + span { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip input:focus-visible + span, .scale input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.consent { display: flex; gap: 14px; align-items: flex-start; padding: 22px 28px; border-bottom: 1px solid var(--line); font-size: 0.95rem; color: var(--muted); cursor: pointer; }
.consent input { margin-top: 4px; accent-color: var(--gold); width: 18px; height: 18px; flex: none; }
.dossier-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 22px 28px; }
.dossier-foot .hint { flex: 1 1 260px; }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* Récépissé avec tampon */
.receipt { position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 3px double var(--gold); padding: 36px 28px 28px; display: grid; gap: 14px; overflow: hidden; }
.receipt h3 { font-size: 1.7rem; max-width: 70%; }
.receipt-lines { margin: 8px 0 6px; border-top: 2px solid var(--fg); }
.receipt-lines div { display: grid; grid-template-columns: 150px 1fr; gap: 4px 20px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.receipt-lines dt { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.receipt-lines dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.receipt .btn { justify-self: start; }
.stamp {
  position: absolute; top: 26px; right: 24px; transform: rotate(-12deg);
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--up); border: 3px double var(--up); padding: 8px 18px; opacity: 0.88;
  animation: stamp .45s cubic-bezier(.2,.9,.3,1.3) both;
}
.stamp.draft { color: var(--down); border-color: var(--down); font-size: 1.1rem; }
@keyframes stamp { from { transform: rotate(-12deg) scale(2.2); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 0.88; } }
@media (max-width: 560px) {
  .receipt { padding-top: 96px; }
  .receipt h3 { max-width: none; }
  .receipt-lines div { grid-template-columns: 1fr; }
  .dossier-head, .dossier-part, .consent, .dossier-foot { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }

/* Navigation : bouton Entraide */
.nav a.nav-cta { color: var(--navy); background: var(--gold-bright); margin-left: 8px; }
.nav a.nav-cta:hover { background: var(--on-navy); color: var(--navy); }
.nav a.nav-cta[aria-current="page"] { box-shadow: none; color: var(--navy); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* La Cote des outils */
.cote-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 12px 0 0; border-top: 1px solid rgba(201,167,90,.45); max-width: 760px; }
.cote-summary div { padding: 14px 16px 0 0; }
.cote-summary dt { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-navy-muted); }
.cote-summary dd { margin: 4px 0 0; font-size: 1.4rem; color: var(--gold-bright); }

.featured { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0; text-decoration: none; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-top: 3px double var(--gold); }
.featured-txt { padding: 32px; display: grid; gap: 14px; align-content: start; }
.featured-txt p { color: var(--muted); }
.featured-txt .btn { justify-self: start; }
.featured:hover .btn { background: var(--gold); border-color: var(--gold); }
.featured-figs { margin: 0; background: var(--navy); color: var(--on-navy); padding: 28px 32px; display: grid; align-content: center; }
.featured-figs div { display: flex; justify-content: space-between; gap: 16px; padding-block: 12px; border-bottom: 1px solid rgba(201,167,90,.22); }
.featured-figs div:last-child { border-bottom: 0; }
.featured-figs dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-navy-muted); align-self: center; }
.featured-figs dd { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-variant-numeric: lining-nums tabular-nums; }
.featured-figs dd.hl { color: var(--gold-bright); }

.filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; align-items: center; }
.filters-right { display: flex; flex-wrap: wrap; gap: 10px; }
.select { font: inherit; font-size: 0.92rem; padding: 8px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: var(--radius); min-width: 0; }
.cote { border-top: 2px solid var(--fg); }
.cote-row { display: grid; grid-template-columns: 84px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.3fr) 120px 190px; gap: 8px 20px; align-items: center; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.cote-headrow { padding-block: 10px; }
.cote-headrow span { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.cote-row.is-soon .cote-name strong, .cote-row.is-soon .code { opacity: 0.6; }
.code { display: inline-block; font-family: var(--font-mono); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.08em; color: var(--gold); border: 1px solid var(--gold); padding: 3px 7px; }
.code-lg { font-size: 1rem; padding: 6px 10px; color: var(--gold-bright); border-color: var(--gold-bright); }
.cote-name { display: grid; gap: 2px; min-width: 0; }
.cote-name strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; }
.cote-name strong a { color: var(--fg); text-decoration: none; }
.cote-name strong a:hover { color: var(--gold); }
.cote-name > span { color: var(--muted); font-size: 0.93rem; }
.cote-name .lvl { font-size: 0.75rem; letter-spacing: 0.06em; }
.cote-etape { font-size: 0.92rem; }
.cote-fmt { display: flex; flex-wrap: wrap; gap: 4px; }
.fmt-badge { font-size: 0.72rem; padding: 2px 7px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status.on { color: var(--up); } .status.on::before { background: var(--up); }
.status.off { color: var(--muted); } .status.off::before { border: 1px solid var(--muted); }
.cote-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cote-act .btn { padding: 8px 12px; font-size: 0.72rem; }
@media (max-width: 900px) {
  .cote-headrow { display: none; }
  .cote-row { grid-template-columns: 72px minmax(0, 1fr); }
  .cote-row > span:nth-child(n+3) { grid-column: 2; }
  .cote-act { justify-content: flex-start; }
  .cote-etape::before { content: "Étape : "; color: var(--muted); }
}
.ask-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; padding: 30px 32px; background: var(--accent-soft); border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.ask-band > div { display: grid; gap: 8px; max-width: 62ch; }
.ask-band p { color: var(--muted); }
.tool-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.dl-note { font-size: 0.88rem; color: var(--on-navy-muted); align-self: center; max-width: 42ch; }

/* Entraide */
.entraide-hero { display: grid; gap: 32px 56px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: center; }
.entraide-hero > * { min-width: 0; }
.manifesto { margin: 0; padding: 28px 30px; border: 1px solid rgba(201,167,90,.5); position: relative; display: grid; gap: 12px; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.4; color: var(--on-navy); }
.manifesto::before { content: "\201C"; position: absolute; top: -28px; left: 18px; font-size: 5rem; line-height: 1; color: var(--gold-bright); }
.manifesto strong { font-weight: 500; font-style: italic; color: var(--gold-bright); }
.pact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 32px; }
.entraide-grid { display: grid; gap: 40px 48px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .entraide-grid { grid-template-columns: 1fr; } }
.threads { display: grid; gap: 12px; }
.thread { background: var(--surface); border: 1px solid var(--line); }
.thread[open] { border-color: var(--gold); }
.thread summary { list-style: none; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 18px 20px; cursor: pointer; }
.thread summary::-webkit-details-marker { display: none; }
.thread-main { display: grid; gap: 6px; min-width: 0; }
.thread-title { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; line-height: 1.3; }
.thread summary:hover .thread-title { color: var(--gold); }
.thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 0.82rem; color: var(--muted); }
.avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--navy); color: var(--gold-bright); font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.04em; border-radius: 50%; }
.st { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 9px; white-space: nowrap; border: 1px solid currentColor; }
.st-ouvert { color: var(--warn); } .st-resolu { color: var(--up); } .st-outil { color: var(--gold); background: var(--accent-soft); } .st-relecture { color: var(--muted); }
.conv { display: grid; gap: 14px; padding: 4px 20px 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.bubble { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.bubble > div { background: var(--bg); border: 1px solid var(--line); padding: 12px 16px; border-radius: 0 10px 10px 10px; display: grid; gap: 4px; }
.bubble-q > div { background: var(--accent-soft); border-color: transparent; }
.bubble-tool > div { border-color: var(--gold); }
.bubble-tool .avatar { background: var(--gold); color: var(--navy); }
.who { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
.file-chip { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.8rem; padding: 4px 10px; border: 1px solid var(--line); background: var(--surface); margin-top: 4px; }
.file-chip::before { content: "XLS"; font-size: 0.62rem; font-weight: 600; color: var(--surface); background: var(--up); padding: 1px 4px; }
.tool-link { font-size: 0.85rem; font-weight: 600; text-decoration: none; margin-top: 2px; }
.composer-wrap { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); }
@media (max-width: 960px) { .composer-wrap { position: static; } }
.composer { background: var(--surface); border: 1px solid var(--line); border-top: 3px double var(--gold); padding: 26px; display: grid; gap: 18px; }
.composer-head { display: grid; gap: 6px; }
.composer h3 { font-size: 1.45rem; }
.composer .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.drop { position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; padding: 22px 16px; border: 1px dashed var(--muted); background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop:hover, .drop.over { border-color: var(--gold); background: var(--accent-soft); }
.drop.has { border-style: solid; border-color: var(--up); }
.drop-main { font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.drop-sub { font-size: 0.8rem; color: var(--muted); }
.drop:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.hint.ok { color: var(--up); }

/* Bandeau données fictives (Entraide) */
.fiction-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fiction-band .wrap { padding-block: 44px; }
.fiction { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px 40px; align-items: center; max-width: 980px; }
.fiction p { color: var(--muted); }
.fiction p strong { color: var(--fg); }
.fiction-seal { width: 132px; height: 132px; border-radius: 50%; border: 3px double var(--gold); display: grid; place-content: center; text-align: center; transform: rotate(-8deg); color: var(--gold); }
.fiction-seal span { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; }
.fiction-seal strong { font-family: var(--font-display); font-size: 2rem; line-height: 1.05; }
.fiction-legal { font-size: 0.88rem; border-left: 2px solid var(--gold); padding-left: 12px; }
@media (max-width: 600px) { .fiction { grid-template-columns: 1fr; } .fiction-seal { width: 104px; height: 104px; } .fiction-seal strong { font-size: 1.6rem; } }

/* Charte */
.charte-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); padding-block: 48px; display: grid; gap: 12px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; border-top: 2px solid var(--fg); }
.toc li { counter-increment: toc; border-bottom: 1px solid var(--line); }
.toc a { display: flex; gap: 10px; padding: 9px 0; font-size: 0.9rem; color: var(--fg); text-decoration: none; }
.toc a::before { content: counter(toc); font-family: var(--font-display); font-style: italic; color: var(--gold); min-width: 14px; }
.toc a:hover { color: var(--gold); }
@media (max-width: 900px) { .charte-layout { grid-template-columns: 1fr; gap: 0; } .toc { position: static; padding-bottom: 0; } }
.charte { gap: 8px; }
.art { display: grid; gap: 14px; padding-block: 12px; scroll-margin-top: 90px; }
.charte .art h2 { display: grid; gap: 4px; }
.art-n { font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.art h3 { margin-top: 8px; }
.art-key { background: var(--surface); border: 1px solid var(--gold); border-top: 3px double var(--gold); padding: 8px 26px 26px; margin-block: 16px; }
.art-key h2 { border-top: 0 !important; }
.rules { counter-reset: r; list-style: none; padding-left: 0 !important; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; gap: 8px; }
.rules li::before { content: counter(r, lower-roman) "."; font-family: var(--font-display); font-style: italic; color: var(--gold); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.two-col > div { padding: 18px 20px; border: 1px solid var(--line); background: var(--bg); }
.two-col ul { padding-left: 1.1em; }
.col-label { display: inline-block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 10px; }
.two-col .no { border-top: 3px solid var(--down); } .two-col .no .col-label { color: var(--down); }
.two-col .yes { border-top: 3px solid var(--up); } .two-col .yes .col-label { color: var(--up); }
.law { margin: 0; border-top: 2px solid var(--fg); }
.law div { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 6px 24px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.law dt { font-family: var(--font-display); font-weight: 600; }
.law dd { margin: 0; color: var(--muted); min-width: 0; }
@media (max-width: 600px) { .law div { grid-template-columns: 1fr; } .art-key { padding-inline: 18px; } }
.charte th[scope="row"] { width: 32%; }

/* Fil d'Ariane */
.crumbs { background: var(--navy-2); color: var(--on-navy-muted); border-bottom: 1px solid rgba(201,167,90,.25); font-size: 0.82rem; }
.crumbs .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 20px; padding-block: 9px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; min-width: 0; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "›"; margin: 0 10px; color: var(--gold-bright); }
.crumbs a { color: var(--on-navy-muted); text-decoration: none; }
.crumbs a:hover { color: var(--gold-bright); }
.crumbs li[aria-current] { color: var(--on-navy); }
.crumbs-map { color: var(--gold-bright) !important; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }

/* Arborescence latérale (secteurs) */
.with-tree { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.tree-side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); padding-block: 48px; display: grid; gap: 12px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.tree li { position: relative; }
.tree ul > li::before { content: ""; position: absolute; left: -14px; top: 1.05em; width: 10px; border-top: 1px solid var(--line); }
.tree a { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--fg); text-decoration: none; font-size: 0.93rem; }
.tree a:hover { color: var(--gold); }
.tree a[aria-current] { color: var(--gold); font-weight: 600; }
.tree .code { font-size: 0.66rem; padding: 1px 5px; }
.tree ul ul a { font-size: 0.86rem; color: var(--muted); padding: 4px 0; }
.tree-main { display: grid; gap: 0; padding-bottom: 64px; min-width: 0; }
.sec-block { padding-block: 48px 8px; scroll-margin-top: 90px; }
@media (max-width: 900px) { .with-tree { grid-template-columns: 1fr; gap: 0; } .tree-side { position: static; padding-bottom: 0; } }

.enjeux { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.enjeu { padding: 22px 22px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); display: grid; gap: 8px; align-content: start; }
.enjeu p { color: var(--muted); font-size: 0.96rem; }
.chain-light { border-top-color: var(--line); min-width: 860px; }
.chain-light li { border-right-color: var(--line); }
.chain-light li::before { color: var(--gold); }
.chain-light .doc { color: var(--fg); }
.chain-light .ref { color: var(--muted); }
.kpis { list-style: none; margin: 0; padding: 0; counter-reset: k; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0; border-top: 2px solid var(--fg); }
.kpis li { counter-increment: k; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 1.08rem; display: flex; gap: 12px; }
.kpis li::before { content: counter(k, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold); padding-top: 4px; }
.subjects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.subjects li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-block: 14px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 1.08rem; }
.mini-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.mini-tool { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; padding: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; }
.mini-tool .status { grid-column: 2; }
a.mini-tool:hover { border-color: var(--gold); }
.mini-tool.is-soon { opacity: 0.75; }
.tree-main .ask-band { margin-top: 48px; }

/* Hub secteurs */
.sector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.sector-card { display: grid; gap: 14px; align-content: start; padding: 30px 28px 32px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; position: relative; }
.sector-card::before { content: ""; position: absolute; top: -1px; left: 0; width: 0; height: 3px; background: var(--gold); transition: width .35s; }
.sector-card:hover::before { width: 100%; }
.sector-card .code-lg { justify-self: start; color: var(--gold); border-color: var(--gold); }
.sector-card h3 { font-size: 1.6rem; }
.sector-card p { color: var(--muted); font-size: 0.97rem; }
.sector-card ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.sector-card li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.sector-card li::before { content: "— "; color: var(--gold); }
.sector-card .more { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.sector-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); border-top: 2px solid var(--fg); }
.sector-strip a { display: grid; gap: 6px; padding: 22px 20px 22px 0; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.sector-strip a .code { justify-self: start; }
.sector-strip strong { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.sector-strip a > span:last-child { color: var(--muted); font-size: 0.9rem; }
.sector-strip a:hover strong { color: var(--gold); }

/* Plan du site */
.sitemap, .sitemap ul { list-style: none; margin: 0; padding: 0; }
.sitemap ul { margin-left: 14px; padding-left: 22px; border-left: 1px solid var(--line); }
.sitemap li { position: relative; }
.sitemap ul > li::before { content: ""; position: absolute; left: -22px; top: 1.35em; width: 16px; border-top: 1px solid var(--line); }
.sitemap summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 9px 0; }
.sitemap summary::-webkit-details-marker { display: none; }
.sitemap summary::before { content: "−"; font-family: var(--font-mono); color: var(--gold); width: 12px; }
.sitemap details:not([open]) > summary::before { content: "+"; }
.sitemap .leaf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 9px 0 9px 26px; }
.sitemap a, .sitemap summary > span:not(.node-desc) { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--fg); text-decoration: none; }
.sitemap a:hover { color: var(--gold); }
.sitemap ul ul a { font-size: 1rem; font-weight: 500; }
.node-desc { font-size: 0.85rem; color: var(--muted); font-family: var(--font-body) !important; font-weight: 400 !important; }
.root-node { font-family: var(--font-display); font-size: 1.5rem !important; color: var(--gold) !important; }
