/* Jarvis — nouvelle interface (30/10/2026). Pensée pour l'iPhone d'abord : fond clair, grande typographie, peu d'éléments. */
:root {
  --fond: #f5f5f7; --carte: #ffffff; --texte: #1d1d1f; --doux: #6e6e73; --trait: rgba(0, 0, 0, .08);
  --bleu: #0071e3; --vert: #248a3d; --vert-fond: #e8f5ec; --rouge: #d70015; --rouge-fond: #fdecee;
  --orange: #b25000; --orange-fond: #fff3e0; --gris-fond: #ececf0;
  --verre: rgba(245, 245, 247, .78); --ombre: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --r: 22px; --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #000; --carte: #1c1c1e; --texte: #f5f5f7; --doux: #98989d; --trait: rgba(255, 255, 255, .1);
    --bleu: #2997ff; --vert: #30d158; --vert-fond: #0f2a17; --rouge: #ff453a; --rouge-fond: #3a1210;
    --orange: #ff9f0a; --orange-fond: #33230a; --gris-fond: #2c2c2e; --verre: rgba(22, 22, 24, .78);
    --ombre: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font: 100%/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; background: var(--fond); color: var(--texte); }
body { margin: 0; min-height: 100vh; background: var(--fond); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--bleu); text-decoration: none; }
[hidden] { display: none !important; }

main { max-width: 680px; margin: 0 auto; padding: calc(var(--haut) + 18px) 18px calc(var(--bas) + 110px); }
.chargement { color: var(--doux); font-size: 1.1rem; padding-top: 30vh; text-align: center; }

/* Titres : grande typographie, approche resserrée */
.surtitre { font-size: .82rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--doux); margin: 0 0 4px; }
h1 { font-size: 2.15rem; line-height: 1.08; letter-spacing: -.025em; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 1.32rem; line-height: 1.2; letter-spacing: -.015em; font-weight: 700; margin: 30px 0 10px; }
.sous { color: var(--doux); font-size: 1rem; margin: 0 0 20px; }
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.entete .lien { font-size: 1rem; font-weight: 500; padding: 8px 0; }

/* Carte de base */
.bloc { background: var(--carte); border-radius: var(--r); box-shadow: var(--ombre); padding: 18px 20px; margin: 0 0 12px; }
.bloc.tap { display: block; color: inherit; transition: transform .12s ease-out; }
.bloc.tap:active, .ligne.tap:active { transform: scale(.98); }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grille .bloc { margin: 0; }
.chiffre { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.etiquette { color: var(--doux); font-size: .88rem; margin-top: 4px; }
.petit { font-size: .85rem; color: var(--doux); }

/* État global */
.etat { border-radius: 26px; padding: 22px 22px 20px; margin: 4px 0 14px; }
.etat.ok { background: var(--vert-fond); }
.etat.attention { background: var(--orange-fond); }
.etat.probleme { background: var(--rouge-fond); }
.etat .grand { font-size: 1.9rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.etat.ok .grand { color: var(--vert); } .etat.attention .grand { color: var(--orange); } .etat.probleme .grand { color: var(--rouge); }
.etat ul { margin: 12px 0 0; padding: 0; list-style: none; }
.etat li a { display: block; color: var(--texte); padding: 7px 0; border-top: 1px solid var(--trait); font-size: .98rem; }
.etat li:first-child a { border-top: 0; }

.ligne { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--trait); color: inherit; }
.ligne:first-child { border-top: 0; }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .nom { font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; }
.ligne .info { color: var(--doux); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.point { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--doux); }
.point.vert { background: #34c759; } .point.orange { background: #ff9500; } .point.rouge { background: #ff3b30; } .point.gris { background: #c7c7cc; }

/* Pastilles et filtres */
.pastilles { display: flex; gap: 8px; overflow-x: auto; padding: 2px 18px 10px; margin: 0 -18px 8px; scrollbar-width: none; }
.pastilles::-webkit-scrollbar { display: none; }
.pastille { flex: none; padding: 8px 15px; border-radius: 999px; background: var(--gris-fond); font-size: .92rem; font-weight: 500; }
.pastille[aria-pressed="true"] { background: var(--texte); color: var(--fond); }
.marque { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--gris-fond);
  color: var(--doux); margin-right: 6px; }
.marque.urgent { background: var(--rouge-fond); color: var(--rouge); }
.marque.obsolete { background: var(--orange-fond); color: var(--orange); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 16px;
  font-size: 1.06rem; font-weight: 600; background: var(--gris-fond); color: var(--texte); transition: transform .1s ease-out, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn.plein { width: 100%; }
.btn.bleu { background: var(--bleu); color: #fff; }
.btn.vert { background: #34c759; color: #fff; }
.btn.rouge { background: #ff3b30; color: #fff; }
.btn.rouge-doux { background: var(--rouge-fond); color: var(--rouge); }
.btn.petit { min-height: 38px; padding: 0 14px; font-size: .92rem; border-radius: 12px; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; }
.rangee .btn { flex: 1; }

/* Décision : une carte à la fois */
.decision { background: var(--carte); border-radius: 28px; box-shadow: var(--ombre); padding: 22px 22px 18px; margin-bottom: 14px;
  transition: transform .32s cubic-bezier(.2, .9, .3, 1), opacity .25s ease; will-change: transform; }
.decision.part-droite { transform: translateX(110%) rotate(4deg); opacity: 0; }
.decision.part-gauche { transform: translateX(-110%) rotate(-4deg); opacity: 0; }
.decision.part-bas { transform: translateY(40px); opacity: 0; }
.decision.arrive { animation: arrive .3s cubic-bezier(.2, .9, .3, 1); }
@keyframes arrive { from { transform: translateY(18px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.decision h1 { font-size: 1.75rem; margin: 10px 0 12px; }
.decision .contexte { font-size: 1.08rem; line-height: 1.5; margin: 0 0 14px; }
.decision .question { font-weight: 600; font-size: 1.05rem; margin: 0 0 12px; }
.options { margin: 0 0 14px; padding: 0; list-style: none; }
.options li { padding: 9px 12px; border-radius: 12px; background: var(--fond); margin-bottom: 6px; font-size: .95rem; }
.conseil { border-radius: 16px; padding: 12px 14px; background: var(--gris-fond); font-size: .97rem; margin-bottom: 10px; }
.conseil b { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--doux); margin-bottom: 2px; }
.avertir { border-radius: 16px; padding: 12px 14px; background: var(--orange-fond); color: var(--orange); font-size: .95rem; margin-bottom: 10px; }
.doublons { border-radius: 16px; padding: 12px 14px; background: var(--fond); font-size: .95rem; margin-bottom: 10px; }
.meta { color: var(--doux); font-size: .84rem; margin-top: 6px; }
.compteur { color: var(--doux); font-size: .95rem; font-variant-numeric: tabular-nums; }

/* Barre d'actions de la décision (au pouce, en bas) */
.actions { position: fixed; left: 0; right: 0; bottom: calc(var(--bas) + 64px); z-index: 20; padding: 10px 18px 10px;
  background: var(--verre); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.actions .dedans { max-width: 680px; margin: 0 auto; }
.actions .rangee .btn { min-height: 58px; font-size: 1.12rem; border-radius: 18px; white-space: nowrap; padding: 0 10px; }
.actions .second { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.actions .second button { color: var(--bleu); font-size: .98rem; font-weight: 500; padding: 8px 4px; }
main.avec-actions { padding-bottom: calc(var(--bas) + 230px); }

/* Onglets translucides */
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  padding: 6px 8px calc(var(--bas) + 6px); background: var(--verre); -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--trait); }
.onglets a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
  color: var(--doux); font-size: .7rem; font-weight: 500; position: relative; }
.onglets a svg { width: 26px; height: 26px; }
.onglets a[aria-current="page"] { color: var(--bleu); }
.onglets .badge { position: absolute; top: 0; left: 55%; background: #ff3b30; color: #fff; font-size: .68rem; font-weight: 700;
  border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; }

/* Feuille (confirmation, réponse) */
.couche { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-end; justify-content: center;
  animation: fondu .2s ease; }
@keyframes fondu { from { opacity: 0; } }
.feuille { width: 100%; max-width: 560px; background: var(--carte); border-radius: 26px 26px 0 0; padding: 10px 20px calc(var(--bas) + 20px);
  animation: monte .32s cubic-bezier(.2, .9, .3, 1); max-height: 88vh; overflow-y: auto; }
@keyframes monte { from { transform: translateY(100%); } }
.feuille .poignee { width: 38px; height: 5px; border-radius: 3px; background: var(--trait); margin: 0 auto 14px; }
.feuille h2 { margin: 4px 0 8px; font-size: 1.4rem; }
.feuille p { margin: 0 0 16px; color: var(--doux); }
.feuille .rangee { margin-top: 10px; }
textarea, input[type=password], input[type=text] { width: 100%; border: 1px solid var(--trait); border-radius: 16px; padding: 14px 16px;
  background: var(--fond); font-size: 1.05rem; outline: none; }
textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
textarea:focus, input:focus { border-color: var(--bleu); }
.choix-duree { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 6px; }

/* Bulle de message */
.bulle { position: fixed; left: 50%; bottom: calc(var(--bas) + 150px); transform: translateX(-50%); z-index: 60; max-width: min(92vw, 520px);
  background: rgba(29, 29, 31, .92); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: .95rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  animation: fondu .2s ease; }
.bulle.erreur { background: #d70015; }

/* RunPod */
.runpod .grand { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.runpod .grand.on { color: var(--vert); }

/* Demandes */
.micro { width: 52px; min-height: 52px; padding: 0; flex: none !important; }
.micro.ecoute { background: #ff3b30; color: #fff; }

/* Connexion */
.connexion { padding-top: 14vh; text-align: center; }
.connexion h1 { font-size: 2.6rem; }
.connexion form { max-width: 360px; margin: 26px auto 0; display: grid; gap: 12px; }

.vide { text-align: center; padding: 50px 10px; }
.vide .grand { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }

@media (min-width: 900px) {
  main { max-width: 760px; padding-top: 40px; }
  h1 { font-size: 2.6rem; }
  .grille.trois { grid-template-columns: 1fr 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: opacity .15s ease !important; }
  .decision.part-droite, .decision.part-gauche, .decision.part-bas { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .onglets, .actions { background: var(--fond); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
