/* Plan — style « livre de comptes » (v19.29) : la liste continue d'avant, rendue plus lisible par la typographie et les
   filets plutôt que par des cartes. Groupe = titre en capitales sur un filet ; famille = nom suivi de points de conduite
   jusqu'aux montants ; catégorie = en retrait, plus petite et grisée, avec ses propres points ; montants en chiffres de
   largeur fixe ; total = filet au-dessus, montants soulignés d'un double trait (comme en comptabilité) ; total du mois =
   double trait plus marqué. Les champs de saisie ressemblent à une ligne à remplir et ne se dévoilent qu'au survol. */
.d-env .env-list { --leader: color-mix(in srgb, var(--ink-3) 60%, transparent); }
.d-env .env-list .env-ghead { padding: 22px 0 8px; border-bottom: 1px solid var(--border-strong); }
.d-env .env-list .env-group:first-of-type .env-ghead { padding-top: 6px; }
.d-env .env-list .env-ghead h3 { text-transform: uppercase; letter-spacing: .14em; font-size: 13.5px; font-weight: 700; }
.d-env .env-list .env-ghead .grp-target { font-size: 12.5px; }
.d-env .env-list .env-cols { border-bottom: 0; padding: 6px 0 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; }

.d-env .env-list .env-row { border-bottom: 0; border-radius: 0; padding: 8px 0 6px; }
.d-env .env-list .er-top { flex-wrap: nowrap; }
.d-env .env-list .er-top .env-name { font-size: 15px; font-weight: 650; flex: none; max-width: 75%; }
.d-env .env-list .er-top::after,
.d-env .env-list .env-sub-name::after { content: ''; flex: 1 1 20px; min-width: 20px; align-self: flex-end; margin: 0 0 5px 8px; border-bottom: 2px dotted var(--leader); }
.d-env .env-list .er-subtoggle .link { font-size: 12px; }

.d-env .env-list .env-row.env-sub { padding: 2px 0 2px 32px; border-bottom: 0; }
.d-env .env-list .env-sub .er-main { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 0; }
.d-env .env-list .env-sub-name { display: flex; flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--ink-2); }
.d-env .env-list .env-sub-name::before { content: '└'; margin-right: 8px; color: var(--ink-3); }
.d-env .env-list .env-sub .er-meta { flex-basis: 100%; margin-left: 20px; font-size: 11.5px; }
.d-env .env-list .env-sub .er-left { padding-top: 7px; }

/* Les champs : une ligne pointillée à remplir ; le cadre revient au survol et à la saisie. */
.d-env .env-list .env-input { background: transparent; border-color: transparent; border-bottom: 1px dashed var(--border-strong); border-radius: 6px 6px 0 0; min-height: 34px; box-shadow: none; }
.d-env .env-list .env-input:hover { border-color: var(--border-strong); }
.d-env .env-list .env-input:focus { border-color: var(--accent); background: var(--surface-2); border-radius: 6px; }
.d-env .env-list .env-sub .env-input { min-height: 30px; font-size: 13px; }

/* Le reste : couleur seule, pas de pastille (lecture en colonne). */
.d-env .env-list .env-avail, .d-env .env-list .env-avail.pos, .d-env .env-list .env-avail.neg, .d-env .env-list .env-row.is-pot .env-avail.pos { background: transparent; padding-inline: 0; }

/* Totaux : filet au-dessus, montants soulignés deux fois. */
.d-env .env-list .env-row.env-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border-strong); }
.d-env .env-list .env-row.env-total > .er-main { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.d-env .env-list .env-row.env-total .er-placed, .d-env .env-list .env-row.env-total .er-left,
.d-env .env-list .env-row.env-grand .er-placed, .d-env .env-list .env-row.env-grand .er-left { justify-self: end; padding-bottom: 3px; border-bottom: 3px double var(--ink-3); }
.d-env .env-list .env-row.env-grand { margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--ink-2); }
.d-env .env-list .env-row.env-grand > .er-main { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; }
.d-env .env-list .env-row.env-grand .er-placed, .d-env .env-list .env-row.env-grand .er-left { border-bottom: 4px double var(--ink-1); font-size: 15px; }
.d-env .env-list .env-fam-rest { margin-left: 32px; }

@media (max-width: 600px) {
  .d-env .env-list .env-row.env-sub { padding-left: 16px; }
  .d-env .env-list .er-top .env-name { max-width: none; flex: 0 1 auto; overflow-wrap: normal; }
  .d-env .env-list .er-top::after, .d-env .env-list .env-sub-name::after { min-width: 6px; flex-basis: 6px; }
  .d-env .env-list .env-fam-rest { margin-left: 16px; }
}
.d-env .env-list .env-row.env-total .er-meta, .d-env .env-list .env-row.env-grand .er-meta { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* Alignement (v19.30) : chaque ligne a la hauteur de son champ et tout est centré dessus (nom, points de conduite,
   reste) ; le texte des montants placés, l'en-tête « Placé » et les totaux finissent au même bord (le retrait
   intérieur du champ). */
.d-env .env-list { --in-pad: 10px; }
.d-env .env-list .env-row { align-items: start; }
.d-env .env-list .er-top { min-height: 34px; align-items: center; }
.d-env .env-list .er-top::after { align-self: center; margin: 8px 0 0 8px; }
.d-env .env-list .er-left { padding-top: 0; min-height: 34px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.d-env .env-list .env-sub-name { min-height: 30px; align-items: center; }
.d-env .env-list .env-sub-name::after { align-self: center; margin: 8px 0 0 8px; }
.d-env .env-list .env-sub .er-left { padding-top: 0; min-height: 30px; }
.d-env .env-list .env-input { padding-right: var(--in-pad); }
.d-env .env-list .env-cols span:nth-child(2) { padding-right: var(--in-pad); }
.d-env .env-list .env-row.env-total .er-placed, .d-env .env-list .env-row.env-grand .er-placed { margin-right: var(--in-pad); }
.d-env .env-list .env-row.env-total .er-left, .d-env .env-list .env-row.env-grand .er-left { min-height: 0; display: block; }
@media (max-width: 600px) { .d-env .env-list { --in-pad: 8px; } }
/* « Tout déplier » : de l'air avec le bord de la carte et le premier groupe. */
.d-env .env-list .env-foldall { margin: 12px 0 10px; }
.d-env .env-list .env-foldall .btn { padding-inline: 14px; }

/* Points de conduite jusqu'au montant (v19.31) : le nom et ses points courent jusque sous la colonne « Placé » ; le champ
   (fond de la carte, largeur du nombre quand le navigateur le permet) les recouvre juste avant le chiffre, comme sur un
   livre de comptes « Logement ........ 750 ». Plus de trait pointillé sous le champ : une seule ligne, à la hauteur du
   texte. Le cadre du champ apparaît au survol et pendant la saisie. */
.d-env .env-list .env-row:not(.env-total):not(.env-grand) > .er-main { grid-column: 1 / 3; grid-row: 1; }
.d-env .env-list .env-row:not(.env-total):not(.env-grand) > .er-placed { grid-column: 2; grid-row: 1; position: relative; z-index: 1; align-self: start; }
.d-env .env-list .env-row:not(.env-total):not(.env-grand) > .er-left { grid-column: 3; grid-row: 1; }
.d-env .env-list .env-input { background: var(--surface); border: 1px solid transparent; border-radius: 6px; field-sizing: content; width: auto; max-width: 96px; min-width: 4.5ch; padding-left: 8px; }
.d-env .env-list .env-input:hover { border-color: var(--border-strong); }
.d-env .env-list .env-input:focus { border-color: var(--accent); background: var(--surface-2); min-width: 7ch; }
.d-env .env-list .er-top::after, .d-env .env-list .env-sub-name::after { margin-top: 10px; margin-right: 0; }
.d-env .env-list .env-row.env-sub .env-input { width: auto; max-width: 86px; }
@supports not (field-sizing: content) { .d-env .env-list .env-input { width: 96px; } .d-env .env-list .env-row.env-sub .env-input { width: 86px; } }

/* v19.38 — rounded amounts reveal their exact value (Amt): hover title with a mouse, tap on touch. */
@media (pointer: fine) { .amt.has-cents { cursor: help; } }
.amt.has-cents { -webkit-tap-highlight-color: transparent; }
/* v19.72: the exact value floats over the rounded one (no layout shift). */
.amt.has-cents { position: relative; display: inline-block; }
.amt .amt-f { position: absolute; top: 50%; right: -4px; transform: translateY(-50%); padding: 1px 4px; white-space: nowrap; z-index: 5; pointer-events: none;
  border-radius: 5px; background: var(--surface-2, var(--surface)); box-shadow: 0 0 0 1px color-mix(in oklab, currentColor 18%, transparent), 0 4px 12px rgba(0, 0, 0, .25); }
.amt.amt-left .amt-f { right: auto; left: -4px; }
.amt.is-open .amt-s { visibility: hidden; }

/* v19.42 — un nom long (famille ou catégorie) ne passe plus sous le champ « Placé » : la ligne du nom garde à droite la
   place de la colonne Placé et le nom va à la ligne s'il le faut ; seuls les points de conduite continuent sous le champ
   jusqu'au chiffre. Le champ ne déborde plus de sa colonne. */
.d-env .env-list { --c2: 96px; --cgap: 10px; --c2-reserve: calc(var(--c2) + var(--cgap)); }
@media (max-width: 420px) { .d-env .env-list { --c2: 80px; --cgap: 8px; } }
.d-env .env-list .env-row:not(.env-total):not(.env-grand) .er-top,
.d-env .env-list .env-row.env-sub .env-sub-name { padding-right: var(--c2-reserve); }
.d-env .env-list .env-row:not(.env-total):not(.env-grand) .er-top::after,
.d-env .env-list .env-row.env-sub .env-sub-name::after { margin-right: calc(-1 * var(--c2-reserve)); }
.d-env .env-list .er-top .env-name { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: break-word; text-align: left; }
.d-env .env-list .env-sub-name { overflow-wrap: break-word; }
.d-env .env-list .env-input, .d-env .env-list .env-row.env-sub .env-input { max-width: var(--c2); }
@supports not (field-sizing: content) { .d-env .env-list .env-input, .d-env .env-list .env-row.env-sub .env-input { width: var(--c2); } }
/* Nom sur plusieurs lignes : le chiffre, l'icône et les points de conduite restent sur la première ligne. */
.d-env .env-list .env-row:not(.env-total):not(.env-grand) .er-top { align-items: flex-start; padding-top: 6px; box-sizing: border-box; }
.d-env .env-list .er-top .env-name { align-items: flex-start; line-height: 22px; }
.d-env .env-list .er-top .env-name .cat-ico { margin-top: 3px; }
.d-env .env-list .er-top .kind-badge { margin-top: 0; align-self: flex-start; }
.d-env .env-list .env-row:not(.env-total):not(.env-grand) .er-top::after { align-self: flex-start; margin-top: 16px; }
.d-env .env-list .env-row.env-sub .env-sub-name { align-items: flex-start; padding-top: 5px; line-height: 20px; box-sizing: border-box; }
.d-env .env-list .env-row.env-sub .env-sub-name::after { align-self: flex-start; margin-top: 14px; }
/* La marge négative des points de conduite ne doit pas rendre de place au nom : leur largeur minimale l'inclut. */
.d-env .env-list .env-row:not(.env-total):not(.env-grand) .er-top::after,
.d-env .env-list .env-row.env-sub .env-sub-name::after { min-width: calc(var(--c2-reserve) + 20px); flex-basis: calc(var(--c2-reserve) + 20px); }
@media (max-width: 600px) {
  .d-env .env-list .env-row:not(.env-total):not(.env-grand) .er-top::after,
  .d-env .env-list .env-row.env-sub .env-sub-name::after { min-width: calc(var(--c2-reserve) + 6px); flex-basis: calc(var(--c2-reserve) + 6px); }
}

/* v19.44 — l'heure d'une transaction n'est pas affichée sur mobile (liste et tableau) ; elle reste sur PC. */
@media (max-width: 699px) { .tx-hour { display: none; } }

/* v19.46 — « Totaux par famille » tient dans l'écran sur mobile : plus de défilement horizontal. Le nom va à la ligne,
   les chiffres sont un peu plus petits et serrés, la dernière colonne s'appelle « Écart » (titre complet au survol). */
.pivot .pv-short { display: none; }
@media (max-width: 699px) {
  .table-wrap:has(> .table.pivot) { overflow-x: visible; }
  .table.pivot { width: 100%; min-width: 0; table-layout: auto; }
  .table.pivot th, .table.pivot td { padding-left: 4px; padding-right: 4px; }
  .table.pivot td:first-child, .table.pivot th:first-child { padding-left: 0; white-space: normal; overflow-wrap: anywhere; }
  .table.pivot td:last-child, .table.pivot th:last-child { padding-right: 0; }
  .table.pivot td.num, .table.pivot th.num { white-space: nowrap; font-size: 13px; }
  .table.pivot .cat-cell { gap: 6px; white-space: normal; min-width: 0; }
  .table.pivot td:first-child, .table.pivot td:first-child * { white-space: normal; }
  .pivot .pv-long { display: none; }
  .pivot .pv-short { display: inline; }
}
@media (max-width: 699px) { .traj-card .table th, .traj-card .table td { padding-left: 3px; padding-right: 3px; } }

/* v19.50 — Réglages : les choix en ligne d'un champ (chèques-repas, « À placer »…) passent à la ligne sur mobile au lieu de
   dépasser de la carte. */
@media (max-width: 699px) { .field .seg { display: flex; flex-wrap: wrap; overflow: visible; max-width: 100%; } .field .seg button { flex: 0 1 auto; } }

/* v19.56 — Pastilles « Réserve », « Épargne », « Cagnotte » : elles suivent le nom comme du texte et passent sous le nom
   quand la place manque, au lieu de le recouvrir. Les points de conduite restent sur la première ligne. */
.d-env .env-list .er-top .er-title { flex: 0 1 auto; min-width: 0; max-width: 100%; line-height: 22px; }
.d-env .env-list .er-top .er-title .env-name { display: inline-flex; vertical-align: top; max-width: 100%; margin-right: 6px; }
.d-env .env-list .er-top .er-title .kind-badge { display: inline-block; vertical-align: top; margin: 1px 0 0; white-space: nowrap; }

/* v19.57 → v19.58 — Accueil › Budgets du mois : à droite ce qui reste (« reste 50 € / 103 € »), sous la barre, au bout
   de la partie remplie, ce qui est dépensé et la part du budget (« 53 € dépensés · 51 % »). La barre, le pourcentage et le
   montant dépensé disent la même chose ; le chiffre de droite est son complément. */
.budgets-mini .bm-btn { grid-template-areas: 'name left' 'bar bar'; }
.budgets-mini .bm-track { grid-area: bar; position: relative; display: block; padding-bottom: 20px; }
.budgets-mini .bm-track .bm-bar { display: block; }
.budgets-mini .bm-pct { position: absolute; top: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1; }
.budgets-mini .bm-pct:not([class*="tone-text"]) { color: var(--ink-2); }
.budgets-mini .bm-pct[class*="tone-text"] { font-weight: 600; }
.budgets-mini .bm-left-lbl { font-weight: 500; }
