/* Tranquillys Budget — charte terracotta & crème */

:root {
  --terracotta: #A84B2A;
  --terracotta-dark: #7E3519;
  --terracotta-soft: #D98B67;
  --cream: #FBF5EC;
  --sand: #F1E4D3;
  --sand-2: #F1DCCB;
  --white: #FFFFFF;
  --ink: #2A1F1A;
  --ink-2: #4A3B32;
  --muted: #6B5A4E;
  --good: #3F5A36;
  --good-bg: #E6ECDF;
  --warn: #7E3519;
  --warn-bg: #F7E2D2;
  --critical-bg: #A84B2A;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(42, 31, 26, 0.08);
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tabbar: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
a { color: var(--terracotta); }
a:hover { color: var(--terracotta-dark); }
h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 18px; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--terracotta-soft); outline-offset: 2px; }
[hidden] { display: none !important; }

.boot { display: grid; place-items: center; min-height: 100vh; }
.boot-text { font-family: var(--serif); font-size: 24px; color: var(--terracotta); }

/* ——— Structure ——— */
.app { max-width: 560px; width: 100%; min-width: 0; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tabbar) + 32px + env(safe-area-inset-bottom)); }
.demo-banner { background: var(--terracotta); color: var(--white); text-align: center; font-size: 13px; font-weight: 600; padding: 6px 12px; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(251, 245, 236, 0.94); backdrop-filter: blur(8px); }
.topbar-actions { display: flex; gap: 4px; }
.content { padding: 8px 16px 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand em { font-style: normal; color: var(--terracotta); }
.brand.small { font-size: 18px; gap: 8px; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--terracotta); color: var(--cream); }
.brand.small .brand-mark { width: 26px; height: 26px; }

.page-head { padding-top: 4px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--terracotta); margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.links a { color: var(--muted); }

/* ——— Cartes et chiffres ——— */
.card { background: var(--white); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.big-number { font-family: var(--serif); font-size: 42px; font-weight: 600; color: var(--terracotta); line-height: 1.1; }
.big-number.negative { color: var(--terracotta-dark); }
.stat { background: var(--white); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.tone-good { color: var(--good); }
.tone-warn { color: var(--warn); }
.tone-critical { color: var(--terracotta); }
.amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount.positive { color: var(--good); }

.status { border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.status strong { font-size: 15px; }
.status span { font-size: 14px; }
.status-good { background: var(--good-bg); color: var(--good); }
.status-warn { background: var(--warn-bg); color: var(--warn); }
.status-critical { background: var(--critical-bg); color: var(--white); }

.alert { border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 14px; }
.alert-critical { background: var(--warn-bg); border-left: 0; color: var(--ink); }
.alert-warn { background: var(--warn-bg); color: var(--ink); }
.alert-neutral { background: var(--sand); color: var(--ink); }
.alert-good { background: var(--good-bg); color: var(--ink); }

.pill { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-critical { background: var(--terracotta); color: var(--white); }
.pill-neutral { background: var(--sand); color: var(--muted); }

.progress { height: 6px; border-radius: 3px; background: var(--sand); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; background: var(--terracotta-soft); }
.progress-good { background: var(--good); }
.progress-warn { background: var(--terracotta-soft); }
.progress-critical { background: var(--terracotta); }

.goal { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.goal + .goal { border-top: 1px solid var(--sand); }
.goal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.goal-btn { background: none; border: 0; text-align: left; width: 100%; cursor: pointer; padding: 10px 0; }

/* ——— Listes ——— */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.list > li + li { border-top: 1px solid var(--sand); }
.row-main { min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { font-size: 12px; color: var(--muted); }
.row-end { display: flex; align-items: center; gap: 8px; }
.row-btn { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }

/* ——— Graphique ——— */
.chart-wrap { display: flex; flex-direction: column; gap: 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke: var(--terracotta); stroke-width: 2.2; stroke-linejoin: round; }
.chart-threshold { stroke: var(--terracotta-soft); stroke-dasharray: 4 4; stroke-width: 1.2; }
.chart-zero { stroke: var(--muted); stroke-width: 1; opacity: 0.4; }
.chart-low { fill: var(--terracotta); }
.chart-expected { fill: none; stroke: var(--good); stroke-width: 1.6; stroke-dasharray: 3 4; stroke-linejoin: round; opacity: 0.8; }
.chart-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.chart-label { font-size: 10px; fill: var(--muted); font-family: var(--sans); }
.bar { fill: var(--sand-2); }
.bar-accent { fill: var(--terracotta); }

/* ——— Boutons ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border-radius: 999px; border: 0; font-weight: 700; cursor: pointer; width: 100%; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--terracotta-dark); }
.btn-secondary { background: var(--white); color: var(--terracotta); border: 1.5px solid var(--terracotta); }
.btn-ghost { background: transparent; color: var(--terracotta); }
.row-stack { padding: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.row-stack > .row { padding: 0; border: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-danger { background: transparent; color: var(--terracotta-dark); border: 1.5px solid var(--warn-bg); }
.link-btn { background: none; border: 0; color: var(--terracotta); font-weight: 600; cursor: pointer; padding: 8px 0; min-height: 44px; text-align: left; text-decoration: none; font-size: 14px; }
.chip-btn { border: 1.5px solid var(--terracotta); background: var(--white); color: var(--terracotta); border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 13px; font-weight: 700; cursor: pointer; }
.chip-btn.subtle { border-color: var(--sand); color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn.active, .icon-btn:hover { color: var(--terracotta); background: var(--sand); }

.fab { position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--terracotta); color: var(--white); display: grid; place-items: center; box-shadow: 0 10px 24px rgba(168, 75, 42, 0.35); cursor: pointer; z-index: 6; }
.fab:hover { background: var(--terracotta-dark); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--white); border-top: 1px solid var(--sand); max-width: 560px; margin: 0 auto; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tab.active { color: var(--terracotta); font-weight: 700; }

/* ——— Formulaires ——— */
.form { display: flex; flex-direction: column; gap: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select { min-height: 48px; border: 1.5px solid var(--sand); border-radius: var(--radius-sm); background: var(--white); padding: 10px 12px; font-size: 16px; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--terracotta-soft); outline: none; box-shadow: 0 0 0 3px rgba(217, 139, 103, 0.25); }
.hint { font-size: 12px; color: var(--muted); }
.form-error { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--terracotta); flex: none; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--sand); border-radius: 999px; padding: 4px; }
.seg { border: 0; background: transparent; border-radius: 999px; min-height: 40px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg.active { background: var(--white); color: var(--terracotta); box-shadow: var(--shadow); }

/* ——— Feuille modale ——— */
.sheet-overlay { position: fixed; inset: 0; background: rgba(42, 31, 26, 0.35); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--cream); width: 100%; max-width: 560px; max-height: 85vh; max-height: calc(100dvh - 16px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-radius: 24px 24px 0 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); animation: rise 0.18s ease-out; outline: none; }
/* En-tête (titre + fermer) et bouton d'enregistrement toujours visibles, même sur un petit écran. */
.sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 2; background: var(--cream); margin: 0 -16px 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--sand); }
.sheet form > button[type=submit] { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -10px 14px 4px var(--cream); }
.field { min-width: 0; }
.field input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
.field input[type=date]::-webkit-date-and-time-value { text-align: left; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + 90px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 30; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--cream); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; max-width: 520px; box-shadow: var(--shadow); }
.toast-good { background: var(--good); }
.toast-warn { background: var(--terracotta-dark); }

.empty { display: flex; flex-direction: column; gap: 12px; text-align: center; padding: 8px 0; color: var(--muted); }

/* ——— Écrans d'accueil (connexion, inscription, accueil guidé) ——— */
.auth { max-width: 440px; margin: 0 auto; padding: calc(32px + env(safe-area-inset-top)) 20px 48px; display: flex; flex-direction: column; gap: 16px; }
.auth h1 { font-size: 32px; margin-top: 12px; }
.recovery-key { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 17px; font-weight: 700; letter-spacing: 0.04em; background: var(--white); border: 2px dashed var(--terracotta-soft); border-radius: var(--radius-sm); padding: 16px; word-break: break-all; text-align: center; user-select: all; }
.dots { display: flex; gap: 6px; }
.dot { width: 28px; height: 4px; border-radius: 2px; background: var(--sand); }
.dot.on { background: var(--terracotta); }

/* ——— Pages légales ——— */
.legal { max-width: 680px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 20px 64px; display: flex; flex-direction: column; gap: 16px; }
.legal section { display: flex; flex-direction: column; gap: 8px; }
.legal ul { margin: 0; padding-left: 20px; }

@media (min-width: 600px) {
  .content { padding: 16px 24px 32px; }
  h1 { font-size: 34px; }
}

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

.debt-row { border: 1.5px solid var(--sand); border-radius: var(--radius-sm); padding: 2px 12px 12px; margin: 0; min-width: 0; }
.debt-row legend { font-size: 13px; font-weight: 700; color: var(--terracotta); padding: 0 6px; }

/* Accueil guidé : charges à cocher puis à chiffrer, récapitulatif */
.chip-group { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.chip-group legend { font-size: 13px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; padding: 0; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--sand-2); background: var(--white); font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s; }
.chip svg { display: none; }
.chip.on { background: var(--terracotta); border-color: var(--terracotta); color: var(--white); }
.chip.on svg { display: block; }
.chip:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.charge-row { background: var(--white); border: 1.5px solid var(--sand); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 10px; }
.charge-name { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.charge-name svg { color: var(--terracotta); flex: none; }
.charge-name input { min-height: 40px; border: 1.5px solid var(--sand); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 16px; width: 100%; min-width: 0; }
.charge-inputs { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.euro { position: relative; min-width: 0; }
.euro input { width: 100%; min-height: 46px; border: 1.5px solid var(--sand); border-radius: var(--radius-sm); padding: 10px 30px 10px 12px; font-size: 16px; background: var(--cream); }
.euro span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.charge-inputs select, .when select { min-height: 46px; border: 1.5px solid var(--sand); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 16px; background: var(--cream); }
.when { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.when select { flex: 1; min-width: 0; }
.when .day-input { width: 64px; min-height: 42px; border: 1.5px solid var(--sand); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 16px; background: var(--cream); text-align: center; }
.when-month { flex: 1; display: flex; min-width: 0; }
p.when { margin: 0; }
.total-line { margin: 4px 0 0; text-align: right; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.recap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; gap: 10px; font-variant-numeric: tabular-nums; }
.recap-line { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; color: var(--ink-2); }
.recap-line.in strong { color: var(--good); }
.recap-left { display: grid; gap: 2px; border-top: 1.5px solid var(--sand); padding-top: 12px; margin-top: 4px; }
.recap-left span { font-size: 14px; color: var(--muted); }
.recap-left strong { font-family: var(--serif); font-size: 38px; line-height: 1.1; color: var(--good); }
.recap-left.neg strong { color: var(--terracotta); }

.row-tap { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; min-width: 0; }
.row-tap .row-title { text-decoration: underline; text-decoration-color: var(--sand-2); text-underline-offset: 3px; }

/* Alerte détaillée (cause du point bas) */
.story { border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 6px; }
.story-neg { background: var(--critical-bg); color: var(--white); }
.story-low { background: var(--warn-bg); color: var(--ink); }
.story p { margin: 0; }
.story-title { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.story-why { font-size: 15px; line-height: 1.45; }
.story-tip { font-size: 14px; opacity: 0.92; }
.story-btn { justify-self: start; margin-top: 4px; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 14px; cursor: pointer; }
.story-neg .story-btn { background: rgba(255, 255, 255, 0.2); color: var(--white); }
.story-low .story-btn { background: var(--white); color: var(--terracotta-dark); }

/* Courbe annotée */
.chart-danger { fill: #F7E2D2; }
.chart-tag { fill: var(--terracotta); }
.chart-tag-text { fill: var(--white); font: 800 10.5px var(--sans); text-anchor: middle; }
.chart-in { fill: none; stroke: var(--good); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-in-text { fill: var(--good); font: 700 10px var(--sans); }
.chart-in-text.end, .chart-label.end { text-anchor: end; }

/* Jour par jour */
.flux-summary { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: 15px; }
.flux-summary.neg { background: #F7E2D2; color: var(--terracotta-dark); }
.flux-summary.low { background: #F3E3C4; color: #7A4A0C; }
.flux-summary.ok { background: var(--good-bg); color: var(--good); }
.flux-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.flux-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.flux-legend i.neg { background: #F7E2D2; border: 1px solid #E9B99E; }
.flux-legend i.low { background: #F3E3C4; border: 1px solid #E2C48A; }
.flux-legend i.in { background: var(--good-bg); border: 1px solid #BFD0B2; }
.flux-head { display: grid; grid-template-columns: 58px 1fr auto; gap: 8px; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 6px; }
.flux-head span:last-child { text-align: right; }
.flux-week-title { margin: 10px 0 2px; padding: 0 6px; font-size: 12px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.flux { list-style: none; margin: 0; padding: 0; }
.flux-row { display: grid; grid-template-columns: 58px 1fr auto; gap: 8px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--sand); font-variant-numeric: tabular-nums; }
.flux-date { font-size: 13px; font-weight: 700; color: var(--muted); }
.flux-label { min-width: 0; }
.flux-label b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flux-label small { font-size: 13px; color: var(--muted); }
.flux-label small.in { color: var(--good); font-weight: 700; }
.flux-balance { text-align: right; font-weight: 800; font-size: 15px; white-space: nowrap; }
.flux-balance small { display: block; font-size: 11.5px; font-weight: 700; }
.flux-row.neg { background: #F7E2D2; border-radius: 10px; border-bottom-color: transparent; margin: 2px 0; }
.flux-row.neg .flux-balance { color: var(--terracotta-dark); }
.flux-row.low .flux-balance { color: #9A5A12; }
.flux-row.in { background: var(--good-bg); border-radius: 10px; border-bottom-color: transparent; margin: 2px 0; }

/* Dettes */
.block-title { margin: 0 2px; font-size: 12px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.tabnum { font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
.tag.late { background: var(--critical-bg); color: var(--white); }
.add-dashed { width: 100%; border: 1.5px dashed var(--sand-2); border-radius: var(--radius-sm); background: transparent; padding: 14px; font-weight: 800; font-size: 15px; color: var(--terracotta); cursor: pointer; }
.big-number.ink { color: var(--ink); }
.idea { background: var(--good-bg); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 6px; }
.idea p { margin: 0; }
.idea-q { font-weight: 800; color: var(--good); font-size: 14px; }
.idea-a { font-size: 15px; line-height: 1.45; color: var(--ink); }
.idea-go { justify-self: start; border: 0; background: var(--good); color: var(--white); border-radius: 999px; padding: 9px 14px; font-weight: 800; font-size: 14px; cursor: pointer; }
.actions .btn { width: 100%; }
.card-title { font-size: 17px; }
.link-btn.back { justify-self: start; }
.row.planned .row-title, .row.planned .amount { color: var(--muted); }
.calc-line { margin: 0; background: var(--sand); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink-2); }
.add-dashed.small { padding: 10px; font-size: 14px; }
.debt-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 0 4px; }
.debt-row-title { font-size: 13px; font-weight: 700; color: var(--terracotta); }
.debt-row-actions { display: flex; gap: 6px; }

/* ——— Onglet Pro ——— */
.pill-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pill-tabs::-webkit-scrollbar { display: none; }
.pill-tab { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--white); border: 1.5px solid var(--sand); color: var(--ink-2, #4A3B32); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
.pill-tab.active { background: var(--terracotta); border-color: var(--terracotta); color: var(--white); }
.pill-tab.add { width: 38px; justify-content: center; padding: 0; font-size: 20px; color: var(--terracotta); }
.activity-card .row-sub { margin-top: 2px; }
.prop-lines { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-top: 6px; font-size: 14px; color: var(--ink-2, #4A3B32); }
.prop-lines strong { color: var(--ink); }
.total-line { padding-top: 10px; border-top: 1px solid var(--sand); }
.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; border-radius: 14px; border: 1.5px solid var(--sand); background: var(--white); cursor: pointer; font: inherit; color: var(--ink); }
.kind-card strong { font-size: 14px; }
.kind-card span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.kind-card.active { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(217, 139, 103, 0.22); }
.kind-card:disabled { opacity: 0.5; cursor: not-allowed; }
.sci-charge { border-bottom: 1px solid var(--sand); padding: 6px 0; }
.sci-charge-detail { padding: 6px 0 4px 32px; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: g; display: grid; gap: 14px; }
.guide-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 4px 10px; }
.guide-steps li::before { counter-increment: g; content: counter(g); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--terracotta); color: var(--white); display: grid; place-items: center; font-weight: 700; }
.guide-steps span { color: var(--muted); font-size: 14px; }
.guide-faq { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; }

/* ——— Accueil : bandeau d'état, comptes en rectangles, premiers pas ——— */
.status-line { flex-direction: row; align-items: center; gap: 10px; font-size: 15px; }
.status-icon { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, 0.6); flex: none; }
.hero-balance { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sand); font-size: 14px; color: var(--ink-2); }
.account-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.account-tile { display: grid; gap: 2px; text-align: left; background: var(--white); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow); cursor: pointer; font: inherit; color: var(--ink); min-width: 0; }
.account-tile:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.tile-tag { justify-self: start; font-size: 11px; font-weight: 700; color: var(--terracotta-dark); background: var(--sand); border-radius: 999px; padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-name { font-size: 13px; color: var(--muted); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-balance { font-size: 17px; }
.tile-balance.negative { color: var(--terracotta-dark); }
.tile-why { font-size: 12px; font-weight: 600; }
.tile-warn { border-color: var(--terracotta-soft); }
.tile-warn .tile-why { color: var(--warn); }
.tile-critical { border-color: var(--terracotta); }
.tile-critical .tile-why { color: var(--terracotta); }
.first-steps { border: 1.5px dashed var(--terracotta-soft); border-radius: var(--radius); padding: 12px 16px; }
.first-steps-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.fs-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; background: none; border: 0; padding: 0; font: inherit; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer; }
.fs-item.done { color: var(--muted); text-decoration: line-through; cursor: default; }
.fs-box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--terracotta-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex: none; }
.fs-item.done .fs-box { background: var(--good-bg); border-color: var(--good-bg); color: var(--good); }
.fs-go { margin-left: auto; color: var(--terracotta); font-weight: 700; }
.link-btn.small { min-height: 32px; padding: 4px 0; font-size: 13px; }

/* ——— Mes prochains mois : barres mensuelles, tableau, marges et conseils ——— */
.seg-3 { grid-template-columns: repeat(3, 1fr); background: var(--cream); }
.month-bars-wrap { margin-top: 12px; }
.month-bars { display: flex; gap: 4px; align-items: flex-end; height: 72px; }
.month-bars > * { flex: 1 1 0; }
.month-bar { display: block; border: 0; padding: 0; border-radius: 6px 6px 2px 2px; background: var(--sand-2); min-height: 4px; cursor: default; }
button.month-bar { cursor: pointer; }
.month-bar.bar-good { background: #C9D9BC; }
.month-bar.bar-low { background: var(--terracotta-soft); }
.month-bar.bar-alert { background: var(--terracotta-dark); }
.month-bar.bar-last { background: var(--terracotta); }
.month-labels { display: flex; gap: 4px; margin-top: 4px; font-size: 11px; color: var(--muted); text-align: center; }
.month-labels > * { flex: 1 1 0; }
.month-labels .is-alert { color: var(--terracotta-dark); font-weight: 700; }
.months-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.months-table th { font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; padding: 6px 2px; border-bottom: 1px solid var(--sand); }
.months-table th:first-child, .months-table td:first-child { text-align: left; width: 26%; }
.months-table td { text-align: right; padding: 9px 2px; border-bottom: 1px solid var(--sand); vertical-align: top; overflow-wrap: anywhere; }
.months-table td.in { color: var(--good); }
.month-row { cursor: pointer; }
.month-row.is-alert { background: var(--warn-bg); }
.month-row.is-good { background: #F3F7EE; }
.month-row .chev { color: var(--muted); font-size: 11px; }
.month-alert { display: block; font-size: 11px; color: var(--terracotta-dark); font-weight: 700; margin-top: 2px; }
.margin-chip { display: inline-block; margin-top: 4px; border: 0; background: var(--good-bg); color: var(--good); font: inherit; font-size: 11px; font-weight: 800; border-radius: 10px; padding: 3px 7px; cursor: pointer; line-height: 1.25; max-width: 100%; }
.month-detail td { background: var(--cream); text-align: left; padding: 8px 10px; }
.month-split { display: grid; gap: 4px; font-size: 13px; }
.advice-list { display: grid; gap: 8px; }
.advice { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--white); border: 1.5px solid var(--sand); border-radius: var(--radius-sm); padding: 12px; font: inherit; color: var(--ink); cursor: pointer; }
.advice.active { border-color: var(--terracotta); background: var(--cream); }
.advice-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--sand); color: var(--terracotta); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.advice-text { display: grid; gap: 2px; }
.advice-text small { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.next-months { display: grid; gap: 4px; text-align: left; width: 100%; font: inherit; color: var(--ink); border: 1.5px solid var(--sand-2); cursor: pointer; }
.next-months h2 { margin: 0; }
.next-total { font-family: var(--serif); font-size: 22px; color: var(--terracotta); }
.next-line { margin: 8px 0 0; font-size: 14px; line-height: 1.45; border-radius: var(--radius-sm); padding: 8px 10px; background: var(--cream); }
.next-line.good { background: var(--good-bg); color: var(--good); }
.next-line.alert { background: var(--warn-bg); color: var(--warn); }
.row-selected { background: var(--cream); border-radius: var(--radius-sm); box-shadow: inset 3px 0 0 var(--terracotta); padding-left: 10px; }
