/* kira : luxe clair, sobre. Règles de lecture de Samuel (guide BDA 2023) : Lexend, interligne 1,5, lettres espacées,
   fond crème jamais blanc, encre jamais noire, ni rouge ni vert, pas d'italique, pas de souligné, pas de majuscules en continu. */

@font-face { font-family: "Lexend"; src: url("/polices/lexend.woff2") format("woff2"); font-weight: 300 600; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/polices/cormorant.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root, :root[data-palette="ivoire"] {
  --fond: #F6F1E7; --surface: #FCF9F3; --surface-2: #EFE8DB; --bord: #DDD5C7; --bord-fort: #C9BEAB;
  --encre: #1C1917; --encre-2: #44403C; --attenue: #6B6259;
  --accent: #A16207; --accent-texte: #8A5306; --bouton: #8A5306; --sur-bouton: #FCF9F3; --accent-doux: #F1E4C8;
  --signal: #1E3A8A; --signal-doux: #E3E8F4; --ombre: 0 1px 2px rgba(60, 45, 20, .06), 0 8px 24px rgba(60, 45, 20, .05);
  --barre: rgba(252, 249, 243, .9); color-scheme: light;
}
:root[data-palette="perle"] {
  --fond: #F3F1EC; --surface: #FBFAF7; --surface-2: #E9E6DF; --bord: #DAD6CD; --bord-fort: #C2BDB2;
  --encre: #1E293B; --encre-2: #1E3A8A; --attenue: #5B6475; --accent: #A16207; --accent-texte: #8A5306; --bouton: #1E3A8A;
  --sur-bouton: #FBFAF7; --accent-doux: #EFE5CF; --signal: #1E3A8A; --signal-doux: #E2E6F0; --barre: rgba(251, 250, 247, .9);
}
:root[data-palette="sable"] {
  --fond: #F8F1E3; --surface: #FFFAF0; --surface-2: #F0E6D2; --bord: #E2D5BD; --bord-fort: #CDBB9C;
  --encre: #292524; --encre-2: #78350F; --attenue: #6E6253; --accent: #92400E; --accent-texte: #92400E; --bouton: #78350F;
  --sur-bouton: #FFFAF0; --accent-doux: #F3E2C6; --signal: #1E3A8A; --signal-doux: #E4E7EF; --barre: rgba(255, 250, 240, .9);
}
:root[data-theme="sombre"] {
  --fond: #1A1714; --surface: #25211C; --surface-2: #2F2A24; --bord: #3A342C; --bord-fort: #51493E;
  --encre: #F2EBDD; --encre-2: #E0D5C1; --attenue: #B3A792; --accent: #D4A64A; --accent-texte: #D9B062; --bouton: #D4A64A;
  --sur-bouton: #1A1714; --accent-doux: #3A3020; --signal: #A8BFEF; --signal-doux: #263044;
  --ombre: 0 1px 2px rgba(0, 0, 0, .3); --barre: rgba(37, 33, 28, .92); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --fond: #1A1714; --surface: #25211C; --surface-2: #2F2A24; --bord: #3A342C; --bord-fort: #51493E;
    --encre: #F2EBDD; --encre-2: #E0D5C1; --attenue: #B3A792; --accent: #D4A64A; --accent-texte: #D9B062; --bouton: #D4A64A;
    --sur-bouton: #1A1714; --accent-doux: #3A3020; --signal: #A8BFEF; --signal-doux: #263044;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3); --barre: rgba(37, 33, 28, .92); color-scheme: dark;
  }
}

:root {
  --police: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titres: var(--police); --poids-titres: 300;
  --rayon: 14px; --rayon-petit: 10px;
  --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
}
:root[data-titres="cormorant"] { --police-titres: "Cormorant", Georgia, serif; --poids-titres: 500; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre); font-family: var(--police); font-weight: 400;
  font-size: 1.0625rem; line-height: 1.5; letter-spacing: .02em; word-spacing: .08em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
em, i, cite, dfn, var, address { font-style: normal; font-weight: 600; }
u, ins { text-decoration: none; }
a { color: var(--accent-texte); text-decoration: none; font-weight: 500; }
a:hover { color: var(--encre); }
strong, b { font-weight: 600; }
h1, h2, h3, h4 { font-family: var(--police-titres); font-weight: var(--poids-titres); line-height: 1.25; margin: 0; letter-spacing: .01em; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
svg.ic { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- structure ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.coquille { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.lateral { display: none; }
.contenu { padding: calc(var(--haut) + 18px) 16px calc(var(--bas) + 96px); max-width: 920px; width: 100%; margin: 0 auto; }
.entete { margin: 4px 0 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.entete .sur { color: var(--accent-texte); font-size: .875rem; font-weight: 500; letter-spacing: .06em; margin-bottom: 4px; display: block; }
.entete h1 { font-size: 2rem; }
:root[data-titres="cormorant"] .entete h1 { font-size: 2.35rem; }
.entete .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.retour { display: inline-flex; align-items: center; gap: 6px; color: var(--attenue); font-size: .9375rem; margin-bottom: 10px; background: none; border: 0; padding: 4px 0; cursor: pointer; }

.barre-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--barre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--bord); padding: 6px 4px calc(var(--bas) + 6px);
}
.barre-bas a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--attenue); font-size: .75rem; font-weight: 400; position: relative; }
.barre-bas a svg { width: 24px; height: 24px; }
.barre-bas a.actif { color: var(--accent-texte); font-weight: 500; }
.barre-bas a.actif::after { content: ""; position: absolute; top: -6px; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }

@media (min-width: 900px) {
  .coquille { grid-template-columns: 248px 1fr; }
  .barre-bas { display: none; }
  .lateral {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 28px 16px; border-right: 1px solid var(--bord); background: var(--surface);
  }
  .lateral .marque { margin: 0 10px 26px; }
  .lateral a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--rayon-petit); color: var(--encre-2); font-weight: 400; }
  .lateral a:hover { background: var(--surface-2); color: var(--encre); }
  .lateral a.actif { background: var(--accent-doux); color: var(--encre); font-weight: 500; }
  .lateral a.actif svg { color: var(--accent-texte); }
  .lateral .sep { height: 1px; background: var(--bord); margin: 12px 10px; }
  .contenu { padding: 40px 40px 60px; }
  .entete h1 { font-size: 2.4rem; }
}

.marque { font-family: var(--police); font-weight: 300; font-size: 1.6rem; letter-spacing: .22em; color: var(--encre); display: flex; align-items: center; gap: 10px; }
.marque::before { content: ""; width: 18px; height: 1px; background: var(--accent); }

/* ---------- cartes et blocs ---------- */
.grille { display: grid; gap: 14px; }
@media (min-width: 700px) { .grille.deux { grid-template-columns: 1fr 1fr; } .grille.trois { grid-template-columns: repeat(3, 1fr); } }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); min-width: 0; }
.carte + .carte, .carte + .grille, .grille + .carte, .grille + .grille { margin-top: 14px; }
.carte > h2, .titre-section { font-size: 1.25rem; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
:root[data-titres="cormorant"] .carte > h2, :root[data-titres="cormorant"] .titre-section { font-size: 1.5rem; }
.carte > h2::before, .titre-section::before { content: ""; display: none; }
.filet { display: block; width: 24px; height: 1px; background: var(--accent); margin-bottom: 10px; }
.titre-section { margin: 28px 0 12px; }
.carte.lien { display: block; color: inherit; font-weight: 400; transition: border-color .2s, transform .2s; }
.carte.douce { background: var(--accent-doux); border-color: transparent; box-shadow: none; }
.carte.signal { background: var(--signal-doux); border-color: transparent; box-shadow: none; }
.attenue { color: var(--attenue); }
.petit { font-size: .9rem; }
.tres-petit { font-size: .8125rem; }
.prose { max-width: 68ch; }
.prose p, .prose li { max-width: 68ch; }
.vide { color: var(--attenue); padding: 6px 0; }
.ligne { display: flex; align-items: center; gap: 10px; }
.ligne.espace { justify-content: space-between; }
.ligne.haut { align-items: flex-start; }
.pile > * + * { margin-top: 10px; }
.flex1 { flex: 1; min-width: 0; }
.coupe { overflow-wrap: anywhere; }
/* une adresse longue dans un texte ne doit jamais élargir la page (le corps masque le débordement : le texte serait coupé) */
p, h1, h2, h3, blockquote { overflow-wrap: anywhere; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .8125rem; font-weight: 500;
  background: var(--surface-2); color: var(--encre-2); white-space: nowrap; letter-spacing: .02em; }
.badge.or { background: var(--accent-doux); color: var(--accent-texte); }
.badge.signal { background: var(--signal-doux); color: var(--signal); }
.badge.contour { background: none; border: 1px solid var(--bord-fort); }

/* ---------- listes ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { padding: 12px 0; border-top: 1px solid var(--bord); display: flex; gap: 12px; align-items: flex-start; }
.liste > li:first-child { border-top: 0; padding-top: 2px; }
.liste > li:last-child { padding-bottom: 2px; }
.liste .titre { font-weight: 500; overflow-wrap: anywhere; }
.liste .meta { color: var(--attenue); font-size: .875rem; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.liste .fait .titre { color: var(--attenue); text-decoration: line-through; text-decoration-color: var(--bord-fort); }
.liste a.rangee { display: flex; gap: 12px; align-items: center; color: inherit; font-weight: 400; width: 100%; }
/* Bouton qui se lit comme une ligne : pas de cadre, mais le contour de focus reste (clavier sur Mac et Windows). */
.ligne-btn { appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; min-width: 0; }

.horaire { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--bord); }
.horaire:first-child { border-top: 0; padding-top: 0; }
.horaire .h { font-variant-numeric: tabular-nums; color: var(--encre-2); font-size: .9375rem; }
.horaire .h small { display: block; color: var(--attenue); font-size: .8125rem; }
.horaire.maintenant { position: relative; }
.horaire.maintenant .h { color: var(--accent-texte); font-weight: 600; }
.horaire.passe { opacity: .7; }
.horaire .quoi { font-weight: 500; }

/* ---------- boutons et champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--bord-fort); background: var(--surface); color: var(--encre); cursor: pointer; font-weight: 500; font-size: .9375rem;
  transition: background .15s, border-color .15s, transform .1s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn.plein { background: var(--bouton); border-color: var(--bouton); color: var(--sur-bouton); }
.btn.nu { border-color: transparent; background: none; color: var(--accent-texte); padding: 8px 10px; }
.btn.petit { min-height: 36px; padding: 6px 14px; font-size: .875rem; }
.btn.rond { width: 44px; padding: 0; }
.btn.rond.petit { width: 36px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.bloc { width: 100%; }
.boutons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.champ { display: block; margin-bottom: 14px; }
.champ > span { display: block; font-size: .875rem; color: var(--encre-2); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=password], input[type=date], input[type=search], input[type=url], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--bord); border-radius: var(--rayon-petit);
  background: var(--fond); font-size: 1rem; outline: none; transition: border-color .15s; -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.5; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--attenue) 50%), linear-gradient(135deg, var(--attenue) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input[type=date] { min-width: 0; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.formulaire-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.formulaire-ligne > * { flex: 1 1 140px; }
.formulaire-ligne > .btn { flex: 0 0 auto; }

/* case ronde */
.case { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; min-width: 26px; border-radius: 50%; border: 1.5px solid var(--bord-fort);
  background: var(--surface); cursor: pointer; display: grid; place-content: center; margin: 0; transition: background .15s, border-color .15s; }
.case::before { content: ""; width: 11px; height: 6px; border-left: 2px solid var(--sur-bouton); border-bottom: 2px solid var(--sur-bouton);
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.case:checked { background: var(--bouton); border-color: var(--bouton); }
.case:checked::before { opacity: 1; }

.interrupteur { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; }
.interrupteur input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bord-fort);
  position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--attenue); transition: transform .2s, background .2s; }
.interrupteur input:checked { background: var(--bouton); border-color: var(--bouton); }
.interrupteur input:checked::after { transform: translateX(20px); background: var(--sur-bouton); }

.segments { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; margin-bottom: 16px; }
.segments button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--encre-2); font-size: .9375rem; min-height: 36px; white-space: nowrap; }
.segments button.actif { background: var(--surface); color: var(--encre); font-weight: 500; box-shadow: var(--ombre); }

.puces { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puces.enveloppe { flex-wrap: wrap; overflow: visible; }
.puces button, .puces a { flex: none; border: 1px solid var(--bord); background: var(--surface); padding: 6px 13px; border-radius: 999px; cursor: pointer; font-size: .875rem; color: var(--encre-2); font-weight: 400; }
.puces .actif { border-color: var(--accent); color: var(--accent-texte); font-weight: 500; background: var(--accent-doux); }

/* barre de progression */
.progres { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progres > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }

/* ---------- bandeaux, messages ---------- */
.bandeau { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--rayon); margin-bottom: 14px; background: var(--accent-doux); color: var(--encre); }
.bandeau.signal { background: var(--signal-doux); }
.bandeau .flex1 { font-size: .9375rem; }
.erreur { padding: 14px 16px; border-radius: var(--rayon); background: var(--signal-doux); color: var(--encre); border-left: 3px solid var(--signal); margin: 10px 0; overflow-wrap: anywhere; }
.chargement { color: var(--attenue); padding: 30px 0; display: flex; align-items: center; gap: 10px; }
.chargement::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--bord-fort); border-top-color: var(--accent); animation: tourne 0.9s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--bas) + 92px); transform: translateX(-50%) translateY(20px); z-index: 60; background: var(--encre); color: var(--fond);
  padding: 11px 18px; border-radius: 999px; font-size: .9375rem; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.vu { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 30px; } }

/* ---------- feuille (fenêtre du bas) ---------- */
.voile { position: fixed; inset: 0; background: rgba(28, 25, 23, .35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: apparait .2s; }
.feuille { background: var(--surface); width: 100%; max-width: 620px; max-height: 88dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 22px 18px calc(var(--bas) + 22px); box-shadow: 0 -10px 40px rgba(0, 0, 0, .12); animation: monte .25s ease-out; }
.feuille h2 { font-size: 1.35rem; margin-bottom: 16px; }
@media (min-width: 700px) { .voile { align-items: center; } .feuille { border-radius: 22px; } }
@keyframes apparait { from { opacity: 0; } }
@keyframes monte { from { transform: translateY(30px); opacity: .6; } }

/* ---------- prose rendue (markdown) ---------- */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.3em 0 .5em; }
.md h1 { font-size: 1.6rem; } .md h2 { font-size: 1.35rem; } .md h3 { font-size: 1.15rem; font-family: var(--police); font-weight: 600; } .md h4 { font-size: 1rem; font-family: var(--police); font-weight: 600; }
.md ul, .md ol { padding-left: 1.3em; margin: 0 0 .9em; }
.md li { margin: .25em 0; }
.md li::marker { color: var(--accent); }
.md blockquote { margin: .8em 0; padding: 4px 0 4px 16px; border-left: 2px solid var(--accent); color: var(--encre-2); }
.md code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; letter-spacing: 0; }
.md pre { background: var(--surface-2); padding: 12px 14px; border-radius: var(--rayon-petit); overflow-x: auto; letter-spacing: 0; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: .9375rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--bord); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md hr { border: 0; height: 1px; background: var(--bord); margin: 1.4em 0; }
.md a { overflow-wrap: anywhere; }

/* ---------- connexion ---------- */
.connexion { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.connexion .carte { width: 100%; max-width: 400px; padding: 34px 26px; text-align: left; }
.connexion .marque { font-size: 2.2rem; margin-bottom: 28px; }

/* ---------- quiz et simulateur ---------- */
.question { padding: 18px; }
.question .enonce { font-size: 1.0625rem; font-weight: 500; margin: 8px 0 14px; }
.options { display: grid; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 13px 14px; border-radius: var(--rayon-petit); border: 1px solid var(--bord);
  background: var(--fond); cursor: pointer; font-size: 1rem; line-height: 1.45; color: var(--encre); transition: border-color .15s, background .15s; }
.option .lettre { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--bord-fort); display: grid; place-items: center; font-size: .8125rem; font-weight: 600; color: var(--encre-2); }
.option.coche { border-color: var(--accent); background: var(--accent-doux); }
.option.coche .lettre { background: var(--bouton); border-color: var(--bouton); color: var(--sur-bouton); }
.option[disabled] { cursor: default; }
.option.juste { border-color: var(--accent); background: var(--accent-doux); }
.option.faux { border-color: var(--signal); background: var(--signal-doux); }
.option .marque-rep { margin-left: auto; flex: none; font-size: .8125rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding-left: 8px; }
.option .flex1 > .marque-rep { display: flex; margin: 0 0 4px; padding: 0; }
.texte-rep { display: block; }
.option.juste .marque-rep { color: var(--accent-texte); }
.option.faux .marque-rep { color: var(--signal); }
.option.fixe { cursor: default; }
.explication { margin-top: 12px; padding: 12px 14px; border-radius: var(--rayon-petit); background: var(--surface-2); font-size: .9375rem; }
.raison { display: block; font-size: .875rem; color: var(--encre-2); margin-top: 4px; font-weight: 400; }
.chrono { font-variant-numeric: tabular-nums; font-weight: 500; }
.note-grande { font-family: var(--police-titres); font-weight: var(--poids-titres); font-size: 3.6rem; line-height: 1; color: var(--encre); }
.note-grande small { font-size: 1.3rem; color: var(--attenue); }
.confiance { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.confiance button { flex: 1 1 120px; }
.confiance button.actif { border-color: var(--accent); background: var(--accent-doux); color: var(--accent-texte); }
.pastilles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pastilles button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--bord); background: var(--surface); font-size: .8125rem; cursor: pointer; color: var(--encre-2); }
.pastilles button.repondu { background: var(--surface-2); border-color: var(--bord-fort); }
.pastilles button.marquee { border-color: var(--signal); color: var(--signal); font-weight: 600; }
.pastilles button.ici { border: 2px solid var(--accent); color: var(--encre); font-weight: 600; }

/* ---------- IA ---------- */
.fil { display: flex; flex-direction: column; gap: 18px; padding-bottom: 12px; }
.msg-samuel { align-self: flex-end; max-width: 86%; background: var(--surface-2); padding: 11px 15px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-kira { max-width: 100%; }
.msg-kira .qui { display: flex; align-items: center; gap: 8px; color: var(--accent-texte); font-size: .8125rem; font-weight: 500; letter-spacing: .08em; margin-bottom: 6px; }
.msg-kira .qui::before { content: ""; width: 14px; height: 1px; background: var(--accent); }
.msg-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.msg-outils > span { margin-left: 6px; }
.compose { position: sticky; bottom: calc(var(--bas) + 76px); background: var(--fond); padding: 10px 0 4px; z-index: 5; }
@media (min-width: 900px) { .compose { bottom: 0; padding-bottom: 20px; } }
.compose .boite { display: flex; align-items: flex-end; gap: 6px; background: var(--surface); border: 1px solid var(--bord); border-radius: 24px; padding: 6px 6px 6px 14px; box-shadow: var(--ombre); }
.compose textarea { border: 0; background: none; min-height: 40px; max-height: 40vh; padding: 9px 0; resize: none; }
.compose textarea:focus { border: 0; }
.apercu-image { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.apercu-image img { height: 64px; border-radius: 10px; border: 1px solid var(--bord); }
.propositions-ia { display: flex; flex-wrap: wrap; gap: 8px; }
.propositions-ia button { text-align: left; }
.tache-proposee { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface); margin-top: 8px; }
.attente { color: var(--attenue); display: flex; align-items: center; gap: 10px; }
.attente i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; display: inline-block; }
.attente i:nth-child(2) { animation-delay: .2s; } .attente i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- visionneuse ---------- */
.visionneuse { width: 100%; height: calc(100dvh - 210px); min-height: 420px; border: 1px solid var(--bord); border-radius: var(--rayon); background: #fff; }
.vignette { max-width: 100%; border-radius: var(--rayon); border: 1px solid var(--bord); }

/* ---------- réglages ---------- */
.nuancier { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.nuancier button { border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 10px; cursor: pointer; text-align: left; font-size: .875rem; }
.nuancier button.actif { border: 2px solid var(--accent); padding: 9px; }
.nuancier .echantillon { display: flex; gap: 4px; margin-bottom: 8px; }
.nuancier .echantillon i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .08); }

.jour-titre { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 8px; }
.jour-titre h3 { font-size: 1.15rem; }
.jour-titre.auj h3 { color: var(--accent-texte); }

/* Survol réservé aux pointeurs : sur iPhone, un :hover reste collé après le toucher et fait croire à une case cochée. */
@media (hover: hover) {
  .carte.lien:hover { border-color: var(--bord-fort); transform: translateY(-1px); }
  .btn:hover { border-color: var(--encre-2); }
  .btn.plein:hover { filter: brightness(1.08); }
  .btn.nu:hover { background: var(--surface-2); }
  .case:hover { border-color: var(--accent); }
  .option:hover:not([disabled]) { border-color: var(--accent); }
  .option.fixe:hover:not([disabled]) { border-color: var(--bord); }
  .option.fixe.juste:hover:not([disabled]) { border-color: var(--accent); }
  .option.fixe.faux:hover:not([disabled]) { border-color: var(--signal); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .barre-bas, .lateral, .compose { display: none; } }
