/* ==========================================================================
   app.css — coque de l'application (étape 23, #836)

   En-tête, barre du bas du téléphone, disposition des zones. Chargé APRÈS style.css :
   il remplace la mise en page de l'ancienne interface à mesure que les écrans sont refaits.
   Référence : projet/design/Application.dc.html (Bureau mois, Tablette portrait mois,
   Téléphone mois) et Tablette paysage et mode sombre.dc.html (Tablette paysage mois).

   Trois dispositions :
   - bureau (≥ 1100 px) : en-tête de 68 px en trois zones, colonne latérale à droite ;
   - tablette portrait (700-1099 px) : en-tête sur deux lignes (64 + 60 px), la navigation
     passe en seconde ligne ;
   - téléphone (< 700 px) : en-tête réduit (icône, titre + synchro, compte), navigation dans
     la barre du bas, sous le pouce.
   Sans imbrication CSS ni :has() (cible iOS 16.4, voir tokens.css).
   ========================================================================== */

/* --------------------------------------------------------------------------
   PAGE
   -------------------------------------------------------------------------- */
html { background-color: var(--color-bg); }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "main   side";
  min-height: 100vh;
  min-height: 100dvh;
}

.app[hidden] { display: none; }

/* --------------------------------------------------------------------------
   EN-TÊTE
   -------------------------------------------------------------------------- */
.app-header {
  grid-area: header;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "brand center end";
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  min-height: 68px;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  background-color: var(--color-surface);
  border-bottom: var(--border-hair) solid var(--color-border);
}

.app-header__brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-header__logo {
  flex: none;
  display: block;
  width: 32px;
  height: 32px;
}

/* « Garde / alternée » sur deux lignes, hauteur de l'icône (DECISIONS, Identité) */
.app-header__name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 32px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Titre + synchro : téléphone seulement */
.app-header__title { display: none; }

.app-header__center {
  grid-area: center;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sélecteur de mois : Bricolage 500, 19 px, largeur fixe 150 px */
.app-header__nav-title {
  flex: none;
  width: 150px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  text-align: center;
  white-space: nowrap;
}

.app-header__today { flex: none; padding: 0 14px; font-size: 15px; }

.app-header__end {
  grid-area: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.app-header__select { flex: none; padding: 0 16px; font-size: 15px; }

/* Mode sélection : le bouton reste encre pleine, libellé « Terminé » (renderHeader) */
.app-header__select[aria-pressed="true"],
.app-bottombar__select[aria-pressed="true"] {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.app-header__sync { cursor: default; }

/* --------------------------------------------------------------------------
   MENU DU COMPTE — pastille (initiale couleur du parent) + prénom + ☰
   -------------------------------------------------------------------------- */
/* dropdown.css pose align-self: flex-start : invisible tant que la zone fait 44 px, décalé
   dès qu'elle est plus haute (64 px en tablette portrait) */
.account-menu { flex: none; align-self: center; }

.account-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  height: var(--tap-min);
  padding: 0 12px 0 6px;
  border: var(--border-control) solid var(--color-border);
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
  font-size: 14px;
  cursor: pointer;
}

/* Menu ouvert : filet encre 2 px (maquette Bureau année, menu du compte ouvert) */
.dropdown--open .account-menu__trigger {
  border-width: var(--border-strong);
  border-color: var(--color-text);
}

.account-menu__trigger:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}

.account-menu__name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 16px;
}

.account-menu__mail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--color-text-muted);
}

.dropdown__link-hint[hidden] { display: none; }

/* --------------------------------------------------------------------------
   ZONES
   -------------------------------------------------------------------------- */
.app-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
  padding: 16px 24px 20px;
  overflow: visible;
}

.app--year .app-main { padding: 16px 36px 20px; gap: 18px; }
/* Cible du focus quand une fenêtre se ferme sans déclencheur visible (restoreFocus) */
.app-main:focus { outline: none; }

/* Grille du mois : hauteur des cases par support (maquettes : 118 bureau, 104 tablette
   paysage, 88 tablette portrait, 61 téléphone) */
.cal-month { --cal-cell-h: 118px; }
.cal-year { --cal-ycell: 26px; gap: 20px 26px; }

/* Bandeau des marques : texte long (bureau, tablette) ou court (téléphone) */
.app-banner { flex: none; }
.app-banner__short { display: none; }
.app-banner .btn { height: 40px; padding: 0 14px; font-size: 14px; }

/* Bandeau « Hors ligne » (maquette Écrans d'état › Bureau hors ligne) : sans action tant que
   la liste des modifications en attente n'existe pas (étape 26) */
#offline-banner { gap: 12px; min-height: 40px; padding: 6px 14px; }
.app-offline__mark {
  flex: none;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  margin: 0 3px;
  border: var(--border-strong) solid var(--color-text);
  border-radius: 1px;
  transform: rotate(45deg);
}

/* Modifications pas encore envoyées : repères affichés seulement quand la file n'est pas vide
   (légendes, note du compteur, aide du téléphone) */
.app:not(.app--pending) [data-pending-only] { display: none; }
.legend__pending {
  display: inline-block;
  flex: none;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border: var(--border-strong) solid var(--color-text);
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
}
.side__note { font-size: var(--font-size-sm); line-height: 1.45; color: var(--color-text-muted); }
.pending-hint { display: none; }

/* Éléments du mode sélection : affichés seulement en mode sélection ; l'en-tête encre du
   mode sélection n'existe que sur téléphone */
.app-header__sel,
.sel-title { display: none; }
.app:not(.app--selecting) [data-sel-only] { display: none; }
.sel-hint { display: none; }
.sel-fill { align-self: flex-start; gap: 10px; }
.app--year .sel-fill { display: none; }
.sel-tray {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  margin: 0 -24px -20px;
  padding: 12px 24px;
}

/* Colonne */
.side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  padding: 20px;
  border-left: var(--border-hair) solid var(--color-border);
  background-color: var(--color-surface);
}

.side__counter,
.side__upcoming,
.side__legend { display: flex; flex-direction: column; gap: 10px; }
.side__upcoming { margin-top: 12px; }
.side__legend { margin-top: 4px; }

/* Légende : celle de la colonne en vue mois, la liste en vue année ; celle sous la grille
   seulement en tablette paysage */
.legend--under,
.legend-year,
.legend-year__hint,
.counter-strip { display: none; }
.app--year .side__legend .legend { display: none; }
.app--year .legend-year { display: flex; }
.app--year .legend-year__hint { display: block; }
.app--year .side__upcoming { display: none; }
.app--year .side__legend { margin-top: 12px; }

.side__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
.side__logout { min-height: var(--tap-min); padding: 0; font-size: var(--font-size-xs); color: var(--color-text-muted); }

/* « À venir » : 3 éléments sur bureau et téléphone, 4 sur tablette (README du paquet) */
.upcoming li:nth-child(n+4) { display: none; }

/* Barre du bas : téléphone seulement */
.app-bottombar { display: none; }

/* --------------------------------------------------------------------------
   DÉTAIL DU JOUR (étape 23c) — bureau : panneau de 380 px à la place de la colonne
   -------------------------------------------------------------------------- */
.day-panel {
  grid-area: side;
  position: sticky;
  top: 68px;
  width: 380px;
  height: calc(100dvh - 68px);
  border-left: var(--border-hair) solid var(--color-border);
}

.app--panel { grid-template-columns: minmax(0, 1fr) 380px; }
.app--panel .side { display: none; }

/* Le voile n'existe que pour la feuille montante */
.sheet-scrim { display: none; }

/* --------------------------------------------------------------------------
   HISTORIQUE (étape 23c) ET PARAMÈTRES (23d) — à la place du planning ; l'en-tête garde la
   synchro et le compte (.app--screen posé avec .app--journal ou .app--settings)
   -------------------------------------------------------------------------- */
.journal,
.settings { grid-column: 1 / -1; grid-row: 2; }
.app-header__back { display: none; flex: none; gap: 8px; padding: 0 16px; font-size: 15px; }
.app--screen .app-main,
.app--screen .side,
.app--screen .app-bottombar,
.app--screen .app-header__select,
.app--screen .app-header__center > :not(.app-header__back) { display: none; }
.app--screen .app-header__back { display: inline-flex; }

/* --------------------------------------------------------------------------
   TABLETTE PAYSAGE (1100-1239 px) — compte réduit à l'initiale et ☰
   -------------------------------------------------------------------------- */
@media (max-width: 1239px) {
  .app { grid-template-columns: minmax(0, 1fr) 300px; }
  /* Même spécificité que la règle ci-dessus, déclarée après elle : sans ce rappel, le panneau
     de 380 px tenait dans une colonne de 300 px et débordait de 80 px */
  .app--panel { grid-template-columns: minmax(0, 1fr) 380px; }
  .account-menu__name { display: none; }
  .account-menu__trigger { gap: 6px; padding: 0 10px 0 6px; }
  /* Synchro avant « Sélectionner » (maquette Tablette paysage mois) */
  .app-header__end > .app-header__sync { order: -1; }
  .cal-month { --cal-cell-h: 104px; }
  .cal-year { --cal-ycell: 24px; gap: 20px 22px; }
  .upcoming li:nth-child(4) { display: list-item; }
  /* Légende sous la grille, intitulés à gauche (DECISIONS, À faire 2) */
  .legend--under { display: flex; flex: none; padding-top: 12px; border-top: var(--border-hair) solid var(--color-border); }
  .side__legend { display: none; }
  .app--year .side__legend { display: flex; }
  .app--year .legend--under { display: none; }
}

/* --------------------------------------------------------------------------
   TABLETTE PORTRAIT (700-1099 px) — en-tête sur deux lignes
   -------------------------------------------------------------------------- */
@media (max-width: 1099px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    /* La hauteur restante va à la colonne, sous la grille : pas de vide entre les deux */
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "header"
      "main"
      "side";
  }
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand  end"
      "center center";
    row-gap: 0;
    padding-bottom: 8px;
  }
  .app-header__brand,
  .app-header__end { min-height: 64px; }
  .app-header__center { min-height: 52px; }
  /* Mois/Année poussé à droite de la seconde ligne */
  .app-header__center .segmented { margin-left: auto; }
  .account-menu__name { display: inline; }
  .account-menu__trigger { gap: 8px; padding: 0 12px 0 6px; }
  .app-main { padding: 20px 24px 0; gap: 16px; }
  .app--year .app-main { padding: 20px 24px 0; }
  .cal-month { --cal-cell-h: 88px; }
  .cal-year { grid-template-columns: repeat(3, max-content); }
  .app-banner { padding: 4px 4px 4px 12px; font-size: 14px; gap: 10px; }
  .app-banner .btn { height: var(--tap-min); }
  .app-banner__history { display: none; }
  .sel-tray { margin: 0 -24px; }

  /* Colonne sous la grille : deux cartes, compteur | À venir + légende (Tablette portrait mois) */
  .side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "counter upcoming"
      "counter legend"
      "foot    foot";
    align-content: start;
    gap: 0 16px;
    padding: 16px 24px 20px;
    border-left: none;
    background-color: transparent;
  }
  .side__counter,
  .side__upcoming,
  .side__legend { margin: 0; padding: 18px; gap: 12px; background-color: var(--color-surface); }
  .side__counter { grid-area: counter; align-self: start; border-radius: var(--radius-lg); }
  .side__upcoming { grid-area: upcoming; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: 12px; }
  .side__legend { grid-area: legend; border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding-top: 0; }
  .side__legend { display: flex; }
  .legend--under { display: none; }
  .side__legend > .side__title { display: none; }
  .side__legend .legend { padding-top: 12px; border-top: var(--border-hair) solid var(--color-border); }
  .side__foot { grid-area: foot; padding-top: 16px; }
  .counter__row { padding-bottom: 8px; }
  .counter__balance { flex-direction: row; align-items: center; justify-content: space-between; padding: 0; background: none; }
  .counter__balance-label { font-size: var(--font-size-md); color: var(--color-text); }
  /* Vue année : une carte, légende en liste */
  .app--year .side__upcoming { display: none; }
  .app--year .side__legend { grid-area: upcoming; padding-top: 18px; border-radius: var(--radius-lg); }
  .app--year .side__legend > .side__title { display: block; }

  /* Détail du jour : feuille montante, voile, 600 px au plus */
  .app--panel { grid-template-columns: minmax(0, 1fr); }
  .app--panel .side { display: grid; }
  .sheet-scrim { display: block; }
  .day-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-modal);
    width: auto;
    max-width: 600px;
    height: auto;
    max-height: calc(100dvh - 48px);
    margin: 0 auto;
    border-left: none;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .day-panel__handle {
    display: block;
    flex: none;
    width: 40px;
    height: 5px;
    margin: 10px auto 4px;
    border-radius: var(--radius-full);
    background-color: var(--color-border);
  }
  .day-panel__head { padding: 6px 16px 14px; }
  .day-panel__head--bar { padding: 6px 12px 10px 6px; }
  .day-panel__body { padding: 16px; gap: 18px; }
  .day-panel__foot { padding: 12px 16px 20px; }

  /* Historique : colonne de filtres un peu plus étroite */
  .journal__filters { top: 124px; width: 260px; height: calc(100dvh - 124px); }
  .journal__main { padding: 20px 24px; }
}

/* --------------------------------------------------------------------------
   TÉLÉPHONE (< 700 px)
   -------------------------------------------------------------------------- */
@media (max-width: 699px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand end";
    min-height: 0;
    padding: 10px 12px 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  .app-header__brand,
  .app-header__end { min-height: 0; }
  .app-header__logo { width: 28px; height: 28px; }
  .app-header__name,
  .app-header__center,
  .app-header__select,
  .app-header__end > .app-header__sync { display: none; }

  .app-header__title {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .app-header__month {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .app-header__title .sync-status { min-height: 0; font-size: 12px; }

  .account-menu__name { display: none; }
  .account-menu__trigger { gap: 6px; padding: 0 10px 0 6px; }

  .app-main,
  .app--year .app-main { padding: 10px 10px 0; gap: 14px; }
  .cal-month { --cal-cell-h: 61px; }
  .cal-year { --cal-ycell: 22px; --cal-ygap: 2px; grid-template-columns: repeat(2, max-content); gap: 18px; }
  .cal-year__title { font-size: var(--font-size-sm); } /* GrilleAnnee big=false : 13 px */
  .app-banner__long { display: none; }
  .app-banner__short { display: inline; }
  #offline-banner { gap: 10px; min-height: var(--tap-min); padding: 4px 12px; }
  .pending-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
  }

  /* Toasts en haut, sous l'en-tête : en bas, ils masqueraient la barre du bas ou celle de la
     sélection, là où le doigt travaille */
  .toast-container--bottom-center {
    top: calc(76px + env(safe-area-inset-top));
    bottom: auto;
    flex-direction: column;
  }
  .sel-hint { display: flex; }
  .sel-fill { align-self: stretch; justify-content: center; }
  /* margin-top auto : la barre descend au bas de la zone principale, étirée jusqu'au bas de
     l'écran en mode sélection (plus bas) */
  .sel-tray { margin: auto -10px 0; padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); }
  .sel-title { display: block; padding: 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.2; }

  /* Colonne : trois cartes de compteur, « À venir » en carte, pas de légende (Téléphone mois) */
  .side { display: flex; gap: 14px; padding: 14px 10px 20px; }
  .side__counter,
  .side__legend { display: none; }
  .app--year .side__legend { display: flex; margin: 0; padding: 14px; border-radius: var(--radius-lg); }
  /* Cartes : sous la grille en vue mois (order 1, derrière les éléments du mode sélection,
     masqués hors de ce mode), à leur place dans le DOM — au-dessus de la grille — en vue année */
  .counter-strip { display: grid; order: 1; }
  .app--year .counter-strip { order: 0; }
  .side__upcoming { margin: 0; padding: 14px; gap: 10px; border-radius: var(--radius-lg); }
  .upcoming__item { padding: 4px 0; }
  .upcoming__body { flex-direction: row; gap: 10px; }
  .upcoming__when { flex: none; width: 84px; font-size: var(--font-size-xs); }
  .upcoming li:nth-child(4) { display: none; }

  /* Mode sélection : en-tête à l'encre (Mode sélection · Terminé), pas de barre du bas */
  .app--selecting .app-header { background-color: var(--color-text); color: var(--color-surface); border-bottom: none; }
  .app--selecting .app-header__brand,
  .app--selecting .account-menu { display: none; }
  .app-header__sel { grid-area: brand; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .app-header__sel-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
  .app-header__sel-hint { font-size: var(--font-size-sm); color: color-mix(in oklab, var(--color-surface) 80%, var(--color-text)); }
  .app--selecting .app-header__select {
    display: inline-flex;
    border: var(--border-control) solid var(--color-surface);
    background-color: transparent;
    color: var(--color-surface);
  }
  .app--selecting .app-bottombar { display: none; }
  /* Ni cartes ni colonne : la zone principale prend la hauteur restante, sans quoi la barre de
     sélection, collante dans cette zone, s'arrêtait à mi-écran au-dessus de la colonne */
  .app--selecting { grid-template-rows: auto 1fr auto; }
  .app--selecting .counter-strip,
  .app--selecting .side { display: none; }

  /* Barre du bas : ‹ Auj. › Année/Mois Sélectionner */
  .app-bottombar {
    position: sticky;
    bottom: 0;
    z-index: var(--z-sticky);
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background-color: var(--color-surface);
    border-top: var(--border-hair) solid var(--color-border);
  }
  .app-bottombar__arrow { height: var(--control-height); }
  .app-bottombar .btn { flex: none; padding: 0 12px; font-size: 15px; }
  .app-bottombar .app-bottombar__select { flex: 1; min-width: 0; }
  .app--panel .side { display: flex; }

  /* Feuille du jour : pleine largeur, le seul bouton Enregistrer en bas (Téléphone détail du jour) */
  .day-panel { max-width: none; }
  /* Pas le titre de barre (« Jour spécial », 18 px) : il prenait aussi les 24 px */
  .day-panel__title:not(.day-panel__title--bar) { font-size: 24px; }
  .day-panel__head .day-panel__close { margin-top: -2px; }
  .pick-row { gap: 6px; }
  .day-panel__cancel { display: none; }
  .day-panel__foot { padding: 12px 16px 28px; }
  .day-panel__foot > .btn--primary { min-height: var(--control-height-lg); font-size: var(--font-size-base); }
  /* Jour spécial : plein écran (Téléphone jour spécial) */
  .day-panel--full {
    top: 0;
    max-height: none;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
  }
  .day-panel--full .day-panel__handle { display: none; }
  .day-panel--full .day-panel__head--bar { padding-top: 10px; }
  .day-panel--full .day-panel__body { padding: 18px 16px; }
  .day-panel--full .day-panel__foot { border-top: none; }
  .day-panel--full .ga-confirm { margin: 0 -4px; }

  /* Historique : barre « ‹ Planning », puces déroulantes, pas d'en-tête de l'application */
  .app--screen .app-header { display: none; }
  .journal { flex-direction: column; grid-row: 1 / -1; }
  .settings { grid-row: 1 / -1; }
  .journal__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px 0 6px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background-color: var(--color-surface);
  }
  .journal__back { gap: 6px; padding: 0 10px; font-size: var(--font-size-md); }
  .journal__bar-title {
    flex: 1;
    padding-right: 8px;
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    font-size: 18px;
    text-align: right;
  }
  .journal__filters {
    position: static;
    width: auto;
    height: auto;
    gap: 10px;
    padding: 10px 12px 12px;
    overflow: visible;
    border-right: none;
    border-bottom: var(--border-hair) solid var(--color-border);
  }
  .journal__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .journal__desk,
  .journal__seen { display: none; }
  .journal__phone { display: flex; gap: 6px; overflow-x: auto; }
  /* Une liste déroulante prend la largeur de sa plus longue option : à trois, elles
     débordaient de l'écran. field-sizing la règle sur l'option choisie (maquette) ; sans
     lui, elles se partagent la ligne */
  .journal__chip {
    flex: 0 1 auto;
    min-width: 0;
    field-sizing: content;
    box-sizing: border-box;
    min-height: var(--tap-min);
    padding: 0 28px 0 12px;
    border: var(--border-control) solid var(--color-border);
    border-radius: var(--radius-full);
    /* Chevron en deux dégradés : il suit currentColor, donc le thème sombre */
    background-color: var(--color-surface);
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: var(--font-weight-bold);
    font-size: 14px;
    appearance: none;
  }
  .journal__main { padding: 4px 12px 12px; }
  .journal__day { padding: 10px 4px 0; }
  .journal__mark { gap: 8px; padding: 8px 0 2px; }
  .jentry { gap: 10px; padding: 12px; }
  .jentry__meta { order: 0; }
  .jentry__what { font-size: var(--font-size-md); line-height: 1.3; }
  .jentry__change { gap: 4px 6px; font-size: 14px; }
  /* Maquette téléphone : zone de 44 px, décalée pour que les points s'alignent sur la marge */
  .jentry__revert { width: 44px; min-height: 44px; margin: -6px -8px 0 0; padding: 0; border: 0; background: none; }
  .jentry__revert-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .jentry__revert-dots { display: block; }
  .jrevert { flex-basis: 100%; max-width: 100%; margin-left: 0; padding: 14px; }
  .jrevert__gap { display: none; }
  .jrevert__actions .btn { flex: 1 1 100%; }
  .jrevert__forms { flex-direction: column; border-radius: var(--radius-md); }
}
