/* Pélion, l'app du téléphone. La nuit du mont Pélion : marbre, olive, bronze. Une colonne, une barre d'onglets en bas,
   l'anneau de bronze de Chiron comme seule signature. Suit le thème du téléphone. */
:root {
  --fond: #0f120c;
  --surface: #181c14;
  --surface-2: #21261c;
  --encre: #ece8df;
  --veine: #9a9d93;
  --doux: #6c7066;
  --olive: #b0b783;
  --olive-fort: #c9cf9c;
  --bronze: #d4a868;
  --bronze-doux: rgba(212, 168, 104, .14);
  --olive-doux: rgba(176, 183, 131, .14);
  --trait: rgba(236, 232, 223, .10);
  --sur-bronze: #14170f;
  --verre: rgba(15, 18, 12, .78);
  --ombre: 0 18px 40px rgba(0, 0, 0, .35);
  --display: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --corps: "Barlow", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --chiffre: "Barlow Condensed", "Arial Narrow", sans-serif;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --fond: #efeee9; --surface: #f8f7f3; --surface-2: #e7e5de; --encre: #1b1f15; --veine: #62665c; --doux: #8b8f85;
    --olive: #56602f; --olive-fort: #46501f; --bronze: #8f6125; --bronze-doux: rgba(143, 97, 37, .12); --olive-doux: rgba(86, 96, 47, .1);
    --trait: rgba(27, 31, 21, .1); --sur-bronze: #fbf8f2; --verre: rgba(239, 238, 233, .82); --ombre: 0 16px 34px rgba(40, 40, 20, .14);
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--fond); color: var(--encre); }
body { font-family: var(--corps); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }

.app { height: 100%; display: grid; grid-template-rows: 1fr auto; }
.vue { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--haut) + 14px) max(18px, env(safe-area-inset-right)) 120px max(18px, env(safe-area-inset-left)); }
.vue[hidden] { display: none; }
.vue > * { max-width: 34rem; margin-inline: auto; }
.entre { animation: entre .38s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entre { from { opacity: 0; transform: translateY(8px); } }

/* En-tête */
.tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 30px; }
.marque { font-family: var(--display); letter-spacing: .28em; font-size: .82rem; text-transform: uppercase; color: var(--veine); padding-left: .1em; }
.synchro { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--veine); background: var(--surface); border: 1px solid var(--trait); border-radius: 999px; padding: 5px 11px 5px 9px; }
.synchro i { width: 7px; height: 7px; border-radius: 50%; background: var(--olive); box-shadow: 0 0 0 0 var(--olive); animation: pouls 2.6s infinite; }
.synchro.vieux i { background: var(--bronze); animation: none; }
.synchro.vieux { color: var(--bronze); }
@keyframes pouls { 0% { box-shadow: 0 0 0 0 rgba(176, 183, 131, .55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(176, 183, 131, 0); } }
h1 { font-family: var(--display); font-weight: 400; font-size: 2.35rem; line-height: 1.05; margin: 22px 0 6px; letter-spacing: .005em; text-wrap: balance; }
.sous { color: var(--veine); margin: 0; font-size: .98rem; }
h2 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; margin: 0; }
.section { margin-top: 30px; display: grid; gap: 12px; }
.section-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-tete span { color: var(--veine); font-size: .88rem; }

/* Chiron travaille */
.travail { margin-top: 22px; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--trait); border-radius: 26px; padding: 20px; display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; }
.travail canvas { width: 112px; height: 112px; }
.travail .gros { font-family: var(--chiffre); font-size: 3.2rem; line-height: .9; font-weight: 500; font-variant-numeric: tabular-nums; }
.travail .lbl { color: var(--veine); font-size: .92rem; line-height: 1.35; }
.travail ul { grid-column: 1 / -1; list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--trait); display: grid; gap: 10px; }
.travail li { display: grid; grid-template-columns: 1fr auto; gap: 12px; font-size: .95rem; line-height: 1.35; }
.travail li small { display: block; color: var(--doux); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.travail li b { font-weight: 500; font-family: var(--chiffre); font-size: .95rem; color: var(--veine); white-space: nowrap; }

/* La pile « À toi » */
/* La carte du dessus, et deux bords de carte en dessous qui disent qu'il en reste */
.pile { position: relative; display: grid; padding-bottom: 20px; }
.fantome { position: absolute; left: 14px; right: 14px; bottom: 10px; height: 40px; border-radius: 0 0 22px 22px; background: var(--surface); border: 1px solid var(--trait); border-top: 0; opacity: .75; z-index: 1; }
.fantome.f2 { left: 28px; right: 28px; bottom: 0; opacity: .4; z-index: 0; }
.carte { position: relative; z-index: 2; background: var(--surface); border: 1px solid var(--trait); border-radius: 26px; padding: 20px; display: grid; gap: 12px; box-shadow: var(--ombre);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .35s; touch-action: pan-y; will-change: transform; }
.carte.derriere { transform: translateY(14px) scale(.955); opacity: .55; pointer-events: none; }
.carte.derriere2 { transform: translateY(26px) scale(.91); opacity: .25; pointer-events: none; }
.carte.cachee { display: none; }
.carte.part { transform: translateX(-120%) rotate(-8deg); opacity: 0; }
.carte.reussi { transform: translateY(-30px) scale(.96); opacity: 0; }
.sourcil { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--veine); font-weight: 600; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sourcil .pastille { letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; background: var(--bronze-doux); color: var(--bronze); }
.carte h3 { margin: 0; font-size: 1.22rem; line-height: 1.28; font-weight: 600; text-wrap: balance; }
.carte p { margin: 0; color: var(--veine); font-size: .96rem; }
.message { background: var(--surface-2); border-radius: 18px 18px 18px 6px; padding: 14px 16px; white-space: pre-wrap; font-size: .98rem; line-height: 1.45; max-height: 13.5em; overflow-y: auto; color: var(--encre); }
.jamais { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--olive); }
.jamais svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.boutons { display: grid; gap: 8px; }
.bouton { border: 0; border-radius: 16px; padding: 15px 18px; font-weight: 600; font-size: 1rem; cursor: pointer; text-align: center; background: var(--surface-2); color: var(--encre); transition: transform .12s, filter .2s; }
.bouton:active { transform: scale(.97); }
.bouton.go { background: var(--bronze); color: var(--sur-bronze); }
.bouton.olive { background: var(--olive); color: var(--sur-bronze); }
.bouton .reco { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7; font-weight: 600; margin-top: 2px; }
.rangee { display: flex; gap: 8px; }
.rangee .bouton { flex: 1; }
.leger { background: transparent; border: 1px solid var(--trait); color: var(--veine); font-weight: 500; }
.detail { font-size: .88rem; color: var(--veine); }
.detail summary { cursor: pointer; color: var(--veine); list-style: none; }
.detail summary::before { content: "＋ "; color: var(--olive); }
.detail[open] summary::before { content: "－ "; }
.detail ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.compteur { font-family: var(--chiffre); font-size: .95rem; color: var(--veine); text-align: center; }
.raison { display: grid; gap: 8px; }
.raison textarea { width: 100%; min-height: 76px; resize: none; border-radius: 14px; border: 1px solid var(--trait); background: var(--surface-2); color: var(--encre); padding: 12px; font: inherit; }
.vide { text-align: center; padding: 36px 18px; background: var(--surface); border: 1px dashed var(--trait); border-radius: 26px; display: grid; gap: 8px; justify-items: center; }
.vide b { font-family: var(--display); font-weight: 400; font-size: 1.35rem; }
.vide p { margin: 0; color: var(--veine); max-width: 22rem; }

/* Le fil */
.fil { list-style: none; margin: 0; padding: 0; display: grid; }
.fil li { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--trait); align-items: start; }
.fil li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; margin: 6px 0 0 4px; background: var(--olive); }
.fil li.marteau::before { background: var(--bronze); }
.fil li.toi::before { background: var(--veine); }
.fil .quoi { font-size: .95rem; line-height: 1.35; }
.fil .quoi small { display: block; color: var(--doux); font-size: .8rem; }
.fil time { color: var(--doux); font-size: .8rem; white-space: nowrap; font-family: var(--chiffre); }

/* Projets */
.projets { display: grid; gap: 10px; }
.projet { text-align: left; border: 1px solid var(--trait); background: var(--surface); border-radius: 22px; padding: 16px 18px; display: grid; gap: 8px; cursor: pointer; transition: transform .12s; }
.projet:active { transform: scale(.985); }
.projet .ligne1 { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.projet .client { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--veine); font-weight: 600; }
.projet .nom { font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.etat { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.etat.risque, .etat.retard { background: var(--bronze-doux); color: var(--bronze); }
.etat.ok { background: var(--olive-doux); color: var(--olive); }
.etat.neutre { border: 1px solid var(--trait); color: var(--veine); }
.barre { height: 5px; border-radius: 3px; background: var(--trait); overflow: hidden; display: flex; }
.barre i { display: block; height: 100%; }
.chiffres { display: flex; gap: 14px; font-size: .84rem; color: var(--veine); flex-wrap: wrap; }
.chiffres b { color: var(--encre); font-weight: 600; font-family: var(--chiffre); font-size: .95rem; }

/* Revue */
.repart { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--trait); border-radius: 26px; padding: 20px; }
.repart .barre { height: 12px; border-radius: 6px; gap: 3px; background: transparent; }
.repart .barre i { border-radius: 6px; }
.legende { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.legende div { display: grid; gap: 2px; border-top: 2px solid var(--c); padding-top: 8px; }
.legende b { font-family: var(--chiffre); font-size: 2rem; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.legende span { font-size: .84rem; color: var(--veine); line-height: 1.25; }

/* Barre d'onglets */
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--verre); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  border-top: 1px solid var(--trait); padding: 8px max(10px, env(safe-area-inset-right)) calc(var(--bas) + 6px) max(10px, env(safe-area-inset-left));
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: end; }
.onglet { background: none; border: 0; display: grid; justify-items: center; gap: 3px; font-size: .68rem; letter-spacing: .03em; color: var(--doux); padding: 4px 0; cursor: pointer; position: relative; }
.onglet svg { width: 24px; height: 24px; }
.onglet[aria-selected="true"] { color: var(--encre); }
.onglet .badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--bronze); color: var(--sur-bronze); font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.chiron-bouton { justify-self: center; width: 60px; height: 60px; border-radius: 50%; border: 0; margin-top: -26px; background: var(--bronze); color: var(--sur-bronze); display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 26px rgba(0, 0, 0, .35), 0 0 0 5px var(--fond); }
.chiron-bouton svg { width: 28px; height: 28px; }
.chiron-bouton:active { transform: scale(.94); }

/* Feuilles (bas d'écran) */
.voile { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .3s; }
.voile.ouvert { opacity: 1; }
.feuille { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 88vh; overflow-y: auto; background: var(--fond); border-radius: 28px 28px 0 0; border-top: 1px solid var(--trait);
  padding: 10px max(18px, env(safe-area-inset-right)) calc(var(--bas) + 24px) max(18px, env(safe-area-inset-left)); transform: translateY(100%); transition: transform .42s cubic-bezier(.2, .85, .2, 1); }
.feuille.ouvert { transform: none; }
.feuille > * { max-width: 34rem; margin-inline: auto; }
.poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--trait); margin: 2px auto 14px; }
.feuille h2 { font-size: 1.6rem; }
.taches { display: grid; gap: 0; }
.tache { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--trait); align-items: center; }
.tache .nom { font-size: .97rem; line-height: 1.35; }
.tache .nom small { display: block; color: var(--doux); font-size: .8rem; }
.tache.faite .nom { color: var(--doux); text-decoration: line-through; }
.tache .actions { display: flex; gap: 6px; }
.mini { border: 1px solid var(--trait); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.mini.olive { background: var(--olive); color: var(--sur-bronze); border-color: var(--olive); }

/* Dis-le à Chiron */
.dire textarea { width: 100%; min-height: 130px; resize: none; border: 1px solid var(--trait); background: var(--surface); color: var(--encre); border-radius: 20px; padding: 16px; font: inherit; font-size: 1.05rem; }
.puces { display: flex; gap: 8px; flex-wrap: wrap; }
.puce { border: 1px solid var(--trait); background: var(--surface); border-radius: 999px; padding: 8px 13px; font-size: .88rem; cursor: pointer; }
.gestes { list-style: none; margin: 0; padding: 0; display: grid; }
.gestes li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--trait); font-size: .92rem; }
.gestes li small { display: block; color: var(--doux); font-size: .8rem; }
.gestes .ok { color: var(--olive); } .gestes .attente { color: var(--veine); } .gestes .non { color: var(--bronze); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--bas) + 96px); z-index: 40; transform: translate(-50%, 20px); opacity: 0; background: var(--encre); color: var(--fond); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: .92rem; transition: all .35s cubic-bezier(.2, .8, .2, 1); pointer-events: none; max-width: calc(100% - 40px); text-align: center; }
.toast.vu { opacity: 1; transform: translate(-50%, 0); }

/* Accueil (pas encore jumelé) */
.accueil { min-height: 100%; display: grid; place-items: center; text-align: center; padding: calc(var(--haut) + 30px) 24px calc(var(--bas) + 30px); }
.accueil main { display: grid; gap: 18px; justify-items: center; max-width: 24rem; }
.accueil canvas { width: 180px; height: 180px; }
.accueil h1 { margin: 0; font-size: 2.8rem; letter-spacing: .08em; }
.accueil code { background: var(--surface); border: 1px solid var(--trait); padding: 10px 14px; border-radius: 12px; font-size: .85rem; user-select: all; }
.accueil .bouton { width: 100%; }
.code-grand { font: 600 2.4rem ui-monospace, Menlo, monospace; letter-spacing: .12em; color: var(--bronze); }
.champ-code { width: 100%; text-align: center; font: 600 2rem ui-monospace, Menlo, monospace; letter-spacing: .14em; text-transform: uppercase;
  background: var(--surface); color: var(--encre); border: 1px solid var(--trait); border-radius: 18px; padding: 14px 10px; }
.champ-code:focus { outline: 2px solid var(--olive); outline-offset: 2px; }
.installer { margin-top: 16px; background: var(--olive-doux); color: var(--olive); border-radius: 16px; padding: 12px 14px; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition-duration: .01s !important; }
}
