/* ==========================================================================
   ANADO Nutrition — design system
   Style : « Accessible & Ethical » (secteur public / santé)
   Typo : Atkinson Hyperlegible · Contraste AA · Mode sombre · Mouvement réduit
   ========================================================================== */

:root {
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f0f3f1;
  --surface-3: #e6ebe8;
  --border: #dde3e0;
  --border-strong: #c3ccc8;
  --text: #0f1a17;
  --text-2: #3f4d48;
  --text-3: #5f6d68;

  /* Couleurs PNIN (logo et bannière) */
  --brand-blue: #0083b0; --brand-teal: #2cb290; --brand-turquoise: #25b7b7; --brand-green: #89c589;
  --brand-lime: #a3c955; --brand-pale: #b6d378; --brand-yellow: #dddf4b; --brand-gray: #575555; --brand-paper: #eeeeed;

  --primary: #00739c;
  --primary-hover: #005e80;
  --primary-soft: #e1f1f7;
  --primary-ink: #00557a;
  --on-primary: #ffffff;
  --accent: #137d64;
  --accent-soft: #e2f4ee;

  --info: #1d5fa8;     --info-soft: #e5effa;
  --success: #12704a;  --success-soft: #e3f4ea;
  --warning: #965606;  --warning-soft: #fdf2dc;
  --danger: #b42318;   --danger-soft: #fdecea;
  --neutral: #4f5b57;  --neutral-soft: #eceff0;

  --hero: #062f43;
  --hero-2: #0b4d5e;
  --on-hero: #f2f8fa;
  --on-hero-2: #bcd8e0;

  --ring: #1a73e8;
  --shadow-sm: 0 1px 2px rgba(15, 26, 23, .06);
  --shadow: 0 1px 3px rgba(15, 26, 23, .07), 0 6px 16px -6px rgba(15, 26, 23, .10);
  --shadow-lg: 0 10px 40px -10px rgba(15, 26, 23, .28);

  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 22px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --container: 1240px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1418; --surface: #101d22; --surface-2: #15262c; --surface-3: #1c3138;
    --border: #21363d; --border-strong: #2e4a53;
    --text: #e8efec; --text-2: #b6c5bf; --text-3: #92a49d;
    --primary: #4cc3e6; --primary-hover: #7ad3ef; --primary-soft: #0d3242; --primary-ink: #9fdcf0; --on-primary: #03202b;
    --accent: #4fd1ae; --accent-soft: #0e3329;
    --info: #79b0f0; --info-soft: #14263a; --success: #5fd39b; --success-soft: #0f2a1e;
    --warning: #f0b453; --warning-soft: #2e230e; --danger: #f88b80; --danger-soft: #3a1714;
    --neutral: #a9b8b2; --neutral-soft: #1c2a26;
    --hero: #041f2c; --hero-2: #073a48;
    --ring: #8ab4f8;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1418; --surface: #101d22; --surface-2: #15262c; --surface-3: #1c3138;
  --border: #21363d; --border-strong: #2e4a53;
  --text: #e8efec; --text-2: #b6c5bf; --text-3: #92a49d;
  --primary: #4cc3e6; --primary-hover: #7ad3ef; --primary-soft: #0d3242; --primary-ink: #9fdcf0; --on-primary: #03202b;
  --accent: #4fd1ae; --accent-soft: #0e3329;
  --info: #79b0f0; --info-soft: #14263a; --success: #5fd39b; --success-soft: #0f2a1e;
  --warning: #f0b453; --warning-soft: #2e230e; --danger: #f88b80; --danger-soft: #3a1714;
  --neutral: #a9b8b2; --neutral-soft: #1c2a26;
  --hero: #041f2c; --hero-2: #073a48;
  --ring: #8ab4f8;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* --------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--s-3); letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 var(--s-3); }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-5) 0; }
.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }

.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: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: var(--r); font-weight: 700; }
.skip-link:focus { top: 12px; color: var(--on-primary); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-4); }
@media (min-width: 768px) { .container { padding: 0 var(--s-5); } }

.muted { color: var(--text-3); }
.small { font-size: .875rem; }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.grow { flex: 1; }

/* --------------------------------------------------------------- Boutons */
.btn {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg); font: inherit; font-weight: 700; font-size: .95rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s;
}
.btn:hover { color: var(--b-fg); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { --b-bg: var(--primary); --b-fg: var(--on-primary); --b-bd: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { --b-bg: var(--primary-soft); --b-fg: var(--primary-ink); --b-bd: transparent; }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%); color: var(--primary-ink); }
.btn-danger { --b-bg: var(--danger); --b-fg: #fff; --b-bd: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .875rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1.05rem; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------- Badges / chips */
.badge {
  --t: var(--neutral); --t-soft: var(--neutral-soft);
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; line-height: 1.4; background: var(--t-soft); color: var(--t); white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.tone-primary { --t: var(--primary-ink); --t-soft: var(--primary-soft); }
.tone-success { --t: var(--success); --t-soft: var(--success-soft); }
.tone-info { --t: var(--info); --t-soft: var(--info-soft); }
.tone-warning { --t: var(--warning); --t-soft: var(--warning-soft); }
.tone-danger { --t: var(--danger); --t-soft: var(--danger-soft); }
.tone-accent { --t: var(--accent); --t-soft: var(--accent-soft); }
.tone-neutral { --t: var(--neutral); --t-soft: var(--neutral-soft); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: .875rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary-ink); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip .icon { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* --------------------------------------------------------------- Header */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: var(--s-4); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-logo { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.05rem; }
.brand-text strong b { color: var(--brand-blue); }
.brand-text span { font-size: .72rem; color: var(--text-3); font-weight: 400; }
.main-nav { display: none; gap: 2px; margin-left: var(--s-3); }
.main-nav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-weight: 700; font-size: .95rem;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--primary-ink); background: var(--primary-soft); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.search-trigger {
  display: none; align-items: center; gap: 10px; min-height: 40px; min-width: 240px; padding: 0 10px 0 12px;
  border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-3);
  font: inherit; font-size: .9rem; cursor: pointer;
}
.search-trigger:hover { border-color: var(--primary); }
.search-trigger kbd, .kbd {
  margin-left: auto; font-family: var(--font); font-size: .72rem; font-weight: 700; padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-3);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-ink); flex-shrink: 0;
}
@media (min-width: 1024px) {
  .main-nav { display: flex; }
  .search-trigger { display: flex; }
  .menu-toggle, #mobile-search-btn { display: none !important; }
}
@media (max-width: 559px) {
  .site-header .container { gap: var(--s-2); }
  .header-actions { gap: 2px; }
  .header-actions .btn-primary { width: 40px; padding: 0; }
  .header-actions .btn-primary span { display: none; }
}
@media (max-width: 379px) {
  .brand-text span { display: none; }
}
.mobile-nav { display: none; }
.mobile-nav.is-open {
  display: block; position: fixed; inset: var(--header-h) 0 0 0; z-index: 39; background: var(--surface);
  padding: var(--s-4); overflow-y: auto; animation: fadeIn .15s var(--ease);
}
.mobile-nav a { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-radius: var(--r); color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.mobile-nav a:hover, .mobile-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); }

/* Menu utilisateur */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50;
}
.dropdown.is-open .dropdown-menu { display: block; animation: pop .15s var(--ease); }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 0;
  background: none; color: var(--text); font: inherit; font-size: .95rem; text-decoration: none; cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head strong { display: block; }

/* --------------------------------------------------------------- Hero (accueil) */
.hero {
  position: relative; overflow: hidden; color: var(--on-hero);
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(44, 178, 144, .32), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(221, 223, 75, .16), transparent 60%),
    linear-gradient(160deg, var(--hero) 0%, var(--hero-2) 100%);
  padding: var(--s-8) 0 calc(var(--s-8) + 24px);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.hero .container { position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; color: var(--on-hero-2);
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); margin-bottom: var(--s-4); }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); max-width: 18ch; margin-bottom: var(--s-4); color: #fff; }
.hero h1 em { font-style: normal; color: #c8e06a; }
.hero-lead { font-size: 1.15rem; color: var(--on-hero-2); max-width: 60ch; margin-bottom: var(--s-6); }
.hero-search { position: relative; max-width: 720px; }
.hero-search .search-field { height: 64px; font-size: 1.1rem; padding-left: 56px; padding-right: 140px; border-radius: var(--r-lg);
  border: 2px solid transparent; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); }
.hero-search .search-field:focus { border-color: var(--brand-yellow); outline: none; }
.hero-search > .icon { position: absolute; left: 20px; top: 21px; width: 22px; height: 22px; color: var(--text-3); pointer-events: none; }
.hero-search .btn { position: absolute; right: 8px; top: 8px; height: 48px; }
.hero-hints { margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; color: var(--on-hero-2); font-size: .9rem; }
.hero-hints a { color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); padding: 4px 12px;
  border-radius: 999px; text-decoration: none; font-weight: 700; }
.hero-hints a:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.stats-band { margin-top: calc(-1 * var(--s-7)); position: relative; z-index: 2; }
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden;
}
.stat { padding: var(--s-5); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-value { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-3); font-size: .9rem; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
@media (min-width: 900px) {
  .stats { grid-template-columns: repeat(5, 1fr); }
  .stat { border-bottom: 0; }
  .stat:last-child { border-right: 0; }
}

/* --------------------------------------------------------------- Sections */
.section { padding: var(--s-7) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--text-3); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* --------------------------------------------------------------- Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-pad { padding: var(--s-5); }
.card-head { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card-body { padding: var(--s-5); }

.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Carte d'étude */
.study-card {
  position: relative; display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.study-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow); transform: translateY(-2px); }
.study-card:focus-within { border-color: var(--primary); }
.study-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.study-year { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.study-card h3 { font-size: 1.08rem; margin: 0; }
.study-card h3 a { color: var(--text); text-decoration: none; }
.study-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.study-card h3 a:hover { color: var(--primary); }
.study-card .producer { color: var(--text-3); font-size: .9rem; display: flex; gap: 6px; align-items: flex-start; }
.study-card .abstract { color: var(--text-2); font-size: .93rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.study-meta { margin-top: auto; padding-top: var(--s-3); border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: var(--s-4);
  font-size: .85rem; color: var(--text-3); }
.study-meta span { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.var-hit { position: relative; z-index: 1; font-size: .85rem; background: var(--accent-soft); color: var(--accent); border-radius: var(--r-sm); padding: 6px 10px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; align-self: flex-start; }
.var-hit:hover { color: var(--accent); text-decoration: underline; }

/* Liste (vue compacte) */
.study-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.study-row { position: relative; display: grid; grid-template-columns: 1fr; gap: 6px; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.study-row:last-child { border-bottom: 0; }
.study-row:hover { background: var(--surface-2); }
.study-row h3 { font-size: 1rem; margin: 0; }
.study-row h3 a { color: var(--text); text-decoration: none; }
.study-row h3 a::after { content: ""; position: absolute; inset: 0; }
.study-row .row-meta { display: flex; flex-wrap: wrap; gap: var(--s-3); font-size: .85rem; color: var(--text-3); }
@media (min-width: 900px) { .study-row { grid-template-columns: 90px 1fr auto; align-items: center; gap: var(--s-4); } }

/* --------------------------------------------------------------- Frise chronologique */
.timeline { position: relative; display: flex; gap: var(--s-3); overflow-x: auto; padding: var(--s-2) 2px var(--s-4); scroll-snap-type: x mandatory; }
.timeline::-webkit-scrollbar { height: 8px; }
.timeline::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.tl-year { scroll-snap-align: start; min-width: 210px; flex: 0 0 auto; display: flex; flex-direction: column; gap: var(--s-2); }
.tl-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.tl-label::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--primary), transparent); border-radius: 2px; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.tl-item { display: block; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); text-decoration: none;
  color: var(--text); font-size: .88rem; line-height: 1.35; font-weight: 700; }
.tl-item:hover { border-color: var(--primary); color: var(--primary-ink); }
.tl-item small { display: block; font-weight: 400; color: var(--text-3); margin-top: 2px; }

/* --------------------------------------------------------------- Parcours d'accès (accueil) */
.access-steps { counter-reset: step; display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 900px) { .access-steps { grid-template-columns: repeat(3, 1fr); } }
.access-step { padding: var(--s-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); position: relative; }
.access-step::before { counter-increment: step; content: counter(step); position: absolute; top: var(--s-5); right: var(--s-5); font-size: 2.6rem; font-weight: 700; color: var(--surface-3); line-height: 1; }
.access-step .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); margin-bottom: var(--s-3); }

/* --------------------------------------------------------------- Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: var(--s-4); }
.label { font-weight: 700; font-size: .93rem; color: var(--text); }
.label .req { color: var(--danger); }
.hint { font-size: .85rem; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6d68' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .875rem; font-weight: 700; display: flex; gap: 6px; align-items: flex-start; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.input-icon .reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.form-grid .field + .field { margin-top: 0; }
.search-field { width: 100%; height: 48px; padding: 0 16px 0 46px; border-radius: var(--r); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; }
.search-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }

/* --------------------------------------------------------------- Alertes / toasts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: var(--s-4); border-radius: var(--r); background: var(--t-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--t) 30%, transparent); --t: var(--info); --t-soft: var(--info-soft); }
.alert > .icon { color: var(--t); margin-top: 2px; }
.alert strong { display: block; margin-bottom: 2px; }
.alert p:last-child { margin-bottom: 0; }
.alert.tone-success { --t: var(--success); --t-soft: var(--success-soft); }
.alert.tone-warning { --t: var(--warning); --t-soft: var(--warning-soft); }
.alert.tone-danger { --t: var(--danger); --t-soft: var(--danger-soft); }
.alert.tone-neutral { --t: var(--neutral); --t-soft: var(--neutral-soft); }

.toasts { position: fixed; z-index: 90; right: 16px; bottom: 16px; left: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; max-width: 440px; width: 100%;
  padding: 14px 14px 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: toastIn .3s var(--ease); --t: var(--info);
  border-left: 4px solid var(--t);
}
.toast.tone-success { --t: var(--success); } .toast.tone-danger { --t: var(--danger); } .toast.tone-warning { --t: var(--warning); }
.toast > .icon { color: var(--t); margin-top: 2px; }
.toast p { margin: 0; flex: 1; font-size: .95rem; word-break: break-word; }
.toast.is-leaving { animation: toastOut .2s var(--ease) forwards; }

/* --------------------------------------------------------------- Catalogue */
.page-head { padding: var(--s-6) 0 var(--s-5); background: var(--surface); border-bottom: 1px solid var(--border); }
.page-head h1 { margin-bottom: 6px; }
.page-head p { color: var(--text-3); margin: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .875rem; color: var(--text-3); margin-bottom: var(--s-3); }
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb .icon { width: 14px; height: 14px; }

.catalog-search { position: relative; margin-top: var(--s-4); max-width: 820px; }
.catalog-search > .icon { position: absolute; left: 16px; top: 15px; color: var(--text-3); pointer-events: none; }
.catalog-search .search-field { height: 52px; padding-right: 110px; font-size: 1.05rem; }
.catalog-search .btn { position: absolute; right: 6px; top: 6px; min-height: 40px; }

.catalog-layout { display: grid; grid-template-columns: 1fr; gap: var(--s-5); padding: var(--s-5) 0 var(--s-7); }
@media (min-width: 1024px) { .catalog-layout { grid-template-columns: 290px 1fr; gap: var(--s-6); } }
.filters { display: none; }
.filters.is-open {
  display: block; position: fixed; inset: 0; z-index: 60; background: var(--surface); overflow-y: auto; padding: var(--s-4);
  animation: slideUp .25s var(--ease);
}
.filters-mobile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
.filters-mobile-foot { position: sticky; bottom: calc(-1 * var(--s-4)); background: var(--surface); padding: var(--s-3) 0; border-top: 1px solid var(--border); margin-top: var(--s-4); }
@media (min-width: 1024px) {
  .filters { display: block; position: sticky; top: calc(var(--header-h) + 16px); align-self: start; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; padding-right: 4px; }
  .filters-mobile-head, .filters-mobile-foot, .filters-open-btn { display: none !important; }
}
.facet { border-bottom: 1px solid var(--border); padding: var(--s-4) 0; }
.facet:first-of-type { padding-top: 0; }
.facet summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 700; padding: 4px 0; }
.facet summary::-webkit-details-marker { display: none; }
.facet summary .icon { transition: transform .2s var(--ease); color: var(--text-3); }
.facet[open] summary .icon { transform: rotate(180deg); }
.facet-body { margin-top: var(--s-3); display: flex; flex-direction: column; gap: 2px; }
.facet-option { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: .93rem; color: var(--text-2); min-height: 40px; }
.facet-option:hover { background: var(--surface-2); color: var(--text); }
.facet-option input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.facet-option .count { margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--text-3); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.facet-option.is-zero { opacity: .5; }
.facet-more { margin-top: 6px; }

/* Histogramme des années */
.year-hist { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin: var(--s-2) 0 var(--s-2); }
.year-hist span { flex: 1; background: var(--surface-3); border-radius: 3px 3px 0 0; min-height: 3px; transition: background .2s; }
.year-hist span.in { background: var(--primary); }
.year-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.year-range .select { min-height: 40px; padding: 6px 32px 6px 10px; font-size: .9rem; background-position: right 8px center; }

.results-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.results-count { font-weight: 700; }
.results-count span { color: var(--text-3); font-weight: 400; }
.results-tools { display: flex; gap: var(--s-2); align-items: center; }
.results-tools .select { min-height: 40px; width: auto; font-size: .9rem; }
.segmented { display: inline-flex; padding: 3px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.segmented a, .segmented button { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 34px; padding: 0 10px; border-radius: 7px; color: var(--text-3); text-decoration: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 700; gap: 6px; }
.segmented a[aria-current="true"], .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.active-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); align-items: center; }
.active-filters .chip { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.active-filters .chip:hover { text-decoration: line-through; }
.results { transition: opacity .2s var(--ease); }
.results.is-loading { opacity: .45; pointer-events: none; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: var(--s-6); flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px;
  border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination [aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pagination .gap { border: 0; background: none; min-width: 20px; }

.empty { text-align: center; padding: var(--s-8) var(--s-5); border: 2px dashed var(--border); border-radius: var(--r-xl); background: var(--surface); }
.empty .ic { width: 64px; height: 64px; margin: 0 auto var(--s-4); border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty .ic .icon { width: 28px; height: 28px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--text-3); max-width: 46ch; margin: 0 auto var(--s-4); }

/* --------------------------------------------------------------- Fiche d'étude */
.study-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--s-5) 0 0; }
.study-hero h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); max-width: 30ch; margin-bottom: var(--s-3); }
.study-hero .subtitle { color: var(--text-3); margin-bottom: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: .95rem; }
.study-hero .subtitle span { display: inline-flex; gap: 6px; align-items: center; }
.study-hero-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; padding-bottom: var(--s-5); }
@media (min-width: 1024px) { .study-hero-grid { grid-template-columns: 1fr 320px; align-items: start; } }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.fact { background: var(--surface); padding: var(--s-3) var(--s-4); }
.fact dt { font-size: .78rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.fact dd { margin: 2px 0 0; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }

.cta-card { padding: var(--s-5); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); }
.cta-card .access-label { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-2); }
.cta-card .access-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--t-soft); color: var(--t); }
.cta-card p { font-size: .9rem; color: var(--text-2); }
.cta-card .btn + .btn { margin-top: var(--s-2); }

.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: var(--s-2); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 14px 16px; color: var(--text-3); text-decoration: none; font-weight: 700;
  border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--primary-ink); border-bottom-color: var(--primary); }
.tabs .count { font-size: .75rem; background: var(--surface-2); padding: 1px 8px; border-radius: 999px; color: var(--text-3); }

.study-body { display: grid; grid-template-columns: 1fr; gap: var(--s-6); padding: var(--s-6) 0 var(--s-7); }
@media (min-width: 1024px) { .study-body { grid-template-columns: 1fr 300px; } .study-body.wide { grid-template-columns: 1fr; } }
.toc { display: none; }
@media (min-width: 1024px) {
  .toc { display: block; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
}
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: var(--s-2); }
.toc a { display: block; padding: 6px 12px; border-left: 2px solid var(--border); color: var(--text-2); text-decoration: none; font-size: .93rem; }
.toc a:hover, .toc a.is-active { color: var(--primary-ink); border-left-color: var(--primary); background: var(--primary-soft); }

.prose { max-width: 75ch; color: var(--text-2); }
.prose p { margin-bottom: var(--s-3); }
.meta-section { scroll-margin-top: calc(var(--header-h) + 24px); }
.meta-section + .meta-section { margin-top: var(--s-7); }
.meta-section > h2 { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; padding-bottom: var(--s-3); border-bottom: 1px solid var(--border); margin-bottom: var(--s-4); }
.meta-section > h2 .icon { color: var(--primary); }
.dl { display: grid; grid-template-columns: 1fr; gap: 0; }
.dl > div { padding: var(--s-3) 0; border-bottom: 1px solid var(--border); display: grid; gap: 4px; }
.dl > div:last-child { border-bottom: 0; }
@media (min-width: 720px) { .dl > div { grid-template-columns: 220px 1fr; gap: var(--s-4); } }
.dl dt { font-weight: 700; color: var(--text); font-size: .93rem; }
.dl dd { margin: 0; color: var(--text-2); }
.dl dd p:last-child { margin-bottom: 0; }
.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; gap: 10px; align-items: flex-start; }
.person .avatar { width: 32px; height: 32px; font-size: .72rem; }
.person small { display: block; color: var(--text-3); }
.readmore { position: relative; }
.readmore.is-clamped .readmore-body { max-height: 9.6em; overflow: hidden; mask-image: linear-gradient(180deg, #000 60%, transparent); }

.citation-box { position: relative; padding: var(--s-4); padding-right: 56px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); font-size: .93rem; color: var(--text-2); }
.citation-box .btn { position: absolute; top: 8px; right: 8px; }

.side-card { padding: var(--s-4); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); }
.side-card + .side-card { margin-top: var(--s-4); }
.side-card h3 { font-size: .95rem; margin-bottom: var(--s-3); display: flex; align-items: center; gap: 8px; }
.side-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.side-list a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-sm); text-decoration: none; color: var(--text); font-size: .9rem; }
.side-list a:hover { background: var(--surface-2); color: var(--primary-ink); }

/* Dictionnaire */
.dict-layout { display: grid; grid-template-columns: 1fr; gap: var(--s-5); padding: var(--s-5) 0 var(--s-7); }
@media (min-width: 1024px) { .dict-layout { grid-template-columns: 280px 1fr; } }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; color: var(--text); }
.file-item:hover { border-color: var(--primary); }
.file-item[aria-current="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.file-item strong { font-size: .93rem; word-break: break-word; display: flex; gap: 8px; align-items: flex-start; }
.file-item small { color: var(--text-3); font-variant-numeric: tabular-nums; }
@media (max-width: 1023px) { .file-list { flex-direction: row; overflow-x: auto; padding-bottom: 6px; } .file-item { min-width: 220px; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); background: var(--surface-2); font-weight: 700; position: sticky; top: 0; z-index: 1; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-clickable { cursor: pointer; }
.var-name { font-family: var(--font-mono); font-weight: 700; color: var(--primary-ink); font-size: .88rem; word-break: break-all; }
a.var-name { text-decoration: none; }
a.var-name:hover { text-decoration: underline; }
.var-q { color: var(--text-3); font-size: .85rem; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.compare-toggle { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.compare-toggle:hover { border-color: var(--primary); color: var(--primary); }
.compare-toggle[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* Détail variable */
.var-detail h2 { font-family: var(--font-mono); font-size: 1.25rem; word-break: break-all; margin-bottom: 4px; }
.var-detail .var-label { font-size: 1.05rem; color: var(--text-2); margin-bottom: var(--s-4); }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin: 0 0 var(--s-5); }
@media (min-width: 640px) { .kv { grid-template-columns: repeat(4, 1fr); } }
.kv > div { padding: 10px 12px; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.kv dt { font-size: .75rem; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kv dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-word; }
.freq { width: 100%; border-collapse: collapse; font-size: .9rem; }
.freq td, .freq th { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.freq th { font-size: .75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.freq .val { font-family: var(--font-mono); color: var(--text-3); width: 1%; white-space: nowrap; }
.freq .bar-cell { width: 40%; }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; min-width: 2px; }
.freq .pct { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--text-2); font-weight: 700; }
.question { padding: var(--s-4); border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r) var(--r) 0; margin-bottom: var(--s-5); color: var(--text); }
.question small { display: block; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; margin-bottom: 4px; }

/* Tiroir latéral (dialog) */
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; max-height: 100%; width: min(720px, 100%); max-width: 100%; padding: 0; border: 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.drawer[open] { animation: drawerIn .28s var(--ease); }
.drawer::backdrop { background: rgba(5, 15, 12, .5); backdrop-filter: blur(2px); }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-5); background: var(--surface); border-bottom: 1px solid var(--border); }
.drawer-body { padding: var(--s-5); }

.modal { border: 0; padding: 0; border-radius: var(--r-xl); width: min(520px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal[open] { animation: pop .2s var(--ease); }
.modal::backdrop { background: rgba(5, 15, 12, .5); }
.modal-body { padding: var(--s-5); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); background: var(--surface-2); }

/* Documentation */
.doc-group + .doc-group { margin-top: var(--s-6); }
.doc-group h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-3); }
.doc-group h2 .count { font-size: .8rem; color: var(--text-3); font-weight: 700; background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.doc-list { display: grid; gap: var(--s-2); }
.doc-item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
.doc-item:hover { border-color: var(--border-strong); }
.file-badge { width: 44px; height: 52px; border-radius: 8px; display: grid; place-items: center; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); position: relative; }
.file-badge.pdf { background: #fdecea; color: #b42318; border-color: #f6cfcb; }
.file-badge.dta, .file-badge.sav, .file-badge.zip, .file-badge.csv, .file-badge.xlsx, .file-badge.xls { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.file-badge.doc, .file-badge.docx { background: var(--info-soft); color: var(--info); border-color: transparent; }
:root[data-theme="dark"] .file-badge.pdf { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .file-badge.pdf { background: var(--danger-soft); color: var(--danger); border-color: transparent; } }
.doc-item h3 { font-size: .98rem; margin: 0; }
.doc-item small { color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.doc-actions { display: flex; gap: 6px; }
@media (max-width: 640px) { .doc-item { grid-template-columns: auto 1fr; } .doc-actions { grid-column: 1 / -1; } .doc-actions .btn { flex: 1; } }

/* Accès : étapes */
.steps { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: var(--s-3); position: relative; padding-bottom: var(--s-5); }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--border); }
.steps li.is-done:not(:last-child)::before { background: var(--primary); }
.step-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--border-strong); background: var(--surface); color: var(--text-3); }
.steps li.is-done .step-dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.steps li.is-current .step-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.steps h3 { margin: 8px 0 4px; font-size: 1rem; }
.steps p { color: var(--text-3); margin: 0; font-size: .93rem; }
.terms-box { max-height: 280px; overflow-y: auto; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); font-size: .9rem; color: var(--text-2); margin-bottom: var(--s-4); }

/* Comparaison */
.compare-bar { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 150%); z-index: 70; display: flex; align-items: center; gap: var(--s-3);
  padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); transition: transform .3s var(--ease), visibility .3s; max-width: calc(100% - 32px); visibility: hidden; }
.compare-bar.is-visible { transform: translate(-50%, 0); visibility: visible; }
.compare-bar strong { white-space: nowrap; }
.compare-bar .btn-primary { --b-bg: var(--primary); }
.compare-bar .btn-ghost { color: var(--bg); }
.compare-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Palette de recherche (Ctrl+K) */
.palette { border: 0; padding: 0; margin: 10vh auto auto; width: min(680px, calc(100% - 24px)); border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.palette[open] { animation: pop .18s var(--ease); }
.palette::backdrop { background: rgba(5, 15, 12, .55); backdrop-filter: blur(3px); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 var(--s-4); border-bottom: 1px solid var(--border); }
.palette-input .icon { color: var(--text-3); width: 22px; height: 22px; }
.palette-input input { flex: 1; height: 60px; border: 0; background: none; font: inherit; font-size: 1.1rem; color: var(--text); outline: none; }
.palette-results { max-height: 60vh; overflow-y: auto; padding: var(--s-2); }
.palette-group { padding: 10px 12px 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--text); }
.palette-item .pi-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); flex-shrink: 0; }
.palette-item[aria-selected="true"], .palette-item:hover { background: var(--primary-soft); color: var(--primary-ink); }
.palette-item[aria-selected="true"] .pi-ic { background: var(--primary); color: var(--on-primary); }
.palette-item .pi-text { min-width: 0; flex: 1; }
.palette-item .pi-text strong, .palette-item .pi-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .pi-text small { color: var(--text-3); font-size: .82rem; }
.palette-foot { display: flex; gap: var(--s-4); padding: 10px var(--s-4); border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-3); background: var(--surface-2); }
.palette-empty { padding: var(--s-6) var(--s-4); text-align: center; color: var(--text-3); }

/* --------------------------------------------------------------- Auth */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .auth-shell { grid-template-columns: 1.05fr 1fr; } }
.auth-aside { display: none; position: relative; overflow: hidden; color: var(--on-hero); padding: var(--s-7);
  background: radial-gradient(700px 400px at 100% 0, rgba(44, 178, 144, .32), transparent 60%), radial-gradient(600px 400px at 0 100%, rgba(221, 223, 75, .18), transparent 60%), linear-gradient(160deg, var(--hero), var(--hero-2)); }
@media (min-width: 1024px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside h2 { font-size: 2.2rem; color: #fff; max-width: 16ch; }
.auth-aside p { color: var(--on-hero-2); max-width: 46ch; font-size: 1.05rem; }
.auth-aside .brand { color: #fff; }
.auth-aside .brand-text span { color: var(--on-hero-2); }
.auth-points { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-3); }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: var(--on-hero); }
.auth-points .icon { color: var(--brand-yellow); margin-top: 3px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: var(--s-6) var(--s-4); }
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-card h1 { font-size: 1.9rem; margin-bottom: 6px; }
.auth-card > p { color: var(--text-3); margin-bottom: var(--s-5); }
.auth-alt { text-align: center; margin-top: var(--s-5); color: var(--text-3); }
.pw-meter { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .25s var(--ease), background .25s; background: var(--danger); }

/* --------------------------------------------------------------- Footer */
.site-footer { margin-top: var(--s-7); background: var(--surface); border-top: 1px solid var(--border); padding: var(--s-6) 0 var(--s-5); font-size: .93rem; color: var(--text-3); }
.footer-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin-bottom: var(--s-3); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.footer-bottom { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }

/* --------------------------------------------------------------- Admin */
.admin-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 1024px) { .admin-shell { grid-template-columns: 260px 1fr; } }
.admin-side { background: var(--hero); color: var(--on-hero); padding: var(--s-4); display: none; flex-direction: column; gap: var(--s-4); }
.admin-side.is-open { display: flex; position: fixed; inset: 0; z-index: 60; overflow-y: auto; }
@media (min-width: 1024px) { .admin-side { display: flex; position: sticky; top: 0; height: 100vh; } .admin-side .close-side { display: none; } }
.admin-side .brand { color: #fff; padding: 8px; }
.admin-side .brand-text span { color: var(--on-hero-2); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--on-hero-2); padding: 14px 12px 6px; font-weight: 700; opacity: .8; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); color: var(--on-hero-2); text-decoration: none; font-weight: 700; font-size: .95rem; }
.admin-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-nav a[aria-current="page"] { background: rgba(37, 183, 183, .16); color: #fff; box-shadow: inset 3px 0 0 var(--brand-teal); }
.admin-nav .pill { margin-left: auto; background: var(--accent); color: #fff; font-size: .72rem; padding: 1px 8px; border-radius: 999px; }
.admin-side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: var(--s-3); }
.admin-side-foot a { color: var(--on-hero-2); }
.admin-main { min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s-3); height: var(--header-h); padding: 0 var(--s-5);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
@media (min-width: 1024px) { .admin-top .menu-toggle { display: none; } }
.admin-content { padding: var(--s-5); max-width: 1400px; }
@media (min-width: 1024px) { .admin-content { padding: var(--s-6); } }
.admin-title { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.admin-title h1 { font-size: 1.7rem; margin: 0; }
.admin-title p { margin: 4px 0 0; color: var(--text-3); }

.kpis { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, 1fr); margin-bottom: var(--s-5); }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: var(--s-4) var(--s-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-size: .88rem; font-weight: 700; }
.kpi-top .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--t-soft, var(--primary-soft)); color: var(--t, var(--primary-ink)); }
.kpi-value { font-size: 1.9rem; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-sub { font-size: .85rem; color: var(--text-3); margin-top: 4px; }

.chart { width: 100%; height: 240px; }
.chart .bar-rect { fill: var(--primary); transition: fill .15s; }
.chart .bar-rect:hover { fill: var(--accent); }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .val { fill: var(--text-2); font-size: 11px; font-weight: 700; font-family: var(--font); }

.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 2px; }

.dropzone { display: grid; place-items: center; text-align: center; gap: 6px; padding: var(--s-6) var(--s-4); border: 2px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .icon { width: 32px; height: 32px; color: var(--primary); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .file-chosen { font-weight: 700; color: var(--primary-ink); }

.toolbar { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s-4); }
.toolbar .input-icon { flex: 1; min-width: 220px; max-width: 420px; }
.toolbar .input { min-height: 42px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--t); margin-right: 6px; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }
.rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .8rem; font-weight: 700; color: var(--text-3); flex-shrink: 0; }
.meter { flex: 1; height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }

/* --------------------------------------------------------------- Squelettes / animations */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateX(24px); opacity: 0; } }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- Impression */
@media print {
  .site-header, .site-footer, .tabs, .toc, .cta-card, .compare-bar, .toasts, .btn, .filters, .admin-side, .admin-top { display: none !important; }
  body { background: #fff; color: #000; }
  .study-body { grid-template-columns: 1fr; }
  a { color: #000; }
}

/* ==========================================================================
   Identité PNIN : bande de couleurs, bannière institutionnelle, motif de barres
   ========================================================================== */
.brand-stripe {
  height: 4px;
  background: linear-gradient(90deg,
    var(--brand-gray) 0 12.5%, var(--brand-yellow) 12.5% 25%, var(--brand-pale) 25% 37.5%, var(--brand-green) 37.5% 50%,
    var(--brand-lime) 50% 62.5%, var(--brand-teal) 62.5% 75%, var(--brand-turquoise) 75% 87.5%, var(--brand-blue) 87.5% 100%);
}
.site-header .brand-stripe { position: absolute; left: 0; right: 0; top: 0; }
.site-header { border-top: 0; }

.inst-banner { background: var(--brand-paper); border-bottom: 1px solid var(--border); }
.inst-banner img { display: block; width: 100%; max-width: 1170px; height: auto; margin: 0 auto; aspect-ratio: 1170 / 197; }
.inst-banner-compact { display: none; align-items: center; gap: 14px; padding: 14px 0; color: #1f2a2e; }
.inst-banner-compact img { width: 56px; height: 56px; aspect-ratio: 1; margin: 0; }
.inst-banner-compact strong { display: block; color: var(--brand-blue); font-size: 1.25rem; letter-spacing: .02em; }
.inst-banner-compact span { font-size: .9rem; line-height: 1.35; }
@media (max-width: 767px) {
  .inst-banner > img { display: none; }
  .inst-banner-compact { display: flex; }
}
:root[data-theme="dark"] .inst-banner { filter: brightness(.92); }

/* Motif « barres » de la bannière, en décor du héros */
.hero-bars { position: absolute; right: max(16px, calc((100vw - var(--container)) / 2 + 24px)); bottom: 0; display: none; align-items: flex-end; gap: 14px; height: 70%; z-index: 0; pointer-events: none; }
.hero-bars i { display: block; width: 12px; border-radius: 3px 3px 0 0; opacity: .9; }
.hero-bars i:nth-child(1) { height: 30%; background: var(--brand-gray); }
.hero-bars i:nth-child(2) { height: 45%; background: var(--brand-yellow); }
.hero-bars i:nth-child(3) { height: 38%; background: var(--brand-pale); }
.hero-bars i:nth-child(4) { height: 60%; background: var(--brand-green); }
.hero-bars i:nth-child(5) { height: 52%; background: var(--brand-lime); }
.hero-bars i:nth-child(6) { height: 75%; background: var(--brand-teal); }
.hero-bars i:nth-child(7) { height: 66%; background: var(--brand-turquoise); }
.hero-bars i:nth-child(8) { height: 90%; background: var(--brand-blue); }
@media (min-width: 1100px) { .hero-bars { display: flex; } }
.hero .hero-motto { color: var(--on-hero-2); font-size: .95rem; border-left: 3px solid var(--brand-yellow); padding-left: 12px; margin: 0 0 var(--s-5); max-width: 62ch; }

/* ==========================================================================
   Mode intégré (iframe dans WordPress / advanced_iframe)
   ========================================================================== */
.embed-bar { display: none; }
.is-embed { min-height: 0; background: var(--bg); }
.is-embed .site-header, .is-embed .mobile-nav, .is-embed .site-footer, .is-embed .inst-banner,
.is-embed .compare-bar, .is-embed [data-open-palette], .is-embed .hero-bars { display: none !important; }
.is-embed .embed-bar {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: 10px var(--s-4);
  background: var(--surface); border-bottom: 1px solid var(--border); position: relative;
}
.is-embed .embed-bar .brand-stripe { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.embed-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.embed-nav::-webkit-scrollbar { display: none; }
.embed-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-weight: 700; font-size: .93rem; white-space: nowrap; }
.embed-nav a:hover { background: var(--surface-2); color: var(--text); }
.embed-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); }
.embed-nav .count { font-size: .75rem; background: var(--primary); color: var(--on-primary); border-radius: 999px; padding: 0 7px; }
.embed-search { position: relative; flex: 1; min-width: 200px; max-width: 420px; margin-left: auto; }
.embed-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.embed-search input { width: 100%; height: 40px; padding: 0 12px 0 38px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: .93rem; }
.embed-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.embed-foot { display: none; }
.is-embed .embed-foot { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4); border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-3); margin-top: var(--s-6); }
.is-embed .toasts { position: absolute; top: 64px; bottom: auto; }
.is-embed .hero { padding: var(--s-6) 0 calc(var(--s-7) + 8px); }
.is-embed .hero h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); }
.is-embed .filters { position: static; max-height: none; overflow: visible; }
.is-embed .toc { position: static; }
.is-embed .page-head { padding-top: var(--s-5); }
.is-embed .auth-shell { min-height: 0; grid-template-columns: 1fr; }
.is-embed .auth-aside { display: none; }
.is-embed .auth-main { padding: var(--s-5) var(--s-4); }

/* En-tête : pas de retour à la ligne, sous-titre masqué quand la place manque */
.main-nav a, .search-trigger kbd { white-space: nowrap; }
.search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (min-width: 1024px) and (max-width: 1279px) {
  .site-header .brand-text span { display: none; }
  .search-trigger { min-width: 0; width: 220px; }
}
@media (min-width: 1280px) { .search-trigger { min-width: 280px; } }
.hero-bars { height: 58%; }
.site-header .brand { min-width: 0; }
.site-header .brand-text { min-width: 0; }
.site-header .brand-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 639px) { .site-header .brand-text span { display: none; } }
/* Les colonnes de grille ne doivent jamais forcer la largeur de la page */
.dict-layout > *, .catalog-layout > *, .study-body > *, .study-hero-grid > *, .grid > * { min-width: 0; }

/* ==========================================================================
   En-tête du portail PNIN (navigation vers pnin.ins.ne)
   ========================================================================== */
.portal-bar { position: relative; z-index: 45; background: #005e80; color: #fff; font-size: .86rem; }
:root[data-theme="dark"] .portal-bar { background: #04364d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .portal-bar { background: #04364d; } }
.portal-bar .container { display: flex; align-items: center; gap: var(--s-4); min-height: 42px; }
.portal-home { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; white-space: nowrap; min-height: 40px; }
.portal-home:hover { color: #fff; text-decoration: underline; }
.portal-home img { width: 24px; height: 24px; background: #fff; border-radius: 6px; padding: 2px; }
.portal-home-sub { color: #cfe7f1; font-weight: 400; }
.portal-nav { margin-left: auto; display: none; }
.portal-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.portal-item > a, .portal-item > button, .portal-compact > button {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: #e6f3f8; font: inherit; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.portal-item > a:hover, .portal-item > button:hover, .portal-item.is-open > button, .portal-compact > button:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.portal-item > a[aria-current], .portal-item > a[aria-current]:hover { background: #fff; color: var(--primary-ink); }
.portal-item .icon, .portal-compact > button .icon { width: 14px; height: 14px; }
.portal-bar :focus-visible { outline-color: #fff; }
.portal-sub { left: 0; right: auto; top: 100%; min-width: 250px; list-style: none; margin: 0; font-size: .93rem; }
.portal-sub li { margin: 0; }
.portal-sub a[aria-current] { background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
@media (hover: hover) and (min-width: 1180px) {
  .portal-item:hover > .portal-sub, .portal-item:focus-within > .portal-sub { display: block; }
}
.portal-compact { margin-left: auto; }
.portal-compact .portal-sub { left: auto; right: 0; max-height: 70vh; overflow-y: auto; }
.portal-group { padding: 10px 12px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.dropdown-menu .portal-child { padding-left: 24px; }
@media (min-width: 1180px) { .portal-nav { display: block; } .portal-compact { display: none; } }
@media (max-width: 1399px) { .portal-home-sub { display: none; } }
@media (max-width: 420px) { .portal-compact > button { padding: 0 6px; } }

/* Lien « Retour sur le portail PNIN » dans la navigation principale */
.main-nav a.nav-portal { margin-left: 6px; border: 1px solid var(--border-strong); color: var(--primary-ink); white-space: nowrap; }
.main-nav a.nav-portal:hover { border-color: var(--primary); background: var(--primary-soft); }
.main-nav a.nav-portal .icon { width: 16px; height: 16px; }
.nav-portal-short { display: none; }
.mobile-nav a.nav-portal { color: var(--primary-ink); }

/* En-tête du site : la marque PNIN est portée par le bandeau du portail → sous-titre masqué sur ordinateur,
   et recherche réduite à une icône sur les écrans moyens pour laisser la place au lien de retour. */
@media (min-width: 1024px) { .site-header .brand-text span { display: none; } }
@media (min-width: 1024px) and (max-width: 1279px) {
  .nav-portal-long { display: none; }
  .nav-portal-short { display: inline; }
  .header-actions .search-trigger { display: none; }
  .header-actions #mobile-search-btn { display: inline-flex !important; }
  .main-nav a { padding: 8px 10px; }
}
@media print { .portal-bar { display: none !important; } }

/* Ajustements de largeur : bandeau du portail et en-tête du site (aucun défilement horizontal) */
.portal-home-sub { display: none !important; }
.portal-item > a, .portal-item > button { padding: 0 8px; font-size: .84rem; }
.portal-nav { display: none !important; }
.portal-compact { display: block; }
@media (min-width: 1280px) { .portal-nav { display: block !important; } .portal-compact { display: none; } }
@media (min-width: 1024px) {
  .main-nav a { padding: 8px 10px; }
  .search-trigger { min-width: 0 !important; width: auto !important; }
  .search-trigger .st-long { display: none; }
}
.search-trigger .st-short { display: none; }
@media (min-width: 1024px) { .search-trigger .st-short { display: inline; } }
@media (max-width: 419px) { .site-header .brand-text { display: none; } }
