/* Coquille de l'app : sidebar + colonne de chat plein écran. Tokens uniquement. */
html, body { margin: 0; height: 100%; }
body { background: var(--color-bg); color: var(--color-text); font-family: var(--font-sans); font-size: var(--text-md); line-height: var(--leading-normal); }
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--color-bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.app__backdrop { display: none; }
/* Mobile : la sidebar devient un tiroir (translation hors écran), rouvert par .app--sidebar-open. */
@media (max-width: 720px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: var(--z-modal); width: min(var(--sidebar-width), 85vw); transform: translateX(-100%); visibility: hidden; transition: transform var(--duration-base) var(--ease-standard), visibility 0s linear var(--duration-base); }
  .app--sidebar-open .sidebar { transform: none; visibility: visible; transition-delay: 0s; box-shadow: var(--shadow-lg); }
  .app--sidebar-open .app__backdrop { display: block; position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1); background: var(--color-overlay); }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none !important; } }

/* ---- Beautify (m0-beautify) -------------------------------------------
   QUOI : the mobile drawer slides with the emphasized easing and its scrim
   fades + blurs the chat behind instead of popping in.
   POURQUOI : orientation — the eye follows where the list came from.
   COMMENT : the scrim is display:block only while open, so the fade is an
   @keyframes on insertion (a transition cannot start from display:none). */
@media (max-width: 720px) {
  .sidebar { transition-timing-function: var(--ease-emphasized); transition-duration: var(--duration-slow); }
  .app--sidebar-open .app__backdrop { backdrop-filter: blur(2px); animation: nx-fade-in var(--duration-base) var(--ease-standard) both; }
}
@keyframes nx-fade-in { from { opacity: 0; } }
/* Ambient light: one faint violet glow in the top-right of the chat pane —
   gives the flat white/ink canvas depth without a single extra element. */
.chat { background:
  radial-gradient(60% 40% at 100% 0%, light-dark(rgb(122 89 255 / 0.06), rgb(122 89 255 / 0.10)), transparent 70%),
  var(--color-bg); }
