/* Budget mensuel : noir et blanc cassé, sans arrondis, ombres ni dégradés. */

@font-face {
  font-family: 'Plex Sans';
  src: url('../Fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plex Sans';
  src: url('../Fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../Fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --bg: #f2f1ec;
  --surface: #f8f7f3;
  --ink: #151515;
  --mute: #55544f;
  --line: #c4c2ba;
  --border: #74736d;
  --neg: #a11d1d;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%2355544f'/%3E%3C/svg%3E");
  --sans: 'Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: light;
}
/* Sombre : automatique selon l'appareil, ou forcé dans les réglages. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414;
    --surface: #1c1c1b;
    --ink: #ecebe6;
    --mute: #aaa9a2;
    --line: #3e3e3b;
    --border: #8d8c86;
    --neg: #f09a92;
    --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23aaa9a2'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414;
  --surface: #1c1c1b;
  --ink: #ecebe6;
  --mute: #aaa9a2;
  --line: #3e3e3b;
  --border: #8d8c86;
  --neg: #f09a92;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23aaa9a2'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { border-radius: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  font-feature-settings: 'tnum' 1;
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 8px 0 4px; letter-spacing: -0.01em; }
h2 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  border-top: 2px solid var(--ink); padding-top: 10px; margin: 40px 0 16px;
}
h3 { font-size: 1.05rem; margin: 0 0 8px; }
h4 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mute);
  margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line);
}
p { margin: 0 0 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }

/* En-tête et pied de page */
.site-header { border-bottom: 1px solid var(--ink); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 600; font-size: 1.1rem; text-decoration: none; letter-spacing: -0.01em; }
.site-header nav { display: flex; gap: 20px; }
.site-footer { border-top: 1px solid var(--ink); margin-top: 64px; padding: 24px 0 40px; font-size: 0.875rem; color: var(--mute); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.site-footer a, .site-footer .link { color: var(--ink); }

/* Champs et boutons */
input, select, textarea, button {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); padding: 7px 9px; min-height: 40px;
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 28px;
  background-image: var(--arrow);
  background-repeat: no-repeat; background-position: right 10px center;
}
input[type=number] { text-align: right; font-family: var(--mono); font-size: 0.95rem; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]:invalid, textarea[aria-invalid=true], input[aria-invalid=true] { border-color: var(--neg); border-width: 2px; }
::placeholder { color: var(--mute); opacity: 1; }

button { cursor: pointer; background: transparent; border-color: var(--ink); }
button.primary { background: var(--ink); color: var(--bg); font-weight: 600; padding: 10px 20px; min-height: 46px; }
button.danger, .link.danger { color: var(--neg); border-color: var(--neg); }
.link {
  border: 0; background: none; padding: 6px 0; min-height: 36px;
  text-decoration: underline; text-underline-offset: 2px; color: var(--ink);
}
.link.inline { padding: 0; min-height: 0; }
.account > .link, .block > .link, .add-account, .accounts + .link, .salary > .link { display: block; justify-self: start; text-align: left; margin-top: 2px; }

.field { display: grid; gap: 4px; }
.field > span, .field > label { font-size: 0.8rem; color: var(--mute); }
.opt { color: var(--mute); font-weight: 400; }
.hint { font-size: 0.875rem; color: var(--mute); margin: 4px 0 8px; }
.meta { color: var(--mute); margin-bottom: 0; }
.notice { border: 1px solid var(--ink); padding: 12px 14px; margin: 16px 0; background: var(--surface); }
.neg { color: var(--neg); }

/* Premier lancement */
.setup { max-width: 640px; padding: 40px 0 8px; }
.lead { font-size: 1.1rem; }
.setup-form { display: grid; gap: 18px; border-top: 1px solid var(--ink); padding-top: 24px; margin-top: 24px; }
.setup-form button { justify-self: start; }
.secondary-action { margin-top: 20px; color: var(--mute); }

/* Barre du mois */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 0 8px; }
.month-nav { display: flex; gap: 0; }
.month-nav button { min-width: 44px; font-size: 1.2rem; line-height: 1; }
.month-nav select { border-left: 0; border-right: 0; border-color: var(--ink); min-width: 200px; }
.add-account { margin-top: 12px; }
.settings summary { cursor: pointer; padding: 8px 0; text-decoration: underline; text-underline-offset: 2px; }
.settings form { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--ink); background: var(--surface); margin-top: 6px; min-width: 260px; }

/* Résumé */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.summary div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary dt { font-size: 0.8rem; color: var(--mute); }
.summary dd { margin: 2px 0 0; font-family: var(--mono); font-size: 1.15rem; }

/* Graphique en barres */
.bars { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.bars th, .bars td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.bars thead th { font-size: 0.75rem; color: var(--mute); font-weight: 400; border-bottom: 1px solid var(--ink); }
.bars tbody th { font-weight: 400; white-space: nowrap; }
.bar-cell { width: 45%; }
.bar { display: block; height: 12px; background: var(--ink); min-width: 2px; }
.num { text-align: right !important; font-family: var(--mono); white-space: nowrap; }

/* Comptes */
.accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 24px; align-items: start; }
.account { border: 1px solid var(--ink); background: var(--surface); padding: 16px; }
.account-head { display: grid; grid-template-columns: 1fr 1fr 96px; gap: 10px; }
.account-head input, .account-head select { width: 100%; min-width: 0; }

.row, .row-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 170px) 104px 72px 40px; gap: 6px; align-items: center; }
.row { margin-bottom: 6px; }
.row input, .row select { width: 100%; min-width: 0; }
.row.four, .row-head.four { grid-template-columns: minmax(0, 1fr) 120px 120px 84px 40px; }
.row.two, .row-head.two { grid-template-columns: minmax(0, 1fr) 130px 40px; }
.row-head { font-size: 0.75rem; color: var(--mute); margin-bottom: 4px; }
.row-head span:nth-child(3), .row-head.four span:nth-child(2) { text-align: right; }
.row-head.two span:nth-child(2) { text-align: right; }
.del { padding: 0; min-height: 40px; border-color: var(--border); font-size: 1.1rem; line-height: 1; }

.salary { display: grid; gap: 6px; margin-bottom: 10px; }
.salary .line { display: grid; grid-template-columns: 1fr 130px; gap: 10px; align-items: center; font-size: 0.95rem; }
.salary .line.strong { font-weight: 600; border-top: 1px solid var(--line); padding-top: 6px; }
.salary output { text-align: right; font-family: var(--mono); padding-right: 10px; }

.totals { margin: 16px 0 6px; border-top: 1px solid var(--ink); }
.totals div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.totals dd { margin: 0; font-family: var(--mono); }
.totals .solde { font-weight: 600; }

/* Épargne, dettes, envies */
.others { display: grid; gap: 32px; }
.block h3 { margin-bottom: 2px; }
.block-total { font-size: 0.95rem; border-top: 1px solid var(--ink); padding-top: 8px; margin-top: 8px; }

/* Taux */
.rates { margin-top: 8px; }
.rate-row { display: grid; grid-template-columns: 76px 140px auto 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.rate-row small { color: var(--mute); font-size: 0.85rem; }

/* Données */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Bandeau cookies */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 2px solid var(--ink);
  padding: 16px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: center;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; max-width: 720px; font-size: 0.9rem; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button { min-width: 110px; font-weight: 600; }

/* Pages de texte */
.page { max-width: 760px; padding-top: 32px; }
.page h2 { margin-top: 36px; }
.page ul, .page ol { padding-left: 20px; margin: 0 0 12px; }
.page li { margin-bottom: 4px; }
.page table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 0.92rem; }
.page th, .page td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.page thead th { border-bottom: 1px solid var(--ink); font-weight: 600; }
.table-scroll { overflow-x: auto; }
@media (max-width: 640px) {
  .page table, .page tbody, .page tr, .page td { display: block; width: 100%; }
  .page thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .page tr { border-top: 1px solid var(--ink); padding: 8px 0; }
  .page td { border: 0; padding: 3px 0; }
  .page td::before { content: attr(data-label); display: block; font-size: 0.75rem; color: var(--mute); }
}
.updated { color: var(--mute); font-size: 0.875rem; }

/* Formulaire de contact */
.contact-form { display: grid; gap: 18px; max-width: 560px; margin-top: 16px; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; }
.contact-form textarea { min-height: 180px; resize: vertical; }
.contact-form button { justify-self: start; }
.error { color: var(--neg); font-size: 0.875rem; margin: 2px 0 0; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { border-left: 3px solid var(--ink); padding: 8px 12px; }
.form-status:empty { display: none; }

/* Petits écrans */
@media (max-width: 640px) {
  h2 { margin-top: 32px; }
  .account { padding: 12px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-head { grid-template-columns: 1fr 1fr; }
  .account-head .narrow { grid-column: span 2; }
  .row-head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) 110px 40px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .row > :first-child { grid-column: 1 / -1; }
  .row > select:nth-child(2) { grid-column: 1; grid-row: 2; }
  .row:not(.four):not(.two) > input:nth-child(3) { grid-column: 2; grid-row: 2; }
  .row:not(.four):not(.two) > .del { grid-column: 3; grid-row: 2; }
  .row > .once { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; }
  .row .once-txt { display: inline; }
  .row.four { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 84px 40px; }
  .row.four > :first-child { grid-column: 1 / -1; }
  .row.four > :nth-child(2) { grid-column: 1; grid-row: 2; }
  .row.two { grid-template-columns: minmax(0, 1fr) 110px 40px; }
  .row.two > :first-child { grid-column: auto; }
  .salary .line { grid-template-columns: 1fr 120px; }
  .bar-cell { width: 30%; }
  .bars { font-size: 0.875rem; }
  .bars tbody th { white-space: normal; }
  .rate-row { grid-template-columns: 70px 1fr auto; }
  .rate-row small { grid-column: 1 / -1; }
  .cookie-banner { justify-content: flex-start; }
  .cookie-actions { width: 100%; }
  .cookie-actions button { flex: 1; }
}

/* Barre du haut : navigation */
.site-header nav { flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
/* Sélecteur de langue FR / EN : la langue active en gras, l'autre soulignée */
.lang-toggle { display: inline-flex; gap: 6px; align-items: baseline; }
.lang-toggle button, .lang-toggle a, .lang-toggle .current {
  border: 0; background: none; padding: 0; min-height: 0; font: inherit; color: var(--ink);
  text-decoration: underline; text-underline-offset: 2px;
}
.lang-toggle [aria-pressed="true"], .lang-toggle .current { font-weight: 600; text-decoration: none; cursor: default; }
.lang-toggle > span[aria-hidden] { color: var(--mute); }

/* Statut de synchronisation */
.sync-status { margin: 0; font-size: 0.85rem; color: var(--mute); align-self: center; }
.toolbar-right { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }

/* Réglages */
.settings-page h2:first-of-type { margin-top: 24px; }
.settings-page h3 { margin-top: 28px; }
.account { position: relative; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px 24px; max-width: 760px; }
.settings-grid select { width: 100%; }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.history-table th, .history-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.history-table th:first-child, .history-table td:first-child { text-align: left; }
.history-table thead th { border-bottom: 1px solid var(--ink); font-weight: 600; font-size: 0.8rem; }
.history-table td { font-family: var(--mono); }
.history-table td:first-child { font-family: var(--sans); }
.history-table tr.current td { font-weight: 600; }
.log-list { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--ink); }
.log-list li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.log-list time { color: var(--mute); font-family: var(--mono); font-size: 0.82rem; }

/* Page compte */
.tabs { display: flex; gap: 0; margin: 24px 0 0; border-bottom: 1px solid var(--ink); }
.tabs button { border: 1px solid var(--ink); border-bottom: 0; margin-right: -1px; min-height: 42px; padding: 8px 16px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); font-weight: 600; }
.auth-form { display: grid; gap: 16px; max-width: 460px; padding-top: 20px; }
.auth-form input { width: 100%; }
.auth-form button[type=submit] { justify-self: start; }
.or { color: var(--mute); margin: 20px 0 10px; }
.google-btn { display: inline-block; border: 1px solid var(--ink); padding: 9px 18px; text-decoration: none; min-height: 42px; }
.account-box { border: 1px solid var(--ink); background: var(--surface); padding: 16px; max-width: 560px; margin: 16px 0; }
.account-box p:last-child { margin-bottom: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; -webkit-appearance: checkbox; appearance: auto; }

@media (max-width: 640px) {
  .log-list li { grid-template-columns: 1fr; gap: 2px; }
  .history-table { font-size: 0.82rem; }
  .history-wrap { overflow-x: auto; }
}
.page .auth-form + p { margin-top: 24px; }

/* Import d'un relevé */
.statement { border: 1px solid var(--ink); background: var(--surface); padding: 16px; margin: 16px 0 24px; }
.statement h3 { margin-top: 0; }
.st-map { margin-bottom: 12px; }
.st-account { max-width: 460px; margin-bottom: 8px; }
.st-table td { vertical-align: middle; }
.st-table td.st-label { font-family: var(--sans); text-align: left; white-space: normal; min-width: 180px; }
.st-table select { min-height: 34px; padding: 4px 26px 4px 6px; font-size: 0.85rem; }
.st-table input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; -webkit-appearance: checkbox; appearance: auto; }

/* Aperçu d'un import structuré */
.sd-table td { font-family: var(--sans); text-align: left; white-space: normal; }
.sd-table th { text-align: left; }
.sd-table th:last-child, .sd-table td:last-child { text-align: right; font-family: var(--mono); white-space: nowrap; padding-right: 0; }
.sd-table td:nth-child(2) { color: var(--mute); }
@media (max-width: 640px) {
  .sd-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sd-table, .sd-table tbody { display: block; }
  .sd-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .sd-table td { display: block; border: 0; padding: 0; }
  .sd-table td:empty { display: none; }
  .sd-table td:nth-child(1) { grid-column: 1; grid-row: 1; font-weight: 600; }
  .sd-table td:last-child { grid-column: 2; grid-row: 1; }
  .sd-table td:nth-child(2), .sd-table td:nth-child(3), .sd-table td:nth-child(4) { grid-column: 1 / -1; }
}

/* Exemples dans l'aide */
.page pre { font-family: var(--mono); font-size: 0.86rem; line-height: 1.5; background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; max-width: 100%; overflow-x: auto; white-space: pre; }


/* Montants saisis en texte (virgule ou point acceptés) */
input[data-amount], input[data-plan], input[data-rate], #set-threshold { text-align: right; font-family: var(--mono); font-size: 0.95rem; }
.field-error { color: var(--neg); font-size: 0.85rem; margin: -2px 0 8px; }
td .field-error { margin: 4px 0 0; white-space: normal; text-align: left; font-family: var(--sans); }
.once { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.85rem; color: var(--mute); }
.once input { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; -webkit-appearance: checkbox; appearance: auto; }
.once-txt { display: none; }
.row-head span:nth-child(4) { text-align: center; }
.salary .check { font-size: 0.9rem; color: var(--mute); }
.check.wide { grid-column: 1 / -1; }
.with-unit { display: flex; gap: 8px; align-items: center; }
.with-unit input { width: 100%; min-width: 0; }

/* Résumé : le solde du mois d'abord */
.headline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--ink); border-bottom: 0; background: var(--surface); }
.kpi { padding: 14px 16px; display: grid; gap: 2px; align-content: start; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-label { font-size: 0.85rem; color: var(--mute); }
.kpi-value { font-family: var(--mono); font-size: 1.35rem; font-weight: 500; }
.kpi.main .kpi-value { font-size: 1.9rem; }
.kpi-value.strong { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.kpi-flag { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-note { font-size: 0.8rem; color: var(--mute); }
.alerts { list-style: none; margin: 0; padding: 10px 16px; border: 1px solid var(--ink); border-bottom: 0; border-left: 4px solid var(--neg); background: var(--surface); }
.alerts li { margin: 2px 0; font-size: 0.92rem; }
.summary { border-left: 1px solid var(--line); }
.summary.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sticky-sum { display: none; }

/* Mois pas encore créé */
.empty-month { border: 1px solid var(--ink); background: var(--surface); padding: 16px; margin-top: 16px; max-width: 720px; }
.empty-month p:first-child { font-size: 1.1rem; }

/* Dépenses par catégorie et budget prévu */
.bars input[data-plan] { width: 104px; min-height: 34px; padding: 4px 8px; }
.bars tr.over .c-spent, .bars tr.over .c-left { color: var(--neg); font-weight: 600; }
.bars tr.over .bar { background: var(--neg); }
.plan-add { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.9rem; }

/* Comptes repliables */
.account-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 10px; }
.account-top h3 { margin: 0; font-size: 1rem; }
.account-sum { margin: 0; font-family: var(--mono); font-size: 0.9rem; color: var(--mute); }
.account-sum.neg { color: var(--neg); }
.account-top .fold { margin-left: auto; padding: 4px 0; min-height: 24px; }
.account:not(.folded) .account-sum { display: none; }

/* Envies : délai */
.goals { list-style: none; padding: 0; margin: 6px 0 0; font-size: 0.9rem; color: var(--mute); }
.goals li { margin-bottom: 2px; }

/* Message court avec « Annuler » */
.toast { position: fixed; left: 16px; bottom: 16px; z-index: 25; max-width: min(520px, calc(100% - 32px)); background: var(--ink); color: var(--bg); padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.toast .link { color: var(--bg); font-weight: 600; min-height: 24px; }

/* Fenêtre de choix */
.dialog { border: 2px solid var(--ink); background: var(--surface); color: var(--ink); padding: 20px; max-width: min(540px, calc(100% - 32px)); }
.dialog::backdrop { background: rgba(10, 10, 10, 0.55); }
.dialog h2 { border: 0; padding: 0; margin: 0 0 10px; font-size: 1.1rem; text-transform: none; letter-spacing: 0; }

/* Courbe sur 12 mois */
.history-chart { margin: 8px 0 20px; }
.history-chart .legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 0 0 6px; font-size: 0.85rem; color: var(--mute); }
.history-chart .legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-area { position: relative; }
.chart-area:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.history-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.history-chart .grid { stroke: var(--line); stroke-width: 1; }
.history-chart .grid.zero { stroke: var(--mute); }
.history-chart .tick { fill: var(--mute); font-size: 11px; font-family: var(--sans); }
.history-chart .end-label { fill: var(--ink); font-size: 12px; font-family: var(--sans); }
.history-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.history-chart .s-solde { stroke: var(--ink); }
.history-chart .s-sav { stroke: var(--ink); stroke-dasharray: 7 4; }
.history-chart .s-debt { stroke: var(--mute); stroke-dasharray: 2 4; }
.history-chart .cross { stroke: var(--mute); stroke-width: 1; }
.history-chart .hit { fill: transparent; }
.tip { position: absolute; top: 4px; width: 190px; background: var(--surface); border: 1px solid var(--ink); padding: 8px 10px; font-size: 0.85rem; pointer-events: none; }
.tip p { margin: 0 0 2px; }
.tip .tip-title { color: var(--mute); }
.tip strong { font-family: var(--mono); font-weight: 500; }

/* Versions */
.versions li { grid-template-columns: 170px 1fr; }

/* Cibles tactiles d'au moins 24 px (WCAG 2.2) */
.site-footer nav a, .site-footer nav .link { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 0; }
.lang-toggle button, .lang-toggle a, .lang-toggle .current { min-height: 32px; padding: 4px 4px; display: inline-flex; align-items: center; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 32px; }

@media (max-width: 640px) {
  .headline { grid-template-columns: 1fr; }
  .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .summary.cols-3, .summary.cols-4, .summary.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary.cols-5 div:last-child { grid-column: span 2; }
  .bars .bar-col, .bars .bar-cell, .bars .part-col { display: none; }
  .bars input[data-plan] { width: 84px; }
  .month-nav select { min-width: 0; flex: 1; }
  .month-nav { width: 100%; }
  .sticky-sum { display: flex; position: sticky; bottom: 0; z-index: 10; gap: 8px; align-items: baseline; justify-content: space-between; background: var(--surface); border-top: 2px solid var(--ink); margin: 24px -16px 0; padding: 10px 16px; font-size: 0.95rem; }
  .sticky-sum strong { font-family: var(--mono); font-size: 1.1rem; }
  .toast { bottom: 64px; }
  .versions li { grid-template-columns: 1fr; }
  .history-chart .end-label { font-size: 14px; }
}
