/* ---------- V3: merchants, logos ---------- */
.mlogo { display: inline-grid; place-items: center; flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--border); overflow: hidden; line-height: 1; }
.mlogo-emoji { background: var(--surface-2); }
.up-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.desc-row { display: flex; gap: 8px; align-items: center; }
.desc-row .input { flex: 1; min-width: 0; }
.mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mrow { display: grid; grid-template-columns: 32px 1fr auto 12px; gap: 10px; align-items: center; width: 100%; border: 0; background: transparent; padding: 6px 4px; border-radius: 10px; text-align: left; font-weight: 500; font-variant-numeric: tabular-nums; }
.mrow:hover { background: var(--surface-2); }
.mrow-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchant { display: flex; flex-direction: column; gap: 14px; }
.merchant-head { display: flex; gap: 14px; align-items: center; }
.merchant-head h3 { margin: 0 0 2px; font-size: 20px; }
.merchant-head p { margin: 0; }
.mstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mstats div { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.mstats span, .chat-kpis span { font-size: 12px; color: var(--ink-3); }
.mstats strong { font-variant-numeric: tabular-nums; }
.mbars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; height: 110px; padding-top: 4px; }
.mbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.mbar-fill { width: 70%; max-width: 34px; background: var(--accent); border-radius: 6px 6px 2px 2px; }
.mbar-val { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mbar-lab { font-size: 11px; color: var(--ink-3); }
.merchant h4 { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.mtx { list-style: none; margin: 0; padding: 0; }
.mtx .row { display: grid; grid-template-columns: 116px 1fr auto; gap: 8px; align-items: center; width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 9px 2px; text-align: left; font-variant-numeric: tabular-nums; }
.mtx .row-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-results { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.brand-results img { border-radius: 4px; }
.logo-demo { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0; }
.logo-demo span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.logo-demo small { font-size: 11px; color: var(--ink-3); }
.logo-key { align-items: end; }

/* ---------- V3: receipt scan ---------- */
.add-top { display: flex; gap: 8px; align-items: center; }
.add-top .seg { flex: 1; }
.scan-btn { white-space: nowrap; min-height: 44px; }
.scan { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: start; background: var(--accent-soft); border-radius: 12px; padding: 10px; }
.scan.is-err { background: color-mix(in srgb, var(--st-critical) 12%, var(--surface)); }
.scan img { width: 56px; height: 72px; object-fit: cover; border-radius: 8px; }
.scan p { margin: 2px 0 0; }
.scan-progress { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; margin-top: 6px; }
.scan-progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.warn-text { color: var(--st-serious); font-weight: 600; }

/* ---------- V3: ledger table ---------- */
.ledger-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ledger-bar .seg { flex: 0 1 auto; }
.ledger-bar .btn { margin-left: auto; }
.ledger-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.ledger th, .ledger td { padding: 8px 8px; }
.ledger td { text-align: left; }
.ledger .num, .pivot .num { text-align: right; }
.ledger thead th { position: sticky; top: 0; background: var(--surface); }
.th-btn { border: 0; background: transparent; font: inherit; color: inherit; padding: 2px 0; cursor: pointer; }
.ledger-m { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; }
.ledger-m > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.logo-btn { border: 0; padding: 0; background: transparent; display: inline-flex; cursor: pointer; }
.nowrap { white-space: nowrap; }
.pivot td { text-align: left; }
.pivot .pivot-head th { text-align: left; font-size: 13px; color: var(--ink-1); padding-top: 14px; }
.pivot .pivot-total td { font-weight: 700; }
.pivot tbody tr { cursor: default; }

/* ---------- V3: advisor chat ---------- */
.top-settings { margin-left: 8px; color: var(--ink-2); display: inline-grid; place-items: center; }
.top-settings.on { color: var(--accent); }
.topbar .sync { margin-left: auto; }
.advisor { padding-bottom: 150px; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: min(560px, 92%); border-radius: 18px; padding: 10px 14px; line-height: 1.45; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; box-shadow: var(--shadow); width: min(560px, 92%); display: flex; flex-direction: column; gap: 10px; }
.bubble.bot > p { margin: 0; }
.bubble.typing { width: auto; flex-direction: row; gap: 4px; padding: 14px; }
.bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: .15s; }
.bubble.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.preset { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: 14px; color: var(--ink-1); min-height: 48px; }
.preset:hover { border-color: var(--accent); }
.chat-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.chat-kpis div { background: var(--surface-2); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; }
.chat-kpis strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chat-verdict { border-left: 4px solid var(--st-good); padding: 2px 0 2px 12px; }
.chat-verdict.v-but { border-left-color: var(--st-warning); }
.chat-verdict.v-no { border-left-color: var(--st-critical); }
.chat-verdict-title { display: block; font-size: 20px; line-height: 1.2; margin-bottom: 2px; }
.chat-verdict.v-yes .chat-verdict-title { color: var(--pos); }
.chat-verdict.v-but .chat-verdict-title { color: var(--warn-ink); }
.chat-verdict.v-no .chat-verdict-title { color: var(--neg); }
.chat-verdict p { margin: 0; }
.chat-tip { border-left: 4px solid var(--st-info); padding: 2px 0 2px 12px; display: flex; flex-direction: column; gap: 4px; }
.chat-tip.lvl-critical { border-left-color: var(--st-critical); }
.chat-tip.lvl-serious { border-left-color: var(--st-serious); }
.chat-tip.lvl-warning { border-left-color: var(--st-warning); }
.chat-tip p { margin: 0; overflow-wrap: anywhere; }
.chat-tip-title { font-size: 15px; line-height: 1.3; }
.chat-tip-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chat-chart { margin: 0 -4px; }
.chat-compare { display: flex; flex-direction: column; gap: 6px; }
.cmp-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.cmp-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.cmp-fill { display: block; height: 100%; background: var(--ink-3); border-radius: 5px; }
.cmp-fill.b { background: var(--accent); }
.chat-progress { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chat-progress p { margin: 4px 0 0; }
.chat-list-title { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 0 0 4px; }
.chat-list { list-style: none; margin: 0; padding: 0; }
.chat-li, .chat-li-btn { display: flex; gap: 8px; align-items: center; width: 100%; padding: 6px 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; font-size: 14px; text-align: left; font-variant-numeric: tabular-nums; color: inherit; }
.chat-list li:last-child .chat-li, .chat-list li:last-child .chat-li-btn { border-bottom: 0; }
.chat-list.wrap .grow { white-space: normal; overflow: visible; }
.chat-list.wrap .chat-li { align-items: flex-start; line-height: 1.4; }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-dock { position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-b)); padding: 8px 16px; background: linear-gradient(to top, var(--plane) 75%, transparent); z-index: 4; display: flex; flex-direction: column; gap: 6px; }
.chat-sugg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chat-sugg::-webkit-scrollbar { display: none; }
.chat-input { display: flex; gap: 8px; }
.chat-input .input { flex: 1; min-width: 0; border-radius: 999px; }
.chat-input .btn { border-radius: 999px; min-width: 48px; }
@media (min-width: 900px) {
  .chat-dock { left: 232px; bottom: 0; padding: 12px 32px 16px; }
  .advisor { padding-bottom: 130px; }
}
.ask-btn { white-space: nowrap; }
.ledger th { text-align: left; }
.ledger th.num { text-align: right; }
.ledger-m > span:last-child { display: flex; flex-direction: column; }
.m-cat { display: none; font-size: 12px; }
@media (max-width: 699px) {
  .ledger .col-cat, .ledger .col-method { display: none; }
  .m-cat { display: block; }
  .ledger-m { max-width: 150px; }
  .ledger th, .ledger td { padding: 8px 6px; }
  .ledger .nowrap .small { display: none; }
}
.ledger .col-amt { display: none; }
@media (max-width: 699px) {
  .ledger .col-in { display: none; }
  .ledger .col-amt { display: table-cell; }
  .ledger-m { max-width: 120px; }
  .ledger { font-size: 13px; }
}
/* Conseiller, lot 4: suggestions of the moment, follow-ups that keep the subject, « Demander › » on the cards. */
.ask-chips .chip { white-space: normal; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.ask-follow { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.ask-follow .ask-chips { margin-top: 6px; }
.ask-all-toggle { display: inline-block; margin-top: 12px; }
.ask-all { margin-top: 8px; }
.goal-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
