* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: var(--texte-m);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}


/* ── Nav ── */
.nav {
  background: var(--nav-bg);
  color: var(--nav-txt);
  display: flex;
  align-items: center;
  gap: var(--espace-15);
  padding: 0 var(--espace-14);
  height: 46px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-nav);
}
.nav-brand { color: var(--nav-txt); font-weight: 700; font-size: var(--texte-l); text-decoration: none; letter-spacing: .02em;
             white-space: nowrap; flex-shrink: 0; }
.nav-links { display: flex; gap: var(--espace-2); }
.nav-links a {
  color: var(--nav-txt-attenue);
  text-decoration: none;
  padding: var(--espace-5) var(--espace-11);
  border-radius: var(--radius-sm);
  font-size: var(--texte-m);
  transition: all .15s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--nav-survol);
  color: var(--nav-txt);
}


/* ── Main ── */
.main { padding: var(--espace-13) var(--espace-15); max-width: 100%; }


/* ── Calendrier des offices ── */
#calendrier { flex: 0 0 280px; }


/* ── Page d'erreur ── */
.erreur-page { text-align: center; padding: var(--espace-20) var(--espace-15); }
.erreur-code { font-size: var(--texte-geant); font-weight: 800; color: var(--border2); line-height: 1; }
.erreur-message { font-size: var(--texte-2xl); color: var(--muted); margin: var(--espace-11) 0 var(--espace-17); }


/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: var(--espace-10) var(--espace-14);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--texte-m);
  box-shadow: var(--shadow-toast);
  z-index: 9999;
  transition: opacity .3s, transform .3s;
  transform: translateY(0);
}
.toast.ok  { background: var(--green); color: var(--sur-accent); }
.toast.err { background: var(--red);   color: var(--sur-accent); }
.toast.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }


/* ── Sélecteur de thème (barre de navigation) ── */
.choix-theme {
  margin-left: auto;
  background: var(--nav-survol);
  color: var(--nav-txt);
  border: 1px solid var(--nav-txt-attenue);
  border-radius: var(--radius-sm);
  padding: var(--espace-3) var(--espace-8);
  font-size: var(--texte-s);
  font-family: inherit;
  cursor: pointer;
}
/* Le menu déroulant natif s'affiche sur le fond du système : ses options
   doivent rester lisibles quel que soit le thème de la barre. */
.choix-theme option { background: var(--surface); color: var(--text); }


/* ── Échanges JSON ── */
/* L'attribut hidden doit gagner sur les display des composants (flex…) */
[hidden] { display: none !important; }
