/* Pages /avis et /resultats : avis anonyme sur le futur site et résultats en direct (nuage de mots). Deux blocs, sans menu.
   Charte de styles.css (chargé avant) : noir, rouge, gris, blanc ; titres Archivo Black, texte Arimo. Aucune bibliothèque. */

/* ---------- Page /avis : deux blocs, sans menu (titre à gauche, formulaire à droite) ---------- */
.av {
  background: var(--paper);
}
.av-split {
  display: grid;
  min-height: 100svh;
}
@media (min-width: 56rem) {
  .av-split {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}
.av-left {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  color: var(--white);
  background: var(--ink);
  border-bottom: 4px solid var(--brand);
  overflow: hidden;
}
@media (min-width: 56rem) {
  .av-left {
    border-bottom: 0;
    border-right: 4px solid var(--brand);
  }
}
.av-left__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 20% 85%, rgba(216, 34, 22, 0.32) 0%, rgba(216, 34, 22, 0) 70%),
    linear-gradient(160deg, #1b1b1b 0%, var(--ink) 60%);
}
.av-left__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--brand-light);
}
.av-left__brand img {
  width: auto;
  height: 2.5rem;
}
.av-left__brand span {
  line-height: 1.4;
}
.av-left__body {
  margin-block: auto;
}
.av-left__title {
  max-width: 16ch;
  font-size: clamp(1.8rem, 3.3vw, 3rem);
  text-wrap: balance;
}
.av-left__lead {
  margin: 1.25rem 0 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: rgba(255, 255, 255, 0.85);
}
.av-left__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}
.av-left__link svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: var(--brand-light);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}
.av-left__link:hover svg {
  transform: translateX(3px);
}
.av-left__tr {
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}
.av-left__tr a {
  color: var(--white);
}
.av-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3.5rem);
}
.av-right__inner {
  width: 100%;
  max-width: 36rem;
}
.av-right__inner--wide {
  max-width: 58rem;
}
@media (min-width: 56rem) {
  /* Résultats : le nuage a besoin de place, le bloc de gauche est plus étroit. */
  .av-split--results {
    grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  }
  .av-split--results .av-right {
    align-items: flex-start;
  }
}
.av-live {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--white);
  border-radius: 999px;
}
:lang(zh) .av-live {
  letter-spacing: 0.02em;
}
.av-live__dot {
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brand);
}
.av-live__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--brand);
  animation: ping 1.8s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .av-live__dot::after {
    animation: none;
  }
}
@media (max-width: 55.99rem) {
  /* Téléphone et tablette : le bloc de gauche devient un bandeau court, le formulaire arrive tout de suite. */
  .av-split {
    min-height: 0;
  }
  .av-left {
    gap: 1.25rem;
  }
  .av-left__title {
    max-width: 20ch;
    font-size: clamp(1.5rem, 6vw, 2.2rem);
  }
  .av-left__lead {
    margin-top: 0.6rem;
  }
  .av-left__link {
    margin-top: 0.9rem;
  }
}
.av-form,
.av-done {
  box-shadow: 0 1px 0 var(--mist), 0 18px 40px rgba(17, 17, 17, 0.08);
}
.av-form {
  gap: 1.35rem;
}
/* Idées : un champ (avec son compteur) et un bouton « + » à sa droite ; les idées ajoutées se rangent en liste dessous. */
.av-entry {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.av-entry[hidden],
.av-list[hidden] {
  display: none;
}
.av-entry__field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
/* « input. » : plus précis que .cform input[type="text"] de styles.css, sinon la place du compteur serait perdue. */
.cform input.av-entry__input {
  height: 100%;
  min-height: 3rem;
  padding-right: 3.4rem;
  text-overflow: ellipsis;
}
.av-entry__count {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ash);
  pointer-events: none;
}
.av-entry__count.is-full {
  color: var(--brand);
  font-weight: 700;
}
.av-entry__add {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 3rem;
  min-height: 3rem;
  padding: 0;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s;
}
.av-entry__add[hidden] {
  display: none;
}
.av-entry__add:hover {
  background: var(--brand);
}
.av-entry__add:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.av-entry__add svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.av-list {
  display: grid;
  gap: 0;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--mist);
}
.av-list__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.35rem 0 0.35rem 0.25rem;
  border-bottom: 1px solid var(--mist);
}
.av-list__item.is-new {
  animation: av-in 0.2s ease both;
}
@keyframes av-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .av-list__item.is-new {
    animation: none;
  }
}
.av-list__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.av-list__remove {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--ash);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s;
}
.av-list__remove:hover {
  color: var(--brand);
}
.av-list__remove:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: -3px;
}
.av-list__remove svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.av-done__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
}
.av-done p {
  margin: 0;
  line-height: 1.6;
  color: var(--steel);
}
.av-done__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.btn--line {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.btn--line:hover {
  background: var(--ink);
  color: var(--white);
}
.av-done .btn--primary:hover {
  background: var(--ink);
  color: var(--white);
}
/* Messages de la visite sans JavaScript : visibles seulement quand l'adresse se termine par leur ancre. */
.av-flash {
  display: none;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  font-weight: 700;
  border-left: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
}
.av-flash--err {
  border-color: var(--brand);
  background: #fdecea;
}
.av-flash:target {
  display: block;
}

/* ---------- Page /resultats ---------- */
.rs {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
}
.rs-note {
  margin: 0;
  padding: 1rem;
  background: var(--white);
  border-left: 4px solid var(--brand);
}
.rs-h {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ash);
}
.rs {
  container-type: inline-size;
}
.rs-stats {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
}
@container (min-width: 34rem) {
  .rs-stats {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  }
}
.rs-total,
.rs-who,
.rs-board {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--mist);
}
.rs-total {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  background: var(--brand);
}
.rs-total__n {
  margin: 0;
  font-family: var(--title);
  font-size: clamp(3rem, 8vw, 4.75rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rs-total__label {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.rs-bars {
  display: grid;
  gap: 0.85rem;
}
.rs-bars li {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 0.85rem;
}
@media (max-width: 30rem) {
  .rs-bars li {
    grid-template-columns: minmax(0, 1fr) 3rem;
  }
  .rs-bars__track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
.rs-bars__label {
  font-size: 0.9375rem;
  color: var(--steel);
}
.rs-bars__track {
  height: 0.65rem;
  background: var(--paper);
  border-radius: 999px;
  overflow: hidden;
}
.rs-bars__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.rs-bars li:first-child .rs-bars__fill {
  background: var(--brand);
}
.rs-bars__n {
  font-family: var(--title);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rs-board__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.rs-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--ash);
}
.rs-status__dot {
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brand);
}
.rs-status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--brand);
  animation: ping 1.8s ease-out infinite;
}
.rs-status.is-off .rs-status__dot,
.rs-status.is-off .rs-status__dot::after {
  background: var(--ash);
  animation: none;
}

/* Le nuage : les mots se rangent au centre ; --s (0 à 1) fixe la taille, data-tier la couleur. */
.rs-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1.1rem;
  min-height: 14rem;
  padding: clamp(1rem, 4vw, 2.5rem) 0;
}
.rs-cloud[hidden] {
  display: none;
}
.rs-word {
  --s: 0;
  font-family: var(--title);
  font-size: calc(0.95rem + var(--s) * clamp(1.4rem, 5vw, 3rem));
  line-height: 1.1;
  color: var(--ash);
  overflow-wrap: anywhere;
  transition:
    font-size 0.6s ease,
    color 0.6s ease;
}
.rs-word[data-tier="1"] {
  color: var(--brand);
}
.rs-word[data-tier="2"] {
  color: var(--ink);
}
.rs-word[data-tier="3"] {
  color: var(--steel);
}
:lang(zh) .rs-word {
  font-weight: 700;
}
.rs-word.is-new {
  animation: rs-in 0.8s ease both;
}
@keyframes rs-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rs-word,
  .rs-bars__fill {
    transition: none;
  }
  .rs-word.is-new {
    animation: none;
  }
}
.rs-empty {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--steel);
}
.rs-empty[hidden],
.rs-error[hidden] {
  display: none;
}
.rs-empty p {
  max-width: 28rem;
  margin: 0;
}
.rs-error {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 700;
  background: #fdecea;
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
}

/* ---------- Profil : liste déroulante native ---------- */
.av-who__label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.av-select {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 2.75rem 0.7rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.9rem center / 1.1rem;
  border: 2px solid var(--mist);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
/* Tant que rien n'est choisi, la consigne « Choisissez » est en gris, comme un texte d'exemple. */
.av-select:has(option[value=""]:checked) {
  color: var(--ash);
}
.av-select option {
  color: var(--ink);
}
.av-select:hover {
  border-color: var(--ash);
}
.av-select:focus {
  border-color: var(--ink);
  outline: 3px solid var(--brand);
  outline-offset: 1px;
}

/* ---------- Menu plein écran (téléphone et tablette) : les rubriques de l'accueil, dans le style de sa deuxième section ---------- */
html:has(.av-menu[open]) {
  overflow: hidden;
}
.av-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  color: var(--white);
  background: var(--ink);
  border: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.av-menu::backdrop {
  background: var(--ink);
}
.av-menu[open] {
  display: flex;
  flex-direction: column;
  animation: av-menu-in 0.22s ease both;
}
@keyframes av-menu-in {
  from {
    opacity: 0;
  }
}
.av-menu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.av-menu__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
}
.av-menu__brand img {
  width: auto;
  height: 1.75rem;
}
.av-menu__close {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
}
.av-menu__close svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.av-menu__close:focus-visible,
.av-menu__item:focus-visible,
.av-menu__brand:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}
.av-menu__nav {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 1.5rem 1.25rem 2rem;
}
.av-menu__list {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.av-menu__item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem 0;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.2s;
}
.av-menu__item:hover,
.av-menu__item:active {
  color: var(--white);
}
.av-menu__n {
  flex: none;
  min-width: 1.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
}
.av-menu__label {
  flex: 1;
  font-family: var(--title);
  font-size: clamp(1.45rem, 7.5vw, 2.6rem);
  line-height: 1.1;
  text-transform: uppercase;
  text-wrap: balance;
}
:lang(zh) .av-menu__label {
  text-transform: none;
}
.av-menu__icon {
  position: relative;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.av-menu__icon::before,
.av-menu__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.8rem;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.av-menu__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
/* Les titres se lèvent un à un à l'ouverture. */
.av-menu[open] .av-menu__list li {
  animation: av-menu-up 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.av-menu[open] .av-menu__list li:nth-child(2) {
  animation-delay: 0.04s;
}
.av-menu[open] .av-menu__list li:nth-child(3) {
  animation-delay: 0.08s;
}
.av-menu[open] .av-menu__list li:nth-child(4) {
  animation-delay: 0.12s;
}
.av-menu[open] .av-menu__list li:nth-child(5) {
  animation-delay: 0.16s;
}
@keyframes av-menu-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .av-menu[open],
  .av-menu[open] .av-menu__list li {
    animation: none;
  }
}

/* ==========================================================================
   Téléphone et tablette (moins de 56 rem) : allure d'application, très épurée.
   Pas de bandeau titre (le titre reste lu par les lecteurs d'écran), fond blanc, aucune ombre, traits fins,
   barre d'onglets claire en bas (Mon avis, Résultats), grandes zones à toucher (44 px au moins),
   bouton d'envoi plat collé en bas de l'écran, bords de l'écran respectés (viewport-fit=cover, env(safe-area-inset-*)).
   Sur ordinateur, rien ne change : la barre d'onglets y est masquée.
   ========================================================================== */
.av-tabs,
.av-burger {
  display: none;
}

/* Passage d'une page à l'autre en fondu, comme entre deux écrans d'une application (navigateurs récents ; sinon passage normal). */
@view-transition {
  navigation: auto;
}
.av-tabs {
  view-transition-name: av-tabs;
}
.av-left {
  view-transition-name: av-head;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.2s;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

@media (max-width: 55.99rem) {
  .av {
    /* Hauteur de la barre d'onglets ; 0 quand le clavier est ouvert (la barre se retire alors pour laisser la place). */
    --tabbar: 3.75rem;
    --line: 1px solid var(--mist);
    min-height: 100dvh;
    padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
    background: var(--white);
    -webkit-tap-highlight-color: transparent;
  }
  .av:has(input[type="text"]:focus) {
    --tabbar: 0px;
  }
  .av a,
  .av button,
  .av select {
    touch-action: manipulation;
  }

  /* --- En-tête : une fine barre blanche avec le blason, sans titre visible --- */
  .av-left {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: calc(0.75rem + env(safe-area-inset-top)) calc(1.25rem + env(safe-area-inset-right)) 0.75rem calc(1.25rem + env(safe-area-inset-left));
    color: var(--ink);
    background: var(--white);
    border: 0;
    border-bottom: var(--line);
  }
  .av-left__glow,
  .av-left__lead,
  .av-left__link,
  .av-live {
    display: none;
  }
  .av-left__brand {
    font-size: 0.625rem;
    color: var(--ink);
  }
  .av-left__brand img {
    height: 1.75rem;
  }
  .av-left__body {
    margin: 0;
  }
  /* Bouton menu, à droite de la barre du haut. */
  .av-burger {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: -0.25rem -0.6rem -0.25rem auto;
    color: var(--ink);
    border-radius: 50%;
  }
  .av-burger svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }
  .av-burger:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 0;
  }
  /* Le titre de la page reste lu par les lecteurs d'écran. */
  .av-left__title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .av-left__tr {
    flex-basis: 100%;
    color: var(--ash);
  }
  .av-left__tr a {
    color: var(--ink);
  }

  /* --- Contenu --- */
  .av-right {
    display: block;
    padding: 1.5rem calc(1.25rem + env(safe-area-inset-right)) 1.5rem calc(1.25rem + env(safe-area-inset-left));
  }
  .av-right__inner {
    max-width: 34rem;
    margin-inline: auto;
  }
  .av-right__inner--wide {
    max-width: 44rem;
  }

  /* --- Formulaire : pas de carte, des blocs séparés par l'espace --- */
  .av-form {
    gap: 1.75rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }
  .av-who__label,
  .av-form legend {
    margin-bottom: 0.6rem;
    font-size: 0.9375rem;
  }
  .av-select {
    min-height: 3.25rem;
    font-size: 16px; /* l'iPhone ne zoome pas */
    border-width: 1px;
    border-radius: 0.75rem;
  }

  /* Idées : champ et bouton « + » de 52 px, texte en 16 px (l'iPhone ne zoome pas), traits fins. */
  .cform input.av-entry__input {
    min-height: 3.25rem;
    font-size: 16px;
    border-width: 1px;
    border-radius: 0.75rem;
  }
  .av-entry__add {
    width: 3.25rem;
    min-height: 3.25rem;
    border-radius: 0.75rem;
  }
  .av-list {
    margin-top: 0.85rem;
  }

  /* Envoi : la mention d'anonymat d'abord, puis le bouton, plat, collé en bas de l'écran tant que le formulaire défile. */
  .av-form .cform__foot {
    display: contents;
  }
  .av-form .cform__note {
    order: 1;
    text-align: center;
  }
  .av-form .cform__error--form {
    order: 1;
  }
  .av-form #av-send {
    order: 2;
    position: sticky;
    bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 0.75rem);
    z-index: 5;
    width: 100%;
    min-height: 3.25rem;
    margin-top: -0.75rem;
    font-size: 0.9375rem;
    color: var(--white);
    background: var(--brand);
    border-radius: 0.75rem;
    box-shadow: none;
  }

  /* Merci : centré, sans carte. */
  .av-done {
    padding: 2.5rem 0 1rem;
    text-align: center;
    background: transparent;
    box-shadow: none;
  }
  .av-done .cform__tick {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1.25rem;
  }
  .av-done__actions {
    display: grid;
    gap: 0.6rem;
    margin-top: 2rem;
  }
  .av-done__actions .btn {
    width: 100%;
    min-height: 3.25rem;
    padding-inline: 1rem;
    letter-spacing: 0.04em;
    border-radius: 0.75rem;
  }
  .av-done__actions .btn--line {
    border-width: 1px;
    border-color: var(--mist);
  }
  .av-flash {
    border-radius: 0.75rem;
  }

  /* --- Résultats : blocs séparés par des traits fins, sans ombre --- */
  .rs,
  .rs-stats {
    gap: 0;
  }
  .rs-total,
  .rs-who,
  .rs-board {
    padding: 1.25rem 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border-bottom: var(--line);
  }
  .rs-board {
    border-bottom: 0;
  }
  /* Le total sur une ligne, en rouge, sans aplat. */
  .rs-total {
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.75rem;
    padding-top: 0;
    color: var(--ink);
  }
  .rs-total__n {
    font-size: clamp(2.5rem, 12vw, 3.25rem);
    color: var(--brand);
  }
  .rs-total__label {
    margin: 0;
    color: var(--ash);
  }
  .rs-h {
    margin-bottom: 0.9rem;
    font-size: 0.75rem;
  }
  .rs-bars {
    gap: 0.8rem;
  }
  .rs-bars li {
    grid-template-columns: minmax(0, 1fr) 2.5rem;
    gap: 0.4rem 0.75rem;
  }
  .rs-bars__track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 0.4rem;
    background: var(--paper);
  }
  .rs-cloud {
    gap: 0.25rem 0.8rem;
    min-height: 11rem;
    padding: 0.5rem 0 1.25rem;
  }
  .rs-word {
    font-size: calc(0.9rem + var(--s) * 1.6rem);
  }
  .rs-empty {
    padding: 2rem 0;
  }
  .rs-empty .btn {
    width: 100%;
    border-radius: 0.75rem;
  }

  /* --- Barre d'onglets claire --- */
  .av-tabs {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: rgba(255, 255, 255, 0.97);
    border-top: var(--line);
  }
  @supports (backdrop-filter: blur(1px)) {
    .av-tabs {
      background: rgba(255, 255, 255, 0.86);
      backdrop-filter: saturate(1.6) blur(16px);
    }
  }
  .av:has(input[type="text"]:focus) .av-tabs {
    display: none;
  }
  .av-tabs__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    height: var(--tabbar);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--ash);
    transition: color 0.15s;
  }
  .av-tabs__item svg {
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .av-tabs__item[aria-current="page"] {
    color: var(--ink);
  }
  .av-tabs__item[aria-current="page"] svg {
    stroke: var(--brand);
  }
  .av-tabs__item:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
  }
  /* Point rouge « en direct » sur l'onglet Résultats. */
  .av-tabs__live {
    position: absolute;
    top: 0.65rem;
    left: calc(50% + 0.6rem);
    width: 0.45rem;
    height: 0.45rem;
    background: var(--brand);
    border: 2px solid var(--white);
    border-radius: 50%;
    box-sizing: content-box;
  }
}

/* Écrans tactiles : pas d'effet de survol qui reste « collé » après un toucher. */
@media (hover: none) {
  .av .btn:hover {
    transform: none;
  }
}
