/* Polices hébergées dans l'appli (licence OFL, voir fonts/) :
   aucune requête vers Google, rien ne sort du téléphone. */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Charte graphique Biblio VSS : voir docs/charte/README.md.
   Les noms de gauche (--bg, --text…) sont utilisés partout dans ce fichier ;
   leurs valeurs viennent des couleurs de la charte (papier, ink, prune…). */
:root {
  --font-serif: "Fraunces", "DM Serif Display", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #f6f1e9;          /* papier */
  --surface: #fffdf9;     /* papier-clair */
  --text: #2b2433;        /* ink */
  --muted: #5e5566;       /* ink-muted */
  --border: #e2d9cc;      /* trait */
  --heading: #4a2f6b;     /* prune : titres, logo */
  --accent: #5b3a8c;      /* violet : liens, boutons */
  --accent-soft: #dcd0ec; /* lavande : encadrés */
  --on-accent: #fffdf9;
  --vert-eau: #4f8783;    /* accent en aplat uniquement, jamais en texte */
  --vert-eau-clair: #d6eae7;
  --ok: #3f7672;          /* message de succès (texte, contraste 4,6) */
  --exit: #b3261e;        /* sortie : RÉSERVÉ au bouton « Sortie rapide » */

  /* Niveaux d'intensité : une seule famille, du vert d'eau au prune */
  --lvl1-bg: #d6eae7; --lvl1-fg: #2b2433;
  --lvl2-bg: #dcd0ec; --lvl2-fg: #2b2433;
  --lvl3-bg: #4a2f6b; --lvl3-fg: #fffdf9;

  /* Listes thématiques et couvertures générées */
  --tone-douceur-bg: #d6eae7; --tone-douceur-fg: #2b2433;
  --tone-lavande-bg: #dcd0ec; --tone-lavande-fg: #2b2433;
  --tone-prune-bg: #4a2f6b;   --tone-prune-fg: #fffdf9;

  --radius: 12px;         /* radius-md */
  --radius-sm: 4px;
  --tabbar-h: 64px;
  --sc-bg: #fff4c2;
  --sc-fg: #6b4e00;
  --sc-border: #f0d77a;

  /* Motif étagère : 5 couleurs de la charte au maximum */
  --shelf-1: #4a2f6b; --shelf-2: #5b3a8c; --shelf-3: #dcd0ec; --shelf-4: #4f8783; --shelf-5: #d6eae7;
}

/* Thème sombre (absent de la charte Instagram, créé pour l'appli) :
   suit le téléphone, sauf si un thème clair/sombre est imposé. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1520;
    --surface: #241d2c;
    --text: #f2edf7;
    --muted: #b8aec4;
    --border: #3a3146;
    --heading: #dcd0ec;
    --accent: #c9b3ec;
    --accent-soft: #352a47;
    --on-accent: #1f1729;
    --vert-eau: #6fa9a4;
    --vert-eau-clair: #2d4c49;
    --ok: #9fd3cc;
    --lvl1-bg: #2d4c49; --lvl1-fg: #e3f2ef;
    --lvl2-bg: #41345a; --lvl2-fg: #ede5f8;
    --lvl3-bg: #c9b3ec; --lvl3-fg: #1f1729;
    --tone-douceur-bg: #2d4c49; --tone-douceur-fg: #e3f2ef;
    --tone-lavande-bg: #41345a; --tone-lavande-fg: #ede5f8;
    --tone-prune-bg: #c9b3ec;   --tone-prune-fg: #1f1729;
    --sc-bg: #3a3214;
    --sc-fg: #f3d873;
    --sc-border: #5c4f1c;
    --shelf-1: #c9b3ec; --shelf-2: #8f74bf; --shelf-3: #41345a; --shelf-4: #6fa9a4; --shelf-5: #2d4c49;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1520;
  --surface: #241d2c;
  --text: #f2edf7;
  --muted: #b8aec4;
  --border: #3a3146;
  --heading: #dcd0ec;
  --accent: #c9b3ec;
  --accent-soft: #352a47;
  --on-accent: #1f1729;
  --vert-eau: #6fa9a4;
  --vert-eau-clair: #2d4c49;
  --ok: #9fd3cc;
  --lvl1-bg: #2d4c49; --lvl1-fg: #e3f2ef;
  --lvl2-bg: #41345a; --lvl2-fg: #ede5f8;
  --lvl3-bg: #c9b3ec; --lvl3-fg: #1f1729;
  --tone-douceur-bg: #2d4c49; --tone-douceur-fg: #e3f2ef;
  --tone-lavande-bg: #41345a; --tone-lavande-fg: #ede5f8;
  --tone-prune-bg: #c9b3ec;   --tone-prune-fg: #1f1729;
  --sc-bg: #3a3214;
  --sc-fg: #f3d873;
  --sc-border: #5c4f1c;
  --shelf-1: #c9b3ec; --shelf-2: #8f74bf; --shelf-3: #41345a; --shelf-4: #6fa9a4; --shelf-5: #2d4c49;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

/* Barre du haut */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
/* Titres : Fraunces (serif), couleur prune */
h1, h2, h3, .brand, .card-title, .list-name, .section-title, .view-title {
  font-family: var(--font-serif);
  color: var(--heading);
}
h1, h2, h3, .brand { font-weight: 600; letter-spacing: -0.01em; }
.brand { font-size: 1.35rem; margin: 0; }
.brand span { color: var(--accent); }

/* Icônes dessinées (remplacent les émojis, interdits par la charte) */
.ui-icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }

.quick-exit {
  min-height: 44px;
  background: var(--exit);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}

main { max-width: 720px; margin: 0 auto; padding: 12px 16px; }
/* Liens : violet de la charte (et non le bleu par défaut du navigateur), y compris après une visite. */
a { color: var(--accent); }

.view { display: none; }
.view.active { display: block; }
.view-title { margin: 8px 0 4px; }
.hint { color: var(--muted); margin: 0 0 16px; font-size: .92rem; }

/* Bandeau d'accueil : phrase repère + motif étagère (charte) */
.shelf-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}
.shelf-text { min-width: 0; padding-bottom: 4px; }
.shelf-tagline {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--heading);
}
.shelf-sub { margin: 4px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.35; }
.shelf-art { flex: none; width: 128px; height: auto; overflow: visible; }
.shelf-art .s1 { fill: var(--shelf-1); }
.shelf-art .s2 { fill: var(--shelf-2); }
.shelf-art .s3 { fill: var(--shelf-3); }
.shelf-art .s4 { fill: var(--shelf-4); }
.shelf-art .s5 { fill: var(--shelf-5); }
.shelf-art .groove { stroke: var(--bg); stroke-width: 1.5; }
.shelf-art .shelf-line { stroke: var(--text); stroke-width: 1.5; }

/* Recherche & filtres */
.search-wrap input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .9rem;
  cursor: pointer;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}
.filter-row select {
  flex: 1 1 180px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .95rem;
}
.toggle { display: flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--muted); }

.count { color: var(--muted); font-size: .85rem; margin: 8px 0; }

/* Cartes */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 1.08rem; line-height: 1.25; margin: 0 0 4px; }
.card-meta { color: var(--muted); font-size: .85rem; margin: 0 0 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: .75rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  padding: 2px 7px;
}
.fav-btn {
  flex: none;
  background: none;
  border: 0;
  font-size: 1.3rem;
  color: var(--accent);
  cursor: pointer;
  padding: 4px;
}

/* Pastille d'intensité : couleur + nombre de barres pleines (1 à 3).
   Les barres disent le niveau par la forme : lisible sans distinguer les couleurs. */
.level {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.3;
  background: var(--lvl-bg); color: var(--lvl-fg);
}
.level-1 { --lvl-bg: var(--lvl1-bg); --lvl-fg: var(--lvl1-fg); }
.level-2 { --lvl-bg: var(--lvl2-bg); --lvl-fg: var(--lvl2-fg); }
.level-3 { --lvl-bg: var(--lvl3-bg); --lvl-fg: var(--lvl3-fg); }
.level-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.level-bars i { width: 3px; border-radius: 1px; background: currentColor; opacity: .3; }
.level-bars i:nth-child(1) { height: 5px; }
.level-bars i:nth-child(2) { height: 8px; }
.level-bars i:nth-child(3) { height: 11px; }
.level-1 .level-bars i:nth-child(-n+1),
.level-2 .level-bars i:nth-child(-n+2),
.level-3 .level-bars i { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* Onglets du bas */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 10;
}
.tab {
  flex: 1;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: .78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}
.tab-icon { width: 24px; height: 24px; }
.tab.active .tab-icon { stroke-width: 2.2; }
.tab.active { color: var(--accent); font-weight: 600; }

/* Fiches (dialog) */
.sheet {
  border: 0;
  padding: 0;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  max-height: 88dvh; /* dvh : suit la hauteur réelle de l'écran quand la barre d'adresse du téléphone apparaît ou disparaît */
  margin: auto auto 0;
  overscroll-behavior: contain; /* le défilement dans la fiche ne fait plus défiler la page derrière */
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--text);
}
@media (min-width: 700px) {
  .sheet { margin: auto; border-radius: 20px; }
}
.sheet::backdrop { background: rgba(10, 5, 20, .55); overflow: hidden; overscroll-behavior: contain; }
.sheet-body { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet h2 { margin-top: 0; }

.warning {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: .92rem;
}
.reveal { filter: blur(6px); user-select: none; transition: filter .2s; }
.reveal.shown { filter: none; user-select: auto; }

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 1rem;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); width: 100%; }
.btn-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; text-align: center; text-decoration: none; }

/* Aide */
.help-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.help-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.help-list li.urgent { border-left: 4px solid var(--heading); }
.help-list a { color: var(--text); text-decoration: none; display: block; font-size: 1.02rem; }
.help-list strong { color: var(--accent); margin-right: 6px; }
.help-list small { color: var(--muted); }
.note {
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.note h3 { margin-top: 0; }
.sheet-exit { float: right; margin-left: 12px; }

/* Couvertures */
.cover {
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  flex-direction: column;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-s { width: 52px; height: 74px; align-items: center; justify-content: center; }
.cover-l { width: 104px; height: 150px; }
/* Couverture générée : un aplat de la charte + une reliure à gauche,
   comme la tranche d'un livre (motif « étagère » de la charte). */
.cover-gen {
  --cv-bg: #4a2f6b; --cv-fg: #fffdf9; --cv-spine: #34204d;
  background: var(--cv-bg);
  color: var(--cv-fg);
  border-left: 5px solid var(--cv-spine);
  padding: 8px;
}
.cover-livre        { --cv-bg: #4a2f6b; --cv-fg: #fffdf9; --cv-spine: #34204d; }
.cover-film         { --cv-bg: #5b3a8c; --cv-fg: #fffdf9; --cv-spine: #4a2f6b; }
.cover-serie        { --cv-bg: #dcd0ec; --cv-fg: #2b2433; --cv-spine: #9a84be; }
.cover-documentaire { --cv-bg: #d6eae7; --cv-fg: #2b2433; --cv-spine: #4f8783; }
.cover-podcast      { --cv-bg: #e2d9cc; --cv-fg: #2b2433; --cv-spine: #4f8783; }
.cover-article      { --cv-bg: #dcd0ec; --cv-fg: #2b2433; --cv-spine: #4a2f6b; }
.cover-bd           { --cv-bg: #9a84be; --cv-fg: #2b2433; --cv-spine: #4a2f6b; }
.cover-s.cover-gen { padding: 0; }
.cover-icon { display: flex; }
.cover-icon .ui-icon { width: 24px; height: 24px; }
.cover-l .cover-icon { margin-bottom: auto; }
.cover-title { font-family: var(--font-serif); }
.cover-title { font-weight: 700; font-size: .82rem; line-height: 1.2; overflow-wrap: anywhere; }
.cover-author { font-size: .65rem; opacity: .85; margin-top: 4px; }
.cover-fallback { background: var(--accent-soft); }
.tags-themes { margin-top: 6px; }
.detail-head { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 4px; clear: both; }
.detail-head h2 { margin: 2px 0; font-size: 1.25rem; }

/* Listes thématiques */
.section-title { font-size: 1rem; margin: 16px 0 8px; }
.lists {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.lists::-webkit-scrollbar { display: none; }
.list-card {
  flex: none;
  width: 200px;
  min-height: 130px;
  scroll-snap-align: start;
  text-align: left;
  border: 0;
  border-radius: var(--radius);
  padding: 14px;
  color: var(--tone-fg);
  background: var(--tone-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  font: inherit;
}
.list-tone-0 { --tone-bg: var(--tone-douceur-bg); --tone-fg: var(--tone-douceur-fg); border-top: 6px solid var(--vert-eau); }
.list-tone-1 { --tone-bg: var(--tone-lavande-bg); --tone-fg: var(--tone-lavande-fg); }
.list-tone-2 { --tone-bg: var(--tone-prune-bg);   --tone-fg: var(--tone-prune-fg); }
.list-name { font-weight: 600; font-size: 1.15rem; line-height: 1.2; color: inherit; }
.list-desc { font-size: .82rem; flex: 1; }
.list-count { font-size: .78rem; font-weight: 600; }
.list-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.list-banner small { color: var(--muted); }
.list-banner .btn { padding: 6px 12px; }
.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer;
}

/* Formulaire */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: .92rem; font-weight: 600; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.req { color: var(--heading); }
.privacy { font-size: .85rem; color: var(--muted); margin: 0; }
.form-status { margin: 0; font-size: .92rem; min-height: 1.2em; }
.form-status.ok { color: var(--ok); }
.form-status.error { color: var(--text); font-weight: 600; } /* le rouge est réservé à « Sortie rapide » */
[hidden] { display: none !important; }

/* Agenda */
.date-badge {
  flex: none;
  width: 52px;
  padding: 6px 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  text-align: center;
  font-size: .75rem;
  line-height: 1.1;
  text-transform: uppercase;
}
.date-badge span { display: block; font-size: 1.4rem; font-weight: 700; }
.event-city { margin: 0 0 2px; font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.event-facts { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.empty .btn { margin-top: 4px; }

/* Annuaire d'aide */
.help-dir { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.help-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.help-entry .card-meta { margin-bottom: 4px; }
.help-desc { margin: 4px 0 10px; font-size: .92rem; }
.contacts { display: flex; flex-wrap: wrap; gap: 6px; }
.contact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
}
.tab { font-size: .72rem; }

/* Note SensCritique */
.tags .level + .sc-badge { margin-left: 6px; }
.sc-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-size: .74rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--sc-bg);
  color: var(--sc-fg);
  border: 1px solid var(--sc-border);
}
.sc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
}
.sc-row small { color: var(--muted); }
.sc-badge-l { font-size: 1.15rem; padding: 6px 10px; }
.sc-badge-l small { font-size: .7rem; font-weight: 600; }

/* Encart « Témoigner » */
.testify {
  display: grid; gap: 6px;
  margin: 16px 0 4px; padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--tone-prune-bg);
  color: var(--tone-prune-fg); text-decoration: none;
}
.testify strong { font-size: 1.05rem; }
.testify span { font-size: .9rem; opacity: .95; }
.testify .testify-cta {
  justify-self: start; margin-top: 4px; padding: 7px 12px;
  border-radius: 999px; border: 1.5px solid currentColor; font-weight: 600; opacity: 1;
}

/* Lien + remplissage automatique */
.url-fill { display: grid; gap: 6px; }
.url-fill > label { font-size: .92rem; font-weight: 600; }
.url-row { display: flex; gap: 8px; }
.url-row input { flex: 1; min-width: 0; }
.url-row .btn { flex: none; padding: 9px 14px; }
.hint-small { color: var(--muted); font-size: .8rem; }
.img-credit { color: var(--muted); font-size: .72rem; margin: 6px 0 0; }

/* Page neutre de la sortie rapide */
body.neutral { background: #fffdf5; color: #222; padding: 0; }
.neutral-page h1 { font: 600 1.2rem system-ui, sans-serif; margin: 0; padding: 16px; border-bottom: 1px solid #eee; }
.neutral-page textarea { width: 100%; height: 80vh; border: 0; padding: 16px; font: 1rem system-ui, sans-serif; background: transparent; color: #222; resize: none; }
.exit-explain { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border-radius: 12px; padding: 12px; margin: 12px 0 16px; }
.exit-explain p { margin: 0; font-size: .9rem; }
.exit-sample { flex: none; font-size: .78rem; padding: 6px 10px; cursor: default; }

/* Bouton Proposer en tête de liste */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.list-head .count { margin: 0; }
.btn-small { padding: 7px 12px; font-size: .88rem; border-radius: 999px; color: var(--accent); border-color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Scan du code-barres */
.scan-view { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-width: 100%; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 30% 12%; border: 3px solid rgba(255,255,255,.85); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scan-photo { display: block; text-align: center; margin-top: 4px; }
.list-head .suggest-cta { width: auto; margin-top: 0; flex: none; }
.list-head .count { white-space: nowrap; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-pair label { min-width: 0; }

/* Comprendre */
.learn-cta {
  display: grid; gap: 4px; width: 100%; text-align: left; cursor: pointer; font: inherit;
  margin: 4px 0 14px; padding: 14px 16px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
}
.learn-cta strong { font-size: 1.05rem; }
.learn-cta span { font-size: .88rem; opacity: .92; }
.acc-list { display: grid; gap: 8px; }
.acc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.acc summary { cursor: pointer; padding: 12px 14px; display: grid; gap: 2px; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary strong::after { content: " ＋"; color: var(--accent); font-weight: 400; }
.acc[open] summary strong::after { content: " －"; }
.acc summary span { color: var(--muted); font-size: .88rem; }
.acc-body { padding: 0 14px 12px; font-size: .95rem; }
.acc-body p { margin: 0 0 10px; }
.acc-source { color: var(--muted); font-size: .82rem; }
.acc-source a { color: var(--accent); }
.small-print { font-size: .78rem; margin-top: 16px; }
/* Questionnaire */
.quiz-progress { color: var(--muted); font-size: .85rem; margin: 0 0 6px; }
.quiz-bar { height: 6px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.quiz-bar span { display: block; height: 100%; background: var(--accent); }
.quiz-question { font-size: 1.12rem; font-weight: 600; margin: 18px 0; line-height: 1.4; }
.quiz-answers { display: grid; gap: 8px; }
.quiz-answer { text-align: left; padding: 14px 16px; }
.quiz-answer.selected { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 16px; font-size: .9rem; }
.quiz-result { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.quiz-result p { margin: 0 0 8px; }
.quiz-message { font-weight: 600; font-size: 1.02rem; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.help-list.compact li { padding: 10px 12px; }
.chips-wrap .chip { flex: 0 1 auto; white-space: normal; text-align: left; max-width: 100%; }

/* Formulaires : les lignes gardent leur taille naturelle (pas d'étirement),
   les zones de texte ne se redimensionnent qu'en hauteur et grandissent avec le texte. */
.form { align-content: start; align-items: start; }
.form > * { min-width: 0; }
.form textarea { resize: vertical; min-height: 96px; max-width: 100%; field-sizing: content; max-height: 60vh; }
.form [type="submit"] { align-self: start; height: auto; }
.acc { scroll-margin-top: 84px; }

/* Comprendre : sommaire, rubriques, tuiles, étapes, réflexion */
.rub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rub-tile, .tile {
  display: grid; gap: 6px; align-content: start; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px;
}
.rub-tile strong, .tile strong { font-size: .95rem; line-height: 1.25; }
.rub-tile span, .tile span { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.rub-icon, .tile-icon { width: 30px; height: 30px; color: var(--accent); }
.inline-icon { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.back-link { margin: 4px 0 10px; font-size: .95rem; }
.rub-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.rub-head h3, .rub-head h2 { margin: 0; }
.rub-head .rub-icon { width: 36px; height: 36px; flex: none; }
.acc-badge { display: inline-block; justify-self: start; font-style: normal; font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; margin-top: 4px; }
.steps { margin: 6px 0 16px; }
.steps-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; scrollbar-width: none; border-radius: var(--radius); }
.steps-track::-webkit-scrollbar { display: none; }
.step { flex: 0 0 100%; scroll-snap-align: start; background: var(--accent-soft); padding: 16px; box-sizing: border-box; }
.step p { margin: 0; }
.step-num { font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.step-title { font-weight: 700; font-size: 1.05rem; margin: 4px 0 6px !important; }
.steps-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.steps-dots { display: flex; gap: 6px; }
.steps-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.steps-dots i.on { background: var(--accent); }
.reflexion { margin: 12px 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--accent); background: var(--surface); }
.reflexion-title { font-weight: 700; margin: 0 0 6px !important; color: var(--accent); }
.reflexion-part { font-weight: 600; margin: 8px 0 2px !important; font-size: .9rem; }
.reflexion ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.reflexion-note { color: var(--muted); font-size: .8rem; margin: 10px 0 0 !important; }
.reflexion-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.sheet-text p { margin: 0 0 10px; }

/* Changement d'onglet : fondu court (View Transitions), désactivé si la personne limite les animations */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
