/* Céleste : feuille de style du site.

   Parti pris : une seule famille de caractères, choisie pour sa lisibilité
   (Atkinson Hyperlegible), une palette tirée du ciel (bleu céleste le jour,
   bleu nuit le soir), et un seul élément remarquable, la carte du ciel de
   l'accueil. Tout le reste se fait oublier. */

/* ------------------------------------------------------------ caractères */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- jetons */

:root {
  color-scheme: light dark;

  --font: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Échelle typographique, rapport 1,2 autour d'un texte courant de 17 px. */
  --t-small: 0.8125rem;
  --t-ui: 0.9375rem;
  --t-body: 1.0625rem;
  --t-lead: 1.25rem;
  --t-title: 1.5rem;
  --t-display: clamp(2.25rem, 1.4rem + 3.2vw, 3.25rem);

  --column: 44rem;
  --sidebar: 17.5rem;
  --radius: 16px;
  --radius-small: 9px;

  /* Jour : bleu céleste, encre bleu nuit. */
  --bg: #e8f1fb;
  --panel: #dbe8f7;
  --surface: #f8fbfe;
  --surface-2: #d3e3f5;
  --ink: #0e1b3e;
  --ink-2: #3d4d73;
  --ink-3: #55648a;
  --line: #b9cde5;
  --line-strong: #7388ae;
  --accent: #0f5fb6;
  --accent-ink: #ffffff;
  --warm: #a64a0a;
  --star: #0e1b3e;
  --sky-line: #0e1b3e24;
  --horizon-glow: #f8fbfe;
  --danger-bg: #fbe4e1;
  --danger-ink: #8c1d18;
  --warn-bg: #fcebd3;
  --warn-ink: #7a3e05;
  --scrim: #0e1b3e59;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1330;
    --panel: #070d24;
    --surface: #111d45;
    --surface-2: #1a2a5e;
    --ink: #eef0e8;
    --ink-2: #b7c0da;
    --ink-3: #8e99ba;
    --line: #27386f;
    --line-strong: #6278b3;
    --accent: #8fcbf5;
    --accent-ink: #081127;
    --warm: #f2b37b;
    --star: #f3f1e7;
    --sky-line: #8fcbf52b;
    --horizon-glow: #16265a;
    --danger-bg: #3a1420;
    --danger-ink: #ffb4ab;
    --warn-bg: #33250f;
    --warn-ink: #f6cf9a;
    --scrim: #02061499;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1330;
  --panel: #070d24;
  --surface: #111d45;
  --surface-2: #1a2a5e;
  --ink: #eef0e8;
  --ink-2: #b7c0da;
  --ink-3: #8e99ba;
  --line: #27386f;
  --line-strong: #6278b3;
  --accent: #8fcbf5;
  --accent-ink: #081127;
  --warm: #f2b37b;
  --star: #f3f1e7;
  --sky-line: #8fcbf52b;
  --horizon-glow: #16265a;
  --danger-bg: #3a1420;
  --danger-ink: #ffb4ab;
  --warn-bg: #33250f;
  --warn-ink: #f6cf9a;
  --scrim: #02061499;
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure,
blockquote,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

button,
textarea,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.07em;
}

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

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 0.75rem;
  top: -4rem;
  z-index: 50;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-small);
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon .is-filled,
.wordmark__sign .is-filled {
  fill: currentColor;
  stroke: none;
}

.column {
  width: min(100% - 2rem, var(--column));
  margin-inline: auto;
}

/* --------------------------------------------------------------- boutons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: var(--t-ui);
  font-weight: 600;
}

.button:hover {
  background: var(--surface-2);
}

/* Un lien qui a l'allure d'un bouton (export, panneau d'administration) n'est
   ni souligné ni coloré comme un lien. */
a.button {
  text-decoration: none;
}

a.button:not(.button--primary):not(.button--danger) {
  color: var(--ink);
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button--primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
}

.icon-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.text-button {
  padding: 0.3rem 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: var(--t-ui);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
}

.text-button:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* ------------------------------------------------------------ structure */

.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

.main {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  padding: 0.5rem 0.75rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-end: auto;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-small);
  color: var(--ink);
  font-size: var(--t-lead);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark__sign {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  color: var(--accent);
}

.model-badge {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: var(--t-small);
  white-space: nowrap;
}

.icon--sun {
  display: none;
}

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

:root[data-theme="dark"] .icon--sun {
  display: block;
}

:root[data-theme="dark"] .icon--moon {
  display: none;
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.dock {
  flex: none;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

/* À l'accueil, le champ de saisie suit le texte au lieu de coller au bas de page.
   L'accueil ne se tasse jamais sous le champ de saisie : sur un petit écran,
   c'est la page qui défile. */
.app[data-view="welcome"] .stage {
  flex: 0 0 auto;
  overflow-y: visible;
  scrollbar-gutter: auto;
}

.app[data-view="welcome"] .main {
  overflow-y: auto;
}

/* --------------------------------------------------------------- panneau */

.sidebar {
  display: flex;
  flex: none;
  flex-direction: column;
  width: var(--sidebar);
  background: var(--panel);
}

.app[data-sidebar="closed"] .sidebar {
  display: none;
}

.sidebar__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
}

.sidebar__head .button {
  flex: 1;
}

.sidebar__close {
  display: none;
}

.sidebar__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.25rem 0.5rem;
}

.sidebar__list ul {
  list-style: none;
}

.sidebar__empty {
  padding: 0.75rem;
  color: var(--ink-3);
  font-size: var(--t-ui);
}

.conversation {
  display: flex;
  align-items: center;
  border-radius: var(--radius-small);
}

.conversation:hover,
.conversation:focus-within {
  background: var(--surface-2);
}

.conversation__open {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--ink-2);
  font-size: var(--t-ui);
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation__open[aria-current="true"] {
  color: var(--ink);
  font-weight: 650;
}

.conversation:has([aria-current="true"]) {
  background: var(--surface-2);
}

.conversation__delete {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-3);
  opacity: 0;
}

.conversation:hover .conversation__delete,
.conversation__delete:focus-visible {
  opacity: 1;
}

.conversation__delete:hover {
  color: var(--danger-ink);
}

.conversation__delete .icon {
  width: 1.05rem;
  height: 1.05rem;
}

.sidebar__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.75rem 1.25rem 1rem;
  font-size: var(--t-small);
}

.sidebar__foot a {
  color: var(--ink-3);
  padding: 0.3rem 0;
}

.sidebar__foot .text-button {
  flex-basis: 100%;
  font-size: var(--t-small);
  text-align: start;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--scrim);
}

@media (max-width: 59.99rem) {
  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline: 0 auto;
    z-index: 30;
    width: min(86vw, 20rem);
    box-shadow: 0 0 2.5rem #0206144d;
  }

  .sidebar__close {
    display: inline-grid;
  }

  .conversation__delete {
    opacity: 1;
  }
}

/* -------------------------------------------------------------- bandeaux */

.banner {
  padding: 0.55rem 1rem;
  font-size: var(--t-ui);
  text-align: center;
}

.banner--info {
  background: var(--surface-2);
  color: var(--ink);
}

.banner--warning {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.banner--error {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

/* ---------------------------------------------------------------- accueil */

.sky-frame {
  position: relative;
}

/* La lueur s'arrête à la ligne d'horizon, tracée 30 px au-dessus du bas du dessin. */
.sky {
  display: block;
  width: 100%;
  height: clamp(12rem, 42vh, 26rem);
  overflow: hidden;
  background: linear-gradient(to bottom, transparent 30%, var(--horizon-glow)) no-repeat top / 100%
    calc(100% - 30px);
  font-family: var(--font);
}

.sky__lines path {
  fill: none;
  stroke: var(--sky-line);
  stroke-width: 1;
}

.sky__star {
  fill: var(--star);
}

.sky__star--2 {
  opacity: 0.95;
}

.sky__star--3 {
  opacity: 0.82;
}

.sky__star--4 {
  opacity: 0.62;
}

.sky__star.is-low {
  opacity: 0.4;
}

.sky__constellation {
  fill: var(--ink-3);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

.sky__name {
  fill: var(--ink-2);
  font-size: 12.5px;
}

.sky__sun {
  fill: var(--warm);
}

.sky__name--sun {
  fill: var(--warm);
}

.sky__horizon line {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.sky__horizon text {
  fill: var(--ink-3);
  font-size: 11.5px;
}

.sky.is-day .sky__stars,
.sky.is-day .sky__lines,
.sky.is-day .sky__constellation {
  opacity: 0.55;
}

.sky-caption {
  width: min(100% - 2rem, var(--column));
  margin: 0.4rem auto 0;
  color: var(--ink-3);
  font-size: var(--t-small);
}

.welcome__text {
  padding: clamp(1.25rem, 4vh, 2.5rem) 0 1.25rem;
}

.welcome__text h1 {
  font-size: var(--t-display);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.welcome__text p {
  margin-top: 0.35rem;
  color: var(--ink-2);
  font-size: var(--t-lead);
}

/* Un seul mouvement à l'ouverture : les étoiles apparaissent par ordre d'éclat. */
@media (prefers-reduced-motion: no-preference) {
  .sky.is-entering .sky__star,
  .sky.is-entering .sky__lines,
  .sky.is-entering .sky__labels {
    animation: sky-appear 0.9s ease-out both;
  }

  .sky.is-entering .sky__star--2 {
    animation-delay: 0.15s;
  }

  .sky.is-entering .sky__star--3 {
    animation-delay: 0.35s;
  }

  .sky.is-entering .sky__star--4 {
    animation-delay: 0.6s;
  }

  .sky.is-entering .sky__lines,
  .sky.is-entering .sky__labels {
    animation-delay: 0.9s;
  }
}

@keyframes sky-appear {
  from {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- saisie */

.composer {
  position: relative;
  padding: 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 1.6rem;
  background: var(--surface);
}

.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  max-height: 40vh;
  padding: 0.55rem 0.6rem 0.25rem;
  border: 0;
  outline: 0;
  background: none;
  line-height: 1.5;
  resize: none;
}

.composer__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
}

.composer__spacer {
  flex: 1 1 auto;
}

.composer__attach:disabled {
  color: var(--ink-3);
}

/* Petits boutons à étiquette de la barre d'outils : recherche web, modèle. */
.tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font-size: var(--t-small);
  font-weight: 600;
  white-space: nowrap;
}

.tool:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.tool .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.tool[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.tool[aria-pressed="false"] .tool__label {
  display: none;
}

.tool__chevron {
  margin-inline-start: -0.15rem;
}

.dictate[data-state="ecoute"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.dictate[data-state="preparation"],
.dictate[data-state="transcription"] {
  color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .dictate[data-state="ecoute"] {
    animation: ecoute 1.6s ease-in-out infinite;
  }
}

@keyframes ecoute {
  50% {
    box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--accent) 25%, transparent);
  }
}

/* Bandeau de la dictée : niveau du micro, état, durée. */
.dictation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0.15rem 0.35rem 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  font-size: var(--t-small);
}

.dictation__bars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 1.2rem;
}

.dictation__bars i {
  width: 3px;
  height: 20%;
  border-radius: 2px;
  background: var(--accent);
  transition: height 0.08s linear;
}

.dictation__label {
  flex: 1 1 10rem;
  color: var(--ink);
}

.dictation__time {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.dictation__progress {
  flex: 1 1 8rem;
  height: 0.4rem;
  accent-color: var(--accent);
}

.dictation .text-button {
  padding-block: 0;
  font-size: var(--t-small);
}

.composer textarea::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.send {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.send:disabled {
  background: var(--surface-2);
  color: var(--ink-3);
}

.send .icon--stop,
.send[data-mode="stop"] .icon--send {
  display: none;
}

.send[data-mode="stop"] .icon--stop {
  display: block;
}

.send .icon {
  stroke-width: 2.1;
}

.composer-note {
  margin-top: 0.5rem;
  color: var(--danger-ink);
  font-size: var(--t-ui);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.5rem;
  margin-top: 0.9rem;
  list-style: none;
}

.suggestion {
  padding: 0.35rem 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: var(--t-ui);
  text-align: start;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 0.22em;
}

.suggestion:hover {
  text-decoration-color: currentColor;
}

.fineprint {
  margin-top: 0.75rem;
  color: var(--ink-3);
  font-size: var(--t-small);
}

.app[data-view="thread"] .fineprint {
  text-align: center;
}

/* ------------------------------------------------------------- discussion */

.messages {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.25rem 0 2rem;
  list-style: none;
}

.message {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.message--user {
  align-self: flex-end;
  max-width: min(88%, 34rem);
  padding: 0.6rem 1rem;
  border-radius: 1.2rem 1.2rem 0.3rem 1.2rem;
  background: var(--surface-2);
  white-space: pre-wrap;
  /* Évite un dernier mot (ou un « ? ») seul sur sa ligne, là où le navigateur sait le faire. */
  text-wrap: pretty;
}

.message--assistant {
  position: relative;
  padding-inline-start: 2.1rem;
}

/* Le signe de Céleste : un astre sur son orbite. */
.message__sign {
  position: absolute;
  inset-inline-start: 0.15rem;
  top: 0.32rem;
  width: 1.05rem;
  height: 1.05rem;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}

.message__sign::after {
  content: "";
  position: absolute;
  top: -0.2rem;
  inset-inline-end: -0.12rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .message[data-state="waiting"] .message__sign,
  .message[data-state="streaming"] .message__sign {
    animation: orbit 1.6s linear infinite;
  }
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

.message__status,
.message__note {
  color: var(--ink-3);
  font-size: var(--t-ui);
}

.message__note {
  margin-top: 0.6rem;
}

.message__error {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-small);
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.message__actions {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

/* --------------------------------------------------- texte des réponses */

.prose {
  max-width: 41rem;
}

.prose > * + * {
  margin-top: 0.85em;
}

.prose p,
.prose li,
.prose blockquote {
  text-wrap: pretty;
}

.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 1.5em;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: var(--t-title);
  font-weight: 600;
}

.prose h4 {
  font-size: var(--t-lead);
  font-weight: 650;
}

.prose h5,
.prose h6 {
  font-size: var(--t-body);
  font-weight: 700;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.4em;
}

.prose li + li,
.prose li > ul,
.prose li > ol {
  margin-top: 0.3em;
}

.prose li > * + * {
  margin-top: 0.5em;
}

.prose li::marker {
  color: var(--ink-3);
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--line-strong);
  color: var(--ink-2);
}

.prose blockquote > * + * {
  margin-top: 0.6em;
}

.prose hr {
  height: 1px;
  border: 0;
  background: var(--line);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.92em;
}

.code {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.15rem 0.5rem 0.15rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--t-small);
}

.code__copy {
  min-height: 2rem;
  padding: 0.2rem 0.5rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  font-size: var(--t-small);
}

.code__copy:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.code pre {
  padding: 0.8rem 0.9rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  tab-size: 4;
}

.code pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

.table-wrap {
  overflow-x: auto;
}

.prose table {
  border-collapse: collapse;
  font-size: var(--t-ui);
  font-variant-numeric: tabular-nums;
}

.prose th,
.prose td {
  padding: 0.4rem 1.25rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.prose th {
  border-bottom-color: var(--line-strong);
  font-weight: 650;
}

.prose [data-align="right"] {
  text-align: right;
}

.prose [data-align="center"] {
  text-align: center;
}

/* ------------------------------------------------------ pages de texte */

.page {
  width: min(100% - 2.5rem, 40rem);
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.page__top {
  display: flex;
  align-items: center;
  margin: 0 -0.5rem 2.5rem;
}

.page h1 {
  font-size: var(--t-display);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.page h2 {
  margin-top: 2.5rem;
  font-size: var(--t-title);
  font-weight: 600;
  line-height: 1.25;
}

.page p,
.page ul {
  margin-top: 0.9rem;
}

.page ul {
  padding-inline-start: 1.3em;
}

.page p,
.page li {
  text-wrap: pretty;
}

.page li + li {
  margin-top: 0.35rem;
}

.page .lead {
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: var(--t-lead);
}

.page .page__updated {
  margin-top: 0.6rem;
  color: var(--ink-3);
  font-size: var(--t-small);
}

.page .page__back {
  margin-top: 2.5rem;
}

/* Un lien du sommaire amène le titre un peu sous le haut de l'écran, pas collé
   contre le bord. */
.page h2[id] {
  scroll-margin-top: 1.5rem;
}

/* Sommaire des pages longues : une liste de liens, sur deux colonnes quand la
   place le permet. Le titre est discret, pour ne pas concurrencer le contenu. */
.page .page__toc {
  margin-top: 2rem;
  padding-block: 1rem 1.1rem;
  border-block: 1px solid var(--line);
}

.page .page__toc h2 {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--t-ui);
  font-weight: 600;
}

.page .page__toc ul {
  margin-top: 0.6rem;
  padding: 0;
  list-style: none;
  columns: 2 15rem;
  column-gap: 2rem;
}

.page .page__toc li {
  margin: 0 0 0.35rem;
  break-inside: avoid;
}

/* Une liste de liens : la couleur suffit à les signaler, le soulignement
   revient au survol et au clavier. */
.page .page__toc a {
  text-decoration: none;
}

.page .page__toc a:hover,
.page .page__toc a:focus-visible {
  text-decoration: underline;
}

/* Mentions légales, bases et durées : un libellé, sa valeur, en deux colonnes
   sur un écran large, l'un sous l'autre sur un téléphone. */
.page .legal {
  margin: 1rem 0 0;
}

.page .legal > div {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 0.2rem 1.25rem;
}

.page .legal dd {
  font-weight: 400;
}

@media (max-width: 36rem) {
  .page .legal > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .page .legal dt {
    color: var(--ink);
    font-weight: 600;
  }
}

.noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 60;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-small);
  background: var(--danger-bg);
  color: var(--danger-ink);
}

@media (max-width: 30rem) {
  .model-badge {
    display: none;
  }

  .message--assistant {
    padding-inline-start: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .message--user,
  .composer,
  .code {
    border: 1px solid CanvasText;
  }

  .message__sign::after,
  .sky__star {
    forced-color-adjust: none;
  }
}

/* ------------------------------------------------------ pièces jointes */

.attachments,
.message__files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.attachments {
  padding: 0.25rem 0.25rem 0.6rem;
}

.message__files {
  justify-content: flex-end;
  margin-top: 0.4rem;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--t-small);
  text-decoration: none;
}

a.file-chip:hover {
  border-color: var(--line-strong);
}

.file-chip .icon {
  width: 1rem;
  height: 1rem;
  color: var(--ink-2);
}

.file-chip__name {
  overflow: hidden;
  max-width: 14rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip__status {
  color: var(--ink-3);
}

.file-chip--error {
  border-color: var(--danger-ink);
  background: var(--danger-bg);
}

.file-chip--error .file-chip__status {
  color: var(--danger-ink);
}

.file-chip--gone {
  background: none;
  color: var(--ink-3);
}

.file-chip__remove {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-inline-end: -0.35rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
}

.file-chip__remove:hover {
  background: var(--line);
  color: var(--ink);
}

/* ------------------------------------------------- champs de formulaire */

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field label,
.setting__label {
  font-size: var(--t-ui);
  font-weight: 600;
}

.field input,
.select {
  min-height: 2.75rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.field input:focus-visible,
.select:focus-visible {
  border-color: var(--accent);
  outline-offset: 0;
}

.field__code {
  font-family: var(--mono);
  font-size: var(--t-title);
  letter-spacing: 0.3em;
  text-align: center;
}

.field__hint,
.setting__help {
  color: var(--ink-3);
  font-size: var(--t-small);
}

.button--danger {
  border-color: var(--danger-ink);
  color: var(--danger-ink);
}

.button--danger:hover {
  background: var(--danger-bg);
}

.button:disabled {
  opacity: 0.55;
}

/* Interrupteur : une case à cocher, dessinée comme un bouton à glissière. */
.switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 3rem;
  height: 1.75rem;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  inset-block-start: 0.2rem;
  inset-inline-start: 0.2rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--ink-3);
  transition: inset-inline-start 0.15s ease;
}

.switch:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.switch:checked::after {
  inset-inline-start: 1.45rem;
  background: var(--accent-ink);
}

/* ------------------------------------------------------ porte d'entrée */

.gate {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.gate__top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
}

.gate__main {
  display: grid;
  flex: 1 1 auto;
  align-content: center;
  gap: 1.5rem;
  width: min(100% - 2rem, 64rem);
  margin-inline: auto;
  padding-block: 1rem 2rem;
}

.gate__sky .sky-frame {
  margin: 0;
}

.gate__sky .sky-caption {
  width: auto;
}

.gate__card {
  width: min(100%, 24rem);
  margin-inline: auto;
}

.gate__card h1 {
  font-size: var(--t-display);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.gate__lead {
  margin: 0.5rem 0 1.5rem;
  color: var(--ink-2);
}

.gate__identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.gate__submit {
  width: 100%;
}

.gate__error,
.gate__warning,
.gate__info {
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-small);
  font-size: var(--t-ui);
}

.gate__error {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.gate__warning {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.gate__info {
  background: var(--surface-2);
}

.gate__approval {
  margin-bottom: 1rem;
  text-align: center;
}

/* Le numéro à comparer avec celui de l'appareil qui valide. */
.gate__number {
  font-family: var(--mono);
  font-size: clamp(4rem, 3rem + 6vw, 6rem);
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--accent);
}

.gate__waiting {
  color: var(--ink-2);
}

.gate__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 1rem;
  font-size: var(--t-ui);
}

.gate__closed {
  color: var(--ink-3);
}

.gate__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  padding: 1rem;
  font-size: var(--t-small);
}

.gate__foot a {
  color: var(--ink-3);
}

.gate__foot .select {
  min-height: 2.25rem;
  padding-block: 0.25rem;
  font-size: var(--t-small);
}

@media (min-width: 60rem) {
  .gate__main {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
  }
}

/* ------------------------------------------------- bouton du compte */

.account-button {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  margin-inline: -0.5rem;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--ink);
  font-size: var(--t-ui);
  text-align: start;
}

.account-button:hover {
  background: var(--surface-2);
}

.account-button__text {
  display: grid;
  min-width: 0;
}

.account-button__name {
  overflow: hidden;
  color: var(--ink-3);
  font-size: var(--t-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------- réglages */

.settings {
  width: min(100% - 1.5rem, 46rem);
  height: min(100dvh - 3rem, 40rem);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

.settings[open] {
  display: flex;
  flex-direction: column;
}

.settings::backdrop {
  background: var(--scrim);
}

.settings__head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.5rem;
  padding-inline: 1.25rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.settings__head h2 {
  font-size: var(--t-lead);
  font-weight: 650;
}

.settings__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.settings__tabs {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 0.15rem;
  width: 11.5rem;
  padding: 0.75rem;
  background: var(--panel);
}

.settings__tabs [role="tab"] {
  min-height: 2.5rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--ink-2);
  font-size: var(--t-ui);
  text-align: start;
}

.settings__tabs [role="tab"]:hover {
  background: var(--surface-2);
}

.settings__tabs [role="tab"][aria-selected="true"] {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}

.settings__panels {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.25rem;
  overflow-y: auto;
}

.setting {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
}

.setting > .setting__label,
legend.setting__label {
  display: block;
  margin-bottom: 0.4rem;
  padding: 0;
}

.setting--switch {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.setting--actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: var(--t-ui);
}

.choices label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
}

.choices input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--accent);
}

.facts {
  margin: 0 0 1.25rem;
}

.facts > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--ink-2);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.doc-list,
.device-list {
  margin: 0.5rem 0 0.75rem;
  list-style: none;
  font-size: var(--t-ui);
}

.doc-list li,
.device-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.9rem;
  padding-block: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.doc-list__name,
.device-list__name {
  flex: 1 1 10rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.doc-list__meta,
.device-list__meta,
.doc-list__empty {
  color: var(--ink-3);
  font-size: var(--t-small);
}

.settings__status {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  font-size: var(--t-ui);
}

.settings__status[data-kind="error"] {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.changelog__version {
  margin-top: 1rem;
}

.changelog h4 {
  font-size: var(--t-body);
}

.changelog h5 {
  margin-top: 0.6rem;
  color: var(--ink-2);
  font-size: var(--t-ui);
}

.changelog ul {
  margin-top: 0.25rem;
  padding-inline-start: 1.2rem;
  font-size: var(--t-ui);
}

@media (max-width: 40rem) {
  .settings {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .settings__body {
    flex-direction: column;
  }

  .settings__tabs {
    flex-direction: row;
    width: auto;
    overflow-x: auto;
  }

  .settings__tabs [role="tab"] {
    flex: none;
  }
}

/* ------------------------------------ pages de l'appareil de validation */

.device__request {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.device__detail {
  color: var(--ink-2);
}

.device__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.device form {
  margin-top: 1.5rem;
}

.device__code {
  font-size: var(--t-lead);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ------------------------------------------------- choix de la langue */

.lang-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.5rem;
  padding: 0 0.35rem 0 0.6rem;
  border-radius: 999px;
  color: var(--ink-2);
}

.lang-picker:hover,
.lang-picker:focus-within {
  background: var(--surface-2);
  color: var(--ink);
}

.lang-picker__select {
  max-width: 9.5rem;
  min-height: 2.5rem;
  padding: 0 0.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: var(--t-ui);
  font-weight: 600;
  cursor: pointer;
}

.lang-picker__select:focus-visible {
  outline: none;
}

.lang-picker:has(.lang-picker__select:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-picker__select option {
  background: var(--surface);
  color: var(--ink);
}

.lang-picker__code {
  display: none;
  min-width: 1.5rem;
  font-size: var(--t-ui);
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* Écran étroit : l'icône et le code de la langue ; la liste, transparente,
   couvre les deux et s'ouvre au toucher comme d'habitude. */
@media (max-width: 30rem) {
  .lang-picker {
    padding-inline: 0.55rem 0.6rem;
  }

  .lang-picker__code {
    display: inline;
  }

  .lang-picker__select {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    opacity: 0;
  }
}

/* -------------------------------------------------------------- menus */

.menu {
  position: fixed;
  z-index: 40;
  min-width: 13rem;
  max-width: min(22rem, 100vw - 1rem);
  padding: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: 0 0.75rem 2rem #0206143d;
}

.menu__item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font-size: var(--t-ui);
  text-align: start;
}

.menu__item:hover,
.menu__item:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.menu__item--danger {
  color: var(--danger-ink);
}

.menu__item .icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.12rem;
  color: var(--ink-2);
}

.menu__item--danger .icon {
  color: inherit;
}

.menu__text {
  display: grid;
  gap: 0.1rem;
}

.menu__help {
  color: var(--ink-3);
  font-size: var(--t-small);
}

.menu__check {
  visibility: hidden;
  margin-inline-start: auto;
}

.menu__item[aria-checked="true"] .menu__check {
  visibility: visible;
  color: var(--accent);
}

.menu__note {
  margin: 0.25rem 0.65rem 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--t-small);
}

/* ---------------------------------------- discussions : menu et archives */

.conversation__menu {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-3);
  opacity: 0;
}

.conversation:hover .conversation__menu,
.conversation__menu:focus-visible,
.conversation__menu[aria-expanded="true"] {
  opacity: 1;
}

.conversation__menu:hover {
  color: var(--ink);
}

@media (max-width: 59.99rem) {
  .conversation__menu {
    opacity: 1;
  }
}

.archives {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.archives__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-small);
  color: var(--ink-2);
  font-size: var(--t-ui);
  cursor: pointer;
  list-style: none;
}

.archives__summary::-webkit-details-marker {
  display: none;
}

.archives__summary:hover {
  background: var(--surface-2);
}

.archives__summary .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.archives__count {
  margin-inline-start: auto;
  color: var(--ink-3);
  font-size: var(--t-small);
}

.archives ul {
  list-style: none;
}

.thread-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-top: 1rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--t-ui);
}

.thread-note .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.thread-note span {
  flex: 1 1 14rem;
}

/* ------------------------------------------------------ réponses : à côté */

.message__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.5rem;
  color: var(--ink-3);
  font-size: var(--t-small);
}

.message__actions .text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.message__actions .icon {
  width: 1rem;
  height: 1rem;
}


/* ------------------------------------------ petites fenêtres de dialogue */

.sheet {
  width: min(100% - 1.5rem, 30rem);
  max-height: min(100dvh - 2rem, 40rem);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

.sheet::backdrop {
  background: var(--scrim);
}

.sheet__body {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem;
}

.sheet__title {
  font-size: var(--t-lead);
  font-weight: 650;
}

.sheet__text {
  color: var(--ink-2);
  font-size: var(--t-ui);
}

.sheet .field {
  margin: 0;
}

.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

/* ------------------------------------------------- réglages : compléments */

.setting--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.setting--inline > div {
  flex: 1 1 14rem;
}

/* --------------------------------------- préférences du système suivies */

/* Contraste élevé demandé par l'appareil : textes plus foncés, bordures plus nettes.
   « :root:root » l'emporte sur les couleurs des thèmes clair et sombre ci-dessus. */
@media (prefers-contrast: more) {
  :root:root {
    --ink-2: var(--ink);
    --ink-3: color-mix(in srgb, var(--ink) 82%, var(--bg));
    --line: var(--line-strong);
  }

  .message--user,
  .composer {
    border: 1px solid var(--line-strong);
  }
}
