:root {
  --bg: #090b10;
  --bg-elev: #0d1117;
  --surface: #121821;
  --surface-soft: #161d27;
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.14);
  --text: #edf2f7;
  --muted: #98a3b3;
  --accent: #2fbf71;
  --accent-bright: #79e3aa;
  --accent-dim: rgba(47, 191, 113, 0.12);
  --accent-glow: rgba(47, 191, 113, 0.18);
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --danger: #f87171;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --topbar-h: 60px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at top left, rgba(47, 191, 113, 0.12), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(88, 101, 242, 0.08), transparent 24%),
    linear-gradient(180deg, #0a0d12 0%, #090b10 38%, #080a0f 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.05), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 24%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

body > * {
  position: relative;
  z-index: 1;
}

/* Barre supérieure : fixe pour tout le monde (invité, membre, admin) */
.topbar.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: block;
  padding: 0;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  max-height: var(--topbar-h);
  background: rgba(9, 11, 16, 0.92);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.topbar.topbar-admin {
  border-bottom-color: rgba(100, 108, 255, 0.22);
  background: linear-gradient(180deg, rgba(14, 16, 24, 0.96), rgba(9, 11, 16, 0.94));
}

/* Espace sous la barre fixe (catalogue, landing, admin) */
body.page-shell {
  padding-top: var(--topbar-h);
}

/* Pages admin : contenu sur toute la largeur utile de l’écran */
body.page-admin .detail-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: min(1720px, 100%);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 2.5vw, 2.25rem);
  padding-right: clamp(1rem, 2.5vw, 2.25rem);
}

.admin-section-head {
  margin-bottom: 1.5rem;
}

.admin-dashboard-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.admin-dashboard-desc {
  margin: 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 100%;
  width: 100%;
  max-width: min(1760px, 100%);
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

.site-header__inner .brand-lockup {
  flex-shrink: 0;
}

.site-header__spacer {
  flex: 1;
  min-width: 0;
}

.site-header__nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 10px,
    #000 calc(100% - 10px),
    transparent
  );
  mask-size: 100% 100%;
  padding: 0.15rem 0;
}

.site-header__nav::-webkit-scrollbar {
  display: none;
}

.site-header__nav .site-header__nav-link {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.45rem 0.72rem;
  font-size: 0.8125rem;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}

@media (min-width: 720px) {
  .site-header__nav {
    overflow-x: visible;
  }
}

.site-header__tools {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.site-header__login {
  padding: 0.5rem 0.95rem;
  font-size: 0.8125rem;
}

.site-header__logout {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
}

@media (max-width: 520px) {
  .site-header__username {
    display: none;
  }

  .site-header__inner {
    gap: 0.35rem;
    padding: 0 max(0.6rem, env(safe-area-inset-right)) 0 max(0.6rem, env(safe-area-inset-left));
  }

  .site-header__nav .site-header__nav-link {
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
  }

  .site-header__login,
  .site-header__logout {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .site-header__tools {
    gap: 0.3rem;
  }
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.admin-dashboard-page .admin-resource-section,
.admin-dashboard-page .admin-catalog-section {
  margin-top: 1.75rem;
}

.admin-dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.admin-dashboard-card:hover {
  border-color: rgba(100, 108, 255, 0.5);
  background: rgba(100, 108, 255, 0.09);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.admin-dashboard-card-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-dashboard-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-dashboard-card-desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}

.admin-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat-card {
  flex: 1;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.admin-stat-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

/* ── Admin Maintenance Panel ── */

.admin-maintenance-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.admin-maintenance-panel.admin-maintenance-active {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.06);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.12), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-maintenance-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.admin-maintenance-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.25s;
}

.admin-maintenance-active .admin-maintenance-icon {
  background: rgba(248, 113, 113, 0.15);
}

.admin-maintenance-icon svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: color 0.25s;
}

.admin-maintenance-active .admin-maintenance-icon svg {
  color: var(--danger);
}

.admin-maintenance-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.admin-maintenance-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.admin-maintenance-desc {
  font-size: 0.76rem;
  color: var(--muted);
}

.admin-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.admin-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-toggle-track {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.25s, border-color 0.25s;
}

.admin-toggle-input:checked + .admin-toggle-track {
  background: rgba(248, 113, 113, 0.35);
  border-color: rgba(248, 113, 113, 0.5);
}

.admin-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.admin-toggle-input:checked + .admin-toggle-track .admin-toggle-thumb {
  transform: translateX(22px);
  background: var(--danger);
}

.admin-toggle-input:focus-visible + .admin-toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .admin-maintenance-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .admin-toggle {
    align-self: flex-end;
  }
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.brand-lockup:hover {
  color: #fff;
}

.brand-lockup:hover .brand-logo {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.brand-accent {
  color: var(--accent-bright);
}

.topbar-trailing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

a.topbar-discord-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  border: 1px solid rgba(88, 101, 242, 0.45);
  background: rgba(88, 101, 242, 0.12);
  color: #a8b0ff;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

a.topbar-discord-link:hover {
  background: rgba(88, 101, 242, 0.24);
  color: #fff;
  border-color: rgba(129, 140, 248, 0.7);
  transform: translateY(-1px);
}

.topbar-discord-icon {
  width: 1.35rem;
  height: 1.35rem;
}

/* Cloche « nouveaux scripts » (membres) */
.topbar-notif-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.topbar-notif-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  border-color: rgba(252, 211, 77, 0.55);
  transform: translateY(-1px);
}

.topbar-notif-bell {
  width: 1.65rem;
  height: 1.65rem;
}

.topbar-notif-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  border-radius: 999px;
  background: #ef4444;
  border: 2px solid rgba(15, 23, 42, 0.95);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.hub-notif-drawer {
  position: fixed;
  inset: 0;
  z-index: 10040;
  pointer-events: none;
}

.hub-notif-drawer:not([hidden]) {
  pointer-events: auto;
}

.hub-notif-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.hub-notif-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100vw - 1.5rem, 22rem);
  max-width: 100%;
  background: var(--surface-elevated, #1a1f2e);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  outline: none;
  animation: hub-notif-slide-in 0.22s ease-out;
}

@keyframes hub-notif-slide-in {
  from {
    transform: translateX(100%);
 opacity: 0.96;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.hub-notif-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1rem 0.65rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-notif-drawer__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hub-notif-drawer__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  margin: -0.2rem -0.2rem 0 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted, #94a3b8);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.hub-notif-drawer__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hub-notif-drawer__hint {
  margin: 0;
  padding: 0.5rem 1.15rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.hub-notif-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 0 0.85rem 1.25rem;
}

.hub-notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hub-notif-item {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-notif-item:last-child {
  border-bottom: none;
}

.hub-notif-item__link {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.85rem 0.35rem;
  color: var(--text, #e2e8f0);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}

.hub-notif-item__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.hub-notif-item__dot {
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.4em;
  border-radius: 50%;
  background: var(--accent-bright, #818cf8);
}

.hub-notif-item__title {
  flex: 1;
  min-width: 0;
}

.hub-notif-empty {
  margin: 1rem 0.35rem;
  font-size: 0.88rem;
}

.hub-notif-drawer__body .hub-notif-error {
  margin: 0.75rem 0.35rem 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
}

body.hub-notif-open {
  overflow: hidden;
}

.userbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.avatar {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.username {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-admin {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(237, 66, 69, 0.2);
  border: 1px solid rgba(237, 66, 69, 0.45);
  color: #ff9a9c;
  flex-shrink: 0;
}

.topbar-reports-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #fff;
  vertical-align: middle;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-lg {
  padding: 0.95rem 1.6rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-discord {
  background: linear-gradient(180deg, #35cb7a 0%, #25a95f 100%);
  color: #07110c;
  border-color: rgba(121, 227, 170, 0.28);
  box-shadow: 0 14px 28px rgba(15, 69, 41, 0.28);
}

.btn-discord:hover {
  background: linear-gradient(180deg, #45d486 0%, #2ab465 100%);
  color: #07110c;
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(15, 69, 41, 0.34);
}

.btn-discord-outline {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-discord-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
  background: linear-gradient(180deg, #2cb968 0%, #1f8e51 100%);
  color: #f7fffb;
  box-shadow: 0 12px 28px rgba(15, 69, 41, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #f0f2f5);
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.flash {
  margin: 1rem 1.35rem 0;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.flash-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.flash-success {
  background: rgba(47, 191, 113, 0.12);
  border-color: rgba(121, 227, 170, 0.35);
  color: #d7f7e3;
}

/* —— Landing page —— */
.page-landing {
  width: 100%;
  max-width: min(1760px, calc(100vw - 1.75rem));
  margin: 0 auto;
  padding: 0 clamp(1rem, 2vw, 2rem) 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: clamp(1.75rem, 3vw, 3rem);
  align-items: stretch;
  padding: 2.25rem 0 2rem;
}

.hero-copy {
  padding: 1.1rem 0;
}

.hero-kicker {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d7f7e3;
  background: rgba(47, 191, 113, 0.1);
  border: 1px solid rgba(121, 227, 170, 0.16);
  margin: 0 0 1rem;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 191, 113, 0.12);
}

.hero h1 {
  margin: 0 0 1rem;
  max-width: min(52ch, 100%);
  font-size: clamp(2.5rem, 5.2vw, 4.35rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.hero .lead {
  max-width: min(52ch, 100%);
  margin: 0 0 1.6rem;
  font-size: 1.08rem;
  color: var(--muted);
}

.hero-caption {
  margin: 1rem 0 0;
  max-width: min(52ch, 100%);
  font-size: 0.92rem;
  color: #c4ccd7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 0.9rem;
  margin: 1.6rem 0 0;
}

.hero-stat {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(13, 17, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.hero-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #f5fbff;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-stat-label {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stats-note {
  max-width: min(52ch, 100%);
  margin: 0.9rem 0 0;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.admin-form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.admin-leak-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-source-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 0.25rem;
}

.admin-source-choice label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text);
}

.admin-source-choice input[type="radio"] {
  accent-color: var(--accent);
}

.admin-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.admin-input,
.admin-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.admin-input:focus,
.admin-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.admin-textarea {
  resize: vertical;
  min-height: 6rem;
}

select.admin-select {
  min-height: 3.1rem;
  padding: 0.8rem 2.85rem 0.8rem 1.05rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  cursor: pointer;
  color: var(--text);
  color-scheme: dark;
  background-color: rgba(18, 24, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2398a3b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.15rem;
}

select.admin-select:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(22, 29, 39, 0.95);
}

select.admin-select:focus {
  border-color: rgba(121, 227, 170, 0.45);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

select.admin-select option {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.65rem 0.85rem;
  background-color: #121821;
  color: #edf2f7;
}

select.admin-select option:first-of-type {
  color: var(--muted);
  font-weight: 500;
}

.admin-progress {
  margin-bottom: 0.5rem;
}

.admin-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.admin-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.admin-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  transition: width 0.2s ease;
}

.admin-page code {
  font-size: 0.88em;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 7.5rem;
  padding: 1.1rem 1rem;
  border-radius: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.admin-dropzone:hover,
.admin-dropzone:focus-within {
  border-color: rgba(121, 227, 170, 0.35);
  background: rgba(47, 191, 113, 0.06);
  color: #c4ccd7;
}

.admin-dropzone.is-dragover {
  border-color: var(--accent-bright);
  background: rgba(47, 191, 113, 0.1);
  color: var(--text);
}

.admin-dropzone.is-filled {
  border-style: solid;
  border-color: rgba(121, 227, 170, 0.28);
  color: var(--accent-bright);
}

.admin-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.admin-dropzone-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.admin-dropzone-hint {
  font-size: 0.82rem;
  max-width: 28ch;
}

.admin-dropzone-filename {
  font-size: 0.8rem;
  color: var(--text);
  word-break: break-all;
  max-width: 100%;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.hero-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.hero-preview-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.hero-brand-mark {
  display: block;
  width: min(320px, 52vw);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: clamp(24px, 6vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 24px 56px rgba(0, 0, 0, 0.5),
    0 10px 28px rgba(47, 191, 113, 0.14);
  background: rgba(10, 14, 18, 0.55);
}

.hero-preview::before {
  content: "";
  position: absolute;
  inset: 2rem 1rem auto auto;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 191, 113, 0.18), transparent 70%);
  filter: blur(12px);
  pointer-events: none;
}

.preview-shell {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: clip;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #14161c;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.22),
    0 28px 56px rgba(0, 0, 0, 0.48),
    0 12px 24px rgba(0, 0, 0, 0.28);
}

/* macOS-style title bar (dark chrome) */
.preview-titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.55rem 0.85rem 0.5rem;
  background: linear-gradient(180deg, #2c2e33 0%, #25262c 55%, #202126 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.preview-traffic {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
  padding-left: 0.15rem;
}

.preview-traffic-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 0.5px solid rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 1px rgba(0, 0, 0, 0.35);
}

.preview-traffic-close {
  background: linear-gradient(180deg, #ff8578 0%, #ff5f57 45%, #e0443e 100%);
}

.preview-traffic-min {
  background: linear-gradient(180deg, #ffe187 0%, #ffbd2e 45%, #dea123 100%);
}

.preview-traffic-zoom {
  background: linear-gradient(180deg, #5ee88a 0%, #28ca42 40%, #1ea836 100%);
}

.preview-title {
  grid-column: 2;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(235, 238, 245, 0.72);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  text-align: center;
  white-space: nowrap;
}

.preview-titlebar-end {
  grid-column: 3;
  justify-self: end;
  width: 3.25rem;
  height: 12px;
}

.preview-body {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  align-items: start;
  background: linear-gradient(180deg, #181a20 0%, #12141a 100%);
}

.preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.85rem 0.75rem 0.95rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.18);
}

.preview-sidebar-label {
  margin: 0 0 0.8rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-nav-item {
  display: block;
  margin-bottom: 0.35rem;
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
  color: #c2ccd8;
  font-size: 0.8rem;
  background: transparent;
}

.preview-nav-item-active {
  background: rgba(47, 191, 113, 0.12);
  color: #f3fff7;
  border: 1px solid rgba(121, 227, 170, 0.16);
}

.preview-main {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.62rem;
  padding: 0.75rem 0.9rem 0.8rem;
  min-height: 0;
}

.preview-search {
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(152, 163, 179, 0.95);
  font-size: 0.84rem;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
}

.preview-meta span,
.landing-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd4de;
  font-size: 0.78rem;
}

.preview-cards {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: auto auto;
  gap: 0.58rem;
  align-content: start;
}

.preview-card {
  padding: 0.78rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 0;
}

.preview-card-featured {
  grid-row: 1 / span 2;
  background:
    linear-gradient(135deg, rgba(47, 191, 113, 0.12), rgba(47, 191, 113, 0.03)),
    rgba(255, 255, 255, 0.03);
}

.preview-card-tag {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
}

.preview-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  line-height: 1.28;
}

.preview-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.landing-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 2rem;
}

.landing-section {
  margin-bottom: 2rem;
}

.section-head {
  max-width: min(900px, 100%);
  margin: 0 0 1.25rem;
}

.section-kicker {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.section-head h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.section-head-compact {
  max-width: min(760px, 100%);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
}

.feature-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.16s;
}

.feature-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.feature-index {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.steps-section {
  margin-bottom: 2.5rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  counter-reset: step;
}

.step {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    rgba(18, 24, 33, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 1.2rem 1.1rem 1.2rem 3.6rem;
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 1.15rem;
  top: 1.15rem;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(47, 191, 113, 0.12);
  border: 1px solid rgba(121, 227, 170, 0.16);
  color: #d8f6e5;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.6rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(12, 16, 22, 0.8);
  border-radius: 22px;
}

.site-footer-brand {
  max-width: min(520px, 100%);
}

.site-footer-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
}

.site-footer a {
  color: #dbe7f1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer-copy {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

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

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .hero .lead,
  .hero-caption,
  .hero-stats-note,
  .section-head {
    max-width: none;
  }

  .preview-body {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .preview-shell {
    max-width: none;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .page-landing {
    padding: 0 1rem 3rem;
  }

  .hero {
    gap: 1.3rem;
    padding: 1.4rem 0 1.6rem;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.25rem, 10vw, 3.1rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .preview-body {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .preview-title {
    white-space: normal;
    line-height: 1.25;
  }

  .preview-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.8rem;
  }

  .preview-main {
    grid-template-rows: auto auto auto;
  }

  .preview-cards {
    grid-template-columns: 1fr;
  }

  .preview-card-featured {
    grid-row: auto;
  }

  .preview-shell {
    min-height: 0;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-strip {
    gap: 1rem;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 400px) {
  .page-landing {
    padding: 0 0.65rem 2rem;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .hero .lead {
    font-size: 0.9rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .hero-stat {
    padding: 0.6rem 0.7rem;
  }
}

.muted {
  color: var(--muted);
}

/* —— Hub (catalogue connecté) —— */
.layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 0.85rem;
  min-height: calc(100vh - var(--topbar-h));
  width: 100%;
  max-width: none;
  margin: 0;
  /* Même retrait horizontal que la topbar, bord gauche écran le plus proche possible */
  padding-left: max(1.4rem, env(safe-area-inset-left));
  padding-right: max(1.4rem, env(safe-area-inset-right));
  box-sizing: border-box;
  align-items: start;
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    gap: 0;
  }

  /* ── Sidebar: collapsible horizontal pill strip on mobile ── */
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: relative;
    top: auto;
    max-height: none;
    margin: 0.5rem 0 0;
    padding: 0.65rem 0.6rem 0.55rem;
    border-radius: 14px;
    overflow: visible;
  }

  .sidebar-inner {
    gap: 0.5rem;
  }

  .sidebar-head {
    margin-bottom: 0.55rem;
    padding: 0 0 0.55rem;
  }

  .sidebar-title {
    font-size: 1rem;
  }

  .sidebar-meta {
    font-size: 0.75rem;
  }

  .sidebar-kicker {
    font-size: 0.65rem;
  }

  .sidebar-title,
  .sidebar-kicker,
  .sidebar-meta,
  .sidebar-chip-row,
  .sidebar-section-head {
    width: 100%;
  }

  .sidebar-section-head {
    margin-bottom: 0.45rem;
  }

  /* Category buttons: horizontal scroll strip on mobile */
  .sidebar .cat-btn {
    display: inline-flex;
    width: auto;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0;
    margin-right: 0.35rem;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 10px;
    gap: 0.45rem;
  }

  .sidebar .cat-btn-icon {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 7px;
    font-size: 0.68rem;
  }

  .sidebar .cat-btn-badge {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.65rem;
  }

  .sidebar .cat-btn:hover {
    transform: none;
  }

  /* ── Hub main area ── */
  .hub {
    padding: 0.75rem 0.25rem 2rem;
  }

  .hub-compact-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .hub-compact-greeting {
    text-align: center;
    font-size: 0.95rem;
  }

  .hub-compact-bar .search-wrap {
    min-height: 46px;
    border-radius: 12px;
    padding: 0 0.7rem;
  }

  .hub-compact-bar .search-input {
    padding: 0.7rem 0.2rem;
    font-size: 0.9rem;
  }

  .hub-compact-bar .search-icon {
    width: 1.4rem;
    height: 1.4rem;
  }

  .hub-sort-wrap {
    width: 100%;
    justify-content: flex-start;
  }

  .hub-compact-bar .hub-sort-select {
    flex: 1;
    min-width: 0;
    max-width: none;
    min-height: 42px;
    padding: 0.45rem 2.2rem 0.45rem 0.75rem;
    font-size: 0.82rem;
  }

  .results-meta {
    font-size: 0.75rem;
    text-align: center;
  }

  /* ── Card grid: 2 columns on tablets, responsive on phones ── */
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 0.65rem;
  }

  .card {
    border-radius: 12px;
  }

  .card-body {
    padding: 0.6rem 0.65rem 0.5rem;
  }

  .card-title {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
  }

  .card-desc {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
  }

  .card-badge {
    font-size: 0.56rem;
    padding: 0.18rem 0.45rem;
    border-radius: 6px;
    top: 0.35rem;
    left: 0.35rem;
  }

  .card-fav {
    width: 2rem;
    height: 2rem;
    top: 0.3rem;
    right: 0.3rem;
  }

  .card-fav__icon {
    width: 1.3rem;
    height: 1.3rem;
  }

  .card-dl-btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .card-dl-icon {
    width: 0.95rem;
    height: 0.95rem;
  }

  /* Disable hover lift on touch */
  .card:hover {
    transform: none;
    box-shadow: none;
  }

  .card:hover .card-img img {
    transform: none;
  }

  .card:hover .card-img::after {
    opacity: 0;
  }

  .card:active {
    transform: scale(0.98);
    transition-duration: 0.1s;
  }
}

/* ── Extra-small phones (≤ 480px) ── */
@media (max-width: 480px) {
  .layout {
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
  }

  .hub {
    padding: 0.5rem 0 1.5rem;
  }

  .hub-compact-greeting {
    font-size: 0.88rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .card-body {
    padding: 0.5rem 0.55rem 0.4rem;
  }

  .card-title {
    font-size: 0.8rem;
  }

  .card-desc {
    font-size: 0.7rem;
    -webkit-line-clamp: 1;
  }

  .card-dl-btn {
    padding: 0.45rem 0.5rem;
    font-size: 0.7rem;
  }

  .sidebar {
    padding: 0.5rem 0.45rem;
    border-radius: 10px;
  }

  .sidebar-head {
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .sidebar-title {
    font-size: 0.9rem;
  }

  .sidebar .cat-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
  }

  .search-reset {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* ── Very small phones (≤ 360px) ── */
@media (max-width: 360px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .card-img {
    aspect-ratio: 16 / 8;
  }

  .hub-compact-bar .search-wrap {
    min-height: 42px;
  }

  .hub-compact-bar .search-input {
    font-size: 0.85rem;
  }
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 1rem);
  align-self: start;
  /* Permet de faire défiler les catégories quand la liste dépasse la fenêtre */
  max-height: calc(100vh - var(--topbar-h) - 2.5rem);
  max-height: calc(100dvh - var(--topbar-h) - 2.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  background: linear-gradient(180deg, rgba(10, 16, 13, 0.95), rgba(10, 14, 12, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-right: 1px solid var(--border);
  border-radius: 18px;
  margin: 1.2rem 0 1.2rem 0;
  padding: 1rem 0.95rem 1.1rem 0.85rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  margin-bottom: 1.1rem;
  padding: 0.2rem 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-bright);
}

.sidebar-title {
  font-size: 1.2rem;
  text-transform: none;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.45rem;
  font-weight: 800;
}

.sidebar-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.sidebar-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.sidebar-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

a.sidebar-chip-admin {
  text-decoration: none;
  color: inherit;
  border-color: rgba(237, 66, 69, 0.35);
  background: rgba(237, 66, 69, 0.08);
}

a.sidebar-chip-admin:hover {
  border-color: rgba(237, 66, 69, 0.5);
  background: rgba(237, 66, 69, 0.12);
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}

.sidebar-section-title {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.sidebar-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--accent-bright);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.16);
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.85rem;
  margin-bottom: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.14s, box-shadow 0.16s;
}

.cat-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.cat-btn-active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.07));
  border-color: rgba(52, 211, 153, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cat-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--accent-bright);
  font-size: 0.78rem;
  font-weight: 700;
}

.cat-btn-label {
  flex: 1;
  min-width: 0;
}

.cat-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.hub {
  padding: 1.2rem 0.85rem 2.8rem 0.35rem;
  max-width: none;
}

/* Compact greeting + search bar */
.hub-compact-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.hub-compact-greeting {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.hub-compact-bar .search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: none;
  min-height: 48px;
}

.hub-compact-bar .results-meta {
  flex-shrink: 0;
}

.hub-sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.hub-sort-label {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.hub-compact-bar .hub-sort-select {
  min-width: 10.5rem;
  min-height: 48px;
  padding: 0.55rem 2.5rem 0.55rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 860px;
  min-height: 60px;
  padding: 0 0.9rem 0 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    rgba(18, 24, 21, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 14px 32px rgba(0, 0, 0, 0.2);
}

.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 0.35rem;
  color: var(--accent-bright);
  font-size: 1rem;
}

.search-input {
  width: 100%;
  max-width: none;
  padding: 0.95rem 0.25rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  box-shadow: none;
}

.search-input::placeholder {
  color: rgba(138, 169, 154, 0.82);
}

.search-input:focus {
  outline: none;
}

.search-wrap:focus-within {
  border-color: rgba(52, 211, 153, 0.22);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08), 0 14px 32px rgba(0, 0, 0, 0.2);
}

.search-reset {
  margin-left: 0.65rem;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.search-reset:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.results-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: border-color 0.25s, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}

.card:hover {
  border-color: rgba(47, 191, 113, 0.25);
  transform: translateY(-5px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(47, 191, 113, 0.12),
    0 0 40px rgba(47, 191, 113, 0.05);
}

.card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  text-decoration: none;
  color: inherit;
}

.card-link:hover .card-title {
  color: var(--accent-bright);
}

.card-fav {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 4;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  line-height: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease-out;
  font-family: inherit;
}

.card-fav__icon {
  width: 1.6rem;
  height: 1.6rem;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.card-fav__star-path {
  fill: rgba(0, 0, 0, 0.4);
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.card-fav:hover {
  transform: scale(1.15);
}

.card-fav:hover .card-fav__star-path {
  fill: rgba(252, 211, 77, 0.25);
  stroke: #fcd34d;
}

.card-fav[aria-pressed="true"] .card-fav__star-path {
  fill: #fbbf24;
  stroke: #fbbf24;
  stroke-width: 1.2;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
}

.card-fav[aria-pressed="true"]:hover {
  transform: scale(1.15);
}

.card-fav[aria-pressed="true"]:hover .card-fav__star-path {
  fill: #fcd34d;
  stroke: #fcd34d;
  filter: drop-shadow(0 0 8px rgba(252, 211, 77, 0.8));
}

.card-fav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.cat-btn-favorites.cat-btn-active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.detail-fav-row {
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.fav-detail-btn[aria-pressed="true"] {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.card-img {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0a0f14 0%, #060a0e 100%);
  overflow: hidden;
}

.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.25s;
}

.card:hover .card-img::after {
  opacity: 1;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Category badge on card image */
.card-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 3;
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: #fff;
  background: rgba(88, 101, 242, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-badge-base { background: rgba(59, 130, 246, 0.88); }
.card-badge-scripts { background: rgba(34, 197, 94, 0.88); }
.card-badge-mapping { background: rgba(245, 158, 11, 0.88); }
.card-badge-armes { background: rgba(239, 68, 68, 0.88); }
.card-badge-vehicules { background: rgba(168, 85, 247, 0.88); }
.card-badge-vetement { background: rgba(236, 72, 153, 0.88); }
.card-badge-animations { background: rgba(234, 179, 8, 0.88); color: #1a1a1a; }
.card-badge-divers { background: rgba(107, 114, 128, 0.88); }

.card-body {
  padding: 0.8rem 0.9rem 0.7rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  line-height: 1.3;
  transition: color 0.2s;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Download button on card */
.card-dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  margin: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(180deg, rgba(47, 191, 113, 0.12) 0%, rgba(47, 191, 113, 0.06) 100%);
  color: var(--accent-bright);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.card-dl-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(47, 191, 113, 0.2) 0%, rgba(47, 191, 113, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.card-dl-btn:hover::before {
  opacity: 1;
}

.card-dl-btn:hover {
  color: #fff;
  box-shadow: inset 0 -2px 12px rgba(47, 191, 113, 0.1);
}

.card-dl-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.card-dl-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  transition: transform 0.2s;
}

.card-dl-btn:hover .card-dl-icon {
  transform: translateY(2px);
}

.card-dl-btn-muted {
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.card-dl-btn-muted::before {
  background: rgba(255, 255, 255, 0.04);
}

.card-dl-btn-muted:hover {
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.detail-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.35rem 1.35rem 3rem;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.back-link:hover {
  color: var(--accent-bright);
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.detail-preview img {
  width: 100%;
  display: block;
  background: #050a08;
}

.detail-body {
  padding: 1.35rem 1.5rem 1.75rem;
}

.detail-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.detail-body h1 {
  margin: 0 0 0.85rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.detail-desc {
  color: var(--muted);
  margin: 0 0 1.1rem;
  font-size: 1rem;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-list li {
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  background: var(--accent-dim);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 6px;
  color: var(--accent-bright);
}

/* Toasts (nouvelles ressources) */
.toast-stack {
  position: fixed;
  bottom: 1.1rem;
  right: 1.1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(17, 28, 23, 0.96);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(34, 197, 94, 0.12);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text);
  opacity: 0;
  transform: translateX(120%);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(52, 211, 153, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--accent-bright);
  font-weight: 800;
}

.toast-msg {
  flex: 1;
  min-width: 0;
}

.toast-msg strong {
  color: var(--accent-bright);
  font-weight: 700;
}

.toast-close {
  flex-shrink: 0;
  margin: -0.2rem -0.35rem -0.2rem 0;
  padding: 0.2rem 0.45rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}

.toast-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 480px) {
  .toast-stack {
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
  }

  .toast {
    transform: translateY(120%);
  }

  .toast.toast-show {
    transform: translateY(0);
  }
}

/* Leak preview modal (hub) */
.leak-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  animation: leak-modal-fade-in 0.2s ease-out;
}

@keyframes leak-modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.leak-modal[hidden] {
  display: none;
}

.leak-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, 0.88);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  cursor: pointer;
}

.leak-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(92vh, 900px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(18, 24, 33, 0.98) 0%, rgba(13, 17, 23, 0.99) 100%);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(47, 191, 113, 0.06),
    0 0 120px rgba(47, 191, 113, 0.04);
  animation: leak-modal-dialog-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes leak-modal-dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.leak-modal-dialog::-webkit-scrollbar {
  width: 8px;
}

.leak-modal-dialog::-webkit-scrollbar-track {
  margin: 14px 0;
  background: transparent;
}

.leak-modal-dialog::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.leak-modal-dialog::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
  background-clip: padding-box;
}

.leak-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.leak-modal-close:hover {
  color: #fff;
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.4);
  transform: rotate(90deg);
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.15);
}

.leak-modal-close:active {
  transform: rotate(90deg) scale(0.9);
}

.leak-modal-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  padding-right: 3rem;
}

.leak-modal-cat {
  margin: 0 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
  opacity: 0.85;
}

.leak-modal-video-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  aspect-ratio: 16 / 9;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  margin-top: 1.25rem;
}

.leak-modal-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.leak-modal-preview-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--surface-soft);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  margin-top: 1.25rem;
}

.leak-modal-preview-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.leak-modal-msg {
  margin: 1rem 1.75rem 0;
}

/* Modal inner content zone (below media) */
.leak-modal-dialog > .leak-modal-title,
.leak-modal-dialog > .leak-modal-cat,
.leak-modal-dialog > .leak-modal-msg,
.leak-modal-dialog > .leak-modal-actions,
.leak-modal-dialog > .leak-modal-report-panel,
.leak-modal-dialog > .leak-modal-admin {
  margin-left: 1.75rem;
  margin-right: 1.75rem;
}

.leak-modal-dialog > .leak-modal-title {
  padding-top: 1.75rem;
}

.leak-modal-dialog > .leak-modal-video-wrap,
.leak-modal-dialog > .leak-modal-preview-wrap {
  margin-left: 0;
  margin-right: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  box-shadow: none;
}

.leak-modal-admin {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.leak-modal-admin-kicker {
  margin: 0 0 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.leak-modal-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.leak-modal-edit-wrap {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.leak-modal-edit-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.leak-modal-edit-form {
  gap: 0.75rem;
}

.leak-modal-edit-form .admin-textarea {
  min-height: 4.5rem;
}

.leak-modal-edit-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.leak-modal-admin-delete {
  color: #f0a4a4;
  border-color: rgba(248, 113, 113, 0.2);
}

.leak-modal-admin-delete:hover {
  color: #ffc9c9;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
}

.leak-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.35rem;
  padding-bottom: 1.75rem;
}

.leak-modal-actions .btn-primary {
  padding: 0.65rem 1.3rem;
  font-size: 0.88rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 69, 41, 0.35);
}

.leak-modal-actions .btn-ghost {
  padding: 0.6rem 1.1rem;
  font-size: 0.84rem;
  border-radius: 12px;
}

.leak-modal-report-toggle {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
  transition: opacity 0.15s;
}

.leak-modal-report-toggle:hover {
  opacity: 1;
}

.leak-modal-report-panel {
  margin-top: 1rem;
  margin-bottom: 1.75rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.leak-modal-report-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.leak-modal-report-hint {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}

.leak-modal-report-textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  resize: vertical;
  min-height: 4.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.leak-modal-report-textarea:focus {
  outline: none;
  border-color: rgba(100, 108, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(100, 108, 255, 0.1);
}

.leak-modal-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .leak-modal {
    padding: 0;
    align-items: flex-end;
  }

  .leak-modal-dialog {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    animation-name: leak-modal-dialog-in-mobile;
  }

  @keyframes leak-modal-dialog-in-mobile {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .leak-modal-dialog > .leak-modal-title,
  .leak-modal-dialog > .leak-modal-cat,
  .leak-modal-dialog > .leak-modal-msg,
  .leak-modal-dialog > .leak-modal-actions,
  .leak-modal-dialog > .leak-modal-report-panel,
  .leak-modal-dialog > .leak-modal-admin {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .leak-modal-dialog > .leak-modal-title {
    padding-top: 1.25rem;
  }

  .leak-modal-title {
    font-size: 1.15rem;
    padding-right: 2.8rem;
  }

  .leak-modal-close {
    top: 0.65rem;
    right: 0.65rem;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.1rem;
  }

  .leak-modal-actions {
    flex-direction: column;
    gap: 0.45rem;
  }

  .leak-modal-actions .btn,
  .leak-modal-actions .btn-ghost {
    width: 100%;
    justify-content: center;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }

  .leak-modal-report-panel {
    padding: 0.9rem 1rem;
    border-radius: 12px;
  }

  .leak-modal-report-textarea {
    font-size: 0.85rem;
    min-height: 3.5rem;
  }

  .leak-modal-msg {
    font-size: 0.85rem;
  }

  .leak-modal-cat {
    font-size: 0.72rem;
  }
}

.card-open-leak {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.card-open-leak:hover .card-title {
  color: var(--accent-bright);
}

.card-open-leak:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

body.leak-modal-open {
  overflow: hidden;
}


/* ── Scraper admin section ── */

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted, #8e99a4);
  cursor: pointer;
}

.admin-checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent, #646cff);
  cursor: pointer;
}

.scraper-progress {
  margin-top: 1rem;
}

.scraper-progress-bar-anim {
  animation: scraper-indeterminate 1.8s ease-in-out infinite;
  width: 40% !important;
}

@keyframes scraper-indeterminate {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(150%); }
  100% { transform: translateX(-100%); }
}

.scraper-results {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.scraper-results h4 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary, #f0f2f5);
}

.scraper-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.scraper-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.scraper-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent-bright, #a5b4fc);
}

.scraper-stat-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #8e99a4);
}

.scraper-log {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-muted, #8e99a4);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

/* —— Scraper dashboard (staging + run) —— */

.scraper-dashboard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.scraper-dashboard-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.scraper-dashboard-lead {
  margin: 0;
  max-width: 48rem;
  line-height: 1.45;
  font-size: 0.9rem;
}

.scraper-dashboard-badges {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.scraper-dash-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  background: rgba(100, 108, 255, 0.12);
  border: 1px solid rgba(121, 127, 255, 0.35);
  min-width: 6.5rem;
}

.scraper-dash-badge-val {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent-bright, #a5b4fc);
  line-height: 1;
}

.scraper-dash-badge-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted, #8e99a4);
}

.scraper-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 960px) {
  .scraper-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.scraper-run-card,
.scraper-queue-card {
  margin: 0;
  height: 100%;
}

.scraper-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.scraper-card-desc {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.scraper-queue-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scraper-select-all-wrap {
  margin: 0;
}

.scraper-staging-bulk-select {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.scraper-bulk-select-btn {
  font-size: 0.78rem !important;
  padding: 0.35rem 0.65rem !important;
  font-weight: 600 !important;
}

.scraper-queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.scraper-btn-danger {
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

.scraper-btn-danger:hover {
  background: rgba(248, 113, 113, 0.12) !important;
}

.scraper-staging-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.scraper-staging-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.scraper-staging-table th,
.scraper-staging-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.scraper-staging-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #8e99a4);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.25);
}

.scraper-staging-table tbody tr:last-child td {
  border-bottom: none;
}

.scraper-staging-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.staging-col-check {
  width: 2.5rem;
  text-align: center;
}

.staging-col-title {
  font-weight: 600;
  max-width: 14rem;
  word-break: break-word;
}

.staging-id-code {
  font-size: 0.78rem;
  word-break: break-all;
}

.staging-dl-tag {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(100, 108, 255, 0.15);
  color: var(--accent-bright, #a5b4fc);
}

.staging-col-date {
  font-size: 0.8rem;
  white-space: nowrap;
}

.staging-empty-cell {
  text-align: center;
  padding: 2rem 1rem !important;
}

.scraper-dashboard .staging-data-row {
  cursor: pointer;
}

.scraper-dashboard .staging-data-row:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: -2px;
}

.scraper-dashboard .staging-col-check,
.scraper-dashboard .staging-col-check * {
  cursor: default;
}

/* Prévisualisation file d’attente */
.staging-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.staging-preview-modal[hidden] {
  display: none !important;
}

.staging-preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.staging-preview-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: min(90vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18);
  padding: 1.35rem 1.5rem 1.5rem;
}

.staging-preview-modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: #f4f4f5;
  color: #52525b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.staging-preview-modal__close:hover {
  background: #e4e4e7;
  color: #18181b;
}

.staging-preview-modal__title {
  margin: 0 2.5rem 0.5rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #18181b;
  letter-spacing: -0.02em;
}

.staging-preview-modal__meta {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: #71717a;
}

.staging-preview-modal__yt-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #71717a;
}

.staging-preview-modal__video {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
}

.staging-preview-modal__yt-thumb-wrap {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #18181b;
  outline: none;
}

.staging-preview-modal__yt-thumb-wrap:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 3px;
}

.staging-preview-modal__yt-thumb-wrap img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  vertical-align: middle;
}

.staging-preview-modal__yt-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.35);
}

.staging-preview-modal__yt-play::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 1.1rem 0 1.1rem 1.85rem;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
  margin-left: 0.35rem;
}

.staging-preview-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body.staging-preview-modal-open {
  overflow: hidden;
}

/* —— Admin : liste des leaks (modifier / supprimer) —— */

.admin-leaks-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.admin-leaks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-leaks-table th,
.admin-leaks-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-leaks-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.admin-leaks-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-leaks-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-leaks-title {
  font-weight: 600;
  max-width: 18rem;
}

.admin-leaks-id {
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-leaks-actions-col {
  width: 1%;
  white-space: nowrap;
}

.admin-leaks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.admin-report-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.admin-report-badge-pending {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

.admin-report-badge-ok {
  background: rgba(47, 191, 113, 0.12);
  border: 1px solid rgba(121, 227, 170, 0.35);
  color: #a7f3d0;
}

.admin-report-reason {
  font-size: 0.85rem;
  line-height: 1.45;
  max-width: 22rem;
}

.admin-report-open-leak {
  margin-left: 0.35rem;
  font-size: 0.8rem;
}

.admin-edit-panel {
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-edit-panel-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Blocage menu contextuel / raccourcis outils développeur (couche UX uniquement) */
.ll-devtools-guard {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  font-family: var(--font);
}

.ll-devtools-guard__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ll-devtools-guard__panel {
  position: relative;
  z-index: 1;
  max-width: 26rem;
  width: 100%;
  padding: 1.5rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.ll-devtools-guard__title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.ll-devtools-guard__text {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.ll-devtools-guard__btn {
  width: 100%;
  justify-content: center;
}

/* Page /verify — instructions vérification Discord */
.verify-flow {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1rem, 3vw, 1.5rem) 3rem;
}

.verify-flow__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.35rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-soft);
}

.verify-flow__badge {
  margin-bottom: 0.75rem;
}

.verify-flow__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.verify-flow__lead {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 1rem;
}

.verify-flow__lead strong {
  color: var(--text);
  font-weight: 600;
}

.verify-flow__steps {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
  color: var(--muted);
}

.verify-flow__steps li + li {
  margin-top: 0.55rem;
}

.verify-flow__steps strong {
  color: var(--text);
  font-weight: 600;
}

.verify-flow__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.35rem;
}

.verify-flow__notes {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1.15rem;
}

.verify-flow__notes p {
  margin: 0 0 0.75rem;
}

.verify-flow__notes p:last-child {
  margin-bottom: 0;
}

.verify-flow__notes strong {
  color: var(--text);
  font-weight: 600;
}

.verify-flow__foot {
  margin: 1.15rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  opacity: 0.95;
}

/* ── Admin Analytics ── */

.admin-analytics-page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.analytics-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.analytics-stat-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.analytics-stat-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.analytics-stat-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-dim);
}

.analytics-stat-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.analytics-stat-live .analytics-stat-icon {
  background: rgba(47, 191, 113, 0.15);
}

.analytics-stat-live .analytics-stat-icon svg {
  color: var(--accent-bright);
}

.analytics-stat-users .analytics-stat-icon {
  background: rgba(88, 101, 242, 0.14);
}

.analytics-stat-users .analytics-stat-icon svg {
  color: #8b95f7;
}

.analytics-stat-downloads .analytics-stat-icon {
  background: rgba(251, 191, 36, 0.13);
}

.analytics-stat-downloads .analytics-stat-icon svg {
  color: #fbbf24;
}

.analytics-stat-views .analytics-stat-icon {
  background: rgba(236, 72, 153, 0.13);
}

.analytics-stat-views .analytics-stat-icon svg {
  color: #f472b6;
}

.analytics-stat-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.analytics-stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.analytics-stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.analytics-stat-hint {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 0.15rem;
}

.analytics-stat-hint strong {
  color: var(--text);
  font-weight: 700;
}

.analytics-live-dot {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(47, 191, 113, 0.5);
  animation: analytics-pulse 2s ease-in-out infinite;
}

@keyframes analytics-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.analytics-charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.analytics-charts-row:has(.analytics-chart-card-half) {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
}

.analytics-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

.analytics-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.analytics-chart-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.analytics-chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.analytics-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.analytics-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.analytics-legend-views .analytics-legend-dot {
  background: #2fbf71;
}

.analytics-legend-dl .analytics-legend-dot {
  background: #5865f2;
}

.analytics-chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}

.analytics-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.analytics-chart-wrap-sm {
  height: 200px;
}

@media (max-width: 640px) {
  .analytics-stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 1rem;
  }

  .analytics-stat-value {
    font-size: 1.5rem;
  }

  .analytics-chart-wrap {
    height: 200px;
  }

  .analytics-chart-wrap-sm {
    height: 160px;
  }
}

@media (max-width: 400px) {
  .analytics-stats-row {
    grid-template-columns: 1fr;
  }
}

/* Clickable stat cards */

.analytics-stat-clickable {
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.analytics-stat-clickable:hover {
  border-color: rgba(100, 108, 255, 0.45);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.analytics-stat-clickable[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim), 0 6px 24px rgba(0, 0, 0, 0.22);
}

/* Visitor / user drawer */

.analytics-drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  animation: analytics-drawer-in 0.2s ease-out;
  overflow: hidden;
}

@keyframes analytics-drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.analytics-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.analytics-drawer-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.analytics-drawer-count {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

.analytics-drawer-close {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.analytics-drawer-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.analytics-drawer-body {
  max-height: 420px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.analytics-drawer-loading,
.analytics-drawer-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 1.5rem 1rem;
  margin: 0;
}

/* Visitor list rows */

.analytics-list-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1.5rem;
  transition: background 0.12s;
}

.analytics-list-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.analytics-list-row + .analytics-list-row {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.analytics-list-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.analytics-list-avatar-anon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.analytics-list-avatar-anon svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.analytics-list-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.analytics-list-info-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.analytics-list-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-list-name-anon {
  color: var(--muted);
  font-weight: 600;
  font-style: italic;
}

.analytics-list-uname {
  font-size: 0.76rem;
  color: var(--muted);
  opacity: 0.7;
}

.analytics-list-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.analytics-list-badge-auth {
  background: rgba(47, 191, 113, 0.14);
  color: var(--accent-bright);
}

.analytics-list-badge-guest {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.analytics-list-info-bottom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.8;
}

.analytics-list-page {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-list-ip {
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  font-size: 0.72rem;
  opacity: 0.7;
}

.analytics-list-ago {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .analytics-list-row {
    padding: 0.55rem 1rem;
  }

  .analytics-drawer-head {
    padding: 0.85rem 1rem;
  }

  .analytics-list-info-bottom {
    gap: 0.4rem;
  }

  .analytics-list-page {
    max-width: 120px;
  }
}
