/* app.ceos.fr — charte Céos. Une seule feuille, aucune police ni ressource externe. */
:root {
  --marron: #2F1B15; --bleu: #75BEE9; --bleu-moyen: #AADDFE; --bleu-clair: #D8F1FD; --orange: #E65930;
  --fond: #FAFAF7; --carte: #FFFFFF; --panneau: #FAF7F2; --panneau-2: #F3EDE4;
  --gris: #6B5A52; --gris-clair: #8A7D6E; --trait: #E7E1DC; --trait-fort: #D6CBBB;
  --ok: #2F7D52; --ok-fond: #E6F1EA; --alerte-fond: #FBE3DA; --alerte: #B43F25;
  --ombre: 0 1px 2px rgba(47, 27, 21, .06), 0 8px 24px rgba(47, 27, 21, .06);
  --sbw: 256px; --r: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--marron);
  font: 16px/1.55 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--marron); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, label.burger:focus-visible {
  outline: 3px solid var(--bleu); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 19px; line-height: 1.3; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
ol, ul { margin: 0 0 12px; padding-left: 22px; }
li { margin: 4px 0; }
img { max-width: 100%; }
.muted { color: var(--gris); font-size: 14px; }
.lead { font-size: 18px; color: var(--gris); max-width: 62ch; }
.hidden { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- composants ---------- */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--r); padding: 20px; margin: 16px 0; }
.carte.accent { border-color: var(--bleu); background: linear-gradient(0deg, #fff, #F4FBFF); }
.carte.danger { border-color: #EFC4B6; }
.carte > :last-child { margin-bottom: 0; }
.carte > h3:first-child { margin-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--marron); color: #fff;
  border: 1px solid var(--marron); border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; min-height: 44px; }
.btn:hover { background: #46291F; }
.btn.sec { background: var(--bleu-clair); border-color: var(--bleu-clair); color: var(--marron); }
.btn.sec:hover { background: var(--bleu-moyen); border-color: var(--bleu-moyen); }
.btn.contour { background: #fff; color: var(--marron); border-color: var(--trait-fort); }
.btn.contour:hover { background: var(--panneau); }
.btn.rouge { background: var(--alerte); border-color: var(--alerte); }
.btn.petit { padding: 6px 12px; font-size: 14px; min-height: 36px; }
.btn.large { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
form.inline { display: inline; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--bleu-clair); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag.ok { background: var(--ok-fond); color: var(--ok); }
.tag.alerte { background: var(--alerte-fond); color: var(--alerte); }
.tag.gris { background: var(--panneau-2); color: var(--gris); }
.note { background: var(--bleu-clair); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 15px; }
.note.alerte { background: var(--alerte-fond); color: #7A2A17; }
.note.ok { background: var(--ok-fond); color: #1F5637; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; background: var(--bleu-clair);
  padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
pre { background: #2B211A; color: #F6EFE6; border-radius: 10px; padding: 14px 16px; margin: 0 0 12px; overflow-x: auto;
  font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
pre code { background: none; padding: 0; color: inherit; overflow-wrap: normal; }
.copie { display: flex; gap: 8px; align-items: stretch; margin: 8px 0 12px; }
.copie .url { flex: 1; min-width: 0; display: flex; align-items: center; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px; background: var(--bleu-clair); padding: 10px 12px; border-radius: 10px; overflow-wrap: anywhere; }
.copie .btn { flex: none; }
.bloc-code { position: relative; }
.bloc-code .btn { position: absolute; top: 8px; right: 8px; background: #46362B; border-color: #5C4A3D; color: #fff; }
input[type=email], input[type=text], input[type=password] { font: inherit; padding: 10px 12px; border: 1px solid var(--trait-fort);
  border-radius: 10px; width: 100%; max-width: 380px; min-height: 44px; background: #fff; color: var(--marron); }
label.champ { display: block; font-weight: 600; font-size: 14px; margin: 0 0 12px; }
label.champ input { display: block; margin-top: 4px; font-weight: 400; }
label.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 12px 0; }
label.consent input { margin-top: 4px; flex: none; width: 18px; height: 18px; }
.ligne-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ligne-form input { flex: 1 1 220px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px 6px; border-bottom: 1px solid var(--trait); text-align: left; font-size: 15px; vertical-align: middle; }
th { font-size: 13px; color: var(--gris); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.fin, th.fin { text-align: right; white-space: nowrap; }
.prix { font-size: 28px; font-weight: 700; margin: 0 0 4px; }
details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details[open] > summary { margin-bottom: 10px; }

/* tuiles et liste de contrôle */
.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.tuile { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--r); padding: 16px; text-decoration: none; display: block; }
a.tuile:hover { border-color: var(--trait-fort); box-shadow: var(--ombre); }
.tuile .k { font-size: 13px; color: var(--gris); font-weight: 600; }
.tuile .v { font-size: 22px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.tuile .s { font-size: 13px; color: var(--gris); margin-top: 2px; }
.etapes { list-style: none; padding: 0; margin: 0; }
.etapes li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--trait); margin: 0; }
.etapes li:last-child { border-bottom: 0; }
.etapes .puce { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px;
  font-weight: 700; border: 1.5px solid var(--trait-fort); background: #fff; color: var(--gris); }
.etapes li.fait .puce { background: var(--ok); border-color: var(--ok); color: #fff; }
.etapes li.suivant .puce { background: var(--marron); border-color: var(--marron); color: #fff; }
.etapes .txt { flex: 1; min-width: 0; }
.etapes .txt b { display: block; }
.etapes li.fait .txt b { color: var(--gris); font-weight: 600; }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vignette { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--r); padding: 16px; text-decoration: none;
  display: flex; flex-direction: column; gap: 4px; }
a.vignette:hover { border-color: var(--trait-fort); box-shadow: var(--ombre); }
.vignette b { font-size: 16px; }
.vignette span { font-size: 14px; color: var(--gris); }
ol.pas { counter-reset: pas; list-style: none; padding: 0; }
ol.pas > li { counter-increment: pas; position: relative; padding: 0 0 14px 40px; margin: 0; }
ol.pas > li::before { content: counter(pas); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--marron); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
ol.pas > li > :last-child { margin-bottom: 0; }
.fil { font-size: 14px; color: var(--gris); margin: 0 0 12px; }
.fil a { color: var(--gris); }

/* ---------- coquille de l'application : menu à gauche ---------- */
.shell { display: grid; grid-template-columns: var(--sbw) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--panneau); border-right: 1px solid var(--trait);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; padding: 6px 10px 16px; text-decoration: none; }
.brand img { height: 18px; width: auto; display: block; }
.espace { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; line-height: 1.3; }
.espace b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.espace small { display: block; font-size: 12.5px; color: var(--gris); margin-top: 2px; }
.espace small.alerte { color: var(--alerte); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--gris);
  text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap; }
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--panneau-2); color: var(--marron); }
.nav a.on { background: var(--bleu-clair); color: var(--marron); font-weight: 700; }
.nav .sep { height: 1px; background: var(--trait); margin: 10px 8px; }
.sidefoot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--trait); font-size: 13px; color: var(--gris); }
.sidefoot .mail { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 8px; }
.topbar { display: none; }
.scrim { display: none; }
.mainwrap { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.content { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 32px 32px 48px; }
.pagehead { margin-bottom: 20px; }
.pagehead p { color: var(--gris); margin: 0; max-width: 68ch; }

/* ---------- pages publiques ---------- */
body.public { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.public > main { flex: 1; width: 100%; }
.pubhead { background: rgba(250, 250, 247, .92); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 20; }
.pubhead .in { max-width: 1080px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.pubhead .logo img { height: 20px; width: auto; display: block; }
.pubhead nav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 15px; }
.pubhead nav a { text-decoration: none; font-weight: 600; }
.pubhead nav a.lien:hover { text-decoration: underline; }
.pub { max-width: 1080px; margin: 0 auto; padding: 40px 24px 56px; }
.pub.etroit { max-width: 760px; }
.pub.mini { max-width: 480px; }
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: 42px; line-height: 1.12; max-width: 20ch; margin-bottom: 16px; letter-spacing: -.02em; }
.hero .lead { font-size: 19px; }
.section { margin-top: 48px; }
.section > h2 { font-size: 24px; margin-bottom: 16px; }
.pied { border-top: 1px solid var(--trait); background: var(--panneau); }
.pied .in { max-width: 1080px; margin: 0 auto; padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center;
  font-size: 14px; color: var(--gris); }
.pied a { color: var(--gris); }
.pied .raison { margin-left: auto; }
.mainwrap .pied .in { max-width: 960px; padding: 16px 32px; }
.prose h2 { margin-top: 32px; }
.prose h3 { margin-top: 20px; }
.prose table { margin-bottom: 16px; }
.ou { display: flex; align-items: center; gap: 12px; color: var(--gris); font-size: 13px; margin: 16px 0; }
.ou::before, .ou::after { content: ""; flex: 1; height: 1px; background: var(--trait); }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .shell { display: block; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: var(--panneau);
    border-bottom: 1px solid var(--trait); padding: 8px 16px; min-height: 56px; }
  .topbar img { height: 17px; width: auto; display: block; }
  .topbar .titre { margin-left: auto; font-size: 14px; color: var(--gris); font-weight: 600; }
  label.burger { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--trait-fort); background: #fff;
    border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 40px; }
  label.burger svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; max-width: 86vw; transform: translateX(-105%);
    transition: transform .2s; box-shadow: 0 12px 48px rgba(47, 27, 21, .18); }
  .menu-toggle:checked ~ .sidebar { transform: none; }
  .menu-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(23, 18, 14, .38); z-index: 25; }
  .menu-toggle:focus-visible ~ .topbar label.burger { outline: 3px solid var(--bleu); outline-offset: 2px; }
  .mainwrap { min-height: calc(100dvh - 56px); }
  .content { padding: 20px 16px 40px; }
  .mainwrap .pied .in { padding: 16px; }
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 32px; }
  .pub { padding: 24px 16px 40px; }
  .pubhead .in { padding: 10px 16px; gap: 12px; }
  .pubhead nav { gap: 12px; }
  .pubhead nav a.lien.opt { display: none; }
  .pied .raison { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .grille-2, .grille-3 { grid-template-columns: minmax(0, 1fr); }
  .copie { flex-direction: column; }
  .hero h1 { font-size: 28px; }
  td, th { font-size: 14px; padding: 9px 4px; }
  /* tableaux de l'application : une ligne devient un bloc, le bouton reste visible */
  table.pile, table.pile tbody { display: block; }
  table.pile tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--trait); }
  table.pile tr:last-child { border-bottom: 0; }
  table.pile tr.entete { display: none; }
  table.pile td { border: 0; padding: 0; }
  table.pile td:first-child { flex: 1 1 100%; overflow-wrap: anywhere; }
  table.pile td.fin { margin-left: auto; white-space: normal; text-align: right; }
  table.pile td:empty { display: none; }
  .carte { padding: 16px; }
  .pubhead nav a.lien { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
