/* removed: tokens.css handled by page aggregator */
/* Cartes “glass” standard */
.u-glass-card {
  background: var(--surface-card);
  border: var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-m);
  backdrop-filter: blur(var(--glass-blur)) saturate(130%);
}

/* “Galet” bouton/pastille convexe (header / chapitres / accordion toggle) */
.u-galet {
  background: var(--galet-bg);
  border: var(--galet-border);
  box-shadow: var(--galet-shadow);
}
.u-galet--bright {
  background: var(--galet-bg-bright);
  box-shadow: var(--galet-shadow-strong);
}

/* Focus cohérent */
.u-focus {
  outline: none;
}
.u-focus:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

/* Ring violet AA (option) */
.u-ring-brand:focus-visible {
  box-shadow:
    0 0 0 2px rgb(255 255 255 / 0.95),
    0 0 0 4px rgb(var(--brand-600-rgb) / 0.45);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: calc(100vw - 24px);
  padding: 0 14px;
  border: 2px solid rgb(34 211 238 / 0.9);
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 12px 30px rgb(2 6 23 / 0.3);
  transform: translateY(calc(-100% - 18px));
  transition: transform 0.14s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  outline: 3px solid rgb(250 204 21 / 0.95);
  outline-offset: 3px;
  transform: translateY(0);
}

.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Scrollbar claire réutilisable */
.u-scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--white-rgb) / 0.5) transparent;
}
.u-scrollbar-thin::-webkit-scrollbar {
  width: 8px;
}
.u-scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgb(var(--white-rgb) / 0.5);
  border-radius: 4px;
}

/* Inline SVG icons */
.u-icon-inline {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  stroke: currentColor;
  fill: none;
}
.u-icon-inline--fill {
  fill: currentColor;
  stroke: none;
}

/* Normalise le centrage des boutons de fermeture a glyphe simple. */
button.modal__close,
button.close-button,
button.chatbot-close-button,
button.close,
button.crop-close,
button.preview-close,
button.chapter-modal__close,
button.qcm-focus-close,
button.calc-close,
button.drawer-close,
button.close-chat,
button.mlg-toast__close,
button.chapter-qcm-close,
button.qa-inline-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  text-align: center;
  font-family: inherit;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

/* MathJax opt-in (third-party load on demand) */
.mathjax-optin-button {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1100;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgb(148 163 184 / 0.45);
  background: rgb(15 23 42 / 0.92);
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px rgb(15 23 42 / 0.35);
  backdrop-filter: blur(8px);
}
.mathjax-optin-button:hover {
  border-color: rgb(148 163 184 / 0.7);
}
.mathjax-optin-button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
