/* Polices auto-hébergées (aucune requête vers un service tiers). IBM Plex : OFL 1.1 ; Newsreader : OFL 1.1. */
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* « Registre » version nuit : anthracite chaud, texte ivoire, filets fins, pas de cartes.
   Le fond n'est pas noir pur et le texte pas blanc pur, pour limiter le contraste éblouissant. */
:root {
  color-scheme: dark;
  --bg: #1c1b18;
  --surface: #232220;
  --surface-2: #2a2926;
  --text: #e6e1d6;
  --text-2: #c9c3b6;
  --muted: #9c968a;
  --faint: #6f6a60;
  --rule: #33312c;
  --rule-strong: #4a463e;
  --pos: #86bd95;
  --neg: #de917f;
  --focus: #d8c9a3;
  --accent: #d8c9a3;
  --c-pea: #8fa9d9;
  --c-cto: #d9b26c;
  --c-crypto: #b79fdb;
  --c-reinvest: #5a564e;
  /* Catégories de dépenses : six teintes dans un ordre validé pour le daltonisme sur ce fond, puis le gris « Autres ». */
  --cat-1: #3987e5;
  --cat-2: #d95926;
  --cat-3: #199e70;
  --cat-4: #c98500;
  --cat-5: #d55181;
  --cat-6: #9085e9;
  --cat-0: #5a564e;
  --header-h: 68px;
  --wrap: 1360px;
  --gutter: 56px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (max-width: 720px) { :root { --gutter: 16px; --header-h: 60px; } }

* { box-sizing: border-box; }
html { scrollbar-color: var(--rule-strong) var(--bg); scroll-padding-top: calc(var(--header-h) + 16px); }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
button, label.btn, label.link-btn, input { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.hidden { display: none !important; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--text); color: var(--bg); text-decoration: none; }
.skip-link:focus { top: 12px; }

.page { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter) 96px; flex: 1 0 auto; }
@media (max-width: 720px) { .page { padding-top: 28px; padding-bottom: 64px; } }

a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px; }
a:hover { color: var(--text); text-decoration-color: var(--text); }

/* ---------- En-tête du site ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.site-header.scrolled, .site-header.open { border-bottom-color: var(--rule); background: color-mix(in srgb, var(--bg) 94%, transparent); }
.site-header-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.logo:hover { color: var(--text); }
.logo-mark { width: 30px; height: 30px; flex-shrink: 0; }
.logo-mark rect { fill: var(--text); }
.logo-mark path { fill: none; stroke: var(--bg); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.logo-text { display: flex; flex-direction: column; font-family: var(--serif); font-size: 21px; line-height: 1.05; letter-spacing: -.01em; }
.logo-text small { font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  position: relative; padding: 8px 12px; border-radius: 999px; font-size: 14px; color: var(--muted); text-decoration: none;
  transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1.5px; background: var(--accent);
}

/* Accès à la démo : pastille détachée des autres liens, pour qu'on puisse essayer sans avoir d'export. */
.site-nav a.nav-demo {
  display: inline-flex; align-items: center; gap: 7px; margin-left: 12px; padding: 7px 15px 7px 12px;
  border: 1px solid var(--accent); color: var(--accent); font-weight: 500;
}
.site-nav a.nav-demo svg { width: 12px; height: 12px; fill: currentColor; }
.site-nav a.nav-demo:hover, .site-nav a.nav-demo.active { background: var(--accent); color: var(--bg); }
.site-nav a.nav-demo::after { display: none; }

.nav-toggle { display: none; width: 42px; height: 42px; margin-right: -8px; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; border-radius: 999px; }
.nav-toggle:hover { background: var(--surface); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 20px; height: 1.5px; margin: 0 auto; background: currentColor; transition: transform .2s, opacity .2s;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.site-header.open .nav-toggle-bars { background: transparent; }
.site-header.open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.site-header.open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    display: none;
  }
  .site-header.open .site-nav { display: flex; }
  .site-nav a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--rule); font-size: 16px; }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a:hover { background: none; }
  .site-nav a[aria-current="page"]::after { left: 4px; right: auto; width: 24px; bottom: 8px; }
  .site-nav a.nav-demo { justify-content: center; margin: 16px 0 0; padding: 12px; border: 1px solid var(--accent); border-radius: 999px; }
  .site-nav a.nav-demo:hover { background: var(--accent); }
}
@media (min-width: 901px) and (max-width: 1100px) { .site-nav a { padding: 8px 9px; font-size: 13.5px; } .site-nav a.nav-demo { margin-left: 6px; } }

/* ---------- En-tête de page ---------- */
.masthead { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; }
.eyebrow { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 6px 0 0; font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1.1; letter-spacing: -.01em; }
@media (max-width: 720px) { h1 { font-size: 34px; } }
.status { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.status .warn { color: var(--neg); }

/* Onglets des analyses : soulignement qui glisse sous l'onglet actif. */
.apptabs { display: flex; gap: 32px; margin-top: 32px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.apptabs::-webkit-scrollbar { display: none; }
.apptabs button {
  position: relative; flex-shrink: 0; background: none; border: 0; padding: 12px 0 14px; cursor: pointer; color: var(--muted); font-size: 15.5px;
}
.apptabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); transform: scaleX(0); transition: transform .2s; transform-origin: left; }
.apptabs button:hover { color: var(--text); }
.apptabs button.active { color: var(--text); font-weight: 600; }
.apptabs button.active::after { transform: scaleX(1); }
@media (max-width: 720px) { .apptabs { gap: 24px; } .apptabs button { font-size: 14.5px; } }

.link-btn {
  background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--muted); font-size: 13px;
  text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px;
}
.link-btn:hover { color: var(--text); text-decoration-color: var(--text); }

/* ---------- Accueil (aucun export chargé) ---------- */
.landing { margin-top: 56px; }
.landing-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px 72px; align-items: stretch; }
@media (max-width: 960px) { .landing-grid { grid-template-columns: minmax(0, 1fr); } }
.landing-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -.025em; }
.landing-title em { font-style: italic; color: var(--accent); }
.landing-lead { margin: 24px 0 0; max-width: 560px; font-size: 17px; line-height: 1.65; color: var(--text-2); }
.promises { list-style: none; margin: 32px 0 0; padding: 0; max-width: 560px; }
.promises li { position: relative; padding: 14px 0 14px 28px; border-top: 1px solid var(--rule); font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.promises li:last-child { border-bottom: 1px solid var(--rule); }
.promises li::before { content: ""; position: absolute; left: 2px; top: 21px; width: 12px; height: 6px; border-left: 1.5px solid var(--pos); border-bottom: 1.5px solid var(--pos); transform: rotate(-45deg); }
.promises strong { color: var(--text); font-weight: 600; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 56px 28px; border: 1px dashed var(--rule-strong); background: linear-gradient(180deg, var(--surface) 0%, transparent 100%);
  transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--text); background: var(--surface-2); }
.drop-icon { width: 34px; height: 34px; margin-bottom: 6px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-title { margin: 0; font-family: var(--serif); font-size: 30px; }
.empty-hint { margin: 0 0 16px; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.dropzone .link-btn { margin-top: 6px; }
.dropzone .remember { margin-top: 18px; max-width: 360px; text-align: left; line-height: 1.45; }
.guide-link { margin-top: 18px; font-size: 14px; color: var(--accent); text-decoration: none; }
.guide-link:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: var(--text); color: var(--bg);
  padding: 12px 22px; font-weight: 600; border: 0; text-decoration: none; transition: background .15s;
}
.btn:hover { background: #fff8ea; color: var(--bg); }
.btn.ghost { background: none; color: var(--text); border: 1px solid var(--rule-strong); }
.btn.ghost:hover { border-color: var(--text); background: var(--surface); }

.features { list-style: none; margin: 72px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 40px; }
@media (max-width: 1100px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .features { grid-template-columns: minmax(0, 1fr); } }
.features li { padding-top: 20px; border-top: 1px solid var(--rule-strong); }
.feature-num { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.features h3 { margin: 8px 0 8px; font-family: var(--serif); font-weight: 400; font-size: 24px; }
.features p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }
.privacy-note { margin: 56px 0 0; max-width: 820px; font-size: 13.5px; line-height: 1.65; color: var(--muted); }

/* ---------- Filtres ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center;
  margin: 28px 0 64px; padding: 4px 0; border-bottom: 1px solid var(--rule);
}
.textseg { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.textseg button {
  background: none; border: 0; padding: 10px 0; cursor: pointer; color: var(--muted); font-size: 14px;
}
.textseg button:hover { color: var(--text); }
.textseg button.active { color: var(--text); font-weight: 600; }
.scope { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; color: var(--muted); font-size: 14px; }
.scope strong { color: var(--text); font-weight: 500; }
.tab > .filters { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 12px; border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: var(--text); }
.chip [aria-hidden] { color: var(--muted); font-size: 15px; line-height: 1; }

/* ---------- Grand chiffre + indicateurs ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px 80px;
  align-items: end; margin-bottom: 88px;
}
@media (max-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero-label { font-size: 14px; color: var(--muted); }
.hero-value {
  margin-top: 12px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(52px, 7.4vw, 104px); line-height: .95; letter-spacing: -.03em;
}
.hero-sentence { margin: 22px 0 0; max-width: 640px; font-size: 17px; line-height: 1.65; color: var(--text-2); }
.hero-sentence strong { font-weight: 600; }
.empty-msg { margin: 0; color: var(--muted); }

.stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.stat { padding: 16px 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stats .stat:nth-last-child(-n+2) { border-bottom: 1px solid var(--rule); }
.stat dt { font-size: 13px; color: var(--muted); }
.stat dd { margin: 0; font-family: var(--mono); font-size: 20px; line-height: 1.3; }
.stat dd small { font-size: 13px; margin-left: 6px; }
.stat .note { display: block; font-size: 12px; color: var(--muted); font-family: var(--sans); }

/* ---------- Sections ---------- */
.block { margin-bottom: 88px; min-width: 0; }
.block-head { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -.005em; }
.sub { font-size: 13px; color: var(--muted); }
.legend-inline { display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 8px; }
.swatch-line { width: 20px; height: 2px; background: var(--text); }
.swatch-dash { width: 20px; border-top: 1.5px dashed var(--muted); }
.legend { margin: 20px 0 0; max-width: 900px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.legend strong { color: var(--text-2); font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 72px; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }

.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 340px; }
@media (max-width: 720px) { .chart-wrap, .chart-wrap.tall { height: 260px; } }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th {
  padding: 10px 12px; text-align: left; font-size: 11.5px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule);
}
thead tr:first-child th { border-top: 1px solid var(--rule-strong); }

/* En-têtes triables : le texte de l'en-tête est un bouton ; la flèche indique la colonne et le sens du tri. */
button.sort {
  background: none; border: 0; padding: 4px 0; margin: -4px 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  display: inline-flex; align-items: center; gap: 5px;
}
button.sort::after { content: "↕"; font-size: 11px; opacity: 0; transition: opacity .15s; }
button.sort:hover { color: var(--text); }
button.sort:hover::after { opacity: .5; }
button.sort.active { color: var(--text); }
button.sort[data-dir="asc"]::after { content: "↑"; opacity: 1; }
button.sort[data-dir="desc"]::after { content: "↓"; opacity: 1; }
td { padding: 13px 12px; border-bottom: 1px solid var(--rule); font-size: 14px; vertical-align: middle; }
th.num, td.num { text-align: right; }
td.num { font-family: var(--mono); font-size: 13.5px; }
td.muted { color: var(--muted); }
th.group { text-align: center !important; }
tr.total td { font-weight: 600; border-top: 1px solid var(--rule-strong); border-bottom: 0; }
tr.avg td { color: var(--muted); font-style: italic; }
tr.dim td { color: var(--faint); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface); }
tbody tr.selected { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--focus); }

/* Positions */
th.chev, td.chev { width: 40px; padding-right: 0; }
.pos-name .name { font-size: 15px; font-weight: 500; }
.pos-name { white-space: normal; min-width: 220px; }
.pos-name .meta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
tbody tr.closed .pos-name .name { color: var(--text-2); }
td .sub-line { display: block; margin-top: 2px; font-family: var(--sans); font-size: 11.5px; color: var(--muted); white-space: normal; }
.weight { display: flex; align-items: center; gap: 12px; min-width: 150px; }
.wbar { flex-grow: 1; height: 3px; background: var(--rule); }
.wbar span { display: block; height: 3px; background: var(--text-2); }
.wpct { width: 52px; text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.tag {
  display: inline-block; margin-left: 8px; padding: 0 7px; font-size: 11px; line-height: 18px;
  border: 1px solid var(--rule-strong); border-radius: 999px; color: var(--muted); vertical-align: 1px;
}
.tag.warn { color: var(--neg); border-color: var(--neg); }

.lot-toggle {
  width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; transition: transform .15s, color .15s;
}
.lot-toggle:hover { color: var(--text); }
.lot-toggle.open { transform: rotate(90deg); color: var(--text); }

/* Accordéon : détail des opérations.
   width 0 + min-width 100 % : le sous-tableau n'élargit pas le tableau parent, il défile dans sa cellule si besoin. */
.ledger-wrap { width: 0; min-width: 100%; overflow-x: auto; }
tr.lots > td { padding: 6px 12px 22px 52px; background: var(--surface); border-bottom: 1px solid var(--rule); }
table.ledger th { padding: 10px 8px 8px; font-size: 11px; border-top: 0; border-bottom: 1px solid var(--rule-strong); }
table.ledger td { padding: 8px; font-size: 13px; border-bottom: 1px dotted var(--rule-strong); }
table.ledger td.num { font-size: 12.5px; }
table.ledger tbody tr:last-child td { border-bottom: 0; }
table.ledger tbody tr.sold td { color: var(--faint); }
table.ledger .kind { margin-left: 6px; font-family: var(--sans); font-size: 11px; color: var(--muted); }
table.ledger tfoot td { padding-top: 10px; border-top: 1px solid var(--rule-strong); border-bottom: 0; font-weight: 600; }
.ledger-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); white-space: normal; }

/* ---------- Dépenses et recettes ---------- */
.swatch { display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 2px; background: var(--cat-0); vertical-align: 0; flex-shrink: 0; }
.swatch.c1, .wbar span.c1 { background: var(--cat-1); }
.swatch.c2, .wbar span.c2 { background: var(--cat-2); }
.swatch.c3, .wbar span.c3 { background: var(--cat-3); }
.swatch.c4, .wbar span.c4 { background: var(--cat-4); }
.swatch.c5, .wbar span.c5 { background: var(--cat-5); }
.swatch.c6, .wbar span.c6 { background: var(--cat-6); }
.wbar span.c0 { background: var(--cat-0); }
.swatch.in { background: none; border: 1.5px solid var(--pos); border-radius: 50%; }
.chip .swatch { margin-right: 0; }
#budgetCatTable .wbar, #budgetCatTable .wbar span { height: 6px; border-radius: 1px; }
#budgetCatTable .weight { min-width: 180px; }

.row-btn {
  display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-align: left;
}
.cat-cell { color: var(--text-2); font-size: 13px; }

.ranklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.ranklist li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
}
.ranklist.income li { grid-template-columns: minmax(0, 1fr) auto auto; gap: 20px; }
.ranklist.income .amount { grid-column: 3; grid-row: 1; }
.ranklist li.muted { display: block; }
.ranklist .rank { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.ranklist .who { min-width: 0; }
.ranklist .name { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranklist .meta { display: flex; align-items: center; margin-top: 2px; font-size: 12px; color: var(--muted); }
.ranklist .amount { font-family: var(--mono); font-size: 13.5px; text-align: right; }
.ranklist li.own .name { color: var(--muted); }
.own-toggle { white-space: nowrap; }

.ops-tools { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 320px; max-width: 520px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.search input {
  width: 100%; padding: 10px 12px 10px 38px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--text); font-size: 14px;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--focus); outline: none; }
.more-btn {
  display: block; width: 100%; margin-top: 16px; padding: 12px; border: 1px solid var(--rule); background: none; color: var(--muted); cursor: pointer; font-size: 13.5px;
}
.more-btn:hover { color: var(--text); border-color: var(--rule-strong); background: var(--surface); }

/* ---------- Import, session ---------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 13px; }

.session { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check.small { font-size: 13px; color: var(--muted); }
.check input { accent-color: var(--text); width: 15px; height: 15px; margin: 0; flex-shrink: 0; }

.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin: 28px 0 0; padding: 12px 16px;
  border: 1px solid var(--accent); border-left-width: 3px; background: var(--surface); font-size: 14px; color: var(--text-2);
}
.banner span { margin-right: auto; }
.banner strong { color: var(--accent); font-weight: 600; }

.ticker-input {
  width: 130px; padding: 6px 8px; border: 1px solid var(--rule-strong); background: var(--bg); color: var(--text);
  font-family: var(--mono); font-size: 13px; text-transform: uppercase;
}
.ticker-input:focus { border-color: var(--focus); outline: none; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--rule); background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.site-footer-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter) 32px;
  display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px 48px;
}
@media (max-width: 900px) { .site-footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .site-footer-inner { grid-template-columns: minmax(0, 1fr); } }
.footer-brand p { margin: 16px 0 0; max-width: 360px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-col h2 { margin: 0 0 4px; font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.footer-col a { font-size: 14px; color: var(--text-2); text-decoration: none; }
.footer-col a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--rule-strong); }
.social { display: inline-flex; align-items: center; gap: 10px; }
.social svg { width: 18px; height: 18px; fill: currentColor; }
.footer-bottom {
  max-width: var(--wrap); margin: 0 auto; padding: 16px var(--gutter) 28px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 12px; color: var(--faint);
}

/* ---------- Pages de contenu (guide, confidentialité, CGU, mentions légales) ---------- */
.doc { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 64px; margin-top: 48px; align-items: start; }
@media (max-width: 960px) { .doc { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: 13.5px; }
.toc h2 { margin: 0 0 12px; font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); border-left-color: var(--text); }
@media (max-width: 960px) { .toc { position: static; } }

.prose { max-width: 760px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 56px 0 14px; font-size: 26px; }
.prose h3 { margin: 32px 0 8px; font-family: var(--sans); font-size: 16px; font-weight: 600; }
.prose p, .prose li, .prose dd { color: var(--text-2); line-height: 1.75; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose code { font-family: var(--mono); font-size: 13px; color: var(--text); }
.prose table { white-space: normal; margin: 12px 0; }
.prose .lead { font-size: 18px; line-height: 1.7; color: var(--text-2); }
.prose .updated { font-size: 13px; color: var(--faint); }
.prose dl.facts { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); margin: 16px 0; border-top: 1px solid var(--rule); }
.prose dl.facts dt, .prose dl.facts dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.prose dl.facts dt { color: var(--muted); font-size: 14px; padding-right: 16px; }
@media (max-width: 600px) { .prose dl.facts { grid-template-columns: minmax(0, 1fr); } .prose dl.facts dt { padding-bottom: 0; border-bottom: 0; } }
.callout { margin: 24px 0; padding: 16px 20px; border-left: 2px solid var(--accent); background: var(--surface); }
.callout p { margin: 0; }
.callout.warn { border-left-color: var(--neg); }

/* Guide : chemin de menus et étapes numérotées */
.prose .path, .path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
.path li { display: inline-flex; align-items: center; gap: 8px; margin: 0 !important; }
.path li + li::before { content: "›"; color: var(--faint); }
.ui { display: inline-block; padding: 2px 10px; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface-2); color: var(--text); font-size: 13.5px; white-space: nowrap; line-height: 1.6; }
.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
@media (max-width: 720px) { .platforms { grid-template-columns: minmax(0, 1fr); } }
.platform { padding: 24px; border: 1px solid var(--rule); background: var(--surface); }
.platform h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.platform h3 svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.platform > p { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.steps { list-style: none; counter-reset: step; margin: 16px 0 0; padding: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 18px 44px; margin: 0 !important; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--rule-strong); font-family: var(--mono); font-size: 12.5px; color: var(--text);
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1px; background: var(--rule); }
.steps figure { margin: 12px 0 4px; }
.steps figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); }
.steps figcaption { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.file-name { font-family: var(--mono); font-size: 13px; padding: 2px 8px; background: var(--surface-2); border-radius: 4px; color: var(--text); white-space: nowrap; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 16px 32px 16px 0; position: relative; list-style: none; font-weight: 500; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-family: var(--mono); font-size: 18px; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { margin: 0 0 16px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

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

/* Petits écrans : le montant reste visible, les colonnes secondaires du budget disparaissent. */
@media (max-width: 600px) {
  #budgetOpsTable th:nth-child(3), #budgetOpsTable td:nth-child(3),
  #budgetCatTable th:nth-child(4), #budgetCatTable td:nth-child(4),
  #budgetCatTable th:nth-child(5), #budgetCatTable td:nth-child(5) { display: none; }
  #budgetCatTable .weight { min-width: 90px; }
  #budgetCatTable .pos-name, #budgetOpsTable .pos-name { min-width: 0; }
  #budgetOpsTable td, #budgetCatTable td { padding-left: 6px; padding-right: 6px; }
  .ranklist.income li { grid-template-columns: minmax(0, 1fr) auto; }
  .ranklist.income .amount { grid-column: 2; }
  .ranklist.income .own-toggle { grid-row: 2; grid-column: 1; }
}

/* ---------- Export chargé ou mémorisé : icône CSV et plage de dates ---------- */
.csv-icon { width: 30px; height: 38px; flex-shrink: 0; }
.csv-icon .sheet { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.2; }
.csv-icon .fold { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-linejoin: round; }
.csv-icon .band { fill: var(--pos); }
.csv-icon text { font-family: var(--mono); font-size: 7.5px; font-weight: 500; fill: var(--bg); text-anchor: middle; letter-spacing: .04em; }

.export-chip {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 14px; padding: 8px 16px 8px 10px;
  border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface); max-width: 100%;
}
.export-chip .csv-icon { width: 24px; height: 30px; }
.export-chip span { display: flex; flex-direction: column; min-width: 0; }
.export-chip strong { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text); }
.export-chip small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.saved-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 24px;
  margin-bottom: 40px; padding: 20px 24px; border: 1px solid var(--pos); border-left-width: 3px; background: var(--surface);
}
.saved-card .csv-icon { width: 38px; height: 48px; }
.saved-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.saved-text strong { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.saved-text small { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.saved-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
@media (max-width: 720px) {
  .saved-card { grid-template-columns: auto minmax(0, 1fr); }
  .saved-actions { grid-column: 1 / -1; align-items: flex-start; }
}

/* ---------- Saveback ---------- */
.tag.ok { color: var(--pos); border-color: var(--pos); }
.ranklist.holdings li { grid-template-columns: minmax(0, 1fr) auto; }
.ranklist.holdings .amount .sub-line { text-align: right; font-family: var(--mono); }
@media (max-width: 600px) {
  #savebackTable th:nth-child(3), #savebackTable td:nth-child(3),
  #savebackTable th:nth-child(5), #savebackTable td:nth-child(5),
  #savebackTable th:nth-child(6), #savebackTable td:nth-child(6) { display: none; }
  #savebackTable td, #savebackTable th { padding-left: 5px; padding-right: 5px; }
  #savebackTable td:last-child { white-space: normal; }
  #savebackTable .tag { margin-left: 0; }
}
@media (max-width: 600px) {
  .ranklist.holdings li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ranklist.holdings .amount, .ranklist.holdings .amount .sub-line { text-align: left; }
}
