/* Base : typographie Lato, boutons, cartes, champs ; mêmes rayons et ombres que la version Windows. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--fond); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: "Lato", -apple-system, "Helvetica Neue", sans-serif; font-size: 15px; line-height: 1.5;
  color: var(--encre); background: var(--fond);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--bleu); }
img { max-width: 100%; }
svg { flex-shrink: 0; }
code, pre, .code { font-family: "Cascadia Mono", ui-monospace, Menlo, monospace; }
:focus-visible { outline: 2px solid var(--anneau-focus); outline-offset: 2px; border-radius: 6px; }
.masque { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Texte */
.surtitre { font-weight: 700; font-size: 12.5px; color: var(--bleu); letter-spacing: .01em; }
.titre { font-weight: 900; font-size: 30px; line-height: 1.15; margin: 0; }
.chapeau { font-size: 16px; color: var(--attenue); }
.etiquette-section { font-weight: 900; font-size: 11px; color: var(--attenue); text-transform: uppercase; letter-spacing: .02em; }
.attenue { color: var(--attenue); }
.petit { font-size: 13px; }
.gras { font-weight: 700; }
.noir { font-weight: 900; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { line-height: 1.25; }
strong, b { font-weight: 900; }

/* Cartes */
.carte {
  background: var(--surface); border: 1px solid var(--ligne); border-radius: 16px; padding: 18px 20px;
  box-shadow: var(--ombre-carte);
}
.carte.accueil { border-radius: 18px; padding: 18px 22px; }
.carte-interieure { background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; padding: 14px 18px; }
.encart-teinte { background: var(--teinte-bleue); border-radius: 12px; }
.titre-carte { font-weight: 900; font-size: 17px; margin: 0; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--texte-sur-fonce); font-weight: 700; font-size: 14px; text-decoration: none; line-height: 1.2;
  box-shadow: 0 4px 14px -4px rgba(10, 111, 184, .55); transition: background .15s, box-shadow .15s, transform .08s;
  -webkit-user-select: none; user-select: none;
}
.bouton:hover { background: var(--accent-survol); box-shadow: var(--ombre-accent); }
.bouton:active { background: var(--accent-presse); transform: translateY(1px); }
.bouton:disabled, .bouton[aria-disabled="true"] { opacity: .45; box-shadow: none; pointer-events: none; }
.bouton svg { width: 16px; height: 16px; }
.bouton.secondaire { background: var(--surface); color: var(--encre); border: 1px solid var(--contour-bleu); box-shadow: none; padding: 9px 16px; }
.bouton.secondaire:hover { background: var(--teinte-bleue); border-color: var(--bleu); }
.bouton.secondaire:active { background: var(--contour-bleu); }
.bouton.large { width: 100%; }
.bouton.petit { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.lien {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 2px; min-height: 36px;
  color: var(--bleu); font-weight: 700; font-size: 14px; text-decoration: none;
}
.lien:hover { color: var(--bleu-profond); text-decoration: underline; }
.lien svg { width: 15px; height: 15px; }
.bouton-icone {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px;
  background: transparent; border: 0; color: var(--encre);
}
.bouton-icone:hover { background: var(--teinte-neutre); }
.bouton-icone svg { width: 20px; height: 20px; }
.rangee { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rangee.fin { justify-content: flex-end; }
.espace { flex: 1; }

/* Piste d'onglets : l'onglet choisi devient une surface ombrée */
.piste { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--piste); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.piste::-webkit-scrollbar { display: none; }
.onglet {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; min-height: 38px; padding: 7px 16px; border-radius: 9px; border: 0;
  background: transparent; color: var(--attenue); font-weight: 700; font-size: 13.5px; text-decoration: none; transition: background .15s, color .15s, box-shadow .15s;
}
.onglet svg { width: 17px; height: 17px; }
.onglet:hover { color: var(--encre); }
.onglet[aria-selected="true"], .onglet.actif { background: var(--surface-elevee); color: var(--encre); box-shadow: var(--ombre-carte); }
.onglet.actif svg { color: var(--accent); }

/* Puces */
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 7px 15px; border-radius: 18px;
  border: 1px solid var(--contour-bleu); background: var(--surface); color: var(--encre); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap;
}
.puce:hover { background: var(--teinte-bleue); border-color: var(--bleu); }
.puce.actif, .puce[aria-pressed="true"] { background: var(--selection); border-color: var(--selection); color: var(--texte-selection); }
.puce .point { width: 9px; height: 9px; border-radius: 50%; background: var(--teinte, var(--bleu)); flex-shrink: 0; }
.puce.teintee.actif { background: var(--teinte, var(--bleu)); border-color: var(--teinte, var(--bleu)); color: #fff; }
.puce.teintee.actif .point { background: #fff; }

/* Segments (sélecteur à choix unique) */
.segments { display: inline-flex; gap: 0; padding: 2px; border: 1px solid var(--contour-neutre); border-radius: 10px; background: var(--surface); }
.segment { border: 0; background: transparent; padding: 6px 13px; min-height: 36px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--encre); }
.segment:hover { background: var(--teinte-sarcelle); }
.segment[aria-pressed="true"] { background: var(--sarcelle-profonde); color: #fff; }

/* Champs */
.champ {
  width: 100%; min-height: 46px; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--contour-neutre);
  background: var(--surface); color: var(--encre); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.champ:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bleu) 22%, transparent); }
select.champ { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566F7F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.case { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.case input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Interrupteur */
.interrupteur { position: relative; width: 52px; height: 30px; border-radius: 15px; border: 0; background: var(--contour-neutre); transition: background .2s; flex-shrink: 0; }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.interrupteur[aria-checked="true"] { background: var(--accent); }
.interrupteur[aria-checked="true"]::after { transform: translateX(22px); }

/* Barre d'avancement et anneaux */
.avancement { height: 6px; border-radius: 3px; background: var(--piste); overflow: hidden; }
.avancement > i { display: block; height: 100%; border-radius: 3px; background: var(--degrade-avancement); transition: width .4s; }
.anneau { position: relative; display: inline-grid; place-items: center; }
.anneau svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau .valeur { position: relative; font-weight: 900; }

/* Clavier (touches) */
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 6px;
  border: 1px solid var(--contour-neutre); border-bottom-width: 2px; background: var(--surface); font: 700 12px "Lato", sans-serif; color: var(--encre); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 90;
  background: var(--barre); color: var(--texte-sur-fonce); padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; box-shadow: var(--ombre-flottante);
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Animations d'entrée */
@keyframes apparition { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes entreeDroite { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes entreeGauche { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.apparait { animation: apparition .28s ease-out both; }
.entree-droite { animation: entreeDroite .22s ease-out both; }
.entree-gauche { animation: entreeGauche .22s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.retour-site{position:fixed;z-index:1000;bottom:4px;right:8px;font:11px/1.4 system-ui;color:var(--texte);background:var(--fond);padding:3px 7px;border-radius:6px;text-decoration:none}.bibliotheque-publique{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}.bibliotheque-publique article{border:1px solid var(--bordure,#d6e2e6);border-radius:16px;padding:20px}.bibliotheque-publique h2{font-size:19px}.edition-publique{padding:16px;border-inline-start:3px solid var(--sarcelle);margin-block:16px;line-height:1.6}
