/* Barre du haut : un filet sous le menu, lien actif souligné, retirée pendant les séances. */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 28px;
  margin: 0 clamp(12px, 3.2vw, 52px);
  padding: 0 clamp(8px, 3vw, 48px);
  border-bottom: 1px solid var(--filet);
}
.wordmark {
  font: 600 var(--t20) / 1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: none;
  padding: 24px 0;
  white-space: nowrap;
}
.bar nav { display: flex; gap: 0 clamp(14px, 2.2vw, 32px); }
.bar nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 68px;
  color: var(--ardoise);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--rapide);
}
.bar nav a:hover, .bar nav a:focus-visible { color: var(--encre); }
.bar nav a[aria-current="page"] { color: var(--encre); }
.bar nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  height: 2px;
  background: var(--encre);
  border-radius: 2px;
}
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; }
  .bar nav { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .bar nav a { min-height: 48px; }
  .bar nav a[aria-current="page"]::after { bottom: 4px; }
  .wordmark { padding: 16px 0 4px; }
}

/* Avis persistants. */
.notices { padding: 0 var(--marge); }
.notices:empty { display: none; }
.notice {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--colonne-large);
  margin: 14px auto 0;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--ardoise);
}
.notice--erreur { border-left-color: var(--alerte); }
.notice--erreur p { color: var(--alerte); }
body.run .notices { display: none; }

/* Boutons : un seul bouton plein par vue, le reste en texte. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-champ);
  background: none;
  font: 500 var(--t15) / 1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--rapide), opacity var(--rapide);
}
.btn--primaire { background: var(--accent); color: var(--sur-accent); }
.btn--primaire:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 86%, var(--encre)); }
.btn--grand { min-height: 52px; padding: 0 26px; border-radius: 14px; gap: 12px; font-size: var(--t17); }
.btn svg, .btn--grand svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn--secondaire { border-color: var(--contour); }
.btn--secondaire:hover:not(:disabled) { background: var(--surface); }
.btn--texte { min-height: 40px; padding: 0 2px; color: var(--encre); }
.btn--texte:hover, .btn--texte:focus-visible { text-decoration: underline; text-underline-offset: 0.2em; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.lien {
  padding: 0; border: 0; background: none;
  text-decoration: underline; text-underline-offset: 0.2em;
  min-height: 24px;
}

/* Champs. */
.champ {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--encre);
  border: 1px solid var(--contour);
  border-radius: var(--r-champ);
}
select.champ { padding-right: 8px; }
textarea.champ { min-height: 9rem; resize: vertical; line-height: 1.5; }
.champ--court { width: 7.5rem; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--outremer); flex: none; }
input[type="range"] { accent-color: var(--outremer); width: 100%; min-height: 40px; }

.etiquette {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--contour);
  border-radius: var(--r-tag);
  font-size: var(--t13);
}

.ardoise { color: var(--ardoise); }
.alerte { color: var(--alerte); }

@media (max-width: 480px) {
  .bar nav { gap: 0 14px; }
}

/* Carte : surface, filet, grand rayon. Utilisée pour l'accueil et les widgets. */
.carte {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--r-carte);
  padding: 22px 24px;
}

/* Compte ouvert, à droite de la barre (sur petit écran : dans les Réglages). */
.compte { display: flex; align-items: center; gap: 12px; color: var(--ardoise); font-size: var(--t15); white-space: nowrap; }
.compte .lien { color: var(--encre); }
@media (max-width: 960px) { .compte { display: none; } }

/* Colonnes de lecture. */
.page { padding: 0 var(--marge) 96px; }
.col { max-width: var(--colonne); margin: 0 auto; }
.col--large { max-width: var(--colonne-large); }
.entete { padding-top: clamp(40px, 8vh, 88px); padding-bottom: 28px; }
.entete p { margin-top: 12px; color: var(--ardoise); max-width: 64ch; }

/* Accueil : voir verre.css (organisation en hero plein écran). */

/* Écrans sobres (modes à venir, états vides). */
.simple { padding-top: clamp(40px, 8vh, 88px); }
.simple p { margin-top: 14px; color: var(--ardoise); max-width: 56ch; }
.simple .btn { margin-top: 28px; }

/* Réglages : sections séparées par l'espace seulement. */
.section { margin-top: 72px; }
.section > h2 { margin-bottom: 8px; }
.section > .intro { color: var(--ardoise); max-width: 60ch; margin-bottom: 8px; }
.reglage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 17rem);
  align-items: center;
  gap: 6px 32px;
  padding: 14px 0;
}
.reglage--pleine { grid-template-columns: minmax(0, 1fr); }
.reglage label, .reglage .libelle { display: block; }
.reglage .aide { display: block; margin-top: 2px; color: var(--ardoise); font-size: var(--t13); max-width: 54ch; }
.reglage .controle { display: flex; align-items: center; gap: 10px; min-width: 0; }
.reglage .controle .valeur { color: var(--ardoise); white-space: nowrap; font-size: var(--t13); }
.choix { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.choix label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.coche { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; }
.statut { color: var(--ardoise); font-size: var(--t13); min-height: 1.4em; }
.faits { display: grid; gap: 4px; margin-top: 8px; }
.faits div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 4px 0; }
.faits dt { color: var(--ardoise); }
.faits dd { margin: 0; text-align: right; }
dl.faits { margin-block: 8px 0; }
@media (max-width: 640px) {
  .reglage { grid-template-columns: minmax(0, 1fr); }
}

/* Importer. */
.depot {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 24px;
  border: 1px dashed var(--contour);
  border-radius: var(--r-carte);
}
.depot[data-actif="1"] { border-color: var(--outremer); border-style: solid; }
.depot p { color: var(--ardoise); }
.depot .btn { justify-self: start; }
.zone-colle { margin-top: 32px; display: grid; gap: 8px; }
.zone-colle .btn { justify-self: start; margin-top: 8px; }
.rapport { margin-top: 40px; }
.rapport h2 { margin-bottom: 16px; }
.rapport .bilan { font-size: var(--t17); max-width: 60ch; }
.rapport-groupe { margin-top: 32px; }
.rapport-groupe h3 { margin-bottom: 8px; }
.rapport-liste > li { padding: 12px 0; border-top: 1px solid var(--filet); }
.rapport-liste .ident { font-weight: 600; margin-right: 12px; }
.rapport-liste ul { margin-top: 4px; color: var(--ardoise); }
.rapport-liste li li { padding: 0; border: 0; }
.rapport details { margin-top: 8px; }
.rapport summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 32px; }
.export { margin-top: 72px; }
.export .actions { margin-top: 16px; }

/* Bibliothèque. */
.outils { display: grid; gap: 14px; margin-bottom: 12px; }
.bascule { display: flex; gap: 22px; }
.bascule button { padding: 6px 0; min-height: 40px; background: none; border: 0; color: var(--ardoise); }
.bascule button[aria-pressed="true"] { color: var(--encre); text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 2px; text-decoration-color: var(--outremer); }
.filtres { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.filtres label { display: grid; gap: 4px; font-size: var(--t13); color: var(--ardoise); }
.filtres select { min-width: 9.5rem; max-width: 15rem; }
.nombre { color: var(--ardoise); margin: 8px 0 4px; }
.lignes > li + li { border-top: 1px solid var(--filet); }
.ligne-tete {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  gap: 8px 20px;
  width: 100%;
  padding: 16px 0;
  text-align: left;
  background: none;
  border: 0;
  align-items: start;
}
.ligne-tete:hover .extrait, .ligne-tete:focus-visible .extrait { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.ligne-tete:focus-visible { outline-offset: -2px; }
.extrait { display: block; font: 400 var(--t17) / 1.5 var(--serif); }
.meta-ligne { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 6px; color: var(--ardoise); font-size: var(--t13); }
.meta-droite { text-align: right; color: var(--ardoise); font-size: var(--t13); line-height: 1.5; }
.meta-droite b { display: block; font-weight: 600; color: var(--encre); }
.meta-droite span { display: block; }
.ligne-corps { padding: 4px 0 24px; max-width: 64ch; }
.ligne-corps p { font: 400 var(--t17) / 1.6 var(--serif); }
.ligne-corps p + p { margin-top: 12px; }
.ligne-corps h3 { font: 600 var(--t13) / 1.4 var(--sans); letter-spacing: 0; margin: 20px 0 6px; color: var(--ardoise); }
.ligne-corps ol { list-style: decimal; padding-left: 1.4em; }
.ligne-corps ol li { font: 400 var(--t17) / 1.6 var(--serif); padding: 3px 0 3px 4px; }
.ligne-corps ol li::marker { font: 600 var(--t13) var(--sans); color: var(--ardoise); }
.suite { margin-top: 20px; }
.vide { margin-top: 40px; color: var(--ardoise); max-width: 56ch; }
@media (max-width: 560px) {
  .ligne-tete { grid-template-columns: minmax(0, 1fr); }
  .meta-droite { text-align: left; display: flex; gap: 14px; }
  .meta-droite b, .meta-droite span { display: inline; }
}

.chiffres dd sup { font-size: 0.5em; vertical-align: 0.7em; margin-left: 1px; }

/* Page de connexion */
.page--connexion { min-height: 100dvh; display: grid; place-items: center; padding: 32px clamp(16px, 5vw, 48px); }
.connexion { width: min(100%, 30rem); }
.connexion h1 { margin: 0; }
.connexion-form { margin-top: 32px; display: grid; gap: 10px; }
.connexion-form label { color: var(--ardoise); font-size: var(--t15); }
.connexion-champ { width: 100%; min-height: 52px; font: 500 var(--t20) / 1 var(--sans); letter-spacing: 0.12em; text-align: center; border-radius: var(--r-champ); }
.connexion-err { min-height: 1.5em; margin: 0; color: var(--alerte); font-size: var(--t15); }
.connexion-form .btn { justify-self: start; }
