/* Numexia · piste D, vague 2 : every screen besides Accueil and Budget › Mois. Loaded right after theme-d.css and uses
   only its tokens and components (cards, d-bar, pill, hero gradient, Outfit labels, Unbounded figures, mono for number
   columns). Charts take the palette D through the family tokens below. No looping animation; all off under reduced motion. */

/* ---------- Family colours (charts, icons, legends): palette D ---------- */
:root {
  --g-besoins: #7C5CFC; --g-envies: #F6B64A; --g-epargne: #A78BFA; --c-invest: #3DD9A4;
}
:root[data-theme="light"] {
  --g-besoins: #5A35F0; --g-envies: #C47F12; --g-epargne: #9474F5; --c-invest: #0E9F6E;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) { --g-besoins: #5A35F0; --g-envies: #C47F12; --g-epargne: #9474F5; --c-invest: #0E9F6E; }
}
/* Icons in a family colour stay legible on their tinted tile. */
.cat-ico.grp-besoins, .mlogo-ico.grp-besoins { color: color-mix(in srgb, var(--g-besoins) 70%, var(--ink-1)); }
:root[data-theme="light"] .cat-ico.grp-envies, :root[data-theme="light"] .mlogo-ico.grp-envies { color: #9A6100; }

/* ---------- Shared headers ---------- */
.view-head h1, .month-title h1 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; font-size: 26px; line-height: 1.15; }
@media (max-width: 599.98px) { .view-head h1, .month-title h1 { font-size: 23px; } }
.view-head .eyebrow, .month-title .eyebrow { margin: 0 0 2px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.view-head.sub h2, .section-head h2 { font-family: var(--font); font-weight: 600; font-size: 17px; letter-spacing: 0; }
.back-link { display: inline-flex; align-items: center; min-height: 32px; font-size: 13.5px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-head .muted.small, .card-head > span.muted { font-size: 12.5px; color: var(--ink-2); }
.eyebrow { text-transform: none; letter-spacing: 0; }

/* KPI tiles: same look as Budget › Mois. */
.kpis .kpi { padding: 14px 16px; gap: 4px; border-color: var(--border); }
.kpi > span:first-child { display: flex; align-items: center; gap: 4px; }
.kpi strong { font-size: 21px; line-height: 1.2; }
.kpi .muted.small, .kpi small { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.kpi .delta { font: 600 12.5px/1.35 var(--font); }
.kpi .delta .muted { font-weight: 500; }
@media (min-width: 900px) { .view > .kpis, .stack > .kpis, .proj-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .proj-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
button.kpi-btn { text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.kpi-btn:hover { border-color: var(--accent-line); }

/* Segmented controls: sentence labels, comfortable targets. */
.seg button { font-family: var(--font); font-weight: 600; text-transform: none; letter-spacing: 0; }
.seg.small button { font-size: 13px; }

/* Rec lists (Bilan, Analyses): the status chip sits right after the title, not floating mid-line. */
.rec-body { flex: 1; min-width: 0; }
.rec-title { justify-content: flex-start; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rec-title strong { font-size: 14.5px; font-weight: 600; }
.rec .rec-body p { font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.chip-status { font: 600 11.5px/1.2 var(--font); padding: 3px 9px; }
.chip-status span { font-size: 9px; }
.chip-status.status-warning span { color: var(--warn-ink); }

/* Tables: header labels in Outfit, numbers in mono (theme-d), tidy rows. */
.table th, .ledger th { text-transform: none; letter-spacing: 0; font: 500 12px/1.25 var(--font); color: var(--ink-3); }
.table td { border-color: var(--border); }
.table td.num, .ledger td.num, .table th.num { text-align: right; }
.subrows.big li { min-height: 36px; align-items: center; }
.delta { font-family: var(--font); font-weight: 600; }

/* Empty states */
.empty { padding: 36px 16px; gap: 8px; }
.empty strong { font: 500 17px/1.3 var(--font-display); letter-spacing: -0.01em; color: var(--ink-1); }
.empty p { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.empty-icon { border-radius: 18px; background: var(--accent-soft); color: var(--accent-text); }

/* Toasts: surface-3 glass, coloured edge. */
.toast { font: 500 14px/1.4 var(--font); padding: 12px 14px 12px 16px; border-radius: 16px; background: var(--surface-3); color: var(--ink-1); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); }
.toast-good, .toast-warning, .toast-critical { background: var(--surface-3); color: var(--ink-1); border-left: 4px solid var(--tone); }
.toast-good { --tone: var(--st-good); } .toast-warning { --tone: var(--st-warning); } .toast-critical { --tone: var(--st-critical); }
.toast-action { color: var(--accent-text); font-weight: 700; min-height: 40px; padding: 4px 6px; }

/* Focus: one visible ring everywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Budget › en-tête de mois ---------- */
.month-nav { gap: 8px; margin: 2px 0 0; }
.month-nav-row { gap: 8px; }
.month-nav .nav-arrow { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; }
.month-nav .nav-arrow:hover { border-color: var(--accent-line); }
.month-title { padding: 2px 8px; }
.month-title .caret { font-size: 13px; }
button.month-sum, p.month-sum-planned { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; padding: 0; margin: 0; font: 600 14px/1.25 var(--font); color: var(--ink-1); }
button.month-sum > span:not(.muted), p.month-sum-planned > span { display: inline-flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 44px; padding: 6px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
button.month-sum > span.muted, p.month-sum-planned > span.muted { display: none; }
button.month-sum > span.muted.small:last-child { display: inline-flex; align-items: center; padding: 0 4px; font-size: 14px; color: var(--accent-text); }
button.month-sum small, p.month-sum-planned small { font: 500 12px/1.2 var(--font); color: var(--ink-2); text-transform: none; letter-spacing: 0; }
button.month-sum .month-sum-est { font: 500 11.5px/1.3 var(--font); }
button.month-sum:hover > span:not(.muted) { border-color: var(--accent-line); }
button.month-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 14px; }
p.month-sum-planned > span:first-child { background: var(--accent-soft); border-color: var(--accent-line); }
p.month-sum-planned > span:first-child small { color: var(--accent-text); font-weight: 700; }
@media (min-width: 1100px) {
  .month-nav { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
  button.month-sum, p.month-sum-planned { margin-left: auto; }
  .month-nav > .msd { flex-basis: 100%; }
}
@media (max-width: 599.98px) {
  button.month-sum, p.month-sum-planned { gap: 6px; }
  button.month-sum > span:not(.muted), p.month-sum-planned > span { flex: 1 1 0; min-width: 0; padding: 6px 10px; }
}

/* Mois / Transactions / Bilan tabs + list/table switch */
.tx-views { display: flex; justify-content: flex-end; }

/* ---------- Budget › Transactions ---------- */
.subs-found .rows .row.static { background: none; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); border-radius: 0; }
.subs-found .rows li:first-child .row.static { border-top: 0; }
.subs-found .btn-row { margin: 0; flex-wrap: nowrap; }
@media (max-width: 599.98px) {
  .subs-found .rows .row.static { grid-template-columns: 32px minmax(0, 1fr); }
  .subs-found .btn-row { grid-column: 2; justify-content: flex-start; }
}
.filters { gap: 8px; align-items: stretch; }
.filters .input.search { min-height: 44px; border-radius: 14px; }
.filters .btn.small { min-height: 44px; border-radius: 12px; }
.day-head { padding: 0 4px; }
.txs { border-radius: 18px; border-color: var(--border); background: var(--surface); }
.tx .tx-amt, .tx .amt { font-family: var(--font); font-weight: 600; }
.bulk-bar { border-radius: 18px; background: var(--glass); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); }

/* Vue tableau */
.ledger, .table { font-size: 14px; }
.ledger thead th { padding-top: 10px; padding-bottom: 10px; }
.ledger tbody tr:hover { background: var(--inset); }
.ledger td.col-cat small, .ledger .muted.small { font-size: 12px; }
.ledger tfoot td { font-weight: 600; border-top: 1px solid var(--border-strong); }

/* ---------- Budget › Bilan ---------- */
.bilan-bar .notice { margin: 0; }
.verdict.d-verdict { padding: 18px 20px; background: linear-gradient(160deg, var(--hero-1), var(--surface) 60%); border-color: var(--hero-border); box-shadow: var(--hero-shadow); }
.d-verdict .eyebrow { font-size: 13px; color: var(--ink-2); }
.d-verdict .verdict-text { margin-top: 6px; font: 600 clamp(17px, 1.7vw, 20px)/1.4 var(--font); letter-spacing: 0; }
.bilan-pair:empty { display: none; }
.bilan-pair:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.plan li strong { font-weight: 600; }

/* ---------- Analyses ---------- */
.analyses .view-head { align-items: flex-end; }
.period-note { margin: -4px 0 0; }
.legend { font-size: 12.5px; color: var(--ink-2); gap: 6px 14px; }
.legend .sw, .sw { border-radius: 3px; }
.chart .tick, .chart text { font-family: var(--font); fill: var(--ink-3); }
.chart .grid line, .chart line.grid { stroke: var(--grid-line); }
.chart svg { overflow: visible; }
.hbar-fill { animation: grow-x .7s var(--ease) both; transform-origin: left; }
.insights ul li::marker { color: var(--accent); }
.ins-row { border-color: var(--border); }
.ins-vals strong { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }
.heat-card .heat-cell, .heat td { border-radius: 8px; }
.donut-card text { font-family: var(--font-display); }
.donut-small { font: 500 11px var(--font) !important; text-transform: none; letter-spacing: 0; fill: var(--ink-2); }
.mpick-tag, .badge-est { text-transform: none; letter-spacing: 0; font-family: var(--font); }
.drift-card .drift, .goals-fc .gf { border-radius: 14px; }
.gf { border-left-color: var(--g-epargne); }
.track-card, .suivi-card { border-radius: var(--radius); }
@media (min-width: 1100px) {
  /* Several columns, larger charts. Full-width items: the head, tabs and notes; cards pair up where they fit. */
  .an-tendances, .comparer, .prevoir, .an-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; align-items: start; column-gap: 16px; }
  .an-tendances > *, .comparer > *, .prevoir > *, .an-categories > * { grid-column: 1 / -1; min-width: 0; }
  .an-tendances > .insights, .an-tendances > .flow-card { grid-column: auto; align-self: stretch; }
  .comparer > .cmp-card { grid-column: auto; align-self: stretch; }
  .comparer > .donut-card, .comparer > .heat-card { grid-column: auto; align-self: start; }
  .prevoir > .drift-card, .prevoir > .goals-fc { grid-column: auto; align-self: stretch; }
  .an-categories .ins-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .an-categories .ins-list > li { min-width: 0; }
  .chart, .ychart { min-height: 0; }
  .flow-card .chart svg, .pvr-card .chart svg { max-height: 300px; }
}
@media (min-width: 1100px) and (max-width: 1359.98px) {
  .an-tendances > .insights, .an-tendances > .flow-card { grid-column: 1 / -1; }
}
.flow-card { min-width: 0; }

/* ---------- Comptes ---------- */
.nw-card { padding: 20px; background: linear-gradient(160deg, var(--hero-1), var(--surface) 60%); border-color: var(--hero-border); box-shadow: var(--hero-shadow); }
.nw-total { margin: 4px 0 12px; gap: 10px; flex-wrap: wrap; }
.nw-total strong { font: 700 clamp(34px, 9vw, 46px)/1.05 var(--font-display); letter-spacing: -0.03em; }
.nw-split { gap: 10px; }
.nw-split > div, .nw-split > .nw-debt { padding: 10px 14px; border-radius: 14px; background: var(--inset); border: 1px solid var(--border); min-width: 120px; }
.nw-split > .nw-debt { display: flex; min-height: 44px; box-sizing: border-box; }
.nw-split strong { font: 500 18px/1.25 var(--font-display); letter-spacing: -0.02em; }
.nw-split .label { font-size: 12.5px; }
.nw-formula { font-size: 12.5px; }
.nw-card > .link.small { display: inline-flex; align-items: center; min-height: 40px; margin-top: 4px; }
#comptes .rows .row { padding: 10px 12px; border-radius: 14px; }
#comptes .rows .row .num { font: 500 16px/1.2 var(--font-display); letter-spacing: -0.02em; }
.acc-keep { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--inset); border: 1px solid var(--border); }
.virtual-badge { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); }
@media (min-width: 1100px) {
  .nw-card { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); column-gap: 32px; align-items: end; }
  .nw-card > .card-head, .nw-card > .nw-formula, .nw-card > .nw-debts, .nw-card > .link { grid-column: 1 / -1; }
  .nw-card .nw-split { justify-content: flex-end; margin: 0 0 12px; }
  #comptes .rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
  #comptes .rows .row { background: var(--inset); border: 1px solid var(--border); padding: 14px; }
  #comptes .rows .row:hover { border-color: var(--accent-line); }
  .page-dettes .eng-card { margin: 0; }
  .page-dettes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  .page-dettes > * { grid-column: 1 / -1; }
  .page-dettes > .eng-card { grid-column: auto; }
}
/* Fiche compte, pointage */
.acc-sheet .acc-bal, .sheet .acc-bal { font: 700 34px/1.1 var(--font-display); letter-spacing: -0.03em; }
.reconcile-diff, .rc-diff { font-family: var(--font-display); }

/* Objectifs / dettes */
.goal { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.goal-head { gap: 12px; }
.goal-head h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.goal-emoji { width: 40px; height: 40px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--inset); border: 1px solid var(--border); }
.goal-amt strong { font: 700 28px/1.1 var(--font-display); letter-spacing: -0.03em; }
.goal-amt .goal-pct { font: 600 14px/1 var(--font); color: var(--accent-text); }
.goal .track { height: 8px; }
.goal-facts { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.goal-facts strong { color: var(--ink-1); font-weight: 600; }
.goal > .btn { align-self: flex-start; min-height: 44px; }
.goal-head .icon-btn { width: 44px; height: 44px; }
.eng .row { padding: 10px 6px; }
.eng-total { margin-left: 6px; font: 500 15px/1 var(--font-display); }
.row-amt.num, .eng .row-amt { font-weight: 600; }

/* ---------- Réglages ---------- */
.settings-menu { padding: 6px; }
.settings-row { min-height: 56px; }
.settings-ico { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.settings-row strong { font-size: 15px; font-weight: 600; }
.settings-row .muted.small { font-size: 13px; line-height: 1.4; }
.version-line { text-align: center; }
.settings .card { padding: 18px 20px; }
.settings .field-hint { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.settings .input, .settings select.input { min-height: 44px; border-radius: 12px; }
.profile-card .input { max-width: 360px; }
@media (min-width: 1100px) {
  .settings-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .settings-menu li + li { border-top: 0; }
  .settings-menu li { border-radius: 14px; }
  .settings-menu .settings-row { height: 100%; box-sizing: border-box; }
  /* Sub-pages with several cards: two columns, a lone wide card spans both. */
  .settings-sub.sec-donnees, .settings-sub.sec-notifications, .settings-sub.sec-avance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; column-gap: 16px; align-items: start; }
  .settings-sub.sec-donnees > *, .settings-sub.sec-notifications > *, .settings-sub.sec-avance > * { grid-column: 1 / -1; min-width: 0; }
  .settings-sub.sec-donnees > .card, .settings-sub.sec-notifications > .card, .settings-sub.sec-avance > .card { grid-column: auto; }
  .settings-sub.sec-recurrents > .card, .settings-sub.sec-categories > .card, .settings-sub.sec-budget > .card, .settings-sub.sec-audit > * { max-width: 1040px; }
}

/* ---------- Formulaire d'ajout ---------- */
.amount-wrap { gap: 4px; }
.amount-input { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; } /* width per digit set in add.js (Unbounded: 0.8 em) */
.amount-cur { font: 500 26px/1 var(--font-display); color: var(--ink-2); }
.keypad { gap: 8px; }
.keypad button { min-height: 52px; border-radius: 14px; font: 500 22px/1 var(--font-display); background: var(--surface-2); border-color: var(--border); transition: background .15s var(--ease), transform .1s var(--ease); }
.keypad button:hover { background: var(--surface-3); }
.keypad button:active { transform: scale(.97); background: var(--accent-soft); }
.keypad .keypad-ok { min-height: 50px; font: 600 16px/1 var(--font); background: linear-gradient(135deg, var(--accent-strong), var(--accent)); color: var(--accent-ink); border: 0; }
:root[data-theme="light"] .keypad .keypad-ok { color: #fff; }
.sheet .seg { border-radius: 16px; }
.favs-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.fav-chip, .habit-chip { border-radius: 999px; }
/* The sticky action bar covers the body's bottom padding too, so nothing scrolls visibly beneath it. */
.sheet-body { --sb-pad: calc(20px + var(--safe-b)); padding-bottom: var(--sb-pad); }
.sheet .sheet-body .sheet-actions { gap: 10px; bottom: calc(-1 * var(--sb-pad)); padding-bottom: var(--sb-pad); margin-bottom: calc(-1 * var(--sb-pad)); background: var(--surface); box-shadow: 0 -14px 16px -10px var(--surface); z-index: 2; }
@media (min-width: 1100px) { .sheet-body { --sb-pad: 24px; } }
.mtx .row { grid-template-columns: 76px minmax(0, 1fr) auto; min-height: 44px; }
.mtx .row > :first-child { color: var(--ink-2); font-size: 13px; }
.sheet-actions .btn { min-height: 48px; border-radius: 14px; }
.sheet-head h2 { font: 500 18px/1.25 var(--font-display); letter-spacing: -0.015em; }
.sheet-head .icon-btn { width: 44px; height: 44px; }

/* « Puis-je ? » / « Avant de dépenser » */
.qc-chip-word { font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.qc-chip-say { display: block; margin-top: 2px; font: 600 12px/1.25 var(--font); color: var(--qc-ink); }
.qc-status { padding: 14px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--qc) 35%, transparent); border-left-width: 1px; background: color-mix(in srgb, var(--qc) 10%, var(--surface)); }
.qc-status-word { font: 600 21px/1.2 var(--font-display); letter-spacing: -0.02em; }
.qc-status.qc-ok .qc-status-word { color: var(--pos); }
.qc-status.qc-stop .qc-status-word { color: var(--neg); }
.qc-msg { font-size: 14px; line-height: 1.5; }
.qc-tiles { gap: 10px; margin-top: 10px; }
.qc-tile { padding: 12px 14px; border-radius: 14px; background: var(--inset); }
.qc-tile > span:first-child { font: 500 12.5px/1.3 var(--font); color: var(--ink-2); }
.qc-tile strong { font: 500 20px/1.2 var(--font-display); letter-spacing: -0.02em; }
.qc-tile small { font-size: 12px; color: var(--ink-2); }
.qc-cap { border-radius: 16px; }
.qc-cap strong { font-family: var(--font-display); font-weight: 500; }

/* Lissage, achat étalé, fiches produit / tiers */
.smooth-sheet .kpi strong, .item-sheet .kpi strong, .merchant-sheet .kpi strong { font-size: 19px; }
.mhead, .merchant-head, .item-head { gap: 12px; }
.mhead h2, .merchant-head h2 { font-family: var(--font-display); font-weight: 500; }
.tier-kind, .kind-badge { border-radius: 999px; }

/* ---------- Recherche / Demander ---------- */
.search .input.search.big, input.search.big { min-height: 52px; border-radius: 16px; font-size: 16px; padding-left: 16px; border: 1px solid var(--accent-line); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.answer-card { background: linear-gradient(160deg, var(--hero-1), var(--surface) 60%); border-color: var(--hero-border); box-shadow: var(--hero-shadow); }
.answer-card .card-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.answer-card p { font-size: 15px; line-height: 1.5; }
.suggest-chips .chip, .ask-chips .chip, .answer-card .chip { min-height: 40px; padding: 8px 14px; font-weight: 500; }

/* ---------- Connexion et verrouillage ---------- */
.auth, .lock { position: relative; isolation: isolate; overflow: hidden; background: var(--plane); }
.auth::before, .lock::before { content: ''; position: absolute; left: 50%; top: -30vh; width: min(900px, 140vw); height: 70vh; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, var(--page-glow), transparent); z-index: -1; pointer-events: none; }
.auth-card { border-radius: 24px; padding: 28px; box-shadow: var(--hero-shadow); border-color: var(--hero-border); background: linear-gradient(160deg, var(--hero-1), var(--surface) 55%); }
.auth-card h1 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }
.auth-card .btn.primary { min-height: 48px; border-radius: 14px; }
.auth-card .link { min-height: 44px; display: inline-flex; align-items: center; }
.lock h1 { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; }
.lock-sub { margin: -6px 0 0; font-size: 14px; color: var(--ink-2); }
.pin-dots span { border-color: var(--ink-3); }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent-line); }
.pin-pad button { font: 500 24px/1 var(--font-display); background: var(--surface); border-color: var(--border-strong); transition: background .15s var(--ease), transform .1s var(--ease); }
.pin-pad button:hover { background: var(--surface-2); }
.pin-pad button:active { transform: scale(.96); background: var(--accent-soft); }

/* ---------- Rapport mensuel (écran) ---------- */
.report-view .rp-head h1, .rp-title { font-family: var(--font-display); }
.rp-verdict { border-radius: 14px; }
.rp-table th, .rp-table th.num { font-family: var(--font); font-weight: 600; letter-spacing: 0; }

/* ---------- Accueil : corrections vague 1 ---------- */
/* « À faire » : the buttons sit to the right of the text when the column is wide enough, below otherwise. */
.d-home .money-actions { container-type: inline-size; container-name: todo; align-self: stretch; width: 100%; box-sizing: border-box; }
@container todo (min-width: 400px) {
  .money-actions .rec-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: start; }
  .money-actions .rec-body > * { grid-column: 1; }
  .money-actions .rec-body > .btn-row { grid-column: 2; grid-row: 1 / span 3; margin: 0; flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
}
/* « Aujourd'hui » next to the big figure, even for four digits: the figure shrinks (clamp) instead of wrapping. */
@media (min-width: 600px) {
  .d-hero { container-type: inline-size; container-name: hero; align-self: stretch; }
  .d-hero .hero-row { flex-wrap: nowrap; }
  .d-hero .hero-num { min-width: 0; white-space: nowrap; font-size: clamp(30px, calc((100cqi - 206px) / (var(--digits, 3) * 0.8 + 1)), 60px); }
  .today-card { flex: 0 0 180px; }
}
@media (max-width: 599.98px) {
  .d-hero .hero-num { white-space: nowrap; font-size: clamp(34px, calc((100vw - 76px) / (var(--digits, 3) * 0.8 + 1)), 58px); }
}

/* ---------- Touch targets (phones) ---------- */
@media (max-width: 599.98px), (pointer: coarse) {
  .view .btn.small, .sheet .btn.small { min-height: 44px; }
  .view .link.small, .sheet .link.small, .view .calc-btn, .sheet .calc-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .settings-row, .row { min-height: 48px; }
  .seg button { min-height: 44px; }
  .tip-btn { min-width: 32px; min-height: 32px; }
}

/* ---------- Print: the report stays a white sheet ---------- */
@media print {
  :root, :root[data-theme] { --plane: #fff; --surface: #fff; --surface-2: #f6f5fb; --ink-1: #15131f; --ink-2: #4c4860; --ink-3: #5e5a73; --border: rgba(0, 0, 0, .12); color-scheme: light; }
  body, .shell, .main { background: #fff !important; color: #15131f; }
  .shell::before, .auth::before, .lock::before { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hbar-fill, .keypad button { animation: none !important; transition: none !important; }
}

/* Budget row sheet: type and carry of the family, folded */
.fam-detail { margin: 12px 0 4px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.fam-detail > summary { cursor: pointer; font: 600 13.5px/1.3 var(--font); color: var(--ink-1); }
.fam-detail[open] > summary { margin-bottom: 10px; }
.fam-fields { display: grid; gap: 10px; }

/* Quand tu dépenses: two small charts, by day and by time of day */
.hm-sub { margin: 4px 0 6px; font: 600 12.5px/1.2 var(--font); color: var(--ink-2); }
.hm-sub ~ .hm-sub { margin-top: 16px; }
/* Tiers on PC: two columns instead of one long list */
@media (min-width: 1100px) {
  .merchants.tiers > ul.txs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
}
/* Month header on a phone: both arrows stay beside the month name (the long names pushed « suivant » to a new line) */
@media (max-width: 1099px) {
  .month-nav-row > .month-title { flex: 1 1 0; min-width: 0; }
  .month-nav-row > .month-title h1 { font-size: clamp(18px, 5.4vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .month-nav-row .nav-arrow { width: 40px; height: 40px; }
  .month-nav-row .today-chip { flex-basis: auto; }
}

/* Réglages › Fixes: the cagnottes summary is a link to Comptes › Cagnottes */
a.smooth-recap { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--ink-1); text-decoration: none; }
a.smooth-recap:hover { border-color: var(--accent); }
.smooth-recap .sr-main { display: grid; gap: 3px; flex: 1; min-width: 0; }
.smooth-recap .sr-main strong { font: 600 14px/1.2 var(--font); }
.smooth-recap .sr-main .small { color: var(--ink-2); line-height: 1.4; }
.smooth-recap .sr-go { flex: none; font: 600 13px/1 var(--font); color: var(--accent-text); }
/* Comptes › Cagnottes */
.cg-head .cg-total { display: block; margin: 4px 0 6px; font: 500 34px/1.1 var(--font-display); letter-spacing: -.02em; }
.cg-state { display: block; margin-top: 2px; }
.cg-state.neg { color: var(--neg); } .cg-state.warn { color: var(--warn-ink); } .cg-state.pos { color: var(--pos); } .cg-state.muted { color: var(--ink-3); }
.pot-actions { display: grid; gap: 12px; }
.pot-act { padding: 12px; border: 1px solid var(--border); border-radius: 12px; display: grid; gap: 8px; justify-items: start; }
.pot-add { display: flex; gap: 8px; width: 100%; }
.pot-add .input { flex: 1; min-width: 0; }
/* Où part l'argent: name, details and shares stacked on the left (the shares on the right squeezed the names) */
.mlist .mrow { grid-template-columns: 32px minmax(0, 1fr) auto; }
.mlist .mrow-name { white-space: normal; }
.mlist .mrow-name > small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlist .mrow-name { overflow: hidden; }

/* Comptes › Personnes and a person's fiche */
.people-kpis { margin-bottom: 8px; }
.person-head { display: grid; gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--inset); }
.person-net { margin: 0; font: 500 22px/1.2 var(--font-display); letter-spacing: -.01em; }
.person-head.tone-good .person-net { color: var(--pos); }
.person-head.tone-critical .person-net { color: var(--neg); }
.person-actions { flex-wrap: wrap; }
.settle-form { display: grid; gap: 10px; padding: 14px; }
.settle-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.person-hist .row-main { min-width: 0; }
.person-hist .settle-line { gap: 8px; }
.chip-st { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.chip-st.st-good { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.chip-st.st-warning { background: color-mix(in srgb, var(--st-warning) 18%, transparent); color: var(--warn-ink); }
.chip-st.st-info { background: var(--accent-soft); color: var(--accent-text); }
/* Fixe form: « Partager » */
.split-field.on { padding: 12px; border: 1px solid var(--accent-line); border-radius: 14px; display: grid; gap: 10px; }
.split-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.split-member { display: grid; gap: 6px; }
.sm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.sm-name { min-width: 0; }
.sm-val { display: inline-flex; align-items: center; gap: 4px; }
.sm-val .input { width: 72px; }
.sm-part { min-width: 64px; text-align: right; font-weight: 600; }
.sm-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.person-hist .settle-line { flex-wrap: wrap; }
.person-hist .settle-undo { flex-basis: 100%; text-align: left; padding: 0; }

/* Accueil · Âge de ton argent */
.age-card { display: grid; gap: 8px; }
.age-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.age-main { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.age-main strong { font: 500 34px/1 var(--font-display); letter-spacing: -.02em; }
.age-diff { margin-left: auto; font-size: 12.5px; font-weight: 600; }
.age-card.tone-good .d-bar i { background: var(--pos); }
.age-card.tone-warning .d-bar i { background: var(--st-warning); }
.age-card.tone-critical .d-bar i { background: var(--neg); }

/* v18.7 — same gestures everywhere: a touchable figure opens its calculation, a touchable name opens its sheet */
.num-tap, .name-tap { padding: 0; margin: 0; background: none; border: 0; font: inherit; color: inherit; letter-spacing: inherit; line-height: inherit; text-align: inherit; cursor: pointer; border-radius: 6px; }
.num-tap { text-decoration: underline dotted color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.name-tap { text-decoration: underline color-mix(in oklab, currentColor 25%, transparent); text-underline-offset: 0.2em; }
.num-tap:hover, .name-tap:hover { text-decoration-color: currentColor; }
.num-tap:focus-visible, .name-tap:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.goals-saved { font-size: .62em; font-weight: 500; margin-left: 6px; }
.an-sub { margin: 8px 0 4px; display: flex; } .an-sub .seg { width: auto; }
.goto-card { padding: 14px 16px; }
.goto-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.goto-row { width: 100%; display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 10px; padding: 10px 8px; background: none; border: 0; border-radius: 10px; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.goto-row:hover, .goto-row:focus-visible { background: var(--accent-soft); }
.goto-label { font-weight: 600; }
.sidebar .side-sub { display: grid; gap: 1px; margin: 2px 0 6px 30px; padding-left: 10px; border-left: 1px solid var(--accent-line); }
.sidebar .side-sub a { padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2, inherit); background: none; text-decoration: none; }
.sidebar .side-sub a.on { color: var(--accent-text); font-weight: 600; background: var(--accent-soft); }
.sidebar .side-sub a:hover { background: var(--accent-soft); }
.sidebar .side-sub a.on::before { display: none; }

/* v19.2 — Accueil : a quick look at the budgets */
.budgets-mini .bm-sum { margin: 0 0 8px; font-weight: 600; }
.budgets-mini .bm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.budgets-mini .bm-btn { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'name left' 'bar bar'; gap: 6px 12px; align-items: center; padding: 8px 6px; background: none; border: 0; border-radius: 10px; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.budgets-mini .bm-btn:hover, .budgets-mini .bm-btn:focus-visible { background: var(--accent-soft); }
.budgets-mini .bm-name { grid-area: name; display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.budgets-mini .bm-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budgets-mini .bm-left { grid-area: left; font-weight: 700; white-space: nowrap; }
.budgets-mini .bm-left small { font-weight: 500; }
.budgets-mini .bm-bar { grid-area: bar; }
.budgets-mini .tone-critical .d-bar i { background: var(--st-critical); }
.budgets-mini .tone-warning .d-bar i { background: var(--st-warning, #F5B544); }
.budgets-mini .bm-more { margin: 6px 0 0; }

/* v19.3 — the month's rituals, guided from À faire */
.ritual-strip { margin: 2px 0 12px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ritual-head { display: block; font-size: 12px; font-weight: 600; color: var(--accent-text); margin-bottom: 6px; text-transform: none; }
.ritual-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ritual-step { width: 100%; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 7px 6px; background: none; border: 0; border-radius: 10px; color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ritual-step:hover, .ritual-step:focus-visible { background: color-mix(in oklab, var(--accent) 14%, transparent); }
.ritual-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1.5px solid var(--accent-line); color: var(--accent-text); }
.ritual-step.is-next .ritual-n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fam-in-cat { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.add-menu { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.add-kind { width: 100%; display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--accent-line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.add-kind:hover, .add-kind:focus-visible { background: var(--accent-soft); }
.fab, .add-side { -webkit-touch-callout: none; user-select: none; touch-action: manipulation; }

/* v19.5 — one rhythm everywhere: projection headline + used/elapsed bar */
.rhythm-bar { margin: 10px 0 4px; }
.rhythm-bar .rb-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; font-size: 14px; }
.rhythm-bar .rb-head strong { font-size: 16px; }
.rhythm-bar .rb-zone { font-size: 12px; font-weight: 600; opacity: .85; }
.rhythm-bar .use-legend { display: flex; justify-content: space-between; margin: 6px 0 0; font-size: 12px; opacity: .8; }
.rhythm-bar .rb-text { margin: 4px 0 0; }
.rhythm-bar.is-compact { margin: 8px 0 0; width: 100%; }
.rhythm-bar.is-compact .use-legend { font-size: 11px; }
.rhythm-bar.tone-warning .d-bar i, .rhythm-bar.tone-serious .d-bar i { background: var(--st-warning, #F5B544); }
.rhythm-bar.tone-critical .d-bar i { background: var(--st-critical); }
.share-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }

/* v19.9 — phone: the month name is never cut; « Ce mois-ci » goes on its own line under it */
@media (max-width: 599.98px) {
  .month-nav-row > .month-title { flex: 1 1 calc(100% - 96px); }
  .month-nav-row > .month-title h1 { overflow: visible; text-overflow: clip; }
  .month-nav-row .today-chip { order: 10; margin: 2px 0 0 48px; min-height: 30px; padding: 4px 12px; font-size: 13px; }
}
.month-amounts { margin-top: 12px; }
.month-amounts .table th, .month-amounts .table td { padding: 7px 6px; font-size: 13px; white-space: nowrap; }
.month-amounts tr.clickable { cursor: pointer; }
@media (max-width: 599.98px) {
  .month-amounts .col-m-hide { display: none; }
  .month-amounts .table th, .month-amounts .table td { padding: 6px 4px; font-size: 12.5px; }
}

/* v19.12 — filling bar of a cagnotte or a goal (charts.js PotBar) */
.pot-bar { display: grid; gap: 4px; width: 128px; flex: none; }
.pot-bar.wide { width: 100%; }
.pot-bar .pb-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pot-bar .pb-left { font-weight: 700; }
.pot-bar .pb-right { opacity: .75; }
.pot-bar.is-neg .pb-left { color: var(--st-critical); }
.pot-bar .pb-track { position: relative; display: block; height: 10px; border-radius: 999px; background: var(--track, rgba(255,255,255,.08)); }
.pot-bar.wide .pb-track { height: 14px; }
.pot-bar .pb-track i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; }
.pot-bar .pb-expected { background: color-mix(in oklab, var(--accent) 38%, transparent); }
.pot-bar .pb-now { background: var(--accent); }
.pot-bar .pb-short { background: color-mix(in oklab, var(--st-warning, #F5B544) 55%, transparent); border-radius: 0 999px 999px 0 !important; }
.pot-bar.is-neg .pb-track { background: color-mix(in oklab, var(--st-critical) 35%, transparent); }
.pot-bar .pb-target { position: absolute; right: -1px; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--ink-1, currentColor); }
.pot-bar .pb-foot { font-size: 11.5px; opacity: .8; white-space: nowrap; }
.pot-bar.is-short .pb-foot { color: var(--st-warning, #F5B544); opacity: 1; }
.pot-bar-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; opacity: .85; margin: 6px 0 2px; }
.pot-bar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.budgets-mini .bm-habit { margin-left: 6px; font-weight: 500; } .budgets-mini .bm-pred { margin: 8px 0 0; }
/* v19.15 — Tableau: one colour per kind of money (revenu, dépense, virement, comptes) */
:root { --c-expense: #FF9F7A; --c-transfer: #7CB8FF; --c-balance: #C4B5FD; }
:root[data-theme="light"] { --c-expense: #B94A1E; --c-transfer: #2463B8; --c-balance: #5A35F0; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) { --c-expense: #B94A1E; --c-transfer: #2463B8; --c-balance: #5A35F0; } }
.ledger .amt-exp, .amt-exp { color: var(--c-expense); }
.ledger .amt-xfer, .amt-xfer { color: var(--c-transfer); }
.ledger .amt-bal, .amt-bal { color: var(--c-balance); }
.ledger td.col-bal.day-end { font-weight: 600; }
.ledger th.th-inc .th-btn { color: var(--pos); } .ledger th.th-exp .th-btn { color: var(--c-expense); } .ledger th.th-bal .th-btn { color: var(--c-balance); }
.ledger tfoot .foot-lbl { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: .02em; text-transform: none; margin-bottom: 2px; font-family: var(--font-ui, inherit); }
.ledger tfoot .foot-labels td { vertical-align: bottom; padding-top: 12px; }
.ledger tfoot .foot-net td { font-weight: 500; color: var(--ink-2); padding-top: 6px; }
.ledger-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); margin: 2px 0 0; }
.ledger-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-dot.pos-bg { background: var(--pos); } .lg-dot.exp-bg { background: var(--c-expense); } .lg-dot.xfer-bg { background: var(--c-transfer); } .lg-dot.bal-bg { background: var(--c-balance); }
@media (max-width: 700px) { .ledger tfoot .foot-labels td.col-cat, .ledger tfoot .foot-labels td.col-method { display: none; } }
.ledger-net { margin: -4px 4px 0; color: var(--ink-2); }
.ledger tfoot .foot-lbl { white-space: normal; line-height: 1.25; }
/* v19.15 — Filtres communs (barre + feuille) */
.fbar { display: flex; flex-direction: column; gap: 8px; }
.fbar-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fbar-q { flex: 1 1 220px; min-width: 0; }
.fbar-btn { display: inline-flex; align-items: center; gap: 6px; }
.fbar-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.fbar-row .tx-views { margin-left: auto; }
.fbar-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.fchip span { opacity: .75; font-size: 11px; }
.fbar-result { margin-left: auto; }
.fsheet .fsheet-body { display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; }
.fsec h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .02em; color: var(--ink-2); font-weight: 600; }
.fsec-hint { margin: -4px 0 8px; }
.fchecks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fcheck.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.fcheck.on::before { content: '✓ '; }
.fcheck:disabled { opacity: .55; }
.frange { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.frange label { display: flex; align-items: center; gap: 6px; }
.frange .input { width: 140px; }
.fsort { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ftree { display: flex; flex-direction: column; gap: 6px; }
.ftree-row { display: flex; gap: 10px; align-items: center; }
.ftree-subs { margin: 2px 0 6px 14px; }
.fsheet-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 10px; padding: 12px 0 4px; background: var(--surface); border-top: 1px solid var(--border); margin-top: 8px; }
.fsheet-foot .btn.primary { flex: 1; }
/* Transactions : calendrier en colonne à droite (grand écran), replié en tête de liste (mobile) */
.tx-layout.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.tx-side { position: sticky; top: 16px; }
.tx-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: -4px; } .tx-tools .swipe-hint { margin: 0; }
.cal-compact .cal { gap: 4px; }
.cal-compact .cal-day { min-height: 0; aspect-ratio: 1; font-size: 11px; border-radius: 7px; padding: 0; }
.cal-compact .cal-stats { flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.cal-compact .cal-legend { font-size: 11px; flex-wrap: wrap; }
.cal-hint { margin: 8px 0 0; }
.cal-fold { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.cal-fold > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.cal-fold > summary::after { content: '›'; transform: rotate(90deg); transition: transform .15s; color: var(--ink-3); }
.cal-fold[open] > summary::after { transform: rotate(-90deg); }
.cal-fold > .card { border: 0; background: transparent; box-shadow: none; margin: 0; padding-top: 0; }
.cal-fold > .card .card-head { display: none; }
@media (max-width: 699px) { .fbar-row .tx-views { margin-left: 0; } .fbar-q { flex-basis: 100%; } }
.ftree-fam { display: inline-flex; align-items: stretch; }
.ftree-fam .fcheck { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ftree-fam .fcheck:only-child { border-radius: 999px; }
.ftree-more { border: 1px solid var(--border-strong); border-left: 0; background: var(--surface-2); color: var(--ink-2); border-radius: 0 999px 999px 0; padding: 0 9px; font-size: 14px; cursor: pointer; }
.ftree-fam.open .ftree-more { background: var(--accent-soft); color: var(--accent-text); transform: none; }
.fcheck.part { border-color: var(--accent-line); }
.ftree-subs { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.ftree-subs p { margin: 0 0 4px; }
.ledger-legend { align-items: center; } .ledger-legend .lg-csv { margin-left: auto; }
.hours-card .hours-sub { margin: -6px 0 8px; }
.hours-chart { width: 100%; height: auto; display: block; }
.hours-chart .hb { fill: color-mix(in srgb, var(--c-expense) 45%, transparent); }
.hours-chart .hb.peak { fill: var(--c-expense); }
.hours-chart .hb-axis { stroke: var(--axis); stroke-width: 1; }
.hours-chart .hb-lab { font-size: 8px; fill: var(--ink-3); }
.hours-peak { margin: 8px 0 6px; color: var(--ink-2); }
.hours-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hours-slots li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--border); }
.hours-slots li.top { font-weight: 600; }
.hours-slots li.top .num { color: var(--c-expense); }
.tx-side.stack { display: flex; flex-direction: column; gap: 14px; }
.cal-fold > .hours-card { border: 0; background: transparent; box-shadow: none; margin: 0; }
.ledger .lg-accbal { display: block; line-height: 1.2; opacity: .72; }
.ledger .lg-accbal + .acc-bal { margin-top: 4px; }
.ledger .lg-accbal.day-end { opacity: 1; font-weight: 600; }
.ledger .lg-accbal small { display: block; font-size: 11px; color: var(--ink-3); font-family: var(--font-ui, inherit); font-weight: 400; }
.ledger .lg-accbal small { white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; margin-left: auto; }
/* v19.18 — lignes de transaction : une seule ligne de détails, les badges qui ne tiennent pas sont masqués */
.tx-meta { flex-wrap: wrap; height: 1.45em; overflow: hidden; row-gap: 8px; align-items: center; }
.tx-meta-text { flex: 0 1 auto; min-width: 0; }
.ledger .lg-what { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
/* Tableau sur téléphone : une carte par ligne */
.lcards-sort { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.lcards-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.lcard + .lcard { border-top: 1px solid var(--border); }
.lcard-btn { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 11px 14px; font: inherit; cursor: pointer; }
.lcard.other-month .lcard-btn { opacity: .55; }
.lcard.is-adjust .lcard-btn { opacity: .7; }
.lcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lcard-name { min-width: 0; }
.lcard-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard-name small { display: block; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard-amt { white-space: nowrap; font-weight: 600; }
.lcard-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard-bal { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; }
.lcard-acc { opacity: .8; }
.lcard-acc.day-end { opacity: 1; font-weight: 600; }
.lcards-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.lcards-foot small { display: block; font-size: 11px; color: var(--ink-3); }
.lcards-foot strong { font-size: 15px; }
.lcards-sort .seg button { text-transform: none; } details.ledger-help > summary { cursor: pointer; margin-bottom: 6px; } details.ledger-help:not([open]) { padding-top: 8px; padding-bottom: 8px; }
/* Lignes d'une dette ou d'un prêt : colonnes date | tiers | produit | montant */
.eng-cols { list-style: none; margin: 8px 0 0; padding: 0; }
.eng-cols .ec-row { display: grid; grid-template-columns: 7.2em minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: baseline; width: 100%; padding: 7px 0; background: none; border: 0; border-top: 1px solid var(--border); color: inherit; font: inherit; text-align: left; }
.eng-cols li:first-child .ec-row { border-top: 0; }
.eng-cols button.ec-row { cursor: pointer; }
.eng-cols button.ec-row:hover .ec-tier { color: var(--accent-text); }
.eng-cols .ec-date { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.eng-cols .ec-tier, .eng-cols .ec-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eng-cols .ec-label { grid-column: span 2; }
.eng-cols .ec-amt { text-align: right; white-space: nowrap; }
@media (max-width: 520px) { .eng-cols .ec-row { grid-template-columns: 6.4em minmax(0, 1fr) auto; } .eng-cols .ec-what { grid-column: 2; grid-row: 2; font-size: 12px; margin-top: -4px; } .eng-cols .ec-what:empty { display: none; } .eng-cols .ec-label { grid-column: auto; } }
/* Plan : la colonne de droite (À placer, Reste à dépenser, Conseil) suit le défilement sur grand écran */
@media (min-width: 1100px) { .d-env .env-side { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: none; } }
/* Fonds d'urgence : proposer une somme */
.em-propose { display: flex; flex-direction: column; gap: 8px; margin: -2px 0 6px; }
.em-propose > .btn { align-self: flex-start; }
.em-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.em-opt { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; }
.em-opt.best { border-color: var(--accent); background: var(--accent-soft); }
.em-opt .num { font-size: 18px; font-weight: 700; }
/* Notifications : appareils et historique */
.ndevices .rows { list-style: none; margin: 0; padding: 0; }
.ndev { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.ndev:first-child { border-top: 0; }
.ndev.off .ndev-main { opacity: .55; }
.ndev-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ndev-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nhist { list-style: none; margin: 0; padding: 0; }
.nhist li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--border); }
.nhist li:first-child { border-top: 0; }
.nhist li.deferred { opacity: .7; }
.nhist .nh-main { display: flex; flex-direction: column; min-width: 0; }
.nhist .nh-body { white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nhist .nh-st { color: var(--ink-3); white-space: nowrap; }
@media (max-width: 600px) { .ndev { flex-wrap: wrap; } .nhist li { grid-template-columns: minmax(0, 1fr) auto; } .nhist .nh-when { grid-column: 1 / -1; } }
/* Accueil en deux bandes : la première tient dans l'écran (Reste à dépenser | Budgets + Avant de dépenser | À faire),
   la seconde est en dessous (Dernières transactions sur deux colonnes | Âge de ton argent). */
.hg-budgets { gap: 16px; }
.hg-budgets > .card { flex: none; }
@media (min-width: 1360px) {
  .home-grid { align-items: start; }
  .home-band2 { grid-template-columns: minmax(0, 2.17fr) minmax(0, .85fr); margin-top: 16px; }
}
@media (min-width: 900px) and (max-width: 1359px) { .home-band2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
/* Feuille d'ajout : suggestions de tiers et de produits toujours entières (plus de boîte qui coupe la 2e ligne) */
.pq-chips, .mpick-chips.pq-chips { max-height: none; overflow: visible; flex-wrap: wrap; }
.pq-chips .chip { min-height: 32px; font-size: 13px; padding: 4px 11px 4px 7px; }
.pq-chips .chip .mlogo, .pq-chips .chip .mlogo-ico { width: 18px; height: 18px; }
@media (min-width: 1360px) {
  .recent-band .txs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .recent-band .txs > li { min-width: 0; }
}
/* Prévoir : ton rythme habituel */
.habit-lead { margin: 0 0 10px; }
.habit-kpis { margin-bottom: 8px; }
.habit-card .habit-curve { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.habit-card .habit-linear { fill: none; stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 4 4; }
.habit-card .habit-half { stroke: var(--accent-line); stroke-dasharray: 2 3; }
.habit-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0 10px; }
.hl { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; }
.hl.hl-lin { border-top: 1.5px dashed var(--ink-3); } .hl.hl-mine { border-top-color: var(--pos); }
.habit-facts { margin: 0 0 10px; padding-left: 18px; }
.habit-facts li { margin: 3px 0; }
.habit-wd { display: flex; gap: 10px; align-items: flex-end; height: 72px; margin: 4px 0 8px; }
.habit-wd .hw { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.habit-wd .hw-bar { width: 100%; max-width: 28px; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--c-expense, #FF9F7A) 55%, transparent); min-height: 2px; }
.habit-wd .hw-l { font-size: 11px; color: var(--ink-3); }
.habit-card .habit-mine { fill: none; stroke: var(--pos); stroke-width: 2.4; }
.habit-card .habit-dot { fill: var(--pos); }
.habit-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 600px) { .habit-kpis { grid-template-columns: 1fr 1fr !important; } .habit-kpis .kpi:last-child { grid-column: 1 / -1; } }
.habit-wd { max-width: 420px; }
/* Plan : ce qui est placé sur une famille sans catégorie — une note sous ses catégories, pas une ligne qui ressemble à une catégorie */
.env-fam-rest { margin: 4px 0 8px 30px; padding: 6px 10px; border-left: 2px solid var(--accent-line); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.env-fam-rest strong { color: var(--ink-1); }
.env-foldall { display: flex; justify-content: flex-end; margin: -4px 0 6px; }
