/* ===== Budgy — design « Liquid Glass » épuré ===== */
:root {
  color-scheme: light dark;
  --bg:        light-dark(#f3f4fa, #08090d);
  --surface:   light-dark(#ffffff, #15171f);
  --surface-2: light-dark(rgb(20 22 40 / .05), rgb(255 255 255 / .06));
  --text:      light-dark(#11131a, #eef0f5);
  --muted:     light-dark(#5a6070, #a1a8b8);
  --line:      light-dark(rgb(20 22 40 / .08), rgb(255 255 255 / .08));
  --brand:     #5b4be8;
  --brand-2:   #8b3cf0;
  --brand-3:   #d946ef;
  --brand-ink: light-dark(#4b3bd6, #b3adff);
  --brand-soft: light-dark(rgb(91 75 232 / .10), rgb(140 130 255 / .16));
  --in:        light-dark(#0b7a53, #3ddc97);
  --out:       light-dark(#c4264a, #ff7a93);
  --warn:      light-dark(#a8580a, #fbbf24);
  --ok:        light-dark(#0b7a53, #3ddc97);

  /* Verre */
  --glass:        light-dark(rgb(255 255 255 / .62), rgb(30 32 44 / .52));
  --glass-strong: light-dark(rgb(255 255 255 / .80), rgb(26 28 38 / .78));
  --glass-edge:   light-dark(rgb(255 255 255 / .85), rgb(255 255 255 / .10));
  --glass-shine:  light-dark(rgb(255 255 255 / .95), rgb(255 255 255 / .07));
  --glass-shadow: 0 1px 1px light-dark(rgb(20 20 60 / .04), rgb(0 0 0 / .3)), 0 0.75rem 2rem light-dark(rgb(40 40 110 / .08), rgb(0 0 0 / .35));
  --blur: blur(1.375rem) saturate(180%);

  --font: "Inter", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 0.75rem; --r: 1.375rem; --r-lg: 1.875rem; --r-pill: 62.4375rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --tabbar-h: 4.5rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* Anciens navigateurs (iOS < 17.5, Android anciens) qui ne connaissent pas light-dark() : couleurs explicites. */
@supports not (color: light-dark(white, black)) {
  :root { --bg: #f3f4fa; --surface: #fff; --surface-2: rgb(20 22 40 / .05); --text: #11131a; --muted: #5a6070; --line: rgb(20 22 40 / .08);
    --brand-ink: #4b3bd6; --brand-soft: rgb(91 75 232 / .10); --in: #0b7a53; --out: #c4264a; --warn: #a8580a; --ok: #0b7a53;
    --glass: rgb(255 255 255 / .62); --glass-strong: rgb(255 255 255 / .80); --glass-edge: rgb(255 255 255 / .85); --glass-shine: rgb(255 255 255 / .95);
    --glass-shadow: 0 1px 1px rgb(20 20 60 / .04), 0 .75rem 2rem rgb(40 40 110 / .08); }
  :root[data-theme="dark"] { --bg: #08090d; --surface: #15171f; --surface-2: rgb(255 255 255 / .06); --text: #eef0f5; --muted: #a1a8b8; --line: rgb(255 255 255 / .08);
    --brand-ink: #b3adff; --brand-soft: rgb(140 130 255 / .16); --in: #3ddc97; --out: #ff7a93; --warn: #fbbf24; --ok: #3ddc97;
    --glass: rgb(30 32 44 / .52); --glass-strong: rgb(26 28 38 / .78); --glass-edge: rgb(255 255 255 / .10); --glass-shine: rgb(255 255 255 / .07);
    --glass-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 .75rem 2rem rgb(0 0 0 / .35); }
}
@supports not (color: light-dark(white, black)) { @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #08090d; --surface: #15171f; --surface-2: rgb(255 255 255 / .06); --text: #eef0f5; --muted: #a1a8b8; --line: rgb(255 255 255 / .08);
  --brand-ink: #b3adff; --brand-soft: rgb(140 130 255 / .16); --in: #3ddc97; --out: #ff7a93; --warn: #fbbf24; --ok: #3ddc97;
  --glass: rgb(30 32 44 / .52); --glass-strong: rgb(26 28 38 / .78); --glass-edge: rgb(255 255 255 / .10); --glass-shine: rgb(255 255 255 / .07);
  --glass-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 .75rem 2rem rgb(0 0 0 / .35); } } }

/* Taille adaptée à chaque téléphone : toutes les dimensions sont en rem et suivent la largeur de l'écran
   (≈ 13,5 px sur un petit Android / iPhone SE, 16 px sur un iPhone standard, 17 px sur un grand modèle). */
html { font-size: clamp(13.5px, calc(3.85vw + 1px), 17px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (min-width: 600px) { html { font-size: 16px; } }
/* Téléphone à l'horizontale : on se règle sur la hauteur pour ne pas tout agrandir. */
@media (orientation: landscape) and (max-height: 500px) { html { font-size: clamp(13px, calc(3.2vh + 1px), 15px); } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* La page elle-même ne défile jamais (seul l'écran interne défile) : évite les décalages d'iOS Safari. */
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--font); font-size: 1rem; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0; }
:focus-visible { outline: 0.1875rem solid var(--brand); outline-offset: 2px; border-radius: 0.625rem; }
.i { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ===== Cadre ===== */
.app { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 26.875rem; height: 100dvh; margin: 0 auto; background: var(--bg); overflow: hidden; isolation: isolate; }
@media (min-width: 600px) {
  body { display: grid; place-items: center;
    background: radial-gradient(circle at 15% 10%, #8b3cf044, transparent 45%), radial-gradient(circle at 85% 90%, #10a37f33, transparent 45%), light-dark(#e6e7f1, #040508); }
  /* Ordinateur / tablette : une colonne centrée, sans faux cadre de téléphone. */
  .app { max-width: 30rem; height: min(58rem, 100dvh - 2rem); border-radius: 2rem; border: 1px solid var(--glass-edge); box-shadow: 0 1.5rem 4rem rgb(20 20 60 / .22); }
}

/* Fond « aurore » liquide */
.aurora { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(3.75rem); opacity: .5; animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 21.25rem; height: 21.25rem; left: -7.5rem; top: -6.25rem; background: light-dark(#b9b2ff, #3b2fb8); }
.aurora i:nth-child(2) { width: 18.75rem; height: 18.75rem; right: -8.125rem; top: 13.75rem; background: light-dark(#ffc2e6, #7a1d6b); animation-delay: -7s; }
.aurora i:nth-child(3) { width: 20rem; height: 20rem; left: -3.75rem; bottom: -7.5rem; background: light-dark(#a6f0d6, #0c5a45); animation-delay: -14s; }
@keyframes drift { 50% { transform: translate(2.5rem, 1.875rem) scale(1.12); } 100% { transform: translate(-1.25rem, 3.125rem) scale(.95); } }

/* Matière verre */
.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine); }
@media (prefers-reduced-transparency: reduce) {
  .glass, .tabbar, .sheet { background: var(--surface) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .aurora { display: none; }
}

.screen { flex: 1; overflow-y: auto; padding: calc(var(--safe-t) + 1.125rem) max(1.125rem, env(safe-area-inset-right)) calc(var(--tabbar-h) + var(--safe-b) + 2.125rem) max(1.125rem, env(safe-area-inset-left)); outline: none; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.stack-lg { display: grid; gap: 0.875rem; }
.stack { display: grid; gap: 0.625rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.625rem; }

/* ===== En-tête ===== */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; padding: 0.25rem 2px 2px; }
.top h1 { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.04em; margin: 0; line-height: 1.05; }
.kicker { color: var(--muted); font-size: .85rem; font-weight: 500; margin-bottom: 2px; }
.top-actions { display: flex; gap: 0.5rem; }
.icon-btn { width: 2.75rem; height: 2.75rem; border-radius: var(--r-pill); border: 1px solid var(--glass-edge); background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); display: grid; place-items: center; transition: transform .15s var(--spring); box-shadow: inset 0 1px 0 var(--glass-shine); }
.icon-btn:active { transform: scale(.9); }
.icon-btn .i { width: 1.25rem; height: 1.25rem; }
.ai-btn { display: inline-flex; align-items: center; gap: 0.375rem; height: 2.75rem; padding: 0 0.875rem 0 0.75rem; border-radius: var(--r-pill); border: 0; color: #fff; font-weight: 700; font-size: .9rem;
  background: linear-gradient(120deg, var(--brand), var(--brand-2), var(--brand-3)); background-size: 200% 100%; animation: sheen 6s linear infinite;
  box-shadow: 0 0.5rem 1.25rem rgb(139 60 240 / .35), inset 0 1px 0 rgb(255 255 255 / .35); transition: transform .15s var(--spring); }
.ai-btn:active { transform: scale(.94); }
.ai-btn .i { width: 1.125rem; height: 1.125rem; }
@keyframes sheen { to { background-position: 200% 0; } }

.month { display: flex; align-items: center; justify-content: space-between; border-radius: var(--r-pill); padding: 0.1875rem; }
.month button { width: 2.5rem; height: 2.5rem; border: 0; background: none; border-radius: var(--r-pill); display: grid; place-items: center; }
.month button:disabled { opacity: .25; cursor: default; }
.month span { font-weight: 650; font-size: .95rem; text-transform: capitalize; }

/* ===== Héros ===== */
.hero { position: relative; overflow: hidden; color: #fff; border-radius: var(--r-lg); padding: 1.5rem 1.375rem 1.25rem;
  background: linear-gradient(135deg, #5b4be8 0%, #7b3fe6 55%, #c43bd9 100%);
  box-shadow: 0 1.375rem 2.75rem rgb(91 75 232 / .35), inset 0 1px 0 rgb(255 255 255 / .35); border: 1px solid rgb(255 255 255 / .18); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 0% 0%, rgb(255 255 255 / .28), transparent 50%), radial-gradient(80% 60% at 100% 100%, rgb(255 255 255 / .10), transparent 60%); pointer-events: none; }
.hero::after { content: ""; position: absolute; width: 15rem; height: 15rem; right: -5rem; top: -6.875rem; border-radius: 50%; background: rgb(255 255 255 / .10); backdrop-filter: blur(0.25rem); }
.hero > * { position: relative; z-index: 1; }
.hero .label { font-size: .9rem; opacity: .9; font-weight: 500; }
.hero .big { font-size: 3rem; font-weight: 800; letter-spacing: -0.05em; margin: 2px 0; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero .sub { font-size: .95rem; opacity: .95; }
.hero .bar { height: 0.5rem; border-radius: var(--r-pill); background: rgb(255 255 255 / .22); margin: 1.125rem 0 0.5rem; overflow: hidden; }
.hero .bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #fff, rgb(255 255 255 / .8)); box-shadow: 0 0 0.75rem rgb(255 255 255 / .6); transition: width .8s var(--ease); }
.hero .meta { display: flex; justify-content: space-between; font-size: .82rem; opacity: .9; }
.hero.over { background: linear-gradient(135deg, #d12d55, #9b1c4c); box-shadow: 0 1.375rem 2.75rem rgb(209 45 85 / .3), inset 0 1px 0 rgb(255 255 255 / .35); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.mini { border-radius: var(--r); padding: 0.875rem 1rem; }
.mini .k { display: flex; align-items: center; gap: 0.375rem; color: var(--muted); font-size: .85rem; }
.mini .v { font-size: 1.35rem; font-weight: 750; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.in-c { color: var(--in); } .out-c { color: var(--out); }
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; display: inline-block; flex: none; }

.insight { display: flex; gap: 0.75rem; align-items: center; padding: 0.875rem 1rem; border-radius: var(--r); }
.ins-i { width: 2.375rem; height: 2.375rem; border-radius: 0.8125rem; display: grid; place-items: center; flex: none; color: #fff; background: var(--brand); }
.tone-ok .ins-i { background: linear-gradient(135deg, #22c38a, #0b7a53); }
.tone-warn .ins-i { background: linear-gradient(135deg, #fbbf24, #d97706); }
.tone-out .ins-i { background: linear-gradient(135deg, #ff6b8b, #c4264a); }
.tone-brand .ins-i { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.insight .i { width: 1.25rem; height: 1.25rem; }
.insight p { font-size: .9rem; color: var(--muted); }
.insight strong { display: block; color: var(--text); font-size: .95rem; }

.ai-card { display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; padding: 0.875rem 1rem; border-radius: var(--r); border: 1px solid rgb(139 60 240 / .25);
  background: linear-gradient(120deg, rgb(91 75 232 / .14), rgb(217 70 239 / .12)); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--glass-shine); transition: transform .15s var(--spring); }
.ai-card:active { transform: scale(.98); }
.ai-card .mid { flex: 1; min-width: 0; display: grid; }
.ai-card strong { font-size: .98rem; }
.ai-card .mid span { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-orb { width: 2.625rem; height: 2.625rem; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff;
  background: conic-gradient(from 180deg, var(--brand), var(--brand-3), #3ddc97, var(--brand)); box-shadow: 0 0.375rem 1.125rem rgb(139 60 240 / .4), inset 0 0 0 2px rgb(255 255 255 / .35); }
.ai-orb .i { width: 1.25rem; height: 1.25rem; }
.ai-orb.sm { width: 1.875rem; height: 1.875rem; } .ai-orb.sm .i { width: 0.9375rem; height: 0.9375rem; }
.chev { color: var(--muted); width: 1.125rem; height: 1.125rem; }

/* ===== Listes ===== */
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0.625rem 0.25rem -0.25rem; }
.section-h h2, .card h2 { font-size: 1.12rem; margin: 0; letter-spacing: -0.025em; }
.muted-s { color: var(--muted); font-size: .85rem; text-transform: capitalize; }
.link { border: 0; background: none; color: var(--brand-ink); font-weight: 650; padding: 0.5rem 0.25rem; }
.list { border-radius: var(--r); overflow: hidden; padding: 0.25rem; }
.row { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.625rem; border: 0; background: none; text-align: left; min-height: 3.875rem; border-radius: 1rem; transition: background .15s; }
.row:active { background: var(--surface-2); }
.ico { width: 2.625rem; height: 2.625rem; border-radius: 0.875rem; display: grid; place-items: center; flex: none; color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 0.25rem 0.625rem rgb(0 0 0 / .10); }
.ico .i { width: 1.3125rem; height: 1.3125rem; stroke-width: 2; }
.ico.sm { width: 1.875rem; height: 1.875rem; border-radius: 0.625rem; } .ico.sm .i { width: 1rem; height: 1rem; }
.ico.lg { width: 4rem; height: 4rem; border-radius: 1.25rem; } .ico.lg .i { width: 2rem; height: 2rem; }
.row .mid { flex: 1; min-width: 0; }
.row .t, .row .s { display: block; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 0.375rem; padding: 1px 0.375rem; margin-right: 0.375rem; text-transform: uppercase; letter-spacing: .04em; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.in { color: var(--in); }
.day-h { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 0.5rem 0.375rem 0.5rem; display: flex; justify-content: space-between; }

.search { display: flex; align-items: center; gap: 0.625rem; border-radius: var(--r-pill); padding: 0 1rem; min-height: 3rem; color: var(--muted); }
.search-in { flex: 1; border: 0; background: none; outline: none; min-height: 2.875rem; color: var(--text); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.25rem; padding: 0.25rem; background: var(--surface-2); border-radius: var(--r-pill); }
.seg button { min-height: 2.5rem; border: 0; border-radius: var(--r-pill); background: none; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; transition: background .25s var(--ease), color .2s; }
.seg button .i { width: 1.0625rem; height: 1.0625rem; }
.seg button[aria-pressed="true"] { background: var(--glass-strong); color: var(--text); box-shadow: 0 2px 0.5rem rgb(0 0 0 / .08), inset 0 1px 0 var(--glass-shine); }
.seg.small button { font-size: .88rem; }

/* ===== Budgets ===== */
.card { border-radius: var(--r); padding: 1.125rem; display: grid; gap: 0.875rem; }
.method h2 { font-size: 1.05rem; }
.splitbar { display: flex; gap: 0.25rem; height: 0.75rem; }
.splitbar i { border-radius: var(--r-pill); box-shadow: inset 0 1px 0 rgb(255 255 255 / .35); transition: flex-grow .4s var(--ease); }
.groups { display: grid; gap: 0.75rem; }
.grp { display: grid; grid-template-columns: 1fr auto; gap: 0.375rem 0.625rem; align-items: center; }
.grp-k { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: .92rem; }
.grp-v { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.grp .progress { grid-column: 1 / -1; margin: 0; }
.bcard { display: grid; gap: 0.75rem; width: 100%; text-align: left; border-radius: var(--r); padding: 0.875rem; transition: transform .15s var(--spring); }
.bcard:active { transform: scale(.985); }
.bcard .head { display: flex; align-items: center; gap: 0.75rem; }
.bcard .mid { flex: 1; display: grid; }
.bcard .t { font-weight: 650; } .bcard .s { font-size: .82rem; color: var(--muted); }
.progress { height: 0.5rem; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; transition: width .8s var(--ease); box-shadow: inset 0 1px 0 rgb(255 255 255 / .3); }
.pill { font-size: .76rem; font-weight: 700; padding: 0.3125rem 0.625rem; border-radius: var(--r-pill); white-space: nowrap; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.pill.over { color: var(--out); background: color-mix(in srgb, var(--out) 13%, transparent); }

.models { display: grid; gap: 0.625rem; }
.model { text-align: left; border-radius: 1.25rem; padding: 0.875rem 1rem; display: grid; gap: 0.5rem; transition: transform .15s var(--spring), border-color .2s, box-shadow .2s; }
.model p { font-size: .85rem; color: var(--muted); }
.model.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand), var(--glass-shadow); }
.model:active { transform: scale(.985); }
.radio-dot { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.model.on .radio-dot { border: 0.375rem solid var(--brand); }
.split-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: .78rem; color: var(--muted); }
.split-legend span { display: inline-flex; align-items: center; gap: 0.3125rem; }
.sliders { gap: 0.625rem; }
.slider { display: grid; gap: 0.25rem; font-weight: 600; font-size: .9rem; }
.slider input { accent-color: var(--brand); width: 100%; height: 1.75rem; }

/* ===== Statistiques ===== */
.chiprow { display: flex; gap: 0.375rem; overflow-x: auto; scrollbar-width: none; margin: 0 -1.125rem; padding: 2px 1.125rem; scroll-snap-type: x proximity; }
.chiprow::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; scroll-snap-align: start; min-height: 2.25rem; padding: 0 0.875rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); font-size: .85rem; font-weight: 600; color: var(--muted); transition: all .2s var(--ease); }
.chip-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: transparent; }
.chiprow + .chiprow .chip-btn[aria-pressed="true"] { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.muted-p { color: var(--muted); }
.radial { position: relative; width: 13.75rem; margin: 0.25rem auto 0; }
.radial svg { width: 100%; display: block; filter: drop-shadow(0 0.625rem 1.125rem rgb(40 30 120 / .18)); }
.radial .pie-seg { stroke: var(--surface); stroke-width: 2.5; transition: opacity .2s; }
.radial-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.radial-center .v { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.04em; }
.radial-center .k { font-size: .8rem; color: var(--muted); }
.total-line { text-align: center; font-weight: 700; }
.legend { display: grid; gap: 0.5rem; }
.legend .li { display: flex; align-items: center; gap: 0.625rem; font-size: .92rem; }
.legend .li .n { flex: 1; }
.legend .li .p { color: var(--muted); width: 2.75rem; text-align: right; font-variant-numeric: tabular-nums; font-size: .85rem; }
.hbars { display: grid; gap: 0.75rem; }
.hbar-top { display: flex; align-items: center; gap: 0.625rem; font-size: .92rem; margin-bottom: 0.375rem; }
.hbar-top .n { flex: 1; } .hbar-top .p { color: var(--muted); font-size: .82rem; width: 2.5rem; text-align: right; }
.hbar-track { height: 0.75rem; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: inherit; box-shadow: inset 0 1px 0 rgb(255 255 255 / .35); }
.treemap { position: relative; width: 100%; aspect-ratio: 100 / 72; border-radius: 1.125rem; overflow: hidden; }
.tile { position: absolute; border: 2px solid var(--surface); border-radius: 0.75rem; color: #fff; padding: 0.5rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .3); }
.tile-i { width: 1.25rem; height: 1.25rem; }
.tile-n { font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-p { font-size: .8rem; font-weight: 800; }
.bubbles { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem; padding: 0.375rem 0; }
.bubble { border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 2px; color: #fff; font-weight: 800; font-size: .8rem;
  box-shadow: inset 0 -0.375rem 0.875rem rgb(0 0 0 / .15), inset 0 2px 0 rgb(255 255 255 / .4), 0 0.5rem 1.125rem rgb(0 0 0 / .12); }
.bubble-i { width: 1.25rem; height: 1.25rem; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.kpis div { background: var(--surface-2); border-radius: 0.875rem; padding: 0.625rem; display: grid; }
.kpis span { font-size: .75rem; color: var(--muted); }
.kpis strong { font-size: 1rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.flow { display: grid; gap: 0.5rem; }
.flow-box { position: relative; height: 10.625rem; }
.flow-area { position: absolute; inset: 0; }
.cols { display: flex; align-items: flex-end; height: 100%; gap: 2px; }
.cols .col { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.cols .b { display: block; width: 38%; max-width: 0.875rem; min-height: 2px; border-radius: 0.375rem 0.375rem 0.1875rem 0.1875rem; transition: height .6s var(--ease); }
.cols .b.in { background: linear-gradient(180deg, #3ddc97, var(--in)); }
.cols .b.out { background: linear-gradient(180deg, #8f84ff, var(--brand)); }
.cols.net .col { flex-direction: column; gap: 0; }
.cols.net .half { flex: 1; width: 100%; display: flex; justify-content: center; }
.cols.net .up { align-items: flex-end; border-bottom: 1px dashed var(--line); }
.cols.net .down { align-items: flex-start; }
.cols.net .b { width: 55%; max-width: 1.125rem; }
.cols.net .b.pos { background: linear-gradient(180deg, #3ddc97, var(--in)); border-radius: 0.375rem 0.375rem 2px 2px; }
.cols.net .b.neg { background: linear-gradient(0deg, #ff8fa6, var(--out)); border-radius: 2px 2px 0.375rem 0.375rem; }
.line-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.line-svg .zero { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 4 4; }
.pt { position: absolute; width: 0.5625rem; height: 0.5625rem; margin: -0.2812rem 0 0 -0.2812rem; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 1px 0.25rem rgb(0 0 0 / .2); }
.flow-hits { position: absolute; inset: 0; display: flex; }
.hit { flex: 1; border: 0; background: none; border-radius: 0.625rem; }
.hit[aria-pressed="true"] { background: light-dark(rgb(91 75 232 / .08), rgb(255 255 255 / .06)); }
.flow-labels { display: flex; }
.flow-labels span { flex: 1; text-align: center; font-size: .7rem; color: var(--muted); white-space: nowrap; text-transform: capitalize; }
.keys { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); }
.keys span { display: inline-flex; align-items: center; gap: 0.375rem; }
.flow-detail { display: flex; flex-wrap: wrap; gap: 0.25rem 0.875rem; font-size: .85rem; color: var(--muted); background: var(--surface-2); border-radius: 0.875rem; padding: 0.625rem 0.75rem; }
.flow-detail strong { width: 100%; color: var(--text); text-transform: capitalize; }
.flow-detail span { display: inline-flex; align-items: center; gap: 0.375rem; }
.flow-detail .pos { color: var(--in); font-weight: 700; } .flow-detail .neg { color: var(--out); font-weight: 700; }

/* ===== États vides ===== */
.empty { text-align: center; padding: 1.875rem 1.125rem; border-radius: var(--r); display: grid; justify-items: center; gap: 0.5rem; }
.empty-i { width: 3.5rem; height: 3.5rem; border-radius: 1.125rem; display: grid; place-items: center; color: var(--brand-ink); background: var(--brand-soft); }
.empty p { color: var(--muted); margin-bottom: 0.375rem; }

/* ===== Boutons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; min-height: 3.25rem; padding: 0 1.25rem;
  border-radius: var(--r-pill); border: 1px solid transparent; font-weight: 700; font-size: 1rem; transition: transform .15s var(--spring), filter .2s; }
.btn:active { transform: scale(.96); }
.btn-primary { color: #fff; background: linear-gradient(120deg, var(--brand), var(--brand-2) 60%, var(--brand-3)); box-shadow: 0 0.75rem 1.625rem rgb(110 60 235 / .35), inset 0 1px 0 rgb(255 255 255 / .35); }
.btn-ghost { background: var(--glass); border-color: var(--glass-edge); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 var(--glass-shine); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); min-height: 2.5rem; font-size: .9rem; }
.btn-danger { background: none; color: var(--out); border-color: color-mix(in srgb, var(--out) 35%, transparent); }
.btn-inline { width: auto; }

/* ===== Barre d'onglets (verre liquide flottant) ===== */
.tabbar { position: absolute; left: 0.875rem; right: 0.875rem; bottom: calc(0.75rem + var(--safe-b)); height: var(--tabbar-h); z-index: 5;
  display: grid; grid-template-columns: 1fr 1fr 4.375rem 1fr 1fr; align-items: center; padding: 0 0.375rem; border-radius: 1.875rem;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(1.75rem) saturate(200%); backdrop-filter: blur(1.75rem) saturate(200%);
  border: 1px solid var(--glass-edge); box-shadow: 0 1rem 2.5rem rgb(20 20 60 / .16), inset 0 1px 0 var(--glass-shine); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--muted); font-size: .68rem; font-weight: 650; min-height: 3.5rem; border-radius: 1.25rem; position: relative; }
.tab-i { width: 1.4375rem; height: 1.4375rem; transition: transform .3s var(--spring); }
.tab[aria-current="page"] { color: var(--brand-ink); }
.tab[aria-current="page"]::before { content: ""; position: absolute; inset: 0.25rem 0.375rem; border-radius: 1.125rem; background: var(--brand-soft); z-index: -1; }
.tab[aria-current="page"] .tab-i { transform: translateY(-1px) scale(1.1); stroke-width: 2.2; }
.fab { justify-self: center; width: 3.625rem; height: 3.625rem; border-radius: 50%; border: 0; color: #fff; margin-top: -1.875rem; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-2) 55%, var(--brand-3)); box-shadow: 0 0.875rem 1.75rem rgb(110 60 235 / .45), inset 0 1px 0 rgb(255 255 255 / .4), 0 0 0 0.3125rem var(--glass-strong);
  transition: transform .2s var(--spring); }
.fab:active { transform: scale(.88) rotate(90deg); }
.fab-i { width: 1.75rem; height: 1.75rem; stroke-width: 2.6; }

/* ===== Feuille du bas ===== */
/* Le <dialog> est un calque transparent qui recouvre EXACTEMENT la zone visible de l'écran
   (--vvtop / --vvh calculés en JS avec visualViewport : tient compte de la barre de Safari, du clavier
   et des décalages d'iOS). Le panneau (.sheet-in) est posé en bas de ce calque et défile à l'intérieur.
   Plus aucune transformation sur le dialog lui-même : il ne peut plus rester « coincé » hors de l'écran. */
.sheet { position: fixed; top: var(--vvtop, 0px); left: 0; right: 0; bottom: auto; width: 100%; max-width: none; height: var(--vvh, 100dvh); max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); overflow: hidden; overscroll-behavior: contain; }
.sheet[open] { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.sheet::backdrop { background: rgb(10 10 25 / .40); }
.sheet-in { width: 100%; max-width: 26.875rem; max-height: calc(100% - 0.75rem - var(--safe-t)); flex: none;
  padding: 0.625rem 1.25rem calc(1.75rem + var(--safe-b)); display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none;
  border-radius: 2rem 2rem 0 0; background: var(--glass-strong); -webkit-backdrop-filter: blur(1.875rem) saturate(190%); backdrop-filter: blur(1.875rem) saturate(190%);
  box-shadow: 0 -0.625rem 2.5rem rgb(0 0 0 / .25), inset 0 1px 0 var(--glass-shine); animation: sheet-in .3s var(--ease); }
@keyframes sheet-in { from { opacity: .4; transform: translateY(2.5rem); } }
.sheet-in::-webkit-scrollbar { display: none; }
.sheet.tall .sheet-in { height: calc(100% - 0.75rem - var(--safe-t)); overflow: hidden; }
.version { text-align: center; font-size: .75rem; color: var(--muted); margin-top: 0.625rem; }
.sheet-in > form, .sheet-in > div:last-child { flex: none; }
.sheet.tall .sheet-in > .chat { flex: 1; }
.grab { width: 2.5rem; height: 0.3125rem; border-radius: 0.1875rem; background: var(--line); margin: 0 auto 0.625rem; flex: none; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.625rem; flex: none; }
.sheet-top h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; }
.sheet-hero { display: grid; justify-items: center; gap: 0.625rem; text-align: center; color: var(--muted); margin: 0.25rem 0 0.875rem; }
.amount-field { display: flex; align-items: baseline; justify-content: center; gap: 0.375rem; margin: 1rem 0 2px; }
.amount-field input { width: 100%; max-width: 16.25rem; border: 0; background: none; text-align: center; font-size: 3rem; font-weight: 800; letter-spacing: -0.05em; outline: none; font-variant-numeric: tabular-nums; }
.amount-field .cur { font-size: 1.8rem; font-weight: 700; color: var(--muted); }
.err { color: var(--out); font-size: .85rem; text-align: center; min-height: 1.2em; margin: 2px 0 0.25rem; }
.err.left { text-align: left; }
.field-l { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin: 0.875rem 0.25rem 0.5rem; text-transform: uppercase; letter-spacing: .05em; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 0.5rem; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.375rem; padding: 0.625rem 0.25rem; border-radius: 1.125rem; border: 1.5px solid transparent; background: var(--surface-2);
  font-size: .72rem; font-weight: 650; text-align: center; cursor: pointer; transition: all .2s var(--ease); min-height: 4.625rem; }
.chip input:checked + label { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.chip input:focus-visible + label { outline: 0.1875rem solid var(--brand); outline-offset: 2px; }
.input { width: 100%; min-height: 3.125rem; padding: 0 0.875rem; border-radius: 1rem; border: 1px solid var(--line); background: var(--surface-2); }
.actions { display: grid; gap: 0.625rem; margin-top: 1.25rem; }
.note { display: flex; gap: 0.5rem; align-items: center; font-size: .82rem; color: var(--muted); margin-top: 0.875rem; }
.note-i { width: 1rem; height: 1rem; }

/* ===== Assistant IA ===== */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.625rem; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; padding: 0.25rem 2px 0.5rem; scrollbar-width: none; }
.msg { display: flex; gap: 0.5rem; align-items: flex-end; max-width: 92%; }
.msg.me { align-self: flex-end; }
.msg .bubble-c { padding: 0.625rem 0.875rem; border-radius: 1.25rem; display: grid; gap: 0.375rem; font-size: .94rem; line-height: 1.45; }
.msg.ai .bubble-c { background: var(--glass); border: 1px solid var(--glass-edge); border-bottom-left-radius: 0.375rem; box-shadow: inset 0 1px 0 var(--glass-shine); }
.msg.me .bubble-c { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-bottom-right-radius: 0.375rem; }
.msg ul { margin: 0; padding-left: 1.125rem; display: grid; gap: 0.25rem; }
.msg .after { color: var(--muted); font-size: .86rem; }
.typing { display: flex !important; gap: 0.25rem; align-items: center; min-height: 2.5rem; }
.typing i { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-0.1875rem); } }
.sugg { display: flex; gap: 0.375rem; overflow-x: auto; scrollbar-width: none; margin: 0 -1.25rem; padding: 2px 1.25rem; flex: none; }
.sugg::-webkit-scrollbar { display: none; }
.sugg-btn { flex: none; max-width: 16.25rem; text-align: left; padding: 0.5rem 0.75rem; border-radius: 1rem; border: 1px solid rgb(139 60 240 / .25); background: var(--brand-soft); color: var(--brand-ink); font-size: .82rem; font-weight: 600; }
.sugg-btn.more { display: inline-flex; align-items: center; gap: 0.375rem; background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.sugg-btn .i { width: 0.9375rem; height: 0.9375rem; }
.chat-form { display: flex; gap: 0.5rem; flex: none; }
.chat-in { flex: 1; min-height: 3.125rem; padding: 0 1.125rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); outline: none; }
.chat-in:focus { border-color: var(--brand); }
.send { width: 3.125rem; height: 3.125rem; border-radius: 50%; border: 0; color: #fff; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 0.5rem 1.125rem rgb(110 60 235 / .35); }
.send .i { width: 1.25rem; height: 1.25rem; }

/* ===== Toast ===== */
.toast { position: fixed; left: 50%; bottom: calc(6.75rem + var(--safe-b) + var(--kb, 0px)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 0.875rem;
  padding: 0.75rem 0.75rem 0.75rem 1.125rem; border-radius: var(--r-pill); background: light-dark(rgb(17 19 26 / .92), rgb(238 240 245 / .95)); color: light-dark(#fff, #11131a);
  -webkit-backdrop-filter: blur(0.75rem); backdrop-filter: blur(0.75rem); box-shadow: 0 0.625rem 1.875rem rgb(0 0 0 / .25); font-weight: 600; font-size: .9rem; animation: pop .3s var(--spring); max-width: 90vw; }
.toast button { border: 0; background: rgb(127 127 127 / .25); color: inherit; font-weight: 700; padding: 0.5rem 0.875rem; border-radius: var(--r-pill); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 0.75rem) scale(.96); } }

/* ===== Onboarding ===== */
.onboarding { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 1.75rem) 1.375rem calc(var(--safe-b) + 1.375rem); overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(1.875rem); backdrop-filter: blur(1.875rem); }
.onboarding .steps { display: flex; gap: 0.375rem; margin-bottom: 1.625rem; }
.onboarding .steps i { flex: 1; height: 0.25rem; border-radius: 2px; background: var(--line); transition: background .3s; }
.onboarding .steps i.on { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.onboarding .grow { flex: 1; }
.onboarding h1 { font-size: 2.1rem; line-height: 1.08; letter-spacing: -0.045em; margin: 0 0 0.625rem; }
.onboarding .lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 1.375rem; }
.logo { width: 5.5rem; height: 5.5rem; margin-bottom: 1.5rem; filter: drop-shadow(0 1.125rem 1.875rem rgb(110 60 235 / .4)); }
.logo img { width: 100%; height: 100%; display: block; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.625rem; }
.perks li { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem 0.875rem; border-radius: 1.25rem; font-weight: 550; }
.perk-i { width: 2.375rem; height: 2.375rem; border-radius: 0.75rem; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: none; }
.perk-i .i { width: 1.1875rem; height: 1.1875rem; }
.quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.quick button { border-radius: var(--r-pill); padding: 0.625rem 1rem; font-weight: 650; min-height: 2.75rem; }
.big-input { width: 100%; font-size: 2.2rem; font-weight: 800; padding: 0.875rem 1.125rem; border-radius: 1.375rem; border: 2px solid var(--glass-edge); background: var(--glass); letter-spacing: -0.03em; }
.big-input:focus { border-color: var(--brand); outline: none; }
.sticky-actions { margin-top: 1.125rem; }

/* ===== Mouvement réduit ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

/* ===================================================================
   Animations fluides (v1.3) — discrètes, désactivées si l'utilisateur
   a demandé « Réduire les animations » dans son téléphone.
   =================================================================== */
/* Arrivée des blocs d'un écran, en cascade légère */
.anim .stack-lg > * { animation: rise .55s var(--ease) both; }
.anim .stack-lg > *:nth-child(2) { animation-delay: .035s; }
.anim .stack-lg > *:nth-child(3) { animation-delay: .07s; }
.anim .stack-lg > *:nth-child(4) { animation-delay: .105s; }
.anim .stack-lg > *:nth-child(5) { animation-delay: .14s; }
.anim .stack-lg > *:nth-child(6) { animation-delay: .175s; }
.anim .stack-lg > *:nth-child(7) { animation-delay: .21s; }
.anim .stack-lg > *:nth-child(n+8) { animation-delay: .245s; }
@keyframes rise { from { opacity: 0; transform: translateY(.875rem) scale(.985); } }

/* Barres de progression qui se remplissent */
.anim .progress > i, .anim .hero .bar > i, .hbar-track i { transform-origin: left; animation: grow .9s var(--ease) .15s both; }
@keyframes grow { from { transform: scaleX(0); } }

/* Graphiques */
.radial svg { animation: spin-in .8s var(--ease) both; }
@keyframes spin-in { from { opacity: 0; transform: rotate(-70deg) scale(.88); } }
.cols .b { transform-origin: bottom; animation: grow-y .75s var(--ease) both; }
.cols.net .down .b { transform-origin: top; }
@keyframes grow-y { from { transform: scaleY(0); } }
.line-svg { animation: reveal 1s var(--ease) both; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.pt { animation: pop-in .4s var(--spring) .6s both; }
.tile, .bubble { animation: pop-in .55s var(--spring) both; }
.tile:nth-child(2), .bubble:nth-child(2) { animation-delay: .05s; }
.tile:nth-child(3), .bubble:nth-child(3) { animation-delay: .1s; }
.tile:nth-child(n+4), .bubble:nth-child(n+4) { animation-delay: .15s; }
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } }

/* Reflet « liquide » qui glisse sur le grand montant */
.hero::before { animation: shine 7s ease-in-out infinite; }
@keyframes shine { 0%, 100% { opacity: 1; transform: translateX(0); } 50% { opacity: .75; transform: translateX(8%); } }

/* Pastille liquide sous l'onglet actif */
.tab-pill { position: absolute; top: .375rem; bottom: .375rem; left: 0; width: 3rem; border-radius: 1.25rem; background: var(--brand-soft);
  box-shadow: inset 0 1px 0 var(--glass-shine); z-index: 0; pointer-events: none;
  transition: transform .55s var(--spring), width .55s var(--spring), opacity .3s; }
.tab-pill.stretch { animation: stretch .55s var(--ease); }
@keyframes stretch { 40% { scale: 1.12 .9; } }
.tab { z-index: 1; }
.tab[aria-current="page"]::before { content: none; }

/* Réactions au toucher plus douces */
.btn, .chip-btn, .row, .bcard, .mini, .ai-card, .icon-btn, .model, .chip label { transition: transform .25s var(--spring), background .25s, box-shadow .25s, border-color .25s; }
.row:active, .chip-btn:active, .mini:active { transform: scale(.98); }
@media (hover: hover) {
  .bcard:hover, .ai-card:hover, .model:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow), 0 .75rem 1.5rem rgb(40 40 110 / .10); }
  .btn-primary:hover { filter: brightness(1.06); }
}
.sheet-in { animation: sheet-in .42s var(--spring); }
@keyframes sheet-in { from { opacity: .3; transform: translateY(2.5rem) scale(.98); } }
.toast { animation: pop .35s var(--spring); }

/* ===== Modifier un budget ===== */
.edit-hint { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 650; color: var(--brand-ink); order: 3; justify-self: end; }
.edit-hint .i { width: .9rem; height: .9rem; }
.bcard .progress { order: 2; }
.ins-btn { margin-left: auto; min-height: 2.25rem; padding: 0 .875rem; flex: none; }
.stepper { display: flex; align-items: center; gap: .625rem; }
.stepper-in { flex: 1; position: relative; display: flex; align-items: center; }
.stepper-in .big-input { padding-right: 2.5rem; }
.stepper-in .cur { position: absolute; right: 1rem; font-size: 1.5rem; font-weight: 700; color: var(--muted); }
.big-input.center { text-align: center; }
.step-btn { width: 3.25rem; height: 3.25rem; flex: none; border-radius: 50%; border: 1px solid var(--glass-edge); background: var(--glass); font-size: 1.6rem; font-weight: 600; line-height: 1;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 var(--glass-shine); transition: transform .2s var(--spring); }
.step-btn:active { transform: scale(.88); }
.quick-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .75rem; }
.bprev { display: grid; gap: .5rem; padding: .875rem 1rem; border-radius: 1.125rem; background: var(--surface-2); font-size: .9rem; }
.bprev .progress { margin: 0; }
.bprev-msg { font-weight: 600; }
.bprev-msg.over { color: var(--out); } .bprev-msg.warn { color: var(--warn); } .bprev-msg.ok { color: var(--ok); }
.bprev-total { color: var(--muted); font-size: .84rem; }
.bprev-total.over { color: var(--out); font-weight: 600; }

/* ===== Avis des utilisateurs ===== */
.fb-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.fb-type { display: grid; justify-items: center; gap: .3rem; padding: .75rem .25rem; border-radius: 1.125rem; border: 1.5px solid transparent; background: var(--surface-2); font-size: .8rem; font-weight: 650; }
.fb-type .i { width: 1.4rem; height: 1.4rem; }
.fb-type[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.stars { display: flex; gap: .35rem; justify-content: center; }
.star { border: 0; background: none; padding: .25rem; color: color-mix(in srgb, var(--muted) 35%, transparent); transition: transform .25s var(--spring), color .2s; }
.star .i { width: 2rem; height: 2rem; fill: currentColor; stroke: none; }
.star[aria-checked="true"] { color: #f5b301; }
.star:active { transform: scale(.8); }
.textarea { width: 100%; min-height: 8rem; padding: .875rem 1rem; border-radius: 1rem; border: 1px solid var(--line); background: var(--surface-2); resize: vertical; font: inherit; color: inherit; }
.textarea:focus { outline: none; border-color: var(--brand); }
.count { text-align: right; font-size: .75rem; color: var(--muted); margin-top: .25rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-done { display: grid; justify-items: center; gap: .75rem; text-align: center; padding: 1rem 0; }
.fb-done .big-emoji { font-size: 3rem; animation: pop-in .6s var(--spring) both; }
.fb-card { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; padding: .875rem 1rem; border-radius: var(--r); }
.fb-card .mid { flex: 1; display: grid; }
.fb-card .mid span { font-size: .85rem; color: var(--muted); }
.fb-card .ins-i { background: linear-gradient(135deg, #f5b301, #f2711c); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== Mode exemple : bandeau + guide (v1.4) ===== */
.demo-banner { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: .625rem; margin: 0 0 .875rem; padding: .625rem .75rem .625rem .875rem;
  border-radius: 1.125rem; background: linear-gradient(120deg, #fff4d6, #ffe7f1); color: #4a3200; border: 1px solid rgb(245 179 1 / .45);
  box-shadow: 0 .5rem 1.25rem rgb(245 179 1 / .18); }
:root[data-theme="dark"] .demo-banner { background: linear-gradient(120deg, #3a2a05, #3b1530); color: #ffe7a8; border-color: rgb(245 179 1 / .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-banner { background: linear-gradient(120deg, #3a2a05, #3b1530); color: #ffe7a8; border-color: rgb(245 179 1 / .35); } }
.demo-dot { width: .625rem; height: .625rem; border-radius: 50%; background: #f5b301; flex: none; box-shadow: 0 0 0 .25rem rgb(245 179 1 / .25); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 .5rem rgb(245 179 1 / 0); } }
.demo-txt { flex: 1; display: grid; line-height: 1.25; min-width: 0; }
.demo-txt strong { font-size: .9rem; }
.demo-txt span { font-size: .78rem; opacity: .85; }
.demo-btn { flex: none; border: 0; border-radius: 999px; padding: .55rem .875rem; font-weight: 700; font-size: .8rem; color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2)); box-shadow: 0 .375rem .875rem rgb(110 60 235 / .3); }
.big-emoji { font-size: 3rem; line-height: 1; }
.hint.center { text-align: center; }

.coach { position: fixed; inset: 0; z-index: 90; }
.coach-spot { position: fixed; box-shadow: 0 0 0 200vmax rgb(8 8 20 / .62); transition: all .45s var(--spring); pointer-events: none; outline: 2px solid rgb(255 255 255 / .85); outline-offset: 2px; }
.coach-bubble { position: fixed; padding: 1rem 1.125rem; border-radius: 1.25rem; background: var(--surface); color: var(--text); box-shadow: 0 1rem 2.5rem rgb(0 0 0 / .35);
  display: grid; gap: .4rem; animation: pop-in .35s var(--spring); transition: top .45s var(--spring), left .45s var(--spring), bottom .45s var(--spring); }
.coach-bubble strong { font-size: 1.05rem; }
.coach-bubble p { color: var(--muted); font-size: .92rem; }
.coach-step { font-size: .75rem !important; font-weight: 700; color: var(--brand-ink) !important; letter-spacing: .04em; }
.coach-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.coach-actions .btn { min-height: 2.6rem; padding: 0 1rem; font-size: .9rem; }

/* ===== Bilan annuel ===== */
.report-card { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; padding: .875rem 1rem; border-radius: var(--r); border: 1px solid rgb(91 75 232 / .25);
  background: linear-gradient(120deg, rgb(91 75 232 / .12), rgb(16 163 127 / .10)); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 var(--glass-shine); }
.report-card .mid { flex: 1; display: grid; min-width: 0; }
.report-card .mid span { font-size: .82rem; color: var(--muted); }
.report-ico { width: 2.6rem; height: 2.6rem; border-radius: .9rem; display: grid; place-items: center; color: #fff; flex: none; background: linear-gradient(135deg, var(--brand), #10a37f); }
.report { display: grid; gap: .875rem; }
.report .card { gap: .6rem; }
.report h3 { margin: 0; font-size: 1rem; }
.report .card p { font-size: .92rem; }
.kpis-4 { grid-template-columns: repeat(2, 1fr); }
.kpis-4 strong { font-size: 1.15rem; }
.rlist { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; font-size: .9rem; }
.rlist.tips li::marker { color: var(--ok); }
.file-in { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ===== Profils (v1.5) — écran « Qui utilise Budgy ? » façon plateforme de streaming ===== */
.profiles { position: absolute; inset: 0; z-index: 30; overflow-y: auto; display: flex;
  background: radial-gradient(120% 80% at 20% 0%, #2a1f6b 0%, transparent 60%), radial-gradient(100% 70% at 90% 100%, #3b1450 0%, transparent 60%), #07070c; color: #f2f2f7; }
.picker { margin: auto; width: 100%; padding: calc(var(--safe-t) + 2rem) 1.5rem calc(var(--safe-b) + 2rem); display: grid; justify-items: center; gap: 1.25rem; text-align: center; }
.picker-logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; letter-spacing: -.02em; opacity: .9; }
.picker-logo img { width: 2rem; height: 2rem; }
.picker h1 { margin: .25rem 0 0; font-size: 1.75rem; letter-spacing: -.03em; font-weight: 750; }
.picker-sub { color: #b9b9c8; max-width: 22rem; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 8.5rem)); gap: 1.5rem 1.25rem; justify-content: center; margin-top: .5rem; }
.profile-tile { border: 0; background: none; color: inherit; display: grid; justify-items: center; gap: .6rem; padding: .25rem; border-radius: 1.25rem;
  animation: tile-in .55s var(--spring) both; transition: transform .25s var(--spring); }
@keyframes tile-in { from { opacity: 0; transform: translateY(1rem) scale(.9); } }
.profile-tile:active { transform: scale(.94); }
.tile-av { position: relative; display: block; border-radius: 1.5rem; transition: box-shadow .25s, transform .3s var(--spring); }
.profile-tile:focus-visible .tile-av, .profile-tile:hover .tile-av { box-shadow: 0 0 0 3px #fff; }
.profile-tile.current .tile-av { box-shadow: 0 0 0 3px #8f84ff; }
.tile-name { font-weight: 600; color: #d9d9e3; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-tile.chosen .tile-av { transform: scale(1.18); box-shadow: 0 0 0 3px #fff, 0 0 3rem rgb(143 132 255 / .6); }
.profile-tile.chosen ~ .profile-tile, .profile-grid:has(.chosen) .profile-tile:not(.chosen) { opacity: .25; transition: opacity .3s; }
.tile-edit { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; background: rgb(0 0 0 / .45); color: #fff; }
.tile-edit .i { width: 2rem; height: 2rem; }
.add-av { background: rgb(255 255 255 / .08) !important; border: 2px dashed rgb(255 255 255 / .35); color: #fff; }
.add-av .i { width: 2.4rem; height: 2.4rem; }
.picker-actions { display: flex; gap: .625rem; margin-top: .5rem; }
.picker-actions .btn { background: rgb(255 255 255 / .08); color: #fff; border-color: rgb(255 255 255 / .25); }
.picker-note { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: #8d8d9e; max-width: 20rem; }

/* Avatars */
.avatar { display: grid; place-items: center; overflow: hidden; border-radius: 30%; flex: none; box-shadow: inset 0 1px 0 rgb(255 255 255 / .35); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-emoji { line-height: 1; filter: drop-shadow(0 .15rem .25rem rgb(0 0 0 / .2)); }
.av-initials { font-weight: 800; color: #fff; }
.avatar.img { background: #2a2d36; }
.avatar.sm { width: 2.75rem; height: 2.75rem; border-radius: 32%; } .avatar.sm .av-emoji { font-size: 1.4rem; } .avatar.sm .av-initials { font-size: .9rem; }
.avatar.md { width: 3.25rem; height: 3.25rem; } .avatar.md .av-emoji { font-size: 1.7rem; }
.avatar.xl { width: 7.5rem; height: 7.5rem; border-radius: 1.5rem; } .avatar.xl .av-emoji { font-size: 3.8rem; } .avatar.xl .av-initials { font-size: 2.4rem; }
.me-btn { border: 0; padding: 0; background: none; border-radius: 32%; transition: transform .2s var(--spring); }
.me-btn:active { transform: scale(.9); }
.me-btn .avatar { box-shadow: 0 0 0 2px var(--glass-edge), 0 .375rem 1rem rgb(0 0 0 / .15); }

/* Éditeur de profil */
.pe-preview { display: grid; justify-items: center; gap: .5rem; padding: .5rem 0 .25rem; }
.pe-preview .avatar { animation: pop-in .4s var(--spring); }
.pe-name { font-weight: 700; font-size: 1.1rem; }
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; justify-items: center; }
.preset { border: 0; background: none; padding: .2rem; border-radius: 30%; transition: transform .2s var(--spring), box-shadow .2s; }
.preset[aria-checked="true"] { box-shadow: 0 0 0 3px var(--brand); transform: scale(1.06); }
.preset:active { transform: scale(.9); }
.link-row { display: flex; gap: .5rem; align-items: center; }
.link-row .input { flex: 1; min-width: 0; }

/* ===== v1.6 : déménagement + sauvegarde ===== */
.moving-banner { display: grid; gap: .35rem; margin: 0 0 .875rem; padding: .875rem 1rem; border-radius: 1.125rem; color: #0b3b5b;
  background: linear-gradient(120deg, #d7f0ff, #e3e0ff); border: 1px solid rgb(47 128 237 / .35); }
:root[data-theme="dark"] .moving-banner { color: #d7ecff; background: linear-gradient(120deg, #0d2a40, #231d47); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .moving-banner { color: #d7ecff; background: linear-gradient(120deg, #0d2a40, #231d47); } }
.moving-banner span { font-size: .86rem; }
.moving-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.moving-actions .btn { min-height: 2.5rem; font-size: .88rem; text-decoration: none; }
.picker-restore { background: rgb(255 255 255 / .08) !important; color: #fff !important; border-color: rgb(255 255 255 / .25) !important; }
