  :root {
    --field: #5B777A;       /* vert champ – couleur de marque */
    --field-soft: #E6ECE2;
    --wheat: #B88A2E;       /* blé – accent des numéros d'article */
    --paper: #F7F8F5;
    --surface: #FFFFFF;
    --ink: #1C221E;
    --muted: #5B645D;
    --rule: #DCE1D8;

    --sans: "Public Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

    --measure: 68ch;
    --radius: 6px;

    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --field: #9DBE8F;
      --field-soft: #243124;
      --wheat: #D9B25E;
      --paper: #141814;
      --surface: #1B201B;
      --ink: #E7EBE4;
      --muted: #A2AB9F;
      --rule: #2F372E;
    }
  }
  :root[data-theme="dark"] {
    --field: #9DBE8F;
    --field-soft: #243124;
    --wheat: #D9B25E;
    --paper: #141814;
    --surface: #1B201B;
    --ink: #E7EBE4;
    --muted: #A2AB9F;
    --rule: #2F372E;
  }

  *, *::before, *::after { box-sizing: inherit; }
  html { scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 1.5rem); }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  a { color: var(--field); text-underline-offset: 3px; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: 2px solid var(--wheat); outline-offset: 3px; border-radius: 2px; }

  .skip {
    position: absolute; left: 1rem; top: -3rem;
    background: var(--field); color: var(--paper);
    padding: .5rem .9rem; font-family: var(--sans); font-size: .9rem;
    border-radius: var(--radius); z-index: 10; text-decoration: none;
  }
  .skip:focus { top: calc(env(safe-area-inset-top, 0px) + 1rem); }

  /* ---------- En-tête ---------- */
  .masthead {
    background: var(--field-soft);
    color: var(--field);
  }

  .img-head {
    width: 15%;
  }

  :root[data-theme="dark"] .masthead { background: #1F2B1D; color: var(--ink); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .masthead { background: #1F2B1D; color: var(--ink); }
  }
  .masthead-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    max-width: 76rem; 
    margin: 0 auto;
    padding: 2.25rem 1.5rem 3rem;
  }
  .brand {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    font-family: var(--sans); font-size: .95rem; font-weight: 600;
    margin-bottom: 3rem;
  }
  .brand-mark { display: flex; align-items: center; gap: .6rem; }
  .brand-mark svg { flex: none; }
  .actions { display: flex; gap: .5rem; }
  .btn {
    font-family: var(--sans); font-size: .85rem; font-weight: 500;
    color: inherit; background: transparent;
    border: 1px solid currentColor; border-radius: 999px;
    padding: .4rem .95rem; cursor: pointer; opacity: .9;
  }
  .btn:hover { opacity: 1; background: rgba(255,255,255,.08); }

  .masthead h1 {
    font-family: var(--sans);
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 3.75rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    max-width: 18ch;
  }
  .masthead .lede {
    font-size: 1.15rem; line-height: 1.6;
    max-width: 60ch; margin: 0; opacity: .88;
  }

  /* ---------- Mise en page ---------- */
  .layout {
    max-width: 76rem; margin: 0 auto;
    padding: 0 1.5rem 5rem;
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 4rem;
  }

  /* Sommaire */
  .toc {
    position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1.5rem);
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding-top: 3rem;
    font-family: var(--sans);
  }
  .toc h2 {
    font-size: .95rem; font-weight: 600; margin: 0 0 .75rem; color: var(--muted);
  }
  .toc ol { list-style: none; margin: 0; padding: 0; }
  .toc a {
    display: grid; grid-template-columns: 1.6rem 1fr; gap: .25rem;
    padding: .35rem .6rem .35rem .75rem;
    border-left: 2px solid var(--rule);
    color: var(--muted); text-decoration: none;
    font-size: .875rem; line-height: 1.35;
  }
  .toc a span { font-variant-numeric: tabular-nums; }
  .toc a:hover { color: var(--ink); }
  .toc a[aria-current="true"] {
    color: var(--field); border-left-color: var(--field); font-weight: 600;
  }

  .toc-mobile { display: none; }

  /* Contenu */
  main { padding-top: 3rem; min-width: 0; }

  .preamble {
    max-width: var(--measure);
    font-size: 1.125rem;
    border-left: 3px solid var(--wheat);
    padding: .25rem 0 .25rem 1.25rem;
    margin: 0 0 3.5rem;
  }
  .preamble p { margin: 0; }

  .article {
    position: relative;
    max-width: var(--measure);
    padding-top: 2.5rem;
    margin-top: 2.5rem;
    border-top: 1px solid var(--rule);
  }
  .article:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

  .article-head {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    align-items: baseline;
    margin-bottom: 1.25rem;
  }
  .article-num {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 2.6rem;
    line-height: 1;
    color: var(--wheat);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
  }
  .article h2 {
    font-family: var(--sans);
    font-weight: 650;
    font-size: 1.45rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0;
  }
  .article h2 small {
    display: block; font-size: .8rem; font-weight: 500; color: var(--muted);
    letter-spacing: 0; margin-bottom: .15rem;
  }
  .article > p, .article > ul, .article > dl, .article > .clauses, .article > h3 {
    margin-left: 3.5rem;
  }
  .article p { margin: 0 0 1rem; }
  .article h3 {
    font-family: var(--sans); font-size: 1.05rem; font-weight: 600;
    margin-top: 1.75rem; margin-bottom: .5rem;
  }

  /* Définitions */
  .defs { margin: 0 0 1rem; }
  .defs div {
    padding: .85rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .defs div:first-child { border-top: 1px solid var(--rule); }
  .defs dt {
    font-family: var(--sans); font-weight: 600; font-size: .95rem; color: var(--field);
    margin-bottom: .2rem;
  }
  .defs dd { margin: 0; }

  /* Clauses numérotées (5.1, 6.1…) */
  .clauses { list-style: none; padding: 0; margin-bottom: 1rem; }
  .clauses > li {
    display: grid; grid-template-columns: 3rem 1fr; gap: .5rem;
    padding: .6rem 0;
  }
  .clauses > li + li { border-top: 1px dashed var(--rule); }
  .clause-num {
    font-family: var(--sans); font-weight: 600; font-size: .9rem;
    color: var(--muted); font-variant-numeric: tabular-nums;
    padding-top: .15rem;
  }
  .clauses p:last-child { margin-bottom: 0; }

  ul.dash { padding-left: 1.2rem; margin-top: 0; }
  ul.dash li { margin-bottom: .35rem; }
  ul.dash li::marker { content: "–  "; color: var(--muted); }

  .callout {
    background: var(--field-soft);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0 1.25rem 3.5rem;
    font-family: var(--sans);
    font-size: .95rem; line-height: 1.6;
  }
  .callout strong { display: block; margin-bottom: .25rem; }
  .callout a { font-weight: 600; }

  .amount { white-space: nowrap; font-weight: 600; }

  .foot {
    max-width: var(--measure);
    margin-top: 4rem; padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    font-family: var(--sans); font-size: .85rem; color: var(--muted);
  }

  .to-top {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 1.25rem);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  z-index: 20;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--field);
  color: var(--paper);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
  .to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
  .to-top svg { width: 1.4rem; height: 1.4rem; }

  /* ---------- Responsive ---------- */
  @media (max-width: 960px) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .toc { display: none; }
    .toc-mobile {
      display: block; margin-top: 1.5rem;
      font-family: var(--sans);
      background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
    }
    .toc-mobile summary {
      padding: .85rem 1rem; cursor: pointer; font-weight: 600; font-size: .95rem; color: #2F4A2B;
    }
    .toc-mobile ol { margin: 0; padding: 0 1rem 1rem 2.4rem; font-size: .9rem; }
    .toc-mobile li { padding: .2rem 0; }
    main { padding-top: 2rem; }
  }
  @media (max-width: 600px) {
    body { font-size: 1rem; }
    .masthead-inner { padding: 1.5rem 1.25rem 2.25rem; }
    .brand { margin-bottom: 2rem; }
    .layout { padding: 0 1.25rem 4rem; }
    .article-head { grid-template-columns: 1fr; gap: .35rem; }
    .article-num { font-size: 2rem; }
    .article > p, .article > ul, .article > dl, .article > .clauses, .article > h3, .callout { margin-left: 0; }
    .clauses > li { grid-template-columns: 2.6rem 1fr; }
    .btn-print { display: none; }
    .masthead h1 {max-width: fit-content;}
    .toc-mobile ol {color: #2F4A2B;;}
    .masthead-inner {flex-direction: column;align-items: center;}
    .img-head {width: 35%;}
  }

  /* ---------- Impression ---------- */
  @media print {
    :root { --paper: #fff; --ink: #000; --muted: #444; --rule: #bbb; --field: #000; --wheat: #555; --field-soft: #f2f2f2; }
    body { font-size: 10.5pt; line-height: 1.5; }
    .masthead { background: none !important; color: #000 !important; border-bottom: 2px solid #000; }
    .masthead-inner { padding: 0 0 1rem; }
    .actions, .toc, .toc-mobile, .skip, .to-top { display: none !important; }
    .layout { display: block; padding: 0; }
    main { padding-top: 1rem; }
    .article { max-width: none; break-inside: auto; }
    .article-head { break-after: avoid; }
    .clauses > li { break-inside: avoid; }
    a { color: #000; text-decoration: none; }
  }