/* ───────── Pépite — design tokens ───────── */
:root {
  --bg: #f4f5fa; --surface: #ffffff; --surface-2: #f0f2f8; --surface-3: #e6e9f2;
  --text: #121826; --muted: #6a7589; --line: #e7e9f1;
  --brand: #6d5efc; --brand-2: #00c2a8; --brand-soft: rgba(109, 94, 252, .11); --brand-ink: #5546e8;
  --pos: #0f9d63; --neg: #e5484d; --warn: #e8890c;
  --pos-soft: rgba(15, 157, 99, .12); --neg-soft: rgba(229, 72, 77, .11); --warn-soft: rgba(232, 137, 12, .13);
  --shadow: 0 1px 2px rgba(18, 24, 38, .04), 0 10px 28px -14px rgba(18, 24, 38, .16);
  --ring: 0 0 0 3px rgba(109, 94, 252, .28);
  --r: 20px; --r-sm: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0f18; --surface: #131a28; --surface-2: #1a2336; --surface-3: #232e45;
  --text: #e9edf6; --muted: #8b98b1; --line: #222c42;
  --brand: #8b7fff; --brand-ink: #a79eff; --brand-soft: rgba(139, 127, 255, .16);
  --pos: #34d399; --neg: #ff6b70; --warn: #fbb34a;
  --pos-soft: rgba(52, 211, 153, .14); --neg-soft: rgba(255, 107, 112, .14); --warn-soft: rgba(251, 179, 74, .15);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 14px 34px -18px rgba(0, 0, 0, .7);
  --ring: 0 0 0 3px rgba(139, 127, 255, .4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f18; --surface: #131a28; --surface-2: #1a2336; --surface-3: #232e45;
    --text: #e9edf6; --muted: #8b98b1; --line: #222c42;
    --brand: #8b7fff; --brand-ink: #a79eff; --brand-soft: rgba(139, 127, 255, .16);
    --pos: #34d399; --neg: #ff6b70; --warn: #fbb34a;
    --pos-soft: rgba(52, 211, 153, .14); --neg-soft: rgba(255, 107, 112, .14); --warn-soft: rgba(251, 179, 74, .15);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 14px 34px -18px rgba(0, 0, 0, .7);
    --ring: 0 0 0 3px rgba(139, 127, 255, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; min-height: 100dvh;
}
body.noscroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 12px; }
.ic { width: 22px; height: 22px; flex: none; }
.mut { color: var(--muted); }
.sm { font-size: 13px; }
.xs { font-size: 12px; }
.b { font-weight: 650; }
.right { text-align: right; }
.hide { display: none !important; }
@media (max-width: 560px) { .hide-s { display: none; } }

/* montants */
.amt { white-space: nowrap; transition: filter .25s; }
.amt.pos { color: var(--pos); }
html.privacy .amt { filter: blur(9px); user-select: none; }
html.privacy .hero .amt { filter: blur(12px); }

/* ───────── Structure ───────── */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; padding: 22px 14px 18px; display: flex; flex-direction: column;
  gap: 4px; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; font-weight: 750; font-size: 20px; letter-spacing: -.02em; }
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 14px; color: var(--muted);
  font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.side-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.sync-chip { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); flex: none; }
.dot.warn { background: var(--warn); } .dot.off { background: var(--muted); opacity: .6; } .dot.bad { background: var(--neg); }

.main { min-width: 0; padding: 26px clamp(16px, 3.2vw, 44px) 56px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 750; letter-spacing: -.025em; }
.head-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s, color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.spin .ic { animation: spin .9s linear infinite; }
.icon-btn.light { background: rgba(255, 255, 255, .18); border-color: transparent; color: #fff; width: 36px; height: 36px; border-radius: 12px; }
.icon-btn.light:hover { background: rgba(255, 255, 255, .28); color: #fff; }

.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(104px + var(--safe-b)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + var(--safe-b)); z-index: 30; padding: 6px; border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line);
    box-shadow: 0 14px 40px -12px rgba(18, 24, 38, .28);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 18px;
    color: var(--muted); font-size: 11px; font-weight: 650; transition: color .15s, background .15s;
  }
  .tab .ic { width: 23px; height: 23px; }
  .tab.on { color: var(--brand-ink); background: var(--brand-soft); }
}

/* ───────── Cartes & grille ───────── */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c7 { grid-column: span 7; } .c6 { grid-column: span 6; }
.c5 { grid-column: span 5; } .c4 { grid-column: span 4; }
@media (max-width: 900px) { .grid > * { grid-column: 1 / -1; } .grid { gap: 14px; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px;
  box-shadow: var(--shadow); min-width: 0;
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 12px; flex-wrap: wrap; }
body { overflow-x: clip; }
.card-h h2 { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.link { color: var(--brand-ink); font-weight: 650; font-size: 13.5px; }
.link:hover { text-decoration: underline; }
.rise { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }

.hero {
  position: relative; overflow: hidden; color: #fff; border: 0; padding: 22px 22px 18px;
  background: radial-gradient(120% 140% at 0% 0%, #8a7dff 0%, #6d5efc 38%, #3d8ee8 78%, #00c2a8 120%);
  box-shadow: 0 22px 44px -22px rgba(109, 94, 252, .7);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 260px; height: 260px; right: -70px; top: -110px; background: rgba(255, 255, 255, .09); }
.hero::after { width: 180px; height: 180px; left: -50px; bottom: -90px; background: rgba(255, 255, 255, .07); }
.hero > * { position: relative; z-index: 1; }
.hero .lbl { font-size: 13px; opacity: .82; font-weight: 600; }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero-amt { font-size: clamp(36px, 6.4vw, 52px); font-weight: 760; letter-spacing: -.035em; line-height: 1.1; margin: 4px 0 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; padding: 4px 10px;
  border-radius: 99px; background: var(--surface-2); color: var(--muted);
}
.hero .pill { background: rgba(255, 255, 255, .2); color: #fff; }
.pill.up { background: var(--pos-soft); color: var(--pos); } .pill.down { background: var(--neg-soft); color: var(--neg); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.hero .spark { margin: 8px -22px 6px; height: 64px; }
.hero .spark svg { width: 100%; height: 100%; display: block; }
.hero-foot { display: flex; gap: 28px; margin-top: 6px; }
.hero-foot b { display: block; font-size: 17px; letter-spacing: -.01em; }

/* ───────── Listes ───────── */
.row { display: flex; align-items: center; gap: 13px; padding: 11px 0; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
a.row, button.row { border-radius: 12px; transition: background .12s; }
.ico {
  --c: #6d5efc; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 20px;
  flex: none; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
}
.ico .ic { width: 21px; height: 21px; }
.ico.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 16px; }
.row-main { flex: 1; min-width: 0; display: grid; }
.row-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; font-weight: 650; flex: none; }
.row-end small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }

.day { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 4px 6px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.day:first-child { padding-top: 6px; }
.txs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 14px; }
.txgroup .tx:last-child { border-bottom: 0; }
.tx { display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px 0; text-align: left; border-bottom: 1px solid var(--line); border-radius: 0; }
.tx:hover .tx-label { color: var(--brand-ink); }
.tx-main { flex: 1; min-width: 0; display: grid; }
.tx-label { font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .12s; }
.tx-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .amt { font-weight: 680; flex: none; }
.daybox { margin-bottom: 4px; }
.daybox .txs { padding: 2px 14px; }

/* ───────── Contrôles ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 14px; font-weight: 680; background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: transform .12s, background .15s, box-shadow .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--brand), #4f8cff); color: #fff; border-color: transparent; box-shadow: 0 10px 22px -10px rgba(109, 94, 252, .85); }
.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--brand), #4f8cff); }
.btn.danger { color: var(--neg); } .btn.danger.solid { background: var(--neg); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-ink); }
.btn.sm { min-height: 36px; padding: 0 13px; border-radius: 12px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ic { width: 19px; height: 19px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl-s { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2);
  border: 1.5px solid transparent; transition: border-color .15s, background .15s; outline: none;
}
.input:focus { border-color: var(--brand); background: var(--surface); box-shadow: var(--ring); }
textarea.input { resize: vertical; min-height: 84px; font-family: inherit; }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.input::placeholder { color: var(--muted); opacity: .8; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two.keep { grid-template-columns: 1fr 1fr; } }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 6px; margin: 0 -1px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 15px; border-radius: 99px; font-weight: 650; font-size: 13.5px; background: var(--surface);
  border: 1px solid var(--line); color: var(--muted); transition: all .15s;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .x { margin-left: 6px; opacity: .6; }

.seg { display: inline-grid; grid-auto-flow: column; background: var(--surface-2); padding: 4px; border-radius: 14px; gap: 2px; }
.seg button { padding: 8px 16px; border-radius: 11px; font-weight: 650; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(20px); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; }

.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.search { position: relative; flex: 1; min-width: 0; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search .input { padding-left: 44px; background: var(--surface); border-color: var(--line); }
.monthbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.monthnav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 3px; }
.monthnav button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); }
.monthnav button:hover { background: var(--surface-2); color: var(--text); }
.monthnav button[disabled] { opacity: .3; pointer-events: none; }
.monthnav .mlabel { min-width: 138px; text-align: center; font-weight: 700; text-transform: capitalize; }
.sumstrip { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); padding: 2px 4px 8px; }
.sumstrip b { color: var(--text); font-weight: 700; }

/* ───────── Graphiques ───────── */
.donut-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: center; }
@media (max-width: 560px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .legend { width: 100%; } }
.donut { width: 200px; height: 200px; display: block; }
.donut .seg { transition: stroke-dasharray 1s cubic-bezier(.2, .8, .2, 1); }
.donut-c { position: relative; width: 200px; height: 200px; }
.donut-c .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-c .center b { font-size: 24px; letter-spacing: -.02em; display: block; }
.donut-c .center span { font-size: 12.5px; color: var(--muted); }
.legend { display: grid; gap: 2px; }
.leg { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 12px; }
a.leg:hover { background: var(--surface-2); }
.leg .ico { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; }
.leg-t { font-size: 14px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-v { text-align: right; font-weight: 680; font-size: 14px; }
.leg-v small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.minibar { grid-column: 2 / 4; height: 5px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin-top: -3px; }
.minibar i { display: block; height: 100%; border-radius: 9px; background: var(--c, var(--brand)); width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1); }

.chart-svg { width: 100%; display: block; overflow: visible; }
.bars .grp { cursor: pointer; }
.bars .bar-rect { transform-box: fill-box; transform-origin: bottom; animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); transition: opacity .2s; }
.bars .grp:not(.sel) .bar-rect { opacity: .38; }
.bars text { fill: var(--muted); font-size: 11.5px; font-weight: 600; text-anchor: middle; }
.bars .grp.sel text { fill: var(--text); }
.cap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.cap b { font-size: 14px; }
.cap .k { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.cap .k i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.pace-wrap { position: relative; touch-action: pan-y; }
.pace-wrap .tip {
  position: absolute; top: 0; pointer-events: none; transform: translateX(-50%); background: var(--text); color: var(--surface);
  padding: 7px 11px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; z-index: 2; opacity: 0; transition: opacity .12s;
}
.pace-wrap .tip small { display: block; font-weight: 500; opacity: .75; }
.pace-wrap.on .tip { opacity: 1; }
.pace-axis text { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.path-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.3, .7, .2, 1) .15s forwards; }

.bar { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--c, var(--brand)); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.bar.warn > i { background: var(--warn); } .bar.over > i { background: var(--neg); }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring .tr { stroke: var(--surface-2); }
.ring .pg { transition: stroke-dasharray 1.1s cubic-bezier(.2, .8, .2, 1); }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .mid b { font-size: 22px; letter-spacing: -.02em; }
.ring .mid span { font-size: 11.5px; color: var(--muted); }
.budget-top { display: flex; align-items: center; gap: 22px; }
@media (max-width: 480px) { .budget-top { flex-direction: column; align-items: flex-start; } }
.bgt { display: grid; gap: 9px; padding: 14px 4px; width: 100%; text-align: left; }
.bgt + .bgt { border-top: 1px solid var(--line); }
.bgt-h { display: flex; align-items: center; gap: 12px; }

/* ───────── Panneaux, états ───────── */
.banner { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--text); margin-bottom: 14px; font-size: 14px; }
.banner .ic { color: var(--warn); }
.banner.bad .ic { color: var(--neg); } .banner.bad { background: var(--neg-soft); }
.banner.info { background: var(--brand-soft); } .banner.info .ic { color: var(--brand-ink); }
.banner .grow { flex: 1; min-width: 0; }
.nudge { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: var(--r); background: linear-gradient(135deg, var(--brand-soft), var(--pos-soft)); border: 1px solid var(--line); }
.nudge .grow { flex: 1; min-width: 0; }
.empty { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.welcome { max-width: 760px; margin: 20px auto 0; text-align: center; padding: 38px 26px; }
.welcome h2 { font-size: 26px; letter-spacing: -.025em; margin-bottom: 8px; }
.welcome .opts { display: grid; gap: 12px; margin-top: 26px; text-align: left; }
.opt-card { display: flex; align-items: center; gap: 15px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); width: 100%; text-align: left; transition: transform .15s, border-color .15s; }
.opt-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.opt-card .grow { flex: 1; min-width: 0; } .opt-card b { display: block; }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--r); padding: 36px 18px; text-align: center; background: var(--surface-2);
  transition: all .15s; cursor: pointer; display: grid; gap: 6px; justify-items: center;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .ic { width: 34px; height: 34px; color: var(--brand-ink); }
.steps { counter-reset: s; display: grid; gap: 10px; }
.steps li { list-style: none; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.steps li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 750; font-size: 13px; }
.steps { padding: 0; margin: 0; }
code, .code { background: var(--surface-2); padding: 2px 7px; border-radius: 8px; font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
details.fold { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 14px; background: var(--surface-2); margin-bottom: 14px; }
details.fold summary { cursor: pointer; font-weight: 680; padding: 10px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 700; padding: 6px 8px; font-size: 12px; }
.tbl td { padding: 7px 8px; border-top: 1px solid var(--line); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.map-grid .input { min-height: 40px; padding: 6px 10px; font-size: 13.5px; }
.bank-list { display: grid; gap: 4px; max-height: 46vh; overflow: auto; margin: 4px -6px 0; padding: 0 6px; }
.bank { display: flex; align-items: center; gap: 13px; padding: 10px; border-radius: 14px; text-align: left; width: 100%; }
.bank:hover { background: var(--surface-2); }
.bank img, .bank .logo { width: 38px; height: 38px; border-radius: 11px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; display: grid; place-items: center; font-weight: 750; color: var(--brand-ink); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.cat-tile { display: grid; justify-items: center; gap: 4px; padding: 11px 6px 9px; border-radius: 16px; background: var(--surface-2); border: 2px solid transparent; font-size: 12.5px; font-weight: 640; text-align: center; line-height: 1.2; transition: transform .12s, border-color .12s; }
.cat-tile:hover { transform: translateY(-2px); }
.cat-tile.on { border-color: var(--brand); background: var(--brand-soft); }
.cat-tile span:first-child { font-size: 24px; }
.group-t { font-size: 12px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; background: var(--c); }
.sw.on { border-color: var(--text); }

/* ───────── Feuilles & toasts ───────── */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(8, 12, 22, .52); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
.overlay.closing { animation: fadeout .18s both; }
.sheet {
  width: min(560px, 100%); max-height: 90dvh; display: flex; flex-direction: column; background: var(--surface);
  border-radius: 28px 28px 0 0; box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .5); animation: sheetup .32s cubic-bezier(.2, .9, .3, 1) both;
}
.overlay.closing .sheet { animation: sheetdown .18s ease-in both; }
.sheet.wide { width: min(760px, 100%); }
.grab { width: 40px; height: 4px; border-radius: 9px; background: var(--surface-3); margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 6px 22px; flex: none; }
.sheet-head h2 { font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.sheet-head .icon-btn { border: 0; background: var(--surface-2); width: 38px; height: 38px; }
.sheet-body { padding: 8px 22px calc(22px + var(--safe-b)); overflow: auto; overscroll-behavior: contain; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 28px; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6); animation-name: pop; }
  .grab { display: none; }
  .overlay.closing .sheet { animation-name: popout; }
}
.sheet-amount { font-size: 34px; font-weight: 760; letter-spacing: -.03em; line-height: 1.1; }
#toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); display: grid; gap: 8px; width: min(440px, calc(100% - 28px)); pointer-events: none; }
@media (min-width: 901px) { #toasts { bottom: 28px; } }
.toast { background: var(--text); color: var(--surface); padding: 13px 16px; border-radius: 16px; font-weight: 600; font-size: 14px; box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .5); animation: toastin .3s cubic-bezier(.2, .9, .3, 1) both; display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--neg); color: #fff; }
.toast.out { animation: toastout .25s both; }

/* ───────── Connexion ───────── */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.auth::before, .auth::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; }
.auth::before { width: 460px; height: 460px; background: #7c6cff; left: -120px; top: -140px; }
.auth::after { width: 420px; height: 420px; background: #00c2a8; right: -120px; bottom: -140px; opacity: .4; }
.auth-card { position: relative; z-index: 1; width: min(420px, 100%); padding: 30px 26px 26px; text-align: center; backdrop-filter: blur(10px); }
.auth-card .logo { width: 68px; height: 68px; margin: 0 auto 14px; display: block; filter: drop-shadow(0 12px 18px rgba(109, 94, 252, .45)); }
.auth-card h1 { font-size: 28px; letter-spacing: -.03em; }
.auth-card form { text-align: left; margin-top: 22px; }
.err-msg { color: var(--neg); font-size: 13.5px; font-weight: 600; min-height: 20px; margin: -4px 0 8px; }

/* ───────── Chargement ───────── */
.sk { border-radius: var(--r); background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: shimmer 1.3s infinite linear; }
.sk-hero { height: 230px; } .sk-card { height: 190px; } .sk-line { height: 64px; border-radius: 16px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }

/* ───────── Animations ───────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } } @keyframes fadeout { to { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(100%); } } @keyframes sheetdown { to { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } } @keyframes popout { to { opacity: 0; transform: scale(.97); } }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.96); } } @keyframes toastout { to { opacity: 0; transform: translateY(8px); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
