/* ============================================================
   Portfolio — chat UI
   Base papier chaud + accent rouge solaire, composer en bloc
   avec barre d'outils intégrée et saisie centrée à l'accueil.
   Tokens → Base → Topbar → Thread → Messages → Composer → Responsive
   ============================================================ */

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-full: 999px;

  --col: 748px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* ── Ciels ──────────────────────────────────────────────
     Deux jeux de motifs, choisis par thème plus bas via --sky-*.
     Sombre : étoiles en dégradés (cœur net + auréole large).
     Clair  : flocons de neige, un SVG en ligne par plan —
              pour les recolorer, changer le %23xxxxxx du tracé. */
  --stars-dust:
    radial-gradient(1px 1px at  24px  42px, var(--star-dim), transparent),
    radial-gradient(1px 1px at 246px  88px, var(--star-dim), transparent),
    radial-gradient(1px 1px at 292px 238px, var(--star-dim), transparent),
    radial-gradient(1px 1px at  74px 286px, var(--star-dim), transparent);
  --stars-a:
    radial-gradient(1.8px 1.8px at  96px 120px, var(--star), transparent),
    radial-gradient(1.5px 1.5px at 420px 300px, var(--star-cool), transparent),
    radial-gradient(2px   2px   at 560px  60px, var(--star-warm), transparent),
    radial-gradient(6px 6px at  96px 120px, var(--halo), transparent),
    radial-gradient(5px 5px at 420px 300px, var(--halo), transparent),
    radial-gradient(7px 7px at 560px  60px, var(--halo-warm), transparent);
  --stars-b:
    radial-gradient(1.7px 1.7px at 208px 468px, var(--star), transparent),
    radial-gradient(1.8px 1.8px at 498px 196px, var(--star-warm), transparent),
    radial-gradient(1.5px 1.5px at 352px 584px, var(--star-cool), transparent),
    radial-gradient(6px 6px at 208px 468px, var(--halo), transparent),
    radial-gradient(6px 6px at 498px 196px, var(--halo-warm), transparent),
    radial-gradient(5px 5px at 352px 584px, var(--halo), transparent);

  --flakes-dust:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 320'%3E%3Cg fill='none' stroke='%23a8bce5' stroke-width='1' stroke-linecap='round'%3E%3Cg transform='translate(62,88) scale(.8)'%3E%3Cpath d='M0-2V2M-1.73-1L1.73 1M-1.73 1L1.73-1'/%3E%3C/g%3E%3Cg transform='translate(238,216) scale(.7)'%3E%3Cpath d='M0-2V2M-1.73-1L1.73 1M-1.73 1L1.73-1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --flakes-a:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cg fill='none' stroke='%2386a2d8' stroke-width='0.8' stroke-linecap='round'%3E%3Cg transform='translate(96,120)'%3E%3Cpath d='M0-2V2M-1.73-1L1.73 1M-1.73 1L1.73-1'/%3E%3C/g%3E%3Cg transform='translate(420,300) scale(.85)'%3E%3Cpath d='M0-2V2M-1.73-1L1.73 1M-1.73 1L1.73-1'/%3E%3C/g%3E%3Cg transform='translate(560,60) scale(1.15)'%3E%3Cpath d='M0-2V2M-1.73-1L1.73 1M-1.73 1L1.73-1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --flakes-b:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cg fill='none' stroke='%239d8fdc' stroke-width='0.85' stroke-linecap='round'%3E%3Cg transform='translate(208,468) scale(1.05)'%3E%3Cpath d='M0-2V2M-1.73-1L1.73 1M-1.73 1L1.73-1'/%3E%3C/g%3E%3Cg transform='translate(498,196) scale(.9)'%3E%3Cpath d='M0-2V2M-1.73-1L1.73 1M-1.73 1L1.73-1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Clair — papier */
:root,
:root[data-theme="light"] {
  --bg:          #f1ede6;
  --bg-elev:     #fbf9f6;
  --bg-sunken:   #e5e0d7;
  --border:      #dcd6ca;
  --border-soft: #e6e1d8;
  --text:        #201f1d;
  --text-dim:    #4a463d;                  /* sous-texte : contraste renforcé */
  --text-faint:  #6f695c;
  --accent:      #3f5fc4;                  /* bleu — texte et petits aplats */
  --accent-hi:   #5b3fb8;                  /* violet — survol */
  --accent-fill: #3f5fc4;                  /* aplats : bouton d'envoi */
  --accent-soft: #e8e9f8;
  --accent-text: #ffffff;
  --sky-dust:    var(--flakes-dust);       /* ciel clair : flocons */
  --sky-a:       var(--flakes-a);
  --sky-b:       var(--flakes-b);
  --nebula:      rgba(120, 104, 92, .08);
  --vignette:    rgba(112, 98, 84, .20);
  --bubble:      #efece4;
  --shadow-sm:   0 1px 2px rgba(60, 45, 35, .06);
  --shadow-lg:   0 2px 4px rgba(60, 45, 35, .04), 0 14px 36px rgba(60, 45, 35, .09);
}

/* Sombre — encre froide */
:root[data-theme="dark"] {
  --bg:          #17181c;
  --bg-elev:     #202228;
  --bg-sunken:   #292c33;
  --border:      #33363f;
  --border-soft: #262930;
  --text:        #eeece8;
  --text-dim:    #d4d1cb;                  /* sous-texte : nettement plus clair */
  --text-faint:  #a6a29b;
  --accent:      #8f6df0;                  /* violet cosmos — texte et traits */
  --accent-hi:   #a78bfa;                  /* survol, plus clair */
  --accent-fill: #7650e0;                  /* aplats : bouton d'envoi */
  --accent-soft: #221c34;
  --accent-text: #ffffff;
  --star:        rgba(236, 240, 255, .82);
  --star-cool:   rgba(168, 146, 255, .78);  /* étoiles violettes */
  --star-dim:    rgba(232, 236, 255, .40);
  --star-warm:   rgba(206, 162, 255, .80);  /* étoiles lilas */
  --halo:        rgba(206, 196, 255, .15);
  --halo-warm:   rgba(206, 162, 255, .15);
  --sky-dust:    var(--stars-dust);        /* ciel sombre : étoiles */
  --sky-a:       var(--stars-a);
  --sky-b:       var(--stars-b);
  --nebula:      rgba(126, 116, 160, .10);  /* voile violacé */
  --vignette:    rgba(0, 0, 0, .42);
  --bubble:      #272a31;
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg:   0 2px 4px rgba(0, 0, 0, .3), 0 14px 36px rgba(0, 0, 0, .38);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #17181c; --bg-elev: #202228; --bg-sunken: #292c33;
    --border: #33363f; --border-soft: #262930;
    --text: #eeece8; --text-dim: #d4d1cb; --text-faint: #a6a29b;
    --accent: #8f6df0; --accent-hi: #a78bfa; --accent-fill: #7650e0;
    --accent-soft: #221c34; --accent-text: #ffffff;
    --star: rgba(236, 240, 255, .82); --star-cool: rgba(168, 146, 255, .78);
    --star-dim: rgba(232, 236, 255, .40); --star-warm: rgba(206, 162, 255, .80);
    --halo: rgba(206, 196, 255, .15); --halo-warm: rgba(206, 162, 255, .15);
    --sky-dust: var(--stars-dust); --sky-a: var(--stars-a); --sky-b: var(--stars-b);
    --nebula: rgba(126, 116, 160, .10);
    --vignette: rgba(0, 0, 0, .42);
    --bubble: #272a31;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 36px rgba(0, 0, 0, .38);
  }
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  /* dvh suit la barre d'adresse mobile, qui se rétracte au défilement ;
     la ligne du dessus reste la solution de repli. */
  height: 100%;
  height: 100dvh;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

button { font: inherit; color: inherit; cursor: pointer; }

/* Une règle d'auteur avec display: … écrase le [hidden] du navigateur.
   Cette ligne rend l'attribut fiable partout. */
[hidden] { display: none !important; }

a { color: var(--text); text-decoration-color: var(--text-faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

::selection { background: var(--accent-soft); color: var(--text); }

/* ── Fond spatial ─────────────────────────────────────────
   Deux calques fixes : un champ d'étoiles en dégradés répétés
   qui dérive très lentement, puis une nébuleuse + vignettage.
   Le champ est fait de trois plans : la poussière fixe portée par
   .stars, et deux plans d'étoiles (::before / ::after) qui pulsent
   à des rythmes différents — d'où le scintillement.
   Pour un fond neutre, masquer .stars et .nebula.            */
.stars {
  position: fixed; left: 0; right: 0;
  top: -640px; height: calc(100% + 1280px);
  z-index: -3; pointer-events: none;
  background-image: var(--sky-dust);      /* plan lointain, sans pulsation */
  background-size: 320px 320px;
  animation: drift 260s linear infinite;
}

.stars::before,
.stars::after { content: ""; position: absolute; inset: 0; background-size: 640px 640px; }

/* Les trames (320 et 640 px) divisent la translation de la dérive :
   le motif se reboucle sans saut. */
.stars::before {
  background-image: var(--sky-a);
  animation: twinkle-a 4.2s ease-in-out infinite alternate;
}
.stars::after {
  background-image: var(--sky-b);
  animation: twinkle-b 6.6s ease-in-out infinite alternate -2.4s;
}

@keyframes drift     { to   { transform: translateY(640px); } }
@keyframes twinkle-a { from { opacity: .30; } to { opacity: 1; } }
@keyframes twinkle-b { from { opacity: 1; }   to { opacity: .28; } }

.nebula {
  position: fixed; inset: 0;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(52% 42% at 88% 84%, var(--nebula), transparent 70%),
    radial-gradient(118% 88% at 50% 42%, transparent 50%, var(--vignette) 100%);
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  background: transparent;          /* le fond spatial reste visible */
  position: sticky; top: 0; z-index: 10;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.brand__badge {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 11px;
  background: var(--accent-soft);
}
.brand__badge svg { width: 19px; height: 19px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand__text strong {
  font-size: 14.5px; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand__text small { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--r-full);
  background: transparent; color: var(--text-dim);
  font-size: 13px; font-weight: 500;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.ghost-btn:hover { color: var(--text); border-color: var(--text-faint); background: var(--bg-elev); }
.ghost-btn svg { width: 15px; height: 15px; }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--text-dim);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--text); }

.ico-moon { display: none; }
:root[data-theme="dark"] .ico-sun { display: none; }
:root[data-theme="dark"] .ico-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .ico-sun { display: none; }
  :root:not([data-theme]) .ico-moon { display: block; }
}

/* ── Colonne de conversation ──────────────────────────────── */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.thread {
  flex: 1; min-height: 0;
  overflow-y: auto;
  /* Surtout pas de scroll-behavior: smooth ici — le suivi du bas doit
     être instantané, une animation ne rattrape jamais un contenu qui
     s'allonge à chaque caractère. */
  padding: 26px 22px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.thread::-webkit-scrollbar { width: 10px; }
.thread::-webkit-scrollbar-thumb { background: var(--border); border: 3px solid var(--bg); border-radius: var(--r-full); }

/* État d'accueil : la saisie remonte au centre.
   « margin-top: auto » plutôt que « align-content: end » : sur un écran
   court, un alignement en fin de conteneur pousse le débordement vers le
   haut, hors de la zone défilable — l'accroche devenait inatteignable. */
.chat.is-empty .thread {
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto;
  padding-bottom: 22px;
}
.chat.is-empty .welcome { margin-top: auto; flex: none; }
.chat.is-empty .composer-wrap { margin-bottom: min(13vh, 104px); }
.chat:not(.is-empty) .suggestions { display: none; }

/* ── Accueil ──────────────────────────────────────────────── */
.welcome {
  position: relative;
  max-width: var(--col);
  text-align: center;
  animation: rise .5s var(--ease) both;
}
.welcome__title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 4.6vw, 42px);
  font-weight: 400;
  letter-spacing: -.018em;
  line-height: 1.16;
  color: var(--text);
  /* évite le mot — ou le « ? » — resté seul sur la dernière ligne */
  text-wrap: balance;
}

/* Suggestions (sous la saisie, à l'accueil) */
.suggestions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px;
  max-width: var(--col); margin: 12px auto 0;
  animation: rise .45s var(--ease) both;
}
.suggestion {
  padding: 12px 15px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.suggestion:hover {
  border-color: var(--accent); background: var(--accent-soft);
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
}
/* Nombre impair de suggestions : la dernière est centrée sur sa ligne,
   à la largeur exacte d'une colonne. Sans la contrainte de largeur, elle
   s'étirerait sur les deux colonnes et paraîtrait deux fois plus grosse. */
.suggestion:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 4.5px);   /* une colonne = la moitié, moins la moitié du gap (9px) */
}
.suggestion strong { display: block; font-size: 13.5px; font-weight: 500; }

/* ── Messages ─────────────────────────────────────────────── */
.msg { max-width: var(--col); margin: 0 auto 28px; animation: rise .35s var(--ease) both; }

.msg--user { display: flex; justify-content: flex-end; }
.msg--user .msg__body {
  max-width: 82%;
  padding: 11px 16px;
  border-radius: var(--r-lg) var(--r-lg) 6px var(--r-lg);
  background: var(--bubble);
}

.msg--bot { display: flex; gap: 13px; align-items: flex-start; }
.msg__mark {                      /* emblème de l'assistant : un emoji, sans cadre */
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: none; margin-top: -1px;
  font-size: 24px; line-height: 1;
}
/* Une URL ou un identifiant sans espace ne doit pas élargir la colonne */
.msg__body { min-width: 0; flex: 1; overflow-wrap: break-word; }
.msg__body > :first-child { margin-top: 0; }
.msg__body > :last-child { margin-bottom: 0; }
.msg__body p { margin: 0 0 11px; }
.msg__body strong { font-weight: 600; }
.msg__body a { color: var(--accent-hi); text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.msg__body code {
  padding: 1px 5px; border-radius: 5px;
  background: var(--bg-sunken);
  font-family: var(--font-mono); font-size: .86em;
}
.msg__body ul { margin: 0 0 13px; padding-left: 0; list-style: none; }
.msg__body ul li { position: relative; padding-left: 19px; margin-bottom: 6px; }
.msg__body ul li::before {
  content: ""; position: absolute; left: 4px; top: .64em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

.caret {
  display: inline-block;
  width: 7px; height: 1.05em;
  margin-left: 2px; vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.typing { display: inline-flex; gap: 4px; padding: 7px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s var(--ease) infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ── Cartes projets ───────────────────────────────────────── */
.cards { display: grid; gap: 10px; margin: 6px 0 13px; }
.card {
  padding: 15px 17px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.card__head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.card__title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card__year { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.card__desc { margin: 0 0 11px; font-size: 14px; color: var(--text-dim); }
.card__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 11px; }
.tag {
  padding: 3px 10px; border-radius: var(--r-full);
  background: var(--bg-sunken); color: var(--text);
  font-size: 11.5px; font-family: var(--font-mono);
}
.card__links, .links-block { display: flex; flex-wrap: wrap; gap: 15px; font-size: 13px; }
.links-block { margin-bottom: 13px; }
.card__links a, .links-block a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent-hi); text-decoration: none; font-weight: 500;
}
.card__links a:hover, .links-block a:hover { color: var(--accent); text-decoration: underline; }
.card__links svg, .links-block svg { width: 13px; height: 13px; }

/* ── Parcours ─────────────────────────────────────────────── */
.timeline { margin: 6px 0 13px; padding-left: 18px; border-left: 1px solid var(--border); }
.timeline__item { position: relative; padding-bottom: 18px; animation: rise .3s var(--ease) both; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -22px; top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--accent);
}
.timeline__when  { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.timeline__what  { font-size: 14.5px; font-weight: 600; }
.timeline__where { font-size: 13.5px; color: var(--text-dim); }
/* Les détails reprennent les puces des listes de messages */
.timeline__item ul { margin: 7px 0 0; }

/* ── Compétences ──────────────────────────────────────────── */
.skills { display: grid; gap: 13px; margin: 6px 0 13px; }
.skills__group h4 {
  margin: 0 0 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text);
}
.skills__items { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Composer ─────────────────────────────────────────────── */
.composer-wrap { padding: 10px 22px 16px; }

.composer {
  max-width: var(--col); margin: 0 auto;
  padding: 12px 12px 10px 16px;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
  transition: border-color .16s var(--ease);
}
.composer:focus-within { border-color: var(--accent); }

.composer__input {
  display: block; width: 100%;
  max-height: 176px; padding: 2px 0 4px;
  border: 0; outline: 0; resize: none;
  background: transparent; color: var(--text);
  font: inherit; line-height: 1.55;
  scrollbar-width: thin;
}
.composer__input::placeholder { color: var(--text-faint); }

.composer__bar { display: flex; align-items: center; gap: 7px; margin-top: 8px; }

.soft-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border-soft); border-radius: var(--r-full);
  background: var(--bg);
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 500;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.soft-btn:hover { color: var(--text); border-color: var(--text-faint); }
.soft-btn[aria-expanded="true"] { color: var(--accent-hi); border-color: var(--accent); background: var(--accent-soft); }
.soft-btn svg { width: 15px; height: 15px; }
.soft-btn--lang { letter-spacing: .04em; }

/* Menu « Sujets » : panneau flottant au-dessus du composer */
.menu { position: relative; }
.menu__panel {
  position: absolute; bottom: calc(100% + 9px); left: 0; z-index: 20;
  display: grid; gap: 2px;
  min-width: 224px; padding: 6px;
  /* le menu ne doit pas dépasser l'écran quand les sujets se multiplient */
  max-height: min(58vh, 380px); overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
  animation: rise .16s var(--ease) both;
}
.menu__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-dim);
  font-size: 13.5px; text-align: left;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.menu__item:hover { background: var(--bg-sunken); color: var(--text); }
.menu__item .emoji { width: 18px; flex: none; text-align: center; font-size: 14px; }

.composer__send {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none; margin-left: auto;
  border: 0; border-radius: var(--r-full);
  background: var(--accent-fill); color: var(--accent-text);
  transition: opacity .15s var(--ease), transform .15s var(--ease), filter .15s var(--ease);
}
.composer__send:disabled { opacity: .26; cursor: not-allowed; }
/* Survol : on fonce plutôt qu'on éclaircit, le texte blanc y gagne */
.composer__send:not(:disabled):hover { filter: brightness(.92); transform: scale(1.06); }
.composer__send svg { width: 17px; height: 17px; stroke-width: 2.2; }

/* ── Pied ─────────────────────────────────────────────────── */
.foot {
  display: flex; align-items: center; justify-content: center; gap: 8px 14px;
  flex-wrap: wrap;
  max-width: var(--col); margin: 12px auto 0;
  font-size: 11.5px; color: var(--text-faint);
}
.social-list { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; }
.social-list a { color: var(--text-dim); text-decoration: none; }
.social-list a:hover { color: var(--accent); }
.foot__note { text-align: center; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  /* étoiles figées à pleine intensité plutôt qu'à la fin du cycle */
  .stars::before, .stars::after { opacity: .85 !important; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar {
    gap: 8px;
    /* les encoches en paysage mangent les bords */
    padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  }
  .ghost-btn span { display: none; }
  .ghost-btn { padding: 0 11px; }
  .thread { padding: 18px 14px 4px; }
  .composer-wrap {
    padding: 8px 14px calc(12px + env(safe-area-inset-bottom));
  }
  .chat.is-empty .composer-wrap { margin-bottom: 6vh; }
  .suggestions { grid-template-columns: minmax(0, 1fr); }
  /* Une seule colonne : la dernière suggestion reprend toute la largeur.
     « justify-self: center » doit être annulé aussi, sinon la carte se
     contente de la largeur de son texte au lieu de s'étirer. */
  .suggestion:last-child:nth-child(odd) { width: auto; justify-self: stretch; }
  .msg--user .msg__body { max-width: 88%; }
  .msg--bot { gap: 10px; }
  .foot { flex-direction: column; gap: 6px; }

  /* Sous 16px, iOS zoome sur le champ dès qu'il reçoit le focus
     et l'utilisateur se retrouve avec une page décadrée. */
  .composer__input { font-size: 16px; }
}

/* Écrans courts — téléphone en paysage, fenêtre réduite.
   L'accueil ne tient plus : on sacrifie les suggestions, le menu
   « Sujets » reste le point d'entrée vers les mêmes questions. */
@media (max-height: 560px) {
  .suggestions { display: none; }
  .chat.is-empty .composer-wrap { margin-bottom: 2vh; }
  .welcome__title { font-size: clamp(20px, 3.4vw, 26px); }
  .welcome__sub { font-size: 13.5px; }
  .thread { padding-top: 14px; }
  .foot { margin-top: 8px; }
}

/* Cibles tactiles : 34px suffit à la souris, pas au doigt. */
@media (pointer: coarse) {
  .soft-btn { height: 38px; }
  .icon-btn, .ghost-btn { height: 38px; }
  .composer__send { width: 38px; height: 38px; }
  .menu__item { padding: 11px 10px; }
  .social-list { gap: 18px; }
}
