/* Valore — boite a messages vers Claude. Fond chaud comme Fit, accent indigo
   pour la distinguer de l'appli sport. Pensee pour le pouce, sur telephone. */

:root {
  color-scheme: light;
  --bg: #F3F2EE; --surface: #FFFFFF; --surface-2: #F0EEE9; --surface-3: #E7E5DF;
  --ink: #151515; --ink-2: #4A4A48; --ink-3: #72716D;
  --rule: #E5E3DD;
  --accent: #4C4CE0; --accent-ink: #3A38B8; --accent-soft: #E7E7FB; --on-accent: #FFFFFF;
  --good: #1E8A4B; --bad: #BE3A2A; --bad-soft: #F8E2DE;
  --shadow: 0 1px 2px rgb(20 20 20 / .04), 0 6px 24px rgb(20 20 20 / .06);
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 20px; --r-s: 13px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0F0F10; --surface: #19191B; --surface-2: #222225; --surface-3: #2C2C30;
    --ink: #F3F2EF; --ink-2: #C0BFBB; --ink-3: #908F8B;
    --rule: #2A2A2D;
    --accent: #7A7AFF; --accent-ink: #9B9BFF; --accent-soft: #23234A; --on-accent: #0C0C1A;
    --good: #4CC47E; --bad: #F07A6A; --bad-soft: #3A1D19;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }

/* ── ossature ── */
.app { max-width: 720px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
.bar .pastille { width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; color: var(--on-accent); flex: none; }
.bar .sp { flex: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-2); flex: none; cursor: pointer; }
.icon-btn:active { background: var(--surface-3); }

/* ── fil ── */
.fil { flex: 1; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 14px; }
.vide { margin: auto 0; text-align: center; color: var(--ink-3); padding: 40px 20px; }
.vide svg { margin-bottom: 14px; opacity: .5; }

.jour { align-self: center; font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  background: var(--surface-3); padding: 3px 11px; border-radius: 999px; margin-top: 4px; }

.msg { max-width: 86%; display: flex; flex-direction: column; gap: 6px; }
.msg.moi { align-self: flex-end; align-items: flex-end; }
.msg.claude { align-self: flex-start; align-items: flex-start; }
.bulle { padding: 11px 14px; border-radius: var(--r); box-shadow: var(--shadow);
  white-space: pre-wrap; overflow-wrap: anywhere; }
.moi .bulle { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 7px; }
.claude .bulle { background: var(--surface); border-bottom-left-radius: 7px; }
.meta { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; padding: 0 4px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); }
.lu { color: var(--good); font-weight: 600; }

.photos { display: grid; gap: 5px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  max-width: 340px; }
.photos.une { grid-template-columns: 1fr; }
.photos img { width: 100%; height: 100%; max-height: 260px; object-fit: cover; border-radius: var(--r-s);
  background: var(--surface-3); display: block; cursor: zoom-in; }
.photos.une img { max-height: 340px; object-fit: contain; }

.suppr { border: 0; background: transparent; color: var(--ink-3); font-size: 12px; cursor: pointer;
  padding: 2px 4px; }
.suppr:active { color: var(--bad); }

.avance { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 12px; margin: 0 2px 9px; }
.avance.attente { background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow); }
.avance.absent  { background: var(--bad-soft); color: var(--bad); }
.pts { display: inline-flex; gap: 3px; }
.pts i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: block;
  animation: rebond 1.2s infinite ease-in-out; }
.pts i:nth-child(2) { animation-delay: .18s; }
.pts i:nth-child(3) { animation-delay: .36s; }
@keyframes rebond { 0%, 60%, 100% { opacity: .28; transform: translateY(0); }
                    30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .pts i { animation: none; opacity: .6; } }

/* ── zone de saisie ── */
.compo { position: sticky; bottom: 0; z-index: 5; background: var(--bg);
  border-top: 1px solid var(--rule); padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); }
.sujets { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 8px; scrollbar-width: none; }
.sujets::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2);
  padding: 5px 13px; border-radius: 999px; font-size: 13.5px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

.apercus { display: flex; gap: 7px; overflow-x: auto; padding: 0 2px 9px; scrollbar-width: none; }
.apercus::-webkit-scrollbar { display: none; }
.apercu { position: relative; flex: none; }
.apercu img { width: 66px; height: 66px; object-fit: cover; border-radius: 11px; display: block; }
.apercu button { position: absolute; top: -5px; right: -5px; width: 23px; height: 23px; border-radius: 50%;
  border: 2px solid var(--bg); background: var(--ink); color: var(--bg); display: grid; place-items: center;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }

.ligne { display: flex; align-items: flex-end; gap: 7px; }
.ligne textarea { flex: 1; resize: none; border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink); border-radius: 21px; padding: 10px 15px; max-height: 148px; min-height: 42px;
  line-height: 1.4; }
.ligne textarea::placeholder { color: var(--ink-3); }
.rond { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center; flex: none; cursor: pointer; }
.rond:active { background: var(--surface-3); }
.envoi { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.envoi:disabled { opacity: .4; }
.etat { font-size: 12.5px; color: var(--ink-3); padding: 6px 4px 0; min-height: 19px; }
.etat.err { color: var(--bad); }

/* ── visionneuse ── */
.loupe { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / .93); display: grid;
  place-items: center; padding: env(safe-area-inset-top) 10px env(safe-area-inset-bottom); }
.loupe img { max-width: 100%; max-height: 100%; object-fit: contain; }
.loupe button { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px;
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .16);
  color: #fff; display: grid; place-items: center; cursor: pointer; }

/* ── connexion ── */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.carte { width: 100%; max-width: 340px; background: var(--surface); border-radius: var(--r);
  padding: 28px 24px; box-shadow: var(--shadow); text-align: center; }
.carte .pastille { width: 52px; height: 52px; border-radius: 15px; background: var(--accent);
  color: var(--on-accent); display: grid; place-items: center; margin: 0 auto 16px; }
.carte h1 { margin-bottom: 6px; font-size: 23px; }
.carte input { width: 100%; margin: 20px 0 12px; padding: 12px 15px; border-radius: 12px;
  border: 1px solid var(--rule); background: var(--surface-2); color: var(--ink); text-align: center; }
.carte button { width: 100%; padding: 12px; border-radius: 12px; border: 0; background: var(--accent);
  color: var(--on-accent); font-weight: 600; cursor: pointer; }
.carte .err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 10px; }
