@font-face {
  font-family: "Marcellus";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../assets/fonts/marcellus-latin.woff2') format('woff2');
}
@font-face {
  font-family: "Figtree";
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  src: url('../assets/fonts/figtree-latin.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { color-scheme: light dark; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-corps);
  font-size: var(--fs-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-titre); line-height: 1.05; font-weight: 400; }
h4 { font-family: var(--font-titre); line-height: 1.05; font-weight: 400; }
h1 { font-size: var(--fs-4); }
h2 { font-size: var(--fs-3); }
h3 { font-size: var(--fs-2); }

img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

.montant {
  font-family: var(--font-chiffres);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.01em;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

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

.page { max-width: 560px; margin: 0 auto; padding: var(--s4) var(--s4) calc(var(--s7) * 2); }

@media (min-width: 1024px) {
  .page { max-width: 720px; }
}

/* Mise en page utilitaire partagée par les écrans */
.pile { display: flex; flex-direction: column; gap: var(--s4); }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.rang { display: flex; flex-wrap: wrap; gap: var(--s2); }
.entete { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.collant-bas { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom) + var(--s3)); z-index: 5; }
@media (min-width: 1024px) { .collant-bas { bottom: var(--s4); } }

/* Le focus programmatique de la vue ne dessine pas d'anneau ; les contrôles gardent le leur. */
#vue:focus, #vue:focus-visible { outline: none; }

/* Accueil : chiffres secondaires plus compacts */
.stat--negatif .montant { color: var(--danger); }
.stat--compact { padding: var(--s4); }
.stat.stat--compact .montant { font-size: var(--fs-2); white-space: nowrap; }
