/* ORIENTA — système visuel
   Palette inspirée des couleurs de la France (bleu France #000091, rouge Marianne #E1000F).
   N'utilise ni la Marianne, ni le bloc « République française », ni la police Marianne :
   le Système de design de l'État est réservé aux sites de l'administration. */

:root {
  --blue: #000091;
  --blue-hover: #1212ff;
  --blue-700: #2323b4;
  --blue-500: #6a6af4;
  --blue-200: #cacafb;
  --blue-100: #e3e3fd;
  --blue-50: #f5f5fe;
  --red: #e1000f;
  --red-100: #fde4e5;
  --green: #18753c;
  --green-100: #dffee6;
  --orange: #b34000;
  --orange-100: #ffe9e6;
  --ink: #161616;
  --ink-2: #3a3a3a;
  --muted: #666;
  --line: #e5e5e5;
  --line-2: #eeeeee;
  --bg: #f6f6f6;
  --card: #ffffff;
  --side: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 18, .06), 0 4px 16px rgba(0, 0, 18, .05);
  --radius: 14px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side-w: 264px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #8585f6; --blue-hover: #a1a1f8; --blue-700: #b1b1f9; --blue-500: #8585f6; --blue-200: #3b3b8f; --blue-100: #23235c; --blue-50: #17173d;
    --red: #ff6a6a; --red-100: #3d1b1c; --green: #3fbf76; --green-100: #14321f; --orange: #ff8d5c; --orange-100: #3a2014;
    --ink: #f0f0f0; --ink-2: #d6d6d6; --muted: #a3a3a3; --line: #2f2f36; --line-2: #26262c; --bg: #111114; --card: #1b1b20; --side: #16161a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue: #8585f6; --blue-hover: #a1a1f8; --blue-700: #b1b1f9; --blue-500: #8585f6; --blue-200: #3b3b8f; --blue-100: #23235c; --blue-50: #17173d;
  --red: #ff6a6a; --red-100: #3d1b1c; --green: #3fbf76; --green-100: #14321f; --orange: #ff8d5c; --orange-100: #3a2014;
  --ink: #f0f0f0; --ink-2: #d6d6d6; --muted: #a3a3a3; --line: #2f2f36; --line-2: #26262c; --bg: #111114; --card: #1b1b20; --side: #16161a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); font-feature-settings: "cv11", "ss01"; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-hover); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .9em; }
img, svg { max-width: 100%; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; border-radius: 4px; }

/* ───────────── structure ───────────── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 0 8px 14px; }
.brand-flag { display: inline-flex; height: 26px; width: 34px; border-radius: 5px; overflow: hidden; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.brand-flag i { flex: 1; } .brand-flag i:nth-child(1) { background: #000091; } .brand-flag i:nth-child(2) { background: #fff; } .brand-flag i:nth-child(3) { background: #e1000f; }
.brand-name { font-weight: 850; letter-spacing: .06em; font-size: 1.05rem; }
.brand-sub { display: block; font-size: .72rem; color: var(--muted); letter-spacing: 0; font-weight: 500; }
.side-search { position: relative; margin: 2px 4px 14px; }
.side-search input[type="search"] { width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; }
.side-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.nav-group { margin: 6px 0 10px; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 6px 12px 4px; margin: 0; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .93rem; }
.nav-group a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav-group a:hover { background: var(--blue-50); color: var(--blue); }
.nav-group a:hover svg { color: var(--blue); }
.nav-group a[aria-current="page"] { background: var(--blue-100); color: var(--blue); }
.nav-group a[aria-current="page"] svg { color: var(--blue); }
.side-foot { margin-top: auto; padding: 12px; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); }
.side-foot a { color: var(--muted); }
.main { min-width: 0; }
.topbar { display: none; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 20px 32px 40px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
.foot p { margin: 0 0 .4em; }

@media (max-width: 1023px) {
  .app { display: block; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 60; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 50; background: var(--side); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .topbar .brand { padding: 0; }
  .menu-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 9px; padding: 7px 12px; font: inherit; font-weight: 600; font-size: .9rem; }
  .page { padding: 20px 16px 48px; }
  .foot { padding: 16px; }
}

/* ───────────── en-têtes de page ───────────── */
.page-head { margin-bottom: 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--blue); margin: 0 0 8px; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 760px; }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; font-size: .82rem; color: var(--muted); }
.crumb li + li::before { content: "›"; margin-right: 6px; }
.crumb a { color: var(--muted); }
.meta { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ───────────── hero accueil ───────────── */
.hero { position: relative; overflow: hidden; border-radius: 22px; background: linear-gradient(135deg, #000091 0%, #1212ff 70%, #313178 100%); color: #fff; padding: clamp(24px, 5vw, 56px); margin-bottom: 26px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(225,0,15,.55), rgba(225,0,15,0) 70%); }
.hero h1 { color: #fff; max-width: 760px; font-size: clamp(1.8rem, 4vw, 2.9rem); position: relative; z-index: 1; }
.hero p { color: #e3e3fd; max-width: 640px; font-size: 1.05rem; position: relative; z-index: 1; }
.hero-search { position: relative; display: flex; gap: 8px; max-width: 680px; margin-top: 18px; z-index: 2; }
.hero-search input[type="search"] { flex: 1; min-width: 0; padding: 15px 18px; border-radius: 12px; border: 0; font: inherit; font-size: 1.02rem; background: #fff; color: #161616; }
.hero-search .btn { background: var(--red); border-color: var(--red); }
.hero-search .btn:hover { background: #c9191e; border-color: #c9191e; }
.hero-kpis { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; max-width: 920px; }
.hero-kpis div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 12px 14px; }
.hero-kpis strong { display: block; font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-kpis span { font-size: .8rem; color: #cacafb; }
@media (max-width: 720px) { .hero-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero-search { flex-direction: column; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: linear-gradient(135deg, #0b0b4d 0%, #1b1b8f 70%, #26264f 100%); } }

/* ───────────── cartes et grilles ───────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 18px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head select { width: auto; }
.card-sub { color: var(--muted); font-size: .86rem; margin: 2px 0 0; }
.card-foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .8rem; color: var(--muted); }
.card-foot p { margin: 0 0 .3em; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .g4 { grid-template-columns: minmax(0, 1fr); } }
.section { margin: 30px 0 14px; }
.section > h2 { margin-bottom: 4px; }
.section > .card-sub { margin-bottom: 14px; }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin: 0; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-value .unit { font-size: 1rem; font-weight: 700; color: var(--muted); margin-left: 2px; }
.kpi-value .na { font-size: 1rem; font-weight: 500; letter-spacing: 0; }
.kpi-hint { font-size: .78rem; color: var(--muted); margin: 6px 0 0; }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-top: 6px; }
.up { color: var(--green); background: var(--green-100); }
.down { color: var(--red); background: var(--red-100); }
.flat { color: var(--muted); background: var(--line-2); }
.kpi.accent { border-top: 4px solid var(--blue); }
.kpi.accent-red { border-top: 4px solid var(--red); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--blue-200); color: var(--ink); }
.tile svg { width: 26px; height: 26px; color: var(--blue); margin-bottom: 10px; }
.tile h3 { margin-bottom: 4px; }
.tile p { margin: 0; color: var(--muted); font-size: .88rem; }

/* ───────────── éléments ───────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font: inherit; font-weight: 650; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); border-color: var(--blue-200); }
.btn-ghost:hover { background: var(--blue-50); color: var(--blue); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-blue { background: var(--blue-100); color: var(--blue); }
.badge-red { background: var(--red-100); color: var(--red); }
.badge-green { background: var(--green-100); color: var(--green); }
.badge-orange { background: var(--orange-100); color: var(--orange); }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: .85rem; color: var(--ink); text-decoration: none; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip .x { font-weight: 800; opacity: .75; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.na { color: var(--muted); font-style: italic; font-size: .92em; }
.na-block { color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 8px 0; font-size: .92rem; }
.hint { color: var(--muted); font-size: .82rem; }
.callout { border-left: 4px solid var(--blue); background: var(--blue-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 12px 16px; margin: 12px 0; font-size: .92rem; }
.callout-warn { border-left-color: var(--orange); background: var(--orange-100); }
.callout-title { font-weight: 750; margin: 0 0 4px; }
.callout p:last-child { margin: 0; }
details.more { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; margin-top: 12px; background: var(--card); }
details.more > summary { cursor: pointer; padding: 11px 0; font-weight: 650; font-size: .92rem; color: var(--ink-2); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-block; width: 1em; color: var(--blue); margin-right: 6px; font-weight: 800; }
details.more[open] > summary::before { content: "−"; }
details.more > :last-child { margin-bottom: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; }
.muted { color: var(--muted); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li + li { margin-top: 6px; }
.split { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* formulaires */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field label, .field legend { font-size: .8rem; font-weight: 650; color: var(--ink-2); }
input[type="search"], input[type="number"], input[type="text"], select { font: inherit; font-size: .93rem; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); min-width: 0; width: 100%; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filters .grow { grid-column: span 2; }
@media (max-width: 560px) { .filters .grow { grid-column: auto; } }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 5px 12px; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--card); color: var(--blue); box-shadow: var(--shadow); }

/* onglets sans JavaScript (la liste d'onglets est le 1er div : panneau n = div n+1) */
.tabs { position: relative; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab-list label { padding: 9px 14px; font-weight: 650; font-size: .92rem; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab-panel { display: none; }
.tabs > input:nth-of-type(1):checked ~ .tab-list label:nth-of-type(1),
.tabs > input:nth-of-type(2):checked ~ .tab-list label:nth-of-type(2),
.tabs > input:nth-of-type(3):checked ~ .tab-list label:nth-of-type(3),
.tabs > input:nth-of-type(4):checked ~ .tab-list label:nth-of-type(4) { color: var(--blue); border-bottom-color: var(--blue); }
.tabs > input:nth-of-type(1):checked ~ .tab-panel:nth-of-type(2),
.tabs > input:nth-of-type(2):checked ~ .tab-panel:nth-of-type(3),
.tabs > input:nth-of-type(3):checked ~ .tab-panel:nth-of-type(4),
.tabs > input:nth-of-type(4):checked ~ .tab-panel:nth-of-type(5) { display: block; }
.tabs > input:focus-visible ~ .tab-list { outline: 2px solid var(--blue-500); outline-offset: 4px; border-radius: 6px; }

/* ───────────── visualisations ───────────── */
.bars { display: flex; flex-direction: column; gap: 11px; margin: 4px 0; }
.bar { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.bar.norank { grid-template-columns: minmax(0, 1fr) auto; }
.bar-rank { font-weight: 800; color: var(--muted); font-size: .85rem; text-align: right; font-variant-numeric: tabular-nums; }
.bar-main { display: block; min-width: 0; }
.bar-label { display: block; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
a.bar-label:hover { color: var(--blue); text-decoration: underline; }
.bar-sub { display: block; font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; position: relative; height: 9px; border-radius: 999px; background: var(--line-2); margin-top: 5px; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--blue); }
.bar-fill.red { background: var(--red); }
.bar-fill.soft { background: var(--blue-500); }
.bar-range { position: absolute; top: 0; bottom: 0; background: var(--blue-200); border-radius: 999px; }
.bar-med { position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px; background: var(--blue); border-radius: 2px; }
.bar-val { display: block; font-weight: 800; font-variant-numeric: tabular-nums; font-size: .95rem; text-align: right; white-space: nowrap; }
.bar-val small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }

.chart { margin: 6px 0 0; }
.chart svg { display: block; width: 100%; height: auto; max-height: 330px; margin: 0 auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .axis-title { fill: var(--ink-2); font-size: 12px; font-weight: 650; font-family: var(--font); }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart .na-mark { fill: var(--muted); font-size: 12px; font-style: italic; font-family: var(--font); }
.chart .pt { cursor: pointer; }
.chart .dotp { fill-opacity: .45; }
.chart .dotp:hover { fill-opacity: 1; }
.chart .trend { stroke: var(--red); stroke-width: 2; stroke-dasharray: 6 4; fill: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.spark { display: inline-block; vertical-align: middle; }
.spark .line { fill: none; stroke: var(--blue); stroke-width: 2; }
.spark .area { fill: var(--blue-100); stroke: none; }

.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.stack span { display: block; height: 100%; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); margin-top: 8px; }

.dumbbell { display: flex; flex-direction: column; gap: 14px; }
.db-row { display: grid; grid-template-columns: minmax(120px, 210px) minmax(0, 1fr) 150px; gap: 12px; align-items: center; }
.db-label { font-size: .88rem; font-weight: 600; }
.db-track { position: relative; height: 22px; }
.db-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--line-2); }
.db-line { position: absolute; top: 50%; height: 4px; margin-top: -1px; background: var(--blue-200); }
.db-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -6px 0 0 -7px; border-radius: 50%; border: 2px solid var(--card); }
.db-dot.a { background: var(--blue); }
.db-dot.b { background: var(--red); }
.db-val { font-size: .82rem; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .db-row { grid-template-columns: minmax(0, 1fr) auto; } .db-track { grid-column: 1 / -1; grid-row: 2; } }

.heat { border-collapse: separate; border-spacing: 3px; font-size: .78rem; }
.heat th { font-weight: 650; color: var(--ink-2); text-align: left; padding: 4px 6px; white-space: nowrap; }
.heat thead th { font-size: .72rem; color: var(--muted); vertical-align: bottom; height: 150px; }
.heat thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 148px; overflow: hidden; text-overflow: ellipsis; }
.heat td { text-align: center; border-radius: 6px; padding: 7px 2px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 48px; }
.heat td.empty { background: var(--line-2); color: var(--muted); font-weight: 400; }
.heat-wrap { overflow-x: auto; }
.scale { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); margin-top: 8px; }
.scale i { display: block; height: 10px; width: 160px; border-radius: 999px; }

.tilemap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-width: 540px; }
.tilemap a, .tilemap-drom a { display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 1.15; border-radius: 10px; padding: 8px; text-decoration: none; color: #161616; font-size: .7rem; font-weight: 700; line-height: 1.15; transition: transform .1s; min-width: 0; overflow: hidden; }
.tilemap a:hover, .tilemap-drom a:hover { transform: scale(1.04); }
.tilemap a strong, .tilemap-drom a strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.tilemap a.dark, .tilemap-drom a.dark { color: #fff; }
.tilemap-drom { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 10px; max-width: 540px; }
.tilemap-drom a { aspect-ratio: 1.6; }
@media (max-width: 480px) { .tilemap a { font-size: .6rem; padding: 5px; } .tilemap a strong { font-size: .82rem; } }

/* tableau léger (rare) */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.tbl th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }

/* liste de formations (cartes) */
.flist { display: flex; flex-direction: column; gap: 12px; }
.fcard { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.fcard:hover { border-color: var(--blue-200); }
.fcard h3 { margin: 4px 0 2px; font-size: 1rem; }
.fcard h3 a { color: var(--ink); text-decoration: none; }
.fcard h3 a:hover { color: var(--blue); text-decoration: underline; }
.fcard .meta { font-size: .84rem; margin: 0; }
.fmetrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fm-label { font-size: .68rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.fm-value { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.fm-value .na { font-size: .78rem; font-weight: 500; }
.meter { height: 5px; border-radius: 999px; background: var(--line-2); margin-top: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
@media (max-width: 900px) { .fcard { grid-template-columns: minmax(0, 1fr); } }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 20px 0; }
.pager a, .pager span { min-width: 38px; text-align: center; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 600; font-size: .9rem; }
.pager span[aria-current] { background: var(--blue); color: #fff; border-color: var(--blue); }
.pager .gap { border: 0; background: none; }

/* fiche */
.fhero { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px 24px 24px 30px; box-shadow: var(--shadow); margin-bottom: 18px; position: relative; overflow: hidden; }
.fhero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(#000091 33.3%, #fff 33.3% 66.6%, #e1000f 66.6%); }
.fhero h1 { font-size: clamp(1.45rem, 2.6vw, 2.1rem); }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
@media (max-width: 1023px) { .toc { top: 57px; } }
.jobs { columns: 2 220px; column-gap: 24px; margin: 0; padding: 0; list-style: none; }
.jobs li { break-inside: avoid; padding: 5px 0 5px 18px; position: relative; font-size: .92rem; }
.jobs li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.occ { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.occ h4 { margin: 0 0 4px; font-size: .95rem; }
.occ p { margin: 0; }

/* autocomplétion et infobulles */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70; list-style: none; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,18,.16); max-height: 360px; overflow-y: auto; text-align: left; }
.suggest a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.suggest li[aria-selected="true"] a, .suggest a:hover { background: var(--blue-50); }
.suggest .k { display: inline-block; font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); margin-right: 8px; }
.suggest .d { display: block; font-size: .76rem; color: var(--muted); }
.tooltip { position: fixed; z-index: 90; max-width: 320px; background: #161616; color: #fff; font-size: .8rem; padding: 7px 10px; border-radius: 8px; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.25); }

@media print { .side, .topbar, .toc, .hero-search { display: none !important; } .app { display: block; } .card, .kpi { box-shadow: none; } }
