/* ==========================================================================
   Bien Connu — design system (CSS écrit à la main, sans build)
   Sommaire
   1.  Variables
   2.  Reset & base
   3.  Typographie
   4.  Mise en page & utilitaires
   5.  Transitions de page
   6.  Révélation en cascade
   7.  Boutons
   8.  Cartes, notices, éléments de liste
   9.  Badges, étiquettes
   10. Champs de formulaire
   11. Choix (radio cards)
   12. Toasts
   13. Modales
   14. Header & navigation
   15. Composants divers (logo, stepper, thumb, chip, empty, stat, pulse-bar)
   16. Layout invité
   17. Mouvement réduit
   ========================================================================== */

/* 1. Variables ------------------------------------------------------------ */
:root {
  --paper: #F6F3EE;
  --card: #FBF9F5;
  --ink: #111315;
  --orange: #F45112;
  --orange-dark: #D8410A;
  --white: #FFFFFF;

  --ok: #1F6B3A;        --ok-bg: #DCEBDD;
  --warn: #7A4A00;      --warn-bg: #F6DFA6;   --warn-solid: #F2B63D;
  --err: #B3261E;       --err-bg: #F8DAD6;
  --pause: #55524C;     --pause-bg: #E4E0D8;

  --muted: #4B473F;
  --line: #CFC8BA;

  --radius: 0;
  --bw: 2px;            /* contour structurant */
  --bw-thin: 2px;       /* contour courant */

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;

  --font-display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --font-text: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 150ms;
  --t-med: 280ms;
  --t-slow: 450ms;

  --content: 960px;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --nav-h: 64px;
  --header-h: 64px;
}

/* 2. Reset & base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none; }
::selection { background: var(--ink); color: var(--paper); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.card--ink :focus-visible, .toast :focus-visible, .on-ink :focus-visible { outline-color: var(--paper); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: var(--space-3) var(--space-4);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

/* 3. Typographie ---------------------------------------------------------- */
.display, .headline--loud .headline__title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: .005em;
}
.headline { display: grid; gap: var(--space-3); }
/* Titre courant : lisible, en casse normale. */
.headline__title {
  font-family: var(--font-text); font-weight: 800; line-height: 1.1; letter-spacing: -.01em;
  font-size: clamp(1.9rem, 6.5vw, 2.75rem); text-wrap: balance;
}
/* Titre d'affiche : réservé aux moments forts (état de l'accueil, premiers pas). */
.headline--loud .headline__title { font-size: clamp(2.6rem, 10vw, 4.75rem); }
.headline__sub { font-size: 1.1875rem; color: var(--muted); max-width: 36em; }
.headline--ink .headline__sub { color: inherit; }

.h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.h3 { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
.eyebrow { font-size: .875rem; font-weight: 600; color: var(--muted); }
.text-muted { color: var(--muted); }
.text-sm { font-size: 1rem; }
.text-xs { font-size: .875rem; }
.text-strong { font-weight: 700; }
.link { font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.link:hover { text-decoration-thickness: 4px; }

/* 4. Mise en page & utilitaires ------------------------------------------ */
.container { width: 100%; max-width: calc(var(--content) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.page { padding-block: var(--space-6) var(--space-8); display: grid; gap: var(--space-6); align-content: start; }
.stack { display: grid; gap: var(--space-4); align-content: start; }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-6); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 0; min-width: 0; }
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.center { text-align: center; }
.divider { border: 0; border-top: var(--bw-thin) solid var(--line); margin: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 5. Transitions de page -------------------------------------------------- */
@view-transition { navigation: auto; }
.page, .guest__inner { view-transition-name: page; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(page) { animation: vt-out 180ms var(--ease) both; }
::view-transition-new(page) { animation: vt-in 320ms var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* Repli sans View Transitions (classe posée par le script du <head>) */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
.fx-fade .page, .fx-fade .guest__inner { animation: page-in var(--t-slow) var(--ease) both; }
.fx-fade.is-leaving .page, .fx-fade.is-leaving .guest__inner {
  opacity: 0; transform: translateY(-8px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

/* 7. Boutons -------------------------------------------------------------- */
.btn {
  --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-bd: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 10px 22px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: var(--bw) solid var(--btn-bd); border-radius: var(--radius);
  font-family: var(--font-text); font-size: 1rem; font-weight: 700; line-height: 1.2;
  text-decoration: none; text-align: center;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast) var(--ease), transform 90ms var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover { --btn-bg: #EAE5DC; }
.btn:active:not(:disabled):not(.is-disabled):not(.is-loading) { transform: translate(2px, 2px); }
.btn .icon { flex: none; }

.btn--primary { --btn-bg: var(--orange); --btn-fg: var(--ink); font-weight: 800; font-size: 1.1875rem; }
.btn--primary:hover { --btn-bg: var(--orange-dark); }
.btn--primary.btn--sm { --btn-fg: var(--ink); font-size: 1rem; }
.btn--primary.btn--sm:hover { --btn-bg: #F0652F; }
.btn--secondary { --btn-bg: var(--paper); }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.btn--ghost:hover { --btn-bg: transparent; --btn-bd: var(--ink); text-decoration: none; }
.btn--danger { --btn-bg: var(--paper); --btn-fg: var(--err); --btn-bd: var(--err); }
.btn--danger:hover { --btn-bg: var(--err); --btn-fg: var(--white); }
.btn--danger.btn--solid { --btn-bg: var(--err); --btn-fg: var(--white); }

.btn--sm { min-height: 44px; padding: 8px 16px; font-size: .9375rem; }
.btn--lg { min-height: 60px; padding: 14px 30px; font-size: 1.25rem; }
.btn--block { display: flex; width: 100%; }

.btn:disabled, .btn.is-disabled {
  --btn-bg: #E4DFD6; --btn-fg: #6B665E; --btn-bd: #8E887D;
  cursor: not-allowed; pointer-events: none; text-decoration: none;
}
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border: 3px solid var(--btn-fg); border-top-color: transparent; border-radius: 0;
  animation: spin .8s linear infinite;
}
.btn--primary.is-loading::after { border-color: var(--white); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon { flex: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; background: transparent;
  border: var(--bw-thin) solid transparent; border-radius: var(--radius);
  transition: border-color var(--t-fast) var(--ease), transform 90ms var(--ease);
}
.icon-btn:hover { border-color: currentColor; }
.icon-btn:active { transform: translate(2px, 2px); }

/* 8. Cartes, notices, éléments de liste ----------------------------------- */
.card {
  background: var(--card); color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: var(--radius);
  padding: var(--space-5);
}
.card--lg { padding: var(--space-6); }
.card--tight { padding: var(--space-4); }
.card--flat { border: var(--bw-thin) solid #8F887A; background: transparent; }
.card--ink { background: var(--ink); color: var(--paper); }
.card--ink .text-muted, .card--ink .eyebrow { color: #C9C3B8; }
a.card, button.card { display: block; text-decoration: none; text-align: left; width: 100%; transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
a.card:hover { background: var(--white); }
a.card:active { transform: translate(2px, 2px); }

/* 9. Badges, étiquettes --------------------------------------------------- */
.badge {
  --b-fg: var(--ink); --b-bg: var(--paper); --b-bd: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; min-height: 28px;
  background: var(--b-bg); color: var(--b-fg);
  border: var(--bw-thin) solid var(--b-bd); border-radius: var(--radius);
  font-size: .875rem; font-weight: 700; line-height: 1.2; white-space: nowrap;
}
.badge--active  { --b-fg: var(--ok);    --b-bg: var(--ok-bg);    --b-bd: var(--ok); }
.badge--pending { --b-fg: var(--warn);  --b-bg: var(--warn-bg);  --b-bd: var(--warn); }
.badge--error   { --b-fg: var(--err);   --b-bg: var(--err-bg);   --b-bd: var(--err); }
.badge--paused  { --b-fg: var(--pause); --b-bg: var(--pause-bg); --b-bd: var(--pause); }
.badge--done    { --b-fg: var(--paper); --b-bg: var(--ink);      --b-bd: var(--ink); }
.badge--neutral { --b-fg: var(--muted); --b-bg: var(--paper);    --b-bd: var(--line); }

/* Pastille de compteur (nav) */
.count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--warn-solid); color: var(--ink);
  border: 2px solid var(--ink); font-size: .75rem; font-weight: 800; line-height: 1;
}

/* Étiquette inclinée : réservée à de rares usages (« Nouveau ») */
.sticker {
  display: inline-block; padding: 2px 10px;
  background: var(--orange); color: var(--ink);
  border: 2px solid var(--ink);
  font-family: var(--font-display); font-size: 1rem; text-transform: uppercase; letter-spacing: .03em;
  transform: rotate(-2.5deg);
}

/* 10. Champs de formulaire ------------------------------------------------ */
.field { display: grid; gap: var(--space-2); }
.field__label { font-weight: 700; font-size: 1rem; }
.field__control {
  width: 100%; min-height: 52px; padding: 12px 14px;
  background: var(--white); color: var(--ink);
  border: var(--bw-thin) solid var(--ink); border-radius: var(--radius);
  font-size: 1.0625rem; line-height: 1.4;
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.field__control::placeholder { color: #7B766C; opacity: 1; }
.field__control:hover { background: #FFFEFC; }
.field__control:focus { outline: 3px solid var(--orange); outline-offset: 0; }
select.field__control {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='square'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
}
textarea.field__control { min-height: 120px; resize: vertical; }
textarea[data-autogrow] { resize: none; overflow: hidden; }
.field__error { display: flex; gap: 6px; align-items: flex-start; font-size: .9375rem; font-weight: 700; color: var(--err); }
.field__error .icon { margin-top: 2px; }
.field--error .field__control { border-color: var(--err); border-width: 3px; }
.field__counter { font-size: .8125rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.field__counter.is-over { color: var(--err); font-weight: 700; }

/* 11. Choix (radio cards) ------------------------------------------------- */
.choices { display: grid; gap: var(--space-3); }
.choice { position: relative; display: block; cursor: pointer; }
.choice__input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.choice__body {
  display: grid; gap: 2px; padding: var(--space-4) 56px var(--space-4) var(--space-4); min-height: 64px;
  background: var(--card); color: var(--ink);
  border: var(--bw-thin) solid var(--ink);
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease), transform 90ms var(--ease);
}
.choice__title { font-weight: 800; font-size: 1.125rem; }
.choice__text { font-size: .9375rem; color: var(--muted); transition: color var(--t-med) var(--ease); }
.choice:hover .choice__body { background: var(--white); }
.choice__input:active + .choice__body { transform: translate(2px, 2px); }
.choice__input:checked + .choice__body { background: var(--ink); color: var(--paper); }
.choice__input:checked + .choice__body .choice__text { color: #D9D3C8; }
.choice__input:focus-visible + .choice__body { outline: 3px solid var(--ink); outline-offset: 3px; }
.choice.is-pop .choice__body { animation: pop var(--t-med) var(--ease); }
@keyframes pop { 40% { transform: scale(1.015); } }

/* 12. Toasts -------------------------------------------------------------- */
.toasts {
  position: fixed; z-index: 90; left: 0; right: 0;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  display: grid; gap: var(--space-2); justify-items: center;
  padding-inline: var(--gutter); pointer-events: none;
}
.toasts--guest { bottom: calc(16px + env(safe-area-inset-bottom)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--space-3);
  width: 100%; max-width: 480px; min-height: 52px; padding: 8px 8px 8px 14px;
  background: var(--ink); color: var(--paper); border: var(--bw-thin) solid var(--ink);
  border-left: 10px solid var(--ok-bg);
  animation: toast-in var(--t-med) var(--ease) both;
}
.toast--ok { border-left-color: #6BC48A; }
.toast--err { background: var(--err); border-color: var(--ink); border-left-color: var(--ink); color: var(--white); }
.toast--info { border-left-color: var(--warn-solid); }
.toast__msg { flex: 1; font-weight: 600; }
.toast__close { color: inherit; }
.toast.is-leaving { animation: toast-out 220ms var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(16px); } }

/* 13. Modales ------------------------------------------------------------- */
dialog.modal {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink);
  overflow: hidden;
}
dialog.modal[open] { display: flex; align-items: flex-end; justify-content: center; }
dialog.modal::backdrop { background: rgba(17, 17, 17, .6); }
dialog.modal[open]::backdrop { animation: fade-in var(--t-med) var(--ease) both; }
dialog.modal.is-closing::backdrop { animation: fade-out 220ms var(--ease) both; }
.modal__panel {
  width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto;
  background: var(--card); border: var(--bw) solid var(--ink); border-bottom-width: 0;
  padding: var(--space-5) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
  display: grid; gap: var(--space-4);
}
dialog.modal[open] .modal__panel { animation: sheet-in var(--t-med) var(--ease) both; }
dialog.modal.is-closing .modal__panel { animation: sheet-out 220ms var(--ease) both; }
.modal--lg .modal__panel { max-width: 720px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.modal__title { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.modal__body { display: grid; gap: var(--space-3); }
.modal__foot { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: flex-end; }
.modal__foot .btn { flex: 1 1 140px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(32px); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(24px); } }
body:has(dialog.modal[open]) { overflow: hidden; }

/* 14. Header & navigation ------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); border-bottom: var(--bw) solid var(--ink);
  padding-top: env(safe-area-inset-top);
}
.app-header__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: var(--header-h); padding-block: var(--space-2);
}
.app-header__brand { display: inline-flex; text-decoration: none; }
.app-header__action { margin-left: auto; }

.app-nav {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper); border-top: var(--bw) solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}
.app-nav__link {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--nav-h); padding: 6px 4px;
  font-size: .875rem; font-weight: 600; text-decoration: none;
  color: var(--muted);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.app-nav__link:hover { background: #EAE5DC; color: var(--ink); }
.app-nav__link[aria-current="page"] { color: var(--ink); font-weight: 800; }
.app-nav__link[aria-current="page"]::before {
  content: ""; position: absolute; left: 12px; right: 12px; top: -3px; height: 6px; background: var(--ink);
}
.app-nav__icon { position: relative; }
.app-nav__icon .count { position: absolute; top: -10px; left: 12px; }
.app-nav__link > .count { display: none; }
.has-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }

@media (min-width: 800px) {
  .has-nav { padding-bottom: 0; }
  .app-header__bar { gap: var(--space-6); }
  .app-nav {
    position: static; display: flex; gap: var(--space-2); border: 0; background: transparent; padding: 0;
    margin-right: auto; align-self: stretch;
  }
  .app-nav__link {
    flex-direction: row; gap: var(--space-2); min-height: 44px; padding: 0 14px;
    font-size: 1rem; align-self: center;
  }
  .app-nav__link:hover { background: transparent; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
  .app-nav__icon { display: none; }
  .app-nav__link[aria-current="page"]::before { left: 14px; right: 14px; top: auto; bottom: -3px; height: 5px; }
  .app-nav__link[aria-current="page"] { align-self: stretch; }
  .app-nav__link > .count { display: inline-flex; }
  .toasts { bottom: 24px; }
  dialog.modal[open] { align-items: center; }
  .modal__panel { border-bottom-width: var(--bw); padding-bottom: var(--space-5); }
  dialog.modal[open] .modal__panel { animation-name: pop-in; }
  dialog.modal.is-closing .modal__panel { animation-name: pop-out; }
  .page { padding-block: var(--space-7) var(--space-8); }
}
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* 15. Composants divers --------------------------------------------------- */
/* Logo */
.logo { display: block; flex: none; width: var(--logo-w, 120px); }
.logo img { width: 100%; height: auto; }

/* Stepper */
.stepper { display: flex; align-items: center; gap: var(--space-3); }
.stepper__count { font-size: .8125rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.stepper__bars { display: flex; gap: 4px; flex: 1; max-width: 200px; }
.stepper__bar { flex: 1; height: 8px; border: 2px solid var(--ink); background: transparent; transition: background-color var(--t-med) var(--ease); }
.stepper__bar.is-done { background: var(--ink); }

/* Photo de bien */
.thumb { position: relative; display: block; aspect-ratio: var(--ratio, 4/3); overflow: hidden; background: var(--pause-bg); border: var(--bw-thin) solid var(--ink); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb__fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted);
  background-color: var(--pause-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M-2 2l4-4M0 16L16 0M14 18l4-4' stroke='%23CFC8BA' stroke-width='2'/%3E%3C/svg%3E");
}
.thumb__fallback .icon { background: var(--paper); border: 2px solid var(--muted); padding: 8px; width: 44px; height: 44px; }
.thumb--lg { --ratio: 16/10; }

/* Pastille de réseau */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-3); min-height: 52px;
  padding: 8px 14px 8px 12px; background: var(--card); color: var(--ink);
  border: var(--bw-thin) solid var(--ink); text-decoration: none;
}
a.chip { transition: background-color var(--t-fast) var(--ease), transform 90ms var(--ease); }
a.chip:hover { background: var(--white); }
a.chip:active { transform: translate(2px, 2px); }
.chip__text { display: grid; line-height: 1.25; }
.chip__name { font-weight: 800; }
.chip__state { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; font-weight: 700; }
.chip--on .chip__state { color: var(--ok); }
.chip--off { border-style: dashed; }
.chip--off .chip__state { color: var(--err); }
.chip__cta { margin-left: var(--space-2); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* État vide */
.empty {
  display: grid; gap: var(--space-3); justify-items: start; padding: var(--space-6) var(--space-5);
  border: var(--bw-thin) dashed var(--ink); background: transparent;
}
.empty__title { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 1.75rem; line-height: 1.1; }
.empty__text { color: var(--muted); max-width: 32em; }

/* Barre de préparation (indéterminée par défaut, ou --value: 60%) */
.pulse-bar { position: relative; height: 14px; border: var(--bw-thin) solid var(--ink); background: var(--card); overflow: hidden; }
.pulse-bar::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--ink);
  animation: pulse-run 1.4s var(--ease) infinite;
}
.pulse-bar[style*="--value"]::before { width: var(--value); animation: none; transition: width var(--t-slow) var(--ease); }
@keyframes pulse-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 16. Layout invité ------------------------------------------------------- */
.guest { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.guest__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--space-6) var(--gutter); }
.guest__inner { width: 100%; max-width: 520px; display: grid; gap: var(--space-6); justify-items: start; padding-block: var(--space-4); }
.guest__inner--wide { max-width: 720px; }
.guest__brand { display: inline-flex; text-decoration: none; }
.guest__foot { padding: var(--space-4) var(--gutter) calc(var(--space-4) + env(safe-area-inset-bottom)); font-size: .875rem; color: var(--muted); }
.guest__inner > * { min-width: 0; max-width: 100%; }
.guest__inner .btn--block, .guest__inner form { width: 100%; }

/* 17. Mouvement réduit ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .pulse-bar::before { width: 40%; transform: translateX(80%); }
}

/* 18. Lisibilité et clarté ------------------------------------------------ */
/* L'attribut hidden doit toujours gagner, même sur une grille ou un flex. */
[hidden] { display: none !important; }

/* Un titre long en capitales est lourd : on le réduit, il reste dominant. */
.headline--loud.headline--long .headline__title { font-size: clamp(2rem, 7.2vw, 3.5rem); line-height: 1; }

/* Lien avec pictogramme : sur la même ligne, bien aligné. */
.link:has(> svg) { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; }
.link:has(> svg):hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Écrans d'accueil : on commence en haut sur téléphone, sans grand vide avant le titre. */
@media (max-width: 799px) {
  .guest__main { align-items: flex-start; padding-top: var(--space-5); }
  .guest__inner { gap: var(--space-5); }
}
