/* La Natasuite : coquille commune des outils, dans l'esprit d'un écran e-ink.
   Papier, encre, filets d'un pixel, cinq couleurs passées (maquette de Claude Design, chantier 0, 20/10/2026).
   Règles de la maison : aucune ombre, aucun dégradé, rayon 3 px, filets 1 px. Les couleurs ne s'écrivent
   qu'ici, en jetons ; mode nuit par le système ou par le bouton « Thème » (clé ltb-theme, celle des Tools).
   Polices hébergées : assets/vendor/fonts/natasuite.css (Literata, Source Sans 3). */

/* ============================== Jetons ============================== */
:root {
  --papier: #ECEAE4;
  --feuille: #F4F3EF;
  --encre: #1A1A1A;
  --encre-2: #5C5C5A;
  --filet: #1A1A1A;
  --filet-leger: #BDBCB7;
  --trame: #C9C7C1;
  --trame-claire: #DAD8D2;

  --brique: #A8443A;
  --bleu: #3F5F7E;
  --ocre: #7A5C14;
  --vert: #4E6B49;
  --prune: #6F5470;
  --sur-couleur: #ECEAE4;

  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  --rayon: 3px;
  --rayon-case: 2px;
  --largeur: 1140px;
  --gouttiere: 24px;

  color-scheme: light;
}

/* Mode nuit : inversion simple, couleurs éclaircies d'un cran. */
:root[data-theme='dark'] {
  --papier: #1A1A1A;
  --feuille: #232322;
  --encre: #ECEAE4;
  --encre-2: #A9A8A2;
  --filet: #ECEAE4;
  --filet-leger: #4A4946;
  --trame: #3A3937;
  --trame-claire: #2E2D2B;
  --brique: #C8655A;
  --bleu: #6F8FB0;
  --ocre: #B08A3A;
  --vert: #7A9A74;
  --prune: #9A7E9C;
  --sur-couleur: #1A1A1A;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --papier: #1A1A1A;
    --feuille: #232322;
    --encre: #ECEAE4;
    --encre-2: #A9A8A2;
    --filet: #ECEAE4;
    --filet-leger: #4A4946;
    --trame: #3A3937;
    --trame-claire: #2E2D2B;
    --brique: #C8655A;
    --bleu: #6F8FB0;
    --ocre: #B08A3A;
    --vert: #7A9A74;
    --prune: #9A7E9C;
    --sur-couleur: #1A1A1A;
    color-scheme: dark;
  }
}

/* ============================== Page ============================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--papier);
  color: var(--encre);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--papier);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brique); }
:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.1; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--encre-2); font-style: italic; font-family: var(--serif); }
[hidden] { display: none !important; }

.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0 var(--gouttiere);
}
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-top: 30px;
  padding-bottom: 32px;
}

/* ============================== Texte ============================== */
.sans { font-family: var(--sans); }
.etiquette {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-2);
}
.marque { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.legende { font-style: italic; color: var(--encre-2); }
.meta { font-family: var(--sans); font-size: 13px; color: var(--encre-2); }
.valeur { font-size: 54px; line-height: 1; }
.titre-page { font-size: 40px; letter-spacing: -0.01em; text-wrap: balance; }
.sous-titre { font-size: 16px; font-style: italic; color: var(--encre-2); }

/* Cachet : le carré de couleur de 9 px. */
.cachet {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--c, var(--encre));
  flex-shrink: 0;
}
.cachet--brique { --c: var(--brique); }
.cachet--bleu { --c: var(--bleu); }
.cachet--ocre { --c: var(--ocre); }
.cachet--vert { --c: var(--vert); }
.cachet--prune { --c: var(--prune); }

/* Filets */
.filet { border: 0; border-top: 1px solid var(--filet); margin: 0; }
.filet--leger { border-top-color: var(--filet-leger); }

/* Trame en damier : images en attente, zones vides. */
.trame {
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame) 0 25%, transparent 0 50%);
  background-size: 3px 3px;
}
.trame--fine { background-size: 2px 2px; }
.trame--large {
  background-size: 4px 4px;
  background-image: repeating-conic-gradient(var(--trame-claire) 0 25%, transparent 0 50%);
}

/* ============================== Commandes ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--encre);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--feuille); color: var(--encre); }
.btn--encre { background: var(--encre); color: var(--papier); font-weight: 600; }
.btn--encre:hover { background: var(--encre); color: var(--papier); opacity: 0.9; }
.btn--brique { border-color: var(--brique); background: var(--brique); color: var(--sur-couleur); font-weight: 600; }
.btn--brique:hover { background: var(--brique); color: var(--sur-couleur); opacity: 0.9; }
.btn--petit { height: 36px; padding: 0 14px; font-size: 13px; }
.btn--discret { border-color: var(--filet-leger); color: var(--encre-2); }
.btn[disabled], .btn[disabled]:hover { border-style: dashed; border-color: var(--filet-leger); background: transparent; color: var(--encre-2); opacity: 1; cursor: default; }

.lien {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--encre-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lien--brique { color: var(--brique); font-style: italic; font-family: var(--serif); }

/* Onglets */
.onglets {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  border-bottom: 1px solid var(--filet);
  font-family: var(--sans);
  font-size: 14px;
}
.onglets > a, .onglets > button {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--encre-2);
  cursor: pointer;
}
.onglets > [aria-current='page'], .onglets > [aria-selected='true'] {
  color: var(--encre);
  font-weight: 600;
  border-bottom-color: var(--encre);
}

/* Puces (choix) */
.puce {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
}
.puce[aria-pressed='true'] { background: var(--encre); color: var(--papier); }

/* Champs */
.champ {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 14px;
  width: 100%;
}
textarea.champ { height: auto; padding: 10px 12px; font-family: var(--serif); line-height: 1.5; resize: vertical; }

/* Case à cocher carrée */
.case {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
}
.case input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--encre);
  border-radius: var(--rayon-case);
  background: transparent;
  display: grid;
  place-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.case input::before {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2.5px solid var(--papier);
  border-bottom: 2.5px solid var(--papier);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.case input:checked { background: var(--encre); }
.case input:checked::before { opacity: 1; }

/* Icônes au trait : une seule famille, trait 1,5, 24 px. */
.icone {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.aller-contenu {
  position: absolute;
  left: var(--gouttiere);
  top: -60px;
  padding: 8px 12px;
  background: var(--encre);
  color: var(--papier);
  font-family: var(--sans);
  font-size: 14px;
  z-index: 10;
}
.aller-contenu:focus { top: 8px; color: var(--papier); }

/* ============================== Coquille ============================== */
/* Barre du haut : fil d'Ariane à gauche, compte à droite. */
.entete { border-bottom: 1px solid var(--filet); }
.entete__ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  padding-bottom: 0;
}
.entete__fil { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.entete__fil a { display: inline-flex; align-items: center; min-height: 40px; }
.entete__sep, .entete__courant { color: var(--encre-2); }
.entete__nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--encre-2);
}
/* Cibles de 40 px au moins : le texte reste petit, la zone qu'on touche non. */
.entete__nav a, .entete__bouton {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--encre-2);
}
.entete__nav a:hover, .entete__bouton:hover { color: var(--brique); }
.entete__bouton {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: inherit;
}
.entete__etat { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.entete__led { width: 7px; height: 7px; border-radius: 50%; background: var(--vert); }
.entete__etat[data-hors-ligne] .entete__led { background: var(--ocre); }

/* Pied de page : la version, la date, les nouveautés. */
.pied { border-top: 1px solid var(--filet); }
.pied__ligne {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  font-family: var(--sans);
  font-size: 12px;
  color: var(--encre-2);
}
.pied__ligne a { color: var(--encre-2); }
.pied__ligne a:hover { color: var(--brique); }

/* Connexion (auth.js pose .auth-overlay > .auth-card) : une fiche à l'encre sur le papier. */
body.suite .auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--gouttiere);
  background: var(--papier);
}
body.suite .auth-card {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px 24px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--feuille);
}
body.suite .auth-card h2 { font-size: 30px; }
body.suite .auth-card h2::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 12px;
  vertical-align: middle;
  background: var(--brique);
}
body.suite .auth-card .muted { font-style: italic; color: var(--encre-2); font-size: 15px; }
body.suite .auth-card input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--papier);
  font-family: var(--sans);
  font-size: 16px;
}
body.suite .auth-card .btn-primary {
  height: 44px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--encre);
  color: var(--papier);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
body.suite .auth-card .btn-primary:hover { opacity: 0.9; }
body.suite .auth-err { color: var(--brique); font-family: var(--sans); font-size: 14px; }

@media (max-width: 720px) {
  :root { --gouttiere: 16px; }
  .entete__ligne { padding-top: 8px; gap: 0 10px; }
  .entete__nav { gap: 14px; font-size: 12px; }
  .page { padding-top: 22px; }
  .valeur { font-size: 44px; }
  .titre-page { font-size: 36px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .puce { transition: background-color 0.12s ease; }
}
