/* Embeds budget fédéral, La Libre. Fond blanc pour intégration dans un article. */
:root {
  --marine: #061E4D; --magenta: #AC115D;
  --ink: #14181F; --ink-2: #4A515C; --ash: #B9BEC6; --line: #E1E4E9; --paper: #FFFFFF; --paper-2: #F3F4F6;
  --c1: #061E4D; --c2: #2E4E8C; --c3: #7A94C4; --c4: #AC115D; --c5: #C9CFDA;
  --serif: "Manuale", Georgia, serif; --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: transparent; }
body { font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
.embed { background: var(--paper); border-top: 3px solid var(--magenta); padding: 16px 20px 14px; max-width: 760px; margin: 0 auto; }
.embed__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.embed__kicker { font-size: 12px; color: var(--ink-2); margin: 0 0 4px; }
.embed__title { font-family: var(--serif); font-weight: 800; font-size: 22px; line-height: 1.15; margin: 0; color: var(--ink); letter-spacing: -.01em; }
.embed__brand img { height: 18px; width: auto; }
.embed__foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.45; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; }
.embed__foot p { margin: 0; }
.embed__foot a { color: var(--magenta); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.sr { position: absolute; left: -9999px; }

/* ---- Barres empilées ---- */
.bars { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.bar { display: grid; gap: 8px; min-width: 0; }
.bar__label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bar__label strong { font-family: var(--serif); font-weight: 800; font-size: 18px; }
.bar__label span { font-size: 13px; color: var(--ink-2); }
.bar__track { display: flex; height: 44px; width: 100%; overflow: hidden; }
.seg { position: relative; min-width: 0; box-shadow: inset -2px 0 0 #fff; border: 0; padding: 0 8px; margin: 0; color: #fff; background: var(--c1); cursor: pointer; overflow: hidden; text-align: left; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: filter .2s var(--ease), flex-basis .8s var(--ease); flex: 0 0 0%; display: flex; align-items: center; }
.seg:hover, .seg.is-active { filter: brightness(1.12); }
.seg--secu, .seg--cotis { background: var(--c1); }
.seg--lsf, .seg--tva { background: var(--c2); }
.seg--fed, .seg--autres { background: var(--c3); }
.seg--interets { background: var(--c4); }
.seg__pct { font-family: var(--serif); font-weight: 800; font-size: 15px; margin-right: 6px; }
.seg__name { font-weight: 400; opacity: .9; }
.seg.is-narrow .seg__name { display: none; }
.seg.is-tiny .seg__pct { display: none; }
.detail { margin-top: 16px; min-height: 62px; background: var(--paper-2); padding: 10px 14px; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: baseline; }
.detail__val { font-family: var(--serif); font-weight: 800; font-size: 26px; grid-row: span 2; color: var(--marine); line-height: 1; }
.detail__label { font-weight: 600; }
.detail__text { font-size: 13px; color: var(--ink-2); }
.detail.is-empty .detail__label { color: var(--ink-2); font-weight: 400; }
.detail .derive { display: inline-block; font-size: 11px; color: var(--magenta); border: 1px solid currentColor; padding: 0 5px; margin-left: 6px; vertical-align: middle; }
.solde { margin-top: 16px; font-size: 13.5px; color: var(--ink-2); }
.solde strong { color: var(--magenta); font-family: var(--serif); font-size: 17px; }

/* ---- Trajectoire ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { border: 1px solid var(--line); background: var(--paper); padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tab[aria-selected="true"] { background: var(--marine); border-color: var(--marine); color: #fff; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 12px; fill: var(--ink-2); }
.chart .axis line { stroke: var(--line); }
.chart .axis .zero line { stroke: var(--ash); }
.chart .obs { fill: none; stroke: var(--marine); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .proj { fill: none; stroke: var(--marine); stroke-width: 2.5; stroke-dasharray: 2 6; stroke-linecap: round; }
.chart .dot { fill: var(--marine); }
.chart .dot--proj { fill: #fff; stroke: var(--marine); stroke-width: 2; }
.chart .thresh line { stroke: var(--magenta); stroke-width: 1.5; stroke-dasharray: 6 4; }
.chart .thresh text { fill: var(--magenta); font-weight: 600; }
.chart .val { fill: var(--ink); font-weight: 600; font-size: 12px; }
.chart .val--proj { fill: var(--ink-2); }
.chart .zone rect { fill: var(--paper-2); }
.chart .zone text { fill: var(--ink-2); font-size: 11px; }
.chart .effort line { stroke: var(--magenta); stroke-width: 1.5; }
.chart .effort text { fill: var(--magenta); font-weight: 600; font-size: 12px; }
.chart .effort circle { fill: var(--magenta); }
.chart .draw { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.6s var(--ease) forwards; }
.chart .proj.draw { animation: draw-dashed 1.2s var(--ease) .9s forwards; stroke-dasharray: 2 6; opacity: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes draw-dashed { to { opacity: 1; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 22px; height: 0; border-top: 2.5px solid var(--marine); }
.legend i.dashed { border-top-style: dotted; }
.legend i.thresh { border-top: 1.5px dashed var(--magenta); }
@media (prefers-reduced-motion: reduce) { .seg { transition: none; } .chart .draw { animation: none; stroke-dashoffset: 0; opacity: 1; } }
@media (max-width: 480px) { .embed { padding: 14px 14px 12px; } .embed__title { font-size: 19px; } .bar__track { height: 40px; } .detail__val { font-size: 22px; } }
