@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600&display=swap");
:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #14171c; --muted: #5b6270; --line: #dfe2e8;
  --accent: #2346d6; --accent-ink: #ffffff; --accent-soft: #e6ebfc;
  --ok: #17824a; --ok-soft: #dcf3e6; --warn: #a8600c; --warn-soft: #fbedd8;
  --f-ui: "Archivo", "Helvetica Neue", Arial, sans-serif; --f-num: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216; --panel: #181b21; --ink: #eceef2; --muted: #9aa1ad; --line: #2a2f38;
    --accent: #7d97ff; --accent-ink: #0d1020; --accent-soft: #1f2645;
    --ok: #63d495; --ok-soft: #173a27; --warn: #f2b15f; --warn-soft: #3a2a15; color-scheme: dark;
  }
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 16px; line-height: 1.5 }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)) }
h1, h2, h3 { line-height: 1.12; margin: 0 }
h1 { font-size: clamp(30px, 6vw, 50px); font-weight: 800; letter-spacing: -0.02em }
h2 { font-size: 24px; font-weight: 800 }
h3 { font-size: 17px; font-weight: 700 }
p { margin: 0 }
.muted { color: var(--muted) }
.small { font-size: 14px }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums }
button, input, textarea, select { font: inherit; color: inherit }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 18px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.btn:disabled { opacity: .5; cursor: default }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted) }
.field input, .field textarea, .field select { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 12px; padding: 11px 12px; font-weight: 500; font-size: 16px; width: 100% }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr } }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 }
.logo { font-weight: 800; font-size: 22px; letter-spacing: .04em }
.banner { background: var(--ok-soft); color: var(--ok); border-radius: 14px; padding: 12px 16px; font-weight: 600 }
/* chat */
.chat { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; padding: 4px 2px }
.bulle { max-width: 82%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word }
.bulle.moi { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px }
.bulle.lui { justify-self: start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px }
.bulle time { display: block; font-size: 11px; opacity: .7; margin-top: 2px }
.envoi { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px }
.envoi textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; resize: none; min-height: 46px; font-size: 16px }
.vide { color: var(--muted); text-align: center; padding: 20px 8px }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important } }
