/* SPL3T — application (téléphone d'abord) */
body { min-height: 100dvh; }
#ecran { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
#ecran.groupe { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }

.barre { display: flex; align-items: center; gap: 8px; min-height: 56px; margin-bottom: 12px; }
.barre img { height: 24px; width: auto; max-width: 100%; display: block; flex: 0 1 auto; min-width: 0; object-fit: contain; object-position: left; }
.barre .bouton.discret { padding: 0 8px; flex: none; }
.barre .langue { flex: none; }
.barre .pousse { flex: 1; }
.barre h1 { font-size: 20px; font-weight: 800; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.retour { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: none; font-weight: 700; color: var(--accent-fonce); }
.retour:hover { background: var(--accent-pale); }

h1.grand { font-size: 28px; line-height: 1.15; font-weight: 800; margin: 8px 0; }
h2 { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 22px 4px 8px; }
.doux { color: var(--doux); }
.petit { font-size: 14px; }

.carte { background: var(--carte); border: 1.5px solid var(--ligne); border-radius: var(--rayon); padding: 16px; }
.pile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.centre { text-align: center; }

.entree { padding-top: 6vh; display: grid; gap: 16px; }
.entree .logo { height: 44px; justify-self: start; }
.entree .haut { display: flex; justify-content: space-between; align-items: center; }

label.champ { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
input[type=text], input[type=email], select, input.montant { width: 100%; min-height: 54px; padding: 0 16px; border: 2px solid var(--ligne); border-radius: 14px; background: var(--carte); font-size: 18px; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
input.code { text-align: center; font-size: 30px; font-weight: 800; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
input.montant { font-size: 34px; font-weight: 800; min-height: 68px; text-align: center; }
.essai { background: #fff6d9; border: 1.5px dashed #e0a800; border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.essai b { font-size: 20px; letter-spacing: .12em; }
.erreur { color: var(--corail); font-weight: 700; min-height: 1.5em; font-size: 15px; }

/* Listes */
.ligne { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 12px 16px; background: var(--carte); border: 1.5px solid var(--ligne); border-radius: var(--rayon); text-align: start; text-decoration: none; }
button.ligne:hover, a.ligne:hover { border-color: var(--accent); }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .titre { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .sous { font-size: 14px; color: var(--doux); }
.ligne .montant { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
.ligne .montant small { display: block; font-weight: 600; font-size: 12px; }
.plus { color: var(--accent-fonce); } .moins { color: var(--corail); } .zero { color: var(--doux); }
.rond { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-pale); color: var(--accent-fonce); font-weight: 800; }
.rond.r { background: #fff3cf; color: #8a6500; }
.vide { padding: 28px 16px; text-align: center; color: var(--doux); border: 2px dashed var(--ligne); border-radius: var(--rayon); }

.resume { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px; border-radius: var(--rayon); background: var(--encre); color: #fff; }
.resume b { font-size: 22px; font-variant-numeric: tabular-nums; }
.resume.plus { background: var(--accent-fonce); color: #fff; } .resume.moins { background: var(--corail); color: #fff; }

.virement { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.virement .bouton { min-height: 44px; padding: 0 16px; }

/* Bas d'écran du groupe : action principale + onglets */
.bas { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--fond) 78%, transparent); }
.bas > div { max-width: 528px; margin: 0 auto; display: grid; gap: 8px; }
.onglets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; background: var(--carte); border: 1.5px solid var(--ligne); border-radius: 999px; }
.onglets button { min-height: 46px; border: 0; border-radius: 999px; background: none; font-weight: 700; color: var(--doux); font-size: 15px; }
.onglets button[aria-selected="true"] { background: var(--encre); color: #fff; }

/* Panneau qui monte du bas */
.voile { position: fixed; z-index: 40; inset: 0; background: rgba(19,32,27,.45); display: flex; align-items: flex-end; justify-content: center; animation: voile .15s; }
.panneau { width: 100%; max-width: 560px; max-height: 94dvh; overflow: auto; background: var(--fond); border-radius: 24px 24px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; animation: monte .22s cubic-bezier(.2,.8,.2,1); }
.panneau .tete { display: flex; align-items: center; justify-content: space-between; min-height: 52px; position: sticky; top: -8px; background: var(--fond); z-index: 1; }
.panneau .tete h1 { font-size: 20px; font-weight: 800; }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
@keyframes voile { from { opacity: 0; } }
@media (min-width: 761px) { .voile { align-items: center; } .panneau { border-radius: 24px; } }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { min-height: 46px; padding: 0 16px; border: 2px solid var(--ligne); border-radius: 999px; background: var(--carte); font-weight: 700; }
.puce[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-fonce); }
.puce[aria-pressed="true"]::before { content: "✓ "; }
.groupe-champ { display: grid; gap: 8px; }
.groupe-champ > span { font-weight: 700; font-size: 15px; }
.paire { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

#toast { position: fixed; z-index: 60; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); padding: 12px 20px; border-radius: 999px; background: var(--encre); color: #fff; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
#toast.vu { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.iban { grid-column: 1 / -1; display: grid; gap: 2px; min-height: 48px; padding: 8px 14px; border: 1.5px dashed var(--accent); border-radius: 12px; background: var(--accent-pale); color: var(--accent-fonce); text-align: start; font-size: 14px; }
.iban span { font-variant-numeric: tabular-nums; color: var(--encre); letter-spacing: .02em; }
.bouton.payer { grid-column: 1 / -1; }
.deux { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; }
.qr { justify-self: center; width: min(280px, 78vw); padding: 10px; background: #fff; border-radius: 16px; border: 1.5px solid var(--ligne); }
.qr svg { display: block; width: 100%; height: auto; }
/* IBAN et numéros : toujours de gauche à droite, même en arabe ou en hébreu */
.iban span, input[name=iban], input[name=twint] { direction: ltr; unicode-bidi: isolate; }
[dir=rtl] .iban span, [dir=rtl] input[name=iban], [dir=rtl] input[name=twint] { text-align: right; }
/* Projets, façons de compter, réglages */
.onglets.deux-onglets { grid-template-columns: repeat(2, 1fr); }
.rond.gris { background: #ecebe4; color: var(--doux); }
.bandeau { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: #fff6d9; font-size: 15px; font-weight: 600; }
.bouton.rouge { background: var(--corail); border-color: var(--corail); color: #fff; }
.rang { display: grid; grid-template-columns: minmax(0, 1fr) 96px 44px; gap: 8px; align-items: center; font-weight: 600; }
.rang span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rang input { min-height: 48px; text-align: end; padding: 0 12px; }
.rang small { color: var(--doux); font-weight: 700; }
.lien { border: 0; background: none; padding: 0; color: var(--corail); font-weight: 700; text-decoration: underline; min-height: 28px; }
[data-note] a { color: var(--accent-fonce); font-weight: 700; }
.retour .coupe { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panneau h2 { margin: 10px 0 0; }
.barre h1 { text-align: center; }
.ligne .montant { flex: 0 1 auto; max-width: 46%; white-space: normal; }
.ligne .corps { flex: 1 1 54%; }
[hidden] { display: none !important; }
.ligne .corps { overflow: hidden; }
.ligne .titre, .ligne .sous { display: block; }
.ligne .corps br { display: none; }
/* Coûts, catégorie et date, trajet */
button.resume { width: 100%; border: 0; text-align: start; font: inherit; }
.resume small { display: block; font-size: 13px; font-weight: 600; opacity: .8; }
.deux.egaux { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
input[type=date] { width: 100%; min-height: 54px; padding: 0 12px; border: 2px solid var(--ligne); border-radius: 14px; background: var(--carte); font-size: 17px; -webkit-appearance: none; appearance: none; }
select { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--doux) 50%), linear-gradient(135deg, var(--doux) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-inline-end: 34px; }
[dir=rtl] select { background-position: 14px 50%, 20px 50%; }
.cout { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px 16px; background: var(--carte); border: 1.5px solid var(--ligne); border-radius: 14px; overflow: hidden; font-weight: 700; }
.cout b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cout i { position: absolute; inset-inline-start: 0; bottom: 0; height: 5px; background: var(--accent); border-radius: 0 3px 3px 0; }
