/* Fée Lezcomptes — interface mobile d'abord, tons chauds (beige, terracotta). */
:root {
  --bg: #F5EEE3;
  --surface: #FFFCF7;
  --surface-2: #FAF4EA;
  --ink: #2B1D16;
  --ink-soft: #4A3A30;
  --muted: #6E5A4C;
  --line: #E8DCCB;
  --line-soft: #F0E6D8;
  --line-strong: #D8C6B2;
  --accent: #B4532F;
  --accent-ink: #FFFCF7;
  --accent-soft: #F4DDD0;
  --accent-soft-ink: #8E3B1E;
  --dark: #3A2418;
  --dark-2: #5C3B2A;
  --dark-muted: #D9C3B4;
  --good: #4F7A3A;
  --good-bright: #5E8C3A;
  --good-soft: #EAF0DF;
  --critical: #8E2316;
  --critical-soft: #F6DDD7;
  --warning: #B8862B;
  --warning-soft: #F7E6C8;
  --warning-ink: #7A4E12;
  --peach: #E9B89C;
  --peach-2: #EBC3AE;
  --radius: 22px;
  --shadow: 0 18px 40px -20px rgba(58, 36, 24, .45);
  --shadow-sm: 0 1px 2px rgba(58, 36, 24, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; display: block; }
.ico.flip, .flip { transform: rotate(180deg); }
.emo { font-size: 1.05em; line-height: 1; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
button, a, summary, label { transition: transform .16s ease, background-color .25s ease, color .25s ease, box-shadow .25s ease, border-color .25s ease; }
button:active:not(:disabled) { transform: scale(.96); }

/* --- Cadre --- */
.shell { max-width: 640px; margin: 0 auto; min-height: 100vh; padding: max(14px, env(safe-area-inset-top)) 18px calc(118px + env(safe-area-inset-bottom)); }
.page { display: flex; flex-direction: column; gap: 18px; padding-top: 16px; }
.page-in { animation: pageIn .34s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-title { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.page-stack { display: flex; flex-direction: column; gap: 10px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.month-pill { display: flex; align-items: center; gap: 2px; background: var(--surface); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); flex: none; }
.month-pill-label { min-width: 96px; padding: 0 6px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 16px; white-space: nowrap; }
.round-btn { width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--bg); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.round-btn.lg { width: 44px; height: 44px; background: var(--surface); box-shadow: var(--shadow-sm); }
.round-btn.active { background: var(--accent); color: var(--accent-ink); }
.sync-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sync-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--good-bright); flex: none; }
.sync-chip.off { background: var(--warning-soft); color: var(--warning-ink); }
.sync-chip.off .sync-dot { background: var(--critical); }
.sync-chip.busy .sync-dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Barre du bas */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20;
  width: min(604px, calc(100% - 28px)); height: 68px; background: var(--dark); border-radius: 26px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; box-shadow: 0 16px 30px -12px rgba(58, 36, 24, .55);
}
.tab { border: 0; background: transparent; color: #B79E8E; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 6px 0; }
.tab.active { color: var(--accent-ink); }
.tab-ico { position: relative; display: flex; }
.badge { position: absolute; top: -6px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.fab { justify-self: center; width: 58px; height: 58px; margin-top: -30px; border: 0; border-radius: 20px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 24px -8px var(--accent), 0 0 0 6px var(--bg); }

/* --- Blocs génériques --- */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.block-head h2, .card h2 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 700; }
.muted-sm { font-size: 12px; font-weight: 700; color: var(--muted); }
.link { border: 0; background: transparent; padding: 0; color: var(--accent); font-weight: 800; font-size: 13px; }
.link.center { align-self: center; margin-top: 4px; }
.neg { color: var(--critical); }
.empty-card { margin: 0; background: var(--surface); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--muted); font-weight: 600; font-size: 14px; }
.empty-note { color: var(--muted); font-size: 13px; margin: 4px 0; }
.done-card { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--good-soft); color: var(--good); border-radius: 18px; padding: 16px; font-weight: 800; font-size: 14px; }
.btn-primary { border: 0; border-radius: 16px; height: 48px; padding: 0 18px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 14px 28px -14px var(--accent); }
.btn-primary.big { height: 56px; border-radius: 18px; font-size: 16px; width: 100%; flex: none; }
.btn-ghost { height: 44px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-soft); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-dashed { width: 100%; height: 48px; border: 1px dashed var(--accent); border-radius: 14px; background: var(--surface); color: var(--accent); font-weight: 800; font-size: 14px; }
.ibox { width: 38px; height: 38px; border-radius: 13px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--c); font-size: 18px; }
.ibox.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; }
.dot { width: 9px; height: 9px; border-radius: 999px; background: var(--c); flex: none; display: inline-block; }
.dot.lg { width: 12px; height: 12px; border-radius: 4px; }
.bar { height: 6px; border-radius: 999px; background: var(--line-soft); display: flex; overflow: hidden; }
.bar > span { background: var(--accent); border-radius: 999px; transition: width .45s var(--ease); }
.pill-soft { font-size: 11px; font-weight: 800; color: var(--accent-soft-ink); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }

/* --- Carte sombre (solde) --- */
.hero { background: var(--dark); color: var(--accent-ink); border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-top > div { display: flex; flex-direction: column; gap: 4px; }
.hero-cap { font-size: 13px; color: var(--dark-muted); font-weight: 600; }
.hero-amount { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 11vw, 44px); letter-spacing: -1.5px; line-height: 1; }
.hero-amount.neg { color: #F2A48C; }
.hero-sub { font-size: 12.5px; color: var(--dark-muted); font-weight: 600; margin-top: 2px; }
.hero-sub b { color: var(--cream, #fff); font-weight: 800; }
.hero-sub.neg b { color: #F2A48C; }
.hero-badge { font-size: 12px; font-weight: 700; color: var(--dark); background: var(--peach-2); border-radius: 999px; padding: 6px 10px; white-space: nowrap; }
.hero-bar { display: flex; gap: 4px; height: 8px; }
.hero-bar .seg { flex-basis: 0; border-radius: 999px; transition: flex-grow .45s var(--ease), width .45s var(--ease); }
.seg-spent { background: var(--peach); display: block; }
.seg-spent.over { background: #EF6B4E; }
.hero-gauge { display: flex; flex-direction: column; gap: 8px; }
.info-text.hero-gauge-cap { margin: 0; font-size: 12px; color: var(--dark-muted); font-weight: 600; }
.info-text.hero-gauge-cap b { color: var(--accent-ink); font-weight: 800; white-space: nowrap; }
.hero-bar.single { background: var(--dark-2); border-radius: 999px; }
.hero-bar.single .seg { flex: none; height: 100%; }
.seg-good { background: var(--good-bright); display: block; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-stats span { font-size: 11px; color: var(--dark-muted); font-weight: 600; }
.hero-stats b { font-size: 15px; font-weight: 800; white-space: nowrap; }

/* --- Accueil --- */
.week-chips { display: flex; gap: 8px; }
.week-chip { flex: 1; border: 0; border-radius: 16px; padding: 10px 0; background: var(--surface); color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; }
.week-chip.now:not(.sel) { box-shadow: inset 0 0 0 2px var(--peach); }
.week-chip.sel { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 20px -10px var(--accent); }
.week-chip-date { font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .85; margin-top: -3px; }
.week-chip-bar { width: 26px; height: 4px; border-radius: 999px; background: var(--line); display: flex; overflow: hidden; }
.week-chip-bar span { background: var(--peach); border-radius: 999px; }
.week-chip.sel .week-chip-bar { background: rgba(255, 252, 247, .35); }
.week-chip.sel .week-chip-bar span { background: var(--accent-ink); }
.budget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.budget-tile { border: 0; background: var(--surface); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0; }
.budget-tile-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.budget-tile-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-ratio { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; }
.tile-ratio b { font-family: var(--display); font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.tile-ratio span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.budget-tile .bar { height: 8px; }
.tile-foot { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.tile-foot b { color: var(--ink); font-weight: 800; }
.tile-foot b.cut { color: var(--critical); }
.block-sub { margin: -6px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.seg { display: inline-flex; background: var(--line); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 800; color: var(--muted); padding: 4px 11px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.info-btn { border: 0; background: none; color: inherit; opacity: .55; padding: 2px; margin-left: 4px; vertical-align: -3px; display: inline-flex; cursor: pointer; border-radius: 999px; }
.info-btn.sel { opacity: 1; }
.info-text { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.45; }
.info-text b { color: var(--ink); }
.budget-tile.over .tile-ratio b { color: var(--critical); }
.budget-tile.over .bar > span { background: var(--critical); }
.fact.report b, .fact.report span { color: var(--critical); }

/* --- Lignes de mouvement : toucher pour dévoiler les actions --- */
.mv-list { display: flex; flex-direction: column; gap: 8px; }
.mv { position: relative; border-radius: 18px; overflow: hidden; background: var(--critical); min-height: 64px; }
.mv-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.mv-actions button { width: 76px; border: 0; color: var(--accent-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 800; }
.mv-edit { background: var(--accent); }
.mv-del { background: var(--critical); }
.mv-row { position: relative; width: 100%; min-height: 64px; border: 0; background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-align: left; transition: transform .28s var(--ease); }
.mv-row:active { transform: none; }
.mv.open .mv-row { transform: translateX(-152px); }
.mv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mv-label { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; min-width: 0; }
.mv-sub-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-pill { flex: none; font-size: 11px; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-radius: 999px; padding: 1px 8px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-amt { flex: none; font-size: 15px; font-weight: 800; }
.mv-amt.inc { color: var(--good); }

/* --- Détail d'un budget --- */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail-title { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 21px; font-weight: 700; min-width: 0; text-align: center; }
.ring-card { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 16; }
.ring-track { stroke: var(--line-soft); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .6s var(--ease); }
.ring-fill.over { stroke: var(--critical); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-center b { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.ring-center span { font-size: 11px; font-weight: 700; color: var(--muted); }
.ring-facts { flex: 1; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.fact { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.fact span { color: var(--muted); font-weight: 600; }
.fact.sep { border-top: 1px solid var(--line-soft); padding-top: 9px; }
.wbars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; height: 150px; margin-top: 12px; }
.wbar { border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.wbar-val { font-size: 10.5px; font-weight: 700; color: var(--muted); min-height: 14px; }
.wbar-fill { width: 100%; max-height: calc(100% - 40px); border-radius: 10px; background: var(--line); transition: height .45s var(--ease); }
.wbar-fill.used { background: var(--peach-2); }
.wbar-fill.sel { background: var(--accent); }
.wbar-fill.over { background: var(--critical); }
.wbar-lab { font-size: 12px; font-weight: 700; color: var(--muted); }
.wbar-lab.sel { color: var(--ink); font-weight: 800; }

/* --- Mouvements --- */
.search-row { display: flex; gap: 8px; }
.search-box { flex: 1; min-width: 0; height: 48px; display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 16px; padding: 0 12px; color: var(--muted); }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 15px; font-weight: 600; color: var(--ink); }
.search-box input::placeholder { color: #8A7768; }
.sheet .search-box { background: var(--bg); flex: none; }
.square-btn { position: relative; width: 48px; height: 48px; flex: none; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); display: flex; align-items: center; justify-content: center; padding: 0; }
.square-btn.on { background: var(--accent); color: var(--accent-ink); }
.square-btn .badge { top: -5px; right: -5px; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.pill-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -6px -18px 0; padding: 0 18px; }
.pill-row::-webkit-scrollbar { display: none; }
.filter-pill { flex: none; height: 32px; padding: 0 10px 0 12px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent-soft-ink); font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.grp-total { font-weight: 800; }
.grp-list { display: flex; flex-direction: column; gap: 10px; }
.grp { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.grp-head { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.grp-head::-webkit-details-marker { display: none; }
.grp-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grp-title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-title span { font-size: 12px; color: var(--muted); font-weight: 600; }
.grp-right { font-size: 14px; font-weight: 800; white-space: nowrap; text-align: right; }
.grp-right small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.chev { color: var(--muted); transition: transform .25s ease; }
details[open] > summary .chev { transform: rotate(180deg); }
.grp-body { padding: 8px; background: var(--surface-2); animation: fadeDown .22s ease; }
.grp-body .mv-row { background: var(--surface); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* --- Frais fixes --- */
.fixed-list { display: flex; flex-direction: column; gap: 8px; }
.fixed-row { min-height: 60px; border: 0; border-radius: 18px; background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-align: left; }
.fixed-row.paid { background: var(--surface-2); }
.check { width: 26px; height: 26px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; color: transparent; box-shadow: inset 0 0 0 2px var(--line-strong); transition: background-color .2s, color .2s; }
.fixed-row.paid .check { background: var(--good-bright); color: var(--accent-ink); box-shadow: none; }
.fixed-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fixed-name b { font-size: 14px; }
.fixed-name span { font-size: 12px; color: var(--muted); font-weight: 600; }
.fixed-row.paid .fixed-name b { color: var(--muted); text-decoration: line-through; }
.fixed-amt { font-size: 15px; font-weight: 800; }
.fixed-row.paid .fixed-amt { color: var(--muted); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 140px; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--surface); font-weight: 600; outline: none; }
.inline-form input[name="amount"] { flex: 0 1 110px; }
.inline-form input:focus { border-color: var(--accent); }

/* --- Statistiques --- */
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.ychart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; height: 150px; margin-top: 12px; }
.ycol { border: 0; background: transparent; padding: 4px 0 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.ycol.sel { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.ycol-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.yb { width: 38%; max-width: 9px; border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .45s var(--ease); }
.yb.inc { background: color-mix(in srgb, var(--good-bright) 55%, var(--surface)); }
.yb.out { background: var(--peach-2); }
.ycol.sel .yb.inc { background: var(--good-bright); }
.ycol.sel .yb.out { background: var(--accent); }
.ycol-lab { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.ycol.sel .ycol-lab { color: var(--ink); font-weight: 800; }
.stack-bar { display: flex; gap: 3px; height: 14px; margin-top: 14px; }
.stack-bar span { flex-basis: 0; border-radius: 999px; min-width: 4px; }
.share-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.share-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.share-name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-pct { width: 44px; text-align: right; color: var(--muted); font-weight: 600; }
.fold { padding: 0; }
.fold-head { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; font-family: var(--display); font-size: 17px; font-weight: 700; cursor: pointer; }
.fold-head::-webkit-details-marker { display: none; }
.fold[open] { padding-bottom: 14px; }
.table-title { margin: 6px 18px 8px; font-size: 14px; }
.table-scroll { overflow-x: auto; margin: 0 0 10px; padding: 0 18px; }
.stat-table { border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.stat-table th, .stat-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.stat-table th:first-child, .stat-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.stat-table th { color: var(--muted); font-weight: 700; }

/* --- Segments et pastilles --- */
.seg-group { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--bg); border-radius: 999px; padding: 4px; }
.card .seg-group { margin-top: 12px; }
.seg-group.compact { display: inline-grid; flex: none; }
.seg-btn { position: relative; height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 14px; cursor: pointer; }
.seg-btn.sel, .seg-btn:has(input:checked) { background: var(--dark); color: var(--accent-ink); font-weight: 800; }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg-btn:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.chip { flex: none; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
.chip-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.sel .dot { background: var(--accent-ink); }
.chip.more { border-style: dashed; border-color: var(--line-strong); color: var(--ink-soft); font-weight: 800; padding: 0 10px 0 12px; gap: 3px; margin-left: auto; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-row { display: flex; gap: 6px; align-items: center; }
.quick-scroll { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-left: -18px; padding-left: 18px; mask-image: linear-gradient(to right, #000 85%, transparent); }
.quick-scroll::-webkit-scrollbar { display: none; }
.quick-scroll .chip { max-width: 170px; }
.quick-row .chip.more { margin-left: 0; }

/* --- Feuilles (dialog ouverts par le bas) --- */
dialog { color: var(--ink); }
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  background: var(--surface); border-radius: 32px 32px 0 0; box-shadow: 0 -20px 40px -20px rgba(40, 24, 16, .45);
}
.sheet.tall { height: calc(100dvh - 56px); }
.sheet[open] { animation: sheetUp .32s var(--ease); }
.sheet.instant[open] { animation: none; }
.sheet::backdrop { background: rgba(40, 24, 16, .5); animation: fadeIn .3s ease; }
.sheet.instant::backdrop { animation: none; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-body { display: flex; flex-direction: column; gap: 14px; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); height: 100%; max-height: inherit; overflow-y: auto; }
.sheet.tall .sheet-body { overflow: hidden; }
.sheet-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; min-height: 0; margin: 0 -4px; padding: 0 4px 6px; }
.grabber { width: 44px; height: 5px; border-radius: 999px; background: var(--line-strong); align-self: center; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.sheet-title { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.sheet-title.sm { font-size: 14px; font-family: inherit; font-weight: 800; color: var(--muted); flex: 1; text-align: right; }
.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-cap { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.amount-field { display: flex; align-items: baseline; justify-content: center; gap: 4px; font-family: var(--display); font-weight: 800; color: var(--ink); padding-top: 4px; }
.amount-field input { field-sizing: content; min-width: 3.2ch; width: 5ch; min-width: 0; border: 0; background: transparent; outline: none; text-align: center; font: inherit; font-size: 52px; letter-spacing: -2px; color: inherit; padding: 0; }
.amount-field input::placeholder { color: #CDBDAC; }
.amount-sign, .amount-cur { font-size: 34px; }
.amount-field.inc { color: var(--good); }
.amount-field input.field-error { color: var(--critical); }
.line-field input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: center; font-size: 15px; font-weight: 600; padding: 8px 0; outline: none; }
.line-field input:focus { border-color: var(--accent); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pill-field { height: 46px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); min-width: 0; }
.pill-field input, .pill-field select { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14px; font-weight: 700; color: var(--ink); }
.pill-field:focus-within { border-color: var(--accent); }
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option { min-height: 68px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-align: left; }
.option.sel { border: 2px solid var(--accent); }
.option-ico { width: 42px; height: 42px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); }
.option.sel .option-ico { background: var(--accent); color: var(--accent-ink); }
.option-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.option-txt b { font-size: 15px; }
.option-txt span { font-size: 12px; color: var(--muted); font-weight: 600; }
.option-check { width: 24px; height: 24px; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center; color: transparent; box-shadow: inset 0 0 0 2px var(--line-strong); }
.option.sel .option-check { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick-tile { min-height: 58px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 8px 12px; display: flex; align-items: center; gap: 10px; text-align: left; min-width: 0; }
.pick-tile.sel { border: 2px solid var(--accent); }
.pick-tile[hidden] { display: none; }
.pick-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pick-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-txt span { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Modales centrées (confirmation, réglages) --- */
.modal { border: none; border-radius: var(--radius); padding: 0; background: var(--surface); max-width: 420px; width: calc(100% - 2rem); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(40, 24, 16, .5); }
.modal[open] { animation: popIn .22s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.modal-form { display: flex; flex-direction: column; gap: .9rem; padding: 1.25rem 1.4rem; max-height: 85vh; overflow-y: auto; }
.modal-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: .3rem; }
.card-title { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 700; }
.btn-secondary { border: 1px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: 12px; min-height: 42px; padding: 0 16px; font-weight: 700; font-size: 14px; }
.btn-danger { border: 0; background: var(--critical); color: var(--accent-ink); border-radius: 12px; min-height: 42px; padding: 0 16px; font-weight: 800; font-size: 14px; }
.btn-add { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 12px; min-height: 42px; padding: 0 16px; font-weight: 800; font-size: 14px; white-space: nowrap; }

/* Toast (hors de #app) */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000;
  max-width: calc(100% - 32px); background: var(--dark); color: var(--accent-ink); border-radius: 16px; padding: 12px 16px;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 14px; box-shadow: 0 14px 30px -10px rgba(58, 36, 24, .6);
}
.toast[hidden] { display: none; }
.toast.show { animation: toastIn .26s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast-btn { border: 0; background: transparent; color: var(--peach); font-weight: 800; padding: 4px 0; white-space: nowrap; }

/* --- Connexion et chargement --- */
.loading-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: var(--muted); font-weight: 600; padding: 24px; }
.loading-logo { width: 72px; height: 72px; border-radius: 20px; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 28px; padding: 28px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-logo { width: 76px; height: 76px; border-radius: 22px; align-self: center; }
.login-title { margin: 0; text-align: center; font-family: var(--display); font-size: 26px; font-weight: 800; }
.login-sub { margin: -8px 0 4px; text-align: center; color: var(--muted); font-weight: 600; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.login-card input[type="text"], .login-card input[type="password"] { height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--surface); font-size: 15px; font-weight: 600; color: var(--ink); outline: none; }
.login-card input:focus { border-color: var(--accent); }
.login-remember { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 600 !important; }
.login-remember input { accent-color: var(--accent); width: 18px; height: 18px; }
.login-error { margin: 0; color: var(--critical); background: var(--critical-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700; }

/* --- Installation --- */
.install-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); }
.install-banner img { border-radius: 10px; flex: none; }
.install-banner-main { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 0; text-align: left; }
.install-banner-main span { color: var(--muted); font-size: 12px; font-weight: 500; }
.install-banner .icon-btn { width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--bg); color: var(--muted); flex: none; }
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.install-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.install-steps code { word-break: break-all; }
.install-step-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }

/* --- Réglages (formulaires repris de l'ancienne interface) --- */
.settings .card { padding: 0; overflow: hidden; }
.settings details > summary.card-title { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; cursor: pointer; font-size: 17px; }
.settings details > summary.card-title::-webkit-details-marker { display: none; }
.settings details > summary.card-title::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s ease; }
.settings details[open] > summary.card-title::after { transform: rotate(-135deg) translate(-2px, -2px); }
.settings-body { display: flex; flex-direction: column; gap: 12px; padding: 0 18px 18px; animation: fadeDown .22s ease; }
.settings input[type="text"], .settings input[type="number"], .settings input[type="password"], .settings select, .modal-form input[type="text"], .modal-form input[type="number"] {
  height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--surface); font-weight: 600; color: var(--ink); outline: none; min-width: 0;
}
.settings input:focus, .settings select:focus, .modal-form input:focus { border-color: var(--accent); }
.stats-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat-tile { background: var(--surface); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.stat-value { font-family: var(--display); font-size: 19px; font-weight: 800; }
.stat-critical .stat-value { color: var(--critical); }
.stat-good .stat-value { color: var(--good); }
.ledger { display: flex; flex-direction: column; }
.ledger-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.amount-input { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.amount-input-sm { width: 84px; height: 34px !important; }
.chip-btn { width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px; background: var(--critical-soft); color: var(--critical); font-weight: 800; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-row input { flex: 1 1 120px; }
.add-row input[type="number"] { flex: 0 1 110px; }
.weeks-control { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 700; }
.weeks-control input { width: 80px; }
.envelopes-grid { display: flex; flex-direction: column; gap: 10px; }
.envelope-card { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 18px; }
.envelope-flap { display: none; }
.envelope-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.envelope-card-ephemeral { border-style: dashed; border-color: var(--line-strong); }
.envelope-card-add { border: 1px dashed var(--line-strong); padding: 12px; display: flex; justify-content: center; background: transparent; }
.envelope-header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.envelope-name { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.envelope-name-input { flex: 1; width: 100%; }
.budget-icon-lg { width: 42px; height: 42px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 20px; }
.tag-extra { font-size: 11px; font-weight: 800; color: var(--accent-soft-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 8px; }
.color-picker, .tag-color-picker { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; flex: none; }
.palette-toggle { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); flex: none; }
.color-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.color-choice { aspect-ratio: 1; border: 2px solid transparent; border-radius: 10px; }
.color-choice.selected { border-color: var(--ink); }
.envelope-amount-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.week-list { display: flex; flex-direction: column; gap: 6px; }
.week-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 12.5px; }
.week-label { color: var(--muted); font-weight: 700; }
.week-bar-track { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.week-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.week-bar-fill.week-good { background: var(--good-bright); }
.week-bar-fill.week-warning { background: var(--warning); }
.week-bar-fill.week-critical { background: var(--critical); }
.week-figures { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.amount-critical { color: var(--critical); font-weight: 800; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.icon-choice { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 20px; }
.icon-choice.selected { border: 2px solid var(--accent); background: var(--accent-soft); }
.add-envelope-form { display: flex; flex-direction: column; gap: 10px; }
.fixed-check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink) !important; flex-direction: row !important; }
.fixed-check-row input { accent-color: var(--accent); width: 18px; height: 18px; }
.tags-list { display: flex; flex-direction: column; gap: 8px; }
.tag-chip { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 14px; background: color-mix(in srgb, var(--tag-color) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tag-color) 30%, var(--surface)); }
.tag-name-input { flex: 1; width: auto !important; }
.tag-remove { width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px; background: var(--critical-soft); color: var(--critical); font-weight: 800; }
.payment-method-row { flex-wrap: wrap; }
.payment-method-name-input { flex: 1 1 120px; }
.payment-default-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.payment-default-label input { accent-color: var(--accent); }
.settings-form { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.settings-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field-error { border-color: var(--critical) !important; }

@media (min-width: 720px) {
  .shell { padding-left: 24px; padding-right: 24px; }
  .budget-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { margin-bottom: auto; border-radius: 28px; max-height: calc(100vh - 80px); }
  .sheet.tall { height: min(720px, calc(100vh - 80px)); }
  .sheet[open] { animation: popIn .24s var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== Dépenses planifiées ===== */
.hero-plan { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--dark-muted); }
.hero-plan b { color: var(--cream, #fff); font-weight: 800; }
.budget-tile .bar { position: relative; }
.tile-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; white-space: nowrap; min-width: 0; }
.tile-planned { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 800; color: var(--accent); }
.hero-plan { display: flex; align-items: center; gap: 5px; }
.hero-stats.four { grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 10px; }
.hero-stats.four b { font-size: 13.5px; }
.seg-planned { background: repeating-linear-gradient(45deg, var(--accent) 0 3px, var(--dark-2) 3px 6px); }
.bar-planned { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, var(--accent) 0 3px, color-mix(in srgb, var(--accent) 25%, var(--surface)) 3px 6px); }
.mv.planned .mv-amt { color: var(--muted); text-decoration: underline dashed var(--accent); text-underline-offset: 4px; }
.planned-pill { --c: var(--accent); }
.mv.planned .mv-actions button { width: 52px; }
.mv.planned.open .mv-row { transform: translateX(-208px); }
.mv-ok { background: var(--good); }
.mv-later { background: var(--peach); color: var(--ink) !important; }
.due-card { width: 100%; border: 1.5px solid var(--accent); background: var(--surface); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left; color: var(--ink); }
.due-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.due-main b { font-size: 14px; font-weight: 800; }
.due-main span { font-size: 12px; color: var(--muted); font-weight: 600; }
.due-item { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.due-item div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.due-item b { font-family: var(--display); font-size: 18px; font-weight: 700; }
.due-item span:not(.ibox) { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.due-btns { display: flex; flex-direction: column; gap: 8px; }
.due-btns .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 16px; }
.planned-block { display: flex; flex-direction: column; gap: 10px; }
.planned-block[hidden], .planned-ask[hidden] { display: none; }
.planned-ask { background: var(--peach); color: var(--ink); border-radius: 14px; padding: 10px 12px; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; gap: 8px; }
.planned-ask-btns { display: flex; gap: 8px; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 4px 2px; }
.switch-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.switch-txt b { font-size: 14px; font-weight: 800; }
.switch-txt span { font-size: 12px; color: var(--muted); font-weight: 600; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong, #d9ccbc); position: relative; transition: background .2s; margin: 0; cursor: pointer; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.push-note { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 6px 0 0; }

/* Carte du haut : le badge reste sur la ligne du titre, le gros montant prend toute la largeur
   (sinon, sur écran étroit, le montant repousse le badge contre le bord de la carte). */
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 10px; }
.hero-top > div { display: contents; }
.hero-top > div > * { grid-column: 1 / -1; }
.hero-top > div > .hero-cap { grid-column: 1; }
.hero-top > .hero-badge { grid-column: 2; grid-row: 1; justify-self: end; }
