/* Charte de verslepositif.fr : crème, vert d'eau, DM Sans + Cormorant
   Garamond (polices hébergées ici, la CSP n'autorise que 'self'). Clair
   uniquement, comme le site. */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300 600; font-display: swap; src: url(fonts/DMSans.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 500; font-display: swap; src: url(fonts/CormorantGaramond.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 300 400; font-display: swap; src: url(fonts/CormorantGaramond-italic.woff2) format("woff2"); }
:root {
  --fond: #f7f6f2; --creme: #fffcf4; --carte: #ffffff; --menthe: #eafaf6; --ligne: #e2e4dc;
  --texte: #1e2b27; --texte-2: #5c6b64; --teal: #00a897; --teal-2: #00786c; --sable: #c4a882;
  --rouge: #b4483a; --vert: #00786c;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --gutter: 16px; --largeur: 760px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--fond); }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--fond); color: var(--texte);
  font: 400 16px/1.6 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--teal-2); }
button { font: inherit; }
.cache { display: none !important; }

/* En-tête */
.entete { position: sticky; top: 0; z-index: 2; background: rgba(255, 252, 244, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ligne); }
.entete-int { max-width: var(--largeur); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 12px; }
.marque { display: inline-flex; align-items: center; gap: 10px; font: 500 21px/1 var(--serif); color: var(--texte); }
.logo { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.logo.grand { width: 72px; height: 72px; margin-bottom: 14px; }
.statut { flex: 1; font-size: 13px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statut.actif::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-right: 8px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.lien-site { font-size: 13px; font-weight: 500; text-decoration: none; color: var(--teal-2); border: 1px solid currentColor; border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.lien-site:hover { background: var(--teal); border-color: var(--teal); color: #fff; }

/* Fil */
.fil { flex: 1; width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 20px var(--gutter) 24px; display: flex; flex-direction: column; gap: 18px; }
.accueil { color: var(--teal-2); text-align: center; margin: 48px auto; max-width: 30em; font: italic 300 24px/1.35 var(--serif); }
.tour { max-width: 100%; }
.tour.utilisateur { align-self: flex-end; max-width: 88%; }
.bulle { background: var(--teal); color: #fff; border: 0; border-radius: 16px 16px 4px 16px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tour.assistant { align-self: stretch; padding-left: 18px; border-left: 2px solid var(--teal); }
.contenu { overflow-wrap: anywhere; }
.contenu > :first-child { margin-top: 0; }
.contenu > :last-child { margin-bottom: 0; }
.contenu p { margin: 0 0 .8em; }
.contenu h1, .contenu h2, .contenu h3 { font: 500 1.4em/1.2 var(--serif); margin: 1em 0 .4em; color: var(--teal-2); }
.contenu ul, .contenu ol { padding-left: 1.4em; margin: 0 0 .8em; }
.contenu li { margin: .2em 0; }
.contenu code { font: 13.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--menthe); padding: 1px 5px; border-radius: 4px; }
.contenu pre { background: var(--creme); border: 1px solid var(--ligne); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 .8em; }
.contenu pre code { background: none; padding: 0; }
.contenu strong { color: var(--texte); font-weight: 600; }
.erreur { color: var(--rouge); margin: .6em 0 0; font-size: 14px; }

/* Actions (outils) */
.actions { margin: 0 0 8px; font-size: 13px; color: var(--texte-2); }
.actions summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.actions summary::-webkit-details-marker { display: none; }
.actions summary::after { content: "▾"; opacity: .6; }
.actions[open] summary::after { content: "▴"; }
.actions.fini summary::after { content: "▸"; }
.actions.fini[open] summary::after { content: "▾"; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--menthe); border-top-color: var(--teal); animation: tourne .9s linear infinite; }
.actions.fini .spin { display: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
.actions ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.actions li { display: flex; gap: 8px; align-items: baseline; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.actions li .verbe { color: var(--teal-2); flex: none; }
.actions li.rate .verbe { color: var(--rouge); }
.actions li.ok .verbe { color: var(--teal-2); }
.separateur { display: flex; align-items: center; gap: 12px; color: var(--texte-2); font-size: 13px; margin: 8px 0; }
.separateur::before, .separateur::after { content: ""; flex: 1; border-top: 1px solid var(--ligne); }
.tour.assistant.erreur-tour { border-left-color: var(--rouge); }

/* Composeur */
.composeur { position: sticky; bottom: 0; background: linear-gradient(to top, var(--fond) 70%, rgba(247, 246, 242, 0)); padding: 8px var(--gutter) calc(10px + env(safe-area-inset-bottom)); }
.composeur-int { max-width: var(--largeur); margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; background: var(--carte); border: 1px solid var(--ligne); border-radius: 26px; box-shadow: 0 6px 24px rgba(30, 43, 39, .07); padding: 8px 8px 8px 16px; }
.composeur-int:focus-within { border-color: var(--teal); }
textarea { flex: 1; background: none; border: 0; color: var(--texte); font: inherit; resize: none; max-height: 40dvh; padding: 6px 0; outline: none; }
textarea::placeholder { color: var(--texte-2); opacity: .78; }
#envoyer, #stop { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; }
#envoyer { background: var(--teal); color: #fff; }
#envoyer:hover:not(:disabled) { background: var(--teal-2); }
#envoyer:disabled { opacity: .35; cursor: default; }
#stop { background: var(--carte); color: var(--rouge); border: 1px solid var(--ligne); }
#envoyer:focus-visible, #stop:focus-visible, .lien:focus-visible, .actions summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.pied { max-width: var(--largeur); margin: 8px auto 0; font-size: 12.5px; color: var(--texte-2); display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.pied #attente { margin-right: auto; }
.lien { background: none; border: 0; padding: 0; color: var(--texte-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lien:hover { color: var(--teal-2); }

/* Connexion */
.page-connexion { justify-content: center; align-items: center; padding: var(--gutter); background: radial-gradient(ellipse at 80% 0%, var(--menthe), var(--fond) 60%); }
.carte { width: 100%; max-width: 360px; text-align: center; background: var(--carte); border: 1px solid var(--ligne); border-radius: 20px; padding: 36px 28px; box-shadow: 0 18px 50px rgba(30, 43, 39, .08); }
.carte h1 { font: 400 32px/1.1 var(--serif); color: var(--teal); margin: 0; }
.sous-titre { color: var(--teal-2); margin: 6px 0 26px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.carte label { display: block; text-align: left; font-size: 13px; color: var(--texte-2); margin-bottom: 6px; }
.carte input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--ligne); background: var(--creme); color: var(--texte); font: inherit; margin-bottom: 14px; }
.carte input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
.carte button { width: 100%; padding: 13px; border-radius: 999px; border: 0; background: var(--teal); color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px rgba(0, 168, 151, .25); }
.carte button:hover { background: var(--teal-2); }
.carte .erreur { margin: 0 0 14px; }

@media (prefers-reduced-motion: reduce) { .spin, .statut.actif::before { animation: none; } }
