/* Mayele — identité du lion : rail noir, salle ivoire, rouge pour agir. */
:root {
  --nuit: #000000;
  --nuit-2: #1f1f1f;
  --encre: #0d0d0d;
  --jour: #fcf6e4;
  --papier: #fffdf6;
  --soleil: #e30208; /* le rouge du logo */
  --ivoire: #fcf6e4;
  --aube: #e30208;
  --brume: #5f594c;
  --trait: #e2d9c0;
  --titre: "Montserrat", "Avenir Next", system-ui, sans-serif;
  --texte: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--jour); color: var(--encre); font: 400 17px/1.55 var(--texte); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #ff4a4a; outline-offset: 2px; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.app { display: grid; grid-template-columns: 290px 1fr; height: 100dvh; }

/* ——— Rail (nuit) ——— */
.rail { background: var(--nuit); color: #f5efde; padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.marque { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 4px; border-radius: 10px; }
.marque b { display: block; font: 800 21px/1 var(--titre); letter-spacing: 0.02em; text-transform: uppercase; }
.marque img { width: 48px; height: 48px; }
.marque small { display: block; font-size: 12.5px; color: #b5ae9c; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }
.nouveau { background: var(--soleil); color: var(--ivoire); border: 0; border-radius: 6px; padding: 12px 14px; font-weight: 600; text-align: left; }
.nouveau:hover { background: #b80106; }
.rail-titre { margin: 10px 4px 0; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #a39c8a; }
.liste { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.liste li { display: flex; align-items: center; border-radius: 10px; }
.liste li.active { background: var(--nuit-2); }
.liste li:hover { background: var(--nuit-2); }
.liste .ouvrir { flex: 1; min-width: 0; background: none; border: 0; color: #f5efde; text-align: left; padding: 9px 10px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liste .oter { background: none; border: 0; color: #a39c8a; padding: 6px 10px; font-size: 18px; line-height: 1; border-radius: 8px; }
.liste .oter:hover { color: #fff; }
.liste .vide { color: #a39c8a; font-size: 14px; padding: 6px 10px; }
.rail-note { margin: 0; font-size: 12.5px; color: #a39c8a; padding: 0 4px; }

/* ——— Salle (jour) ——— */
.salle { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.barre { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--trait); }
.barre-titre { margin: 0; flex: 1; min-width: 0; font: 700 17px/1.2 var(--titre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offre { font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ivoire); background: var(--soleil); padding: 4px 10px; border-radius: 3px; }
.menu { display: none; background: none; border: 0; padding: 8px; margin-left: -8px; border-radius: 8px; }
.menu span { display: block; width: 20px; height: 2.5px; background: var(--encre); border-radius: 2px; }
.menu span + span { margin-top: 4px; }

.fil { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 22px 12px; scroll-behavior: smooth; }
.fil > * { max-width: 760px; margin-inline: auto; }

.accueil { padding-top: clamp(8px, 7vh, 80px); }
.accueil-lion { width: 72px; height: 72px; margin: 0 0 18px; display: block; }
.accueil-sur { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--aube); }
.accueil h1 { margin: 0; font: 800 clamp(30px, 4.6vw, 52px)/1.06 var(--titre); letter-spacing: -0.025em; text-wrap: balance; }
.accueil-texte { margin: 20px 0 30px; max-width: 56ch; color: var(--brume); font-size: 18px; }
.amorces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.amorces button { background: var(--papier); border: 1px solid var(--trait); border-radius: 6px; padding: 14px 16px; text-align: left; font-size: 15.5px; line-height: 1.35; }
.amorces button:hover { border-color: var(--nuit); }

.message { margin-block: 0 22px; }
.message.moi { display: flex; justify-content: flex-end; }
.message.moi p { margin: 0; background: var(--nuit); color: #fff; padding: 11px 16px; border-radius: 18px 18px 4px 18px; max-width: 82%; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.elle { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.message.elle::before { content: ""; width: 28px; height: 28px; background: url(/icone.svg) center / contain no-repeat; }
.corps { min-width: 0; overflow-wrap: anywhere; }
.corps > :first-child { margin-top: 0; }
.corps > :last-child { margin-bottom: 0; }
.corps p { margin: 0 0 12px; }
.corps ul, .corps ol { margin: 0 0 12px; padding-left: 22px; }
.corps li { margin-bottom: 5px; }
.corps h3 { font: 700 19px/1.25 var(--titre); margin: 18px 0 8px; }
.corps code { background: #efe6cc; padding: 1px 5px; border-radius: 5px; font-size: 0.92em; }
.corps blockquote { margin: 0 0 12px; padding-left: 14px; border-left: 3px solid var(--soleil); color: var(--brume); }
.attente { color: var(--brume); font-style: italic; }
.erreur { color: #a11d1d; background: #ffe4e0; border-radius: 10px; padding: 10px 14px; }

.saisie { display: flex; align-items: flex-end; gap: 10px; margin: 0 auto; width: min(760px, calc(100% - 44px)); background: var(--papier); border: 1.5px solid var(--trait); border-radius: 22px; padding: 8px 8px 8px 18px; }
.saisie:focus-within { border-color: var(--nuit); }
.saisie textarea { flex: 1; border: 0; outline: 0; resize: none; background: none; padding: 9px 0; max-height: 180px; line-height: 1.45; }
.envoyer { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--soleil); color: var(--ivoire); display: grid; place-items: center; }
.envoyer:hover { background: #b80106; }
.envoyer:disabled { background: var(--trait); color: var(--brume); cursor: default; }
.pied { margin: 8px 0 max(12px, env(safe-area-inset-bottom)); text-align: center; font-size: 12.5px; color: var(--brume); padding-inline: 16px; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 20; transform: translateX(-100%); transition: transform 0.2s ease; }
  .rail.ouvert { transform: none; }
  .voile { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 10; }
  .menu { display: block; }
  .barre { padding: 12px 16px; }
  .fil { padding: 20px 16px 10px; }
  .saisie { width: calc(100% - 32px); }
  .amorces { grid-template-columns: 1fr; }
  .message.moi p { max-width: 90%; }
}
@media (prefers-reduced-motion: reduce) {
  .rail { transition: none; }
  .fil { scroll-behavior: auto; }
}
