@charset "UTF-8";
/*
 * Cartofidele : CSS maison mobile-first (décision D-11).
 * Couches : reset → tokens → base → layout → components → utilities.
 * La couleur d'accent d'une boutique est injectée via --store-accent (étape 04).
 */
@layer reset, tokens, base, layout, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg { display: block; max-width: 100%; }
  /* L'attribut hidden l'emporte toujours (sinon .btn ou display:grid le réaffichent). */
  [hidden] { display: none !important; }
  input, button, textarea, select { font: inherit; }
}

@layer tokens {
  :root {
    --color-bg: #f7f7f5;
    --color-surface: #ffffff;
    --color-text: #1c1c1e;
    --color-muted: #5b5b63;
    --color-border: #d9d9de;
    /* Thème Cartofidele (D-114) : orange et noir, comme la page d'accueil. Sur l'orange,
       le texte est toujours noir (contraste) ; un texte orange sur fond clair utilise la
       teinte foncée --brand-ink. */
    --brand: #f97316;
    --brand-strong: #ea580c;
    --brand-ink: #c2410c;
    --on-brand: #111111;
    --ink: #0f0f10;
    --color-primary: var(--brand);
    --color-primary-text: var(--on-brand);
    --color-danger: #b3261e;
    --color-success: #1e7a3c;
    --color-warning: #8a5a00;
    --store-accent: var(--color-primary);

    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.25rem;
    --text-xl: 1.75rem;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    --radius: 0.75rem;
    --shadow: 0 1px 3px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.04);
    --tap-size: 3rem; /* cible tactile minimale confortable */
    --container: 60rem;
  }
}

@layer base {
  body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
  }
  h1 { font-size: var(--text-xl); line-height: 1.2; }
  h2 { font-size: var(--text-lg); line-height: 1.3; }
  a { color: var(--brand-ink); }
  :focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
}

@layer layout {
  .container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding: var(--space-4);
    flex: 1;
  }
  .stack > * + * { margin-top: var(--space-4); }
  .cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

  .site-header {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
  }
  .site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
  }
  .site-footer {
    padding: var(--space-4);
    color: var(--color-muted);
    font-size: var(--text-sm);
    text-align: center;
  }

  @media (min-width: 48rem) {
    .container { padding: var(--space-8) var(--space-6); }
  }
}

@layer components {
  /* Boutons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-size);
    padding: var(--space-2) var(--space-6);
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
  }
  .btn--primary { background: var(--brand); color: var(--color-primary-text); }
  .btn--secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
  .btn--danger { background: var(--color-danger); color: #ffffff; }
  .btn--lg { min-height: 4rem; font-size: var(--text-lg); width: 100%; }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

  /* Cartes */
  .card {
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .card__title { margin-bottom: var(--space-2); }
  .card__body { color: var(--color-muted); }

  /* Formulaires */
  .field { display: grid; gap: var(--space-1); }
  .field__label { font-weight: 600; }
  .field input, .field select, .field textarea {
    min-height: var(--tap-size);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) / 2);
    background: var(--color-surface);
  }
  .field__help { color: var(--color-muted); font-size: var(--text-sm); }
  .field__error { color: var(--color-danger); font-size: var(--text-sm); }
  .field--error input, .field--error select, .field--error textarea { border-color: var(--color-danger); }

  /* Messages */
  .messages { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
  .message {
    padding: var(--space-3) var(--space-4);
    border-radius: calc(var(--radius) / 2);
    border-left: 4px solid var(--color-primary);
    background: var(--color-surface);
  }
  .message--success { border-color: var(--color-success); }
  .message--warning { border-color: var(--color-warning); }
  .message--error { border-color: var(--color-danger); }

  /* Pagination */
  .pagination { display: flex; gap: var(--space-3); align-items: center; justify-content: center; }
  .pagination__status { color: var(--color-muted); }

  /* Indicateurs HTMX (styles inline de HTMX désactivés pour la CSP) */
  .htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
  .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

  /* Lien d'évitement (accessibilité clavier) */
  .skip-link { position: absolute; left: -999px; }
  .skip-link:focus { left: var(--space-4); top: var(--space-4); padding: var(--space-2); background: var(--color-surface); }
}

/* Étape 03 : navigation du compte, listes, boutons compacts. */
@layer layout {
  .site-header { justify-content: space-between; gap: var(--space-2) var(--space-3); flex-wrap: wrap; }
  .site-header__brand { flex-shrink: 0; }
  .site-header__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }
  .site-header__nav a { white-space: nowrap; }
  .site-header__nav a[aria-current="page"] { font-weight: 700; text-decoration: none; }
  .narrow { max-width: 28rem; margin-inline: auto; }
}

@layer components {
  .btn--sm { min-height: 2.5rem; padding: var(--space-1) var(--space-3); font-size: var(--text-sm); }
  .list { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
  .list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) / 2);
  }
  .field ul { list-style: none; padding: 0; display: grid; gap: var(--space-1); }
}

/* Étape 04 : espace pro, formulaires à choix, QR code, page publique. */
@layer components {
  fieldset { border: 1px solid var(--color-border); }
  legend { font-weight: 700; padding-inline: var(--space-2); }
  .pro-bar {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 3px solid var(--brand);
  }
  .pro-bar__store { display: flex; align-items: center; gap: var(--space-2); }
  .pro-bar__logo { border-radius: 50%; object-fit: cover; }
  .pro-nav { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
  .pro-nav a { padding-block: var(--space-2); }
  .pro-nav a[aria-current="page"] { font-weight: 700; color: var(--color-text); text-decoration-thickness: 3px; }

  /* Code secret oublié (D-96) : ticket du client, scanner et nouveau code en caisse. */
  .code-ticket__card { justify-items: center; text-align: center; }
  .code-ticket__qr { inline-size: min(100%, 16.5rem); block-size: auto; margin-inline: auto; background: #ffffff; padding: var(--space-2); border-radius: var(--radius); }
  .code-ticket__label { font-weight: 600; }
  .code-ticket__short { font-size: 2.4rem; font-weight: 800; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
  .qr-video { inline-size: 100%; max-block-size: 60vh; border-radius: var(--radius); background: #000000; object-fit: cover; }
  .code-input {
    inline-size: 100%;
    min-inline-size: 0;
    min-block-size: 3.5rem;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .new-code { text-align: center; }
  .new-code__digits { display: flex; justify-content: center; gap: var(--space-3); }
  .new-code__digits span {
    display: grid;
    place-items: center;
    inline-size: 4rem;
    block-size: 5rem;
    border: 2px solid var(--store-accent);
    border-radius: var(--radius);
    background: var(--color-surface);
    font-size: 3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  .steps { padding-inline-start: 1.25rem; display: grid; gap: var(--space-2); }
  /* Téléphone : indicatif du pays + numéro. */
  .phone-row { display: grid; grid-template-columns: minmax(8.5rem, 42%) 1fr; gap: var(--space-2); }
  .phone-row select, .phone-row input { min-inline-size: 0; inline-size: 100%; }
  /* Exemples en gris dans les champs. */
  ::placeholder { color: #9a9aa2; opacity: 1; font-style: italic; }
  .choice { display: flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; }
  .choice input { min-height: auto; margin-top: 0.3rem; inline-size: 1.15rem; block-size: 1.15rem; }
  .choice-list { list-style: none; padding: 0; display: grid; gap: var(--space-1); }
  .choice-list .choice { padding: var(--space-2); border: 1px solid var(--color-border); border-radius: calc(var(--radius) / 2); background: var(--color-surface); }
  .field .choice-list input { min-height: auto; }

  .checklist { padding-left: var(--space-6); display: grid; gap: var(--space-2); }
  .checklist .is-done { text-decoration: line-through; color: var(--color-muted); }
  .checklist .is-done::marker { content: "✓  "; color: var(--color-success); }
  .is-inactive { opacity: 0.6; }

  .logo-preview { border-radius: var(--radius); border: 1px solid var(--color-border); object-fit: contain; background: var(--color-surface); }
  .qr-layout { display: grid; gap: var(--space-6); align-items: start; }
  .qr-image { background: #ffffff; border-radius: var(--radius); border: 1px solid var(--color-border); }
  @media (min-width: 48rem) { .qr-layout { grid-template-columns: auto 1fr; } }

  .public-store { text-align: center; }
  .public-store__logo { margin-inline: auto; border-radius: 50%; object-fit: cover; }
}

@layer utilities {
  .muted { color: var(--color-muted); }
  .lead { font-size: var(--text-lg); color: var(--color-muted); }
  .visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
}

/* Étape 06 : carte de fidélité et état des demandes. */
@layer components {
  /* Carte « réelle » : proportions d'une carte bancaire, reflet qui passe, étoiles dorées. */
  .loyalty-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    align-content: space-between;
    gap: var(--space-3);
    min-block-size: 13rem;
    aspect-ratio: 1.586;
    padding: var(--space-4) var(--space-4) var(--space-3);
    border-radius: 1.15rem;
    border: 1px solid rgb(255 255 255 / 0.22);
    background:
      radial-gradient(120% 90% at 100% 0%, rgb(255 255 255 / 0.28), transparent 55%),
      radial-gradient(90% 80% at 0% 100%, rgb(0 0 0 / 0.28), transparent 60%),
      linear-gradient(135deg, var(--store-accent), color-mix(in srgb, var(--store-accent) 55%, #000000));
    color: #ffffff;
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 14px 30px rgb(0 0 0 / 0.28), 0 3px 8px rgb(0 0 0 / 0.18);
    animation: card-in 500ms ease-out both;
  }
  .loyalty-card::before { /* reflet */
    content: "";
    position: absolute;
    inset: -40% auto -40% -60%;
    inline-size: 45%;
    z-index: -1;
    background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.22), transparent);
    transform: rotate(8deg);
    animation: card-sheen 5.5s ease-in-out 600ms infinite;
  }
  .loyalty-card::after { /* motif discret */
    content: "";
    position: absolute;
    inset-block-start: -35%;
    inset-inline-end: -18%;
    inline-size: 60%;
    aspect-ratio: 1;
    z-index: -1;
    border-radius: 50%;
    border: 1.6rem solid rgb(255 255 255 / 0.06);
  }
  .loyalty-card__header { display: grid; column-gap: var(--space-3); align-items: center; }
  .loyalty-card__header:has(.loyalty-card__logo) { grid-template-columns: auto 1fr; }
  .loyalty-card__logo {
    grid-row: span 2;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border-radius: 50%;
    background: #ffffff;
    object-fit: contain;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.25);
  }
  .loyalty-card__store { font-size: var(--text-lg); font-weight: 800; line-height: 1.15; text-shadow: 0 1px 2px rgb(0 0 0 / 0.35); }
  .loyalty-card__kind { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8; }
  .loyalty-card__footer { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
  .loyalty-card__owner {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgb(0 0 0 / 0.45), 0 -1px 0 rgb(255 255 255 / 0.18);
    overflow-wrap: anywhere;
  }
  .loyalty-card__count { font-size: var(--text-sm); white-space: nowrap; text-align: end; }
  .loyalty-card__count strong { font-size: 1.9rem; line-height: 1; }
  .loyalty-card__cells {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-1) var(--space-2);
    justify-items: center;
  }
  .loyalty-card__cells--dense { grid-template-columns: repeat(10, 1fr); gap: 0.1rem; }
  .loyalty-card__cell {
    font-size: clamp(1.5rem, 8.5vw, 2.3rem);
    line-height: 1.1;
    color: rgb(255 255 255 / 0.1);
    -webkit-text-stroke: 1.5px rgb(255 255 255 / 0.55);
  }
  .loyalty-card__cells--dense .loyalty-card__cell { font-size: clamp(0.95rem, 5vw, 1.4rem); -webkit-text-stroke-width: 1px; }
  .loyalty-card__cell.is-filled {
    color: #ffd54a;
    -webkit-text-stroke: 0;
    text-shadow: 0 0 2px #fff6c9, 0 0 10px rgb(255 204 51 / 0.75), 0 2px 3px rgb(0 0 0 / 0.35);
    animation: star-pop 520ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
  }
  .loyalty-card__cell.is-filled:nth-child(1) { animation-delay: 70ms; }
  .loyalty-card__cell.is-filled:nth-child(2) { animation-delay: 140ms; }
  .loyalty-card__cell.is-filled:nth-child(3) { animation-delay: 210ms; }
  .loyalty-card__cell.is-filled:nth-child(4) { animation-delay: 280ms; }
  .loyalty-card__cell.is-filled:nth-child(5) { animation-delay: 350ms; }
  .loyalty-card__cell.is-filled:nth-child(6) { animation-delay: 420ms; }
  .loyalty-card__cell.is-filled:nth-child(7) { animation-delay: 490ms; }
  .loyalty-card__cell.is-filled:nth-child(8) { animation-delay: 560ms; }
  .loyalty-card__cell.is-filled:nth-child(9) { animation-delay: 630ms; }
  .loyalty-card__cell.is-filled:nth-child(10) { animation-delay: 700ms; }
  .loyalty-card__cell.is-filled:nth-child(11) { animation-delay: 770ms; }
  .loyalty-card__cell.is-filled:nth-child(12) { animation-delay: 840ms; }
  .loyalty-card__cell.is-filled:nth-child(13) { animation-delay: 910ms; }
  .loyalty-card__cell.is-filled:nth-child(14) { animation-delay: 980ms; }
  .loyalty-card__cell.is-filled:nth-child(15) { animation-delay: 1050ms; }
  .loyalty-card__cell.is-filled:nth-child(16) { animation-delay: 1120ms; }
  .loyalty-card__cell.is-filled:nth-child(17) { animation-delay: 1190ms; }
  .loyalty-card__cell.is-filled:nth-child(18) { animation-delay: 1260ms; }
  .loyalty-card__cell.is-filled:nth-child(19) { animation-delay: 1330ms; }
  .loyalty-card__cell.is-filled:nth-child(20) { animation-delay: 1400ms; }
  .loyalty-card__cell.is-filled:nth-child(21) { animation-delay: 1470ms; }
  .loyalty-card__cell.is-filled:nth-child(22) { animation-delay: 1540ms; }
  .loyalty-card__cell.is-filled:nth-child(23) { animation-delay: 1610ms; }
  .loyalty-card__cell.is-filled:nth-child(24) { animation-delay: 1680ms; }
  .loyalty-card__cell.is-filled:nth-child(25) { animation-delay: 1750ms; }
  .loyalty-card__cell.is-filled:nth-child(26) { animation-delay: 1820ms; }
  .loyalty-card__cell.is-filled:nth-child(27) { animation-delay: 1890ms; }
  .loyalty-card__cell.is-filled:nth-child(28) { animation-delay: 1960ms; }
  .loyalty-card__cell.is-filled:nth-child(29) { animation-delay: 2030ms; }
  .loyalty-card__cell.is-filled:nth-child(30) { animation-delay: 2100ms; }
  /* La dernière étoile gagnée scintille. */
  .loyalty-card__cell.is-filled:not(:has(~ .is-filled)) {
    animation: star-pop 520ms cubic-bezier(0.2, 1.6, 0.4, 1) both, star-twinkle 1.8s ease-in-out 1.2s infinite;
  }
  .loyalty-card__meter { inline-size: 100%; block-size: 1.25rem; }
  .loyalty-card__ready {
    font-weight: 700;
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.2);
    justify-self: start;
  }

  /* Boutons sous la carte : avis, étoile, récompense (dans cet ordre). */
  .card-actions { display: grid; gap: var(--space-3); }
  .card-actions > * { animation: action-in 450ms ease-out both; }
  .card-actions > :nth-child(1) { animation-delay: 150ms; }
  .card-actions > :nth-child(2) { animation-delay: 270ms; }
  .card-actions > :nth-child(3) { animation-delay: 390ms; }
  .card-actions > :nth-child(n + 4) { animation-delay: 510ms; }
  .card-action {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--space-3);
    align-items: center;
    inline-size: 100%;
    min-block-size: 4.25rem;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: var(--color-surface);
    color: var(--color-text);
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 120ms ease, box-shadow 120ms ease;
  }
  .card-action:active:not(:disabled) { transform: scale(0.97); box-shadow: none; }
  .card-action__icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border-radius: 50%;
    background: rgb(0 0 0 / 0.06);
    font-size: 1.5rem;
    line-height: 1;
  }
  .card-action__label { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
  .card-action__hint { font-size: var(--text-sm); color: var(--color-muted); }
  .card-action--star {
    border-color: transparent;
    background: linear-gradient(135deg, var(--store-accent), color-mix(in srgb, var(--store-accent) 70%, #000000));
    color: #ffffff;
  }
  .card-action--star .card-action__icon { background: rgb(255 255 255 / 0.2); color: #ffd54a; }
  .card-action--star .card-action__hint { color: rgb(255 255 255 / 0.85); }
  .card-action--star:not(:disabled) .card-action__icon { animation: star-twinkle 2.2s ease-in-out infinite; }
  .card-action--reward.is-ready {
    border-color: #e0a800;
    background: linear-gradient(110deg, #f7c531 0%, #ffe680 25%, #fff7cf 38%, #ffe680 50%, #f7c531 100%);
    background-size: 220% 100%;
    color: #3a2a00;
    animation: reward-shine 2.6s linear infinite, reward-glow 1.8s ease-in-out infinite;
  }
  .card-action--reward.is-ready .card-action__icon { background: rgb(255 255 255 / 0.55); }
  .card-action--reward.is-ready .card-action__hint { color: #5a4300; }
  .card-action:disabled {
    cursor: not-allowed;
    border-style: dashed;
    background: #ececea;
    color: var(--color-muted);
    box-shadow: none;
  }
  .card-action:disabled .card-action__icon { filter: grayscale(1); opacity: 0.6; background: rgb(0 0 0 / 0.05); color: inherit; }
  .card-action:disabled .card-action__hint { color: var(--color-muted); }

  @keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
  @keyframes card-sheen { 0%, 55% { translate: 0 0; } 100% { translate: 520% 0; } }
  @keyframes star-pop { 0% { opacity: 0; transform: scale(0) rotate(-40deg); } 70% { opacity: 1; transform: scale(1.3) rotate(8deg); } 100% { opacity: 1; transform: none; } }
  @keyframes star-twinkle { 0%, 100% { filter: brightness(1); scale: 1; } 50% { filter: brightness(1.35) drop-shadow(0 0 6px rgb(255 221 102 / 0.9)); scale: 1.14; } }
  @keyframes action-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes reward-shine { from { background-position: 120% 0; } to { background-position: -100% 0; } }
  @keyframes reward-glow { 0%, 100% { box-shadow: 0 0 0 0 rgb(247 197 49 / 0.55), var(--shadow); } 50% { box-shadow: 0 0 0 9px rgb(247 197 49 / 0), 0 6px 18px rgb(224 168 0 / 0.4); } }
  @media (prefers-reduced-motion: reduce) {
    .loyalty-card, .loyalty-card::before, .loyalty-card__cell.is-filled, .card-actions > *, .card-action, .card-action__icon {
      animation: none !important;
    }
  }

  .request-status {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-4);
    border-radius: var(--radius);
    border-left: 6px solid var(--color-primary);
    background: var(--color-surface);
    box-shadow: var(--shadow);
  }
  .request-status__title { font-size: var(--text-lg); font-weight: 700; }
  .request-status--pending { border-color: var(--color-warning); }
  .request-status--approved { border-color: var(--color-success); }
  .request-status--rejected, .request-status--expired { border-color: var(--color-danger); }
}

/* Étape 07 : caisse (grands boutons, utilisable d'une main). */
@layer components {
  .cashier-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--space-2); margin-bottom: var(--space-4); padding-bottom: var(--space-3);
    border-bottom: 3px solid var(--brand);
  }
  .request-list { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
  .request-item {
    display: grid; gap: var(--space-3); padding: var(--space-4);
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .request-item__name { font-size: var(--text-xl); font-weight: 700; line-height: 1.2; }
  .request-item__reward { font-weight: 700; color: var(--color-warning); }
  /* Choix du nombre d'étoiles (caisse) : grosses pastilles, sans JavaScript. */
  .star-picker { border: 0; padding: 0; display: grid; gap: var(--space-2); }
  .star-picker legend { font-weight: 600; padding: 0; margin-bottom: var(--space-2); }
  .star-picker__choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .star-picker__choice { position: relative; cursor: pointer; }
  .star-picker__choice input { position: absolute; opacity: 0; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; cursor: pointer; }
  .star-picker__choice span {
    display: grid;
    place-items: center;
    min-inline-size: 3.5rem;
    min-block-size: var(--tap-size);
    padding-inline: var(--space-3);
    border: 2px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    font-size: var(--text-lg);
    font-weight: 700;
    transition: transform 120ms ease, background-color 120ms ease;
  }
  .star-picker__choice input:checked + span { border-color: var(--brand); background: var(--brand); color: var(--on-brand); transform: scale(1.06); }
  .star-picker__choice input:focus-visible + span { outline: 3px solid var(--color-primary); outline-offset: 2px; }
  .btn--reward {
    border: 1px solid #e0a800;
    background: linear-gradient(110deg, #f7c531, #ffe680 45%, #f7c531);
    color: #3a2a00;
    font-weight: 700;
  }
  .request-item__more summary { cursor: pointer; min-height: var(--tap-size); display: flex; align-items: center; font-weight: 600; }
  .request-item__more form { margin-top: var(--space-3); }
  .request-item select, .request-item input[type="text"], .search-input {
    min-height: var(--tap-size); padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border); border-radius: calc(var(--radius) / 2);
    background: var(--color-surface); width: 100%;
  }
  .empty-state { padding: var(--space-8) var(--space-4); text-align: center; color: var(--color-muted); font-size: var(--text-lg); }
  @media (min-width: 48rem) {
    .request-item { grid-template-columns: 1fr minmax(16rem, auto); align-items: start; }
    .request-item__more { grid-column: 1 / -1; }
  }
}

/* Étape 09 : tableau de bord (indicateurs, filtres de période, graphiques SVG). */
@layer components {
  .period-filter fieldset { border: 0; padding: 0; }
  .chip {
    display: inline-flex; align-items: center; gap: var(--space-1);
    min-height: 2.5rem; padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface);
    cursor: pointer; font-size: var(--text-sm);
  }
  .chip:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 700; }
  .period-filter__date { font-size: var(--text-sm); display: inline-flex; gap: var(--space-1); align-items: center; }
  .period-filter__date input { min-height: 2.5rem; border: 1px solid var(--color-border); border-radius: calc(var(--radius) / 2); padding: 0 var(--space-2); }

  .kpi-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block: var(--space-4); }
  @media (min-width: 48rem) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .kpi { padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
  .kpi__value { font-size: 2rem; font-weight: 700; line-height: 1.1; }
  .kpi__label { color: var(--color-muted); font-size: var(--text-sm); }
  .kpi__change { font-weight: 700; font-size: var(--text-sm); }
  .kpi__change.is-up { color: var(--color-success); }
  .kpi__change.is-down { color: var(--color-danger); }

  .chart-grid { display: grid; gap: var(--space-4); margin-block: var(--space-4); }
  @media (min-width: 48rem) { .chart-grid { grid-template-columns: 1fr 1fr; } }
  .chart { margin: 0; }
  .chart__svg { width: 100%; height: auto; overflow: visible; }
  .chart__axis { stroke: var(--color-border); }
  .chart__tick { font-size: 16px; fill: var(--color-muted); }
  .chart-line { stroke-width: 2.5; }
  .chart-line--visits { stroke: var(--brand); fill: var(--brand); }
  .chart-line--new { stroke: var(--color-success); fill: var(--color-success); }
  .chart-line--rewards { stroke: var(--color-warning); fill: var(--color-warning); }
  polyline.chart-line { fill: none; }
  .chart__caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-muted); }
  .legend::before { content: "●"; margin-right: 0.25rem; }
  .legend.chart-line--visits::before { color: var(--brand); }
  .legend.chart-line--new::before { color: var(--color-success); }
  .legend.chart-line--rewards::before { color: var(--color-warning); }
  .upsell { border-color: var(--brand); }
}
@layer components {
  .bars { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
  .bars__row { display: grid; grid-template-columns: minmax(6rem, 1fr) 2fr auto; gap: var(--space-2); align-items: center; }
  .bars__label { font-size: var(--text-sm); overflow-wrap: anywhere; }
  .bars__meter { width: 100%; height: 1rem; }
  .bars__meter::-webkit-meter-optimum-value { background: var(--brand); }
  .bars__meter::-moz-meter-bar { background: var(--brand); }
  .bars__value { font-size: var(--text-sm); white-space: nowrap; }
}

/* Étape 10 : liste clients, filtres, tableau. */
@layer components {
  .chip--saved { border-style: dashed; }
  a.chip { text-decoration: none; color: var(--color-text); }
  .filters-grid { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
  @media (min-width: 48rem) { .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .table-wrap { overflow-x: auto; }
  .data-table { width: 100%; border-collapse: collapse; background: var(--color-surface); }
  .data-table th, .data-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); text-align: left; white-space: nowrap; }
  .data-table th { font-size: var(--text-sm); color: var(--color-muted); }
  .badge { display: inline-block; padding: 0 var(--space-2); border-radius: 999px; background: var(--color-bg); border: 1px solid var(--color-border); font-size: var(--text-sm); }
}

/* Étape 10 : invitation salarié. */
@layer components {
  .invitation-link__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: center; }
  .invitation-link__body > * { min-inline-size: 0; }
  .invitation-link__qr { justify-self: center; padding: var(--space-2); border-radius: 1rem; background: #ffffff; border: 3px solid var(--brand); line-height: 0; }
  .invitation-link__qr svg { display: block; inline-size: min(15rem, 70vw); block-size: auto; background: #ffffff; }
  @media (min-width: 48rem) { .invitation-link__body { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-6); } }
  .break-all { word-break: break-all; }
}

/* Étape 11 : double authentification et sécurité du compte. */
@layer components {
  .message--info { border-color: var(--color-primary); }
  .totp-qr { display: block; width: 12rem; height: auto; margin: var(--space-3) 0; background: #ffffff; }
  .backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); padding: 0; list-style: none; font-size: 1.1rem; }
  .security-banner { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; }
}

/* Étape 12 : SMS. */
@layer components {
  .sms-preview { white-space: pre-wrap; padding: var(--space-3); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); font-family: inherit; }
}

/* Étape 13 : campagnes. */
@layer components {
  .wizard-steps { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0; list-style: none; counter-reset: step; font-size: var(--text-sm); color: var(--color-muted); }
  .wizard-steps li { counter-increment: step; }
  .wizard-steps li::before { content: counter(step) ". "; font-weight: 700; }
}

/* Étape 16 : abonnements. */
@layer components {
  .plans-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
  .plan-card--current { border-color: var(--color-primary); border-width: 2px; }
}

/*
 * Coque d'application (D-97) : apparence « application mobile » pour l'espace commerçant et la
 * caisse. Barre d'onglets en bas sur téléphone (en haut sur ordinateur), panneau « Plus » en
 * tuiles, fenêtre flottante d'installation, boutons et cartes retravaillés.
 * Tout est en CSS (CSP : aucun style en ligne) ; les animations respectent prefers-reduced-motion.
 */
@layer tokens {
  :root {
    --color-bg: #f4f5f8;
    --color-border: #e3e5ea;
    --radius: 0.9rem;
    --shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 6px 18px rgb(16 24 40 / 0.06);
    --shadow-lift: 0 10px 30px rgb(16 24 40 / 0.16);
    --tabbar-height: 4.25rem;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@layer components {
  /* --- Icônes --- */
  .icon { inline-size: 1.5rem; block-size: 1.5rem; flex: none; }

  /* --- Boutons : relief léger, retour tactile --- */
  .btn {
    gap: var(--space-2);
    border-width: 1px;
    border-radius: 0.85rem;
    letter-spacing: 0.01em;
    transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease, background-color 160ms ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  .btn:not(:disabled):active { transform: translateY(1px) scale(0.985); }
  .btn--primary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #ffffff), var(--brand));
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 6px 16px color-mix(in srgb, var(--brand) 32%, transparent);
  }
  .btn--primary:not(:disabled):hover { filter: brightness(1.06); }
  .btn--primary:not(:disabled):active { box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 30%, transparent); }
  .btn--secondary { box-shadow: 0 1px 2px rgb(16 24 40 / 0.06); }
  .btn--secondary:not(:disabled):hover { background: #f7f8fa; border-color: #cfd3da; }
  .btn--danger { box-shadow: 0 6px 16px rgb(179 38 30 / 0.22); }
  .btn--danger:not(:disabled):hover { filter: brightness(1.06); }
  .btn--lg { border-radius: 1rem; }

  /* --- Cartes et champs --- */
  .card { border-radius: 1.1rem; padding: var(--space-4) var(--space-4); }
  .field input, .field select, .field textarea, .request-item select, .request-item input[type="text"], .search-input {
    border-radius: 0.8rem;
    transition: border-color 140ms ease, box-shadow 140ms ease;
  }
  .field input:focus, .field select:focus, .field textarea:focus, .search-input:focus, .code-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
  }

  /* --- En-tête : barre d'application --- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgb(255 255 255 / 0.86);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom-color: rgb(16 24 40 / 0.06);
  }

  /* --- Bandeau de la boutique --- */
  .store-chip {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    margin-bottom: var(--space-4);
    border-radius: 1.1rem;
    background:
      radial-gradient(120% 140% at 100% 0%, rgb(255 255 255 / 0.22), transparent 55%),
      linear-gradient(135deg, var(--store-accent), color-mix(in srgb, var(--store-accent) 62%, #000000));
    color: #ffffff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--store-accent) 28%, transparent);
  }
  .store-chip__logo {
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border-radius: 0.8rem;
    background: #ffffff;
    object-fit: cover;
  }
  .store-chip__logo--empty { display: grid; place-items: center; color: var(--store-accent); font-weight: 800; font-size: 1.3rem; }
  .store-chip__name { display: grid; line-height: 1.2; min-inline-size: 0; }
  .store-chip__name strong { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .store-chip__hint { font-size: var(--text-sm); opacity: 0.85; }
  .store-chip__switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-block-size: 2.5rem;
    padding: 0 var(--space-3);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.18);
    color: #ffffff;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
  }
  .store-chip__switch .icon { inline-size: 1.1rem; block-size: 1.1rem; }

  /* --- Barre d'onglets --- */
  .tabbar {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 40;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: stretch;
    block-size: calc(var(--tabbar-height) + var(--safe-bottom));
    padding: 0 var(--space-2) var(--safe-bottom);
    /* Pas de backdrop-filter ici : il ferait de la barre le repère des éléments fixes qu'elle
       contient (panneau « Plus », fond), qui doivent se placer par rapport à l'écran. */
    background: #ffffff;
    border-top: 1px solid rgb(16 24 40 / 0.08);
    box-shadow: 0 -6px 24px rgb(16 24 40 / 0.06);
  }
  .tabbar__item {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.15rem;
    min-inline-size: 0;
    padding: 0.35rem 0.15rem;
    color: var(--color-muted);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease, transform 120ms ease;
  }
  .tabbar__item::-webkit-details-marker { display: none; }
  .tabbar__item span:last-child { max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar__item .icon { transition: transform 200ms cubic-bezier(0.2, 1.6, 0.4, 1); }
  .tabbar__item:active { transform: scale(0.94); }
  .tabbar__item[aria-current="page"],
  .tabbar__more[open] > .tabbar__item,
  .tabbar__more:has(.tile[aria-current="page"]) > .tabbar__item { color: var(--brand-ink); }
  .tabbar__item[aria-current="page"] .icon,
  .tabbar__more[open] > .tabbar__item .icon { transform: translateY(-1px) scale(1.12); }
  /* Petit trait au-dessus de l'onglet actif. */
  .tabbar__item[aria-current="page"]::before,
  .tabbar__more:has(.tile[aria-current="page"]) > .tabbar__item::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inline-size: 1.75rem;
    block-size: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--brand);
    animation: tab-in 260ms ease-out both;
  }
  /* Onglet central mis en avant (la caisse : l'action la plus fréquente). */
  .tabbar__item--main { color: var(--brand-ink); }
  .tabbar__bubble {
    display: grid;
    place-items: center;
    inline-size: 3.1rem;
    block-size: 3.1rem;
    margin-block-start: -1.5rem;
    border-radius: 50%;
    border: 4px solid #ffffff;
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 85%, #ffffff), var(--brand));
    color: #ffffff;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 40%, transparent);
  }
  .tabbar__more { display: grid; min-inline-size: 0; }
  .tabbar__more > summary { block-size: 100%; }

  /* --- Panneau « Plus » : feuille qui monte du bas, rubriques en tuiles --- */
  .sheet__backdrop {
    position: fixed;
    inset: 0 0 calc(var(--tabbar-height) + var(--safe-bottom)) 0;
    z-index: -1;
    border: 0;
    padding: 0;
    background: rgb(16 24 40 / 0.38);
    cursor: default;
    animation: fade-in 180ms ease-out both;
  }
  .sheet {
    position: fixed;
    inset-inline: 0;
    inset-block-end: calc(var(--tabbar-height) + var(--safe-bottom));
    z-index: -1;
    max-block-size: min(78vh, 34rem);
    overflow-y: auto;
    padding: var(--space-3) var(--space-4) var(--space-4);
    border-radius: 1.4rem 1.4rem 0 0;
    background: var(--color-surface);
    box-shadow: 0 -12px 36px rgb(16 24 40 / 0.22);
    animation: sheet-up 260ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
  }
  .sheet::before { /* poignée */
    content: "";
    display: block;
    inline-size: 2.5rem;
    block-size: 0.3rem;
    margin: 0 auto var(--space-3);
    border-radius: 999px;
    background: #d5d8de;
  }
  .sheet__title { margin-bottom: var(--space-3); font-size: var(--text-sm); font-weight: 700; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.08em; }
  .sheet__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3) var(--space-2); }
  .tile {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: var(--space-2);
    padding: var(--space-1);
    border: 0;
    border-radius: 0.9rem;
    background: none;
    color: var(--color-text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 120ms ease;
    animation: tile-in 320ms ease-out both;
  }
  .tile:active { transform: scale(0.93); }
  .tile:nth-child(2) { animation-delay: 25ms; }
  .tile:nth-child(3) { animation-delay: 50ms; }
  .tile:nth-child(4) { animation-delay: 75ms; }
  .tile:nth-child(5) { animation-delay: 100ms; }
  .tile:nth-child(6) { animation-delay: 125ms; }
  .tile:nth-child(7) { animation-delay: 150ms; }
  .tile:nth-child(n + 8) { animation-delay: 175ms; }
  .tile__icon {
    display: grid;
    place-items: center;
    inline-size: 3.4rem;
    block-size: 3.4rem;
    border-radius: 1.05rem;
    color: #ffffff;
    box-shadow: 0 6px 14px rgb(16 24 40 / 0.14), 0 1px 0 rgb(255 255 255 / 0.35) inset;
  }
  .tile__icon .icon { inline-size: 1.65rem; block-size: 1.65rem; }
  .tile__icon--blue { background: linear-gradient(160deg, #52525b, #18181b); }
  .tile__icon--gold { background: linear-gradient(160deg, #ffcf4a, #e89b00); }
  .tile__icon--green { background: linear-gradient(160deg, #4fd28a, #1e9b55); }
  .tile__icon--purple { background: linear-gradient(160deg, #a98bff, #6a45d6); }
  .tile__icon--orange { background: linear-gradient(160deg, #ffa25c, #e0621a); }
  .tile__icon--red { background: linear-gradient(160deg, #ff7b7b, #d63838); }
  .tile__icon--teal { background: linear-gradient(160deg, #46d3d0, #12908f); }
  .tile__icon--grey { background: linear-gradient(160deg, #a3abb8, #5d6675); }
  .tile[aria-current="page"] { color: var(--brand-ink); }
  .tile[aria-current="page"] .tile__icon { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }
  .sheet__footer {
    display: grid;
    gap: var(--space-1);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
  }
  .sheet__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    inline-size: 100%;
    min-block-size: var(--tap-size);
    padding: 0 var(--space-2);
    border: 0;
    border-radius: 0.8rem;
    background: none;
    color: var(--color-text);
    font: inherit;
    font-weight: 600;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
  }
  .sheet__link:active { background: #f1f3f6; }
  .sheet__link--danger { color: var(--color-danger); }

  /* --- Fenêtre flottante d'installation --- */
  .install-card {
    position: fixed;
    inset-inline: var(--space-3);
    inset-block-end: calc(var(--tabbar-height) + var(--safe-bottom) + var(--space-3));
    z-index: 35;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    max-inline-size: 28rem;
    margin-inline: auto;
    padding: var(--space-3);
    border: 1px solid rgb(16 24 40 / 0.06);
    border-radius: 1.2rem;
    background: rgb(255 255 255 / 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow-lift);
    animation: install-in 420ms cubic-bezier(0.2, 1.2, 0.3, 1) 300ms both;
  }
  .install-card__icon { inline-size: 3rem; block-size: 3rem; border-radius: 0.8rem; box-shadow: 0 2px 8px rgb(16 24 40 / 0.14); }
  .install-card__body { min-inline-size: 0; }
  .install-card__title { font-weight: 800; line-height: 1.2; }
  .install-card__text { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.35; }
  .install-card__share { display: inline-grid; vertical-align: -0.3rem; color: var(--brand-ink); }
  .install-card__share .icon { inline-size: 1.2rem; block-size: 1.2rem; }
  .install-card__actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); }
  .install-card__later {
    min-block-size: 2.5rem;
    padding: 0 var(--space-2);
    border: 0;
    background: none;
    color: var(--color-muted);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
  }

  .security-banner { margin-bottom: var(--space-4); }

  /* --- Mise en page des pages « application » --- */
  body.app-shell { padding-block-end: calc(var(--tabbar-height) + var(--safe-bottom)); }
  body.app-shell .site-footer { display: none; }
  /* Sur téléphone, la barre d'onglets et le panneau « Plus » remplacent les liens de l'en-tête. */
  body.app-shell:has(.tabbar) .site-header__nav { display: none; }

  /* --- Ordinateur : la barre passe en haut, le panneau devient un menu déroulant --- */
  @media (min-width: 56rem) {
    body.app-shell { padding-block-end: 0; }
    body.app-shell .site-footer { display: block; }
    body.app-shell:has(.tabbar) .site-header__nav { display: flex; }
    .tabbar {
      position: sticky;
      inset-block: 4.25rem auto;
      grid-auto-columns: max-content;
      justify-content: start;
      gap: var(--space-1);
      block-size: auto;
      margin-bottom: var(--space-6);
      padding: var(--space-1);
      border: 1px solid var(--color-border);
      border-radius: 1.1rem;
      box-shadow: var(--shadow);
    }
    .tabbar__item {
      grid-auto-flow: column;
      align-items: center;
      gap: var(--space-2);
      padding: var(--space-2) var(--space-4);
      border-radius: 0.8rem;
      font-size: var(--text-base);
    }
    .tabbar__item:hover { background: #f1f3f6; color: var(--color-text); }
    .tabbar__item[aria-current="page"],
    .tabbar__more[open] > .tabbar__item,
    .tabbar__more:has(.tile[aria-current="page"]) > .tabbar__item {
      background: color-mix(in srgb, var(--brand) 14%, #ffffff);
      color: var(--brand-ink);
    }
    .tabbar__item[aria-current="page"]::before,
    .tabbar__more:has(.tile[aria-current="page"]) > .tabbar__item::before { content: none; }
    .tabbar__bubble { inline-size: 2rem; block-size: 2rem; margin: 0; border: 0; box-shadow: none; }
    .tabbar__bubble .icon { inline-size: 1.15rem; block-size: 1.15rem; }
    .tabbar__more { position: relative; }
    .sheet__backdrop { display: none; }
    .sheet {
      position: absolute;
      inset: calc(100% + var(--space-2)) auto auto 0;
      z-index: 45;
      inline-size: 24rem;
      max-block-size: none;
      border: 1px solid var(--color-border);
      border-radius: 1.2rem;
      box-shadow: var(--shadow-lift);
      animation-name: sheet-drop;
    }
    .sheet::before { content: none; }
    .install-card { inset: auto var(--space-6) var(--space-6) auto; margin: 0; }
  }

  @keyframes tab-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes sheet-drop { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
  @keyframes tile-in { from { opacity: 0; transform: translateY(10px) scale(0.92); } to { opacity: 1; transform: none; } }
  @keyframes install-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }

  @media (prefers-reduced-motion: reduce) {
    .btn, .tabbar__item, .tabbar__item .icon, .tile, .sheet, .sheet__backdrop, .install-card,
    .tabbar__item[aria-current="page"]::before { animation: none !important; transition: none !important; }
  }
}

/* QR code affiché au commercial (essai de la boutique, lien de paiement) — D-99. */
@layer components {
  .qr-test { align-items: center; text-align: center; }
  .qr-test__image { width: min(20rem, 100%); height: auto; background: #fff; border-radius: var(--radius, 0.75rem); }
}

/* Factures et suivi financier (D-104). */
@layer components {
  .invoice__sheet { max-inline-size: 48rem; }
  .invoice__head { display: flex; justify-content: space-between; align-items: start; gap: var(--space-4); }
  .invoice__parties { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
  .invoice tfoot th { text-align: end; font-weight: 600; }
  .invoice td:last-child, .invoice th:last-child { text-align: end; white-space: nowrap; }
  .finance-meter { inline-size: 100%; block-size: 1.1rem; }
  @media print {
    .site-header, .site-footer, .pro-nav, .tabbar, .store-chip, .messages, .no-print, .install-card { display: none !important; }
    body { background: #fff; padding: 0; }
    .invoice__sheet { box-shadow: none; border: 0; }
  }
}

/* Anniversaire sur la carte et parrainage (D-105). */
@layer components {
  .loyalty-card__birthday { font-size: 0.78rem; line-height: 1.25; padding: 0.2rem 0.55rem; border-radius: 0.6rem; background: rgb(0 0 0 / 0.22); justify-self: start; }
  .loyalty-card:has(.loyalty-card__birthday) { aspect-ratio: auto; }
  .card-action--referral { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: #86efac; }
  .card-action--referral .card-action__icon { background: #bbf7d0; }
  .referral__message { font-size: 1.05rem; font-weight: 600; }
  .referral__link { padding: var(--space-3); border-radius: var(--radius); background: var(--color-bg); font-family: ui-monospace, monospace; font-size: var(--text-sm); overflow-wrap: anywhere; user-select: all; }
  .referral__channels { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
}

/* Tuiles d'indicateurs : libellé au-dessus de la valeur. */
@layer components {
  .kpi { display: grid; gap: var(--space-1); align-content: start; }
}

/* Étoile de parrainage : couleur spéciale et halo qui pulse (D-106). */
@layer components {
  .loyalty-card__cell.is-referral {
    color: #5eead4;
    text-shadow: 0 0 2px #f0fdfa, 0 0 10px rgb(45 212 191 / 0.9), 0 0 18px rgb(167 139 250 / 0.7), 0 2px 3px rgb(0 0 0 / 0.35);
    animation: star-pop 520ms cubic-bezier(0.2, 1.6, 0.4, 1) both, referral-glow 2.4s ease-in-out 700ms infinite;
  }
  .loyalty-card__referral { font-size: 0.78rem; line-height: 1.25; padding: 0.2rem 0.55rem; border-radius: 0.6rem; background: rgb(0 0 0 / 0.22); justify-self: start; }
  .loyalty-card__referral-star, .referral__star { color: #2dd4bf; text-shadow: 0 0 8px rgb(45 212 191 / 0.7); }
  .loyalty-card:has(.loyalty-card__referral) { aspect-ratio: auto; }
  .referral__qr { align-items: center; text-align: center; }
  .referral__qr img { inline-size: min(13.75rem, 100%); block-size: auto; background: #fff; border-radius: var(--radius); }
  .referral__channels-title { font-size: var(--text-sm); color: var(--color-muted); }
  @keyframes referral-glow {
    0%, 100% { filter: none; transform: none; }
    50% { filter: brightness(1.35) drop-shadow(0 0 6px rgb(167 139 250 / 0.9)); transform: scale(1.12); }
  }
  @media (prefers-reduced-motion: reduce) {
    .loyalty-card__cell.is-referral { animation: none; }
  }
}

/* Messages des boutiques, cloche, « Mes cartes » (D-107). */
@layer components {
  .bell { position: relative; display: inline-grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem; border-radius: 50%; color: inherit; text-decoration: none; }
  .bell:hover { background: rgb(0 0 0 / 0.06); }
  .bell__badge { position: absolute; inset-block-start: 0.2rem; inset-inline-end: 0.1rem; min-inline-size: 1.2rem; block-size: 1.2rem; padding-inline: 0.25rem; border-radius: 1rem; background: #e11d48; color: #fff; font-size: 0.7rem; font-weight: 800; line-height: 1.2rem; text-align: center; box-shadow: 0 0 0 2px var(--color-surface); }

  .news-list { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
  .news-item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: start; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
  .news-item.is-unread { border-color: #fb923c; background: #fff7ed; }
  .news-item__body { display: grid; gap: var(--space-1); min-inline-size: 0; overflow-wrap: anywhere; }
  .news-item__kind { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 1rem; font-size: 0.72rem; font-weight: 700; background: #e0e7ff; color: #3730a3; white-space: nowrap; }
  .news-item__kind--promo { background: #ffedd5; color: #9a3412; }
  .news-item__kind--reminder { background: #dcfce7; color: #166534; }
  .news-item__kind--menu { background: #fef9c3; color: #854d0e; }
  .news-item__new { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 1rem; background: #e11d48; color: #fff; font-size: 0.7rem; font-weight: 800; }

  .store-avatar { position: relative; flex: none; display: inline-grid; place-items: center; inline-size: 3rem; block-size: 3rem; border-radius: 50%; background: var(--store-accent, var(--color-primary)); color: #fff; font-weight: 800; font-size: 1.25rem; text-decoration: none; box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-border); }
  .store-avatar img { inline-size: 100%; block-size: 100%; border-radius: 50%; object-fit: cover; }
  .store-avatar--lg { inline-size: 4rem; block-size: 4rem; font-size: 1.6rem; }
  .store-avatar__dot { position: absolute; inset-block-start: -0.2rem; inset-inline-end: -0.2rem; min-inline-size: 1.3rem; block-size: 1.3rem; padding-inline: 0.25rem; border-radius: 1rem; background: #e11d48; color: #fff; font-size: 0.72rem; font-weight: 800; line-height: 1.3rem; text-align: center; box-shadow: 0 0 0 2px var(--color-surface); }

  .card-group__title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }
  .store-cards { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
  .store-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: 1.1rem; background: var(--color-surface); box-shadow: var(--shadow); }
  .store-card__link { display: flex; align-items: center; gap: var(--space-4); min-inline-size: 0; color: inherit; text-decoration: none; }
  .store-card__text { display: grid; gap: 0.15rem; min-inline-size: 0; }
  .store-card__name { font-size: 1.1rem; line-height: 1.2; overflow-wrap: anywhere; }
  .store-card__stars { font-size: var(--text-sm); }
  .store-card__stars span { color: #f59e0b; }
  .store-card__meter { inline-size: 100%; max-inline-size: 12rem; block-size: 0.5rem; }
  .store-card__promos { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.8rem; border-radius: 2rem; background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; font-size: var(--text-sm); font-weight: 700; text-decoration: none; white-space: nowrap; }
  .store-card__promos-count { min-inline-size: 1.2rem; block-size: 1.2rem; padding-inline: 0.25rem; border-radius: 1rem; background: #e11d48; color: #fff; font-size: 0.7rem; line-height: 1.2rem; text-align: center; }

  .card-action--menu { margin-block-start: var(--space-3); background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; }
  .card-action--menu .card-action__icon { background: #fde68a; }
  .push-box { display: grid; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius); background: var(--color-bg); }
}

/* Bouton d'installation dans la page et aide aux notifications (D-108). */
@layer components {
  .install-box { display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: 1.1rem; background: linear-gradient(135deg, #111, #27272a); color: #fff; box-shadow: var(--shadow); }
  .install-box__text { display: grid; gap: 0.15rem; }
  .install-box__text span { color: #d4d4d8; font-size: var(--text-sm); }
  .install-box .btn { justify-self: start; background: #f97316; color: #111; border-color: transparent; }
  .install-box__help { padding: var(--space-3); border-radius: var(--radius); background: rgb(255 255 255 / 0.1); }
  .install-box__help .icon { display: inline-block; vertical-align: middle; inline-size: 1.1rem; block-size: 1.1rem; }
  .push-box__denied { display: grid; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius); background: #fff7ed; border: 1px solid #fdba74; font-size: var(--text-sm); }
  .push-box__denied ol { padding-inline-start: 1.2rem; display: grid; gap: var(--space-1); }
}

/* Menu et bouton d'appel sur la carte du client (D-109). */
@layer components {
  .order-box__preview { display: block; max-block-size: 22rem; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--color-border); background: #fff; }
  .order-box__preview img { inline-size: 100%; block-size: auto; }
  .order-box__actions { display: grid; gap: var(--space-3); }
  .order-box .card-action--menu { margin-block-start: 0; }
  .card-action--call { background: linear-gradient(135deg, #16a34a, #15803d); border-color: transparent; color: #fff; }
  .card-action--call .card-action__icon { background: rgb(255 255 255 / 0.22); }
  .card-action--call .card-action__hint { color: rgb(255 255 255 / 0.9); font-weight: 700; }
}

/* Bouton « Donner un avis Google » : logo Google et liseré aux couleurs de Google (D-111).
   Même bouton pour tous les clients, texte neutre inchangé (règle 9). */
@layer components {
  .card-action--review {
    position: relative;
    overflow: hidden;
    padding-inline-end: 2.75rem;
    padding-block-end: calc(var(--space-3) + 0.3rem);
    border-color: #dadce0;
    background: linear-gradient(180deg, #ffffff, #f8fafd);
    box-shadow: 0 1px 2px rgb(60 64 67 / 0.2), 0 6px 16px rgb(60 64 67 / 0.12);
  }
  .card-action--review::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    block-size: 0.3rem;
    background: linear-gradient(90deg, #4285f4 0 25%, #ea4335 25% 50%, #fbbc05 50% 75%, #34a853 75% 100%);
  }
  .card-action--review::after {
    content: "\203A"; /* chevron, en échappement : lisible quel que soit l'encodage */
    position: absolute;
    inset-inline-end: 1rem;
    inset-block-start: 50%;
    translate: 0 -55%;
    color: #5f6368;
    font-size: 1.8rem;
    line-height: 1;
  }
  .card-action--review .card-action__icon { background: #ffffff; box-shadow: 0 0 0 1px #dadce0, 0 2px 6px rgb(60 64 67 / 0.18); }
  .card-action--review .card-action__label { color: #202124; }
  .card-action--review:hover { box-shadow: 0 2px 4px rgb(60 64 67 / 0.25), 0 10px 22px rgb(60 64 67 / 0.18); }
  .google-g { inline-size: 1.75rem; block-size: 1.75rem; }
}

@layer components {
  .store-card--closed { opacity: 0.7; box-shadow: none; grid-template-columns: 1fr; }
}

/* Nom de la marque dans l'en-tête, comme sur le logo (D-112) : « Carto » + « fidele » orange. */
@layer components {
  .site-header__brand img { border-radius: 0.5rem; }
  .brand-name { font-weight: 800; letter-spacing: -0.01em; }
  .brand-name__accent { color: #ea580c; }
}

/* Guides de saisie (D-113) : cases du numéro de téléphone, affichage du code secret. */
@layer components {
  .phone-guide { display: flex; gap: 0.3rem; margin-block-start: var(--space-2); }
  .phone-guide__slot {
    flex: 1 1 0; max-inline-size: 2.1rem; aspect-ratio: 1; display: grid; place-items: center;
    border-radius: 0.5rem; border: 1px solid transparent; background: #eceef3;
    color: var(--color-text); font-weight: 700; font-size: 1rem; line-height: 1;
    transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
  }
  .phone-guide__slot--gap { margin-inline-start: 0.45rem; }
  .phone-guide__slot.is-filled { background: #fff7ed; border-color: #fb923c; transform: scale(1.04); }
  .phone-guide.is-complete .phone-guide__slot { background: #f0fdf4; border-color: #4ade80; transform: none; }
  .phone-guide__hint { margin-block-start: var(--space-1); font-size: var(--text-sm); color: var(--color-muted); min-block-size: 1.3em; }
  .secret-field { position: relative; display: grid; }
  .secret-field input { padding-inline-end: 6rem; letter-spacing: 0.08em; }
  .secret-field__toggle {
    position: absolute; inset-inline-end: 0.4rem; inset-block-start: 50%; translate: 0 -50%;
    padding: 0.4rem 0.75rem; border: 1px solid var(--color-border); border-radius: 0.6rem;
    background: var(--color-surface); color: var(--brand-ink); font-size: var(--text-sm); font-weight: 700; cursor: pointer;
  }
  @media (prefers-reduced-motion: reduce) { .phone-guide__slot { transition: none; } }
}

/* === Thème Cartofidele sur tout le site (D-114) : orange et noir, comme la page d'accueil === */
@layer components {
  h1, h2, .card__title { font-weight: 800; letter-spacing: -0.01em; }
  body:not(.landing) main h1::after {
    content: ""; display: block; inline-size: 3rem; block-size: 0.28rem;
    margin-block-start: 0.5rem; border-radius: 1rem; background: var(--brand);
  }

  /* En-tête et pied de page noirs. */
  .site-header {
    background: var(--ink); color: #ffffff; border-bottom: 0;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .site-header a, .site-header__brand { color: #ffffff; }
  .site-header .brand-name__accent { color: var(--brand); }
  .site-header__nav a[aria-current="page"] { color: var(--brand); }
  .site-header .btn--secondary { background: transparent; color: #ffffff; border-color: rgb(255 255 255 / 0.45); box-shadow: none; }
  .site-header .btn--secondary:not(:disabled):hover { background: rgb(255 255 255 / 0.12); border-color: #ffffff; }
  .site-header .bell:hover { background: rgb(255 255 255 / 0.14); }
  .site-header .bell__badge { box-shadow: 0 0 0 2px var(--ink); }
  .site-footer { background: var(--ink); color: #d4d4d8; }
  .site-footer a { color: #ffffff; }

  /* Boutons : orange à texte noir, secondaire à contour sombre. */
  .btn { font-weight: 800; border-radius: 0.9rem; }
  .btn--primary {
    background: linear-gradient(180deg, #fb923c, var(--brand));
    color: var(--on-brand); border-color: transparent;
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 8px 20px rgb(249 115 22 / 0.32);
  }
  .btn--primary:not(:disabled):hover { filter: none; background: linear-gradient(180deg, #fdba74, #fb923c); }
  .btn--primary:not(:disabled):active { box-shadow: 0 2px 6px rgb(249 115 22 / 0.3); }
  .btn--secondary { background: #ffffff; color: var(--ink); border: 1.5px solid #27272a; box-shadow: none; }
  .btn--secondary:not(:disabled):hover { background: #18181b; color: #ffffff; border-color: #18181b; }
  .btn--danger { border-color: transparent; }

  /* Cartes, messages, champs. */
  .card { border-radius: 1.25rem; border-color: #e4e4e7; }
  .message--info { background: #fff7ed; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus-visible,
  select:focus-visible, textarea:focus-visible { outline-color: var(--brand); }

  /* Barre d'onglets : onglet central orange à icône noire. */
  .tabbar__bubble { background: linear-gradient(180deg, #fb923c, var(--brand)); color: var(--on-brand); box-shadow: 0 8px 18px rgb(249 115 22 / 0.4); }
  .tabbar__item[aria-current="page"], .tabbar__more[open] > .tabbar__item { color: var(--brand-ink); }
  .pro-nav strong { color: var(--ink); }
  .badge { font-weight: 700; }
}

/* Rappel de sécurité discret (D-115) : une ligne grise, sans carte ni bouton. */
@layer components {
  .security-hint { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 0.35rem 0.5rem; margin-block-end: var(--space-3); padding-inline: var(--space-2); font-size: 0.8rem; color: var(--color-muted); }
  .security-hint .icon { inline-size: 0.95rem; block-size: 0.95rem; flex: none; }
  .security-hint a { color: var(--color-muted); font-weight: 600; }
  .security-hint a:hover { color: var(--brand-ink); }
}

/* Bandeau de la boutique : compte connecté, à côté de « Changer » (D-116). */
@layer components {
  .store-chip { grid-template-columns: auto 1fr auto auto; }
  .store-chip__account {
    display: inline-flex; align-items: center; gap: var(--space-1);
    min-block-size: 2.5rem; max-inline-size: 11rem; padding: 0 var(--space-3);
    border-radius: 999px; border: 1px solid rgb(255 255 255 / 0.35);
    color: #ffffff; font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  }
  .store-chip__account:hover { background: rgb(255 255 255 / 0.16); }
  .store-chip__account .icon { inline-size: 1.15rem; block-size: 1.15rem; flex: none; }
  .store-chip__account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (max-width: 30rem) {
    .store-chip { gap: var(--space-2); }
    .store-chip__account { padding: 0 var(--space-2); max-inline-size: 6.5rem; }
    .store-chip__switch span { display: none; }
    .store-chip__switch { padding: 0 var(--space-2); }
  }
}

/* Accueil simplifié du commerçant (D-117) : filtre segmenté, grandes tuiles, camemberts. */
@layer components {
  .period-bar__set { border: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
  .period-bar__title { float: left; margin-inline-end: var(--space-3); padding: 0; font-size: var(--text-sm); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); line-height: 2.75rem; }
  .segmented { display: inline-flex; padding: 0.25rem; border-radius: 999px; background: #ffffff; border: 1px solid #e4e4e7; box-shadow: var(--shadow); max-inline-size: 100%; overflow-x: auto; }
  .segmented__item { position: relative; display: block; cursor: pointer; }
  .segmented__item input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
  .segmented__item span { display: block; padding: 0.5rem 0.95rem; border-radius: 999px; font-size: var(--text-sm); font-weight: 700; white-space: nowrap; color: #3f3f46; transition: background-color 160ms ease, color 160ms ease; }
  .segmented__item:hover span { background: #f4f4f5; }
  .segmented__item input:checked + span { background: var(--ink); color: #ffffff; }
  .segmented__item input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
  .period-bar__dates { display: none; flex-wrap: wrap; gap: var(--space-2); font-size: var(--text-sm); font-weight: 700; }
  .period-bar:has(input[value="custom"]:checked) .period-bar__dates { display: flex; }
  .period-bar__dates label { display: inline-flex; align-items: center; gap: var(--space-2); }
  .period-bar__dates input { min-block-size: 2.6rem; padding: 0 var(--space-3); border: 1px solid #d4d4d8; border-radius: 0.8rem; background: #ffffff; }
  .period-note { font-size: var(--text-sm); color: var(--color-muted); }

  .home-tiles { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block: var(--space-3); }
  .home-tile { display: grid; gap: 0.15rem; align-content: start; padding: var(--space-4); border-radius: 1.25rem; background: #ffffff; border: 1px solid #e4e4e7; box-shadow: var(--shadow); }
  .home-tile__value { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
  .home-tile__label { font-weight: 800; }
  .home-tile__hint { font-size: var(--text-sm); color: var(--color-muted); }
  .home-tile--accent { background: var(--ink); border-color: var(--ink); color: #ffffff; }
  .home-tile--accent .home-tile__value { color: var(--brand); }
  .home-tile--accent .home-tile__hint { color: #d4d4d8; }

  .month-bars { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
  .month-bars li { display: grid; grid-template-columns: 4.5rem 1fr 2.5rem; align-items: center; gap: var(--space-3); }
  .month-bars__label { font-size: var(--text-sm); color: var(--color-muted); }
  .month-bars__meter { inline-size: 100%; block-size: 0.9rem; }
  .month-bars__meter::-webkit-meter-bar { background: #f4f4f5; border: 0; border-radius: 1rem; block-size: 0.9rem; }
  .month-bars__meter::-webkit-meter-optimum-value { background: var(--brand); border-radius: 1rem; }
  .month-bars__meter::-moz-meter-bar { background: var(--brand); border-radius: 1rem; }
  .month-bars li strong { text-align: end; }

  .pie-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
  .pie { display: grid; gap: var(--space-3); margin: 0; }
  .pie__chart { inline-size: min(11rem, 60%); block-size: auto; justify-self: center; }
  .pie__slice { stroke: #ffffff; stroke-width: 2; stroke-linejoin: round; }
  .pie__slice--1, .pie__dot--1 { fill: #f97316; background: #f97316; }
  .pie__slice--2, .pie__dot--2 { fill: #18181b; background: #18181b; }
  .pie__slice--3, .pie__dot--3 { fill: #d4d4d8; background: #d4d4d8; }
  .pie__slice--4, .pie__dot--4 { fill: #fdba74; background: #fdba74; }
  .pie__hole { fill: #ffffff; }
  .pie__total { font-size: 34px; font-weight: 800; fill: #18181b; }
  .pie__legend { list-style: none; padding: 0; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
  .pie__legend li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-2); }
  .pie__dot { inline-size: 0.8rem; block-size: 0.8rem; border-radius: 50%; }
  .pie__empty { color: var(--color-muted); }
  @media (min-width: 48rem) { .home-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  @media (prefers-reduced-motion: reduce) { .segmented__item span { transition: none; } }
}

/* Statut du client et page « Clients » (D-118). */
@layer components {
  .client-tag { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
  .client-tag::before { content: ""; inline-size: 0.45rem; block-size: 0.45rem; border-radius: 50%; background: currentColor; }
  .client-tag--loyal { background: var(--ink); color: #fdba74; border-color: var(--ink); }
  .client-tag--passing { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
  .client-tag--new { background: #f0fdf4; color: #166534; border-color: #86efac; }
  .request-item__status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-block: 0.2rem; }

  .commune-group__title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: 1.05rem; }
  .commune-group__name { display: inline-flex; align-items: center; gap: var(--space-2); }
  .commune-group__name .icon { inline-size: 1.2rem; block-size: 1.2rem; color: var(--brand-ink); }
  .commune-group__count { padding: 0.1rem 0.6rem; border-radius: 999px; background: #f4f4f5; font-size: var(--text-sm); font-weight: 700; color: var(--color-muted); white-space: nowrap; }
  .client-list { list-style: none; padding: 0; display: grid; }
  .client-list li + li { border-block-start: 1px solid #f0f0f2; }
  .client-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-2); border-radius: 0.9rem; color: var(--color-text); text-decoration: none; transition: background-color 140ms ease; }
  .client-row:hover, .client-row:focus-visible { background: #fff7ed; }
  .client-row__avatar { display: grid; place-items: center; inline-size: 2.6rem; block-size: 2.6rem; border-radius: 50%; background: #f4f4f5; color: #3f3f46; font-weight: 800; font-size: 0.9rem; }
  .client-row__avatar--loyal { background: var(--ink); color: #fdba74; }
  .client-row__avatar--passing { background: #ffedd5; color: #9a3412; }
  .client-row__avatar--new { background: #dcfce7; color: #166534; }
  .client-row__main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-inline-size: 0; }
  .client-row__name { font-weight: 800; overflow-wrap: anywhere; }
  .client-row__tags { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
  .client-row__facts { grid-column: 2 / 3; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); color: var(--color-muted); }
  .client-row__facts strong { color: var(--color-text); }
  .client-fact { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
  .client-fact .icon { inline-size: 1rem; block-size: 1rem; color: var(--brand-ink); }
  .client-row__go { grid-column: 3; grid-row: 1 / span 2; color: #a1a1aa; }
  .client-row__go .icon { inline-size: 1.2rem; block-size: 1.2rem; }
  .client-row:hover .client-row__go { color: var(--brand-ink); }
  @media (min-width: 48rem) {
    .client-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
    .client-row__facts { grid-column: 3; }
    .client-row__go { grid-column: 4; grid-row: 1; }
  }

  /* Vue d'ensemble par commune (D-126). */
  .client-row__avatar .icon { inline-size: 1.2rem; block-size: 1.2rem; }
  .commune-row--home { background: #fff7ed; }
  .commune-back a { display: inline-flex; align-items: center; gap: var(--space-1); font-weight: 700; font-size: var(--text-sm); color: var(--brand-ink); text-decoration: none; }
  .commune-back .icon { inline-size: 1rem; block-size: 1rem; rotate: 180deg; }

  /* Recherche d'un client (D-125). */
  .client-search { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .client-search > * { min-inline-size: 0; margin: 0; }
  .client-search__bar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; }
  .client-search__icon { position: absolute; inset-inline-start: 0.9rem; inset-block-start: 50%; translate: 0 -50%; color: #71717a; pointer-events: none; line-height: 0; }
  .client-search__icon .icon { inline-size: 1.25rem; block-size: 1.25rem; }
  .client-search__bar input { inline-size: 100%; min-inline-size: 0; min-block-size: 3.2rem; padding: 0 var(--space-4) 0 2.8rem; border: 2px solid var(--ink); border-radius: 999px; background: #ffffff; font-size: 1rem; box-sizing: border-box; }
  .client-search__bar input:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
  .client-search__more > summary { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-weight: 700; font-size: var(--text-sm); color: var(--brand-ink); list-style: none; }
  .client-search__more > summary::-webkit-details-marker { display: none; }
  .client-search__more > summary .icon { inline-size: 1.1rem; block-size: 1.1rem; }
  @media (max-width: 30rem) {
    .client-search__bar { grid-template-columns: minmax(0, 1fr); }
    .client-search__bar .btn { inline-size: 100%; }
    .client-search__icon { inset-block-start: 1.6rem; }
  }
  @media (prefers-reduced-motion: reduce) { .client-row { transition: none; } }
}

/* Caisse : limite de passages du jour (D-120). */
@layer components {
  .limit-note { padding: var(--space-3) var(--space-4); border-radius: 0.9rem; background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; font-size: var(--text-sm); }
}

/* Page « QR code » : présentoir, menu des formats (D-121). */
@layer components {
  .poster-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .poster-panel > * { min-inline-size: 0; }
  .poster-panel__preview { margin: 0; display: grid; gap: var(--space-2); justify-items: center; padding: var(--space-4); border-radius: 1.1rem; background: #f4f4f5; }
  .poster-panel__preview img { display: block; inline-size: 100%; max-inline-size: min(17rem, 100%); block-size: auto; border-radius: 0.5rem; background: #ffffff; box-shadow: 0 12px 30px rgb(0 0 0 / 18%); }
  .poster-panel__preview figcaption { font-size: var(--text-sm); font-weight: 700; color: var(--color-muted); }
  .poster-format { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .poster-format select { inline-size: 100%; max-inline-size: 100%; text-overflow: ellipsis; min-block-size: 3rem; padding: 0 var(--space-4); border: 2px solid var(--ink); border-radius: 0.9rem; background: #ffffff; font-weight: 700; }
  .poster-format select:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
  @media (min-width: 48rem) { .poster-panel { grid-template-columns: minmax(14rem, 19rem) 1fr; } }
  .poster-panel .cluster .btn { flex: 1 1 12rem; }
  .qr-layout > * { min-inline-size: 0; }
  .qr-layout a { overflow-wrap: anywhere; }
}

/* Page « Ma boutique » (D-123) : sections au thème, état « en ligne », mise en page mobile. */
@layer components {
  .settings { inline-size: 100%; max-inline-size: 42rem; margin-inline: auto; }
  .settings form { min-inline-size: 0; }
  .settings-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4); border-radius: 1.25rem; background: #ffffff; border: 1px solid #e4e4e7; box-shadow: var(--shadow); }
  .settings-card > * { min-inline-size: 0; margin: 0; }
  .settings-card__title { display: flex; align-items: center; gap: var(--space-2); font-size: 1.1rem; }
  .settings-card__title::before { content: ""; inline-size: 0.35rem; block-size: 1.2rem; border-radius: 999px; background: var(--brand); }
  .settings-card--info { background: #fafafa; }
  .settings-card .field input:not([type="color"]):not([type="checkbox"]):not([type="radio"]), .settings-card .field select { inline-size: 100%; max-inline-size: 100%; min-inline-size: 0; box-sizing: border-box; }
  .settings-card input[type="file"] { padding: var(--space-2); font-size: var(--text-sm); }
  .settings-card input[type="file"]::file-selector-button { margin-inline-end: var(--space-3); padding: 0.5rem 0.9rem; border: 0; border-radius: 999px; background: var(--ink); color: #ffffff; font-weight: 700; cursor: pointer; }
  .field--color input[type="color"] { inline-size: 5rem; block-size: 3rem; padding: 0.25rem; border-radius: 0.8rem; border: 2px solid var(--ink); background: #ffffff; cursor: pointer; }

  .online-state { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: 1rem; background: #f4f4f5; border: 1px dashed #d4d4d8; }
  .online-state--on { background: #f0fdf4; border: 1px solid #86efac; }
  .online-state__thumb { inline-size: 4.5rem; block-size: 4.5rem; border-radius: 0.9rem; object-fit: contain; background: #ffffff; border: 1px solid #e4e4e7; }
  .online-state__thumb--empty, .online-state__thumb--doc { display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: #a1a1aa; }
  .online-state__thumb--doc { font-size: 0.9rem; color: var(--ink); background: #fff7ed; border-color: #fdba74; }
  .online-state__text { display: grid; gap: 0.3rem; justify-items: start; font-size: var(--text-sm); overflow-wrap: anywhere; }
  .status-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.78rem; font-weight: 800; background: #e4e4e7; color: #3f3f46; }
  .status-pill::before { content: ""; inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%; background: currentColor; }
  .status-pill--on { background: #166534; color: #ffffff; }

  .info-list { display: grid; gap: var(--space-3); }
  .info-list > div { display: grid; gap: 0.15rem; }
  .info-list dt { font-size: var(--text-sm); font-weight: 700; color: var(--color-muted); }
  .info-list dd { margin: 0; overflow-wrap: anywhere; }
  .info-list code { padding: 0.15rem 0.5rem; border-radius: 0.5rem; background: #ffffff; border: 1px solid #e4e4e7; font-weight: 700; }
  .settings__save .btn { inline-size: 100%; }
  .settings-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .settings-form > * { min-inline-size: 0; margin: 0; }
  .settings-card .field textarea { inline-size: 100%; max-inline-size: 100%; box-sizing: border-box; }
  /* Téléphone : type et bouton sur la première ligne, texte du message sur toute la largeur. */
  .settings-card .news-item { grid-template-columns: minmax(0, 1fr) auto; }
  .settings-card .news-item__kind { justify-self: start; }
  .settings-card .news-item__body { grid-column: 1 / -1; grid-row: 2; min-inline-size: 0; overflow-wrap: anywhere; }
  @media (min-width: 48rem) { .settings-card .news-item { grid-template-columns: auto 1fr auto; } .settings-card .news-item__body { grid-column: auto; grid-row: auto; } }
  .online-state__thumb--doc .icon { inline-size: 1.6rem; block-size: 1.6rem; }
  @media (min-width: 48rem) {
    .settings-card { padding: var(--space-6); }
    .settings__save .btn { inline-size: auto; min-inline-size: 14rem; }
  }
}

/* Carte du client : comptes de la boutique, historique replié (D-127). */
@layer components {
  .card-action--instagram { background: linear-gradient(135deg, #fff1f2, #ffe4e6); border-color: #fda4af; color: var(--ink); }
  .card-action--instagram .card-action__icon { background: #fecdd3; color: #9f1239; }
  .card-action--tiktok { background: var(--ink); border-color: var(--ink); color: #ffffff; }
  .card-action--tiktok .card-action__icon { background: rgb(255 255 255 / 0.16); color: #ffffff; }
  .card-action--tiktok .card-action__hint { color: rgb(255 255 255 / 0.85); }
  .card-action__icon .icon { inline-size: 1.4rem; block-size: 1.4rem; }
  .card-history > summary { cursor: pointer; font-weight: 700; color: var(--color-muted); list-style: none; display: flex; align-items: center; justify-content: space-between; }
  .card-history > summary::-webkit-details-marker { display: none; }
  .card-history > summary::after { content: "\203A"; font-size: 1.3rem; transition: rotate 160ms ease; }
  .card-history[open] > summary::after { rotate: 90deg; }
  .card-history[open] > summary { margin-block-end: var(--space-3); }
  @media (prefers-reduced-motion: reduce) { .card-history > summary::after { transition: none; } }
}

/* En-tête compact sur téléphone (D-128) : icônes rondes, une seule ligne. */
@layer components {
  .nav-link { display: inline-flex; align-items: center; gap: 0.35rem; }
  .nav-link .icon { display: none; inline-size: 1.3rem; block-size: 1.3rem; }
  @media (max-width: 47.99rem) {
    .site-header { flex-wrap: nowrap; gap: var(--space-2); }
    .site-header__brand { min-inline-size: 0; }
    .site-header__nav { flex-wrap: nowrap; gap: 0.15rem; flex-shrink: 0; }
    .site-header__nav form { display: inline-flex; }
    .nav-link .icon { display: block; }
    .nav-link__label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .site-header .nav-link, .site-header .bell { position: relative; justify-content: center; inline-size: 2.5rem; block-size: 2.5rem; min-block-size: 0; padding: 0; border-radius: 50%; text-decoration: none; }
    .site-header .nav-link:hover, .site-header .nav-link:focus-visible { background: rgb(255 255 255 / 0.14); }
    .site-header .nav-link[aria-current="page"] { background: rgb(255 255 255 / 0.16); }
    .site-header .nav-link--button { border-color: transparent; background: transparent; }
  }
  @media (max-width: 22rem) { .site-header .brand-name { display: none; } }
}

/* Offres au mois ou à l'année (D-129). */
@layer components {
  .plan-card__annual { font-size: var(--text-sm); }
  .plan-card__offer { display: inline-block; margin-inline-start: 0.25rem; padding: 0.05rem 0.55rem; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 0.75rem; font-weight: 800; white-space: nowrap; }
  .plan-card__actions { display: grid; gap: var(--space-2); }
  .plan-card__actions .btn, .plan-card > .btn { inline-size: 100%; }
}

/* Types de commerce (D-130) : pictogramme et nombre de cartes par groupe, type sur la carte. */
@layer components {
  .card-group__icon { font-size: 1.2rem; }
  .card-group__count { padding: 0.05rem 0.5rem; border-radius: 999px; background: #e4e4e7; color: #3f3f46; font-size: 0.75rem; letter-spacing: 0; }
  .loyalty-card__category { white-space: nowrap; }
}

/* Menu en pages et parrainage mis en avant sur la carte du client (D-135). */
@layer components {
  .menu-viewer > summary { list-style: none; grid-template-columns: auto 1fr auto; }
  .menu-viewer > summary::-webkit-details-marker { display: none; }
  .menu-viewer > summary::after { content: "▾"; grid-row: 1 / span 2; grid-column: 3; font-size: 1.2rem; color: #92400e; transition: transform 160ms ease; }
  .menu-viewer[open] > summary::after { transform: rotate(180deg); }
  .menu-viewer__pages { display: grid; gap: var(--space-3); margin-block-start: var(--space-3); }
  .menu-viewer__pages--many { grid-auto-flow: column; grid-auto-columns: 88%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-block-end: var(--space-2); }
  .menu-viewer__page { margin: 0; display: grid; gap: var(--space-1); align-content: start; scroll-snap-align: center; }
  .menu-viewer__page a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--color-border); background: #fff; }
  .menu-viewer__page img { inline-size: 100%; block-size: auto; }
  .menu-viewer__page figcaption { font-size: var(--text-sm); color: #52525b; text-align: center; }
  .menu-viewer__dots { display: flex; justify-content: center; gap: var(--space-2); margin-block-start: var(--space-2); }
  .menu-viewer__dots a { display: grid; place-items: center; inline-size: 2rem; block-size: 2rem; border-radius: 50%; background: #fef3c7; color: #92400e; font-weight: 700; text-decoration: none; }
  .menu-thumbs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .menu-thumbs img { inline-size: 5rem; block-size: 6.9rem; object-fit: cover; border-radius: 0.5rem; border: 1px solid var(--color-border); }

  .referral-cta {
    display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--space-2) var(--space-4);
    padding: var(--space-4); border-radius: 1.25rem; text-decoration: none;
    background: radial-gradient(24rem 12rem at 100% 0%, rgb(249 115 22 / 0.45), transparent 70%), var(--ink);
    color: #ffffff; box-shadow: 0 14px 30px rgb(0 0 0 / 0.22);
  }
  .referral-cta__badge {
    grid-row: span 2; display: flex; align-items: center; justify-content: center; gap: 0.05rem; inline-size: 4.25rem; block-size: 4.25rem; border-radius: 50%; white-space: nowrap;
    background: var(--brand); color: var(--on-brand); font-size: 1.35rem; font-weight: 800; line-height: 1;
    box-shadow: 0 0 0 0.35rem rgb(249 115 22 / 0.3); animation: referral-pulse 2.4s ease-in-out infinite;
  }
  .referral-cta__badge span { font-size: 1.1rem; }
  .referral-cta__text { display: grid; gap: 0.2rem; }
  .referral-cta__text strong { font-size: 1.1rem; line-height: 1.25; }
  .referral-cta__text span { color: #e4e4e7; font-size: var(--text-sm); }
  .referral-cta__go { justify-self: start; padding: 0.45rem 1.1rem; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-weight: 800; }
  .referral-cta:active { transform: scale(0.98); }
  .referral-cta:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
  @keyframes referral-pulse { 0%, 100% { box-shadow: 0 0 0 0.35rem rgb(249 115 22 / 0.3); } 50% { box-shadow: 0 0 0 0.7rem rgb(249 115 22 / 0.08); } }
  @media (prefers-reduced-motion: reduce) { .referral-cta__badge { animation: none; } .menu-viewer > summary::after { transition: none; } }
}

/* Carte du client (D-136) : avis, étoile et récompense dans un seul bloc, de même taille et
   plus compacts ; parrainage plus brillant ; parrainage d'un commerce en variante sombre. */
@layer components {
  .card-actions { gap: 0.4rem; grid-auto-rows: 1fr; padding: 0.45rem; border: 1px solid var(--color-border); border-radius: 1.25rem; background: var(--color-surface); box-shadow: var(--shadow); }
  .card-actions > form { display: grid; }
  .card-actions .card-action { block-size: 100%; min-block-size: 3.6rem; padding: 0.5rem 0.8rem; column-gap: 0.7rem; border-radius: 0.9rem; box-shadow: none; }
  .card-actions .card-action--review { padding-inline-end: 2.4rem; padding-block-end: 0.7rem; box-shadow: none; }
  .card-actions .card-action--review:hover { box-shadow: none; }
  .card-actions .card-action--review::after { font-size: 1.5rem; inset-inline-end: 0.8rem; }
  .card-actions .card-action__icon { inline-size: 2.3rem; block-size: 2.3rem; font-size: 1.2rem; }
  .card-actions .google-g { inline-size: 1.4rem; block-size: 1.4rem; }
  .card-actions .card-action__label { font-size: 1rem; }
  .card-actions .card-action__hint { font-size: 0.78rem; line-height: 1.25; }

  .referral-cta {
    position: relative; overflow: hidden; border: 1px solid rgb(255 255 255 / 0.6);
    background: linear-gradient(120deg, #fdba74 0%, #f97316 42%, #fbbf24 78%, #fde047 100%);
    color: var(--on-brand);
    box-shadow: 0 14px 30px rgb(249 115 22 / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.65);
  }
  .referral-cta::after {
    content: ""; position: absolute; inset-block: -20%; inset-inline-start: -60%; inline-size: 38%;
    background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.65), transparent);
    transform: skewX(-20deg); pointer-events: none; animation: referral-shine 3.2s ease-in-out infinite;
  }
  .referral-cta > * { position: relative; z-index: 1; }
  .referral-cta__badge { background: #ffffff; color: var(--ink); box-shadow: 0 0 0 0.35rem rgb(255 255 255 / 0.4), 0 6px 14px rgb(0 0 0 / 0.18); animation: none; }
  .referral-cta__text span { color: #27272a; }
  .referral-cta__go { background: var(--ink); color: #ffffff; }
  .referral-cta:focus-visible { outline-color: var(--ink); }
  @keyframes referral-shine { 0%, 55% { inset-inline-start: -60%; } 100% { inset-inline-start: 130%; } }

  .referral-cta--merchant { border-color: transparent; background: radial-gradient(24rem 12rem at 100% 0%, rgb(249 115 22 / 0.5), transparent 70%), var(--ink); color: #ffffff; box-shadow: 0 14px 30px rgb(0 0 0 / 0.22); }
  .referral-cta--merchant::after { display: none; }
  .referral-cta--merchant .referral-cta__badge { background: var(--brand); box-shadow: 0 0 0 0.35rem rgb(249 115 22 / 0.3); font-size: 1.7rem; }
  .referral-cta--merchant .referral-cta__text span { color: #e4e4e7; }
  .referral-cta--merchant .referral-cta__go { background: var(--brand); color: var(--on-brand); }
  .referral-cta--merchant:focus-visible { outline-color: var(--brand); }
  @media (prefers-reduced-motion: reduce) { .referral-cta::after { animation: none; display: none; } }
}

/* Aide à la saisie d'une date (D-139) : date relue en toutes lettres sous le champ. */
@layer components {
  .date-guide__hint { margin-block-start: var(--space-1); font-size: var(--text-sm); color: var(--color-muted); min-block-size: 1.3em; }
  .date-guide__hint.is-complete { color: #166534; font-weight: 700; }
  .date-guide__hint.is-invalid { color: #b91c1c; font-weight: 700; }
}

/* Liens légaux du pied de page (D-140). */
@layer components {
  .legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1rem; margin-block-start: var(--space-2); font-size: var(--text-sm); }
  .legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }
}
