/* ==========================================================================
   Retraite Sans Jargon : feuille de style
   Lisibilité d'abord (public 55-64 ans) : corps 18px, contrastes AA+, cibles larges.
   ========================================================================== */

:root {
  --primary: #1F3A5F;
  --primary-dark: #172C48;
  --primary-deep: #0F1A2B;
  --secondary: #F2C94C;
  --secondary-soft: #FCF1C8;
  --tint: #EDE8DC;
  --paper: #F6F3EC;
  --ink: #1C2530;
  --muted: #4F5A68;
  --line: #D9D2C3;
  --ok: #14633F;
  --ok-bg: #E4F4EA;
  --warn: #8A4B00;
  --warn-bg: #FFF3DC;
  --alert: #9B1C1C;
  --alert-bg: #FDE9E9;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 6px 24px rgba(15, 26, 43, .08);
  --shadow-lg: 0 18px 48px rgba(15, 26, 43, .14);

  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-dark); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
p { margin: 0 0 var(--sp-4); }
ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.25rem; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--primary-deep); margin: 0 0 var(--sp-4); font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }
.muted { color: var(--muted); font-size: .98rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

.container { width: min(100% - 2rem, 1160px); margin-inline: auto; }
.container.narrow { width: min(100% - 2rem, 820px); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary-deep); color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 200; }
.skip-link:focus { left: 8px; color: #fff; }

/* ---------- Topbar & header ---------- */
.topbar { background: var(--primary-deep); color: #F6F3EC; font-size: .92rem; }
.topbar-inner { display: flex; gap: var(--sp-3); align-items: center; justify-content: center; flex-wrap: wrap; padding-block: 8px; text-align: center; }
.topbar i { width: 16px; height: 16px; vertical-align: -3px; color: var(--secondary); }
.topbar-sep { opacity: .5; }

.site-header { position: sticky; top: 0; z-index: 100; background: rgba(251,249,244,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--primary-deep); }
.brand-text { font-family: var(--font-head); font-size: 1.2rem; line-height: 1.1; }
.brand-text strong { color: var(--primary); }
.brand-light { color: #fff; }
.brand-light .brand-text strong { color: var(--secondary); }
.brand:hover { color: var(--primary-deep); }
.brand-light:hover { color: #fff; }

.nav-toggle { display: inline-flex; align-items: center; gap: 8px; background: var(--tint); color: var(--primary-deep); border: 2px solid var(--line); border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; min-height: 48px; }
.nav-toggle i { width: 22px; height: 22px; }

.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: var(--sp-3) 1rem var(--sp-5); }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a, .site-nav summary { display: block; padding: 14px 12px; text-decoration: none; color: var(--ink); font-weight: 700; border-radius: 10px; cursor: pointer; }
.site-nav a:hover, .site-nav summary:hover { background: var(--tint); color: var(--primary-dark); }
.site-nav a[aria-current="page"] { background: var(--secondary-soft); color: var(--primary-deep); }
.nav-more ul { padding-left: var(--sp-4); border-left: 3px solid var(--secondary); margin: 4px 0 0 12px; }
.nav-more summary { list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: ' ▾'; }

@media (min-width: 1040px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; position: static; box-shadow: none; border: 0; padding: 0; background: transparent; }
  .site-nav > ul { display: flex; align-items: center; gap: 2px; }
  .site-nav a, .site-nav summary { padding: 10px 12px; font-size: 1rem; }
  .nav-more { position: relative; }
  .nav-more ul { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; margin: 0; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 24px; border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .2s, background .2s, box-shadow .2s, color .2s; line-height: 1.2; }
.btn i { width: 20px; height: 20px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(31,58,95,.28); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--primary-dark); border-color: var(--primary); }
.btn-ghost:hover { background: var(--tint); color: var(--primary-deep); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--primary-deep); }
.btn-light:hover { background: var(--secondary); color: var(--primary-deep); transform: translateY(-2px); }
.btn-lg { min-height: 58px; padding: 14px 30px; font-size: 1.1rem; }
.btn-block { display: flex; width: 100%; margin-top: var(--sp-3); }
.btn-text { background: none; border: 0; padding: 8px 0; font: inherit; font-weight: 700; color: var(--primary-dark); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: underline; text-underline-offset: 3px; }
.btn-text i { width: 18px; height: 18px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.link-arrow i { width: 18px; height: 18px; transition: transform .2s; }
.link-arrow:hover i { transform: translateX(4px); }

/* ---------- Chips ---------- */
.chip { display: inline-block; font-size: .9rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; line-height: 1.5; }
.chip-alert { background: var(--alert-bg); color: var(--alert); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-info { background: var(--secondary-soft); color: var(--primary-deep); }

/* ---------- Kicker ---------- */
.kicker { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; color: var(--primary-dark); margin-bottom: var(--sp-3); }
.kicker i { width: 18px; height: 18px; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 62ch; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--tint) 0%, #fff 100%); padding-block: var(--sp-7) var(--sp-8); overflow: hidden; }
.hero-grid { display: grid; gap: var(--sp-7); align-items: center; }
.hero h1 .hl { color: var(--primary); background: linear-gradient(transparent 62%, var(--secondary) 62%); padding: 0 .1em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-5) 0; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-weight: 700; }
.hero-points li { display: flex; gap: 10px; align-items: center; }
.hero-points i { color: var(--ok); width: 22px; height: 22px; flex: none; }
.hero-visual { position: relative; }
.hero-visual img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.hero-badge { position: absolute; left: 16px; bottom: -22px; background: #fff; border-radius: var(--radius); padding: 14px 20px; box-shadow: var(--shadow-lg); border-left: 6px solid var(--primary); display: grid; line-height: 1.35; max-width: 270px; }
.hero-badge strong { font-family: var(--font-head); font-size: 1.5rem; color: var(--primary); }
.hero-badge span { font-size: .95rem; color: var(--muted); }
@media (min-width: 900px) {
  .hero { padding-block: var(--sp-8) var(--sp-9); }
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
  .hero-badge { left: -28px; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--sp-8); }
.section-tint { background: var(--tint); }
.section-head { max-width: 720px; margin-bottom: var(--sp-6); }
.section-head p:last-child { color: var(--muted); font-size: 1.15rem; margin-bottom: 0; }

.page-hero { background: linear-gradient(180deg, var(--tint), #fff); padding-block: var(--sp-6) var(--sp-7); border-bottom: 1px solid var(--line); }
.page-hero-grid { display: grid; gap: var(--sp-6); align-items: start; }
@media (min-width: 900px) { .page-hero-grid { grid-template-columns: 1.4fr .8fr; } }
.verif { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; background: var(--ok-bg); color: var(--ok); padding: 8px 16px; border-radius: 999px; font-size: .98rem; }
.verif i { width: 18px; height: 18px; }
.hero-aside { background: #fff; border: 2px solid var(--secondary); border-radius: var(--radius-lg); padding: var(--sp-5); box-shadow: var(--shadow); }
.hero-aside h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.hero-aside h2 i { color: var(--primary); }

/* Breadcrumb */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 var(--sp-5); font-size: .98rem; }
.breadcrumb li + li::before { content: '›'; margin-right: 6px; color: var(--muted); }
.breadcrumb a { color: var(--primary-dark); }

/* ---------- Lists ---------- */
.tick-list, .cross-list, .plain-list { list-style: none; padding: 0; }
.tick-list li, .cross-list li { position: relative; padding-left: 36px; margin-bottom: 12px; }
.tick-list li::before { content: ''; position: absolute; left: 0; top: .28em; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314633F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat; }
.cross-list li::before { content: ''; position: absolute; left: 0; top: .28em; width: 22px; height: 22px; border-radius: 50%; background: var(--alert-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239B1C1C' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center/12px no-repeat; }
.plain-list li { margin-bottom: 8px; }

/* ---------- Cards ---------- */
.cards-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 700px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } .cards-grid-2 { grid-template-columns: repeat(2, 1fr); } }
.cards-grid-docs { grid-template-columns: 1fr; }
@media (min-width: 700px) { .cards-grid-docs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards-grid-docs { grid-template-columns: repeat(3, 1fr); } }

.doc-card { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); text-decoration: none; color: var(--ink); transition: transform .25s, box-shadow .25s, border-color .25s; }
.doc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); color: var(--ink); }
.doc-card h3 { margin: 0; color: var(--primary-deep); }
.doc-card p { margin: 0; color: var(--muted); }
.doc-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--secondary-soft); color: var(--primary-dark); display: inline-grid; place-items: center; margin-bottom: 4px; }
.doc-icon i { width: 28px; height: 28px; }
.doc-count { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--primary-dark); font-size: .98rem; }

.fiche-card { background: #fff; border: 2px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); display: flex; flex-direction: column; gap: 8px; transition: box-shadow .25s, border-color .25s, transform .25s; }
.fiche-card:hover { box-shadow: var(--shadow); border-color: var(--secondary); transform: translateY(-3px); }
.fiche-card-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.fiche-doc { display: inline-flex; gap: 6px; align-items: center; font-size: .92rem; color: var(--muted); font-weight: 700; }
.fiche-doc i { width: 16px; height: 16px; }
.fiche-card h3 { margin: 4px 0 0; font-size: 1.2rem; }
.fiche-card h3 a { color: var(--primary-deep); text-decoration: none; }
.fiche-card h3 a:hover { color: var(--primary); text-decoration: underline; }
.fiche-card p { color: var(--muted); margin: 0; }
.fiche-card .link-arrow { margin-top: auto; padding-top: 8px; }

/* ---------- Features ---------- */
.features { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 700px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature { padding: var(--sp-5); border-radius: var(--radius-lg); background: var(--tint); }
.feature-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; margin-bottom: var(--sp-3); }
.feature-icon i { width: 26px; height: 26px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); }

/* ---------- Split ---------- */
.section-split { background: var(--primary-deep); color: #F6F3EC; }
.section-split h2 { color: #fff; }
.section-split .kicker { color: var(--secondary); }
.section-split .tick-list li::before { background-color: var(--secondary); }
.split { display: grid; gap: var(--sp-7); align-items: center; }
.split-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); aspect-ratio: 3/2; object-fit: cover; width: 100%; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } .split-media { transform: translateX(-12px) rotate(-1deg); } }

/* ---------- Boundary ---------- */
.boundary-grid { display: grid; gap: var(--sp-5); }
@media (min-width: 800px) { .boundary-grid { grid-template-columns: 1fr 1fr; } }
.boundary { padding: var(--sp-6); border-radius: var(--radius-lg); border: 2px solid var(--line); }
.boundary h3 { display: flex; align-items: center; gap: 10px; }
.boundary-yes { background: var(--ok-bg); border-color: #B7DEC6; }
.boundary-yes h3 i { color: var(--ok); }
.boundary-no { background: var(--alert-bg); border-color: #F2C3C3; }
.boundary-no h3 i { color: var(--alert); }
.boundary li { color: var(--ink); }

/* ---------- Quiz ---------- */
.quiz { background: #fff; border-radius: var(--radius-lg); padding: var(--sp-6); box-shadow: var(--shadow-lg); border: 2px solid var(--secondary); }
.quiz-q { font-size: 1.4rem; }
.quiz-sub { font-weight: 700; color: var(--primary-dark); }
.quiz-options { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-4); }
@media (min-width: 700px) { .quiz-options.is-docs { grid-template-columns: repeat(2, 1fr); } }
.quiz-option { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--tint); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font: inherit; font-weight: 700; color: var(--primary-deep); cursor: pointer; text-decoration: none; min-height: 60px; transition: background .2s, border-color .2s, transform .2s; }
.quiz-option:hover { background: var(--secondary-soft); border-color: var(--primary); transform: translateX(3px); color: var(--primary-deep); }
.quiz-option i { width: 26px; height: 26px; color: var(--primary); flex: none; }
.quiz-option.is-alt { background: #fff; border-style: dashed; }

/* ---------- Table "ligne par ligne" ---------- */
.table-wrap { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
table.lines { width: 100%; border-collapse: collapse; }
table.lines th, table.lines td { text-align: left; padding: 16px 20px; vertical-align: top; border-bottom: 1px solid var(--line); }
table.lines thead th { background: var(--primary-deep); color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
table.lines tbody th { font-weight: 700; color: var(--primary-deep); width: 24%; background: #FBF9F4; }
table.lines tbody tr:last-child th, table.lines tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 799px) {
  table.lines thead { position: absolute; left: -9999px; }
  table.lines, table.lines tbody, table.lines tr, table.lines th, table.lines td { display: block; width: 100% !important; }
  table.lines tr { border-bottom: 6px solid var(--tint); padding-bottom: 8px; }
  table.lines th, table.lines td { border: 0; padding: 10px 18px; }
  table.lines tbody th { font-size: 1.1rem; background: #FBF9F4; }
  table.lines td::before { content: attr(data-label); display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary-dark); margin-bottom: 2px; }
}

/* ---------- Callouts ---------- */
.callout { display: flex; gap: var(--sp-4); padding: var(--sp-5); border-radius: var(--radius-lg); margin-bottom: var(--sp-5); border-left: 6px solid var(--primary); }
.callout > i { width: 30px; height: 30px; flex: none; margin-top: 2px; }
.callout h2 { font-size: 1.3rem; margin-bottom: 6px; }
.callout p { margin: 0; }
.callout-info { background: var(--secondary-soft); border-color: var(--primary); }
.callout-info > i { color: var(--primary-dark); }
.callout-soft { background: var(--tint); border-color: var(--secondary); }
.callout-soft > i { color: var(--primary); }
.callout-warn { background: var(--warn-bg); border-color: #E39A1A; }
.callout-warn > i { color: var(--warn); }

/* ---------- Fiche anomalie ---------- */
.page-hero-fiche .fiche-head { max-width: 860px; }
.fiche-head h1 { margin-top: var(--sp-3); }
.meta-strip { list-style: none; padding: 0; margin: var(--sp-4) 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 1rem; color: var(--muted); }
.meta-strip li { display: inline-flex; gap: 8px; align-items: center; }
.meta-strip i { width: 18px; height: 18px; color: var(--primary); }

.fiche-layout { display: grid; gap: var(--sp-7); align-items: start; }
@media (min-width: 1000px) { .fiche-layout { grid-template-columns: minmax(0, 1fr) 340px; } .fiche-aside { position: sticky; top: 96px; } }
.fiche-main > * + * { margin-top: var(--sp-6); }
.block h2 { display: flex; align-items: center; gap: 14px; font-size: 1.6rem; }
.block .num { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-family: var(--font-body); font-size: 1.1rem; }
.block-intro { color: var(--muted); }

.check-steps { list-style: none; padding: 0; counter-reset: cs; }
.check-steps li { counter-increment: cs; position: relative; padding: 14px 16px 14px 56px; background: var(--tint); border-radius: var(--radius); margin-bottom: 10px; }
.check-steps li::before { content: counter(cs); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 8px; background: #fff; color: var(--primary-dark); font-weight: 700; display: grid; place-items: center; border: 2px solid var(--secondary); font-size: .95rem; }

.steps { list-style: none; padding: 0; counter-reset: st; position: relative; }
.steps li { counter-increment: st; position: relative; padding: 0 0 var(--sp-5) 64px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--primary-deep); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 1.15rem; z-index: 1; }
.steps li::after { content: ''; position: absolute; left: 21px; top: 44px; bottom: 4px; width: 2px; background: var(--secondary); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }

.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #fff; transition: background .2s, border-color .2s; }
.checklist li.is-done { background: var(--ok-bg); border-color: #B7DEC6; }
.checklist li.is-done label { text-decoration: line-through; color: var(--muted); }
.checklist input { width: 26px; height: 26px; flex: none; margin-top: 2px; accent-color: var(--primary); cursor: pointer; }
.checklist label { cursor: pointer; flex: 1; }

.aside-card { background: #fff; border: 2px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); margin-bottom: var(--sp-4); }
.aside-card h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); }
.aside-card h2 i { color: var(--primary); width: 22px; height: 22px; }
.aside-card p:last-child { margin-bottom: 0; }
.aside-delai { background: var(--warn-bg); border-color: #E39A1A; }
.aside-delai h2 i { color: var(--warn); }
.aside-soft { background: var(--tint); border-color: var(--secondary); font-size: 1rem; }
.aside-soft i { width: 20px; height: 20px; color: var(--primary); vertical-align: -4px; margin-right: 4px; }

/* ---------- Calculateur de délai ---------- */
.calc { background: #fff; border: 2px solid var(--primary); border-radius: var(--radius-lg); padding: var(--sp-6); box-shadow: var(--shadow); }
.calc-head { display: flex; gap: var(--sp-4); align-items: flex-start; }
.calc-head > i { width: 40px; height: 40px; color: var(--primary); flex: none; }
.calc-head h2 { font-size: 1.5rem; }
.calc-row { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
@media (min-width: 760px) { .calc-row { grid-template-columns: 1fr auto; align-items: end; } .calc-row label { grid-column: 1 / -1; } }
.calc label, .filter-search label { font-weight: 700; display: block; }
.calc input[type="date"], .filter-search input { width: 100%; min-height: 54px; font: inherit; padding: 10px 16px; border: 2px solid #6E7887; border-radius: 12px; background: #fff; color: var(--ink); }
.calc input:focus, .filter-search input:focus { border-color: var(--primary); outline: 3px solid var(--secondary); }
.calc-out { margin-top: var(--sp-4); }
.calc-result { border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); background: var(--ok-bg); border-left: 6px solid var(--ok); }
.calc-result.is-late { background: var(--alert-bg); border-color: var(--alert); }
.calc-result.is-soon { background: var(--warn-bg); border-color: #E39A1A; }
.calc-result strong.big { display: block; font-family: var(--font-head); font-size: 1.7rem; color: var(--primary-deep); }
.calc-result p { margin: 6px 0 0; }
.calc-note { margin: var(--sp-4) 0 0; font-size: .96rem; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq details { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; transition: border-color .2s; }
.faq details[open] { border-color: var(--primary); }
.faq summary { cursor: pointer; padding: 18px 56px 18px 20px; font-weight: 700; color: var(--primary-deep); list-style: none; position: relative; min-height: 56px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; background: var(--secondary-soft); color: var(--primary-dark); font-size: 1.5rem; line-height: 30px; text-align: center; }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding: 0 20px 18px; margin: 0; color: var(--muted); }

/* ---------- Sources & pager ---------- */
.sources-box { margin-top: var(--sp-7); background: var(--tint); border-radius: var(--radius-lg); padding: var(--sp-5); border: 2px solid var(--secondary); }
.sources-box h2 { font-size: 1.3rem; display: flex; gap: 10px; align-items: center; }
.sources-box h2 i { color: var(--primary); }
.sources-box ul { padding-left: 1.2rem; }
.pager { display: grid; gap: var(--sp-4); margin-top: var(--sp-6); }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a { display: grid; gap: 2px; padding: var(--sp-4) var(--sp-5); border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .2s, background .2s; }
.pager a:hover { border-color: var(--primary); background: var(--tint); }
.pager span { font-size: .9rem; color: var(--muted); }
.pager strong { color: var(--primary-deep); }
.pager-next { text-align: right; }

/* ---------- Filter ---------- */
.filter-bar { background: var(--tint); border-radius: var(--radius-lg); padding: var(--sp-5); margin-bottom: var(--sp-6); display: grid; gap: var(--sp-4); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-btn { font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--primary-deep); cursor: pointer; min-height: 48px; transition: background .2s, border-color .2s, color .2s; }
.chip-btn:hover { border-color: var(--primary); }
.chip-btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-count { margin: 0; font-weight: 700; color: var(--primary-dark); }
.empty-state { text-align: center; padding: var(--sp-6); background: var(--tint); border-radius: var(--radius); }

/* ---------- Glossaire ---------- */
.glossary { margin: 0; }
.gloss-item { padding: var(--sp-5) 0; border-bottom: 1px solid var(--line); }
.gloss-item dt { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--primary-deep); margin-bottom: 6px; }
.gloss-item dd { margin: 0; }
.gloss-meta { font-size: .98rem; color: var(--muted); }
.gloss-meta span { font-weight: 700; color: var(--primary-dark); }

/* ---------- Lettres ---------- */
.letter-block { background: #fff; border: 2px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-6); margin-bottom: var(--sp-6); scroll-margin-top: 110px; }
.letter { white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New', ui-monospace, monospace; font-size: 1rem; line-height: 1.65; background: #F8FBFC; border: 2px dashed #6E7887; border-radius: var(--radius); padding: var(--sp-5); margin: var(--sp-4) 0; max-height: 480px; overflow: auto; }
.letter-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.copy-status { font-weight: 700; color: var(--ok); }

/* ---------- Prose ---------- */
.prose h2 { margin-top: var(--sp-7); font-size: 1.65rem; }
.prose h2:first-child { margin-top: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding-block: var(--sp-7); }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { margin: 0; color: #F6F3EC; }
.cta-inner { display: grid; gap: var(--sp-5); align-items: center; }
@media (min-width: 800px) { .cta-inner { grid-template-columns: 1fr auto; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-deep); color: #CFE8F0; padding-top: var(--sp-8); }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--secondary); }
.footer-grid { display: grid; gap: var(--sp-6); padding-bottom: var(--sp-6); }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-title { font-family: var(--font-body); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--secondary); margin-bottom: var(--sp-3); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-about p { max-width: 46ch; margin-top: var(--sp-3); }
.footer-note { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--secondary); }
.footer-note i { width: 18px; height: 18px; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.15); padding-block: var(--sp-5); font-size: .95rem; }
.footer-legal p { margin-bottom: 8px; }

/* ---------- Reveal ---------- */
.reveal-on-scroll { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal-on-scroll.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-on-scroll { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .site-header, .site-footer, .cta-band, .fiche-aside .btn, .btn, .btn-text, .calc, [data-print], .pager, .nav-toggle, .filter-bar { display: none !important; }
  body { font-size: 12pt; color: #000; }
  .reveal-on-scroll { opacity: 1 !important; transform: none !important; }
  .fiche-layout { display: block; }
  .page-hero, .section, .section-tint { padding: 12px 0; background: none; border: 0; }
  .aside-card, .block, .callout { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .letter { max-height: none; border: 1px solid #000; }
}
/* outils-rsj-champs [05-tools] : champs des outils (textarea, select, choix) */
.calc textarea, .calc select, .calc input[type="text"], .calc-out textarea { width: 100%; font: inherit; padding: 10px 16px; border: 2px solid #6E7887; border-radius: 12px; background: #fff; color: var(--ink); }
.calc select, .calc input[type="text"] { min-height: 54px; }
.calc textarea:focus, .calc select:focus, .calc input[type="text"]:focus { border-color: var(--primary); outline: 3px solid var(--secondary); }
.calc fieldset { border: 0; padding: 0; margin: 0; }
.calc legend { font-weight: 700; margin-bottom: var(--sp-2); }
.calc .choice { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; cursor: pointer; }
.calc .choice input { width: 22px; height: 22px; accent-color: var(--primary); }
.calc-out .checklist li .chip { margin-right: 8px; }

/* ===== BLOC SOUS-MENU OUTILS — sans JavaScript (hover + focus-within) ===== */
.nav-item{position:relative;display:inline-flex;align-items:center}
.has-sub>a::after{content:"";display:inline-block;width:5px;height:5px;margin-left:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px)}
.has-sub::after{content:"";position:absolute;top:100%;left:0;right:0;height:18px}
.sub-nav{position:absolute;top:calc(100% + 18px);left:-16px;z-index:30;min-width:296px;flex-direction:column;gap:1px;padding:8px;background:var(--surface);border:1px solid var(--line);box-shadow:0 18px 34px rgba(31,58,77,.14);display:none}
.has-sub:hover>.sub-nav,.has-sub:focus-within>.sub-nav{display:flex}
.sub-nav a{display:block;padding:9px 12px;font-size:13px;font-weight:700;line-height:1.25;white-space:nowrap;border-left:2px solid transparent}
.sub-nav a small{display:block;margin-top:2px;font-family:var(--font-body);font-size:11px;font-weight:400;color:var(--text-muted)}
.sub-nav a:hover,.sub-nav a:focus{background:var(--fill);color:var(--primary);border-left-color:var(--primary)}
.sub-nav a:hover small,.sub-nav a:focus small{color:var(--text-secondary)}
.sub-nav-all{margin-top:5px;border-top:1px solid var(--line);padding-top:11px!important;color:var(--primary)}
@media(max-width:850px){
.nav-item{display:block}
.has-sub::after{display:none}
.has-sub>a::after{transform:rotate(45deg) translateY(-2px)}
.sub-nav{position:static;display:flex;min-width:0;margin:9px 0 4px 2px;padding:2px 0 2px 14px;border:0;border-left:2px solid var(--line);box-shadow:none;background:transparent;gap:0}
.sub-nav a{white-space:normal;padding:7px 0;font-size:13px;border-left:0}
.sub-nav a small{display:none}
.sub-nav a:hover,.sub-nav a:focus{background:transparent}
.sub-nav-all{padding-top:8px!important}
}

/* outils-rsj-nav [05b] : sous-menu dans la nav du builder (tiroir sous 1040 px) */
.calc fieldset.calc-row { display: block; }
.footer-title-next { margin-top: var(--sp-5); }
.site-nav .sub-nav a { padding: 9px 12px; }
@media (max-width: 1039px) {
  .site-nav .nav-item { display: block; }
  .site-nav .has-sub::after { display: none; }
  .site-nav .sub-nav { position: static; display: flex; min-width: 0; margin: 4px 0 4px 12px; padding: 2px 0 2px 14px; border: 0; border-left: 3px solid var(--secondary); box-shadow: none; background: transparent; }
  .site-nav .sub-nav a { white-space: normal; }
  .site-nav .sub-nav a small { display: none; }
}

/* ===== BLOC LARGEUR UNIFIÉE — toutes les pages à la largeur de la home ===== */
/*
 * Posé par 06a2-largeur-contenu. Les sélecteurs ci-dessous ont été RELEVÉS
 * dans les feuilles réellement chargées par le front, pas devinés : c'est la
 * correction du défaut d'origine, où une liste de classes supposées rendait
 * le bloc inerte sans que rien ne le signale.
 *
 * Largeur de référence relevée sur `.container` : 1160 px.
 *
 * `!important` est délibéré. Une contrainte peut être déclarée dans une
 * feuille chargée APRÈS celle-ci, ou plus bas dans ce même fichier par un
 * bloc appendu ultérieurement : à spécificité égale elle gagnerait, et le
 * bloc serait posé, validé, et sans effet.
 *
 * Les contrôles de formulaire, les images et les cartes sont épargnés.
 *
 * Ce qui suit la borne « relevé automatique : fin » est CONSERVÉ au rejeu :
 * c'est là que vivent les règles tranchées à la main. N'écris rien au-dessus.
 */

/* --- relevé automatique : début --- */
.lead{max-width:none!important}   /* styles.css : 62ch */
.section-head{max-width:none!important}   /* styles.css : 720px */
.page-hero-fiche .fiche-head{max-width:none!important}   /* styles.css : 860px */
.footer-about p{max-width:none!important}   /* styles.css : 46ch */
.source-list{max-width:none!important}   /* styles.css : 820px */

/* Grilles à deux colonnes relevées, NON collapsées d'office : une grille de
   cartes se collapserait à tort. À trancher au brief 06a2, puis à écrire
   SOUS la borne de fin ci-dessous. */
/*   .hero-grid { grid-template-columns: 1.05fr .95fr }  (styles.css) */
/* --- relevé automatique : fin --- */

/* Règles tranchées à la main, conservées au rejeu de 06a2. */
/* Règles tranchées à la main, conservées au rejeu de 06a2. */
.content-narrow{max-width:none!important}
.content-narrow select,.content-narrow input[type=number],.content-narrow input[type=text]{max-width:520px}
.article-layout{width:min(1140px,calc(100% - 40px));margin-inline:auto}
.article-body{max-width:72ch}
.article-layout{width:min(100% - 28px,1140px)}
.toc{background: var(--tint); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); margin: var(--sp-5) 0;}
.toc ol{margin: var(--sp-2) 0 0;}
.prose blockquote{margin: var(--sp-6) 0; padding: var(--sp-4) var(--sp-5); border-left: 6px solid var(--secondary); background: var(--secondary-soft); font-family: var(--font-head); font-size: 1.2rem;}
.prose blockquote p{margin: 0;}

/* ===== ENVELOPPE + OUVERTURE NORMÉE (couches 1 et 2 du gabarit) ===== */
.author-card{display:flex;gap:18px;align-items:flex-start;margin:0 0 22px;padding:20px 22px;background:var(--fill);border-left:3px solid var(--primary)}
.author-card .author-avatar{flex:0 0 auto;line-height:0}
.author-card .author-img{object-fit:cover}
.author-footer .author-card .author-img{width:88px;height:88px;object-fit:cover;border-radius:var(--radius-round, 50%)}
.author-footer .author-card .author-monogram{width:88px;height:88px;font-size:30px}
.author-name{margin:0;font-family:var(--font-heading);font-size:16px;font-weight:700;line-height:1.3}
.author-name a{color:var(--text-strong)}
.author-name a:hover{color:var(--primary)}
.author-job{display:block;margin-top:3px;font-size:11px;font-weight:400;text-transform:uppercase;letter-spacing:1.1px;color:var(--text-muted)}
.author-legit{margin:11px 0 0;font-size:14.5px;line-height:1.5;font-weight:600;color:var(--text-strong)}
.author-bio{margin:7px 0 0;font-size:13.5px;line-height:1.55;color:var(--text-secondary)}
.author-links{margin:10px 0 0;font-size:13px}
.author-links a{color:var(--primary);font-weight:700;border-bottom:1px solid currentColor}
.page-dates{display:flex;flex-wrap:wrap;gap:6px 20px;margin:0 0 22px;font-size:12px;color:var(--text-muted)}
.page-dates time{font-family:var(--font-mono);font-variant-numeric:tabular-nums;color:var(--text-secondary)}
.method-note{margin:0 0 26px;padding:17px 19px;background:var(--callout-bg);border:1px solid var(--callout-border);border-left:3px solid var(--primary)}
.method-note-title{margin:0 0 6px;font-family:var(--font-heading);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;color:var(--callout-text)}
.method-note p:last-child{margin:0;font-size:14px;line-height:1.6;color:var(--callout-text)}
.opening{margin:0 0 34px}
.opening .answer{margin:0;padding:22px 24px;background:var(--secondary);color:var(--white);font-family:var(--font-heading);font-size:clamp(17px,1.9vw,20px);line-height:1.45;letter-spacing:-.2px}
.essentials{margin:0;padding:20px 24px;background:var(--surface);border:1px solid var(--border);border-top:0}
.essentials-title{margin:0 0 10px;font-family:var(--font-heading);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;color:var(--text-muted)}
.essentials ul{margin:0;padding:0;list-style:none}
.essentials li{position:relative;padding:7px 0 7px 22px;font-size:15px;line-height:1.5;color:var(--text)}
.essentials li::before{content:"";position:absolute;left:0;top:15px;width:8px;height:2px;background:var(--primary)}
.scope{margin:0;padding:14px 24px;background:var(--fill);border:1px solid var(--border);border-top:0;font-size:13.5px;line-height:1.55;color:var(--text-secondary)}
.scope span{font-family:var(--font-heading);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.1px;color:var(--text-muted);margin-right:6px}
.scope a{color:var(--secondary);font-weight:700;border-bottom:1px solid currentColor}
.scope a:hover{color:var(--primary)}
.update-log{margin:0;padding:20px 22px;border-top:2px solid var(--secondary);background:var(--fill)}
.update-log-title{margin:0 0 9px;font-family:var(--font-heading);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;color:var(--text-muted)}
.update-log ul{margin:0;padding:0;list-style:none}
.update-log li{padding:6px 0;font-size:13.5px;line-height:1.5;color:var(--text-secondary);border-bottom:1px solid var(--border)}
.update-log li:last-child{border-bottom:0}
.update-log time{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-weight:500;color:var(--text-strong)}
@media(max-width:640px){.author-card{padding:16px}.opening .answer{padding:18px}.essentials,.scope{padding:16px 18px}}

/* Signature de tête — identité et dates sur une seule ligne. Le parcours de
   l'auteur n'est pas ici : il se lit en pied, via .author-footer. */
.author-byline{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 18px;margin:0 0 26px;padding-bottom:14px;border-bottom:1px solid var(--border,#D3CEC1);font-size:13px;color:var(--text-secondary,#4A554D)}
.byline-author a{color:var(--secondary,#3A4A3F);font-weight:700;border-bottom:1px solid currentColor}
.byline-author a:hover{color:var(--primary,#A65E2E)}
.author-byline .page-dates{margin:0;gap:6px 18px}

/* Pied d'article — la carte auteur complète, détachée du corps du texte. */
.author-footer{margin:38px 0 22px;border-top:2px solid var(--secondary,#3A4A3F)}
.author-footer .author-card{margin:0}

/* Signature dans le hero d'article (blog) : le hero est un aplat sombre, la
   signature doit y passer en blanc. Sans cette règle, elle hérite des couleurs
   pensées pour un fond clair et devient illisible (contraste ~1,1:1). */
.guide-hero .author-byline,
.guide-hero .author-byline .page-dates,
.guide-hero .byline-author a,
.guide-hero .page-dates time{color:#FFFFFF}
.guide-hero .author-byline{border-bottom-color:rgba(255,255,255,.28)}

/* ===== SOURCES — liens sortants cités près de l'affirmation ===== */
.source-note a[rel~="nofollow"]{color:var(--secondary);font-weight:600;border-bottom:1px solid var(--text-faint)}
.source-note a[rel~="nofollow"]:hover{color:var(--primary);border-bottom-color:var(--primary)}
.tool-table a[rel~="nofollow"]{font-weight:600;text-decoration:none;border-bottom:1px solid var(--text-faint)}
.tool-table a[rel~="nofollow"]:hover{color:var(--primary);border-bottom-color:var(--primary)}
.source-list{list-style:none;margin:0;padding:0;max-width:820px}
.source-list li{padding:10px 0;border-bottom:1px solid var(--line);font-size:14px}
.source-list li:last-child{border-bottom:0}
.source-list span{display:block;margin-top:2px;font-size:11px;color:var(--text-muted)}

/* rsj-enveloppe-tokens [06a] : le bloc ENVELOPPE attend des tokens que ce builder ne définit pas,
   et lit --secondary comme une couleur foncée, alors qu'ici --secondary est le surligneur. */
:root { --text: #1C2530; --text-strong: #0F1A2B; --text-secondary: #36414F; --text-muted: #4F5A68; --fill: #EDE8DC; --border: #D9D2C3; --surface: #FBF9F4; --white: #FFFFFF; --callout-bg: #FCF1C8; --callout-text: #4A3800; --callout-border: #F2C94C; --font-heading: var(--font-head); --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.byline-author a { color: var(--primary-dark); }
.byline-author a:hover { color: var(--primary); }
.opening .answer { background: var(--primary); color: #FFFFFF; }
.scope a { color: var(--primary-dark); }
.scope a:hover { color: var(--primary); }
