/* ============================================================
   LE MANIFESTE — Navigation (barre + méga-panneaux + sommaire)
   Autonome : scopée #mfn-root / .mfn-*, aucune dépendance aux
   anciennes classes .nav-* (devenues inertes).
   Tokens repris de manifeste.css, redéfinis localement pour
   fonctionner aussi hors body.manifeste.
   ============================================================ */

#mfn-root {
    --mfn-paper: #faf7f0;
    --mfn-paper-2: #f3eee3;
    --mfn-surface: #fffdf8;
    --mfn-ink: #0e2a1c;
    --mfn-ink-2: #3f5249;
    --mfn-ink-3: #5f7168; /* assombri vs --ink-3 du site : AA ≥ 4.5 sur petit texte */
    --mfn-rule: color-mix(in srgb, #0e2a1c 12%, transparent);
    --mfn-rule-soft: color-mix(in srgb, #0e2a1c 7%, transparent);
    --mfn-rule-strong: color-mix(in srgb, #0e2a1c 32%, transparent);
    --mfn-accent: #ef4444;
    --mfn-accent-deep: #b91c1c;
    --mfn-serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --mfn-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --mfn-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    --mfn-ease: cubic-bezier(.22, .61, .36, 1);

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    font-family: var(--mfn-sans);
    color: var(--mfn-ink);
    -webkit-font-smoothing: antialiased;
}

#mfn-root *, #mfn-root *::before, #mfn-root *::after { box-sizing: border-box; }
#mfn-root a { text-decoration: none; }
#mfn-root button { font-family: inherit; background: none; border: 0; cursor: pointer; }
#mfn-root svg { display: block; }

html.mfn-lock, html.mfn-lock body { overflow: hidden; }

/* ============================================================
   BARRE — masthead éditorial pleine largeur
   ============================================================ */
.mfn-bar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 2.25rem);
    height: 68px;
    padding-inline: clamp(1.25rem, 4vw, 3rem);
    background: color-mix(in srgb, #faf7f0 88%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    backdrop-filter: blur(14px) saturate(1.05);
    border-bottom: 1px solid var(--mfn-rule);
    transition: height .35s var(--mfn-ease), box-shadow .35s ease;
}
#mfn-root.is-scrolled:not(.has-open) .mfn-bar {
    height: 56px;
    box-shadow: 0 14px 34px -24px color-mix(in srgb, var(--mfn-ink) 40%, transparent);
}

/* ---------- Marque ---------- */
#mfn-root .mfn-brand {
    font-family: var(--mfn-serif);
    font-weight: 560;
    font-size: 1.32rem;
    letter-spacing: -0.01em;
    color: var(--mfn-ink);
    white-space: nowrap;
    line-height: 1;
    padding-block: .2rem;
}
.mfn-brand-dot {
    font-style: italic;
    font-weight: 480;
    color: var(--mfn-accent);
}

/* ---------- Rail central + souligné magnétique ---------- */
.mfn-rail {
    position: relative;
    flex: 1;
    align-self: stretch;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: .15rem;
}
#mfn-root .mfn-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: .38rem;
    padding-inline: .85rem;
    font-size: .93rem;
    font-weight: 500;
    color: var(--mfn-ink-2);
    white-space: nowrap;
    transition: color .22s ease;
}
.mfn-item:hover, .mfn-item:focus-visible { color: var(--mfn-ink); }
.mfn-item.is-active { color: var(--mfn-ink); font-weight: 600; }
.mfn-item[aria-expanded="true"] { color: var(--mfn-ink); }
.mfn-caret { display: inline-flex; width: 11px; color: var(--mfn-ink-3); transition: transform .28s var(--mfn-ease), color .22s ease; }
.mfn-caret svg { width: 100%; height: auto; }
.mfn-item[aria-expanded="true"] .mfn-caret { transform: rotate(180deg); color: var(--mfn-accent-deep); }

.mfn-underline {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--mfn-ink);
    opacity: 0;
    transition: transform .3s var(--mfn-ease), width .3s var(--mfn-ease), opacity .2s ease, background-color .25s ease;
    pointer-events: none;
}
.mfn-underline.is-on { opacity: 1; }
.mfn-underline.is-red { background: var(--mfn-accent); }
.mfn-underline.no-anim { transition: none; }

/* ---------- Extrémité droite ---------- */
.mfn-end { display: flex; align-items: center; gap: .7rem; }

.mfn-lang { position: relative; }
.mfn-lang-btn {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .6rem;
    border: 1px solid var(--mfn-rule);
    border-radius: 6px;
    color: var(--mfn-ink-2);
    transition: border-color .22s ease, color .22s ease, background-color .22s ease;
}
.mfn-lang-btn:hover { border-color: var(--mfn-rule-strong); color: var(--mfn-ink); background: color-mix(in srgb, var(--mfn-paper) 65%, transparent); }
.mfn-lang-code { font-family: var(--mfn-mono); font-size: .74rem; font-weight: 600; letter-spacing: .06em; }
.mfn-flag { display: inline-flex; width: 18px; flex: none; }
.mfn-flag svg { width: 100%; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--mfn-ink) 12%, transparent); }

.mfn-lang-pop {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 192px;
    background: var(--mfn-surface);
    border: 1px solid var(--mfn-rule);
    border-radius: 10px;
    padding: .4rem;
    box-shadow: 0 26px 55px -22px color-mix(in srgb, var(--mfn-ink) 38%, transparent);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .24s ease, transform .28s var(--mfn-ease), visibility 0s linear .28s;
}
.mfn-lang-pop.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity .26s ease, transform .3s var(--mfn-ease);
}
.mfn-lang-pop::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--mfn-accent);
    border-radius: 10px 10px 0 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .45s var(--mfn-ease) .05s;
}
.mfn-lang-pop.is-open::before { transform: scaleX(1); }
.mfn-lang-pop button {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .55rem .6rem;
    border-radius: 6px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--mfn-ink-2);
    transition: background-color .18s ease, color .18s ease;
}
.mfn-lang-pop button:hover { background: var(--mfn-paper-2); color: var(--mfn-ink); }
.mfn-lang-pop button[aria-checked="true"] { color: var(--mfn-ink); font-weight: 650; }
.mfn-lang-name { flex: 1; text-align: left; }
.mfn-lang-check { width: 14px; color: var(--mfn-accent-deep); opacity: 0; transition: opacity .18s ease; }
.mfn-lang-check svg { width: 100%; height: auto; }
.mfn-lang-pop button[aria-checked="true"] .mfn-lang-check { opacity: 1; }

/* ---------- CTA encre ---------- */
#mfn-root .mfn-cta {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .62rem 1.05rem;
    background: var(--mfn-ink);
    color: var(--mfn-paper);
    border: 1px solid var(--mfn-ink);
    border-radius: 6px;
    font-size: .88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.mfn-cta svg { width: 15px; height: 15px; transition: transform .25s var(--mfn-ease); }
.mfn-cta:hover { background: var(--mfn-accent-deep); border-color: var(--mfn-accent-deep); color: #fff; }
.mfn-cta:hover svg { transform: translateX(3px); }

/* ---------- Burger (mobile) ---------- */
.mfn-burger {
    display: none;
    width: 48px;
    height: 48px;
    margin-right: -.7rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--mfn-ink);
}
.mfn-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .32s var(--mfn-ease);
}
.mfn-burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.mfn-burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Ligne ECG (signature vivante) ---------- */
.mfn-ecg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    pointer-events: none;
}
.mfn-ecg-line {
    position: absolute;
    inset: 0;
    background: var(--mfn-accent);
    opacity: .26;
}
.mfn-ecg-qrs {
    position: absolute;
    left: 0;
    bottom: -15px;
    width: 120px;
    height: 18px;
    overflow: visible;
    opacity: 0;
    animation: mfn-ecg-run 7s linear infinite;
}
.mfn-ecg-qrs path {
    fill: none;
    stroke: var(--mfn-accent);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@keyframes mfn-ecg-run {
    0% { transform: translateX(-140px); opacity: 0; }
    3% { opacity: .9; }
    33% { opacity: .9; }
    37.15% { transform: translateX(calc(100vw + 30px)); opacity: 0; }
    100% { transform: translateX(calc(100vw + 30px)); opacity: 0; }
}

/* ============================================================
   PANNEAUX — pleine largeur, accolés sous la barre
   ============================================================ */
.mfn-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1;
    background: var(--mfn-surface);
    border-bottom: 1px solid var(--mfn-rule);
    box-shadow: 0 34px 60px -34px color-mix(in srgb, var(--mfn-ink) 32%, transparent);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .26s ease, transform .3s var(--mfn-ease), visibility 0s linear .3s;
}
.mfn-panel.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity .3s ease, transform .34s var(--mfn-ease);
}
/* filet haut rouge qui se balaie */
.mfn-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--mfn-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .55s var(--mfn-ease) .06s;
}
.mfn-panel.is-open::before { transform: scaleX(1); }

.mfn-panel-inner {
    max-width: 76rem;
    margin-inline: auto;
    padding: 2.1rem clamp(1.25rem, 4vw, 3rem) 2.3rem;
}

/* En-têtes de colonnes mono */
.mfn-col-head {
    display: flex;
    align-items: center;
    gap: .65em;
    margin: 0 0 .9rem;
    font-family: var(--mfn-mono);
    font-size: .63rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--mfn-ink-3);
}
.mfn-col-head::before { content: ''; width: 1.7em; height: 1px; background: var(--mfn-accent); }

/* ---------- Cellules génériques ---------- */
.mfn-cell {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .62rem .7rem;
    margin-inline: -.7rem;
    border-radius: 7px;
    transition: background-color .2s ease;
}
.mfn-cell:hover { background: var(--mfn-paper-2); }
.mfn-cell-ico {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--mfn-rule);
    border-radius: 8px;
    color: var(--mfn-ink-2);
    background: var(--mfn-surface);
    transition: color .22s ease, border-color .22s ease, background-color .22s ease;
}
.mfn-cell-ico svg { width: 17px; height: 17px; }
.mfn-cell:hover .mfn-cell-ico { color: var(--mfn-accent-deep); border-color: var(--mfn-rule-strong); background: var(--mfn-paper); }
.mfn-cell-tx { flex: 1; min-width: 0; }
.mfn-cell-tx b {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: var(--mfn-ink);
    line-height: 1.3;
}
.mfn-cell-tx i {
    display: block;
    margin-top: .14rem;
    font-size: .76rem;
    font-style: normal;
    line-height: 1.45;
    color: var(--mfn-ink-3);
}
.mfn-cell-arrow {
    flex: none;
    align-self: center;
    width: 15px;
    color: var(--mfn-accent-deep);
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity .22s ease, transform .28s var(--mfn-ease);
}
.mfn-cell-arrow svg { width: 100%; height: auto; }
.mfn-cell:hover .mfn-cell-arrow { opacity: 1; transform: none; }

/* Révélation en cascade à l'ouverture */
.mfn-panel .mfn-cell,
.mfn-panel .mfn-prow,
.mfn-panel .mfn-feature,
.mfn-panel .mfn-watch,
.mfn-panel .mfn-ucard {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .32s ease, transform .42s var(--mfn-ease), background-color .2s ease;
}
.mfn-panel.is-open .mfn-cell,
.mfn-panel.is-open .mfn-prow,
.mfn-panel.is-open .mfn-feature,
.mfn-panel.is-open .mfn-watch,
.mfn-panel.is-open .mfn-ucard {
    opacity: 1;
    transform: none;
    transition-delay: calc(var(--i, 0) * 40ms), calc(var(--i, 0) * 40ms), 0ms;
}
.mfn-panel .mfn-feature, .mfn-panel .mfn-watch, .mfn-panel .mfn-ucard { transition-property: opacity, transform; }

/* ---------- Panneau Application : méga-grille ---------- */
.mfn-mega {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .92fr);
    gap: clamp(1.4rem, 2.6vw, 2.4rem);
}

/* Carte vedette démo (fond encre) */
#mfn-root .mfn-feature {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1.3rem 1.3rem 1.15rem;
    background: var(--mfn-ink);
    color: var(--mfn-paper);
    border-radius: 12px;
    overflow: hidden;
    transition: transform .3s var(--mfn-ease), box-shadow .3s ease;
}
.mfn-feature::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 88% -10%, color-mix(in srgb, var(--mfn-accent) 26%, transparent), transparent 58%);
    opacity: .8;
    transition: opacity .3s ease;
    pointer-events: none;
}
.mfn-feature:hover { transform: translateY(-3px); box-shadow: 0 26px 45px -22px color-mix(in srgb, var(--mfn-ink) 55%, transparent); }
.mfn-feature:hover::before { opacity: 1; }
.mfn-feature > * { position: relative; }
.mfn-feature-kicker {
    font-family: var(--mfn-mono);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--mfn-paper) 62%, transparent);
}
#mfn-root .mfn-feature-title {
    font-family: var(--mfn-serif);
    font-size: 1.42rem;
    font-weight: 560;
    line-height: 1.18;
    letter-spacing: -0.01em;
}
.mfn-feature-title em { font-style: italic; color: var(--mfn-accent); }
.mfn-feature-curve { width: 100%; height: auto; margin-block: .15rem; }
.mfn-feature-curve .ax-line { stroke: color-mix(in srgb, var(--mfn-paper) 18%, transparent); stroke-width: 1; }
.mfn-feature-curve .zone {
    fill: color-mix(in srgb, var(--mfn-paper) 9%, transparent);
    stroke: color-mix(in srgb, var(--mfn-paper) 22%, transparent);
    stroke-width: 1;
    stroke-dasharray: 2 3;
}
.mfn-feature-curve text {
    font-family: var(--mfn-mono);
    font-size: 8px;
    letter-spacing: .1em;
    fill: color-mix(in srgb, var(--mfn-paper) 48%, transparent);
}
.mfn-feature-curve .c {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}
.mfn-feature-curve .c1, .mfn-feature-curve .c3 { stroke: color-mix(in srgb, var(--mfn-paper) 88%, transparent); }
.mfn-feature-curve .c2 { stroke: var(--mfn-accent); }
.mfn-panel.is-open .mfn-feature-curve .c1 { stroke-dashoffset: 0; transition: stroke-dashoffset .8s ease .2s; }
.mfn-panel.is-open .mfn-feature-curve .c2 { stroke-dashoffset: 0; transition: stroke-dashoffset .6s ease .85s; }
.mfn-panel.is-open .mfn-feature-curve .c3 { stroke-dashoffset: 0; transition: stroke-dashoffset .5s ease 1.3s; }
.mfn-feature-cap {
    font-size: .75rem;
    line-height: 1.5;
    color: color-mix(in srgb, var(--mfn-paper) 62%, transparent);
}
.mfn-feature-cta {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: auto;
    padding-top: .55rem;
    border-top: 1px solid color-mix(in srgb, var(--mfn-paper) 16%, transparent);
    font-family: var(--mfn-mono);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--mfn-paper);
}
.mfn-feature-cta svg { width: 14px; height: 14px; transition: transform .25s var(--mfn-ease); }
.mfn-feature:hover .mfn-feature-cta svg { transform: translateX(4px); }

/* Colonne vedette : carte démo (encre) + carte GlycoGuard (app montre, distincte du SaaS) */
.mfn-side { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.mfn-side .mfn-feature { flex: 1; }
#mfn-root .mfn-watch {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: .95rem 1.05rem .9rem;
    background: var(--mfn-paper);
    border: 1px solid color-mix(in srgb, var(--mfn-ink) 16%, transparent);
    border-left: 2px solid var(--mfn-accent);
    border-radius: 12px;
    transition: transform .3s var(--mfn-ease), border-color .2s ease, box-shadow .3s ease;
}
.mfn-watch:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--mfn-ink) 34%, transparent); border-left-color: var(--mfn-accent); box-shadow: 0 18px 32px -24px color-mix(in srgb, var(--mfn-ink) 45%, transparent); }
.mfn-watch-chip {
    align-self: flex-start;
    font-family: var(--mfn-mono);
    font-size: .58rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--mfn-accent-deep);
    border: 1px solid color-mix(in srgb, var(--mfn-accent) 45%, transparent);
    border-radius: 999px;
    padding: .18rem .55rem;
}
.mfn-watch-row { display: flex; align-items: center; gap: .7rem; }
.mfn-watch-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: color-mix(in srgb, var(--mfn-ink) 6%, transparent); color: var(--mfn-ink); }
.mfn-watch-ico svg { width: 18px; height: 18px; }
.mfn-watch-tx { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.mfn-watch-tx b { font-size: .92rem; font-weight: 650; color: var(--mfn-ink); letter-spacing: -0.01em; }
.mfn-watch-tx i { font-style: normal; font-size: .74rem; line-height: 1.4; color: var(--mfn-ink-3); }
.mfn-watch-cta {
    display: flex; align-items: center; gap: .45rem;
    padding-top: .5rem;
    border-top: 1px solid color-mix(in srgb, var(--mfn-ink) 10%, transparent);
    font-family: var(--mfn-mono); font-size: .66rem; font-weight: 600;
    letter-spacing: .15em; text-transform: uppercase; color: var(--mfn-ink);
}
.mfn-watch-cta svg { width: 13px; height: 13px; transition: transform .25s var(--mfn-ease); }
.mfn-watch:hover .mfn-watch-cta { color: var(--mfn-accent-deep); }
.mfn-watch:hover .mfn-watch-cta svg { transform: translateX(4px); }

/* Renfort contraste CTA (tous contextes) */
#mfn-root a.mfn-cta, #mfn-root a.mfn-cta span,
#mfn-root a.mfn-ov-cta, #mfn-root a.mfn-ov-cta span { color: var(--mfn-paper); }

/* ---------- Panneau Pathologies ---------- */
.mfn-patho-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1.4rem, 2.6vw, 2.4rem);
}
.mfn-prow {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .52rem .6rem;
    margin-inline: -.6rem;
    border-radius: 6px;
    transition: background-color .2s ease;
}
.mfn-prow + .mfn-prow { border-top: 1px solid var(--mfn-rule-soft); }
.mfn-prow:hover { background: var(--mfn-paper-2); }
.mfn-prow-name {
    font-size: .9rem;
    font-weight: 550;
    color: var(--mfn-ink);
    transition: transform .25s var(--mfn-ease);
}
.mfn-prow:hover .mfn-prow-name { transform: translateX(2px); }
.mfn-prow-code {
    margin-left: auto;
    font-family: var(--mfn-mono);
    font-size: .7rem;
    letter-spacing: .04em;
    color: var(--mfn-ink-3);
    transition: color .2s ease;
}
.mfn-prow:hover .mfn-prow-code { color: var(--mfn-accent-deep); }
.mfn-prow-arrow {
    flex: none;
    width: 13px;
    align-self: center;
    color: var(--mfn-accent-deep);
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity .2s ease, transform .26s var(--mfn-ease);
}
.mfn-prow-arrow svg { width: 100%; height: auto; }
.mfn-prow:hover .mfn-prow-arrow { opacity: 1; transform: none; }

.mfn-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.7rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--mfn-rule);
}
#mfn-root .mfn-foot-link {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: .92rem;
    font-weight: 650;
    color: var(--mfn-accent-deep);
}
.mfn-foot-link svg { width: 15px; height: 15px; transition: transform .25s var(--mfn-ease); }
.mfn-foot-link:hover svg { transform: translateX(4px); }
.mfn-foot-note {
    margin: 0;
    font-family: var(--mfn-serif);
    font-style: italic;
    font-size: .95rem;
    color: var(--mfn-ink-3);
}

/* ---------- Panneau Ressources ---------- */
.mfn-res-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: clamp(1.6rem, 3vw, 2.6rem);
    align-items: start;
}
.mfn-res-cells {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(1.2rem, 2.4vw, 2rem);
}

/* Mini carte d'urgence (esprit de l'artefact de la home) */
.mfn-ucard {
    display: flex;
    flex-direction: column;
    background: var(--mfn-surface);
    border: 1px solid var(--mfn-rule-strong);
    border-radius: 10px;
    overflow: hidden;
    transform: rotate(-1.2deg);
    box-shadow: 0 2px 4px color-mix(in srgb, var(--mfn-ink) 10%, transparent),
                0 20px 40px -20px color-mix(in srgb, var(--mfn-ink) 32%, transparent);
    transition: transform .3s var(--mfn-ease), box-shadow .3s ease;
}
.mfn-ucard:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 0 4px 8px color-mix(in srgb, var(--mfn-ink) 12%, transparent),
                0 28px 50px -22px color-mix(in srgb, var(--mfn-ink) 40%, transparent);
}
.mfn-ucard-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    background: var(--mfn-accent);
    color: #fff;
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .03em;
    padding: .65rem 1rem;
}
.mfn-ucard-head svg { width: 15px; height: 15px; flex: none; }
.mfn-ucard-body { display: flex; flex-direction: column; gap: .4rem; padding: .95rem 1.05rem .75rem; }
.mfn-ucard-code { font-family: var(--mfn-mono); font-size: .66rem; letter-spacing: .05em; color: var(--mfn-ink-3); }
.mfn-ucard-warn { font-size: .83rem; font-weight: 650; color: var(--mfn-accent-deep); line-height: 1.4; }
.mfn-ucard-url {
    margin-top: .45rem;
    font-family: var(--mfn-mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-align: center;
    color: var(--mfn-ink);
}
.mfn-ucard-note {
    margin: 0 1.05rem;
    padding: .55rem 0 .8rem;
    border-top: 1px dashed var(--mfn-rule-strong);
    font-size: .71rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--mfn-ink-3);
}

/* ============================================================
   OVERLAY MOBILE — « Sommaire » plein écran
   ============================================================ */
.mfn-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: var(--mfn-paper);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
.mfn-overlay.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity .34s ease;
}
.mfn-ov-top {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    padding-inline: clamp(1.25rem, 4vw, 3rem);
    border-bottom: 1px solid var(--mfn-rule);
}
.mfn-ov-close {
    width: 48px;
    height: 48px;
    margin-right: -.75rem;
    display: grid;
    place-items: center;
    color: var(--mfn-ink);
}
.mfn-ov-close svg { width: 21px; height: 21px; }

.mfn-ov-kicker {
    flex: none;
    display: flex;
    align-items: center;
    gap: .8em;
    margin: 0;
    padding: 1.15rem clamp(1.25rem, 4vw, 3rem) .9rem;
    font-family: var(--mfn-mono);
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--mfn-ink-3);
}
.mfn-ov-kicker::before { content: ''; width: 2.2em; height: 1px; background: var(--mfn-accent); }

.mfn-ov-nav {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 1rem;
}

.mfn-chap {
    display: block;
    border-top: 1px solid var(--mfn-rule);
}
#mfn-root .mfn-chap--direct { border-bottom: 1px solid var(--mfn-rule); }
.mfn-chap-head, #mfn-root .mfn-chap--direct {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    width: 100%;
    min-height: 68px;
    padding: 1rem clamp(1.25rem, 4vw, 3rem);
    text-align: left;
}
.mfn-chap-no {
    font-family: var(--mfn-mono);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    color: var(--mfn-accent-deep);
}
.mfn-chap-title {
    font-family: var(--mfn-serif);
    font-size: clamp(1.65rem, 5.6vw, 2.15rem);
    font-weight: 560;
    letter-spacing: -0.015em;
    line-height: 1.05;
    color: var(--mfn-ink);
}
.mfn-chap-plus {
    margin-left: auto;
    align-self: center;
    width: 18px;
    color: var(--mfn-ink-2);
    transition: transform .32s var(--mfn-ease), color .22s ease;
}
.mfn-chap-plus svg { width: 100%; height: auto; }
.mfn-chap.is-open .mfn-chap-plus { transform: rotate(45deg); color: var(--mfn-accent-deep); }
.mfn-chap-plus--arrow { transform: none; color: var(--mfn-ink-3); }
.mfn-chap--direct:hover .mfn-chap-plus--arrow { color: var(--mfn-accent-deep); transform: translateX(4px); }

.mfn-chap-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .4s var(--mfn-ease);
}
.mfn-chap.is-open .mfn-chap-body { grid-template-rows: 1fr; }
.mfn-chap-in { overflow: hidden; min-height: 0; padding-bottom: .6rem; }

.mfn-ov-label {
    display: flex;
    align-items: center;
    gap: .7em;
    margin: 0;
    padding: 1rem clamp(1.25rem, 4vw, 3rem) .35rem;
    font-family: var(--mfn-mono);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--mfn-ink-3);
}
.mfn-ov-label::before { content: ''; width: 1.6em; height: 1px; background: var(--mfn-accent); }

.mfn-ov-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 54px;
    padding: .7rem clamp(1.25rem, 4vw, 3rem);
    border-top: 1px solid var(--mfn-rule-soft);
}
.mfn-ov-label + .mfn-ov-link { border-top: 0; }
.mfn-ov-link:active { background: var(--mfn-paper-2); }
.mfn-ov-link-ico {
    flex: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--mfn-rule);
    border-radius: 7px;
    color: var(--mfn-ink-2);
    background: var(--mfn-surface);
}
.mfn-ov-link-ico svg { width: 16px; height: 16px; }
.mfn-ov-link-ico--red { color: var(--mfn-accent-deep); border-color: color-mix(in srgb, var(--mfn-accent) 35%, transparent); }
.mfn-ov-link-tx { flex: 1; min-width: 0; }
.mfn-ov-link-tx b { display: block; font-size: .97rem; font-weight: 600; color: var(--mfn-ink); line-height: 1.3; }
.mfn-ov-link-tx i { display: block; margin-top: .1rem; font-size: .78rem; font-style: normal; color: var(--mfn-ink-3); line-height: 1.4; }
.mfn-ov-link--row b { font-weight: 550; }
.mfn-ov-link--row .mfn-prow-code { margin-left: auto; }
.mfn-ov-link--all b { color: var(--mfn-accent-deep); font-weight: 650; }
.mfn-ov-all-arrow { width: 15px; color: var(--mfn-accent-deep); }
.mfn-ov-all-arrow svg { width: 100%; height: auto; }
.mfn-ov-link--card i { color: var(--mfn-accent-deep); }

.mfn-ov-foot {
    flex: none;
    padding: 1rem clamp(1.25rem, 4vw, 3rem) calc(1.2rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--mfn-rule);
    background: var(--mfn-surface);
}
.mfn-ov-langs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: .95rem;
}
.mfn-ov-langs button {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 48px;
    padding: .5rem .8rem;
    border: 1px solid var(--mfn-rule);
    border-radius: 7px;
    font-family: var(--mfn-mono);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    color: var(--mfn-ink-2);
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.mfn-ov-langs button[aria-pressed="true"] {
    border-color: var(--mfn-ink);
    color: var(--mfn-ink);
    background: var(--mfn-paper);
}
#mfn-root .mfn-ov-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    min-height: 54px;
    padding: .95rem 1.2rem;
    background: var(--mfn-ink);
    color: var(--mfn-paper);
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 600;
}
.mfn-ov-cta svg { width: 16px; height: 16px; }
.mfn-ov-cta:active { background: var(--mfn-accent-deep); }
#mfn-root .mfn-ov-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    margin-top: .35rem;
    font-size: .92rem;
    font-weight: 550;
    color: var(--mfn-accent-deep);
}

/* Cascade d'ouverture du sommaire */
.mfn-ov-kicker, .mfn-chap, .mfn-ov-foot {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .38s ease, transform .48s var(--mfn-ease);
}
.mfn-overlay.is-open .mfn-ov-kicker,
.mfn-overlay.is-open .mfn-chap,
.mfn-overlay.is-open .mfn-ov-foot {
    opacity: 1;
    transform: none;
    transition-delay: calc(70ms + var(--i, 0) * 65ms), calc(70ms + var(--i, 0) * 65ms);
}

/* ============================================================
   ACCESSIBILITÉ — focus visible
   ============================================================ */
#mfn-root a:focus-visible, #mfn-root button:focus-visible {
    outline: 2px solid var(--mfn-accent);
    outline-offset: 2px;
    border-radius: 3px;
}
.floating-print-btn:focus-visible { outline: 2px solid var(--mfn-accent, #ef4444); outline-offset: 2px; }

/* Bouton « Imprimer » flottant : l'icône SVG remplace l'emoji */
.floating-print-btn { display: inline-flex; align-items: center; gap: .5rem; }
.floating-print-btn svg { width: 16px; height: 16px; flex: none; }

/* ============================================================
   BREAKPOINT — mobile < 1024px : rail masqué, burger + sommaire
   ============================================================ */
@media (max-width: 1023.98px) {
    .mfn-bar { height: 62px; }
    #mfn-root.is-scrolled:not(.has-open) .mfn-bar { height: 56px; }
    #mfn-root .mfn-rail, #mfn-root .mfn-lang, #mfn-root .mfn-cta, #mfn-root .mfn-panels { display: none; }
    .mfn-burger { display: flex; }
    .mfn-end { margin-left: auto; }
}
@media (min-width: 1024px) {
    .mfn-overlay { display: none; }
}

/* Panneaux étroits : resserrement */
@media (min-width: 1024px) and (max-width: 1240px) {
    .mfn-mega { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .98fr); gap: 1.3rem; }
    .mfn-cell-tx i { font-size: .73rem; }
}

/* ============================================================
   REDUCED MOTION — tout au calme
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    #mfn-root .mfn-ecg-qrs { display: none; }
    #mfn-root *, #mfn-root *::before, #mfn-root *::after {
        animation: none !important;
        transition-duration: .01ms !important;
        transition-delay: 0ms !important;
    }
    #mfn-root .mfn-panel .mfn-cell,
    #mfn-root .mfn-panel .mfn-prow,
    #mfn-root .mfn-panel .mfn-feature,
    #mfn-root .mfn-panel .mfn-ucard,
    #mfn-root .mfn-ov-kicker,
    #mfn-root .mfn-chap,
    #mfn-root .mfn-ov-foot {
        opacity: 1 !important;
        transform: none !important;
    }
    #mfn-root .mfn-feature-curve .c { stroke-dashoffset: 0 !important; }
    #mfn-root .mfn-ucard { transform: none !important; }
}

/* ============================================================
   IMPRESSION — ni barre, ni overlay, ni bouton
   ============================================================ */
@media print {
    #mfn-root { display: none !important; }
}
