:root {
  --fond: #f7f3ec; --carte: #fffdf9; --texte: #1f1b16; --doux: #6b6157; --ligne: #e7ded1;
  --accent: #d9480f; --accent-doux: #fde7dc; --ok: #2f9e44; --ko: #e03131; --attente: #adb5bd;
  --ombre: 0 1px 2px rgba(60,40,20,.06), 0 8px 24px rgba(60,40,20,.06);
  --rayon: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #16130f; --carte: #211d18; --texte: #f3ede4; --doux: #b3a898; --ligne: #352f27;
    --accent: #ff8a4c; --accent-doux: #3a2418; --ombre: none;
  }
}
:root[data-theme="dark"] { --fond: #16130f; --carte: #211d18; --texte: #f3ede4; --doux: #b3a898; --ligne: #352f27; --accent: #ff8a4c; --accent-doux: #3a2418; --ombre: none; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 17px/1.6 Inter, system-ui, sans-serif; }
a { color: var(--accent); }
h1, h2 { font-family: Fraunces, Georgia, serif; line-height: 1.15; }

.haut { max-width: 860px; margin: 0 auto; padding: 16px; }
.bande { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.marque { font-weight: 600; color: var(--texte); text-decoration: none; font-size: 18px; }
.bouton-lien { font-size: 15px; font-weight: 500; text-decoration: none; border: 1px solid var(--ligne); background: var(--carte); padding: 8px 14px; border-radius: 999px; color: var(--texte); }
.intro h1 { font-size: clamp(30px, 6vw, 46px); margin: 36px 0 12px; }
.intro p { color: var(--doux); max-width: 58ch; margin: 0 0 20px; }

.statut { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); }
.statut-titre { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.statut ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.statut li { font-size: 14px; background: var(--fond); border-radius: 999px; padding: 4px 12px 4px 8px; display: flex; align-items: center; gap: 8px; }
.pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--attente); flex: none; }
.pastille[data-etat="ok"] { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.pastille[data-etat="ko"] { background: var(--ko); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ko) 20%, transparent); }

.sommaire { display: flex; gap: 8px; overflow-x: auto; padding: 20px 0 4px; scrollbar-width: none; }
.sommaire a { flex: none; text-decoration: none; color: var(--texte); background: var(--carte); border: 1px solid var(--ligne); border-radius: 999px; padding: 6px 14px; font-size: 15px; white-space: nowrap; }
.sommaire a:hover { border-color: var(--accent); }

.guide, .souci { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.guide section { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 8px 22px 18px; margin: 18px 0; box-shadow: var(--ombre); }
.guide h2 { font-size: 26px; margin: 18px 0 8px; }
.guide blockquote { margin: 14px 0; padding: 10px 14px; background: var(--accent-doux); border-radius: 12px; }
.guide blockquote p { margin: 0; }
.guide li { margin: 4px 0; }
.guide details { border: 1px solid var(--ligne); border-radius: 12px; margin: 10px 0; background: var(--fond); }
.guide details[open] { background: var(--carte); }
.guide summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "＋"; color: var(--accent); }
.guide details[open] summary::after { content: "－"; }
.guide details > div { padding: 0 16px 8px; }

.souci { padding-bottom: 32px; }
.souci h2 { font-size: 28px; margin: 34px 0 6px; }
.souci > p { color: var(--doux); margin-top: 0; }
form#form-souci { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 18px; display: grid; gap: 14px; box-shadow: var(--ombre); }
.rangee { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .rangee { grid-template-columns: 1fr; } }
label { display: grid; gap: 6px; font-size: 15px; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--ligne); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; cursor: pointer; }
form#form-souci button { justify-self: start; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 10px 22px; font-weight: 600; }
.piege { position: absolute; left: -9999px; }
.retour { margin: 0; font-weight: 500; }
.bas { text-align: center; color: var(--doux); font-size: 14px; padding: 24px 16px 96px; }

/* --- chatbot --- */
.chat-ouvrir { position: fixed; right: 16px; bottom: 16px; z-index: 10; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 11; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 32px)); background: var(--carte); border: 1px solid var(--ligne); border-radius: 20px; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; }
.chat[hidden] { display: none; }
.chat-tete { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--ligne); }
.chat-tete small { display: block; color: var(--doux); font-size: 12px; }
.chat-actions button { background: none; border: 0; color: var(--doux); font-size: 18px; padding: 4px 8px; }
.chat-fil { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bulle { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.bulle p { margin: 0 0 6px; } .bulle p:last-child { margin: 0; }
.bulle ol, .bulle ul { margin: 4px 0; padding-left: 20px; }
.bulle.bot { background: var(--fond); align-self: flex-start; border-bottom-left-radius: 4px; }
.bulle.moi { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bulle.erreur { background: color-mix(in srgb, var(--ko) 15%, transparent); }
.bulle.attente::after { content: "…"; animation: clignote 1s infinite; }
@keyframes clignote { 50% { opacity: .2; } }
.chat-idees { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.chat-idees button { font-size: 13px; background: var(--fond); border: 1px solid var(--ligne); color: var(--texte); border-radius: 999px; padding: 5px 10px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--ligne); }
.chat-form button { background: var(--accent); color: #fff; border: 0; border-radius: 10px; width: 44px; }
