/* Mimimondy : palette « Nuit » validée sur la maquette (docs/maquette.html).
   CSS écrit à la main, sans étape de compilation. */

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/static/fonts/fredoka-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/figtree-latin.woff2") format("woff2");
}

:root {
  --bg: #15122c;
  --stage: #0e0c20;
  --card: #221d45;
  --ink: #f4efff;
  --muted: #a79fcb;
  --line: #352e62;
  --soft: #2a2452;
  --gold: #ffc83d;
  --gold-deep: #c98f00;
  --gold-ink: #2a1c00;
  /* Palette des profils (views.Palette) : claires, pour le texte foncé des pastilles. */
  --c-bleu: #6fa8ff;
  --c-rose: #ff7eb0;
  --c-vert: #7fdc6f;
  --c-violet: #b79bff;
  --c-orange: #ff9e4f;
  --c-turquoise: #3fd6d0;
  --c-corail: #ff8466;
  --c-citron: #dcec5a;
  --a: var(--c-bleu);   /* première personne, à gauche */
  --b: var(--c-rose);   /* seconde personne, à droite */
  --ok: #55d79c;
  --ok-soft: #173a31;
  --warn: #ffb54d;
  --warn-soft: #3a2c18;
  --danger: #ff7a7a;
  --danger-soft: #3d1c2a;
  --sky1: #2c2468;
  --sky2: #4c3e93;
  --ground3d: #3e3580;
  --display: "Fredoka", "Avenir Next Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

/* Couleur choisie par chacun (classes de <html>, voir Household.Theme). */
.ca-bleu { --a: var(--c-bleu); } .cb-bleu { --b: var(--c-bleu); } .sw-bleu { --sw: var(--c-bleu); }
.ca-rose { --a: var(--c-rose); } .cb-rose { --b: var(--c-rose); } .sw-rose { --sw: var(--c-rose); }
.ca-vert { --a: var(--c-vert); } .cb-vert { --b: var(--c-vert); } .sw-vert { --sw: var(--c-vert); }
.ca-violet { --a: var(--c-violet); } .cb-violet { --b: var(--c-violet); } .sw-violet { --sw: var(--c-violet); }
.ca-orange { --a: var(--c-orange); } .cb-orange { --b: var(--c-orange); } .sw-orange { --sw: var(--c-orange); }
.ca-turquoise { --a: var(--c-turquoise); } .cb-turquoise { --b: var(--c-turquoise); } .sw-turquoise { --sw: var(--c-turquoise); }
.ca-corail { --a: var(--c-corail); } .cb-corail { --b: var(--c-corail); } .sw-corail { --sw: var(--c-corail); }
.ca-citron { --a: var(--c-citron); } .cb-citron { --b: var(--c-citron); } .sw-citron { --sw: var(--c-citron); }
/* Espaces à plusieurs : la couleur d'un membre sur l'élément qui le
   représente (pastille, nom, écharpe, part) : .p-<couleur> pose --p. */
.p-bleu { --p: var(--c-bleu); } .p-rose { --p: var(--c-rose); } .p-vert { --p: var(--c-vert); } .p-violet { --p: var(--c-violet); }
.p-orange { --p: var(--c-orange); } .p-turquoise { --p: var(--c-turquoise); } .p-corail { --p: var(--c-corail); } .p-citron { --p: var(--c-citron); }
.av-p { background: var(--p); }
.p-name { color: var(--p); font-weight: 800; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; }
code { font-size: .92em; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--muted); margin: 0; }

/* ---------- Marque ---------- */
/* Le logo Cozie (static/brand/cozie/, SVG crème pour le thème sombre). */
.brand-logo { display: block; height: 22px; width: auto; flex: none; }
.brand-logo.big { height: 44px; }

/* ---------- Structure ---------- */
.apphead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { font-family: var(--display); font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.me { display: none; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); font-weight: 700; min-height: 40px; padding: 0 4px; border-radius: 12px; }
.me .ic { width: 22px; height: 22px; }
.me-name { display: none; }
.topnav { display: none; }
.page { padding: 4px 16px calc(120px + var(--safe-b)); display: flex; flex-direction: column; gap: 16px; }
.narrow { width: 100%; max-width: 560px; margin-inline: auto; }
.settings { width: 100%; max-width: 560px; margin-inline: auto; }
.settings-grid { display: flex; flex-direction: column; gap: 18px; }
.stack, .stack-lg { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { gap: 18px; }
.center-page { align-items: center; text-align: center; padding-top: 12vh; gap: 14px; }
.h1 { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.05; margin: 0; }
.h1 small { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.h2 { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 0; display: flex; align-items: center; gap: 8px; }
.h2 .ic { width: 20px; height: 20px; color: var(--gold); }
.pagehead { display: flex; flex-direction: column; gap: 6px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 3px 0 var(--line); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; text-decoration: none; min-height: 40px; }
.back svg { width: 16px; height: 16px; }

/* ---------- Barre d'onglets (téléphone) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
  padding: 8px 10px calc(10px + var(--safe-b));
  background: var(--card); border-top: 2px solid var(--line);
}
.tabbar a, .topnav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 800; color: var(--muted); text-decoration: none; padding: 4px; border-radius: 12px;
}
.tabbar .ic { width: 24px; height: 24px; }
.tabbar a[aria-current], .topnav a[aria-current] { color: var(--ink); }
.tabbar a[aria-current] .ic, .topnav a[aria-current] .ic { color: var(--gold); }
/* « Dépense » au milieu de la barre : un rond doré qui dépasse, à la place
   du bouton flottant (qui recouvrait « Marquer comme réglé »). */
.tabbar .tab-add { color: var(--gold); margin-top: -30px; }
.tab-add-face {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink);
  box-shadow: 0 4px 0 var(--gold-deep), 0 0 0 5px var(--bg);
}
.tabbar .tab-add .ic { width: 26px; height: 26px; }
.tab-add:active .tab-add-face { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-deep), 0 0 0 5px var(--bg); }

/* ---------- Mois ---------- */
.month-grid { display: flex; flex-direction: column; gap: 18px; }
.hero-col, .list-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.monthnav-btns { display: flex; gap: 6px; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--line); background: var(--card);
  display: inline-grid; place-items: center; color: var(--ink); flex: none; text-decoration: none; padding: 0;
}
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn.off { opacity: .35; }

.hero { background: var(--card); border: 2px solid var(--line); border-radius: 26px; box-shadow: 0 4px 0 var(--line); overflow: hidden; }
/* Scène SVG : toutes les coordonnées de trajet sont dans le même viewBox. */
.scene { position: relative; padding: 19px 16px 20px; background: radial-gradient(ellipse at 50% 40%, #39306c, var(--stage)); overflow: hidden; }
.scene-eyebrow { margin: 0; color: var(--muted); text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .17em; }
.balance-stage { display: block; width: 100%; max-width: 460px; height: auto; margin-inline: auto; overflow: hidden; }
.balance-ground { fill: rgba(255, 255, 255, .08); } /* le sol de la scène animée (stage.js) */
.balance-arc { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 2 8; opacity: .2; }
.balance-guide { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scene[data-direction="left"] .balance-guide { transform: translateX(440px) scaleX(-1); }
.balance-even-star { fill: var(--ok); }
.scene:not([data-direction="even"]) .balance-even-star, .scene[data-direction="even"] .balance-guide, .scene[data-direction="even"] .balance-arc { display: none; }
.side-a { --scarf: var(--a); }
.side-b { --scarf: var(--b); }
/* Sprites en pixel art : l'écharpe (4 tons) suit la couleur de profil,
   exactement comme dans la scène animée (atlas.js, tint) : la couleur
   multipliée par les gris de l'atlas (0x73, 0xb3, 0xe0, 0xff). En sRGB, un
   mélange avec du noir est cette multiplication. */
.balance-character .scarf-0 { fill: color-mix(in srgb, var(--scarf) 45.098%, #000); }
.balance-character .scarf-1 { fill: color-mix(in srgb, var(--scarf) 70.196%, #000); }
.balance-character .scarf-2 { fill: color-mix(in srgb, var(--scarf) 87.843%, #000); }
.balance-character .scarf-3 { fill: var(--scarf); }
.balance-names { display: grid; grid-template-columns: 42% 16% 42%; max-width: 460px; margin: -3px auto 0; text-align: center; }
.balance-names span { min-width: 0; }
.balance-names span:last-child { grid-column: 3; }
.balance-names b { display: block; overflow-wrap: anywhere; font-size: 14px; }
.balance-names span:first-child b { color: var(--a); }
.balance-names span:last-child b { color: var(--b); }
.balance-names small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.balance-copy { margin-top: 16px; text-align: center; }
.balance-amount { display: block; color: var(--gold); font-family: var(--display); font-size: clamp(26px, 6vw, 36px); font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.scene[data-direction="even"] .balance-amount { color: var(--ok); }
.balance-sentence { margin: 5px 0 0; font-size: 13px; color: var(--muted); text-wrap: balance; }
/* Scène pixel art (static/pixel.js) : le canvas remplace le dessin fixe, à
   la même taille et au même endroit (même repère 280 × 140, 2:1). */
.pixel-canvas { display: block; width: 100%; max-width: 460px; height: auto; aspect-ratio: 2 / 1; margin-inline: auto; image-rendering: pixelated; }
.scene.pixel-ready .balance-stage { display: none; }
/* Quand la scène animée va prendre le relais (JavaScript actif, animations
   permises), le dessin fixe n'affiche pas la flèche, l'arc ni l'étoile, que
   la scène n'a pas : sinon elles apparaissent un instant au chargement.
   Elles reviennent si la scène n'a pas pu se monter ou s'est arrêtée (pixel-off). */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .scene[data-pixel="balance"]:not(.pixel-off) :is(.balance-guide, .balance-arc, .balance-even-star) { visibility: hidden; }
}

/* Scène à plusieurs (scene_group.templ, assets/pixel/group.js) : de 2 à 4,
   une ligne, repère de 420 × 140, le canvas garde la même proportion que le
   dessin fixe ; de 5 à 8, la photo de classe (en fin de fichier). Écharpe
   de chacun à sa couleur (--p). */
.group-scene .pixel-canvas { aspect-ratio: 3 / 1; }
/* L'écart au-dessus du dessin est porté par sa rangée, pas par le dessin
   fixe (masqué au montage) : le canvas prend exactement sa place. */
.group-row { margin-top: 6px; }
.group-actor { --scarf: var(--p); }
/* Les noms sous les personnages : une colonne par membre, centrée sous ses
   pieds (mêmes écarts que group.js). */
.group-names { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 6px 2px; max-width: 460px; margin: 2px auto 0; padding: 0; list-style: none; text-align: center; }
.group-names li { min-width: 0; }
.group-names b { display: block; color: var(--p); font-size: 14px; overflow-wrap: anywhere; }
.group-names small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.group-names.names-1 { --cols: 1; }
.group-names.names-2 { --cols: 2; padding-inline: 17.6%; }
.group-names.names-3 { --cols: 3; padding-inline: 1.4%; }
.group-names.names-4 { --cols: 4; }
/* Le sens du solde en mots (« à recevoir 96,20 € »), pour les lecteurs d'écran
   seulement : à l'écran, le signe suffit. */
.group-sense { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.balance-amount.is-even { color: var(--ok); }

.tags { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 0; }
.tag { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tag-b { flex-direction: row-reverse; text-align: right; }
.tag b { display: block; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }
.tag small { color: var(--muted); font-size: 12px; }
.verdict { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.verdict-title { font-family: var(--display); font-weight: 600; font-size: 25px; line-height: 1.15; margin: 0; text-wrap: balance; }
.verdict-title em { font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt-a { color: var(--a); } .amt-b { color: var(--b); } .amt-ok { color: var(--ok); }
.verdict-sub { margin: 0; color: var(--muted); font-size: 14px; }

.av {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 800; color: var(--gold-ink); border: 2.5px solid var(--card);
}
.av-a { background: var(--a); } .av-b { background: var(--b); }
.av-lg { width: 56px; height: 56px; font-size: 18px; }

.housestrip {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 12px 14px; box-shadow: 0 3px 0 var(--line);
}
.housestrip .ic-wrap { width: 40px; height: 40px; border-radius: 13px; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; flex: none; }
.housestrip .ic-wrap svg { width: 21px; height: 21px; }
.housestrip b { display: block; font-weight: 800; font-size: 14px; }
.housestrip small { color: var(--muted); font-size: 12.5px; }
.housestrip .chev { width: 16px; height: 16px; margin-left: auto; color: var(--muted); flex: none; }

.sect-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 4px 2px -4px; }
.sect-h h2 { font-family: var(--display); font-weight: 600; font-size: 20px; margin: 0; }
.sect-h span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.day { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; margin: 6px 4px -6px; }
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 2px solid var(--line); border-radius: 20px; overflow: hidden; }
.list li + li { border-top: 2px solid var(--soft); }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none; min-height: 60px; }
.row:active { background: var(--soft); }
.cat { width: 38px; height: 38px; border-radius: 13px; background: var(--soft); display: grid; place-items: center; flex: none; color: var(--ink); }
.cat svg { width: 19px; height: 19px; }
.row-closing .cat { background: var(--ok-soft); color: var(--ok); }
.row-carry .cat { background: var(--warn-soft); color: var(--warn); }
.row-off { opacity: .55; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-label { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 12.5px; color: var(--muted); }
.row-meta .chip { margin-left: 4px; vertical-align: 1px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: 0; }
.dot-a { background: var(--a); } .dot-b { background: var(--b); } .dot-p { background: var(--p); }
.row-amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.row-amt small { display: block; font-weight: 600; font-size: 11.5px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.chip svg { width: 11px; height: 11px; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.empty { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.empty p { margin: 0; }

/* ---------- Boutons ---------- */
.btn {
  border: 0; border-radius: 16px; padding: 13px 18px; font-weight: 800; font-size: 15.5px; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .08s, box-shadow .08s;
}
.btn svg { width: 17px; height: 17px; }
.btn.gold { background: var(--gold); color: var(--gold-ink); box-shadow: 0 4px 0 var(--gold-deep); }
.btn.gold:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-deep); }
.btn.ghost { background: var(--card); border: 2px solid var(--line); color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border: 2px solid transparent; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; } /* envoi en cours (static/app.js) */
.fab { display: none; position: fixed; z-index: 21; } /* ordinateur seulement : sur téléphone, « Dépense » est dans la barre */

/* ---------- Maison ---------- */
.house-grid { display: flex; flex-direction: column; gap: 18px; }
.summary { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.kpi b { font-family: var(--display); font-weight: 700; font-size: 25px; font-variant-numeric: tabular-nums; }
/* Barre à deux couleurs : la part de A (valeur) sur fond de B. Un <progress>
   plutôt qu'un style="width:…" : la Content-Security-Policy interdit les styles en ligne. */
.splitbar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 12px; border: 0; border-radius: 999px; overflow: hidden; background: var(--b); }
.splitbar::-webkit-progress-bar { background: var(--b); border-radius: 999px; }
.splitbar::-webkit-progress-value { background: var(--a); }
.splitbar::-moz-progress-bar { background: var(--a); }
.splitlegend { display: flex; justify-content: space-between; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 6px; gap: 8px; }
.splitlegend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; padding: 0 4px; margin: 0; }
.hint svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--gold); }
.nextgen { display: flex; align-items: center; gap: 10px; background: var(--warn-soft); color: var(--warn); border-radius: 16px; padding: 11px 14px; font-size: 13px; font-weight: 700; margin: 0; }
.nextgen svg { width: 16px; height: 16px; flex: none; }
.stopped summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 8px 4px; }
.stopped .list { margin-top: 8px; }
/* Maison à plusieurs : ce que chacun avance (pastille, nom, montant). */
.advances { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.advances li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.advances .av { width: 28px; height: 28px; font-size: 11px; border-width: 2px; }
.advances .advance-who { flex: 1; min-width: 0; color: var(--muted); }
.advances b { font-variant-numeric: tabular-nums; }

/* ---------- Les mois ---------- */
.monthcard { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.monthcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.monthcard-head b { font-family: var(--display); font-weight: 600; font-size: 19px; }
.monthcard .tot { font-weight: 800; font-variant-numeric: tabular-nums; }
.monthcard-res { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.monthcard.current { border-color: var(--gold); box-shadow: 0 3px 0 var(--gold-deep); }

/* ---------- Formulaires ---------- */
.form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.amount { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 4px 0 2px; }
.amount-input { border: 0; background: transparent; font-family: var(--display); font-weight: 700; font-size: 50px; width: 5.6ch; text-align: right; font-variant-numeric: tabular-nums; padding: 0; min-width: 0; }
.amount-input::placeholder { color: var(--line); }
.amount-input:focus { outline: none; }
.amount span { font-family: var(--display); font-size: 32px; font-weight: 600; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .fs legend { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.text { border: 2px solid var(--line); background: var(--bg); border-radius: 14px; padding: 11px 12px; min-height: 46px; width: 100%; font-size: 16px; }
.text:focus { border-color: var(--a); outline: none; }
.text[aria-invalid="true"] { border-color: var(--danger); }
.fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.fs legend { padding: 0; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick > span { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 700; color: var(--muted); background: var(--bg); min-height: 38px; }
.pick > span svg { width: 14px; height: 14px; }
.pick input:checked + span { background: var(--ink); color: var(--card); border-color: var(--ink); }
.pick input:focus-visible + span { outline: 3px solid var(--a); outline-offset: 2px; }
.pick-a input:checked + span { background: var(--a); border-color: var(--a); color: var(--gold-ink); }
.pick-b input:checked + span { background: var(--b); border-color: var(--b); color: var(--gold-ink); }
/* Une personne (espaces à plusieurs) : sa couleur quand elle est cochée. */
.pick.p input:checked + span { background: var(--p); border-color: var(--p); color: var(--gold-ink); }
/* « Tout pour … » : le nom de l'autre, selon qui a payé (sans JavaScript). */
.for-b { display: none; }
form:has(input[name="payer"][value="b"]:checked) .for-a { display: none; }
form:has(input[name="payer"][value="b"]:checked) .for-b { display: inline; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--warn-soft); color: var(--warn); border-radius: 16px; padding: 12px 14px; font-weight: 800; font-size: 14px; cursor: pointer; }
.toggle span { display: flex; align-items: center; gap: 8px; }
.toggle svg { width: 15px; height: 15px; }
.toggle input { -webkit-appearance: none; appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked { background: var(--warn); }
.toggle input:checked::after { transform: translateX(18px); }
/* Les options de récurrence n'apparaissent que si l'interrupteur est coché. */
.recur { display: none; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.toggle:has(input:checked) + .recur, .recur-always { display: flex; }
.recur select { border: 2px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 10px; min-height: 42px; font-size: 15px; }
.recur .hint { width: 100%; padding: 0; }
/* Mot de passe : le bouton « afficher », dans le champ. */
.pw { position: relative; display: block; }
.pw .text { padding-right: 52px; }
.pw-toggle { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle[aria-pressed="true"] { color: var(--ink); }
/* Couleur du profil : une pastille par couleur, celle de l'autre est grisée. */
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span { width: 44px; height: 44px; border-radius: 50%; background: var(--sw); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--line); }
.character-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .character-choices { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.character-choice { position: relative; cursor: pointer; min-width: 0; }
.character-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.character-choice > span { display: flex; align-items: center; flex-direction: column; gap: 4px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 18px; background: var(--bg); font-weight: 700; height: 100%; }
.character-choice small { font-size: 12px; font-weight: 700; }
.character-choice:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.character-preview { display: block; width: 100%; max-width: 112px; height: auto; aspect-ratio: 180 / 160; }
.character-choice input:checked + span { border-color: var(--gold); background: var(--soft); }
.character-choice input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.swatch small { font-size: 12px; font-weight: 700; color: var(--muted); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.swatch input:checked ~ small { color: var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 3px; }
.swatch:has(input:disabled) { opacity: .3; cursor: not-allowed; }
/* Réglages : l'écharpe des aperçus suit la couleur cochée, avant même
   d'enregistrer (sans :has, elle garde la couleur enregistrée). */
.profile-form:has(input[name="color"][value="bleu"]:checked) .character-preview { --scarf: var(--c-bleu); }
.profile-form:has(input[name="color"][value="rose"]:checked) .character-preview { --scarf: var(--c-rose); }
.profile-form:has(input[name="color"][value="vert"]:checked) .character-preview { --scarf: var(--c-vert); }
.profile-form:has(input[name="color"][value="violet"]:checked) .character-preview { --scarf: var(--c-violet); }
.profile-form:has(input[name="color"][value="orange"]:checked) .character-preview { --scarf: var(--c-orange); }
.profile-form:has(input[name="color"][value="turquoise"]:checked) .character-preview { --scarf: var(--c-turquoise); }
.profile-form:has(input[name="color"][value="corail"]:checked) .character-preview { --scarf: var(--c-corail); }
.profile-form:has(input[name="color"][value="citron"]:checked) .character-preview { --scarf: var(--c-citron); }
.note.ok { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.err { color: var(--danger); font-size: 13px; font-weight: 700; margin: -6px 0 0; }
.alert { background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 10px 12px; font-weight: 700; margin: 0; }
.note { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--muted); margin: 0; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note a { color: var(--ink); font-weight: 700; }
/* Les parts pondérées d'une Maison (charte : ScreenWeights). La barre est un
   SVG dont les largeurs sont des attributs (pas de style en ligne : CSP). */
.weights { width: 100%; max-width: 560px; margin-inline: auto; }
.weights-card { overflow: hidden; }
.weights-form:has(input[name="mode"][value="egal"]:checked) .weights-card { display: none; }
.stackbar-wrap { padding: 14px 14px 4px; }
.stackbar { display: block; width: 100%; height: 14px; border-radius: 7px; background: var(--soft); }
.stackbar rect { fill: var(--p); }
.share { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 2px solid var(--soft); }
.stackbar-wrap + .share { border-top: 0; }
.share-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.share-main small { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.share-pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.pct { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--muted); }
.pct .text { width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 2px solid var(--soft); font-weight: 800; }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.hint svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--gold); }
.character-preview.scarf-p { --scarf: var(--p); }
.big-amount { font-family: var(--display); font-size: 36px; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.login { padding-top: 12vh; gap: 22px; }
.login-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
/* Comptes (charte : ScreenLogin, ScreenSignup). « Continuer avec Google » :
   bouton neutre ; provider-slot garde la place du logo officiel de Google,
   à reprendre tel quel de ses consignes de marque, jamais redessiné. */
.btn.provider { background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.provider-slot { width: 18px; height: 18px; border-radius: 4px; border: 1.5px dashed var(--muted); flex: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; margin: 0; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.linkline { text-align: center; font-size: 14px; color: var(--muted); margin: 0; }
.linkline a { color: var(--ink); font-weight: 800; }
.email-state { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; overflow-wrap: anywhere; }

/* ---------- Espaces : sélecteur, nouvel espace, invitations ---------- */
/* Le nom de l'espace dans l'en-tête : un long nom se coupe avec « … ». */
.spacebtn { min-height: 40px; padding: 5px 12px; font-size: 14.5px; min-width: 0; max-width: 62%; flex: 0 1 auto; gap: 7px; }
.spacebtn svg { flex: none; }
.spacebtn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 3px 0 var(--line); text-decoration: none;
}
.space[aria-current] { border-color: var(--gold); box-shadow: 0 3px 0 var(--gold-deep); }
.space-main { flex: 1; min-width: 0; }
.space b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space small { display: block; color: var(--muted); font-size: 12.5px; }
.avs { display: flex; flex: none; }
.avs .av + .av { margin-left: -9px; }
.av-more { background: var(--soft); color: var(--muted); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { position: relative; cursor: pointer; min-width: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice > span { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 2px solid var(--line); border-radius: 18px; background: var(--bg); height: 100%; }
.choice b { font-family: var(--display); font-weight: 600; font-size: 19px; }
.choice small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.choice .ic { width: 26px; height: 26px; color: var(--muted); }
.choice input:checked + span { border-color: var(--gold); background: var(--soft); box-shadow: 0 3px 0 var(--gold-deep); }
.choice input:checked + span .ic { color: var(--gold); }
.choice input:focus-visible + span { outline: 3px solid var(--a); outline-offset: 3px; }
.choice-off { cursor: not-allowed; opacity: .6; }
.choice b .chip { margin-left: 4px; vertical-align: 2px; font-family: var(--body); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.invite-link { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 2px dashed var(--line); border-radius: 14px; padding: 10px 10px 10px 12px; }
.invite-link span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; user-select: all; -webkit-user-select: all; }
.invite-link .btn { min-height: 38px; padding: 6px 12px; flex: none; }

/* ---------- Feuilles (dialog natif) ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh;
  background: var(--card); color: var(--ink); border-radius: 28px 28px 0 0; overflow-y: auto; overscroll-behavior: contain;
}
dialog.sheet::backdrop { background: rgba(8, 5, 20, .6); }
dialog.sheet[open] { animation: sheet-in .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet-body { padding: 14px 18px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-family: var(--display); font-weight: 700; font-size: 23px; margin: 0; }
.transfer { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 0; }
.transfer .arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--display); font-weight: 700; font-size: 23px; font-variant-numeric: tabular-nums; }
.transfer .arrow svg { width: 70px; height: 14px; color: var(--muted); }
.explain { margin: 0; color: var(--muted); font-size: 14px; text-align: center; text-wrap: balance; }
/* Équilibrer à plusieurs (charte : ScreenTripClose) : un virement par ligne,
   « C'est fait » le coche ; l'avancement en <progress> (pas de style en ligne). */
.xfer { display: flex; align-items: center; gap: 10px; padding: 11px 14px; min-height: 60px; }
.xfer-who { display: flex; align-items: center; gap: 2px; flex: none; color: var(--muted); }
.xfer-who svg { width: 16px; height: 16px; }
.xfer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xfer-main b { font-weight: 800; font-variant-numeric: tabular-nums; }
.xfer-main small { font-size: 12.5px; color: var(--muted); }
.xfer.done { opacity: .7; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 12px; }
.progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: var(--soft); }
.progress::-webkit-progress-bar { background: var(--soft); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--ok); }
.progress::-moz-progress-bar { background: var(--ok); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(96px + var(--safe-b)); z-index: 40; margin: 0 auto; max-width: 480px;
  background: var(--ink); color: var(--bg); border-radius: 16px; padding: 12px 14px; font-size: 14px; font-weight: 700;
}

/* ---------- Ordinateur : pleine largeur, navigation en haut ---------- */
@media (min-width: 900px) {
  .apphead { padding: 14px 32px; }
  .topnav { display: flex; gap: 6px; }
  .topnav a { flex-direction: row; gap: 8px; font-size: 14.5px; padding: 8px 14px; }
  .topnav .ic { width: 20px; height: 20px; }
  .topnav a[aria-current] { background: var(--card); }
  .spacebtn { max-width: 320px; }
  .me { display: flex; }
  .me-name { display: inline; }
  .tabbar { display: none; }
  .page { padding: 12px 32px 48px; }
  .fab { display: inline-flex; bottom: 32px; right: 32px; }
  .toast { bottom: 32px; }
  .month-grid { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .hero-col { position: sticky; top: 80px; }
  .scene { padding-top: 22px; }
  .house-grid { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .settings { max-width: 1120px; }
  .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  dialog.sheet { margin: auto; border-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open] { animation: none; }
  .btn { transition: none; }
}

/* ---------- Clôture (agent K) ---------- */
/* Le voyage clôturé : virements, soldes, « Rouvrir le voyage ». Même rythme que .hero-col. */
.trip-closing { display: flex; flex-direction: column; gap: 14px; }
.trip-closing .xfer form { flex: none; }
.trip-closed-by { margin: 0; text-align: center; font-size: 13px; }

/* Nouvel espace : en Vacances, les dates et « Créer le voyage » (sans script).
   Sans :has(), les dates restent visibles (une Maison les ignore) et le
   bouton garde « Créer la maison ». */
.new-space .for-trip { display: none; }
@supports selector(:has(*)) {
  .new-space .trip-dates { display: none; }
  .new-space:has(input[name="kind"][value="vacances"]:checked) .trip-dates { display: flex; }
  .new-space:has(input[name="kind"][value="vacances"]:checked) .for-trip { display: inline; }
  .new-space:has(input[name="kind"][value="vacances"]:checked) .for-maison { display: none; }
}

/* ---------- Voyage (agent V) ---------- */
/* Trois onglets (Voyage · Dépense · Réglages) : « Dépense » reste au milieu. */
.tabbar.tabbar-trip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trip-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 14px; }

/* ---------- Devises (agent F) ---------- */
/* Le montant d'une dépense de voyage : le nombre et sa devise côte à côte,
   l'aperçu en euros dessous, puis « Débité en euros ». */
.fx { display: flex; flex-direction: column; gap: 10px; }
.fx-amount { align-items: center; }
.fx-currency {
  border: 2px solid var(--line); background: var(--bg); border-radius: 14px; padding: 6px 10px; min-height: 46px;
  font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.fx-currency:focus { border-color: var(--a); outline: none; color: var(--ink); }
.fx-preview { margin: -4px 0 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.fx-debited { display: flex; flex-direction: column; gap: 8px; }
.fx-debited[hidden] { display: none; }
.fx-debited .hint { padding: 0; }

/* ---------- Scène photo de classe (agent S) ---------- */
/* De 5 à 8 membres (scene_group.templ, assets/pixel/group.js) : deux
   rangées de bustes derrière un comptoir, chacune un repère de 280 × 91
   (son dessin fixe, puis son canvas) et ses noms dessous. Une rangée prend
   la plus grande largeur qui tombe juste en pixels physiques,
   280 × k / devicePixelRatio avec k entier : un pas par densité d'écran
   (--pixel-step). Le canvas (backingSize, integer) dessine alors chaque
   pixel d'art sur k × k pixels de l'écran, comme le dessin fixe qu'il
   remplace.
   Densités : celles des téléphones et des écrans courants, et les zooms
   courants de Chrome sur ces écrans (110 % à densité 1 et 2 : 1,1 et 2,2 ;
   90 % et 80 % : 1,8 et 1,6…). Chrome compare la densité en flottant
   32 bits : 1.1dppx reconnaît le 1,100000023… de son zoom à 110 %.
   Limite : une densité non listée (autre zoom ; Firefox, dont le zoom donne
   des densités comme 60/55) garde --pixel-step à 1px : la rangée a une
   largeur au pixel CSS près, et le canvas le facteur entier le plus proche,
   légèrement étiré au plus proche voisin (un peu moins net, rien ne bouge). */
.group-scene[data-layout="photo"] { --pixel-step: 1px; }
@media (resolution: .75dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / .75); } }
@media (resolution: .8dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / .8); } }
@media (resolution: .9dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / .9); } }
@media (resolution: 1dppx) { .group-scene[data-layout="photo"] { --pixel-step: 280px; } }
@media (resolution: 1.1dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.1); } }
@media (resolution: 1.2dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.2); } }
@media (resolution: 1.25dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.25); } }
@media (resolution: 1.375dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.375); } }
@media (resolution: 1.5dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.5); } }
@media (resolution: 1.6dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.6); } }
@media (resolution: 1.65dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.65); } }
@media (resolution: 1.75dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.75); } }
@media (resolution: 1.8dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 1.8); } }
@media (resolution: 2dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 2); } }
@media (resolution: 2.2dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 2.2); } }
@media (resolution: 2.25dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 2.25); } }
@media (resolution: 2.4dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 2.4); } }
@media (resolution: 2.5dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 2.5); } }
@media (resolution: 2.6dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 2.6); } }
@media (resolution: 2.625dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 2.625); } }
@media (resolution: 2.75dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 2.75); } }
@media (resolution: 3dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 3); } }
@media (resolution: 3.3dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 3.3); } }
@media (resolution: 3.5dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 3.5); } }
@media (resolution: 4dppx) { .group-scene[data-layout="photo"] { --pixel-step: calc(280px / 4); } }
/* La largeur d'une rangée : le plus grand multiple du pas qui tient dans la
   carte (460 au plus). Si c'est moins de 280 pixels CSS (téléphone de 320
   de large : 252 de place), la rangée peut prendre sur la marge intérieure
   de la scène (16 pixels de chaque côté, .scene) jusqu'au multiple le plus
   proche de 280 (281 : une marge pour les arrondis du pas) : 280 à 320 de
   large, en densité 1 comme en densité 2. Et jamais moins d'un pas (k = 1),
   même sur un écran plus étroit encore (la scène coupe alors les bords).
   Sans round() (navigateur ancien), la ligne de repli : toute la largeur. */
.group-scene[data-layout="photo"] .group-row { width: min(100%, 460px); max-width: 460px; margin-inline: auto; }
@supports (width: round(down, 1px, 1px)) {
  .group-scene[data-layout="photo"] .group-row {
    --row-width: max(var(--pixel-step), round(down, min(100%, 460px), var(--pixel-step)), min(round(down, 100% + 32px, var(--pixel-step)), round(down, 281px, var(--pixel-step))));
    width: var(--row-width);
    margin-inline: calc((100% - var(--row-width)) / 2);
  }
}
.group-scene[data-layout="photo"] .group-row + .group-row { margin-top: 12px; }
.group-scene[data-layout="photo"] .pixel-canvas { max-width: none; aspect-ratio: 280 / 91; }
/* Les noms d'une rangée : une colonne par case (photoColumns), alignée sur
   les bustes : photo-<cases par rangée>-<membres de la rangée>, la marge
   étant le bord de la première case (6, 51 ou 39 pixels sur 280).
   Un prénom trop long se coupe à ses espaces et traits d'union
   (« Marie- / Charlotte »), jamais au milieu d'un mot : un mot qui ne tient
   pas finit par « … » (le nom complet reste dans le texte, lu par les
   lecteurs d'écran). Le solde reste sur une ligne ; en 4 colonnes (66
   pixels à 280 de large), un corps plus petit pour « −12 345,67 € ». */
.group-names.photo-names { max-width: none; margin-top: 4px; }
.photo-names b { font-size: 12.5px; overflow: hidden; overflow-wrap: normal; text-overflow: ellipsis; }
.photo-names small { font-size: 10.5px; white-space: nowrap; }
.group-names.photo-3-3 { --cols: 3; padding-inline: 2.143%; }
.group-names.photo-3-2 { --cols: 2; padding-inline: 18.214%; }
.group-names.photo-4-4 { --cols: 4; padding-inline: 2.143%; }
.group-names.photo-4-3 { --cols: 3; padding-inline: 13.929%; }
.photo-4-4 b, .photo-4-3 b { font-size: 12px; }
.photo-4-4 small, .photo-4-3 small { font-size: 9.5px; }

/* ---------- Corrections du voyage (agent X) ---------- */
/* Voyage clôturé : « Dépense » reste au milieu de la barre, éteint (un
   <span aria-disabled>, sans lien). */
.tabbar span.tab-add {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 800; padding: 4px; color: var(--muted); cursor: not-allowed;
}
.tabbar span.tab-add .tab-add-face { background: var(--line); color: var(--muted); box-shadow: 0 0 0 5px var(--bg); }
.tabbar span.tab-add:active .tab-add-face { transform: none; box-shadow: 0 0 0 5px var(--bg); }

/* ---------- Installer l'app (InstallApp) ---------- */
.install { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.install-login { margin-top: 22px; }
.install-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; }
.install-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.install .h2 { margin: 0; }
.install p { margin: 0; }
.install-share { width: 18px; height: 18px; vertical-align: -3px; }
.install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.linkbtn { padding: 6px 0; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
