/* ArkMemo, nouveau design (refonte Cloudflare 21/11/2026, anne-claude).
   Fiche de goût : sombre #0d0d10, orange #ff7a1a en petites touches, gros boutons blanc sur sombre / noir sur clair, Space Grotesk.
   Règle du pouce : ce qui se touche est en bas ; le haut sert à lire. Les id et classes fabriqués par la logique (index.html)
   sont gardés tels quels : ce fichier ne fait que les habiller et les placer. */

:root, body[data-theme="sombre"] {
  --fond:#0d0d10; --carte:#17171b; --carte-2:#202026; --bord:#2c2c33; --texte:#f2f2f4; --legende:#a2a2aa;
  --accent:#ff7a1a; --accent-pale:rgba(255,122,26,.14); --rouge:#ff6a5a; --vert:#7fd6a0;
  --sur-fort:#0d0d10; --feuille:#131317; --poignee:#3a3a42; --voile:rgba(0,0,0,.55); --lueur:rgba(255,122,26,.10);
  color-scheme: dark;
}
body[data-theme="clair"] {
  --fond:#eeeeef; --carte:#ffffff; --carte-2:#e5e5e9; --bord:#dcdce1; --texte:#0d0d10; --legende:#6c6c74;
  --accent:#e2600c; --accent-pale:rgba(226,96,12,.10); --rouge:#cf3b2c; --vert:#1c9a57;
  --sur-fort:#ffffff; --feuille:#f8f8f9; --poignee:#c4c4ca; --voile:rgba(20,20,26,.30); --lueur:rgba(255,122,26,.07);
  color-scheme: light;
}
body {
  --sasha-carte: var(--carte); --sasha-carte-2: var(--carte-2); --sasha-feuille: var(--feuille); --sasha-texte: var(--texte);
  --sasha-legende: var(--legende); --sasha-bord: var(--bord); --sasha-accent: var(--accent); --sasha-fort: var(--texte); --sasha-sur-fort: var(--sur-fort);
  --sasha-police: "Space Grotesk", system-ui, sans-serif;
  --bas-boutons: 146px;         /* barre Parler + sélecteur de version */
  --sasha-bas: 154px;           /* la barre Sasha se pose juste au-dessus */
  --reserve-bas: 360px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--fond); color: var(--texte); font: 16px/1.4 "Space Grotesk", system-ui, -apple-system, sans-serif;
  background-image: radial-gradient(ellipse 70% 30% at 50% -5%, var(--lueur), transparent 70%); background-attachment: fixed;
  padding: env(safe-area-inset-top) 0 calc(var(--reserve-bas, 300px) + env(safe-area-inset-bottom)) 0 !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- en-tête : à lire ---------- */
header { padding: 14px 20px 0; display: flex; flex-direction: column; }
header .tete { display: flex; align-items: center; gap: 10px; }
header .logo { width: 30px; height: 30px; border-radius: 9px; flex: none; }
header h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
header h1 b { color: var(--accent); font-weight: 600; }
#resume { display: none; margin-left: auto; font-size: 12px; color: var(--legende); background: var(--carte); border-radius: 99px; padding: 7px 12px; white-space: nowrap; max-width: 52%; overflow: hidden; text-overflow: ellipsis; }
#compte { order: -1; font-size: 12px; color: var(--legende); padding: 2px 0 8px; }
#compte b { color: var(--texte); font-weight: 500; }
.lecture { margin-top: 22px; }
.lecture .jour { font-size: 13px; color: var(--legende); }
.lecture .chiffre { font-size: 56px; font-weight: 600; letter-spacing: -.03em; line-height: 1; margin-top: 6px; }
.lecture .chiffre small { font-size: 20px; font-weight: 500; color: var(--legende); letter-spacing: 0; margin-left: 8px; }
.lecture .detail { margin-top: 10px; font-size: 14px; color: var(--legende); display: flex; gap: 14px; flex-wrap: wrap; }
.lecture .detail span { display: inline-flex; align-items: center; gap: 6px; }
.lecture .detail em { font-style: normal; color: var(--accent); }
.point { width: 7px; height: 7px; border-radius: 50%; background: var(--vert); display: inline-block; flex: none; }
.point.rouge { background: var(--rouge); } .point.orange { background: var(--accent); }
.dernieres { margin-top: 22px; }
.dernieres .titre { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--legende); margin-bottom: 6px; }
.dernieres .lu { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--bord); }
.dernieres .lu:first-of-type { border-top: 0; }
.dernieres .lu .h { width: 44px; flex: none; font-size: 12px; color: var(--legende); padding-top: 2px; }
.dernieres .lu .a { font-size: 15px; font-weight: 500; }
.dernieres .lu .b { font-size: 12px; color: var(--legende); margin-top: 2px; }

/* ---------- la liste (tiroirs fabriqués par la logique) ---------- */
main#tiroirs { padding: 0 20px; }
.groupe { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--legende); margin: 22px 2px 4px; }
section { margin: 14px 0 0; }
section h2 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 2px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--legende); border-bottom: 1px solid var(--bord); }
section h2 .ico { font-size: 14px; letter-spacing: 0; filter: grayscale(1); opacity: .75; }
section h2 .nomTiroir { flex: 1; }
section h2 small { font-size: 12px; color: var(--legende); }
section h2 small:empty { display: none; }
section.vide ul::after { content: "Rien pour l'instant"; display: block; padding: 12px 2px; color: var(--legende); font-size: 14px; }
#t-probleme { background: var(--carte); border-radius: 20px; padding: 4px 14px 6px; box-shadow: inset 3px 0 0 var(--rouge); }
#t-probleme h2 { color: var(--rouge); border-bottom: 0; }
ul { list-style: none; margin: 0; padding: 0; }
li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 60px; padding: 8px 0; border-top: 1px solid var(--bord); font-size: 16px; }
li:first-child { border-top: 0; }
li .txt { flex: 1; min-width: 0; font-weight: 500; line-height: 1.3; cursor: text; overflow-wrap: anywhere; }
li small.quand { flex: 0 0 100%; order: 8; margin: -6px 0 0 0; font-size: 12px; color: var(--legende); padding-left: 0; }
li .qui { width: 26px; height: 26px; border-radius: 50%; background: var(--carte-2); color: var(--legende); font-size: 12px; display: grid; place-items: center; flex: none; }
li input[type=checkbox] { order: 7; appearance: none; -webkit-appearance: none; width: 30px; height: 30px; margin: 9px; border-radius: 50%; border: 2px solid var(--poignee); flex: none; display: grid; place-items: center; cursor: pointer; }
li input[type=checkbox]::after { content: ""; width: 12px; height: 7px; border: solid var(--sur-fort); border-width: 0 0 2.4px 2.4px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
li input[type=checkbox]:checked { background: var(--texte); border-color: var(--texte); }
li input[type=checkbox]:checked::after { opacity: 1; }
li.fait .txt { color: var(--legende); text-decoration: line-through; }
li button { min-width: 44px; min-height: 44px; border-radius: 99px; background: var(--carte-2); color: var(--texte); font-size: 15px; display: inline-grid; place-items: center; padding: 0 10px; }
li button.deplacer { order: 6; background: transparent; color: var(--legende); font-size: 20px; }
li button.regle { order: 7; background: var(--texte); color: var(--sur-fort); font-weight: 600; padding: 0 16px; }
li button.ecouter, li button.retenter { order: 5; background: transparent; color: var(--legende); }
li .ou { min-height: 32px !important; min-width: 0 !important; margin-left: 6px; padding: 0 10px !important; font-size: 12px !important; background: var(--carte-2) !important; color: var(--legende) !important; vertical-align: middle; }
li .ou.inconnu { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent) !important; }
li.neuf { animation: clignote 1.2s ease-in-out infinite; border-radius: 12px; }
@keyframes clignote { 50% { background: var(--accent-pale); } }
@media (prefers-reduced-motion: reduce) { li.neuf { animation: none; background: var(--accent-pale); } }
li .jfait { flex: 0 0 100%; order: 9; font-size: 12px; color: var(--vert); }
li .jarvis { flex: 0 0 100%; order: 10; margin: 4px 0 6px; padding: 14px; border-radius: 20px; background: var(--carte); box-shadow: inset 0 0 0 1px var(--accent); font-size: 15px; font-style: normal; color: var(--texte); }
li .jarvis b { font-weight: 600; }
li .jarvis .jbtn { display: flex; gap: 8px; margin-top: 10px; }
li .jarvis button { flex: 1; height: 48px; background: var(--carte-2); }
li .jarvis button.jOui { background: var(--texte); color: var(--sur-fort); font-weight: 600; }
li .jarvis.montree { box-shadow: inset 0 0 0 2px var(--accent); }
li.attente .txt { color: var(--legende); }
.medias { flex: 0 0 100%; order: 9; display: flex; gap: 8px; flex-wrap: wrap; }
.medias .media { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--carte-2); padding: 0; }
.medias .media img { width: 100%; height: 100%; object-fit: cover; }

/* outils et historique (en fin de liste, ou dans la feuille « Plus ») */
#outils { display: flex; gap: 10px; padding: 22px 20px 0; }
#outils button { flex: 1; height: 52px; border-radius: 99px; background: var(--carte); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 500; }
#historique { margin: 14px 20px 0; background: var(--carte); border-radius: 20px; }
#historique summary { list-style: none; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; cursor: pointer; font-size: 15px; font-weight: 500; }
#historique summary::-webkit-details-marker { display: none; }
#historique summary small { color: var(--legende); }
#historique ul { padding: 0 16px; }
#historique li .txt { color: var(--legende); }
#viderHisto { margin: 6px 16px 16px; height: 48px; padding: 0 16px; border-radius: 99px; background: var(--carte-2); color: var(--rouge); display: flex; align-items: center; gap: 8px; }

/* barre des lieux : une rangée de pastilles au-dessus du pouce */
#lieux { order: 3; display: flex; gap: 8px; margin: 0 -14px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
#lieux:empty { display: none; }
#lieux button { flex: none; height: 44px; border-radius: 99px; padding: 0 14px; background: var(--carte); font-size: 14px; white-space: nowrap; }
#lieux button.actif { background: var(--texte); color: var(--sur-fort); }
#aCote { margin: 10px 20px 0; padding: 12px 14px; border-radius: 18px; background: var(--carte); font-size: 14px; }
#aCote a.itineraire { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); }

/* ---------- le bas : ce qui se touche ---------- */
#bas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0 14px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; pointer-events: none;
  background: linear-gradient(transparent, var(--fond) 38%); padding-top: 40px; }
#bas > * { pointer-events: auto; }
#message { order: 1; align-self: center; max-width: 100%; font-size: 14px; color: var(--legende); text-align: center; min-height: 0; }
#message:empty { display: none; }
#google, #relier { order: 2; height: 52px; border-radius: 99px; background: var(--carte); color: var(--texte); display: flex; align-items: center; justify-content: center; font-weight: 500; text-decoration: none; }
#saisieLigne { order: 4; display: flex; gap: 8px; }
body.avec-sasha #saisieLigne { margin-bottom: 58px; }   /* la barre Sasha passe dessous */
#saisie { flex: 1; min-width: 0; height: 48px; border-radius: 99px; border: 0; background: var(--carte); padding: 0 18px; font-size: 16px; outline: none; }
#saisie:focus { box-shadow: inset 0 0 0 1px var(--accent); }
#ajouter { width: 56px; height: 48px; border-radius: 99px; background: var(--carte-2); font-weight: 600; }
#boutons { order: 5; display: flex; align-items: center; gap: 10px; }
#boutons #micro span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
#boutons > button { width: 56px; height: 56px; border-radius: 50%; background: var(--carte-2); display: grid; place-items: center; flex: none; font-size: 20px; }
#boutons #micro { flex: 1; width: auto; height: 64px; border-radius: 99px; background: var(--texte); color: var(--sur-fort); display: flex; gap: 9px; justify-content: center; font-size: 16px; font-weight: 600; }
#boutons #micro::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
#boutons #micro svg.i { width: 24px; height: 24px; }
#boutons #micro.ecoute { background: var(--accent); color: #0d0d10; }
#boutons #recap span, #boutons #plus span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#boutons #recap { order: -1; }
body[data-theme="clair"] #boutons #micro { box-shadow: 0 6px 18px rgba(0,0,0,.12); }

/* sélecteur de version (essai : Long choisit en se servant de l'appli) */
#versions { order: 6; align-items: center; padding: 3px; }
#versions span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--legende); padding: 0 8px 0 12px; }
#versions button { height: 44px; font-size: 13px; }

/* écoute : grand écran de A (versions A et C) */
.ecoute-voile { display: none; position: fixed; inset: 0; z-index: 25; background: var(--fond); padding: 70px 22px 0; }
.ecoute-voile .onde { display: flex; gap: 5px; align-items: center; height: 60px; }
.ecoute-voile .onde i { width: 6px; border-radius: 6px; background: var(--texte); animation: onde 1s ease-in-out infinite; }
.ecoute-voile .onde i:nth-child(odd) { animation-delay: .2s; } .ecoute-voile .onde i:nth-child(3n) { animation-delay: .45s; }
@keyframes onde { 50% { transform: scaleY(.35); } }
@media (prefers-reduced-motion: reduce) { .ecoute-voile .onde i { animation: none; } }
.ecoute-voile .gros { margin-top: 30px; font-size: 30px; font-weight: 500; line-height: 1.25; }
.ecoute-voile .gros span { color: var(--legende); }
.ecoute-voile .astuce { margin-top: 18px; color: var(--legende); font-size: 14px; }
body[data-ecoute-plein] :is(#micro.ecoute) ~ * {}
body[data-ecoute-plein].ecoute .ecoute-voile { display: block; }
body[data-ecoute-plein].ecoute :is(#lieux, .puces, #saisieLigne, #relier, #google, sasha-barre) { display: none !important; }
#boutons #micro { min-width: 0; }

/* ---------- feuilles qui montent du bas ---------- */
.feuille-fond { position: fixed; inset: 0; z-index: 1000; background: var(--voile); display: none; }
.feuille-fond.ouverte { display: block; }
.feuille { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82dvh; overflow-y: auto; background: var(--feuille); border-radius: 30px 30px 0 0; border-top: 1px solid var(--bord); padding: 12px 18px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.feuille .poignee { width: 40px; height: 4px; border-radius: 4px; background: var(--poignee); margin: 0 auto 16px; flex: none; }
.feuille h3 { margin: 0; font-size: 20px; font-weight: 600; }
.feuille .petit { margin: 4px 0 10px; font-size: 13px; color: var(--legende); }
.feuille .corps { flex: 1; }
.feuille .fermer-feuille { margin-top: 14px; height: 56px; border-radius: 99px; background: var(--carte-2); font-weight: 500; flex: none; }
.feuille main#tiroirs { padding: 0; }
.feuille #outils { padding: 10px 0 0; }
.feuille #historique { margin: 12px 0 0; }
.titre-reglage { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--legende); margin: 16px 2px 8px; }
.segment { display: flex; background: var(--carte); border-radius: 99px; padding: 4px; gap: 4px; }
.segment button { flex: 1; height: 48px; border-radius: 99px; text-align: center; font-size: 14px; color: var(--legende); }
.segment button.on { background: var(--texte); color: var(--sur-fort); font-weight: 600; }
.ligne-reglage { margin-top: 14px; height: 52px; width: 100%; border-radius: 99px; background: var(--carte); font-weight: 500; }

/* fenêtres de la logique (Déplacer, média, lieu, récap) : en feuilles du bas */
dialog { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 82dvh; overflow-y: auto; border: 0; border-top: 1px solid var(--bord); border-radius: 30px 30px 0 0; background: var(--feuille); color: var(--texte); padding: 26px 18px calc(22px + env(safe-area-inset-bottom)); }
dialog::backdrop { background: var(--voile); }
dialog h3 { margin: 0 0 14px; font-size: 20px; font-weight: 600; }
dialog button, dialog a.maps { min-height: 52px; border-radius: 99px; background: var(--carte); color: var(--texte); font-size: 15px; padding: 0 18px; text-decoration: none; display: flex; align-items: center; justify-content: center; }
#menuTiroirs div, #dlgLieu div { display: flex; flex-direction: column; gap: 8px; }
#menuTiroirs button.supprimer { color: var(--rouge); }
#dlgRecap ul li { font-size: 19px; min-height: 52px; }
#dlgRecap #recapOk { width: 100%; margin-top: 16px; height: 64px; background: var(--texte); color: var(--sur-fort); font-weight: 600; }
#dlgRecap #recapAnnuler { width: 100%; margin-top: 10px; }
#dlgMedia .vue img, #dlgMedia .vue video { width: 100%; border-radius: 18px; }
#dlgMedia .btns { display: flex; gap: 8px; margin-top: 12px; } #dlgMedia .btns button { flex: 1; }
#dlgMedia .btns .retirer { color: var(--rouge); }
#dlgLieu .coller { display: flex; gap: 8px; flex-direction: row !important; }
#dlgLieu .coller input { flex: 1; min-width: 0; height: 52px; border-radius: 99px; border: 0; background: var(--carte); padding: 0 16px; }
#dlgLieu button small { color: var(--legende); margin-left: 6px; }

/* ---------- VERSION B (et C accueil « liste ») : la liste du jour ---------- */
body[data-accueil="liste"] header { min-height: 50dvh; }
body[data-accueil="liste"] .lecture { margin-top: auto; padding-bottom: 6px; }
body[data-accueil="liste"] .dernieres { display: none; }

/* ---------- VERSION A (et C accueil « micro ») : le micro d'abord ---------- */
body[data-accueil="micro"] main#tiroirs:not(.dans-feuille),
body[data-accueil="micro"] #outils:not(.dans-feuille),
body[data-accueil="micro"] #historique:not(.dans-feuille) { display: none; }
.puces { display: none; }
body[data-accueil="micro"] .puces { order: 3; display: flex; gap: 8px; margin: 0 -14px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
body[data-accueil="micro"] .puces button { flex: none; height: 48px; border-radius: 99px; padding: 0 16px; background: var(--carte); font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
body[data-accueil="micro"] .puces button b { font-weight: 600; }
body[data-accueil="micro"] .puces button.alerte b { color: var(--rouge); }

/* C : un titre de tiroir ouvre le tiroir en feuille (geste de A) */
body[data-version="c"] section h2 { cursor: pointer; min-height: 44px; }

/* téléphone couché */
@media (max-height: 520px) { body { --reserve-bas: 210px; } header { min-height: 0 !important; } #saisieLigne { display: none; } }
