/* Univers nocturne, dans l'esprit de ChakraDuo : fond nuit, panneaux violets, accent or */
:root{
  --night:#08071c; --deep:#0e0c27; --panel:#141233; --panel2:#1c1a42;
  --line:rgba(190,182,255,.16); --line2:rgba(190,182,255,.3);
  --ink:#ece9fb; --muted:#a9a6c9; --faint:#7d7aa3; --gold:#f0c36a;
  --c1:#f0c36a; --c2:#4fd1a1; --c3:#a291f7; --c4:#ff7a9a; --c5:#6ec3ff; --c6:#c9b79a;
  --g:#4fd1a1; --y:#f5b01e; --n:#aab4c9;
  --fd:"Marcellus",Georgia,serif; --fb:"Nunito Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  color-scheme:dark;
}
*{box-sizing:border-box}
body{margin:0;color:var(--ink);font:16px/1.6 var(--fb);
  background:radial-gradient(1100px 560px at 12% -8%,rgba(98,72,210,.32),transparent 62%),
             radial-gradient(900px 520px at 105% 8%,rgba(40,120,150,.22),transparent 58%),var(--night);
  background-attachment:fixed;min-height:100vh}
.wrap{max-width:980px;margin:0 auto;padding:30px 16px 64px}
h1,h2{font-family:var(--fd);font-weight:400;letter-spacing:.01em;text-wrap:balance}
h1{font-size:clamp(1.7rem,4.4vw,2.5rem);line-height:1.15;margin:0 0 8px}
.lead{color:var(--muted);margin:0 0 18px;max-width:660px}
.card{background:linear-gradient(180deg,rgba(28,26,66,.88),rgba(20,18,51,.88));border:1px solid var(--line);border-radius:18px;padding:20px;margin-bottom:18px;
  box-shadow:0 14px 44px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.05)}
.tabs{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 6px;margin-bottom:14px;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs button{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;font:inherit;font-size:.95rem;padding:7px 15px 7px 9px;border-radius:999px;
  border:1px solid var(--line2);background:var(--panel);color:var(--muted);cursor:pointer;transition:border-color .2s,background .2s,color .2s}
.tabs button:hover{border-color:var(--c3);color:var(--ink)}
.tabs button[aria-selected=true]{background:var(--panel2);color:var(--ink);border-color:var(--gold);box-shadow:0 0 0 1px var(--gold),0 0 22px rgba(240,195,106,.18)}
.tabs button:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.ico{flex:none;overflow:visible;filter:drop-shadow(0 2px 2.5px rgba(0,0,0,.55))}
.badges{display:flex;flex-wrap:wrap;gap:8px;font-size:.85rem;color:var(--muted);align-items:center}
.b{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;font-weight:700;padding:2px 10px 2px 4px;border-radius:999px;white-space:nowrap;
  border:1px solid color-mix(in srgb,currentColor 40%,transparent);background:color-mix(in srgb,currentColor 11%,transparent)}
.b.g{color:var(--g)} .b.y{color:var(--y)} .b.n{color:var(--n)}
h2{margin:0 0 4px;font-size:1.5rem}
.intro{color:var(--muted);margin:0 0 12px}
.big{font-size:1.2rem;font-weight:700;margin:8px 0 0}
.big span{color:var(--gold);font-family:var(--fd);font-weight:400;font-size:1.45rem}
input[type=range]{width:100%;accent-color:var(--gold);margin:6px 0 0}
svg#chart{width:100%;height:auto;display:block;overflow:visible}
.legend{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:.88rem;margin-top:10px}
.legend i{display:inline-block;width:18px;height:4px;border-radius:2px;margin-right:7px;vertical-align:middle;box-shadow:0 0 8px currentColor}
.legend i.dash{background:repeating-linear-gradient(90deg,currentColor 0 5px,transparent 5px 8px)!important;box-shadow:none}
.notes{display:grid;gap:10px}
.note{border:1px solid var(--line);border-radius:14px;padding:13px 15px;background:rgba(20,18,51,.7);transition:border-color .25s,box-shadow .25s,opacity .25s}
.note.on{border-color:rgba(240,195,106,.7);box-shadow:0 0 0 1px rgba(240,195,106,.35),0 0 26px rgba(240,195,106,.12);background:rgba(28,26,66,.85)}
.note .top{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;margin-bottom:4px}
.note .when{font-size:.8rem;color:var(--muted);font-weight:600}
.note b{font-size:1rem}
.note p{margin:4px 0 0;font-size:.95rem;color:#d9d5f3}
.note.off{opacity:.55}
.src{display:inline-flex;align-items:center;gap:6px;margin-top:8px;font-size:.82rem;color:var(--g);text-decoration:none;border-bottom:1px dotted color-mix(in srgb,var(--g) 60%,transparent)}
.src:hover{color:#8ff0c9}
.small{font-size:.8rem;color:var(--faint);margin-top:8px}
.warn{background:rgba(245,176,30,.07);color:#f1d9a6;border:1px solid rgba(245,176,30,.28);border-radius:14px;padding:14px 16px;font-size:.92rem}
.warn strong{color:var(--gold)}
/* moteur des graphiques */
.home{display:inline-block;margin-bottom:14px;font-size:.88rem;color:var(--muted);text-decoration:none}
.home:hover{color:var(--gold)}
.see{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:18px;font-size:.9rem;color:var(--muted)}
.see a{color:var(--ink);text-decoration:none;border:1px solid var(--line2);background:var(--panel);border-radius:999px;padding:5px 13px}
.see a:hover{border-color:var(--gold)}
.mt-tete{margin-bottom:14px}
.mt-tete .badges{margin-top:10px}
#chart{cursor:ew-resize;touch-action:pan-y}
.legend .lv{display:inline-block;width:34px;height:5px;border-radius:3px;background:var(--line);margin-left:8px;vertical-align:middle;overflow:hidden}
.legend .lv i{display:block;height:100%;width:0;margin:0;border-radius:3px;box-shadow:none;transition:width .15s}
.mt-pilote{display:flex;align-items:center;gap:12px;margin-top:8px}
.mt-pilote .big{margin:0}
/* Le curseur du temps est posé sur l'axe horizontal du graphique (position calée en JS) */
.mt-axe{position:relative}
.mt-axe input[type=range]{position:absolute;left:0;top:0;width:100%;height:22px;margin:0;padding:0;background:transparent;-webkit-appearance:none;appearance:none;cursor:ew-resize}
.mt-axe input[type=range]::-webkit-slider-runnable-track{height:22px;background:transparent}
.mt-axe input[type=range]::-moz-range-track{height:22px;background:transparent}
.mt-axe input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:18px;height:18px;margin-top:2px;border-radius:50%;background:var(--gold);border:3px solid var(--panel2);box-shadow:0 0 0 1px var(--gold),0 0 12px rgba(240,195,106,.5)}
.mt-axe input[type=range]::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:var(--gold);border:3px solid var(--panel2);box-shadow:0 0 0 1px var(--gold),0 0 12px rgba(240,195,106,.5)}
.mt-axe input[type=range]:focus-visible{outline:none}
.mt-axe input[type=range]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 3px var(--ink)}
#play{flex:none;width:38px;height:38px;border-radius:50%;border:1px solid var(--gold);background:var(--panel2);color:var(--gold);font-size:.95rem;cursor:pointer;display:grid;place-items:center}
#play:hover{box-shadow:0 0 16px rgba(240,195,106,.35)}
.mt-app [data-onglet]{grid-column:1/-1}
.mt-app.vue-scene>:not([data-onglet]),.mt-app:not(.vue-scene)>[data-onglet]{display:none}
/* Tablette et ordinateur : tout tient sur un écran, les explications défilent dans leur colonne */
@media (min-width:900px) and (min-height:560px){
  .wrap.moteur{max-width:1320px;padding:10px 22px 40px}
  .moteur .home{display:none}
  .mt-tete{display:flex;align-items:flex-end;justify-content:space-between;gap:6px 24px;flex-wrap:wrap;margin-bottom:8px}
  .mt-tete h1{font-size:1.75rem;margin:0}
  .mt-tete .lead{margin:2px 0 0;font-size:.92rem;line-height:1.45}
  .mt-tete .badges{margin:0;font-size:.8rem}
  .moteur .tabs{margin-bottom:10px}
  .mt-app{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(300px,1fr);gap:16px;height:var(--h-app,auto)}
  .mt-app>.card{margin:0;min-height:0}
  .mt-graphe{display:flex;flex-direction:column;padding:14px 18px}
  .mt-graphe h2{font-size:1.3rem}
  .mt-graphe .intro{margin:0 0 6px;font-size:.92rem;line-height:1.45}
  .mt-graphe .mt-pilote{margin:0 0 4px}
  .mt-axe{flex:1 1 0;min-height:150px;display:flex;flex-direction:column}
  .mt-graphe svg#chart{flex:1 1 0;min-height:0;height:auto;width:100%}
  .mt-graphe .legend{margin-top:6px}
  .mt-graphe .small{margin:4px 0 0}
  .moteur .notes{overflow-y:auto;min-height:0;align-content:start;padding-right:6px;scrollbar-width:thin}
  .moteur .note{padding:10px 13px}
  .moteur .note p{font-size:.9rem;line-height:1.5}
  .mt-app>[data-onglet]{overflow:auto}
}
/* Petite tablette : textes du graphique plus serrés pour laisser de la hauteur à la courbe */
@media (min-width:900px) and (max-width:1199px) and (min-height:560px){
  .mt-app{grid-template-columns:minmax(0,1.75fr) minmax(260px,.9fr);gap:12px}
  .mt-tete .lead,.mt-graphe .intro{font-size:.84rem;line-height:1.4}
  .mt-graphe .legend{font-size:.82rem;gap:4px 12px}
  .mt-graphe .small{font-size:.74rem;line-height:1.35}
}
/* Questions fréquentes (fichier <nom>.faq.html à côté des données) */
.mt-faq{margin-top:18px}
.mt-faq h2{margin:0 0 6px}
.mt-faq details{border-top:1px solid var(--line);padding:10px 0}
.mt-faq summary{cursor:pointer;font-weight:600}
.mt-faq details p{color:var(--muted);margin:8px 0 0}

/* accueil et rubriques */
.grp{margin:28px 0 10px;font-family:var(--fd);font-weight:400;font-size:1.35rem;display:flex;align-items:center;gap:10px}
.grp a{color:inherit;text-decoration:none}
.grp a:hover{color:var(--gold)}
.grp i{width:12px;height:12px;border-radius:50%;display:inline-block}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.tile{display:block;text-decoration:none;color:var(--ink);background:linear-gradient(180deg,rgba(28,26,66,.88),rgba(20,18,51,.88));border:1px solid var(--line);border-radius:16px;padding:16px 18px;border-top:3px solid var(--k);transition:transform .15s,border-color .15s}
.tile:hover,.tile:focus-visible{transform:translateY(-2px);border-color:var(--line2)}
.tile b{display:block;font-size:1.05rem;margin-bottom:4px}
.tile span{color:var(--muted);font-size:.93rem;line-height:1.45}
/* icône 2.5D à gauche du titre (outils/pictos.py) */
.tile:has(.pic){display:grid;grid-template-columns:52px 1fr;column-gap:12px;align-content:start}
.tile .pic{grid-row:span 2;width:52px;height:56px;margin-top:-2px;transition:transform .2s}
.tile:hover .pic,.tile:focus-visible .pic{transform:translateY(-2px) rotate(-4deg)}
@media (prefers-reduced-motion:reduce){.tile .pic{transition:none}.tile:hover .pic{transform:none}}
