/* ==========================================================================
   Mon ANRH — feuille de style unique
   Charte graphique ANRH 2026 : prune, aubergine, orange, vert dynamique ;
   Luciole pour les titres, Verdana pour le texte ; logo dans son cartouche blanc.
   ========================================================================== */

@font-face {
  font-family: "Luciole";
  src: url("../fonts/Luciole-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Luciole";
  src: url("../fonts/Luciole-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Charte */
  --prune: #824a79;
  --prune-700: #6c3d65;
  --prune-50: #f8f2f7;
  --prune-100: #f0e4ee;
  --prune-200: #dfc8db;
  --aubergine: #573656;
  --aubergine-900: #3d2540;
  --aubergine-950: #2c1a2e;
  --vert: #80ba2e;
  --vert-700: #4f7a16;
  --vert-50: #f2f8e8;
  --vert-100: #e2f0cc;
  --orange: #ed6e1c;
  --orange-700: #a84c0f;
  --orange-50: #fdf1e8;
  --rouge: #c0262f;
  --rouge-50: #fdeeee;
  --bleu: #3b6ea5;
  --bleu-50: #ebf2f9;
  --rose: #c43b78;
  --rose-50: #fde7f1;
  --jaune: #8a6a00;
  --jaune-50: #fff6cc;

  /* Neutres clairs : le prune reste une couleur, plus le fond */
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #faf8fb;
  --surface-3: #f2eef3;
  --line: #e8e2ea;
  --line-strong: #d6ccd8;
  --field-border: #857987;
  --text: #2a1f2b;
  --text-2: #4b3e4d;
  --muted: #6d6170;

  /* Typographie */
  --font: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --font-title: "Luciole", Verdana, Geneva, sans-serif;

  /* Formes */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(42, 31, 43, 0.05);
  --shadow: 0 1px 2px rgba(42, 31, 43, 0.04), 0 6px 18px rgba(42, 31, 43, 0.06);
  --shadow-lg: 0 4px 10px rgba(42, 31, 43, 0.05), 0 18px 48px rgba(42, 31, 43, 0.16);
  --ring: 0 0 0 3px rgba(130, 74, 121, 0.25);

  /* Mise en page */
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --gutter: clamp(16px, 3vw, 32px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Alias historiques */
  --ink: var(--text);
  --lilas: var(--prune-50);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
img { display: block; height: auto; }
svg { flex-shrink: 0; }

a {
  color: var(--prune);
  text-decoration: none;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--aubergine); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.2;
  color: var(--aubergine);
  letter-spacing: -0.005em;
}

p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--prune);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--prune-200); color: var(--aubergine-950); }

[hidden] { display: none !important; }
[data-denied] { display: none !important; }
html:not([data-nav-ready]) [data-module],
html:not([data-nav-ready]) [data-nav-group] { display: none !important; }

kbd {
  font-family: var(--font);
  font-size: 0.72rem;
}

.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: 0.78rem; }

.skip-links ul { margin: 0; padding: 0; list-style: none; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--aubergine);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus { top: 12px; color: #fff; }

/* Vagues ANRH en fond */
.site-waves {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.site-wave { position: absolute; height: auto; overflow: visible; }
.site-wave--a { width: 110vw; left: -20vw; top: 34vh; opacity: 0.05; }
.site-wave--b { width: 46vw; right: -12vw; bottom: -10vh; opacity: 0.07; }

/* ---------- Coque : barre latérale + contenu ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.shell-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 16px 12px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
  color: var(--text);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e4ddd4 transparent;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
}

.brand:hover { color: var(--aubergine); }

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  transition: transform 0.3s var(--ease);
}

.brand-mark img { width: 24px; height: auto; }
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.04); }

.brand-copy { display: grid; min-width: 0; line-height: 1.2; }

.brand-copy strong {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--text);
}

.brand-version {
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 400;
  line-height: 1.4;
}

.sidebar-close {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
}

.sidebar-close:hover { background: var(--rose-50); }

.nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  outline: none;
}

.nav-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.nav-group { display: grid; gap: 2px; margin-top: 14px; }

.nav-group-label {
  padding: 0 12px 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.86rem;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-link svg { color: var(--rose); transition: color 0.18s var(--ease); }

.nav-link:hover {
  background: var(--jaune-50);
  color: var(--text);
}

.nav-link:hover svg { color: var(--orange-700); }

.nav-link.active {
  background: var(--rose-50);
  box-shadow: inset 3px 0 0 var(--rose);
  color: var(--text);
  font-weight: 700;
}

.nav-link.active svg { color: var(--rose); }

.nav-text { display: grid; min-width: 0; line-height: 1.25; }

.nav-text small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
}

.nav-link:focus-visible { outline-color: var(--vert); }

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sidebar-note {
  padding: 10px 12px 0;
  color: var(--muted);
  font-size: 0.7rem;
}

/* ---------- Barre supérieure ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  background: transparent;
  border-bottom: 1px solid var(--line);
}

/* Le flou reste sur un calque, pour que le menu des notifications
   puisse se positionner sur l’écran et non dans la barre. */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

.topbar .nav-toggle { display: none; }

.topbar-brand {
  display: none;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.topbar-brand img { width: 20px; }

.global-search {
  position: relative;
  flex: 1 1 auto;
  max-width: 560px;
  min-width: 0;
}

.global-search form {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search form > svg {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}

.global-search-input {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 42px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.84rem;
  outline: 2px solid transparent;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}

.global-search-input::placeholder { color: var(--muted); opacity: 1; }
.global-search-input::-webkit-search-cancel-button { display: none; }

.global-search-input:hover { border-color: var(--line-strong); }

.global-search-input:focus,
.live-search.is-open .global-search-input {
  border-color: var(--prune);
  background: #fff;
  box-shadow: var(--ring);
}

.search-kbd {
  position: absolute;
  right: 12px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  pointer-events: none;
}

.global-search-input:focus + .search-kbd { opacity: 0; }

.live-search { position: relative; }

.live-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: min(460px, 70vh);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: drop-in 0.18s var(--ease) both;
}

.search-group { padding: 4px 0; }

.search-group + .search-group { border-top: 1px solid var(--line); }

.search-group h4 {
  margin: 0;
  padding: 8px 12px 4px;
  font-family: var(--font);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-group a {
  display: grid;
  gap: 1px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
}

.search-group a:hover,
.search-group a:focus-visible { background: var(--prune-50); color: var(--prune); }

.search-group a small { color: var(--muted); font-size: 0.74rem; }

.search-empty { margin: 0; padding: 14px 12px !important; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.header-slot { position: relative; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.icon-btn:hover,
.icon-btn[aria-expanded="true"] { background: var(--prune-50); color: var(--prune); }

.badge-dot {
  position: absolute;
  top: 6px;
  right: 5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--orange-700);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.user-chip:hover,
.user-chip[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); }

.user-copy { display: grid; line-height: 1.2; max-width: 170px; }

.user-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}

.user-role {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-caret { color: var(--muted); display: grid; transition: transform 0.2s var(--ease); }
.user-chip[aria-expanded="true"] .user-caret { transform: rotate(180deg); }

/* Menus déroulants */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  display: none;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.dropdown.open { display: block; animation: drop-in 0.18s var(--ease) both; }

.dropdown a,
.dropdown button.menu-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
  text-align: left;
}

.dropdown a svg,
.dropdown button.menu-action svg { color: var(--muted); }

.dropdown a:hover,
.dropdown button.menu-action:hover { background: var(--prune-50); color: var(--prune); }

.dropdown a:hover svg,
.dropdown button.menu-action:hover svg { color: var(--prune); }

.dropdown form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }

.dropdown-title {
  padding: 8px 12px 6px;
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--aubergine);
}

.dropdown--notifs { width: min(380px, calc(100vw - 24px)); }

.dropdown-list { max-height: min(360px, 60vh); overflow: auto; }

.dropdown-foot {
  justify-content: center;
  margin-top: 4px;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 0 10px 10px !important;
  color: var(--prune) !important;
  font-weight: 700;
}

.dropdown a.notif-item,
.notif-page .notif-item {
  display: grid;
  justify-items: stretch;
  align-items: start;
  min-width: 0;
}

.notif-item {
  position: relative;
  padding: 10px 12px 10px 26px !important;
  border-radius: 10px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.notif-item strong,
.notif-item small {
  min-width: 0;
  max-width: 100%;
}

.notif-item strong { display: block; font-size: 0.82rem; }
.notif-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.74rem; line-height: 1.35; }

.notif-item::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.notif-item.unread { background: var(--orange-50); }
.notif-item.unread::before { background: var(--orange); }

.notif-empty {
  margin: 0;
  padding: 14px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.notif-page .notif-item { margin-bottom: 4px; }
.notif-page .notif-item:hover { background: var(--prune-50); }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: none;
  background: rgba(44, 26, 46, 0.45);
  backdrop-filter: blur(2px);
}

.overlay.open { display: block; animation: fade-in 0.2s var(--ease) both; }

/* ---------- Contenu ---------- */

.main {
  flex: 1;
  width: 100%;
  padding: 28px var(--gutter) 64px;
  outline: none;
}

.page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  animation: rise 0.4s var(--ease) backwards;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head > div { min-width: 0; max-width: 760px; }

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--prune);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-kicker::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--vert);
}

.page-head h1 {
  margin-top: 6px;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.15rem);
}

.page-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 64ch;
}

.page-head .btn { flex: none; }

.lede { color: var(--text-2); font-size: 0.92rem; max-width: 68ch; }

.breadcrumb { margin-bottom: 18px; color: var(--muted); font-size: 0.78rem; }

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li { display: inline-flex; align-items: center; }

.breadcrumb li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  margin: 0 10px;
  border-top: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.breadcrumb a { color: var(--prune); font-weight: 700; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--text-2); }

.section { margin-top: 32px; }
.section-gap { margin-top: 16px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.section-head h2,
.section > h2 { font-size: 1.15rem; }
.section > h2 { margin-bottom: 14px; }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--prune);
  font-size: 0.8rem;
  font-weight: 700;
}

.link-more svg { transition: transform 0.2s var(--ease); }
.link-more:hover svg { transform: translateX(3px); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* La rubrique Actualités se replie selon la place réelle, pas seulement la largeur de la fenêtre. */
[data-page="news"] .grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.demo-note { margin-top: 12px; color: var(--muted); font-size: 0.74rem; }

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px dashed var(--orange);
  border-radius: 999px;
  background: var(--orange-50);
  color: var(--orange-700);
  font-size: 0.74rem;
  font-weight: 700;
}

.demo-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

/* ---------- Boutons ---------- */

.btn,
.an-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--prune);
  border-radius: 12px;
  background: var(--prune);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.2s var(--ease), transform 0.18s var(--ease);
}

.btn:hover,
.an-button:hover {
  border-color: var(--aubergine);
  background: var(--aubergine);
  color: #fff;
  box-shadow: 0 6px 16px rgba(87, 54, 86, 0.22);
}

.btn:active { transform: translateY(1px); box-shadow: none; }

.btn-primary { background: var(--prune); border-color: var(--prune); color: #fff; }

.btn-accent {
  border-color: var(--vert);
  background: var(--vert);
  color: var(--aubergine-950);
}

.btn-accent:hover {
  border-color: #73a82a;
  background: #73a82a;
  color: var(--aubergine-950);
  box-shadow: 0 6px 16px rgba(79, 122, 22, 0.25);
}

.btn-ghost,
.btn-secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
}

.btn-ghost:hover,
.btn-secondary:hover {
  border-color: var(--prune-200);
  background: var(--prune-50);
  color: var(--prune);
  box-shadow: none;
}

.btn-soft { border-color: transparent; background: var(--prune-50); color: var(--prune); }

.btn-sm { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 0.78rem; }
.btn-pill { border-radius: 999px; }

.btn-star[aria-pressed="true"] { border-color: var(--orange); background: var(--orange-50); color: var(--orange-700); }
.btn-star[aria-pressed="true"] svg { color: var(--orange); }

.an-button__icon, .an-button__arrow { display: none; }

/* ---------- Champs ---------- */

.main input[type="text"],
.main input[type="email"],
.main input[type="password"],
.main input[type="tel"],
.main input[type="url"],
.main input[type="number"],
.main input[type="datetime-local"],
.main input[type="search"],
.main input:not([type]),
.main select,
.main textarea,
.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 400;
  outline: 2px solid transparent;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.main select {
  padding-right: 36px;
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236d6170' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 12px center / 12px;
}

.main input:hover,
.main select:hover,
.login-card input:hover { border-color: #bfb2c2; }

.main input:focus,
.main select:focus,
.main textarea:focus,
.login-card input:focus {
  border-color: var(--prune);
  box-shadow: var(--ring);
}

.main input:disabled,
.main select:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }

.main input[type="checkbox"] { accent-color: var(--prune); width: 16px; height: 16px; }

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }

.field label,
.profile-form label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
}

.field-hint { color: var(--muted); font-size: 0.74rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }

.form-section {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.form-section legend {
  padding: 0 0 4px;
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--aubergine);
}

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.profile-status { min-height: 0; margin: 0; }
.profile-status:empty { display: none; }
.profile-status.is-error { color: var(--rouge); }
.profile-status.is-ok { color: var(--vert-700); }

/* Barre de recherche et filtres de liste */
.toolbar { display: grid; gap: 12px; margin-bottom: 20px; }

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.toolbar .search-row { margin-bottom: 0; }

.search-field {
  position: relative;
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  min-width: 0;
}

.search-field > svg {
  position: absolute;
  left: 13px;
  color: var(--muted);
  pointer-events: none;
}

.main .search-field input { padding-left: 40px; }
.main .search-field input::-webkit-search-cancel-button { cursor: pointer; }

.search-row--lg .search-field input { min-height: 50px; font-size: 0.95rem; border-radius: 14px; }
.search-row--lg .btn { min-height: 50px; border-radius: 14px; }

.main select.filter-select { width: auto; min-width: 130px; flex: 0 1 180px; }
.search-field { flex-basis: 220px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.toolbar .filters { margin-bottom: 0; }

/* ---------- Petits composants ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 0.8rem;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

a.chip:hover { border-color: var(--prune-200); background: var(--prune-50); color: var(--prune); }

.chip.is-muted { border-style: dashed; color: var(--muted); background: transparent; }

.chip.active {
  border-color: var(--prune);
  background: var(--prune);
  color: #fff;
  font-weight: 700;
}

span.chip,
.access-list .chip,
.gov-hint .chip {
  min-height: 26px;
  padding: 0 10px;
  border-color: var(--prune-100);
  background: var(--prune-50);
  color: var(--prune);
  font-size: 0.74rem;
  font-weight: 700;
}

.tag,
.languette {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.languette.prune, .tag.prune { background: var(--prune-50); color: var(--prune); }
.languette.orange, .tag.orange { background: var(--orange-50); color: var(--orange-700); }
.languette.vert, .tag.vert { background: var(--vert-50); color: var(--vert-700); }
.languette.bleu, .tag.bleu { background: var(--bleu-50); color: #2f5b8a; }
.languette.rose, .tag.rose { background: var(--rose-50); color: var(--rose); }
.languette.jaune, .tag.jaune { background: var(--jaune-50); color: var(--jaune); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--vert-700);
  font-size: 0.76rem;
  font-weight: 700;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vert);
  box-shadow: 0 0 0 3px var(--vert-100);
}

.status.warn { color: var(--orange-700); }
.status.warn::before { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-50); }
.status.off { color: var(--muted); }
.status.off::before { background: var(--muted); box-shadow: 0 0 0 3px var(--line); }

.picto {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--prune-50);
  color: var(--prune);
}

.picto-lg { width: 46px; height: 46px; border-radius: 13px; }
.picto-xl { width: 72px; height: 72px; border-radius: 20px; }
/* Application interne au portail : le logo ANRH. */
.picto-anrh { background: #fff; border: 1px solid var(--line); }
.picto-anrh img { width: 56%; height: auto; }

.picto { border-radius: 50%; }
.tone-prune.picto { background: #7b3fa0; color: #fff; }
.tone-orange.picto { background: #f58220; color: #3d2208; }
.tone-vert.picto { background: #8bc53f; color: #1c3308; }
.tone-bleu.picto { background: #2f6fad; color: #fff; }
.tone-rose.picto { background: #ed6ea3; color: #3d1020; }
.tone-jaune.picto { background: #f5c518; color: #3d2e00; }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--prune);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar.tone-prune { background: var(--prune); }
.avatar.tone-orange { background: var(--orange-700); }
.avatar.tone-vert { background: var(--vert-700); }
.avatar.tone-bleu { background: var(--bleu); }
.avatar.tone-rose { background: var(--rose); }
.avatar.tone-jaune { background: var(--jaune); }

.avatar-lg, .avatar.lg { width: 56px; height: 56px; font-size: 1.05rem; }
.avatar-xl, .avatar.xl { width: 80px; height: 80px; font-size: 1.45rem; }

.star {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease), transform 0.25s var(--ease);
}

.star:hover { background: var(--orange-50); color: var(--orange); }
.star[aria-pressed="true"] { color: var(--orange); }
.star:active { transform: scale(0.88); }

/* Onglets */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}

.tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 3px;
  background: transparent;
  transition: background-color 0.2s var(--ease);
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--prune); }
.tab.active::after { background: var(--prune); }

.tab-panel { animation: rise 0.3s var(--ease) backwards; }

/* Panneaux */
.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.panel > h2 svg { color: var(--prune); }
.panel > .lede, .panel > .muted { margin-bottom: 14px; }

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.panel-subtitle {
  margin: 20px 0 8px;
  font-size: 0.9rem;
}

.facts { display: grid; gap: 0; margin: 0; }

.facts > div {
  display: grid;
  grid-template-columns: minmax(130px, 34%) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--muted); font-size: 0.8rem; }
.facts dd { margin: 0; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }

.facts--row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 20px;
}

.facts--row > div {
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 0;
  border: 0;
}

.panel .facts--row { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.panel > .facts--row:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.list-links,
.list-rows { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.list-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.84rem;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.list-links a > span:not(.list-star) { display: grid; min-width: 0; }
.list-links a small { color: var(--muted); font-size: 0.74rem; font-weight: 400; }
.list-links a > svg { color: var(--line-strong); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.list-links a:hover { background: var(--prune-50); color: var(--prune); }
.list-links a:hover > svg { color: var(--prune); transform: translateX(2px); }
.list-links a:has(.list-star) { justify-content: flex-start; }
.list-star { display: grid; color: var(--orange); }

.list-rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.list-rows li:first-child { border-top: 0; }
.list-rows li > svg { color: var(--prune); }
.list-rows li > span:first-of-type { flex: 1; min-width: 0; }

.stack-list { display: grid; gap: 6px; }

.empty {
  padding: 32px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
}

.empty a { font-weight: 700; }

/* Tableaux */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

table.data { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.82rem; }

table.data th {
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

table.data td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
table.data td:first-child a { font-weight: 700; }
table.data tbody tr { transition: background-color 0.15s var(--ease); }
table.data tbody tr:hover { background: var(--prune-50); }

/* Interrupteur */
.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-ui {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--field-border);
  transition: background-color 0.2s var(--ease);
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(42, 31, 43, 0.25);
  transition: transform 0.22s var(--ease);
}

.switch input:checked + .switch-ui { background: var(--vert-700); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { box-shadow: var(--ring); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch-ui { opacity: 0.6; }

.pref-list { display: grid; }

.pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.pref:first-child { border-top: 0; }

/* ---------- Cartes ---------- */

.app-card,
.news-card,
.doc-card,
.person-card,
.dash-card,
.kpi,
.action-card--boxed {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.app-card:hover,
.news-card:hover,
a.doc-card:hover,
a.person-card:hover,
.dash-card:hover,
.action-card--boxed:hover {
  border-color: var(--prune-200);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* Application */
.app-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.app-card-top { display: flex; align-items: flex-start; justify-content: space-between; }

.app-card h3 { margin: 14px 0 6px; font-size: 1rem; }
.app-card h3 a { color: var(--aubergine); }
.app-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-card h3 a:focus-visible { outline: none; }
.app-card:has(h3 a:focus-visible) { box-shadow: var(--ring); }

.app-card p {
  flex: 1;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.app-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.app-card.app-launch {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 14px 16px;
}
.app-launch-link {
  position: static;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  color: var(--aubergine);
  font-weight: 700;
}
.app-launch-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-launch-name { min-width: 0; display: grid; gap: 2px; }
.app-launch-meta { color: var(--muted, #6b5d6a); font-size: 0.8rem; font-weight: 400; }
.grid > .app-group,
.grid > .empty { grid-column: 1 / -1; }
.app-group {
  display: block;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.app-group details {
  padding: 8px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.app-group details:not([open]) { padding-bottom: 8px; }
.app-group:first-child { margin-top: 0; }
.app-group summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 2px;
  cursor: pointer;
  list-style: none;
}
.app-group summary::-webkit-details-marker { display: none; }
.app-group summary::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 2px;
  border-right: 2px solid var(--prune);
  border-bottom: 2px solid var(--prune);
  transform: rotate(-45deg);
}
.app-group details[open] summary::before { transform: rotate(45deg); }
.app-group summary:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.app-group h2 {
  margin: 0;
  color: var(--prune);
  font-family: var(--font-title);
  font-size: 1.15rem;
}
.app-group .grid { margin-top: 8px; }
.app-group-count {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--prune-50);
  color: var(--prune-700);
  font-size: 0.76rem;
  font-weight: 700;
}
/* Listes d’applications du profil : la carte du catalogue, sur une colonne. */
/* La liste écrite dans la page attend celle des accès : des cartes grisées en attendant, pas d’initiales. */
[data-app-list]:not([data-rendered]) > li {
  border-radius: 14px;
  background: linear-gradient(100deg, var(--surface-2) 30%, #fff 50%, var(--surface-2) 70%) 0 0 / 300% 100%;
  animation: app-skeleton 1.2s ease-in-out infinite;
}
[data-app-list]:not([data-rendered]) > li > * { visibility: hidden; }
[data-app-list][data-rendered] > li { animation: app-appear 0.18s ease-out; }
@keyframes app-skeleton { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes app-appear { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  [data-app-list]:not([data-rendered]) > li,
  [data-app-list][data-rendered] > li { animation: none; }
}
.app-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.app-grid .app-card.app-launch { min-height: 72px; padding: 12px 14px; }
.app-grid .app-logo { width: 40px; height: 40px; }
.app-grid > .empty { padding: 18px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; color: var(--muted, #6b5d6a); }
.app-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  object-fit: contain;
  image-rendering: auto;
  color: var(--prune);
  font-weight: 700;
}
.app-logo-anrh { padding: 6px 8px; box-sizing: border-box; background: #fff; }
img.app-logo { display: block; }
.app-card-foot .btn { margin-left: auto; }

.app-card .star,
.app-card .btn { position: relative; z-index: 1; }

/* Actualité */
.news-card { overflow: hidden; }

.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.card-link:hover { color: inherit; }

.news-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-3);
}

.news-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.news-card:hover .news-cover img { transform: scale(1.04); }

.news-cover .tag {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--prune);
  box-shadow: var(--shadow-sm);
}

.news-card-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.news-card time { color: var(--muted); font-size: 0.74rem; }
.news-card h3 { font-size: 1rem; line-height: 1.3; }
.news-card:hover h3 { color: var(--prune); }

.news-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Document */
.doc-list { display: grid; gap: 10px; }

.doc-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  color: inherit;
}

.doc-card:hover { color: inherit; }
.doc-card-copy { display: grid; flex: 1; gap: 4px; min-width: 0; }
.doc-card h3 { font-size: 0.95rem; }
a.doc-card:hover h3 { color: var(--prune); }
.doc-card p { color: var(--muted); font-size: 0.8rem; }

.doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.doc-card-go { align-self: center; display: grid; color: var(--line-strong); transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
a.doc-card:hover .doc-card-go { color: var(--prune); transform: translateX(3px); }

/* Personne */
.person-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: inherit;
}

.person-card:hover { color: inherit; }
.person-card > span:last-child { display: grid; min-width: 0; }
.person-card strong { color: var(--aubergine); }
.person-card strong + span { color: var(--muted); font-size: 0.78rem; }

/* Action */
.action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text);
  transition: background-color 0.18s var(--ease);
}

.action-card:hover { background: var(--prune-50); color: var(--prune); }
.action-card > span:last-child { display: grid; min-width: 0; }
.action-card strong { font-size: 0.86rem; }
.action-card .meta { display: block; }
.action-card--boxed { padding: 14px 16px; }

/* Tableau de bord (carte) */
.dash-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  color: inherit;
}

.dash-card:hover { color: inherit; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; }
.dash-card-go { display: grid; color: var(--line-strong); transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.dash-card:hover .dash-card-go { color: var(--prune); transform: translateX(3px); }
.dash-card h3 { margin-top: 6px; font-size: 1.02rem; }
.dash-card:hover h3 { color: var(--prune); }
.dash-card p { flex: 1; color: var(--muted); font-size: 0.8rem; }

.dash-card-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 4px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.dash-card-kpis span { display: grid; min-width: 0; }
.dash-card-kpis small { color: var(--muted); font-size: 0.7rem; }
.dash-card-kpis strong { font-family: var(--font-title); font-size: 1.2rem; color: var(--prune); }

/* Indicateur */
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px; }

.kpi small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi strong {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 1.2rem + 0.8vw, 1.9rem);
  line-height: 1.15;
  color: var(--aubergine);
}

.kpi-hint { margin-top: 4px; color: var(--muted); font-size: 0.74rem; }

.delta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 700;
}

.delta.tone-vert { background: var(--vert-50); color: var(--vert-700); }
.delta.tone-orange { background: var(--orange-50); color: var(--orange-700); }
.delta.tone-prune { background: var(--prune-50); color: var(--prune); }
.delta.tone-bleu { background: var(--bleu-50); color: #2f5b8a; }

/* ---------- Fiches détaillées ---------- */

.detail-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 20px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(90% 140% at 100% 0%, var(--prune-50), transparent 60%),
    #fff;
  box-shadow: var(--shadow-sm);
}

.detail-hero-copy { display: grid; gap: 6px; min-width: 0; }
.detail-hero-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.detail-hero h1,
.detail-hero-title { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem); }

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.detail-hero-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.detail-hero-meta svg { color: var(--prune); }

.detail-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

/* ---------- Accueil ---------- */

.home-hero {
  position: relative;
  display: grid;
  gap: 22px;
  padding: clamp(22px, 3vw, 36px) clamp(20px, 3vw, 40px) 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(42% 80% at 100% 0%, rgba(237, 110, 163, 0.28), transparent 70%),
    radial-gradient(36% 70% at 0% 100%, rgba(245, 197, 24, 0.34), transparent 68%),
    radial-gradient(28% 50% at 80% 100%, rgba(139, 197, 63, 0.28), transparent 70%),
    #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.home-hero-wave {
  position: absolute;
  right: -40px;
  top: -30px;
  width: min(460px, 60%);
  opacity: 0.35;
  pointer-events: none;
}

.home-hello {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-hello .avatar { box-shadow: 0 0 0 4px #fff6cc; }

.home-hello-date {
  color: var(--orange-700);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.home-hello h1 {
  margin-top: 2px;
  color: var(--text);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem);
}

.home-hello-meta { margin-top: 4px; color: var(--muted); font-size: 0.84rem; }

.serp-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 860px;
  min-height: 58px;
  padding: 6px 6px 6px 18px;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(20, 8, 22, 0.25);
  transition: box-shadow 0.25s var(--ease);
}

.serp-search:focus-within { box-shadow: 0 10px 30px rgba(20, 8, 22, 0.25), 0 0 0 4px rgba(128, 186, 46, 0.55); }

.serp-search-icon { display: grid; color: var(--prune); }

.serp-search input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0.98rem;
}

.serp-search input::-webkit-search-cancel-button { display: none; }

.serp-clear {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--muted);
}

.serp-clear:hover { background: var(--surface-3); color: var(--text); }

.serp-go {
  flex: none;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--vert);
  color: var(--aubergine-950);
  font-weight: 700;
  transition: background-color 0.18s var(--ease);
}

.serp-go:hover { background: #73a82a; }

.serp-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  margin: 0 -6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.serp-tabs::-webkit-scrollbar { display: none; }

.serp-tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px 12px 0 0;
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 700;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.serp-tab:hover { background: var(--jaune-50); color: var(--text); }

.serp-tab.is-active {
  background: var(--bg);
  color: var(--rose);
}

.page.home { display: block; }

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 28px 32px;
  align-items: start;
}

.page.home .home-hero {
  grid-column: 1;
  gap: 14px;
  padding: 4px 0 0;
  background: transparent;
  box-shadow: none;
}

.page.home .home-hero-wave { display: none; }

.page.home .serp-main { grid-column: 1; min-width: 0; }

.page.home .serp-search {
  max-width: none;
  min-height: 48px;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  box-shadow: none;
}

.page.home .serp-search:hover,
.page.home .serp-search:focus-within {
  border-color: transparent;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.page.home .serp-search input[type="search"] { font-size: 1rem; }

.page.home .serp-tabs { gap: 4px; border-bottom: 1px solid #dadce0; }

.page.home .serp-tab {
  min-height: 42px;
  border-radius: 0;
  color: #5f6368;
  font-weight: 600;
}

.page.home .serp-tab.is-active {
  background: transparent;
  color: #1a0dab;
  box-shadow: inset 0 -3px 0 #1a0dab;
}

.page.home .web-serp { max-width: 42rem; }

.page.home .web-idle {
  max-width: 42rem;
  margin: 8px 0 0;
  color: #3c4043;
  font-size: 1.05rem;
  line-height: 1.6;
}

.page.home .web-serp-list:has(> li) + .web-idle,
html.is-searching .web-idle { display: none; }

.page.home .web-serp .web-serp-list:has(> li) {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.page.home .web-serp .web-serp-list > li {
  padding: 20px 0 8px;
  border-top: 0;
}

.page.home .web-serp .web-hit-title {
  color: #1a0dab;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
}

.page.home .web-serp .web-hit-title:hover { color: #1a0dab; text-decoration: underline; }

.page.home .web-serp .web-hit-url {
  margin-top: 4px;
  color: #188038;
  font-size: 0.875rem;
}

.page.home .web-serp .web-hit-snippet {
  margin-top: 6px;
  color: #3c4043;
  font-size: 0.92rem;
  line-height: 1.58;
}

.page.home .web-serp .web-serp-status { color: #3c4043; font-size: 1rem; }

.web-sentinel { height: 1px; }

.serp-main { min-width: 0; }

.home-news {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
  overflow: hidden;
}

.home-news-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}

.home-news-head h2 { font-size: 1.05rem; }

.home-news-head a { color: #1a0dab; font-size: 0.82rem; font-weight: 700; }
.home-news-head a:hover { text-decoration: underline; }

.home-news .home-hello {
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #e8eaed;
}

.home-news .home-hello h1 { font-size: 1.2rem; line-height: 1.25; }

.side-tabs {
  display: flex;
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid #e8eaed;
}

.side-tab {
  flex: 1;
  margin: 0;
  padding: 12px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #5f6368;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.side-tab:hover { color: #1a0dab; }

.side-tab.is-active {
  color: #1a0dab;
  border-bottom-color: #1a0dab;
}

.home-news .serp-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-news .serp-panel[hidden] { display: none; }

.home-news .photo-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.home-news .serp-empty,
.home-news .serp-pager { margin: 0; padding: 12px; }

/* Les actualités du portail restent les mêmes pendant une recherche web. */
.home-news .side-news-list { display: none; }

.side-news-list { padding: 4px 14px 16px; }

.home-news .serp-news {
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f3f4;
}

.home-news .web-hit-snippet {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-slider { display: flex; flex-direction: column; }

.home-news .news-slider-track.home-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-slider-track > li {
  grid-area: 1 / 1;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.news-slider-track > li.is-current {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.home-news .news-slider-track > li:not(.is-current) {
  position: absolute;
  width: 100%;
  overflow: hidden;
}

.news-slider .home-feed-card,
.news-slider .home-feed-card.is-lead {
  display: flex;
  flex-direction: column;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

.news-slider .home-feed-photo,
.news-slider .home-feed-card.is-lead .home-feed-photo {
  flex: none;
  aspect-ratio: 16 / 9;
  max-height: 190px;
  min-height: 0;
}

.news-slider .home-feed-photo img,
.news-slider .home-feed-card.is-lead .home-feed-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-slider .home-feed-copy,
.news-slider .home-feed-card.is-lead .home-feed-copy {
  gap: 6px;
  justify-content: flex-start;
  padding: 14px 16px 4px;
}

.news-slider .home-feed-card strong,
.news-slider .home-feed-card.is-lead strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.05rem;
  line-height: 1.35;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.news-slider .home-feed-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 0.86rem;
  line-height: 1.45;
}

.news-slider-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 12px;
}

.news-slider-bar p {
  color: #5f6368;
  font-size: 0.8rem;
  font-weight: 700;
}

.news-slider-bar button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  font-size: 0.78rem;
  font-weight: 700;
}

.news-slider-bar button:hover { background: #f8f9fa; border-color: #dadce0; color: #202124; }

.news-slider-bar [data-news-next] { justify-self: end; }

/* L’accueil exporté garde « À la une » dans le HTML. Une recherche la retire
   pour laisser la place aux résultats internet. */
html.is-searching .home-landing { display: none !important; }

.home-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  container-type: inline-size;
}

.home-feed-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.home-feed-card:hover { color: inherit; border-color: var(--prune-200); box-shadow: var(--shadow); transform: translateY(-2px); }

.home-feed-photo { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-3); }

.home-feed-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.home-feed-card:hover .home-feed-photo img { transform: scale(1.04); }

.home-feed-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 18px 18px; }

.home-feed-kicker { color: var(--prune); font-size: 0.72rem; font-weight: 700; }

.home-feed-card strong {
  font-family: var(--font-title);
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--aubergine);
}

.home-feed-card:hover strong { color: var(--prune); }

.home-feed-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-feed-card.is-lead {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: none;
}

.home-feed-card.is-lead .home-feed-photo { aspect-ratio: auto; min-height: 300px; }

.home-feed-card.is-lead .home-feed-copy {
  justify-content: center;
  gap: 10px;
  padding: clamp(20px, 3vw, 36px);
}

.home-feed-card.is-lead strong { font-size: clamp(1.2rem, 1rem + 0.6vw, 1.45rem); }
.home-feed-card.is-lead p { font-size: 0.88rem; -webkit-line-clamp: 4; }

/* La une se replie quand la colonne d’actualités est étroite, même sur un grand écran. */
@container (max-width: 640px) {
  .home-feed-card.is-lead { grid-template-columns: minmax(0, 1fr); }
  .home-feed-card.is-lead .home-feed-photo { min-height: 0; aspect-ratio: 16 / 9; }
}

/* Résultats */
.web-serp-status,
.serp-empty {
  padding: 16px 0;
  color: var(--muted);
}

.web-serp-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.web-serp-list:has(> li) {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.web-serp-list > li {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  animation: rise 0.35s var(--ease) backwards;
}

.web-serp-list > li:first-child { border-top: 0; }

.web-serp-list > li[hidden] + li,
.web-serp-list > li:first-child { border-top: 0; }

.web-hit-skel {
  height: 92px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent) 0 0 / 50% 100% no-repeat,
    linear-gradient(var(--surface-3), var(--surface-3)) 20px 22px / 45% 14px no-repeat,
    linear-gradient(var(--surface-3), var(--surface-3)) 20px 46px / 28% 10px no-repeat,
    linear-gradient(var(--surface-3), var(--surface-3)) 20px 66px / 80% 10px no-repeat;
  animation: skeleton 1.3s ease-in-out 3 !important;
}

.web-hit-title {
  color: var(--prune);
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.web-hit-title:hover { color: var(--aubergine); text-decoration: underline; }

.web-hit-url {
  margin-top: 2px;
  color: var(--vert-700);
  font-size: 0.76rem;
}

.web-hit-snippet { margin-top: 6px; color: var(--text-2); font-size: 0.82rem; line-height: 1.6; }

.web-hit-title,
.web-hit-url,
.web-hit-snippet { overflow-wrap: anywhere; }

.serp-news {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 18px;
  align-items: center;
}

.serp-news > div { min-width: 0; }

.serp-news-thumb { display: block; overflow: hidden; border-radius: var(--radius); }

.serp-news-thumb img {
  width: 132px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-3);
  transition: transform 0.4s var(--ease);
}

.serp-news:hover .serp-news-thumb img { transform: scale(1.05); }

.serp-pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.serp-pager button,
.serp-pager a {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.serp-pager a { display: inline-flex; align-items: center; }

.serp-pager button:hover,
.serp-pager a:hover { border-color: var(--prune-200); background: var(--prune-50); color: var(--prune); }

/* Photothèque */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.photo-card { min-width: 0; color: inherit; }
.photo-frame { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface-3); }
.photo-open { display: block; }

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}


.photo-download {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--prune);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background-color 0.2s var(--ease);
}

.photo-card:hover .photo-download,
.photo-download:focus-visible { opacity: 1; transform: none; }
.photo-download:hover { background: var(--prune); color: #fff; }

.photo-card strong { display: block; margin-top: 8px; font-size: 0.8rem; color: var(--text); }
.photo-card span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.72rem; }

@media (hover: none) {
  .photo-download { opacity: 1; transform: none; }
}

/* Aperçu d’une photo */
.has-lightbox { overflow: hidden; }

.photo-open { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  padding: env(safe-area-inset-top) 12px calc(16px + env(safe-area-inset-bottom));
  background: rgba(28, 16, 30, 0.94);
  backdrop-filter: blur(6px);
  color: #fff;
  animation: fade-in 0.2s var(--ease) both;
}

.lightbox-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
}

.lightbox-count { color: rgba(255, 255, 255, 0.7); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.lightbox-actions { display: flex; align-items: center; gap: 8px; }

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background-color 0.18s var(--ease);
}

.lightbox-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.lightbox-close { padding: 0; font-size: 1.5rem; line-height: 1; }

.lightbox-figure {
  grid-column: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  height: 100%;
  min-height: 0;
  margin: 0;
  align-content: center;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  transition: opacity 0.2s var(--ease);
}

.lightbox.is-loading .lightbox-figure img { opacity: 0.35; }

.lightbox-figure figcaption { display: grid; justify-items: center; gap: 2px; text-align: center; }
.lightbox-figure figcaption strong { font-family: var(--font-title); font-size: 1rem; }
.lightbox-figure figcaption span { color: rgba(255, 255, 255, 0.7); font-size: 0.78rem; }

.lightbox-nav {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  justify-self: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-prev:hover { transform: translateX(-2px); }
.lightbox-next:hover { transform: translateX(2px); }
.lightbox :focus-visible { outline-color: var(--vert); }

@media (max-width: 720px) {
  .lightbox { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; padding-inline: 8px; }
  .lightbox-figure { grid-column: 1; grid-row: 2; }
  .lightbox-figure img { max-height: calc(100dvh - 230px); }
  .lightbox-nav { grid-row: 3; width: 48px; height: 48px; margin-top: 8px; }
  .lightbox-prev { justify-self: start; grid-column: 1; }
  .lightbox-next { justify-self: end; grid-column: 1; }
}

/* Mes applications */
.serp-apps {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.serp-apps-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.serp-apps-block + .serp-apps-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.serp-apps-head h2 { font-size: 1.02rem; }
.serp-apps-head a { font-size: 0.78rem; font-weight: 700; }
.serp-apps-head a:hover { text-decoration: underline; }

.serp-apps ul { display: grid; gap: 2px; margin: 0 -8px; padding: 0; list-style: none; }

.serp-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  color: inherit;
  transition: background-color 0.18s var(--ease);
}

.serp-app:hover { background: var(--prune-50); color: inherit; }
.serp-app > span:last-child { display: grid; min-width: 0; }

.serp-app strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.serp-app:hover strong { color: var(--prune); }
.serp-app span span { color: var(--muted); font-size: 0.72rem; }
.serp-app span span.status { color: var(--vert-700); font-size: 0.72rem; }
.serp-app span span.status.off { color: var(--muted); }

.serp-apps-empty { color: var(--muted); font-size: 0.8rem; }

/* ---------- Article ---------- */

.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  margin-bottom: 32px;
}

.article-head { display: grid; gap: 14px; }
.article-head h1 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.5rem); line-height: 1.15; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.article-meta strong { color: var(--text); }

.article-cover {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.article-cover img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.article-body {
  max-width: 70ch;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #fff;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.8;
}

.article-body p + p { margin-top: 1.1em; }
.article-body p:first-child:not(.article-lead)::first-letter {
  float: left;
  margin: 6px 10px 0 0;
  font-family: var(--font-title);
  font-size: 3.1rem;
  font-weight: 700;
  line-height: 0.8;
  color: var(--prune);
}

/* ---------- Documents ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.docs-main { min-width: 0; }
.docs-side { display: grid; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 20px); }

/* ---------- Data ---------- */

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(0deg, transparent 0 44px, var(--line) 44px 45px);
}

.bar {
  flex: 1;
  min-height: 8px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--prune), var(--aubergine));
  transform-origin: bottom;
  animation: grow 0.6s var(--ease) both;
}

.bar:last-child { background: linear-gradient(180deg, var(--vert), var(--vert-700)); }
.bar:nth-child(2) { animation-delay: 0.04s; }
.bar:nth-child(3) { animation-delay: 0.08s; }
.bar:nth-child(4) { animation-delay: 0.12s; }
.bar:nth-child(5) { animation-delay: 0.16s; }
.bar:nth-child(6) { animation-delay: 0.2s; }
.bar:nth-child(7) { animation-delay: 0.24s; }
.bar:nth-child(8) { animation-delay: 0.28s; }

.legend-row {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.chart-row { display: flex; align-items: center; gap: 24px; }
.chart { width: 150px; height: 150px; flex: none; }

.chart-legend { display: grid; flex: 1; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 0.82rem; }
.chart-legend li { display: flex; align-items: center; gap: 10px; }
.chart-legend li span:nth-child(2) { flex: 1; color: var(--text-2); }
.chart-legend strong { color: var(--aubergine); }
.chart-legend .swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }

/* ---------- Organigramme ---------- */

.org-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 12px;
}
.org-tools[hidden] { display: none; }
.org-find {
  position: relative;
  flex: 1 1 280px;
  max-width: 440px;
}
.org-find svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.org-find input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
}
.org-find input[type="search"]:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--prune); }
.org-summary { margin: 0; color: var(--muted); font-size: 0.8rem; }
.org-actions { display: flex; gap: 8px; margin-left: auto; }

.org-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.76rem;
}
.org-legend li { display: inline-flex; align-items: center; gap: 8px; }
.org-swatch { width: 14px; height: 14px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; }
.org-swatch.is-root { border: 0; background: linear-gradient(135deg, var(--prune), var(--vert)); }
.org-swatch.is-site { background: #fff; }
.org-swatch.is-lead { border-color: var(--prune-200); background: var(--prune-50); }
.org-swatch.is-me { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-50); }

.org-board {
  position: relative;
  padding: clamp(16px, 2.4vw, 32px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle, var(--line) 1px, transparent 1.5px) 0 0 / 22px 22px,
    linear-gradient(180deg, #fff, var(--surface-2));
  box-shadow: var(--shadow-sm);
}
.org-board:focus-visible { box-shadow: var(--ring); }
.org-board.is-wide { cursor: grab; }
.org-board.is-panning { cursor: grabbing; user-select: none; }
.org-board.is-wide .org-node { cursor: auto; }

.org-tree, .org-tree ul { margin: 0; padding: 0; list-style: none; }
.org-tree { display: flex; width: 100%; }
.org-top { display: flex; flex: 1; flex-direction: column; align-items: center; min-width: 0; }

/* Carte commune */
.org-node {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(42, 31, 43, 0.05);
  color: inherit;
  text-align: left;
  transition: border-color 0.18s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.org-copy { flex: 1; min-width: 0; }
.org-copy strong, .org-copy span { display: block; }
.org-copy strong { color: var(--aubergine); font-size: 0.84rem; line-height: 1.25; }
.org-copy span { margin-top: 2px; color: var(--muted); font-size: 0.72rem; line-height: 1.3; }

/* Sommet : l’ANRH */
.org-crest {
  width: auto;
  min-width: 230px;
  padding: 12px 20px 12px 14px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--aubergine), var(--prune));
  box-shadow: 0 10px 28px rgba(87, 54, 86, 0.28);
}
.org-crest img { flex: none; padding: 5px 7px; border-radius: 10px; background: #fff; box-sizing: content-box; }
.org-crest .org-copy strong { color: #fff; font-size: 1.02rem; letter-spacing: 0.02em; }
.org-crest .org-copy span { color: rgba(255, 255, 255, 0.82); }

/* Rangée des services, reliée au sommet */
.org-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  padding-top: 30px;
}
/* Marges automatiques plutôt que centrage : rien n’est coupé à gauche quand ça déborde. */
.org-row > li:first-child { margin-left: auto; }
.org-row > li:last-child { margin-right: auto; }
.org-top > .org-crest::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 15px;
  background: var(--line-strong);
}
.org-service {
  --org-tone: var(--prune);
  --org-tone-50: var(--prune-50);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 0;
  min-width: 190px;
  max-width: 300px;
}
.org-service::before,
.org-service::after {
  content: "";
  position: absolute;
  top: -15px;
  height: 2px;
  background: var(--line-strong);
}
.org-service::before { left: -10px; right: 50%; }
.org-service::after { left: 50%; right: -10px; }
.org-service:first-child::before, .org-service:last-child::after { display: none; }
.org-service > .org-unit::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: 2px;
  height: 16px;
  background: var(--line-strong);
}
.org-board.is-single .org-service::before, .org-board.is-single .org-service::after { display: none; }

/* Service et équipe */
.org-unit { padding: 12px 10px 12px 14px; }
.org-service > .org-unit {
  border: 0;
  border: 1px solid transparent;
  background: var(--org-tone-50);
  box-shadow: 0 6px 18px rgba(42, 31, 43, 0.08);
}
.org-service > .org-unit .org-copy strong { font-size: 0.92rem; }
.org-service.is-loose { --org-tone: var(--line-strong); --org-tone-50: var(--surface-3); }
.org-team > .org-unit { padding: 9px 8px 9px 12px; background: #fff; }
.org-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--aubergine);
  cursor: pointer;
}
.org-toggle:hover { border-color: var(--line); background: #fff; }
.org-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.org-toggle svg { transition: transform 0.2s var(--ease); }
.org-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.is-collapsed > .org-body { display: none; }

.org-body { display: flex; flex-direction: column; gap: 8px; }
.org-people { display: flex; flex-direction: column; gap: 6px; }
.org-teams {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 2px 0 0 10px;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
}
.org-team { position: relative; display: flex; flex-direction: column; gap: 8px; }
.org-team::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 20px;
  width: 12px;
  height: 2px;
  background: var(--line-strong);
}
.org-team > .org-body { padding-left: 10px; }

/* Personne */
.org-person:hover { border-color: var(--prune-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.org-link { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding: 9px 11px; color: inherit; border-radius: inherit; }
.org-link:hover { color: inherit; }
.org-link:focus-visible { outline: none; box-shadow: var(--ring); }
.org-link:hover .org-copy strong { color: var(--prune); }
.org-node .avatar { flex: none; width: 34px; height: 34px; font-size: 0.68rem; }
.org-person.is-lead { border-color: var(--prune-200); background: linear-gradient(180deg, #fff, var(--org-tone-50, var(--prune-50))); box-shadow: 0 2px 8px rgba(42, 31, 43, 0.06); }
.org-person.is-lead .avatar { width: 40px; height: 40px; font-size: 0.76rem; }
.org-person.is-me { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-50); }
.org-badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--orange-50);
  color: var(--orange-700);
  font-size: 0.66rem;
  font-weight: 700;
}

/* Recherche */
.org-board.is-searching .org-node:not(.org-crest):not(.is-hit) { opacity: 0.38; }
.org-node.is-hit { opacity: 1; border-color: var(--prune); box-shadow: 0 0 0 3px var(--prune-100); }

@media (max-width: 760px) {
  .org-actions { margin-left: 0; }
  .org-tree { width: auto; }
  .org-top { flex: 1; min-width: 0; align-items: stretch; }
  .org-row { flex-direction: column; align-items: stretch; gap: 14px; padding-top: 18px; }
  .org-service { max-width: none; min-width: 0; }
  .org-row > li:first-child, .org-row > li:last-child { margin: 0; }
  .org-service::before, .org-service::after, .org-service > .org-unit::before, .org-top > .org-crest::after { display: none; }
  .org-crest { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .org-node, .org-toggle svg { transition: none; }
  .org-person:hover { transform: none; }
}

/* ---------- Mon espace ---------- */

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-col { display: grid; gap: 20px; min-width: 0; }

.access-list { display: grid; gap: 0; margin: 4px 0 12px; padding: 0; list-style: none; }

.access-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.access-list li:first-child { border-top: 0; }

/* ---------- Gouvernance & administration ---------- */

/* Créations */

/* Équipes d’un service */

.tab-quiet { margin-left: auto; background: transparent; color: var(--muted); box-shadow: none; }

/* Gouvernance en lecture seule */
.gov-sheet {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.gov-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.gov-sheet--team { margin-left: clamp(16px, 4vw, 40px); }

.gov-kind {
  display: block;
  margin-bottom: 2px;
  color: var(--prune);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gov-sheet-head strong { display: block; font-family: var(--font-title); color: var(--aubergine); font-size: 1rem; }
.gov-sheet-body { padding: 4px 18px 14px; }
.gov-count { flex: none; }
.gov-count, .gov-hint { color: var(--muted); font-size: 0.76rem; }
.gov-hint { display: block; font-weight: 400; margin-top: 2px; }
.gov-hint .chip { margin: 4px 4px 0 0; }

.gov-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.gov-sheet-body .gov-row:first-child { border-top: 0; }
.gov-row strong { display: block; }

[data-gov-users] > .panel + .panel { margin-top: 12px; }
[data-gov-users] > .panel h3 { font-size: 1rem; margin-bottom: 6px; }
[data-gov-users] > .panel p { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

/* ---------- Page d’état (404) ---------- */

.state-page {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 560px;
  margin: clamp(20px, 8vh, 80px) auto 0;
  text-align: center;
}

.state-code {
  font-family: var(--font-title);
  font-size: clamp(4rem, 3rem + 6vw, 7rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--prune), var(--vert));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.state-page h1 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.state-page > p { color: var(--muted); }
.state-page .search-row { width: 100%; margin: 6px 0 0; }

/* ---------- Connexion ---------- */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 24px 16px;
  background:
    radial-gradient(50% 45% at 100% 0%, rgba(237, 110, 163, 0.35), transparent 70%),
    radial-gradient(46% 50% at 0% 100%, rgba(245, 197, 24, 0.4), transparent 68%),
    var(--bg);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
}

.login-card {
  width: min(420px, 100%);
  padding: clamp(26px, 5vw, 40px);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 30px 80px rgba(20, 8, 22, 0.45);
  animation: rise 0.45s var(--ease) both;
}

.login-logo { width: auto; height: 56px; }

.login-card h1 { margin: 18px 0 6px; font-size: 1.6rem; color: var(--aubergine); }
.login-card > p { margin: 0 0 18px; color: var(--muted); }
.login-card a { font-weight: 700; }

.login-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--rouge-50);
  color: var(--rouge);
}

.login-card label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
}

.login-card input[type="email"],
.login-card input[type="password"] { min-height: 46px; }

.login-card button[type="submit"] {
  width: 100%;
  min-height: 48px;
  margin-top: 22px;
  border: 0;
  border-radius: 12px;
  background: var(--prune);
  color: #fff;
  font-weight: 700;
  transition: background-color 0.18s var(--ease), box-shadow 0.2s var(--ease);
}

.login-card button[type="submit"]:hover { background: var(--aubergine); box-shadow: 0 8px 20px rgba(87, 54, 86, 0.3); }

/* ---------- Notifications éphémères ---------- */

.toasts {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 14px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.32s var(--ease) both;
}

.toast-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-weight: 700;
}

.toast-card.is-ok .toast-mark { background: var(--vert-50); color: var(--vert-700); }
.toast-card.is-error .toast-mark { background: var(--rouge-50); color: var(--rouge); }
.toast-card.is-info .toast-mark { background: var(--prune-50); color: var(--prune); }

.toast-copy strong { display: block; color: var(--aubergine); font-size: 0.86rem; }
.toast-copy p { margin-top: 2px; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }

.toast-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
}

.toast-close:hover { background: var(--surface-3); color: var(--text); }

.toast-life {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  transform-origin: left center;
  animation: toast-life linear forwards;
}

.toast-card.is-ok .toast-life { background: var(--vert); }
.toast-card.is-error .toast-life { background: var(--rouge); }
.toast-card.is-info .toast-life { background: var(--prune); }
.toast-card.is-out { animation: toast-out 0.26s var(--ease) forwards; }

/* ---------- Animations ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes skeleton { from { background-position: -50% 0, 20px 22px, 20px 46px, 20px 66px; } to { background-position: 150% 0, 20px 22px, 20px 46px, 20px 66px; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes toast-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes wave-drift { 0%, 100% { transform: none; } 50% { transform: translate3d(2%, -1.5%, 0); } }



.grid > * { animation: rise 0.4s var(--ease) backwards; }
.grid > *:nth-child(2) { animation-delay: 0.03s; }
.grid > *:nth-child(3) { animation-delay: 0.06s; }
.grid > *:nth-child(4) { animation-delay: 0.09s; }
.grid > *:nth-child(5) { animation-delay: 0.12s; }
.grid > *:nth-child(6) { animation-delay: 0.15s; }
.grid > *:nth-child(n+7) { animation-delay: 0.18s; }

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

/* ---------- Adaptation aux écrans ---------- */

@media (max-width: 1279px) {
  .page.home { grid-template-columns: minmax(0, 1fr); }
  .home-news { grid-column: 1; grid-row: auto; position: static; min-height: 0; max-height: none; }
  .home-layout { grid-template-columns: minmax(0, 1fr); }

  .serp-apps { position: static; order: -1; }
  /* En recherche, les résultats passent devant les applications. */
  html.is-searching .serp-apps { order: 0; }
  html.is-searching .serp-main { order: -1; }
  .serp-apps ul { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; }

  .docs-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout, .profile-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Tablette et mobile : la barre latérale devient un tiroir */
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    visibility: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }

  .sidebar.open {
    transform: none;
    visibility: visible;
    transition: transform 0.3s var(--ease);
  }

  .sidebar-close { display: grid; }
  .topbar .nav-toggle, .topbar-brand { display: grid; }

  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); order: -1; }

  .article-hero { grid-template-columns: minmax(0, 1fr); }
  .article-cover { order: -1; }
}

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }

  .detail-hero { grid-template-columns: auto minmax(0, 1fr); }
  .detail-hero-actions { grid-column: 1 / -1; justify-content: flex-start; }

  .home-feed-card.is-lead { grid-template-columns: minmax(0, 1fr); }
  .home-feed-card.is-lead .home-feed-photo { min-height: 0; aspect-ratio: 16 / 9; }
}

@media (max-width: 720px) {
  :root { --topbar-h: 58px; }

  .main { padding-top: 18px; }

  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }

  .topbar { gap: 8px; padding: 0 12px; }
  .user-copy, .user-caret, .search-kbd { display: none; }

  /* Le menu s’aligne sur l’écran : ancré à la cloche, il sortait à gauche. */
  .dropdown--notifs {
    position: fixed;
    top: calc(var(--topbar-h) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - var(--topbar-h) - 20px);
  }

  .dropdown--notifs .dropdown-list {
    max-height: min(320px, calc(100dvh - var(--topbar-h) - 110px));
  }
  .user-chip { padding: 4px; }
  .global-search-input { padding-right: 12px; }

  .home-hero { border-radius: var(--radius-lg); gap: 16px; }
  .home-hello .avatar { display: none; }
  .home-feed { grid-template-columns: minmax(0, 1fr); }
  .serp-apps { padding: 16px 0 12px; }
  .serp-apps-head { padding: 0 16px; }
  .serp-apps ul {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: repeat(3, auto);
    grid-auto-columns: 74%;
    margin: 0;
    padding: 0 8px 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 8px;
    scrollbar-width: none;
  }
  .serp-apps ul::-webkit-scrollbar { display: none; }
  .serp-apps li { scroll-snap-align: start; }
  .serp-apps-empty { padding: 0 16px; }
  .serp-tab { padding: 0 12px; gap: 6px; }
  .serp-go { flex: 1 1 100%; padding: 0 14px; }
  .serp-search { flex-wrap: wrap; row-gap: 8px; min-height: 52px; padding-left: 14px; }
  .serp-search-icon { display: none; }
  /* 16px : iOS ne zoome plus le champ, ce qui laissait l’écran sur les articles.
     Le bouton passe à la ligne ; la croix reste dans le champ. */
  .serp-search input[type="search"] { flex: 1 1 0; min-width: 0; font-size: 16px; }
  .serp-clear { flex: none; }
  .serp-news { grid-template-columns: minmax(0, 1fr) 88px; gap: 12px; }
  .serp-news-thumb img { width: 88px; }
  .web-serp-list > li { padding: 16px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  .filters { flex-wrap: nowrap; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }

  .main select.filter-select { flex: 1 1 140px; min-width: 0; }
  .search-row .btn { flex: 1 1 100%; }
  .search-row--lg .btn { flex: 0 0 auto; }

  .docs-side { grid-template-columns: minmax(0, 1fr); }

  .detail-hero { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 14px; }
  .detail-hero .picto-xl { width: 56px; height: 56px; border-radius: 16px; }
  .detail-hero .avatar-xl { width: 64px; height: 64px; font-size: 1.2rem; }
  .detail-hero-actions .btn { flex: 1 1 auto; }

  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .panel { padding: 18px; }
  .chart-row { flex-direction: column; align-items: stretch; }
  .chart { align-self: center; }
  .bars { height: 140px; gap: 5px; }

  .article-body { padding: 20px; font-size: 0.9rem; }
  .page-head { margin-bottom: 18px; }
  .page-head .btn { width: 100%; }
}

@media (max-width: 640px) {
  /* Les trois onglets (Internet, Photothèque, Actualités) restent entiers. */
  .serp-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    margin-inline: 0;
    overflow: visible;
  }

  .serp-tab {
    justify-content: center;
    gap: 0;
    min-width: 0;
    padding: 0 4px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .serp-tab svg { display: none; }

  /* Résultats d’actualités : le texte passe sous la photo au lieu d’être écrasé. */
  .serp-news { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .serp-news-thumb { order: -1; }
  .serp-news-thumb img { width: 100%; height: 132px; aspect-ratio: auto; }
}

@media (max-width: 720px) {
  [data-page="news"] .filters {
    flex-wrap: wrap;
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }
}

@media (max-width: 420px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .topbar-brand { display: none; }
  .toasts { right: 12px; left: 12px; width: auto; }
}

@media print {
  .sidebar, .topbar, .site-waves, .toasts, .overlay, .ticket-dock { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
}


/* ==========================================================================
   Accessibilité (RGAA 4.1)
   ========================================================================== */

/* Texte réservé aux lecteurs d’écran */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Collections de cartes balisées en listes */
ul.grid,
ul.doc-list,
ul.home-feed,
ul.stack-list,
.sitemap-list,
.dropdown-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid-item { display: flex; min-width: 0; }
.grid-item > * { flex: 1 1 auto; min-width: 0; }
.home-feed > .grid-item.is-lead { grid-column: 1 / -1; }
.stack-list { display: grid; gap: 6px; }

/* Focus visible sur les fonds sombres */
.sidebar :focus-visible,
.home-hero :focus-visible,
.ai-hero :focus-visible,
.lightbox :focus-visible,
.login-body > :focus-visible {
  outline: 3px solid var(--vert);
  outline-offset: 2px;
}

.main :focus-visible { outline-width: 3px; }
.tab-panel:focus-visible { outline-offset: 6px; border-radius: var(--radius); }

/* Liens dans le texte : soulignés */
.main p a:not([class]),
.main li > a:not([class]):where(.prose *, .sitemap-list *),
.facts dd a{
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.main p a:not([class]):hover,
.facts dd a:hover { text-decoration-thickness: 2px; }

/* Champs obligatoires et facultatifs */
.field-required,
.field-optional { color: var(--muted); font-weight: 400; }
.form-intro { margin: 0 0 14px; }
.login-hint { margin: 0 0 6px; color: var(--muted); font-size: 0.8rem; }

/* Pied de page */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer ul { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--text-2); text-decoration: underline; text-underline-offset: 0.18em; }
.site-footer a:hover { color: var(--prune); }

/* Déclaration d’accessibilité */
.prose { max-width: 75ch; padding: clamp(20px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; color: var(--text-2); line-height: 1.7; }
.prose h2 { margin: 28px 0 10px; font-size: 1.2rem; }
.prose h2:first-of-type { margin-top: 18px; }
.prose h3 { margin: 18px 0 6px; font-size: 1rem; }
.prose p + p { margin-top: 10px; }
.prose ul { margin: 8px 0 0; padding-left: 1.3rem; }
.prose li + li { margin-top: 4px; }

/* Plan du site */
.sitemap { display: grid; gap: 20px; }
.sitemap-list { display: grid; gap: 8px; }
.sitemap-list ul { margin: 6px 0 4px; padding-left: 1.2rem; list-style: disc; }
.sitemap-list--cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sitemap-list a { font-weight: 700; }

/* Mode contrasté de Windows : les repères restent visibles */
@media (forced-colors: active) {
  .nav-link.active,
  .chip.active,
  .tab.active{ outline: 2px solid CanvasText; }
  .switch-ui { border: 1px solid CanvasText; }
  .status::before { forced-color-adjust: none; }
}

/* ==========================================================================
   Outil Communication
   ========================================================================== */

.comm .tab-panel > div > * + * { margin-top: 20px; }
.comm-dashboard > * + * { margin-top: 20px; }

.comm-links { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.comm-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.comm-link > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }

.comm-link-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--field-border); }
.comm-link.is-on .comm-link-dot { background: var(--vert-700); box-shadow: 0 0 0 4px var(--vert-100); }
.comm-link.is-off .comm-link-dot { background: var(--orange-700); box-shadow: 0 0 0 4px var(--orange-50); }

.comm-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.comm-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.comm-events { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.comm-events li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.82rem; }
.comm-events li:first-child { border-top: 0; padding-top: 0; }
.comm-events time { color: var(--muted); font-size: 0.74rem; }

.comm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 0; }
.comm-meta a { display: inline-flex; align-items: center; min-height: 28px; font-weight: 700; text-decoration: underline; text-underline-offset: 0.18em; }
.comm-meta { gap: 6px 14px; }
.comm-field { margin-top: 14px; }

.comm-photo { margin-top: 14px; }
.comm-photo-label { margin: 0 0 8px; color: var(--text-2); font-size: 0.8rem; font-weight: 700; }
.comm-photo-row { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 14px; align-items: start; }
.comm-photo-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}
.comm-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.comm-photo-tools { display: grid; gap: 8px; min-width: 0; }
.comm-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.comm-photo-tools label { display: grid; gap: 4px; color: var(--text-2); font-size: 0.78rem; font-weight: 700; }
.comm-photo-tools input { font-weight: 400; }

.comm-photo-browser { display: grid; gap: 8px; margin-top: 14px; }
.comm-photo-browser > label { color: var(--text-2); font-size: 0.8rem; font-weight: 700; }
.comm-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding: 2px;
}
.comm-photo-choice {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.comm-photo-choice:hover, .comm-photo-choice:focus-visible { border-color: var(--prune-200); }
.comm-photo-choice.is-on { border-color: var(--prune); box-shadow: 0 0 0 3px var(--prune-50); }
.comm-photo-choice img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-3);
}
.comm-photo-choice strong, .comm-photo-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comm-photo-choice strong { font-size: 0.75rem; }
.comm-photo-choice span { color: var(--muted); font-size: 0.68rem; }
.comm-photo-pager { display: flex; flex-wrap: wrap; gap: 8px; }

/* Photothèque de l’outil Communication : ajout et retrait */
.comm-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.comm-lib-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface, #fff);
}
.comm-lib-open { display: block; background: var(--surface-3); }
.comm-lib-open img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.comm-lib-meta { display: grid; gap: 4px; align-content: start; justify-items: start; padding: 10px 12px 12px; min-width: 0; }
.comm-lib-meta strong, .comm-lib-meta > span:not(.chip) {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comm-lib-meta strong { font-size: 0.8rem; }
.comm-lib-meta > span:not(.chip) { color: var(--muted); font-size: 0.72rem; }
.comm-lib-meta .btn { margin-top: 4px; }
.comm-lib-badge { font-size: 0.68rem; }

.comm-picker {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(28, 16, 32, 0.55);
}
.comm-picker[hidden] { display: none; }
.comm-picker-box {
  display: grid;
  gap: 12px;
  width: min(920px, 100%);
  max-height: min(82vh, 780px);
  overflow: auto;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.comm-picker-head, .comm-picker-search, .comm-picker-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.comm-picker-head h2 { margin: 0; font-size: 1.2rem; }
.comm-picker-search label { display: grid; gap: 4px; flex: 1; min-width: min(100%, 240px); font-size: 0.78rem; font-weight: 700; color: var(--text-2); }
.comm-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.comm-picker-grid button {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.comm-picker-grid button:hover, .comm-picker-grid button:focus-visible { border-color: var(--prune-200); background: var(--prune-50); }
.comm-picker-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.comm-picker-grid strong, .comm-picker-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-picker-grid strong { font-size: 0.75rem; }
.comm-picker-grid span { color: var(--muted); font-size: 0.68rem; }

@media (max-width: 640px) {
  .comm-photo-row { grid-template-columns: minmax(0, 1fr); }
  .comm-photo-preview { max-width: 220px; }
}
.main textarea { min-height: 0; padding: 10px 12px; line-height: 1.6; resize: vertical; }

.comm-targets {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.comm-targets legend { padding: 0 6px; color: var(--text-2); font-size: 0.8rem; font-weight: 700; }

.comm-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.86rem; cursor: pointer; }
.main .comm-check input[type="checkbox"] { flex: none; width: 24px; height: 24px; margin: 0; }
.comm-check + .comm-check { margin-top: 2px; } .panel form > .comm-check { margin-top: 10px; }

.comm-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-top: 12px;
}

.comm-inline label { display: grid; flex: 1 1 220px; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--text-2); }

.comm-details { margin-top: 10px; }
.comm-details summary { display: inline-flex; color: var(--prune); font-weight: 700; cursor: pointer; }
.comm-details[open] summary { margin-bottom: 4px; }
.comm-steps { display: grid; gap: 8px; margin: 10px 0 0; padding-left: 1.3rem; color: var(--text-2); font-size: 0.84rem; }

table.data th[scope="row"] { font-weight: 400; text-align: left; }
table.data th[scope="row"] strong { display: block; }

/* Visuels sans image : dégradé aux couleurs ANRH */
.news-cover--plain,
.home-feed-photo--plain {
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(128, 186, 46, 0.35), transparent 60%),
    linear-gradient(135deg, var(--aubergine), var(--prune));
}

.home-feed-photo--plain { min-height: 180px; }

.article-hero--plain { grid-template-columns: minmax(0, 1fr); }
.article-lead { font-weight: 700; color: var(--text); }
.article-source a { font-weight: 700; text-decoration: underline; }

@media (max-width: 1023px) {
  .comm-columns { grid-template-columns: minmax(0, 1fr); }
}

/* Titre qui reçoit le focus par script (page de lecture) : pas de cadre au chargement */
h1[tabindex="-1"]:focus { outline: none; }

/* Administration : habilitations d'une personne (profil + périmètre) */
/* Droits : profils, habilitations, correspondances Entra */
.chip-static { cursor: default; }

.lvl { display: inline-block; min-width: 86px; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; text-align: center; }
.lvl-0 { background: var(--surface-3); color: var(--muted); }
.lvl-1 { background: var(--bleu-50); color: var(--bleu); }
.lvl-2 { background: var(--vert-50); color: var(--vert-700); }
.lvl-3 { background: var(--jaune-50); color: var(--jaune); }
.lvl-4 { background: var(--orange-50); color: var(--orange-700); }
.lvl-5 { background: var(--prune-100); color: var(--prune-700); }
/* Correspondance : groupe, profil et service sur trois colonnes égales. */
/* Ajout d’une habilitation : profil, périmètre, équipes, puis motif et fin. */

/* Navigation à deux niveaux : un sélecteur d’espaces aubergine, puis les onglets de l’espace. */

/* Bandeau d’alertes : seulement ce qui demande une action. */

/* Menu « Créer » : une seule entrée au lieu de cinq boutons. */

/* Fiche : une seule feuille, des sections séparées par un filet, sans cadres imbriqués. */

/* Boutons d’enregistrement à leur taille, alignés à droite ; la suppression reste à gauche. */

/* Ajout d’une exception : profil et périmètre, puis motif et fin. */

/* Champs de la fiche : libellé au-dessus, contrôle sur toute la colonne. */

/* Libellés en casse normale dans la colonne de recherche. */

/* Filtres en puces et outils de liste. */

/* Aperçu d’impact avant d’enregistrer. */

/* Confirmation qui nomme la conséquence. */

/* Journal : filtres et avant/après. */

/* Simulateur : groupes à cocher. */

/* Organigramme : un arbre complet, relié par des traits, que l'on déplie branche par branche. */
.oc-summary { margin: 4px 0 12px; }
.org-find { position: relative; }
.oc-results { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; display: grid; gap: 2px; max-height: 380px; margin: 0; padding: 6px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); list-style: none; }
.oc-results[hidden] { display: none; }
.oc-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.oc-result:hover, .oc-result:focus-visible { outline: none; background: var(--prune-50); }
.oc-none { padding: 10px; color: var(--muted); font-size: 0.84rem; }
.oc-scope { display: inline-flex; flex: 0 1 280px; align-items: center; gap: 8px; min-width: 200px; color: var(--muted); font-size: 0.8rem; }
.oc-scope select { flex: 1; min-width: 0; min-height: 40px; padding: 6px 10px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 0.88rem; font-weight: 700; }
.oc-scope select:focus-visible { outline: none; box-shadow: var(--ring); }
.oc-seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.oc-seg[hidden] { display: none; }
.oc-seg button { min-height: 32px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font: inherit; font-size: 0.82rem; cursor: pointer; }
.oc-seg button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); font-weight: 700; }
.oc-seg button:focus-visible { outline: none; box-shadow: var(--ring); }
.oc-zoom { display: inline-flex; flex: none; gap: 2px; }
.oc-zoom .btn { min-width: 34px; padding: 0 8px; }

.oc-board { height: clamp(460px, calc(100vh - 290px), 900px); padding: 20px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.oc-board.is-wide { cursor: grab; }
.oc-board.is-panning { cursor: grabbing; user-select: none; }
.oc-board:focus-visible { outline: none; box-shadow: var(--ring); }
.oc-empty { margin: 0; padding: 24px; color: var(--muted); }

.oc-tree, .oc-level, .oc-stack { margin: 0; padding: 0; list-style: none; }
.oc-tree { display: flex; justify-content: center; width: max-content; min-width: 100%; }
.oc-level { position: relative; display: flex; justify-content: center; padding-top: 22px; }
/* Trait qui descend du parent, puis trait horizontal au-dessus de chaque enfant. */
.oc-level::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--line-strong); }
.oc-level > .oc-branch { position: relative; padding: 22px 8px 0; }
.oc-level > .oc-branch::before, .oc-level > .oc-branch::after { content: ""; position: absolute; top: 0; width: 50%; height: 22px; border-top: 2px solid var(--line-strong); }
.oc-level > .oc-branch::before { right: 50%; }
.oc-level > .oc-branch::after { left: 50%; border-left: 2px solid var(--line-strong); }
.oc-level > .oc-branch:first-child::before, .oc-level > .oc-branch:last-child::after { border-top-color: transparent; }
.oc-level > .oc-branch:last-child::after { width: 0; border-left: 0; }
.oc-level > .oc-branch:last-child::before { width: 50%; border-right: 2px solid var(--line-strong); border-top: 2px solid var(--line-strong); border-top-right-radius: 8px; }
.oc-level > .oc-branch:first-child::after { border-top-left-radius: 8px; }
.oc-level > .oc-branch:only-child { padding-top: 0; }
.oc-level > .oc-branch:only-child::before, .oc-level > .oc-branch:only-child::after { display: none; }
.oc-branch { display: flex; flex-direction: column; align-items: center; }
.oc-node { position: relative; display: flex; flex-direction: column; align-items: center; }

.oc-card { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: 216px; min-height: 62px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; text-align: left; }
a.oc-card:hover { border-color: var(--prune); box-shadow: var(--shadow); color: var(--text); }
a.oc-card:focus-visible { outline: none; box-shadow: var(--ring); }
.oc-card.is-me { border-color: var(--prune); box-shadow: inset 0 0 0 1px var(--prune); }
.oc-card.is-selected { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-50), inset 0 0 0 1px var(--orange); }
.oc-card--root { width: auto; min-width: 150px; justify-content: center; background: var(--surface-2); }
.oc-card--unit { min-height: 52px; background: var(--surface-3); border-color: var(--line-strong); }
.oc-avatar { flex: none; width: 36px; height: 36px; font-size: 0.74rem; }
.oc-copy { display: grid; flex: 1; gap: 1px; min-width: 0; }
.oc-copy strong { font-size: 0.84rem; line-height: 1.25; overflow-wrap: anywhere; }
.oc-copy small { color: var(--muted); font-size: 0.72rem; line-height: 1.25; }
.oc-copy .oc-job { display: -webkit-box; overflow: hidden; color: var(--text-2); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.oc-badge { position: absolute; top: -9px; right: 8px; padding: 1px 7px; border-radius: 999px; background: var(--prune); color: #fff; font-size: 0.64rem; font-weight: 700; }

.oc-toggle { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 4px; min-height: 24px; margin-top: -8px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 0.7rem; font-weight: 700; cursor: pointer; }
.oc-toggle:hover { border-color: var(--prune); color: var(--text); }
.oc-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.oc-chevron { font-size: 0.9rem; line-height: 1; }

.oc-aside { position: sticky; left: 0; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.oc-aside summary { margin-bottom: 12px; color: var(--text-2); font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.oc-stack.is-wrap { display: flex; flex-wrap: wrap; max-width: 1120px; }

/* Personnes sans équipe : une colonne, plus lisible qu'une longue ligne. */
.oc-stack { display: grid; gap: 6px; }
.oc-stack.is-double { grid-template-columns: repeat(2, 216px); }
.oc-stack > li { position: relative; }
.oc-stack .oc-card { min-height: 54px; }

@media (max-width: 720px) {
  .oc-board { height: 70vh; padding: 12px; }
  .oc-stack.is-double { grid-template-columns: 216px; }
}
@media print {
  .org-tools { display: none !important; }
  .oc-board { height: auto; overflow: visible; border: 0; }
}
