/* Coffre — direction « Coffre de famille » (voir DESIGN.md) : acier vert bouteille, plaque de laiton, registre relié. */
:root {
  --fond: #f2f0e9; --carte: #fffefa; --carte-2: #f8f6f0; --texte: #18211c; --doux: #56605a; --trait: #e2ded3; --trait-fort: #cfcabd;
  --accent: #1f5642; --accent-clair: #e3eee8; --sur-accent: #ffffff;
  --laiton: #7a5a12; --laiton-plaque: #d8b466; --laiton-clair: #f5ecd6;
  --plaque: #17392d; --plaque-2: #1f4a3a; --plaque-texte: #ffffff; --plaque-doux: #c3d3ca;
  --vert: #1c6b43; --rouge: #a33a2a; --ambre: #7a5a12;
  --ombre: 0 1px 0 rgba(40, 50, 40, .04), 0 1px 3px rgba(40, 50, 40, .06), 0 8px 24px -12px rgba(40, 50, 40, .14);
  --ombre-flotte: 0 12px 32px -8px rgba(20, 30, 25, .24), 0 2px 6px rgba(20, 30, 25, .08);
  --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --r-sm: 8px; --r-md: 12px; --rayon: 16px; --r-xl: 22px;
  --d-etat: 120ms; --d-entree: 240ms; --courbe: cubic-bezier(.2, 0, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #101412; --carte: #1a201d; --carte-2: #151a18; --texte: #e9edea; --doux: #a2aba5; --trait: #2a322e; --trait-fort: #3a443f;
    --accent: #8fd1b3; --accent-clair: #1f3229; --sur-accent: #0e1712;
    --laiton: #e0c07a; --laiton-plaque: #d8b466; --laiton-clair: #2e2814;
    --plaque: #1b3f32; --plaque-2: #22503f; --plaque-texte: #ffffff; --plaque-doux: #c3d3ca;
    --vert: #79d3a3; --rouge: #ff9b88; --ambre: #e0c07a;
    --ombre: 0 0 0 1px rgba(255, 255, 255, .04);
    --ombre-flotte: 0 0 0 1px rgba(255, 255, 255, .07), 0 16px 40px -8px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
body { font: 16px/1.45 var(--police); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; -webkit-user-select: none; user-select: none; }
input, select { -webkit-user-select: text; user-select: text; font: inherit; color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::placeholder { color: var(--doux); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.doux { color: var(--doux); }
.petit { font-size: 13px; }
.vert { color: var(--vert); }
.rouge { color: var(--rouge); }
em.vert, em.rouge { font-style: normal; font-weight: 600; }

/* ---------- connexion ---------- */
#v-code { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.code-boite { text-align: center; width: 100%; max-width: 340px; }
.code-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--ombre); }
.code-boite h1 { margin: 16px 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.connexion { margin: 28px 0 8px; overflow: hidden; text-align: left; }
.connexion input { display: block; width: 100%; height: 54px; border: 0; padding: 0 16px; font-size: 17px; background: none; outline: none; }
.connexion input:focus-visible { outline: none; background: var(--carte-2); }
.connexion input + input { border-top: 1px solid var(--trait); }
.code-err { min-height: 20px; color: var(--rouge); font-size: 14px; margin: 0 0 14px; }
.btn-principal.large { width: 100%; margin-bottom: 14px; }
.deconnexion { display: block; margin: 32px auto 0; color: var(--rouge); font-size: 15px; font-weight: 500; min-height: 44px; padding: 10px 16px; }
.deconnexion.confirme { font-weight: 700; }

/* ---------- structure ---------- */
#v-app { padding: 0 16px calc(104px + env(safe-area-inset-bottom, 0px)); max-width: 640px; margin: 0 auto; }
.onglet { padding-top: calc(8px + env(safe-area-inset-top, 0px)); animation: entre var(--d-entree) var(--courbe); }
@keyframes entre { from { opacity: 0; transform: translateY(6px); } }
.haut { padding: 8px 2px 4px; }
.salut { margin: 8px 0 12px; font-size: 15px; font-weight: 600; color: var(--laiton); letter-spacing: .02em; }
.haut-titre h1 { margin: 14px 2px 14px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); }
.titre-sec { margin: 32px 4px 10px; font-size: 17px; font-weight: 650; color: var(--texte); }

/* ---------- la plaque du coffre (signature) ---------- */
.plaque {
  position: relative; display: grid; padding: 22px 26px 20px; border-radius: var(--rayon); color: var(--plaque-texte);
  background: linear-gradient(160deg, var(--plaque-2), var(--plaque) 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), var(--ombre);
}
.plaque::before { content: ""; position: absolute; inset: 7px; border: 1px solid color-mix(in srgb, var(--laiton-plaque) 55%, transparent); border-radius: 11px; pointer-events: none; }
.rivet { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f4dea0, var(--laiton-plaque) 55%, #8a6a24); box-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.r1 { top: 13px; left: 13px; } .r2 { top: 13px; right: 13px; } .r3 { bottom: 13px; left: 13px; } .r4 { bottom: 13px; right: 13px; }
.plaque-lib { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--laiton-plaque); }
.plaque-val { font-size: clamp(32px, 10vw, 40px); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 2px; white-space: nowrap; }
.plaque-autres { font-size: 17px; font-weight: 600; color: var(--plaque-texte); min-height: 4px; font-variant-numeric: tabular-nums; }
.plaque-det { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 13px; color: var(--plaque-doux); font-variant-numeric: tabular-nums; }

/* ---------- à rendre au coffre ---------- */
.a-rendre { margin-top: 12px; padding: 4px 16px; }
.ar-tete, .ar-pied { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; font-variant-numeric: tabular-nums; }
.ar-tete span { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--laiton); }
.ar-tete b { font-size: 17px; color: var(--laiton); white-space: nowrap; }
.ar-bloc { border-top: 1px solid var(--trait); cursor: pointer; transition: background var(--d-etat); }
.ar-bloc.moi { margin: 0 -16px; padding: 0 16px; background: var(--laiton-clair); }
.bilan .ar-bloc.moi { margin: 0 -20px; padding: 0 20px; }
.ar-bloc:active { background: var(--carte-2); }
@media (hover: hover) { .ar-bloc:not(.moi):hover { background: var(--carte-2); } }
.ar-ligne { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; font-variant-numeric: tabular-nums; }
.chevron { color: var(--doux); font-size: 20px; line-height: 1; margin-left: -4px; }
.ar-detail { display: grid; gap: 2px; padding: 0 0 10px 44px; font-size: 14px; color: var(--doux); font-variant-numeric: tabular-nums; }
.ar-detail div { display: flex; justify-content: space-between; gap: 12px; min-height: 24px; align-items: baseline; }
.ar-detail span:last-child { white-space: nowrap; color: var(--texte); font-weight: 600; margin-right: 14px; }
.ar-detail small { font-size: 12px; }
.ar-ligne .av { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.ar-ligne .milieu { flex: 1; min-width: 0; }
.ar-ligne .nom { display: block; font-weight: 600; }
.ar-ligne .sous { display: block; font-size: 13px; color: var(--doux); }
.ar-ligne b { font-weight: 700; white-space: nowrap; }
.ar-bloc.moi .nom::after { content: " · toi"; font-weight: 500; color: var(--doux); }
.ar-pied { border-top: 1px solid var(--trait); font-size: 14px; color: var(--doux); }
.ar-pied b { color: var(--texte); font-size: 15px; white-space: nowrap; }
.ar-vide { padding: 16px 0; color: var(--doux); font-size: 15px; text-align: center; }

/* ---------- segment ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: color-mix(in srgb, var(--trait) 70%, var(--fond)); border-radius: var(--r-md); padding: 4px; margin: 20px 0 12px; }
.seg button { min-height: 44px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--doux); transition: background var(--d-etat), color var(--d-etat); }
.seg button.actif { background: var(--carte); color: var(--texte); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 8px -2px rgba(0, 0, 0, .1); }
.seg button[data-sens="sortie"].actif, .seg [data-s="sortie"].actif { color: var(--rouge); }
.seg button[data-sens="entree"].actif, .seg [data-s="entree"].actif { color: var(--vert); }
.petit-seg { margin: 0; }

/* ---------- formulaire ---------- */
.formulaire { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.champ, .champ-montant { display: block; min-width: 0; }
.lib { display: block; font-size: 13px; font-weight: 600; color: var(--doux); margin-bottom: 8px; }
.lib em { font-weight: 400; font-style: normal; }
.champ input, .ac input {
  width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; height: 50px; padding: 0 14px; border-radius: var(--r-md); border: 1.5px solid var(--trait);
  background: var(--carte-2); font-size: 17px; outline: none; transition: border-color var(--d-etat), background var(--d-etat), box-shadow var(--d-etat);
}
.champ input:focus, .ac input:focus { border-color: var(--accent); background: var(--carte); box-shadow: 0 0 0 4px var(--accent-clair); }
.montant-ligne { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--trait); padding-bottom: 6px; transition: border-color var(--d-etat); }
.montant-ligne:focus-within { border-color: var(--accent); }
#s-montant, .f-montant { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 44px; font-weight: 700; letter-spacing: -.03em; padding: 0; height: auto; font-variant-numeric: tabular-nums; }
.formulaire:not(.entree) #s-montant { color: var(--rouge); }
.formulaire.entree #s-montant { color: var(--vert); }
.devises { display: flex; flex: none; background: color-mix(in srgb, var(--trait) 70%, var(--fond)); border-radius: 10px; padding: 3px; }
.dev { min-width: 44px; min-height: 44px; border-radius: 8px; font-size: 15px; font-weight: 700; color: var(--doux); }
.dev.actif { background: var(--carte); color: var(--texte); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
#e-dev { flex: none; height: 44px; border-radius: 10px; border: 1.5px solid var(--trait); background: var(--carte-2); padding: 0 10px; font-size: 17px; font-weight: 700; }

/* autocomplétion */
.ac { position: relative; }
.ac input { padding-right: 48px; }
.ac-x { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; color: var(--doux); font-size: 20px; line-height: 44px; }
.ac-liste { list-style: none; margin: 6px 0 0; padding: 4px; border-radius: var(--r-md); background: var(--carte); border: 1px solid var(--trait); box-shadow: var(--ombre-flotte); max-height: 248px; overflow-y: auto; }
.ac-liste li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 10px 12px; border-radius: 9px; font-size: 17px; }
.ac-liste li.sel, .ac-liste li:active { background: var(--accent-clair); }
.ac-liste li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-liste li b { color: var(--accent); font-weight: 700; }
.ac-liste li small { color: var(--doux); font-size: 13px; }
.ac-liste li.nouveau { color: var(--accent); font-weight: 600; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.puces:empty { display: none; }
.puce { min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--accent-clair); color: var(--accent); font-size: 15px; font-weight: 600; transition: transform var(--d-etat); }
.puce:active { transform: scale(.96); }

/* dates */
.dates { display: flex; gap: 8px; flex-wrap: wrap; }
.puce-date { position: relative; min-height: 46px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: var(--r-md); border: 1.5px solid var(--trait); background: var(--carte); font-size: 15px; font-weight: 500; overflow: hidden; transition: border-color var(--d-etat), background var(--d-etat); }
.puce-date.actif { border-color: var(--accent); background: var(--accent-clair); color: var(--accent); font-weight: 600; }
.puce-date.autre input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; }

/* à rendre : interrupteur */
.rendre { display: grid; gap: 14px; padding: 14px; margin: 0 -4px; border-radius: var(--r-md); background: var(--carte-2); border: 1px solid var(--trait); }
.bascule { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.b-txt { flex: 1; font-weight: 600; }
.b-int { flex: none; position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--trait-fort); transition: background var(--d-etat); }
.b-int::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform var(--d-entree) var(--courbe); }
.bascule input:checked ~ .b-int { background: var(--laiton); }
.bascule input:checked ~ .b-int::after { transform: translateX(20px); }
.bascule input:focus-visible ~ .b-int { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-principal { min-height: 54px; border-radius: var(--r-md); background: var(--accent); color: var(--sur-accent); font-size: 17px; font-weight: 650; transition: opacity var(--d-etat), transform .08s; }
.btn-principal:disabled { opacity: .38; }
.btn-principal:not(:disabled):active { transform: scale(.98); }
.btn-danger { min-height: 50px; border-radius: var(--r-md); color: var(--rouge); font-weight: 600; background: var(--carte); border: 1.5px solid var(--trait); }
.btn-danger.confirme { background: var(--rouge); border-color: var(--rouge); color: var(--carte); }
.btn-second { min-height: 48px; padding: 0 16px; border-radius: var(--r-md); background: var(--carte); box-shadow: var(--ombre); color: var(--accent); font-weight: 600; font-size: 15px; transition: transform .08s; }
.btn-second:active { transform: scale(.98); }

/* ---------- listes ---------- */
.liste { overflow: hidden; }
.ligne { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; position: relative; }
.ligne + .ligne::before { content: ""; position: absolute; top: 0; left: 66px; right: 16px; border-top: 1px solid var(--trait); }
.ligne.cliquable { cursor: pointer; transition: background var(--d-etat); }
.ligne.cliquable:active { background: var(--carte-2); }
@media (hover: hover) { .ligne.cliquable:hover { background: var(--carte-2); } }
.ligne .av { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; }
.ligne .milieu { flex: 1; min-width: 0; display: block; }
.ligne .nom { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .sous { display: block; margin-top: 1px; font-size: 13px; color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .droite { flex: none; display: grid; justify-items: end; gap: 2px; }
.ligne .mt { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ligne.entree .mt { color: var(--vert); }
.ligne .apres { font-size: 12px; color: var(--doux); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ligne .attente { display: block; font-size: 12px; font-weight: 600; color: var(--ambre); }
.etiq { display: inline-block; vertical-align: 1px; margin-right: 6px; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--laiton); background: var(--laiton-clair); }
.etiq.vert { color: var(--vert); background: var(--accent-clair); }
.ligne.ouverture { background: var(--carte-2); }
.ligne.ouverture .av { background: var(--plaque); color: var(--laiton-plaque); }
.vide { padding: 28px 18px; text-align: center; color: var(--doux); font-size: 15px; line-height: 1.5; }
.barre-p { display: block; height: 6px; border-radius: 3px; background: var(--trait); margin-top: 8px; overflow: hidden; }
.barre-p i { display: block; height: 100%; border-radius: 3px; background: var(--rouge); opacity: .75; }
.barre-p i.e { background: var(--vert); }
.ligne .mt.vert { color: var(--vert); }

/* filtres + recherche */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filtres button { min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--carte); border: 1px solid var(--trait); font-size: 14px; font-weight: 600; transition: background var(--d-etat), color var(--d-etat); }
.filtres button.actif { background: var(--texte); border-color: var(--texte); color: var(--fond); }
.recherche input { width: 100%; height: 48px; border-radius: var(--r-md); border: 1.5px solid transparent; background: color-mix(in srgb, var(--trait) 75%, var(--fond)); padding: 0 16px; font-size: 16px; outline: none; }
.recherche input:focus { border-color: var(--accent); background: var(--carte); }
.resume { display: grid; gap: 2px; margin: 18px 6px 10px; }
.resume b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.resume span { min-width: 0; color: var(--doux); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- bilan ---------- */
.bilan { padding: 4px 20px 12px; }
.b-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--trait); font-variant-numeric: tabular-nums; }
.b-ligne.cliquable { cursor: pointer; }
.b-ligne small { font-size: 13px; }
.b-note { display: block; margin-top: 2px; }
.b-note:empty { display: none; }
.b-rendre { margin-top: 16px; }
.b-ligne b { font-weight: 650; white-space: nowrap; }
.b-ligne.total { border: 0; padding-bottom: 6px; }
.b-ligne.total span { font-weight: 650; font-size: 17px; }
.b-ligne.total b { color: var(--accent); font-size: 22px; }
.b-autres { margin: 0 0 6px; text-align: right; font-size: 14px; color: var(--doux); font-variant-numeric: tabular-nums; }
.b-autres:empty { display: none; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 16px; }

/* ---------- barre de navigation ---------- */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--carte) 88%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--trait);
}
.barre button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 52px; color: var(--doux); font-size: 12px; font-weight: 600; }
.barre svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.barre button.actif { color: var(--accent); }
.barre button.actif svg { stroke-width: 2.1; }

/* ---------- feuille ---------- */
.voile { position: fixed; inset: 0; z-index: 30; background: rgba(10, 18, 14, .42); animation: fondu .2s; }
@keyframes fondu { from { opacity: 0; } }
.feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 90dvh; overflow-y: auto; max-width: 640px; margin: 0 auto;
  background: var(--fond); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--ombre-flotte); animation: monte .28s var(--courbe);
}
@keyframes monte { from { transform: translateY(100%); } }
.poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--trait-fort); margin: 4px auto 12px; }
.f-titre { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 14px; }
.f-titre h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.f-titre button { color: var(--accent); font-weight: 600; min-height: 44px; padding: 0 4px; }
.f-actions { display: grid; gap: 10px; margin-top: 4px; }
.f-info { font-size: 12px; color: var(--doux); text-align: center; margin: 8px 0 0; }

/* toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: flex; align-items: center; gap: 14px; padding: 6px 8px 6px 18px; min-height: 52px; border-radius: var(--r-md); max-width: calc(100% - 32px);
  background: #18211c; color: #fff; font-size: 15px; box-shadow: var(--ombre-flotte); animation: toast var(--d-entree) var(--courbe);
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast button { color: #d8b466; font-weight: 650; min-height: 44px; padding: 0 10px; }
.hors-ligne { position: fixed; top: 0; left: 0; right: 0; z-index: 41; background: #7a5a12; color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px; }

/* ---------- tablette ---------- */
@media (min-width: 600px) {
  #v-app { padding-left: 24px; padding-right: 24px; padding-bottom: 120px; }
  .barre {
    left: 50%; right: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(520px, calc(100% - 48px)); transform: translateX(-50%);
    padding: 6px; border: 1px solid var(--trait); border-radius: 22px; box-shadow: var(--ombre-flotte);
  }
  .barre button { border-radius: 16px; }
  .barre button.actif { background: var(--accent-clair); }
  .toast { bottom: 104px; }
}

/* ---------- ordinateur : barre latérale + deux colonnes ---------- */
@media (min-width: 1000px) {
  .barre {
    left: 0; top: 0; bottom: 0; right: auto; width: 240px; transform: none; border-radius: 0; box-shadow: none;
    display: flex; flex-direction: column; gap: 4px; padding: 88px 16px 24px; border: 0; border-right: 1px solid var(--trait);
    background: var(--carte-2); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .barre::before { content: "Coffre"; position: absolute; top: 30px; left: 30px; font-size: 20px; font-weight: 700; color: var(--texte); }
  .barre button { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
  .barre svg { width: 22px; height: 22px; }
  @media (hover: hover) { .barre button:not(.actif):hover { background: var(--fond); color: var(--texte); } }
  #v-app { max-width: none; margin: 0 0 0 240px; padding: 24px 48px 64px; }
  .onglet { max-width: 1080px; margin: 0 auto; }
  #o-registre, #o-personnes, #o-bilan { max-width: 780px; }
  #o-coffre { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; align-items: start; }
  #o-coffre > .haut { display: contents; }
  #o-coffre .salut { grid-column: 1 / -1; grid-row: 1; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--texte); margin: 8px 0 22px; }
  #o-coffre .plaque { grid-column: 2; grid-row: 2 / span 2; }
  #o-coffre > .seg { grid-column: 1; grid-row: 2; margin: 0 0 12px; }
  #o-coffre > #f-saisie { grid-column: 1; grid-row: 3 / span 4; }
  #o-coffre > .a-rendre { grid-column: 2; grid-row: 4; }
  #o-coffre > .titre-sec { grid-column: 2; grid-row: 5; margin-top: 20px; }
  #o-coffre > #dernieres { grid-column: 2; grid-row: 6; }
  .toast { left: calc(50% + 120px); bottom: 32px; }
  .feuille {
    top: 50%; bottom: auto; left: 50%; right: auto; width: min(560px, calc(100% - 320px)); margin: 0; max-height: 86dvh;
    border-radius: var(--r-xl); padding: 20px 24px 24px; transform: translate(calc(-50% + 120px), -50%); animation: apparait .24s var(--courbe);
  }
  .poignee { display: none; }
  @keyframes apparait { from { opacity: 0; transform: translate(calc(-50% + 120px), calc(-50% + 12px)) scale(.98); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 599px) { .actions > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
