:root{
  --border:#ddd;
  --muted:#666;
  --bg:#fff;
  --soft:#fafafa;
  --err:#b00020;
  --btn:#fff;
  --btn-border:#ccc;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
}

*{ box-sizing:border-box; }

/* --- Layout: page fixe (pas de scroll global), chat scrollable --- */
html, body { height: 100%; }

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  margin: 0;
  background: var(--bg);
  color: #111;
  overflow: hidden; /* empêche le scroll global */
}

.app{
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.container{
  max-width: 980px;
  margin: 0 auto;
}

/* header fixe */
.header{
  flex: 0 0 auto;
  padding: 24px 24px 12px;
  background: var(--bg);
}

/* zone chat (frame scroll) */
.chatScroller{
  flex: 1 1 auto;
  min-height: 0;            /* CRUCIAL en flex pour que overflow fonctionne */
  overflow-y: auto;
  padding: 0 24px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.topbar{ display:flex; align-items:center; gap:12px; margin: 0 0 14px; }
.logo{ height:80px; width:auto; vertical-align:middle; }

h1{ margin:0; font-size:22px; }
.muted{ color: var(--muted); font-size: 13px; }

.row{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin: 12px 0; }

.rowBreak{
  flex-basis: 100%;
  height: 0;
}

select, input, button, textarea{ font-size:14px; }

textarea{
  width: 100%;
  min-height: 90px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  resize: vertical;
}

select, input, button{
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--btn-border);
  background: var(--btn);
  box-shadow: var(--shadow);
}

button{ cursor:pointer; font-weight:600; }
button[disabled]{ cursor:default; opacity:.55; }

.vocalToggle{
  border: 1px solid var(--btn-border);
}
.vocalToggle.on{
  border-color: #97c2ff;
  box-shadow: 0 0 0 3px rgba(104, 160, 255, .18);
}

.turn{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
  background: var(--bg);
}

.turn h2{ margin:0 0 8px; font-size:14px; }

.answer{
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid #eee;
  white-space: pre-wrap;
  word-break: break-word;
}

.meta{ margin-top: 8px; }

.cit{ margin-top: 10px; font-size: 13px; }
.cit ul{ margin: 6px 0 0; padding-left: 18px; }
.cit li{ margin: 4px 0; }

.err{ color: var(--err); }

.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.small{ font-size: 12px; }

/* --- Avatars "Toi" / "Neo" --- */
.who{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 8px;
}
.who h2{
  margin:0;
  font-size:14px;
}
.who-icon{
  height:28px;
  width:28px;
  border-radius:8px;
  object-fit:contain;
  flex: 0 0 auto;
  box-shadow: var(--shadow);
  background: #fff;
  border: 1px solid #eee;
}

/* --- Pastel backgrounds --- */
textarea.qbox{
  background: #eaf4ff; /* bleu pastel très clair */
}
.answer.answer-neo{
  background: #fff6d6; /* jaune pastel très clair */
  border-color: #f1e6b2;
}

/* Hint line under action buttons */
.hint{
  margin-top: 6px;
}

/* Mobile: reduce paddings a bit */
@media (max-width: 560px){
  .header{
    padding: 14px 12px 10px;
  }
  .chatScroller{
    padding: 0 12px 14px;
  }
  button, select, input{
    padding: 10px 12px;
  }
  .logo{ height:42px; }
}

/* "Je réfléchie..." en bleu + respiration */
.thinkingWrap{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  animation: breatheBlue 1.6s ease-in-out infinite;
  color: #fd8585; /* bleu foncé (point de départ) */
}

/* Spinner (prend la couleur courante = suit la respiration) */
.spinner{
  display:inline-block;
  width:14px;
  height:14px;
  border:2px solid currentColor;
  border-top-color: transparent;
  border-radius:50%;
  animation: spin .8s linear infinite;
  vertical-align: -2px;
}

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

@keyframes breatheBlue{
  0%   { color:#fd8585; opacity:1; }
  50%  { color:#facbcb; opacity:.65; } /* bleu clair */
  100% { color:#fd8585; opacity:1; }
}

/* Accessibilité: réduit les animations si l’utilisateur le demande */
@media (prefers-reduced-motion: reduce){
  .thinkingWrap{ animation: none; }
  .spinner{ animation: none; }
}


