/* ============================================================
   EDITORIAL SIGNAL — Cockpit Pro
   Design : encre éditoriale élevée (Claude Design / The Black Room)
   ============================================================ */
:root {
  /* encre — surfaces superposées */
  --ink-0: #0a0b0f;
  --ink-1: #0e1016;
  --ink-2: #14161e;
  --ink-3: #191c26;
  --ink-4: #1f2330;
  --line: rgba(255, 255, 255, 0.065);
  --line-2: rgba(255, 255, 255, 0.11);
  --line-3: rgba(255, 255, 255, 0.16);

  /* texte */
  --fg: #e9ebf1;
  --fg-strong: #ffffff;
  --fg-muted: #8a92a6;
  --fg-subtle: #5a6275;
  --fg-faint: #3e4554;

  /* marque indigo/violet */
  --brand: #818cf8;
  --brand-2: #6366f1;
  --brand-3: #4f46e5;
  --purple: #a855f7;
  --brand-grad: linear-gradient(120deg, #6366f1, #a855f7);
  --brand-soft: rgba(99, 102, 241, 0.14);

  /* chaleur du signal */
  --hot: #ff6a4d;
  --hot-2: #ff8a5b;
  --warm: #f5b14b;
  --cool: #7e8aa3;
  --hot-soft: rgba(255, 106, 77, 0.13);
  --warm-soft: rgba(245, 177, 75, 0.13);
  --cool-soft: rgba(126, 138, 163, 0.12);

  /* tendance */
  --up: #34d399;
  --up-soft: rgba(52, 211, 153, 0.13);
  --down: #f87171;
  --down-soft: rgba(248, 113, 113, 0.12);

  /* teintes catégorie */
  --h-indigo: #818cf8;
  --h-pink: #f472b6;
  --h-emerald: #34d399;
  --h-purple: #c084fc;
  --h-amber: #fbbf24;
  --h-blue: #60a5fa;
  --h-red: #fb7185;

  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 18px;
  --r-full: 9999px;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.75);
  --maxw: 1320px;
}

/* On override le bg body global pour cette page */
body {
  font-family: var(--font-sans);
  background: var(--ink-0);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05", "ss01";
}
/* subtle vignette grain on page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(120% 80% at 50% -10%, rgba(99, 102, 241, 0.06), transparent 60%);
}
#cp-root {
  position: relative;
  z-index: 1;
}
::selection {
  background: rgba(129, 140, 248, 0.32);
  color: #fff;
}
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--line-3);
}
*::-webkit-scrollbar-track {
  background: transparent;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ink-0), 0 0 0 4px var(--brand-2);
  border-radius: var(--r-md);
}

/* ============================ TOP NAV ============================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 11, 15, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
/* Rangee unique historique — encore utilisee telle quelle par la landing
   page (index.html, .lp-nav) et la page Discover publique (discover/) qui
   ont chacune un nav minimal (4 et 2 liens) sans probleme de place. Le nav
   authentifie (shell-pro.js / cockpit-pro.js) est passe a 2 rangees
   ci-dessous (.topnav-top / .topnav-links) car son nombre d'onglets a
   grandi au fil du temps. */
.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
/* Ligne 1 (nav authentifie) : logo + recherche + bouton refresh + badge utilisateur. */
.topnav-top {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 20px;
}
/* Ligne 2 : menu de navigation, pleine largeur, sous le logo — separee
   en propre rangee pour ne plus se disputer l'espace horizontal avec les
   controles de la ligne 1 (le nombre d'onglets a grandi au fil du temps). */
.topnav-links {
  border-top: 1px solid var(--line);
}
.topnav-links .nav-links {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 44px;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav-links .nav-links::-webkit-scrollbar {
  display: none;
}
.cp-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg {
  display: block;
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 4px 10px rgba(255, 106, 77, 0.18));
}
.brand-mark .brand-beacon {
  transform-origin: 41.5px 5.5px;
  animation: brand-beacon-pulse 2.6s var(--ease-out) infinite;
}
@keyframes brand-beacon-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-name {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--fg-strong);
  font-family: "Figtree", system-ui, sans-serif;
  white-space: nowrap;
}
.brand-name__accent {
  color: var(--hot);
}
.brand-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--fg-subtle);
  margin-top: 4px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brand-sub__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 6px var(--hot);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 12px;
  height: 100%;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: var(--r-md);
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--fg);
  background: var(--ink-2);
}
.nav-link.active {
  color: var(--fg-strong);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 12px var(--brand);
}
.nav-spacer { flex: 1; }
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 7px 11px;
  width: 240px;
  transition: border-color 0.15s, background 0.15s;
}
.nav-search:focus-within {
  border-color: var(--brand-2);
  background: var(--ink-3);
}
.nav-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--fg);
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}
.nav-search input::placeholder {
  color: var(--fg-subtle);
}
.nav-search kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-subtle);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 6px;
}
.user-meta {
  text-align: right;
  line-height: 1.1;
}
.user-role {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--fg-subtle);
  text-transform: uppercase;
}
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  margin-top: 2px;
}
.cp-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--brand-grad);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
}

/* ============================ ADMIN REFRESH BTN ============================
   Bouton "Mettre a jour la data" visible uniquement pour l'admin.
   Apparait dans le topnav juste avant le user-chip.
*/
.admin-refresh {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 10px;
  margin-right: 8px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.admin-refresh:hover {
  border-color: var(--brand);
  background: var(--ink-3);
  transform: translateY(-1px);
}
.admin-refresh:active {
  transform: translateY(0);
}
.admin-refresh__icon {
  width: 16px;
  height: 16px;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-refresh:hover .admin-refresh__icon {
  animation: adminRefreshSpin 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes adminRefreshSpin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
.admin-refresh__icon svg {
  width: 16px;
  height: 16px;
}
.admin-refresh__label {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 2px;
}
.admin-refresh__title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-strong);
  letter-spacing: -0.005em;
}
.admin-refresh__meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-refresh__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.admin-refresh__dot.is-fresh {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}
.admin-refresh__dot.is-warm {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
}
.admin-refresh__dot.is-stale {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}
.admin-refresh__dot.is-running {
  background: #6fb3ff;
  box-shadow: 0 0 8px rgba(111, 179, 255, 0.6);
  animation: adminRefreshPulse 1.2s ease-in-out infinite;
}
.admin-refresh__dot.is-error {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
  animation: adminRefreshPulse 1s ease-in-out infinite;
}
@keyframes adminRefreshPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Etat actif : icone tourne en continu pendant dispatching/queued/in_progress */
.admin-refresh[data-state="dispatching"] .admin-refresh__icon,
.admin-refresh[data-state="queued"] .admin-refresh__icon,
.admin-refresh[data-state="in_progress"] .admin-refresh__icon {
  animation: adminRefreshSpin 1.4s linear infinite;
}
.admin-refresh[data-state="dispatching"],
.admin-refresh[data-state="queued"],
.admin-refresh[data-state="in_progress"] {
  border-color: rgba(111, 179, 255, 0.4);
  background: rgba(111, 179, 255, 0.06);
  pointer-events: none;
}
.admin-refresh[data-state="completed"] {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.06);
}
.admin-refresh[data-state="error"] {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.06);
}

@media (max-width: 900px) {
  .admin-refresh__label {
    display: none;
  }
  .admin-refresh {
    padding: 7px 10px;
  }
}

/* ============================ ADMIN PAT MODAL ============================
   Modale de configuration du Personal Access Token GitHub.
   Apparait au premier clic du bouton "Mettre a jour" si PAT absent.
*/
.admin-pat-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: adminPatFadeIn 0.18s ease-out;
}

@keyframes adminPatFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.admin-pat-modal__card {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 28px 22px;
  max-width: 520px;
  width: 100%;
  box-shadow:
    0 24px 60px -16px rgba(0, 0, 0, 0.7),
    0 4px 16px -4px rgba(0, 0, 0, 0.4);
  animation: adminPatSlide 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes adminPatSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-pat-modal__title {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
}

.admin-pat-modal__deck {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.admin-pat-modal__help {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  border-left: 3px solid var(--brand);
}

.admin-pat-modal__help ol {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fg);
}

.admin-pat-modal__help ol li + li {
  margin-top: 4px;
}

.admin-pat-modal__help a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(123, 108, 255, 0.4);
}

.admin-pat-modal__help code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 6px;
  background: var(--ink-3);
  border-radius: 3px;
  color: var(--fg-strong);
}

.admin-pat-modal__field {
  display: block;
  margin-bottom: 12px;
}

.admin-pat-modal__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
  margin-bottom: 6px;
}

.admin-pat-modal__input {
  width: 100%;
  padding: 10px 12px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-strong);
  outline: none;
  transition: border-color 0.15s;
}

.admin-pat-modal__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(123, 108, 255, 0.15);
}

.admin-pat-modal__error {
  margin: 0 0 14px;
  min-height: 18px;
  font-size: 12px;
  color: #ef4444;
  visibility: hidden;
}

.admin-pat-modal__error.is-visible {
  visibility: visible;
}

.admin-pat-modal__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-pat-modal__spacer {
  flex: 1;
}

.admin-pat-modal__link {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-muted);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}

.admin-pat-modal__link:hover {
  color: var(--fg);
}

.admin-pat-modal__cancel,
.admin-pat-modal__save,
.admin-pat-modal__danger {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-pat-modal__cancel {
  background: var(--ink-2);
  color: var(--fg);
}

.admin-pat-modal__cancel:hover {
  border-color: var(--line-2);
  background: var(--ink-3);
}

.admin-pat-modal__save {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.admin-pat-modal__save:hover {
  background: color-mix(in srgb, var(--brand) 80%, white);
  transform: translateY(-1px);
}

.admin-pat-modal__danger {
  background: transparent;
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.admin-pat-modal__danger:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* ============================ TODAY BAR ============================ */
.todaybar {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink-1), var(--ink-0));
}
.todaybar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 13px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 0 var(--up);
  animation: live 2s infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.tb-date {
  font-weight: 700;
  color: var(--fg-strong);
  font-size: 14px;
  letter-spacing: 0.01em;
}
.tb-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.tb-sep {
  width: 1px;
  height: 14px;
  background: var(--line-2);
}
.tb-cta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  transition: 0.15s;
  text-decoration: none;
}
.tb-cta:hover {
  background: var(--brand-soft);
  border-color: var(--brand-2);
}

/* ============================ LAYOUT ============================ */
.cp-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 28px 80px;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 26px;
  align-items: start;
}
@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; }
  .rail { order: -1; }
}
@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================ KPI ============================ */
.kpi {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.kpi:hover { border-color: var(--line-2); transform: translateY(-2px); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
}
.kpi-val {
  font-size: 34px;
  font-weight: 800;
  color: var(--fg-strong);
  line-height: 1;
  margin-top: 12px;
  letter-spacing: -0.02em;
}
.kpi-sub {
  font-size: 12px;
  color: var(--fg-subtle);
  margin-top: 7px;
}
.kpi-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-full);
}
.delta.up { color: var(--up); background: var(--up-soft); }
.delta.down { color: var(--down); background: var(--down-soft); }
.delta.flat { color: var(--fg-subtle); background: var(--ink-3); }
.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}
.spark i {
  width: 3px;
  border-radius: 2px;
}

/* ============================ SECTION HEADERS ============================ */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.sec-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
  flex-shrink: 0;
}
.sec-sub {
  font-size: 12px;
  color: var(--fg-subtle);
}
.sec-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}

/* ============================ HERO TOP 3 ============================ */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  padding: 18px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s var(--ease-out), border-color 0.22s, box-shadow 0.22s;
  display: flex;
  flex-direction: column;
  min-height: 230px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 70% at 0% 0%, var(--glow, rgba(255, 106, 77, 0.14)), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}
.hero:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-card);
}
/* Bandeau image publisher (og:image) en tête de carte — full-bleed dans le padding 18px */
.hero-img {
  position: relative;
  margin: -18px -18px 16px;
  height: 118px;
  overflow: hidden;
  background: var(--ink-3);
}
.hero-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, var(--ink-2) 100%);
  pointer-events: none;
}
.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s var(--ease-out);
}
.hero:hover .hero-img img {
  transform: scale(1.04);
}
.hero-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-subtle);
}
.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
}
.hero-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.32;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
  position: relative;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}

/* ============================ SIGNAL GAUGE ============================ */
.gauge {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.gauge .num {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg-strong);
  line-height: 1;
}
.gauge .lab {
  position: absolute;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

/* tier chip */
.tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-full);
}
.tier.fort { color: var(--hot); background: var(--hot-soft); }
.tier.moyen { color: var(--warm); background: var(--warm-soft); }
.tier.faible { color: var(--cool); background: var(--cool-soft); }
.tier-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* category chip */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
}
.cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--cat, #818cf8);
}

/* ============================ SOURCE GLYPHS ============================ */
.sources {
  display: flex;
  align-items: center;
  gap: 5px;
}
.src {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--fg-muted);
  position: relative;
}
.src svg { width: 12px; height: 12px; }
.src-more {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-subtle);
  padding-left: 2px;
}

/* ============================ TOOLBAR ============================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.seg button {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-muted);
  padding: 5px 11px;
  border-radius: 6px;
  transition: 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.seg button:hover { color: var(--fg); }
.seg button.on {
  background: var(--ink-4);
  color: var(--fg-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.chip:hover {
  border-color: var(--line-2);
  color: var(--fg);
}
.chip.on {
  color: var(--fg-strong);
  border-color: transparent;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand-2);
}
.chip .cat-dot { width: 7px; height: 7px; }
.clearfilter {
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ============================ LIST ============================ */
.list { display: flex; flex-direction: column; gap: 8px; }
.tier-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 8px;
}
.tier-divider:first-child { margin-top: 2px; }
.tier-divider .line { flex: 1; height: 1px; background: var(--line); }
.row {
  display: grid;
  grid-template-columns: 34px 52px 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--spine, var(--cool));
  border-radius: var(--r-lg);
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.row:hover {
  background: var(--ink-3);
  transform: translateX(2px);
}
.row.open {
  background: var(--ink-3);
  border-color: var(--line-2);
}
.row-rank {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-subtle);
  font-weight: 500;
  text-align: center;
}
.row-mid { min-width: 0; }
.row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.4;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row:hover .row-title { color: var(--fg-strong); }
.row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
}
.row-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.row-chev {
  color: var(--fg-subtle);
  transition: transform 0.2s, color 0.15s;
}
.row:hover .row-chev { color: var(--fg-muted); }
.row.open .row-chev {
  transform: rotate(180deg);
  color: var(--brand);
}

/* mini bar gauge for rows */
.bar {
  width: 48px;
  height: 5px;
  border-radius: 3px;
  background: var(--ink-4);
  overflow: hidden;
  position: relative;
}
.bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
}
.row-score {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}
.row-score-wrap {
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

/* Trend badge : flèche velocity 6h. */
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--r-full);
  letter-spacing: 0.02em;
}
.trend-badge.up {
  color: var(--up);
  background: var(--up-soft);
}
.trend-badge.down {
  color: var(--down);
  background: var(--down-soft);
}
.trend-badge.flat {
  color: var(--fg-subtle);
  background: var(--ink-3);
}
.trend-badge svg {
  width: 10px;
  height: 10px;
}

/* LLM enrich badges (main_topic + sentiment + ton) */
.llm-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: -2px 0 14px;
}
.llm-topic {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line-2));
  border-radius: var(--r-md);
  padding: 3px 9px;
}
.llm-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
}
.llm-tag.up {
  color: var(--up);
  background: var(--up-soft);
  border-color: color-mix(in srgb, var(--up) 30%, var(--line-2));
}
.llm-tag.down {
  color: var(--down);
  background: var(--down-soft);
  border-color: color-mix(in srgb, var(--down) 30%, var(--line-2));
}
.llm-tag.flat,
.llm-tag.neutral {
  color: var(--fg-muted);
  background: var(--ink-3);
  border-color: var(--line-2);
}
.llm-tag.warn {
  color: var(--warm);
  background: var(--warm-soft);
  border-color: color-mix(in srgb, var(--warm) 30%, var(--line-2));
}
.llm-tag.people {
  color: var(--purple);
  background: color-mix(in srgb, var(--purple) 14%, transparent);
  border-color: color-mix(in srgb, var(--purple) 30%, var(--line-2));
}

/* Cluster badge : N articles fusionnes par embeddings */
.cluster-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cool);
  background: color-mix(in srgb, var(--cool) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--cool) 30%, var(--line-2));
  border-radius: var(--r-full);
  vertical-align: 2px;
}

/* Discover prediction — badge row + bloc detail */
.discover-proba {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: var(--r-full);
  border: 1px solid;
}
.discover-proba.high {
  color: var(--hot);
  background: var(--hot-soft);
  border-color: color-mix(in srgb, var(--hot) 30%, var(--line-2));
}
.discover-proba.medium {
  color: var(--warm);
  background: var(--warm-soft);
  border-color: color-mix(in srgb, var(--warm) 30%, var(--line-2));
}
.discover-proba.low {
  color: var(--fg-subtle);
  background: var(--ink-3);
  border-color: var(--line-2);
}
.discover-proba-lbl {
  font-weight: 500;
  font-size: 9px;
  opacity: 0.75;
  letter-spacing: 0.04em;
}

/* Bloc prediction Discover en detail panel */
.discover-pred-block {
  background: var(--ink-3);
  border: 1px solid var(--line-2);
  border-left: 3px solid;
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.discover-pred-block.high {
  border-left-color: var(--hot);
  background: color-mix(in srgb, var(--hot) 6%, var(--ink-3));
}
.discover-pred-block.medium {
  border-left-color: var(--warm);
  background: color-mix(in srgb, var(--warm) 5%, var(--ink-3));
}
.discover-pred-block.low {
  border-left-color: var(--fg-subtle);
}
.discover-pred-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}
.discover-pred-pct {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.discover-pred-block.high .discover-pred-pct {
  color: var(--hot);
}
.discover-pred-block.medium .discover-pred-pct {
  color: var(--warm);
}
.discover-pred-block.low .discover-pred-pct {
  color: var(--fg-subtle);
}
.discover-pred-lbl {
  font-size: 11.5px;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}
.discover-pred-conf {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--r-full);
  color: var(--fg-subtle);
  background: var(--ink-4);
}
.discover-pred-conf.high {
  color: var(--up);
  background: var(--up-soft);
}
.discover-pred-conf.medium {
  color: var(--warm);
  background: var(--warm-soft);
}
.discover-pred-factors {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.discover-pred-factors li {
  font-size: 11.5px;
  color: var(--fg-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}
.discover-pred-factors li::before {
  content: "·";
  position: absolute;
  left: 4px;
  top: -2px;
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-subtle);
}

/* Liste des titres alternatifs fusionnes (panneau detail) */
.alt-titles {
  margin-top: 14px;
}
.alt-titles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.alt-titles-list li {
  font-size: 12px;
  color: var(--fg-muted);
  padding: 6px 10px;
  background: var(--ink-3);
  border-left: 2px solid var(--cool);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  line-height: 1.4;
}

/* inline detail (expand) */
.detail {
  background: var(--ink-1);
  border: 1px solid var(--line-2);
  border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  margin-top: -4px;
  padding: 18px 20px;
  animation: expand 0.22s var(--ease-out);
  overflow: hidden;
}
@keyframes expand {
  from { transform: translateY(-6px); }
  to { transform: translateY(0); }
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
@media (max-width: 680px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail h6 {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  font-weight: 700;
  margin-bottom: 10px;
}
.detail p.snip {
  font-size: 13.5px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}
.src-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.src-line:last-child { border-bottom: none; }
.src-line-l {
  display: flex;
  align-items: center;
  gap: 9px;
}
.src-line-name { font-size: 12.5px; color: var(--fg); }
.src-line-v {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}
.ent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}
.ent {
  font-size: 12px;
  color: var(--fg);
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 4px 11px;
  transition: 0.15s;
}
.ent:hover {
  border-color: var(--brand-2);
  color: var(--fg-strong);
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.cp-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--r-md);
  transition: 0.15s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.cp-btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(99, 102, 241, 0.8);
}
.cp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px rgba(99, 102, 241, 0.9);
}
.cp-btn-ghost {
  background: var(--ink-3);
  color: var(--fg);
  border: 1px solid var(--line-2);
}
.cp-btn-ghost:hover {
  background: var(--ink-4);
  border-color: var(--line-3);
}

/* ============================ RAIL ============================ */
.rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 78px;
}
.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.panel-icon svg {
  width: 15px;
  height: 15px;
}
.panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
}
.panel-sub {
  font-size: 10.5px;
  color: var(--fg-subtle);
  margin-top: 1px;
  white-space: nowrap;
}
.panel-body { padding: 8px; }

/* rising list */
.rise {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.14s;
}
.rise:hover { background: var(--ink-3); }
.rise-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  width: 14px;
}
.rise-body {
  min-width: 0;
  flex: 1;
}
.rise-name {
  font-size: 13px;
  color: var(--fg);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rise-meta {
  font-size: 11px;
  color: var(--fg-subtle);
  margin-top: 1px;
}

/* ---------- Hot news (breaking / surging / emerging) ---------- */
.hot-panel { border-top: 2px solid var(--hot); }
.hot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.14s;
}
.hot-row:hover { background: var(--ink-3); }
.hot-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.hot-dot[data-tier="urgent"],
.hot-banner-pulse {
  animation: hotpulse 1.4s ease-in-out infinite;
}
@keyframes hotpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
.hot-row-body { min-width: 0; flex: 1; }
.hot-row-name {
  font-size: 13px;
  color: var(--fg);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-row-meta {
  font-size: 11px;
  color: var(--fg-subtle);
  margin-top: 1px;
}
.hot-tag {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Bandeau plein-largeur "breaking" en tête du cockpit */
.hot-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s;
}
.hot-banner:hover { background: var(--ink-3); }
.hot-banner-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.hot-banner-tag {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}
.hot-banner-title {
  font-weight: 700;
  color: var(--fg);
  font-size: 14px;
  flex: 1;
  min-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-banner-meta {
  font-size: 12px;
  color: var(--fg-subtle);
}
.hot-banner-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  margin-left: auto;
  flex: 0 0 auto;
}

/* perf category row */
.perf {
  padding: 10px 9px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.14s;
}
.perf:hover { background: var(--ink-3); }
.perf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.perf-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.perf-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.perf-total {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-strong);
}
.perf-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--ink-4);
  overflow: hidden;
}
.perf-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.perf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.perf-foot small {
  font-size: 10.5px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
}

/* universe cluster */
.uni {
  padding: 11px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.14s;
}
.uni:hover { background: var(--ink-3); }
.uni-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.uni-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.uni-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.uni-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.uni-tag {
  font-size: 10.5px;
  color: var(--fg-muted);
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.uni-foot {
  font-size: 10.5px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  margin-top: 8px;
}

/* indiv topics */
.indiv-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.indiv {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.14s;
}
.indiv:hover { background: var(--ink-3); }
.indiv-bar {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
}
.indiv-name {
  font-size: 12.5px;
  color: var(--fg);
  font-weight: 500;
  flex: 1;
}
.indiv-art {
  font-size: 11px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.indiv-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--fg);
  width: 26px;
  text-align: right;
}

/* ============================ DRAWER ============================ */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.62);
  backdrop-filter: blur(3px);
  z-index: 60;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(540px, 94vw);
  background: var(--ink-1);
  border-left: 1px solid var(--line-2);
  z-index: 61;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-pop);
  animation: slidein 0.3s var(--ease-out);
}
@keyframes slidein {
  from { transform: translateX(46px); }
  to { transform: translateX(0); }
}
.dr-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.dr-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  color: var(--fg-muted);
  background: var(--ink-2);
  border: 1px solid var(--line);
  transition: 0.15s;
  cursor: pointer;
}
.dr-close:hover {
  color: var(--fg-strong);
  background: var(--ink-3);
}
.dr-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}
/* Bandeau image publisher en tête du tiroir détail — full-bleed dans le padding */
.dr-img {
  position: relative;
  margin: -22px -24px 20px;
  height: 200px;
  overflow: hidden;
  background: var(--ink-3);
}
.dr-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--ink-1) 100%);
  pointer-events: none;
}
.dr-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dr-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.34;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
  margin: 14px 0 4px;
}
.dr-section { margin-top: 24px; }
.dr-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  background: var(--ink-1);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.metric {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
}
.metric-v {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--fg-strong);
}
.metric-l {
  font-size: 10.5px;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.fade-up { animation: fadeUp 0.45s var(--ease-out) both; }
@keyframes fadeUp {
  from { transform: translateY(12px); }
  to { transform: translateY(0); }
}

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

/* ───────────────────────────────────────────────────────────────────
   admin-retro : encart "Hit-rate predictions" sur la home (admin)
   Compact, sobre, en bas du flux. Accent sarcelle aligne avec
   project-retro pour signaler que c'est le meme module evaluatif.
   ─────────────────────────────────────────────────────────────────── */

.admin-retro {
  margin: var(--space-2xl, 3rem) 0 var(--space-xl, 2rem);
  padding: var(--space-lg, 1.5rem) var(--space-xl, 2rem);
  background: var(--surface-card, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-left: 3px solid #0aa590;
}

.admin-retro__head {
  margin-bottom: var(--space-md, 1rem);
  padding-bottom: var(--space-sm, 0.75rem);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.admin-retro__eyebrow {
  display: inline-block;
  font-family: var(--font-display, monospace);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #0aa590;
}

.admin-retro__title {
  margin: 6px 0 0;
  font-family: var(--font-display, sans-serif);
  font-size: clamp(1.2rem, 1rem + 0.6vw, 1.5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-primary, #fff);
}

.admin-retro__title em {
  font-style: normal;
  color: #0aa590;
}

.admin-retro__empty {
  padding: var(--space-md, 1rem);
  margin-bottom: var(--space-md, 1rem);
  background: rgba(10, 165, 144, 0.05);
  border: 1px dashed rgba(10, 165, 144, 0.3);
  font-family: var(--font-body, sans-serif);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.admin-retro__empty code {
  padding: 1px 6px;
  font-family: var(--font-display, monospace);
  font-size: 0.78rem;
  background: rgba(10, 165, 144, 0.12);
  border-radius: 2px;
  color: #0aa590;
}

.admin-retro__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm, 0.75rem);
  margin-bottom: var(--space-lg, 1.5rem);
}

.admin-retro__kpi {
  padding: var(--space-sm, 0.75rem) var(--space-md, 1rem);
  background: rgba(10, 165, 144, 0.04);
  border-top: 2px solid rgba(10, 165, 144, 0.4);
}

.admin-retro__kpi-value {
  font-family: var(--font-display, sans-serif);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary, #fff);
}

.admin-retro__kpi-label {
  margin-top: 4px;
  font-family: var(--font-display, monospace);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
}

.admin-retro__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body, sans-serif);
  font-size: 0.85rem;
}

.admin-retro__table th,
.admin-retro__table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.admin-retro__table th {
  font-family: var(--font-display, monospace);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  border-bottom: 1px solid rgba(10, 165, 144, 0.3);
}

.admin-retro__cell-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-retro__cell-slug a {
  color: var(--text-primary, #fff);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted rgba(10, 165, 144, 0.4);
}

.admin-retro__cell-slug a:hover {
  color: #0aa590;
  border-bottom-color: #0aa590;
}

.admin-retro__row.is-empty {
  opacity: 0.55;
}

@media (max-width: 720px) {
  .admin-retro__kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-retro__table {
    font-size: 0.78rem;
  }
}
