* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  color: #1d2939;
  background: #f3f6fb;
}

header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.header-title {
  flex: 1;
}

header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.7rem);
  color: #0f172a;
}

header p {
  margin: 0.75rem 0 0;
  color: #475569;
  max-width: 780px;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.3rem;
}

.auth-button {
  padding: 0.75rem 1.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.auth-button:hover {
  background: #1d4ed8;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-name {
  font-weight: 600;
  color: #0f172a;
}

.auth-link-button,
.logout-button {
  padding: 0.5rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.3s ease;
}

.auth-link-button:hover,
.logout-button:hover {
  background: #e2e8f0;
}

.guest-login-btn,
.btn-primary.guest-login-btn {
  background: #f70059;
  color: #fff;
  border-color: #f70059;
}

.guest-login-btn:hover,
.btn-primary.guest-login-btn:hover {
  background: #d4004e;
  border-color: #d4004e;
}

.profile-form {
  display: grid;
  gap: 1rem;
}

.profile-form input {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font: inherit;
}

.profile-bio-textarea {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font: inherit;
  resize: vertical;
  min-height: 6rem;
  box-sizing: border-box;
}

.amendment-list-user {
  display: grid;
  gap: 1rem;
}

.amendment-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
}

.amendment-meta,
.amendment-target {
  margin: 0.5rem 0;
  color: #475569;
}

.current-version-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  padding: 1rem;
  margin: 1rem 0;
}

.current-version-box h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.current-version-meta {
  margin: 0 0 0.75rem;
  color: #334155;
  font-weight: 600;
}

/* ── Système de commentaires threadés ─────────────────────────────────────── */
.comment-section {
  margin-top: 1.5rem;
}

.comment-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.comment-section-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.01em;
}

.comment-sort-select {
  padding: 0.25rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fff;
  color: #374151;
  cursor: pointer;
}

/* Comment tree nodes */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comment-node {
  padding: 0.65rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.4rem;
  background: #fff;
}

/* Décalage uniforme par niveau via padding sur le conteneur de réponses */
.comment-node.depth-1 { border-left-color: #e2e8f0; }
.comment-node.depth-2 { border-left-color: #bfdbfe; }
.comment-node.depth-3 { border-left-color: #93c5fd; }
.comment-node.depth-4 { border-left-color: #60a5fa; }
.comment-node.depth-5 { border-left-color: #3b82f6; }
.comment-node.depth-6 { border-left-color: #1d4ed8; }

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.comment-author {
  font-weight: 700;
  color: #1e293b;
}

.author-link {
  cursor: pointer;
  color: inherit;
  font-weight: 600;
  border-bottom: 1px dotted currentColor;
  transition: color 0.15s;
}
.author-link:hover { color: #2563eb; }

.comment-date {
  color: #94a3b8;
  font-size: 0.78rem;
}

.comment-body {
  margin: 0 0 0.5rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #1e293b;
}

.comment-body.comment-deleted {
  color: #94a3b8;
  font-style: italic;
}

/* Vote + action bar */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.comment-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #f8fafc;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: #374151;
}

.comment-vote-btn.up   { background: #dcfce7; border-color: #86efac; color: #15803d; }
.comment-vote-btn.down { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.comment-vote-btn.up:hover   { background: #bbf7d0; border-color: #4ade80; }
.comment-vote-btn.down:hover { background: #fecaca; border-color: #f87171; }
.comment-vote-btn.up.active   { background: #16a34a; border-color: #15803d; color: #fff; font-weight: 700; }
.comment-vote-btn.down.active { background: #dc2626; border-color: #b91c1c; color: #fff; font-weight: 700; }

.comment-score {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  min-width: 1.5rem;
  text-align: center;
}

.comment-score.positive { color: #15803d; }
.comment-score.negative { color: #b91c1c; }

.comment-action-btn {
  padding: 0.15rem 0.5rem;
  border: none;
  background: none;
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.comment-action-btn:hover { background: #f1f5f9; color: #1e293b; }
.comment-action-btn.danger { color: #b91c1c; }
.comment-action-btn.danger:hover { background: #fee2e2; }

/* Replies — le décalage est ici, uniforme à chaque niveau */
.comment-replies {
  margin-top: 0.15rem;
  padding-left: 1.25rem;
  border-left: 1px solid #f1f5f9;
}


/* Reply form inline */
.comment-reply-form {
  margin: 0.5rem 0 0.25rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Root comment form */
.comment-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  resize: vertical;
  min-height: 100px;
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.comment-form-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.comment-form button {
  margin-top: 0;
}

/* Pagination / states */
.comment-pager {
  margin-top: 0.5rem;
  text-align: center;
}

.comment-load-more {
  width: 100%;
  margin-top: 0.25rem;
}

.comment-loading,
.comment-empty,
.comment-error {
  padding: 0.75rem 0;
  color: #64748b;
  font-size: 0.9rem;
  font-style: italic;
}

.comment-error { color: #b91c1c; }

/* ── Profil public ────────────────────────────────────────────────────────── */
.public-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.public-profile-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.public-profile-name {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.public-profile-handle {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.public-profile-bio {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

.profile-tab-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.profile-tab-btn {
  padding: 0.45rem 0.9rem;
  border: none;
  background: none;
  font-size: 0.88rem;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 4px 4px 0 0;
  transition: color 0.15s, border-color 0.15s;
}

.profile-tab-btn:hover { color: #1e293b; }
.profile-tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

.profile-list-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}

.profile-list-row:last-child { border-bottom: none; }
.profile-list-row:hover { background: #f8fafc; border-radius: 6px; padding-left: 0.5rem; }

.profile-row-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.profile-row-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.92rem;
}

.profile-row-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.profile-comment-body {
  margin: 0 0 0.3rem;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Fin profil public ────────────────────────────────────────────────────── */

.amendment-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.login-wall {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 130px);
  padding: 2rem 1rem;
  background: #f3f6fb;
}

.login-wall-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.login-wall-card h3 {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  color: #0f172a;
}

.login-wall-subtitle {
  color: #64748b;
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.login-wall-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.3rem;
}

.login-wall-card input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.login-wall-card input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-wall-card .btn-primary {
  width: 100%;
  margin-top: 0.25rem;
}

.main-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(240px, 320px) 1fr minmax(280px, 360px);
  padding: 1.5rem;
}

.main-layout.home-layout {
  grid-template-columns: minmax(220px, 280px) 1fr minmax(240px, 300px);
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.main-layout.home-layout aside.sidebar {
  display: flex !important;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 1.5rem;
}

.main-layout.home-layout #project-nav {
  display: block !important;
}

.main-layout.home-layout #chapter-list,
.main-layout.home-layout #section-list,
.main-layout.home-layout #block-list {
  display: none !important;
}

.main-layout.home-layout #amendments-panel {
  display: block !important;
}

.main-layout.home-layout .block-header {
  display: none;
}

.main-layout.home-layout #block-text {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
}

/* Nav accueil */
.home-nav-greeting {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.home-nav-auth {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.home-nav-text-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.5rem 0.65rem 0.5rem 0.8rem;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-left-color 0.12s;
  margin-bottom: 0.05rem;
}

.home-nav-text-btn:hover {
  background: #f1f5f9;
  border-left-color: #f70059;
}

.home-nav-text-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.35;
}

.home-nav-text-stat {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* Centre accueil — derniers amendements */
.home-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.home-recent-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, border-left-color 0.12s;
}

.home-recent-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  border-left-color: #f70059;
}

.home-recent-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.home-recent-text-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-recent-date {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.home-recent-body {
  font-size: 0.875rem;
  color: #1e293b;
  line-height: 1.5;
  margin: 0 0 0.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-recent-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.home-recent-author {
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
}

.home-recent-status {
  font-size: 0.68rem;
}

/* Timeline historique amendement */
.amend-timeline {
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0;
}

.amend-timeline-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.amend-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.amend-timeline-item {
  display: flex;
  gap: 0.75rem;
  position: relative;
  padding-bottom: 1rem;
}

.amend-timeline-item:last-child {
  padding-bottom: 0;
}

/* Ligne verticale entre les items */
.amend-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 1.1rem;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.amend-timeline-dot {
  flex-shrink: 0;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #ffffff;
  margin-top: 0.15rem;
  z-index: 1;
}

/* Couleurs des dots selon statut */
.amend-timeline-dot--recueil-soutiens  { background: #3b82f6; }
.amend-timeline-dot--revision-necessaire { background: #ec4899; }
.amend-timeline-dot--qualifie          { background: #10b981; }
.amend-timeline-dot--accepte           { background: #059669; }
.amend-timeline-dot--clos-accepte      { background: #065f46; }
.amend-timeline-dot--clos-rejete       { background: #dc2626; }
.amend-timeline-dot--rejete-moderation { background: #7c3aed; }
.amend-timeline-dot--a-verifier        { background: #f59e0b; }
.amend-timeline-dot--creation          { background: #94a3b8; }

.amend-timeline-item--current .amend-timeline-dot {
  width: 1rem;
  height: 1rem;
  box-shadow: 0 0 0 3px rgba(247, 0, 89, 0.15);
}

.amend-timeline-body {
  flex: 1;
  min-width: 0;
}

.amend-timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.amend-timeline-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
}

.amend-timeline-item--current .amend-timeline-label {
  color: #f70059;
}

.amend-timeline-date {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.amend-timeline-actor {
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
  display: block;
}

.amend-timeline-note {
  font-size: 0.78rem;
  color: #475569;
  margin: 0.3rem 0 0;
  padding: 0.35rem 0.6rem;
  background: #f8fafc;
  border-left: 2px solid #e2e8f0;
  border-radius: 0 4px 4px 0;
  line-height: 1.45;
}

/* Dark mode timeline */
html.dark-mode .amend-timeline                { border-color: #1e293b; }
html.dark-mode .amend-timeline-title          { color: #e2e8f0; border-bottom-color: #1e293b; }
html.dark-mode .amend-timeline-item::before   { background: #334155; }
html.dark-mode .amend-timeline-dot            { border-color: #0f1f33; }
html.dark-mode .amend-timeline-label          { color: #e2e8f0; }
html.dark-mode .amend-timeline-note           { background: #162032; border-left-color: #334155; color: #94a3b8; }

/* Panneau d'aide droite */
.home-help-panel {
  padding: 0;
}

.home-help-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.home-help-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.65rem 0;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
}

.home-help-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.home-help-num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: #f70059;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.home-help-text strong {
  font-size: 0.875rem;
  color: #1e293b;
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.home-help-text p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  line-height: 1.55;
}

.main-layout.menu-layout {
  grid-template-columns: 1fr;
  max-width: 960px;
  margin: 0 auto;
}

.main-layout.gestion-layout {
  grid-template-columns: 190px 1fr;
  max-width: 1140px;
  margin: 0 auto;
  align-items: start;
  gap: 1.25rem;
}

.main-layout.gestion-layout aside.sidebar {
  display: flex !important;
  flex-direction: column;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  max-height: none;
  overflow: visible;
  gap: 0;
  position: sticky;
  top: 1.5rem;
}

.main-layout.gestion-layout aside.sidebar > div {
  display: none;
}

.main-layout.gestion-layout #amendments-panel {
  display: none !important;
}

.main-layout.gestion-layout .block-header {
  display: none;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.block-action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

#open-amend-button {
  flex-shrink: 0;
  width: auto;
}

.btn-secondary,
.btn-danger {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-secondary {
  background: #64748b;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
}

aside.sidebar,
#amendments-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
}

aside.sidebar > div,
#amendments-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  flex-shrink: 0;
}

aside.sidebar > div {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  flex-shrink: 0;
}

.panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
}

.sidebar h2,
.panel h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.nav-part,
.nav-chapter,
.nav-section,
.nav-block {
  width: 100%;
  text-align: left;
  margin-bottom: 0.55rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
}

.nav-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0;
  position: relative;
}

.nav-block-row {
  position: relative;
}

.nav-block-line {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  align-items: stretch;
  gap: 0.35rem;
}

.nav-collapse-button,
.nav-collapse-spacer {
  width: 1.6rem;
  min-width: 1.6rem;
}

.nav-collapse-button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.nav-collapse-button:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.nav-block-row + .nav-block-row {
  margin-top: 0.35rem;
}

.nav-block-row::before {
  content: "";
  position: absolute;
  left: -0.42rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.nav-block-row-depth-0::before {
  display: none;
}

.nav-block-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-amendment-badge {
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #f70059;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.nav-block:hover {
  background: #e2e8f0;
  color: #f70059;
}

.selected-target {
  background: #f70059;
  border-color: #f70059;
  color: #ffffff;
}

.selected-target .nav-amendment-badge {
  background: #ffffff;
  color: #f70059;
}

.nav-sublist {
  margin-left: 1rem;
  margin-bottom: 0.5rem;
}

.nav-sublist--nested {
  margin-left: 1rem;
}

.nav-group {
  margin-bottom: 0.85rem;
}

.nav-group-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  padding: 0 0.1rem;
}

.nav-env-select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.nav-env-select:focus,
.nav-env-select:hover {
  border-color: #94a3b8;
}

.nav-text-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 0.15rem;
}

.nav-text-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-text-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 500;
}

.nav-text-code {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #64748b;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
}

.nav-text-btn.active .nav-text-code {
  background: #bfdbfe;
  color: #1d4ed8;
}

.nav-text-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.nav-separator {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.5rem 0 0.85rem;
}

.nav-role-block {
  margin-bottom: 0.85rem;
}

.nav-role-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.nav-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}
.nav-role--admin    { background: #fef3c7; color: #92400e; }
.nav-role--owner    { background: #dbeafe; color: #1e40af; }
.nav-role--moderator{ background: #ede9fe; color: #5b21b6; }
.nav-role--writer   { background: #d1fae5; color: #065f46; }
.nav-role--contributor { background: #e0f2fe; color: #075985; }
.nav-role--reader   { background: #f1f5f9; color: #64748b; }
.nav-role--creator  { background: #fce7f3; color: #9d174d; }

.nav-role-source {
  font-size: 0.7rem;
  color: #94a3b8;
  font-style: italic;
}

.nav-role-info {
  position: relative;
  cursor: default;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1;
}

.nav-role-tooltip {
  display: none;
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #f8fafc;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  pointer-events: none;
}

.nav-role-info:hover .nav-role-tooltip,
.nav-role-info:focus .nav-role-tooltip {
  display: block;
}

.nav-role-tooltip-item {
  padding: 0.1rem 0;
}

.nav-role-vote {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.3rem;
}

.nav-empty {
  font-size: 0.875rem;
  color: #94a3b8;
  padding: 0.25rem 0.1rem;
}

.block-tree {
  display: grid;
  gap: 0.35rem;
  overflow: hidden;
}

#content-area {
  display: grid;
  gap: 1rem;
}

  .child-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
  }

  .child-list li {
    margin: 0;
  }

  .child-list button {
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
  }

  .child-list button:hover {
    background: #e2e8f0;
  }

  .selected-child {
    border-color: #2563eb;
    background: #dbeafe;
  }

#block-meta {
  color: #64748b;
  margin-bottom: 1rem;
}

.readable-block {
  position: relative;
  margin: 0 0 0.8rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  border-left: 3px solid transparent;
  border-radius: 8px;
  line-height: 1.7;
  color: #1e293b;
  background: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.readable-block:hover,
.readable-block:focus-within {
  background: #f8fafc;
  border-left-color: #f70059;
}

.readable-block.has-amendments {
  border-left-color: #f9a8c8;
}

.readable-block--list-element {
  display: block;
  padding-left: 2.5rem;
  position: relative;
}

.readable-block--list-element::before {
  content: "•";
  position: absolute;
  left: 0.75rem;
  color: #f70059;
  font-weight: 800;
  font-size: 1.2rem;
}

.readable-block-text {
  white-space: pre-wrap;
  display: block;
  padding-right: 0;
}

/* Barre d'actions unifiée en bas à droite */
.readable-block-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid #f1f5f9;
}

/* Boutons d'action - cachés par défaut */
.readable-block-actions-bar .action-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.readable-block:hover .action-buttons,
.readable-block:focus-within .action-buttons {
  opacity: 1;
  transform: translateY(0);
}

/* Séparateur entre actions et stats */
.readable-block-actions-bar .actions-separator {
  width: 1px;
  height: 1.2rem;
  background: #e2e8f0;
  margin: 0 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.readable-block:hover .actions-separator,
.readable-block:focus-within .actions-separator {
  opacity: 1;
}

/* Statistiques (likes, amendements) */
.readable-block-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-item .stat-icon {
  font-size: 0.9rem;
}

.stat-item .stat-count {
  font-weight: 600;
  min-width: 1rem;
  text-align: center;
}

/* Boutons d'action */
.inline-block-action {
  width: 2rem;
  height: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.inline-block-action:hover {
  transform: scale(1.1);
}

.inline-like-button {
  color: #ec4899;
  border-color: #fce7f3;
}

.inline-like-button:hover {
  background: #fce7f3;
  border-color: #f9a8c8;
}

.inline-like-button.liked {
  background: #fce7f3;
  border-color: #f9a8c8;
  transform: scale(1.1);
}

.inline-like-button.liked:hover {
  background: #fbcfe8;
  border-color: #f472b6;
}

.inline-amend-button {
  color: #10b981;
  border-color: #d1fae5;
}

.inline-amend-button:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.inline-open-button {
  color: #3b82f6;
  border-color: #dbeafe;
}

.inline-open-button:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* ── Bascule de mode d'affichage ─────────────────────────────────────────── */
.block-view-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.view-toggle-btn {
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  padding: 0;
}

.view-toggle-btn:hover {
  color: #475569;
  border-color: #cbd5e1;
}

.view-toggle-btn.active {
  background: #f70059;
  border-color: #f70059;
  color: #ffffff;
}

/* ── Mode continu (seamless) ─────────────────────────────────────────────── */
#block-text.seamless-mode .readable-block {
  background: transparent;
  border-radius: 0;
  margin: 0;
  padding: 0.35rem 1rem 0.35rem 0.75rem;
  border-left: 3px solid transparent;
}

#block-text.seamless-mode .readable-block:hover,
#block-text.seamless-mode .readable-block:focus-within {
  background: rgba(247, 0, 89, 0.04);
  border-left-color: #f70059;
}

#block-text.seamless-mode .readable-block.has-amendments {
  border-left-color: transparent;
}

#block-text.seamless-mode .readable-block.has-amendments:hover,
#block-text.seamless-mode .readable-block.has-amendments:focus-within {
  border-left-color: #f70059;
}

#block-text.seamless-mode .readable-block--list-element {
  padding-left: 2.5rem;
}

#block-text.seamless-mode .readable-block--header {
  margin-top: 1rem;
  padding-bottom: 0.2rem;
}

#block-text.seamless-mode .readable-block--header .readable-block-text {
  font-weight: 700;
  font-size: 1.05em;
  color: #1e293b;
}

/* Barre d'actions : collapsée par défaut, déployée au survol */
#block-text.seamless-mode .readable-block-actions-bar {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  pointer-events: none;
  transition: max-height 0.2s ease, opacity 0.15s ease, margin-top 0.15s ease;
}

#block-text.seamless-mode .readable-block:hover .readable-block-actions-bar,
#block-text.seamless-mode .readable-block:focus-within .readable-block-actions-bar {
  max-height: 3rem;
  opacity: 1;
  pointer-events: auto;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid #f1f5f9;
}

.child-list--headers .section-link-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.child-list--headers .section-link-button.has-amendments {
  border-color: #f9a8c8;
  background: #fff1f6;
}

/* Sections d'amendements */
.amendment-section {
  margin-bottom: 1.5rem;
}

.amendment-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.amendment-section--sub .amendment-section-title {
  color: #475569;
  border-bottom-color: #f1f5f9;
}

.amendment-section + .amendment-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px dashed #e2e8f0;
}

.amendment-empty {
  color: #64748b;
  font-style: italic;
  font-size: 0.9rem;
  margin: 0;
}

.amendment-block-info {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #f70059;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amendment-card {
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.amendment-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.amendment-section--sub .amendment-card {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.amendment-section--sub .amendment-card:hover {
  border-color: #cbd5e1;
}

.amendment-section--subheaders {
  margin-top: 1.5rem;
  border-top: 2px solid #f1f5f9;
  padding-top: 1rem;
}

/* ── Section visibilité (admin environnement) ─────────────────────────────── */

.env-visibility-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.env-visibility-section h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.vis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  gap: 1rem;
}

.vis-row--env {
  font-weight: 600;
}

.vis-label {
  flex: 1;
  font-size: 0.9rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vis-sublabel {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0.5rem 0 0.25rem;
  font-style: italic;
}

.vis-separator {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.75rem 0;
}

.vis-toggle {
  flex-shrink: 0;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.vis-toggle--public {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.vis-toggle--public:hover {
  background: #bbf7d0;
}

.vis-toggle--private {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.vis-toggle--private:hover {
  background: #fecaca;
}


.amendment-section--subheaders .amendment-card {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.amendment-section--subheaders .amendment-card:hover {
  border-color: #cbd5e1;
}

.amendment-card h4 {
  margin: 0 0 0.4rem;
}

.amendment-meta {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 0.75rem;
}

/* Badges de statut des amendements */
.amendment-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

.amdt-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
  margin-right: 0.3rem;
}

.amdt-type-badge--add    { background: #dbeafe; color: #1e40af; }
.amdt-type-badge--delete { background: #fee2e2; color: #991b1b; }
.amdt-type-badge--modify { background: #fef3c7; color: #854d0e; }

.amendment-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #64748b;
}

.status-a-verifier          { background: #fef3c7; color: #92400e; }
.status-recueil             { background: #dbeafe; color: #1e40af; }
.status-revision            { background: #fce7f3; color: #9d174d; }
.status-qualifie            { background: #d1fae5; color: #065f46; }
.status-accepte             { background: #dcfce7; color: #14532d; }
.status-clos-rejete         { background: #fee2e2; color: #991b1b; }
.status-clos-accepte        { background: #bbf7d0; color: #14532d; }
.status-rejete-moderation   { background: #f3e8ff; color: #6b21a8; }

.amendment-moderation-reject-notice {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: #f3e8ff;
  color: #6b21a8;
  border-left: 3px solid #a855f7;
  border-radius: 4px;
  font-size: 0.875rem;
}

.amendment-moderation-reject-notice p {
  margin: 0.25rem 0 0;
}

.amendment-moderation-reject-notice p:first-child {
  margin-top: 0;
}

.amendment-moderation-reject-reason {
  font-style: italic;
}

.amendment-revision-notice {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: #fefce8;
  color: #854d0e;
  border-left: 3px solid #eab308;
  border-radius: 4px;
  font-size: 0.875rem;
}

.amendment-revision-notice p {
  margin: 0.25rem 0 0;
}

.amendment-revision-notice p:first-child {
  margin-top: 0;
}

.amendment-revision-reason {
  font-style: italic;
}

.revision-vote-info {
  margin: 0.4rem 0 0;
  padding: 0.35rem 0.6rem;
  background: #fefce8;
  color: #854d0e;
  border-left: 3px solid #eab308;
  border-radius: 4px;
  font-size: 0.8rem;
  font-style: italic;
}

.amendment-vote-notice {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: #eff6ff;
  color: #1e40af;
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  font-size: 0.875rem;
}

.amendment-vote-notice p {
  margin: 0.25rem 0 0;
}

.amendment-vote-notice p:first-child {
  margin-top: 0;
}

.amendment-vote-closes-at {
  font-style: italic;
}

/* Page d'accueil */
.home-page {
  padding: 0;
}

.home-greeting {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: #0f172a;
}

.home-intro {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0.5rem 0 1rem;
}

.home-env-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 1.25rem 0 0.5rem;
}

.home-text-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.home-text-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  min-height: 5rem;
  justify-content: space-between;
}

.home-text-card:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.home-text-card-title {
  font-weight: 500;
  color: #1e293b;
  font-size: 1rem;
}

.home-text-card-stats {
  display: flex;
  gap: 0.75rem;
  align-self: flex-end;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.home-text-card-code {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: monospace;
}

.home-empty {
  color: #94a3b8;
  font-style: italic;
}

.home-access-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  gap: 0.75rem;
}

.home-access-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.home-access-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.home-access-body {
  font-size: 0.95rem;
  color: #64748b;
  max-width: 30rem;
  line-height: 1.6;
  margin: 0;
}

.home-access-message .btn-primary,
.home-access-message .btn-secondary {
  margin-top: 0.5rem;
  min-width: 12rem;
}

.home-auth-box {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
}

.home-auth-box p {
  margin: 0 0 0.75rem;
  color: #475569;
}

.home-auth-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Onglets du panneau Gestion */
/* Formulaires modales admin */
.admin-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin: 0.85rem 0 0.3rem;
}

.admin-form-label:first-of-type { margin-top: 0; }

.admin-form-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font: inherit;
  font-size: 0.9rem;
  color: #1e293b;
  transition: border-color 0.15s;
  cursor: pointer;
}

.admin-form-select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}

.gestion-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  padding: 0 0.25rem 0.5rem;
  margin: 0;
}

.gestion-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.5rem;
}

.gestion-tab {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: none;
  color: #64748b;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gestion-tab:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.gestion-tab--active {
  color: #1e40af;
  background: #eff6ff;
  font-weight: 600;
}

/* Boutons de transition de statut */
.amendment-transition-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.btn-transition {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-transition--recueil-soutiens    { color: #1e40af; border-color: #93c5fd; }
.btn-transition--recueil-soutiens:hover { background: #dbeafe; }
.btn-transition--revision-necessaire { color: #9d174d; border-color: #f9a8d4; }
.btn-transition--revision-necessaire:hover { background: #fce7f3; }
.btn-transition--qualifie            { color: #065f46; border-color: #6ee7b7; }
.btn-transition--qualifie:hover      { background: #d1fae5; }
.btn-transition--accepte             { color: #14532d; border-color: #86efac; }
.btn-transition--accepte:hover       { background: #dcfce7; }
.btn-transition--clos-rejete         { color: #991b1b; border-color: #fca5a5; }
.btn-transition--clos-rejete:hover   { background: #fee2e2; }
.btn-transition--clos-accepte        { color: #14532d; border-color: #4ade80; }
.btn-transition--clos-accepte:hover  { background: #bbf7d0; }

.support-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.amendment-score-row {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.amendment-support-section {
  margin-bottom: 0.75rem;
}

.amendment-progress-wrap {
  margin-top: 0.5rem;
}

.amendment-progress-label {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.amendment-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.amendment-progress-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.amendment-progress-fill--ratio {
  background: #3b82f6;
}

.report-paragraph-option {
  display: block;
  padding: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.report-paragraph-option input {
  margin-right: 0.75rem;
}

.report-status {
  margin-top: 1rem;
  color: #047857;
  font-weight: 600;
}

.block-measures h3 {
  margin: 1rem 0 0.75rem;
  font-size: 1.05rem;
}

.measure-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #334155;
}

.measure-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

#amend-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

#amend-form input,
#amend-form select,
#amend-form textarea {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  margin-bottom: 1rem;
  font: inherit;
}

#amend-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.3rem;
  border: none;
  border-radius: 14px;
  background: #10b981;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

/* ── Gestion utilisateurs ─────────────────────────────────────────────────── */

.user-search-bar {
  margin-bottom: 1.25rem;
}

.user-search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.75rem center;
  padding-left: 2.5rem;
}

.user-search-input:focus {
  outline: none;
  border-color: #6366f1;
  background-color: #fff;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.user-card:hover {
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}

.user-card--suspended {
  opacity: 0.6;
}

.user-card--member {
  flex-wrap: wrap;
  cursor: default;
}

.user-card--member .user-card-body {
  flex-basis: 100%;
  order: 2;
  min-width: 0;
}

.user-card--member .user-card-avatar {
  order: 1;
}

.user-card--member .user-detail-select--sm,
.user-card--member .user-detail-remove {
  order: 3;
}

.user-card--member .badge {
  order: 3;
}

.user-card-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-card-body {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-handle {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.82rem;
}

.user-card-email {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.user-card-roles {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.user-card-arrow {
  color: #cbd5e1;
  font-size: 1.2rem;
}

.user-list-empty {
  color: #94a3b8;
  font-style: italic;
  padding: 1rem 0;
}

.badge-admin    { background: #fee2e2; color: #991b1b; }
.badge-creator  { background: #dbeafe; color: #1e40af; }
.badge-moderator { background: #fef3c7; color: #92400e; }
.badge-suspended { background: #f1f5f9; color: #64748b; }

/* ── Détail utilisateur ───────────────────────────────────────────────────── */

.user-detail-back {
  background: none;
  border: none;
  color: #6366f1;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0 0 1rem;
  display: block;
}

.user-detail-back:hover { text-decoration: underline; }

.user-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.user-detail-avatar {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-detail-name {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.user-detail-meta {
  font-size: 0.82rem;
  color: #94a3b8;
}

.user-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-detail-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.user-detail-card-title {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.user-detail-field-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-detail-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}

.user-detail-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  background: #f8fafc;
}

.user-detail-select--sm  { flex-shrink: 0; }
.user-detail-select--grow { flex: 1; min-width: 0; }

.user-detail-add-row .user-detail-select--sm,
.user-detail-add-row .user-detail-select--grow { width: 100%; flex: none; }

.user-detail-role-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.user-detail-role-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-detail-role-name {
  flex: 1;
  font-size: 0.88rem;
  min-width: 0;
}

.user-detail-role-env {
  color: #94a3b8;
  font-size: 0.8rem;
}

.user-detail-remove {
  flex-shrink: 0;
  background: none;
  border: 1px solid #fca5a5;
  color: #ef4444;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}

.user-detail-remove:hover { background: #fee2e2; }

.user-detail-add-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.user-detail-add-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  width: 100%;
}

.user-detail-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  font-style: italic;
  margin: 0 0 0.5rem;
}

/* ── Gestion membres environnement (owner) ───────────────────────────────── */

.env-members-search-result {
  margin-top: 0.75rem;
}

.env-members-not-found {
  color: #94a3b8;
  font-size: 0.88rem;
  font-style: italic;
  margin: 0;
}


footer {
  padding: 1.5rem;
  text-align: center;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-bug-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  color: #64748b;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.3rem 0.9rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.footer-bug-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

.hidden {
  display: none !important;
}

.auth-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  color: #92400e;
}

#auth-panel input,
#auth-panel button {
  width: 100%;
}

#auth-panel button {
  margin-top: 0.5rem;
}

/* Modale modification de bloc */
.block-edit-dialog {
  background: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.block-edit-dialog-title {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  color: #1e293b;
}

.block-edit-label {
  display: block;
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0.3rem;
}

.block-edit-select,
.block-edit-textarea {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  background: #f8fafc;
  color: #1e293b;
  margin-bottom: 1rem;
}

.block-edit-textarea {
  resize: vertical;
  margin-bottom: 1.25rem;
}

.block-edit-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

html.dark-mode .block-edit-dialog        { background: #1e293b; }
html.dark-mode .block-edit-dialog-title  { color: #f1f5f9; }
html.dark-mode .block-edit-label         { color: #94a3b8; }
html.dark-mode .block-edit-select,
html.dark-mode .block-edit-textarea      { background: #162032; border-color: #334155; color: #e2e8f0; }

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.reparent-modal-content {
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reparent-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.reparent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.reparent-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.85rem;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  white-space: pre;
  color: #334155;
  transition: background 0.12s;
}

.reparent-option:last-child {
  border-bottom: none;
}

.reparent-option:hover {
  background: #f0f9ff;
  color: #0f172a;
}

.reparent-option--header {
  font-weight: 600;
  color: #1e293b;
}

.inline-reparent-button {
  color: #7c3aed;
  border-color: transparent;
}

.inline-reparent-button:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
}

.modal-close:hover {
  color: #0f172a;
}

.auth-tab {
  display: none;
}

.auth-tab.active {
  display: block;
}

.auth-tab h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #0f172a;
}

.auth-tab label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #0f172a;
}

.password-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.password-wrapper input {
  width: 100%;
  padding-right: 2.75rem;
  box-sizing: border-box;
  margin-bottom: 0;
}

.toggle-password {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  line-height: 1;
  color: #64748b;
  opacity: 0.6;
}

.toggle-password:hover {
  opacity: 1;
}

.auth-tab input {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-bottom: 1rem;
  font: inherit;
}

.auth-tab input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: #64748b;
}

.link-button {
  border: none;
  background: none;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
  padding: 0;
}

.link-button:hover {
  color: #1d4ed8;
}

.error-message {
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 960px) {
  .main-layout:not(.home-layout) {
    grid-template-columns: 1fr;
  }
  .main-layout.home-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Boutons d'édition inline ────────────────────────────────────────────── */

.inline-edit-button,
.inline-delete-button {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.1rem 0.3rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.inline-edit-button:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.inline-delete-button:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.inline-move-button {
  color: #64748b;
  border-color: transparent;
}

.inline-move-button:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.inline-move-button:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

/* Barre auteur (modifier bloc courant + ajouter sous-bloc) */
.block-author-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #e2e8f0;
  flex-wrap: wrap;
}

.block-author-bar .btn-secondary {
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
}

/* Historique des modifications d'un bloc */
.block-history-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.block-history-summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.block-history-summary::before {
  content: '▶';
  font-size: 0.65rem;
  transition: transform 0.15s;
}

.block-history-section[open] .block-history-summary::before {
  transform: rotate(90deg);
}

.block-history-entry {
  margin-top: 0.9rem;
  padding: 0.75rem;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

.block-history-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.block-history-diff {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.block-history-before,
.block-history-after {
  font-size: 0.83rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  line-height: 1.5;
}

.block-history-before {
  background: #fff0f0;
  color: #a00;
  text-decoration: line-through;
  text-decoration-color: #c00;
}

.block-history-after {
  background: #f0fff4;
  color: #1a6b2a;
}

.block-history-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Boutons d'action sur les sections (intertitre) */
.section-nav-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-nav-item .section-link-button {
  flex: 1;
  min-width: 0;
}

.section-nav-item .section-action-btn {
  width: auto;
  flex-shrink: 0;
}

.section-action-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.15rem 0.35rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.section-nav-item:hover .section-action-btn {
  opacity: 1;
}

.section-action-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.section-action-btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.section-action-btn:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

/* ── Cloche de notifications ─────────────────────────────────────────────── */

.notif-bell {
  position: relative;
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s;
}

.notif-bell:hover {
  background: #e2e8f0;
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 340px;
  max-height: 480px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow-y: auto;
  z-index: 200;
}

.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.9rem;
}

.notif-panel-header button {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
}

.notif-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:hover {
  background: #f8fafc;
}

.notif-item.unread {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
}

.notif-item.unread:hover {
  background: #dbeafe;
}

.notif-item-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.notif-item-body {
  font-size: 0.8rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item-time {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.notif-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Wrapper relatif pour positionner le panel */
.notif-wrapper {
  position: relative;
  display: inline-flex;
}

/* ── Logo cliquable ───────────────────────────────────────────────────────── */

.logo-link {
  text-decoration: none;
  color: inherit;
}

.logo-link:hover h1 {
  opacity: 0.8;
}

/* ── Menu hamburger ───────────────────────────────────────────────────────── */

.hamburger-wrapper {
  position: relative;
  display: inline-flex;
}

.hamburger-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.hamburger-button:hover {
  background: #e2e8f0;
}

.hamburger-button span {
  display: block;
  height: 2px;
  background: #0f172a;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger-button.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-button.is-open span:nth-child(2) {
  opacity: 0;
}
.hamburger-button.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hamburger-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 300;
  padding: 0.4rem 0;
  overflow: hidden;
}

.header-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-username:hover {
  color: #e11d48;
  text-decoration: underline;
}

.hamburger-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.9rem;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s;
}

.hamburger-item:hover {
  background: #f8fafc;
}

.hamburger-item--logout {
  color: #ef4444;
}

.hamburger-item--logout:hover {
  background: #fef2f2;
}

.hamburger-item--lang {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.2s;
}

.hamburger-lang-wrapper.is-open .lang-arrow {
  transform: rotate(90deg);
}

.hamburger-separator {
  height: 1px;
  background: #f1f5f9;
  margin: 0.3rem 0;
}

.lang-submenu {
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 0.5rem 1.5rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.85rem;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-option:hover {
  background: #e2e8f0;
}

.lang-option.is-active {
  font-weight: 700;
  color: #2563eb;
}

/* ── Page signalements (modération) ─────────────────────────────────────── */

.report-filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.report-filter-btn {
  padding: 0.35rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s, border-color 0.15s;
}

.report-filter-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.report-filter-btn:hover:not(.active) {
  background: #e2e8f0;
}

.report-mine-bar {
  display: flex;
  gap: 0.25rem;
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

.report-mine-btn {
  padding: 0.2rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: #64748b;
  transition: background 0.15s, color 0.15s;
}

.report-mine-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.report-mine-btn:hover:not(.active) {
  background: #f1f5f9;
}

.report-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.report-status-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.report-status-pending   { background: #fef9c3; color: #854d0e; }
.report-status-acknowledged { background: #dbeafe; color: #1e40af; }
.report-status-resolved  { background: #dcfce7; color: #166534; }
.report-status-dismissed { background: #f1f5f9; color: #64748b; }

.report-issue {
  font-size: 0.88rem;
  margin: 0.3rem 0 0.6rem;
  color: #1e293b;
}

.report-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.report-type--block   { background: #e0f2fe; color: #075985; }
.report-type--comment { background: #fef3c7; color: #92400e; }

.report-comment-box {
  background: #f8fafc;
  border-left: 3px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin: 0.3rem 0 0.5rem;
}

.report-comment-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.report-comment-text {
  font-size: 0.88rem;
  color: #1e293b;
}

.report-amendment-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: #3b82f6;
  cursor: pointer;
  margin-bottom: 0.5rem;
  text-align: left;
}

.report-amendment-link:hover {
  text-decoration: underline;
}

.report-excerpt {
  font-size: 0.8rem;
  color: #64748b;
  font-style: italic;
  margin-bottom: 0.6rem;
}

.report-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.report-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.report-note-input {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.82rem;
  resize: vertical;
}

/* ── Signatures nominatives ──────────────────────────────────────────────────── */
.signatures-section {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.signatures-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.signatures-count {
  font-size: 0.85rem;
  color: #475569;
  margin: 0 0 0.5rem;
}

.signatures-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.signatures-list li {
  background: #e0f2fe;
  color: #0c4a6e;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* ── Panneau de signature (volet droit) ─────────────────────────────────────── */
.sign-panel {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.sign-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #1e293b;
}

.sign-panel .signatures-count {
  margin: 0 0 0.75rem;
}

/* ── Vote formel ─────────────────────────────────────────────────────────────── */
.formal-vote-section {
  margin-top: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0;
}

.formal-vote-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #1e293b;
}

.formal-vote-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.vote-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.vote-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vote-status--open   { background: #dbeafe; color: #1e40af; }
.vote-status--closed { background: #f1f5f9; color: #64748b; }

.vote-result-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vote-result--adopted  { background: #dcfce7; color: #14532d; }
.vote-result--rejected { background: #fee2e2; color: #7f1d1d; }

.vote-closes-at {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.3;
}

.vote-counters {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
}

.vote-oui { color: #15803d; font-weight: 700; }
.vote-non { color: #b91c1c; font-weight: 700; }

.vote-progress-bar {
  flex: 1;
  height: 6px;
  background: #fee2e2;
  border-radius: 999px;
  overflow: hidden;
}

.vote-progress-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ballot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.btn-ballot {
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, box-shadow 0.15s;
  text-align: center;
}

.btn-ballot--oui {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.btn-ballot--oui:hover { background: #bbf7d0; }
.btn-ballot--oui.active {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.2);
}

.btn-ballot--non {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.btn-ballot--non:hover { background: #fecaca; }
.btn-ballot--non.active {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.2);
}

.btn-ballot.active {
  font-weight: 800;
}

.vote-no-right {
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
}

/* ── File de vérification ────────────────────────────────────────────────────── */
.review-queue-section {
  margin-bottom: 1.5rem;
}

.review-queue-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: #1e293b;
}

.review-queue-card {
  border-left: 3px solid #94a3b8;
}

/* ── Alerte file de vérification — en retard ─────────────────────────────────── */
.review-queue-overdue {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── Onglets de navigation texte (Voir le texte / Qualifiés / Voter / Clos / Gérer) ── */
#text-tab-bar-container {
  margin-bottom: 1rem;
}

.text-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.text-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #64748b;
  transition: color 0.15s, border-color 0.15s;
  border-radius: 0;
}

.text-tab-btn:hover {
  color: #1e293b;
}

.text-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.text-tab-panel {
  padding: 0.5rem 0;
}

/* ── Vue traitement owner ─────────────────────────────────────────────────────── */
.treat-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}

.treat-box h3 {
  margin: 0 0 0.5rem;
  color: #166534;
}

.treat-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.treat-side {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
}

.treat-side h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.treat-block-content {
  font-style: italic;
  color: #1e293b;
  white-space: pre-wrap;
}

.treat-proposal {
  color: #166534;
  font-weight: 500;
  white-space: pre-wrap;
}

.treat-delete {
  color: #b91c1c;
  font-style: italic;
}

/* ── Formulaire paramétrage texte ─────────────────────────────────────────────── */
.text-settings-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  max-width: 560px;
}

.text-settings-form h3 {
  margin: 0 0 1rem;
  color: #1e293b;
  font-size: 1.1rem;
}

.settings-field {
  margin-bottom: 1rem;
}

.settings-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.3rem;
}

.settings-field input[type="number"],
.settings-field select {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9rem;
  background: #fff;
  color: #1e293b;
}

.settings-field .field-hint {
  display: block;
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 0.2rem;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.settings-save-status {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  font-weight: 600;
}

/* ── Dark mode toggle (switch dans le menu) ──────────────────────────────── */

.hamburger-darkmode-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.dark-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.dark-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.dark-switch-track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 10px;
  transition: background 0.2s;
}

.dark-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.dark-switch input:checked + .dark-switch-track {
  background: #2563eb;
}

.dark-switch input:checked + .dark-switch-track::after {
  transform: translateX(16px);
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */

html.dark-mode body {
  background: #0f172a;
  color: #e2e8f0;
}

html.dark-mode header {
  background: #1e293b;
  border-bottom-color: #334155;
}

html.dark-mode header h1 { color: #f1f5f9; }
html.dark-mode header p  { color: #94a3b8; }

html.dark-mode .header-username       { color: #f1f5f9; }
html.dark-mode .header-username:hover { color: #f87171; }
html.dark-mode #user-name             { color: #f1f5f9; }

/* Bouton hamburger */
html.dark-mode .hamburger-button               { background: #263347; border-color: #334155; }
html.dark-mode .hamburger-button:hover         { background: #334155; }
html.dark-mode .hamburger-button span          { background: #e2e8f0; }

/* Dropdown menu */
html.dark-mode .hamburger-menu                 { background: #1e293b; border-color: #334155; }
html.dark-mode .hamburger-item                 { color: #e2e8f0; }
html.dark-mode .hamburger-item:hover           { background: #263347; }
html.dark-mode .hamburger-item--logout         { color: #f87171; }
html.dark-mode .hamburger-item--logout:hover   { background: #2d1515; }
html.dark-mode .hamburger-separator            { background: #334155; }
html.dark-mode .lang-submenu                   { background: #162032; border-top-color: #334155; }
html.dark-mode .lang-option                    { color: #e2e8f0; }
html.dark-mode .lang-option:hover              { background: #263347; }
html.dark-mode .hamburger-darkmode-row         { color: #e2e8f0; }

/* Notifications */
html.dark-mode .notif-panel              { background: #1e293b; border-color: #334155; }
html.dark-mode .notif-panel-header       { border-bottom-color: #334155; color: #e2e8f0; }
html.dark-mode .notif-item               { border-bottom-color: #334155; color: #e2e8f0; }
html.dark-mode .notif-item:hover         { background: #263347; }
html.dark-mode .notif-item.unread        { background: #1a2744; border-left-color: #3b82f6; }
html.dark-mode .notif-item.unread:hover  { background: #1e3060; }
html.dark-mode .notif-item-body          { color: #94a3b8; }
html.dark-mode .notif-item-time          { color: #64748b; }

/* Panels / sidebar */
html.dark-mode aside.sidebar > div,
html.dark-mode #amendments-panel,
html.dark-mode .panel {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark-mode .sidebar h2,
html.dark-mode .panel h2 { color: #f1f5f9; }

/* Navigation blocs */
html.dark-mode .nav-part,
html.dark-mode .nav-chapter,
html.dark-mode .nav-section,
html.dark-mode .nav-block {
  background: #263347;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark-mode .nav-collapse-button       { background: #1e293b; border-color: #334155; color: #94a3b8; }
html.dark-mode .nav-collapse-button:hover { background: #263347; color: #e2e8f0; }
html.dark-mode .nav-block-row::before     { background: #334155; }
html.dark-mode .nav-block.selected-target { background: #f70059; border-color: #f70059; color: #ffffff; }
html.dark-mode .nav-block.selected-target .nav-amendment-badge { background: #ffffff; color: #f70059; }

/* Blocs de texte (overrides complets en bas de fichier) */
html.dark-mode .readable-block-actions-bar         { border-top-color: #334155; }
html.dark-mode .readable-block-actions-bar .actions-separator { background: #334155; }

/* Commentaires */
html.dark-mode .comment-section-header              { background: #162032; border-color: #334155; }
html.dark-mode .comment-section-header h3           { color: #e2e8f0; }
html.dark-mode .comment-sort-select                 { background: #263347; border-color: #334155; color: #e2e8f0; }
html.dark-mode .comment-node                        { background: #1e293b; }
html.dark-mode .comment-author                      { color: #e2e8f0; }
html.dark-mode .comment-body                        { color: #cbd5e1; }
html.dark-mode .comment-reply-form                  { background: #162032; border-color: #334155; }
html.dark-mode .comment-replies                     { border-left-color: #334155; }
html.dark-mode .comment-action-btn                  { color: #94a3b8; }
html.dark-mode .comment-action-btn:hover            { background: #263347; color: #e2e8f0; }
html.dark-mode .comment-vote-btn                    { background: #263347; border-color: #334155; color: #94a3b8; }

/* Amendements */
html.dark-mode .amendment-card           { background: #1e293b; border-color: #334155; }
html.dark-mode .amendment-meta,
html.dark-mode .amendment-target         { color: #94a3b8; }
html.dark-mode .current-version-box      { background: #162032; border-color: #334155; }
html.dark-mode .current-version-meta     { color: #cbd5e1; }

/* Modales */
html.dark-mode .modal-content,
html.dark-mode .modal-box                { background: #1e293b; color: #e2e8f0; }
html.dark-mode .modal-close              { color: #94a3b8; }
html.dark-mode .modal-overlay            { background: rgba(0,0,0,0.7); }

/* Formulaires */
html.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.dark-mode textarea,
html.dark-mode select {
  background: #162032;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark-mode .auth-link-button,
html.dark-mode .logout-button {
  background: #263347;
  border-color: #334155;
  color: #e2e8f0;
}
html.dark-mode .auth-link-button:hover,
html.dark-mode .logout-button:hover { background: #334155; }

/* Profil */
html.dark-mode .public-profile-header   { border-bottom-color: #334155; }
html.dark-mode .public-profile-name     { color: #f1f5f9; }
html.dark-mode .public-profile-bio      { color: #cbd5e1; }
html.dark-mode .profile-tab-bar         { border-bottom-color: #334155; }
html.dark-mode .profile-tab-btn         { color: #94a3b8; }
html.dark-mode .profile-tab-btn:hover   { color: #e2e8f0; }
html.dark-mode .profile-list-row        { border-bottom-color: #263347; }
html.dark-mode .profile-list-row:hover  { background: #263347; }
html.dark-mode .profile-row-title       { color: #e2e8f0; }
html.dark-mode .profile-comment-body    { color: #cbd5e1; }

/* Accueil — cartes textes */
html.dark-mode .home-text-card           { background: #1e293b; border-color: #334155; }
html.dark-mode .home-text-card:hover     { background: #263347; border-color: #475569; }
html.dark-mode .home-text-card-title     { color: #e2e8f0; }
html.dark-mode .home-auth-box            { background: #162032; border-color: #334155; }

/* Filtres / boutons secondaires */
html.dark-mode .report-filter-btn            { background: #263347; border-color: #334155; color: #e2e8f0; }
html.dark-mode .report-filter-btn:hover:not(.active) { background: #334155; }
html.dark-mode .vis-toggle                   { background: #263347; border-color: #334155; color: #e2e8f0; }
html.dark-mode .vis-toggle--public           { border-color: #15803d; color: #4ade80; }
html.dark-mode .vis-toggle--private          { border-color: #b91c1c; color: #f87171; }

.settings-save-status.ok  { color: #166534; }
.settings-save-status.err { color: #b91c1c; }

/* ── Vue Espaces & Textes ───────────────────────────────────────────────────── */

.spaces-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.spaces-quota {
  font-size: 0.82rem;
  color: #475569;
  background: #f0f4ff;
  border: 1px solid #c5d3f6;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
}

.spaces-quota-warn {
  font-size: 0.78rem;
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}

.spaces-accordion {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.spaces-accordion--open {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.spaces-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
}

.spaces-accordion--open .spaces-accordion-header {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.spaces-accordion-header:hover {
  background: #f1f5f9;
}

.spaces-accordion-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.spaces-chevron {
  font-size: 0.6rem;
  color: #94a3b8;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.spaces-accordion--open .spaces-chevron {
  transform: rotate(90deg);
}

.spaces-env-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.spaces-owner-badge {
  font-size: 0.7rem;
  background: #dcfce7;
  color: #166534;
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-weight: 600;
}

.spaces-meta-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.spaces-badge {
  font-size: 0.72rem;
  background: #e2e8f0;
  color: #475569;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

.spaces-accordion-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.spaces-action-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.spaces-action-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.spaces-action-btn--danger { color: #dc2626; border-color: #fca5a5; }
.spaces-action-btn--danger:hover { background: #fee2e2; border-color: #f87171; }
.spaces-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.spaces-vis-btn--public { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.spaces-vis-btn--public:hover { background: #bfdbfe; }

.spaces-accordion-body {
  padding: 0.75rem 1rem 1rem;
}

.spaces-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.spaces-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.spaces-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.spaces-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.spaces-empty {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0.35rem 0 0;
}

.spaces-loading {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
}

.spaces-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.spaces-table thead tr {
  background: #f8fafc;
}

.spaces-table th {
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.spaces-th-center { text-align: center !important; }

.spaces-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.spaces-table tr:last-child td { border-bottom: none; }

.spaces-code {
  font-size: 0.75rem;
  color: #64748b;
  font-family: monospace;
}

.spaces-actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.spaces-member-add-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.spaces-member-search-result {
  font-size: 0.82rem;
}

.spaces-member-found {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  flex-wrap: wrap;
}

.spaces-member-info {
  font-size: 0.82rem;
}

.spaces-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spaces-member-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
}

.spaces-member-row .spaces-member-info { flex: 1; min-width: 0; }

.spaces-member-text-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.spaces-member-text-badge {
  font-size: 0.72rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.spaces-member-text-badge-role {
  font-weight: 600;
  color: #2563eb;
}

.vr-can-vote-yes {
  font-weight: 700;
  color: #16a34a;
  font-size: 1rem;
}

.vr-can-vote-no {
  color: #cbd5e1;
  font-size: 1rem;
}

.vr-inherited-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.vote-rights-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  accent-color: #2563eb;
}

.vote-rights-checkbox:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dysfonctionnements plateforme — modale footer */
/* Modale partagée signalement texte + amendement */
.form-modal-content {
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
}

.form-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
  padding-right: 1.5rem;
}

.form-modal-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.form-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.form-modal-section-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.platform-report-modal-content {
  max-width: 460px;
  padding: 1.75rem;
}

.modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.modal-btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.report-reason-textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  color: #1e293b;
}

.report-reason-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.platform-report-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.platform-report-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  color: #1e293b;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #f8fafc;
  line-height: 1.5;
}

.platform-report-textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}

.platform-report-feedback {
  font-size: 0.82rem;
  margin: 0.4rem 0 0;
}

.platform-report-feedback.error { color: #dc2626; }

.platform-report-success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0 0.5rem;
  text-align: center;
}

.platform-report-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.platform-report-success-text {
  font-size: 0.97rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.platform-report-success-hint {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.platform-report-close-btn {
  margin-top: 0.5rem;
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 0.85rem;
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.platform-report-close-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.platform-report-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.platform-report-submit-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.platform-report-submit-btn:hover { background: #1d4ed8; }
.platform-report-submit-btn[style*="dc2626"]:hover { background: #b91c1c !important; }
.platform-report-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.success-message {
  color: #166534;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.platform-reports-closed-details {
  margin-top: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.platform-reports-closed-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #475569;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.platform-reports-closed-details summary::before {
  content: '▶';
  font-size: 0.65rem;
  transition: transform 0.15s;
}

.platform-reports-closed-details[open] summary::before {
  transform: rotate(90deg);
}

.platform-reports-closed-details .report-card {
  margin-top: 0.75rem;
}

/* ── Dark mode — compléments ────────────────────────────────────────────────── */

/* Blocs lisibles — léger contraste avec le fond du panel */
html.dark-mode .readable-block                    { background: #243044; color: #e2e8f0; }
html.dark-mode .readable-block:hover,
html.dark-mode .readable-block:focus-within       { background: #2d3e52; }
html.dark-mode .readable-block.has-amendments     { border-left-color: #be185d; }

/* Bascule de mode d'affichage — dark */
html.dark-mode .view-toggle-btn                   { background: #1e293b; border-color: #334155; color: #64748b; }
html.dark-mode .view-toggle-btn:hover             { color: #94a3b8; border-color: #475569; }
html.dark-mode .view-toggle-btn.active            { background: #f70059; border-color: #f70059; color: #ffffff; }

/* Mode continu — dark */
html.dark-mode #block-text.seamless-mode .readable-block { background: transparent; }
html.dark-mode #block-text.seamless-mode .readable-block:hover,
html.dark-mode #block-text.seamless-mode .readable-block:focus-within { background: rgba(247, 0, 89, 0.07); }
html.dark-mode #block-text.seamless-mode .readable-block:hover .readable-block-actions-bar,
html.dark-mode #block-text.seamless-mode .readable-block:focus-within .readable-block-actions-bar { border-top-color: #334155; }
html.dark-mode #block-text.seamless-mode .readable-block--header .readable-block-text { color: #e2e8f0; }

/* Section "Dans cette partie" — boutons de navigation (child-list) */
html.dark-mode .child-list button                 { background: #243044; border-color: #334155; color: #e2e8f0; }
html.dark-mode .child-list button:hover           { background: #2d3e52; }
html.dark-mode .child-list--headers .section-link-button.has-amendments { background: #2d1a2a; border-color: #be185d; }
html.dark-mode .child-list .selected-child        { background: #1e3a6e; border-color: #3b82f6; color: #e2e8f0; }

/* Select environnement dans la sidebar */
html.dark-mode .nav-env-select                    { background: #243044; border-color: #334155; color: #e2e8f0; }

/* Textes de navigation */
html.dark-mode .nav-text-btn                      { color: #94a3b8; }
html.dark-mode .nav-text-btn:hover                { background: #263347; color: #e2e8f0; }
html.dark-mode .nav-group-label                   { color: #64748b; }
html.dark-mode #block-meta                        { color: #94a3b8; }

/* Onglets texte */
html.dark-mode .text-tab-bar                      { border-bottom-color: #334155; }
html.dark-mode .text-tab-btn                      { color: #64748b; }
html.dark-mode .text-tab-btn:hover                { color: #e2e8f0; }

/* Historique des modifications */
html.dark-mode .block-history-section             { border-top-color: #334155; }
html.dark-mode .block-history-entry               { background: #1e293b; border-left-color: #334155; }
html.dark-mode .block-history-before              { background: #2d1a1a; color: #fca5a5; text-decoration-color: #f87171; }
html.dark-mode .block-history-after               { background: #132d1f; color: #86efac; }

/* Sections d'amendements */
html.dark-mode .amendment-section-title           { color: #e2e8f0; border-bottom-color: #334155; }
html.dark-mode .amendment-section--sub .amendment-section-title { color: #94a3b8; border-bottom-color: #263347; }
html.dark-mode .amendment-section + .amendment-section         { border-top-color: #334155; }
html.dark-mode .amendment-section--subheaders                  { border-top-color: #334155; }
html.dark-mode .amendment-block-info              { background: #243044; color: #94a3b8; }
html.dark-mode .amendment-section--sub .amendment-card        { background: #162032; border-color: #334155; }
html.dark-mode .amendment-section--sub .amendment-card:hover  { border-color: #475569; }
html.dark-mode .amendment-card h4                 { color: #e2e8f0; }
html.dark-mode .amendment-empty                   { color: #64748b; }
html.dark-mode .amendment-score-row               { color: #94a3b8; }
html.dark-mode .amendment-progress-track          { background: #334155; }

/* Notices d'amendements (révision, vote, rejet) */
html.dark-mode .amendment-moderation-reject-notice { background: #2a1a3e; color: #c084fc; border-left-color: #7c3aed; }
html.dark-mode .amendment-revision-notice,
html.dark-mode .revision-vote-info                 { background: #2a200a; color: #fbbf24; border-left-color: #d97706; }
html.dark-mode .amendment-vote-notice              { background: #0f2144; color: #93c5fd; border-left-color: #3b82f6; }

/* Boutons de transition — couleurs lisibles sur fond sombre */
html.dark-mode .btn-transition--recueil-soutiens    { color: #93c5fd; border-color: #3b82f6; }
html.dark-mode .btn-transition--recueil-soutiens:hover { background: #1e3a8a; }

html.dark-mode .btn-transition--revision-necessaire { color: #f9a8d4; border-color: #ec4899; }
html.dark-mode .btn-transition--revision-necessaire:hover { background: #4c1d3a; }

html.dark-mode .btn-transition--rejete-moderation   { color: #d8b4fe; border-color: #a855f7; }
html.dark-mode .btn-transition--rejete-moderation:hover { background: #3b0764; }

html.dark-mode .btn-transition--qualifie            { color: #6ee7b7; border-color: #10b981; }
html.dark-mode .btn-transition--qualifie:hover      { background: #064e3b; }

html.dark-mode .btn-transition--accepte             { color: #86efac; border-color: #22c55e; }
html.dark-mode .btn-transition--accepte:hover       { background: #14532d; }

html.dark-mode .btn-transition--clos-rejete         { color: #fca5a5; border-color: #ef4444; }
html.dark-mode .btn-transition--clos-rejete:hover   { background: #7f1d1d; }

html.dark-mode .btn-transition--clos-accepte        { color: #86efac; border-color: #22c55e; }
html.dark-mode .btn-transition--clos-accepte:hover  { background: #14532d; }

/* Formulaire rapport dans modal */
html.dark-mode .report-paragraph-option          { background: #243044; border-color: #334155; color: #e2e8f0; }

/* Traitement (owner) */
html.dark-mode .treat-box                        { background: #0d2a1a; border-color: #166534; color: #d1fae5; }

/* Accueil */
html.dark-mode .home-greeting                    { color: #f1f5f9; }
html.dark-mode .home-intro                       { color: #e2e8f0; }
html.dark-mode .home-access-title                { color: #e2e8f0; }
html.dark-mode .home-access-body                 { color: #94a3b8; }
html.dark-mode .main-layout.home-layout #block-text { background: #0f1f33; border-color: #1e293b; }
html.dark-mode .home-nav-greeting                { color: #e2e8f0; border-bottom-color: #1e293b; }
html.dark-mode .home-nav-text-btn:hover          { background: #1e293b; border-left-color: #f70059; }
html.dark-mode .home-nav-text-title              { color: #e2e8f0; }
html.dark-mode .home-nav-text-stat               { color: #475569; }
html.dark-mode .home-recent-card                 { background: #162032; border-color: #1e293b; border-left-color: #1e293b; }
html.dark-mode .home-recent-card:hover           { background: #1e293b; border-color: #334155; border-left-color: #f70059; }
html.dark-mode .home-recent-text-label           { color: #94a3b8; }
html.dark-mode .home-recent-body                 { color: #cbd5e1; }
html.dark-mode .home-help-title                  { color: #e2e8f0; border-bottom-color: #1e293b; }
html.dark-mode .home-help-item                   { border-bottom-color: #1e293b; }
html.dark-mode .home-help-text strong            { color: #e2e8f0; }
html.dark-mode .home-help-text p                 { color: #94a3b8; }

/* Section actions boutons éditeur */
html.dark-mode .section-action-btn:hover         { background: #1e3a8a; border-color: #3b82f6; color: #93c5fd; }
html.dark-mode .section-action-btn--danger:hover { background: #7f1d1d; border-color: #f87171; }

/* Espaces & admin */
html.dark-mode .spaces-topbar,
html.dark-mode .review-queue-card                { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html.dark-mode .review-queue-heading             { color: #94a3b8; }
html.dark-mode .settings-save-status.ok          { color: #4ade80; }
html.dark-mode .settings-save-status.err         { color: #f87171; }

/* Rapports plateforme */
html.dark-mode .platform-reports-closed-details summary { color: #94a3b8; }

/* Env visibility */
html.dark-mode .env-visibility-section           { background: #162032; border-color: #334155; }

/* ── Modales — formulaires ──────────────────────────────────────────────────── */

/* Modal auth (connexion / inscription) */
html.dark-mode .auth-tab h2                      { color: #f1f5f9; }
html.dark-mode .auth-tab label                   { color: #cbd5e1; }
html.dark-mode .auth-tab input                   { background: #162032; border-color: #334155; color: #e2e8f0; transition: background-color 99999s, color 99999s; }
html.dark-mode .auth-tab input:focus             { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
html.dark-mode .auth-switch                      { color: #94a3b8; }

/* Login wall (page plein écran) */
html.dark-mode .login-wall                       { background: #0f172a; }
html.dark-mode .login-wall-card                  { background: #1e293b; border-color: #334155; }
html.dark-mode .login-wall-card h3               { color: #f1f5f9; }
html.dark-mode .login-wall-subtitle              { color: #94a3b8; }
html.dark-mode .login-wall-card label            { color: #cbd5e1; }
html.dark-mode .login-wall-card input            { background: #162032; border-color: #334155; color: #e2e8f0; transition: background-color 99999s, color 99999s; }
html.dark-mode .login-wall-card input:focus      { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }

/* Modal box (confirms, infos — .modal-overlay + .modal-box) */
html.dark-mode .modal-box                        { background: #1e293b; }
html.dark-mode .modal-title                      { color: #f1f5f9; }
html.dark-mode .modal-btn-row .btn-secondary     { background: #334155; color: #e2e8f0; border: none; }
html.dark-mode .modal-btn-row .btn-secondary:hover { background: #475569; }
html.dark-mode .report-reason-textarea           { background: #162032; border-color: #334155; color: #e2e8f0; }

/* Modal amendement / signalement */
html.dark-mode .form-modal-title                 { color: #f1f5f9; }
html.dark-mode .form-modal-section-label         { color: #94a3b8; }
html.dark-mode .platform-report-textarea         { background: #162032; border-color: #334155; color: #e2e8f0; }
html.dark-mode .platform-report-textarea:focus   { background: #162032; border-color: #3b82f6; }
html.dark-mode .platform-report-success-text     { color: #f1f5f9; }
html.dark-mode .platform-report-success-icon     { background: #14532d; color: #86efac; }
html.dark-mode .platform-report-close-btn        { border-color: #334155; color: #94a3b8; }
html.dark-mode .platform-report-close-btn:hover  { background: #263347; border-color: #475569; }
html.dark-mode .platform-report-subtitle         { color: #94a3b8; }

/* Avertissement auth dans modal amendement */
html.dark-mode .auth-warning                     { background: #2a1a00; border-color: #d97706; color: #fbbf24; }

/* Labels génériques dans modal/formulaire */
html.dark-mode .modal-content label,
html.dark-mode .form-modal-content label         { color: #cbd5e1; }
html.dark-mode .modal-content h3,
html.dark-mode .form-modal-content h3            { color: #f1f5f9; }
html.dark-mode .error-message                    { color: #f87171; }

/* Vote formel */
html.dark-mode .formal-vote-section              { border-bottom-color: #1e293b; }
html.dark-mode .formal-vote-section h3           { color: #f1f5f9; }
html.dark-mode .vote-status--open                { background: #1e3a8a; color: #93c5fd; }
html.dark-mode .vote-status--closed              { background: #263347; color: #94a3b8; }
html.dark-mode .vote-result--adopted             { background: #14532d; color: #86efac; }
html.dark-mode .vote-result--rejected            { background: #7f1d1d; color: #fca5a5; }
html.dark-mode .vote-closes-at                   { color: #94a3b8; }
html.dark-mode .vote-oui                         { color: #4ade80; }
html.dark-mode .vote-non                         { color: #f87171; }
html.dark-mode .vote-progress-bar                { background: #3b2020; }
html.dark-mode .vote-no-right                    { color: #94a3b8; }

/* Boutons "Voter Oui / Non" — fond sombre */
html.dark-mode .btn-ballot--oui                  { background: #14532d; color: #86efac; border-color: #22c55e; }
html.dark-mode .btn-ballot--oui:hover            { background: #166534; }
html.dark-mode .btn-ballot--oui.active           { background: #16a34a; color: #fff; border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.25); }
html.dark-mode .btn-ballot--non                  { background: #7f1d1d; color: #fca5a5; border-color: #ef4444; }
html.dark-mode .btn-ballot--non:hover            { background: #991b1b; }
html.dark-mode .btn-ballot--non.active           { background: #dc2626; color: #fff; border-color: #ef4444; box-shadow: 0 0 0 3px rgba(220,38,38,0.25); }

/* ── Page statistiques admin ─────────────────────────────────────────────── */

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-kpi-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  text-align: center;
}

.admin-kpi-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.admin-kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}

.admin-kpi-label {
  color: #64748b;
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.admin-stats-section {
  margin-bottom: 2rem;
}

.admin-stats-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.75rem;
}

.admin-status-list {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-status-badge {
  padding: 0.4rem 0.9rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #334155;
}

.admin-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-stats-table thead tr {
  background: #f8fafc;
}

.admin-stats-table th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
}

.admin-stats-th-center { text-align: center !important; }

.admin-stats-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.admin-stats-td-center { text-align: center; }

.admin-stats-table tr:last-child td { border-bottom: none; }

.admin-trend-chart {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  height: 120px;
}

.admin-trend-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.admin-trend-bar {
  width: 100%;
  max-width: 40px;
  background: #3b82f6;
  border-radius: 4px 4px 0 0;
}

.admin-trend-label {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: #64748b;
}

.admin-trend-count {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ── Dark mode — pages de gestion ───────────────────────────────────────── */

/* Liste utilisateurs — recherche & grille */
html.dark-mode .user-search-input        { background-color: #162032; border-color: #334155; color: #e2e8f0; }
html.dark-mode .user-search-input:focus  { background-color: #1e293b; border-color: #6366f1; }
html.dark-mode .user-card                { background: #1e293b; border-color: #334155; }
html.dark-mode .user-card:hover          { border-color: #6366f1; }
html.dark-mode .user-card-name           { color: #e2e8f0; }
html.dark-mode .user-card-arrow          { color: #475569; }

/* Signalements — filtres */
html.dark-mode .report-filter-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
html.dark-mode .report-mine-btn          { border-color: #334155; color: #94a3b8; }
html.dark-mode .report-mine-btn.active   { background: #e2e8f0; color: #0f172a; border-color: #e2e8f0; }
html.dark-mode .report-mine-btn:hover:not(.active) { background: #263347; color: #e2e8f0; }

/* Signalements & Dysfonctionnements — cards */
html.dark-mode .report-card              { background: #1e293b; border-color: #334155; }
html.dark-mode .report-issue             { color: #e2e8f0; }
html.dark-mode .report-excerpt           { color: #64748b; }
html.dark-mode .report-meta              { color: #64748b; }
html.dark-mode .report-note-input        { background: #162032; border-color: #334155; color: #e2e8f0; }
html.dark-mode .report-comment-box       { background: #162032; border-left-color: #334155; }
html.dark-mode .report-comment-author    { color: #94a3b8; }
html.dark-mode .report-comment-text      { color: #cbd5e1; }

/* Badges statut signalement */
html.dark-mode .report-status-pending      { background: #2a1a00; color: #fbbf24; }
html.dark-mode .report-status-acknowledged { background: #1e3a6e; color: #93c5fd; }
html.dark-mode .report-status-resolved     { background: #14532d; color: #86efac; }
html.dark-mode .report-status-dismissed    { background: #263347; color: #64748b; }

/* Badges type signalement */
html.dark-mode .report-type--block         { background: #0c4a6e; color: #7dd3fc; }
html.dark-mode .report-type--comment       { background: #2a1a00; color: #fbbf24; }

/* Paramétrage du texte */
html.dark-mode .text-settings-form                    { background: #1e293b; border-color: #334155; }
html.dark-mode .text-settings-form h3                 { color: #e2e8f0; }
html.dark-mode .settings-field label                  { color: #cbd5e1; }
html.dark-mode .settings-field input[type="number"],
html.dark-mode .settings-field select                 { background: #162032; border-color: #334155; color: #e2e8f0; }
html.dark-mode .settings-field .field-hint            { color: #64748b; }

/* Signatures */
html.dark-mode .signatures-section      { border-top-color: #1e293b; }
html.dark-mode .signatures-section h3   { color: #e2e8f0; }
html.dark-mode .signatures-count        { color: #94a3b8; }
html.dark-mode .signatures-list li      { background: #1e3a6e; color: #93c5fd; }
html.dark-mode .sign-panel              { background: #1e293b; border-color: #334155; }
html.dark-mode .sign-panel h3           { color: #e2e8f0; }

/* Badges type amendement */
html.dark-mode .amdt-type-badge--add    { background: #1e3a6e; color: #93c5fd; }
html.dark-mode .amdt-type-badge--delete { background: #7f1d1d; color: #fca5a5; }
html.dark-mode .amdt-type-badge--modify { background: #2a1a00; color: #fbbf24; }
html.dark-mode .amendment-detail-meta   { color: #64748b; }

/* Footer */
html.dark-mode footer                  { color: #64748b; }
html.dark-mode footer a                { color: #93c5fd; }
html.dark-mode footer a:hover          { color: #bfdbfe; }
html.dark-mode .footer-bug-btn         { border-color: #334155; color: #64748b; }
html.dark-mode .footer-bug-btn:hover   { background: #263347; border-color: #475569; color: #94a3b8; }

/* Statistiques admin */
html.dark-mode .admin-kpi-card            { background: #1e293b; border-color: #334155; }
html.dark-mode .admin-kpi-value           { color: #f1f5f9; }
html.dark-mode .admin-kpi-label           { color: #94a3b8; }
html.dark-mode .admin-stats-heading       { color: #e2e8f0; }
html.dark-mode .admin-status-badge        { background: #263347; border-color: #334155; color: #cbd5e1; }
html.dark-mode .admin-stats-table thead tr { background: #1e293b; }
html.dark-mode .admin-stats-table th      { color: #64748b; border-bottom-color: #334155; }
html.dark-mode .admin-stats-table td      { color: #cbd5e1; border-bottom-color: #263347; }
html.dark-mode .admin-trend-bar           { background: #3b82f6; }
html.dark-mode .admin-trend-label         { color: #94a3b8; }
html.dark-mode .admin-trend-count         { color: #64748b; }

/* Navigation gestion */
html.dark-mode .gestion-tabs              { background: #1e293b; border-color: #334155; }
html.dark-mode .gestion-tab              { color: #94a3b8; }
html.dark-mode .gestion-tab:hover        { color: #e2e8f0; background: #263347; }
html.dark-mode .gestion-tab--active      { color: #93c5fd; background: #1e3a6e; }

/* Formulaires admin communs */
html.dark-mode .admin-form-label         { color: #94a3b8; }
html.dark-mode .admin-form-select        { background: #162032; border-color: #334155; color: #e2e8f0; }
html.dark-mode .admin-form-select:focus  { background: #1e293b; border-color: #3b82f6; }

/* Détail utilisateur */
html.dark-mode .user-detail-card         { background: #1e293b; border-color: #334155; }
html.dark-mode .user-detail-card-title   { color: #64748b; }
html.dark-mode .user-detail-label        { color: #94a3b8; }
html.dark-mode .user-detail-select       { background: #162032; border-color: #334155; color: #e2e8f0; }
html.dark-mode .user-detail-role-env     { color: #64748b; }
html.dark-mode .user-detail-remove       { border-color: #7f1d1d; color: #f87171; }
html.dark-mode .user-detail-remove:hover { background: #2d1515; }
html.dark-mode .user-detail-add-row      { border-top-color: #263347; }
html.dark-mode .user-detail-empty        { color: #64748b; }
html.dark-mode .user-detail-back         { color: #94a3b8; }
html.dark-mode .user-detail-meta         { color: #64748b; }

/* Espaces & textes — accordéon */
html.dark-mode .spaces-accordion                          { border-color: #334155; }
html.dark-mode .spaces-accordion-header                   { background: #1e293b; }
html.dark-mode .spaces-accordion--open .spaces-accordion-header { background: #263347; border-bottom-color: #334155; }
html.dark-mode .spaces-accordion-header:hover             { background: #263347; }
html.dark-mode .spaces-env-name                           { color: #e2e8f0; }
html.dark-mode .spaces-badge                              { background: #334155; color: #94a3b8; }
html.dark-mode .spaces-owner-badge                        { background: #14532d; color: #86efac; }
html.dark-mode .spaces-action-btn                         { border-color: #475569; color: #94a3b8; }
html.dark-mode .spaces-action-btn:hover                   { background: #263347; border-color: #64748b; }
html.dark-mode .spaces-action-btn--danger                 { color: #f87171; border-color: #7f1d1d; }
html.dark-mode .spaces-action-btn--danger:hover           { background: #2d1515; border-color: #f87171; }
html.dark-mode .spaces-vis-btn--public                    { background: #1e3a6e; border-color: #3b82f6; color: #93c5fd; }
html.dark-mode .spaces-vis-btn--public:hover              { background: #1e3a8a; }
html.dark-mode .spaces-accordion-body                     { background: #162032; }
html.dark-mode .spaces-section                            { border-bottom-color: #263347; }
html.dark-mode .spaces-section-title                      { color: #64748b; }
html.dark-mode .spaces-quota                              { background: #1e293b; border-color: #334155; color: #94a3b8; }
html.dark-mode .spaces-quota-warn                         { background: #2a1a00; border-color: #d97706; color: #fbbf24; }

/* Espaces & textes — tableau textes */
html.dark-mode .spaces-table thead tr    { background: #1e293b; }
html.dark-mode .spaces-table th          { color: #64748b; border-bottom-color: #334155; }
html.dark-mode .spaces-table td          { color: #cbd5e1; border-bottom-color: #263347; }
html.dark-mode .spaces-code              { color: #64748b; }

/* Espaces & textes — membres */
html.dark-mode .spaces-member-found      { background: #1e293b; border-color: #334155; }
html.dark-mode .spaces-member-row        { background: #1e293b; border-color: #263347; }
html.dark-mode .spaces-member-text-badge { background: #263347; border-color: #334155; color: #94a3b8; }
html.dark-mode .spaces-member-text-badge-role { color: #93c5fd; }
html.dark-mode .vr-inherited-badge       { background: #263347; border-color: #334155; color: #64748b; }
html.dark-mode .env-members-not-found    { color: #64748b; }

/* ============================================================================
   MODE RÉDACTION
   ============================================================================ */

/* ── Bouton toggle dans le header ──────────────────────────────────────────── */

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-brand h1 {
  margin: 0;
}

.mode-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.8rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.mode-toggle-btn::before {
  content: '✎';
  font-size: 0.73rem;
  opacity: 0.7;
}

.mode-toggle-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.mode-toggle-btn--active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.mode-toggle-btn--active::before {
  opacity: 1;
}

.mode-toggle-btn--active:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* ── Layout mode Rédaction ─────────────────────────────────────────────────── */

.main-layout.redaction-layout {
  grid-template-columns: minmax(200px, 260px) 1fr;
  align-items: start;
}

.main-layout.redaction-layout #amendments-panel,
.main-layout.redaction-layout #content-area {
  display: none !important;
}

#redaction-area {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 1.5rem 2rem;
  min-height: calc(100vh - 160px);
  box-sizing: border-box;
}

.nav-env-single {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  padding: 0.25rem 0;
}

html.dark-mode .nav-env-single { color: #e2e8f0; }

.nav-redaction-env-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-redaction-env-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: transparent;
  color: #1d2939;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.nav-redaction-env-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.nav-redaction-env-btn.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 600;
}

html.dark-mode .nav-redaction-env-btn         { border-color: #334155; color: #cbd5e1; }
html.dark-mode .nav-redaction-env-btn:hover   { background: #1e293b; border-color: #475569; }
html.dark-mode .nav-redaction-env-btn.active  { background: #1e3a6e; border-color: #3b82f6; color: #93c5fd; }

.nav-redaction-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.75rem;
}

.nav-redaction-help {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.nav-redaction-help p {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.5;
}

.nav-redaction-help p:last-child { margin-bottom: 0; }

.nav-redaction-help-item {
  padding-left: 0.75rem;
  border-left: 2px solid #2563eb;
}

html.dark-mode .nav-redaction-title         { color: #e2e8f0; }
html.dark-mode .nav-redaction-help          { border-bottom-color: #334155; }
html.dark-mode .nav-redaction-help p        { color: #94a3b8; }
html.dark-mode .nav-redaction-help-item     { border-left-color: #3b82f6; }

/* ── Toolbar liste ─────────────────────────────────────────────────────────── */

.redaction-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.redaction-toolbar-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.redaction-pending-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Boutons inline (sm / xs) ──────────────────────────────────────────────── */

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  width: auto;
  border-radius: 8px;
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  width: auto;
  border-radius: 6px;
}

.btn-success {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: #16a34a;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: auto;
}

.btn-success:hover { background: #15803d; }

.btn-ghost {
  padding: 0.35rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
  width: auto;
}

.btn-ghost:hover { background: #f1f5f9; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: none;
  background: none;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
}

.btn-back:hover { color: #1d4ed8; }

/* ── Formulaires (input, select, textarea) ─────────────────────────────────── */

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1d2939;
  background: #ffffff;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-textarea { resize: vertical; }

.form-error {
  color: #dc2626;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* ── Cartes contributions ──────────────────────────────────────────────────── */

.redaction-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.redaction-empty {
  color: #64748b;
  font-style: italic;
  padding: 1rem 0;
}

.redaction-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.redaction-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: #93c5fd;
}

.redaction-card--a_verifier {
  border-left: 3px solid #f59e0b;
}

.redaction-card--accepte {
  border-left: 3px solid #16a34a;
}

.redaction-card--rejete_moderation {
  border-left: 3px solid #dc2626;
  opacity: 0.7;
}

.redaction-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.redaction-card-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
}

.redaction-card-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.redaction-card-excerpt {
  color: #475569;
  font-size: 0.85rem;
  margin: 0 0 0.4rem;
  line-height: 1.5;
}

.redaction-card-meta {
  color: #94a3b8;
  font-size: 0.78rem;
}

/* ── Badges type & statut ──────────────────────────────────────────────────── */

.redaction-type-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e0e7ff;
  color: #3730a3;
}

.redaction-type--idee          { background: #e0e7ff; color: #3730a3; }
.redaction-type--communication { background: #fce7f3; color: #9d174d; }
.redaction-type--texte         { background: #dbeafe; color: #1e40af; }
.redaction-type--autre         { background: #f1f5f9; color: #475569; }

.redaction-status-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.redaction-status--a_verifier    { background: #fef3c7; color: #92400e; }
.redaction-status--accepte       { background: #dcfce7; color: #166534; }
.redaction-status--rejete_moderation { background: #fee2e2; color: #991b1b; }

.redaction-pub-count-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
}

/* ── Détail contribution ───────────────────────────────────────────────────── */

.redaction-detail-wrap {
  max-width: 720px;
}

.redaction-detail-header {
  margin-bottom: 1.25rem;
}

.redaction-detail-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.redaction-detail-meta {
  color: #64748b;
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}

.redaction-detail-body {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 0.95rem;
  color: #1d2939;
  margin-bottom: 1.5rem;
}

.redaction-moderation-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #92400e;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

/* ── Panel modération ──────────────────────────────────────────────────────── */

.redaction-moderation-panel {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.redaction-moderation-panel h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #92400e;
}

.redaction-mod-btns {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* ── Panel publication ─────────────────────────────────────────────────────── */

.redaction-publication-panel {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.redaction-publication-panel h4 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #0f172a;
}

.redaction-pub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.redaction-pub-row:last-child { border-bottom: none; }

.redaction-pub-row--done .redaction-chan-name {
  color: #16a34a;
}

.redaction-pub-chan-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.redaction-chan-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.redaction-chan-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.redaction-chan-name a {
  color: inherit;
  text-decoration: none;
}

.redaction-chan-name a:hover { text-decoration: underline; }

.redaction-pub-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.redaction-pub-url-input {
  width: 220px;
  margin: 0;
}

.redaction-pub-done-badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.redaction-pub-noyet {
  color: #94a3b8;
  font-size: 0.82rem;
}

.redaction-pub-view-link {
  color: #2563eb;
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
}

.redaction-pub-view-link:hover { text-decoration: underline; }

/* ── Gestion des canaux ────────────────────────────────────────────────────── */

.redaction-channels-wrap { max-width: 600px; }

.redaction-channels-wrap h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #0f172a;
}

.redaction-channels-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.redaction-channel-row {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  gap: 0;
}

.redaction-channel-view {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.redaction-chan-actions {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.redaction-channel-edit-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.redaction-channel-edit-form .form-input {
  margin-bottom: 0.5rem;
}

.redaction-chan-name-edit {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
}

.redaction-chan-url {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 400;
}

.redaction-chan-del {
  color: #dc2626;
  border-color: #fecaca;
  margin-left: auto;
}

.redaction-chan-del:hover { background: #fee2e2; }

.redaction-channel-add-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
}

.redaction-channel-add-form h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #0f172a;
}

/* ── Formulaire de contribution ────────────────────────────────────────────── */

.redaction-form-wrap {
  max-width: 680px;
}

.redaction-form-wrap h3 {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  color: #0f172a;
}

.redaction-form-btns {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* ── Dark mode ─────────────────────────────────────────────────────────────── */

html.dark-mode .mode-toggle-btn               { border-color: #334155; color: #94a3b8; }
html.dark-mode .mode-toggle-btn:hover         { border-color: #3b82f6; color: #93c5fd; background: #1e293b; }
html.dark-mode .mode-toggle-btn--active       { border-color: #3b82f6; background: #3b82f6; color: #ffffff; }
html.dark-mode .mode-toggle-btn--active:hover { background: #2563eb; border-color: #2563eb; }
html.dark-mode #redaction-area                { background: #1e293b; border-color: #334155; }

html.dark-mode .redaction-card            { background: #1e293b; border-color: #334155; }
html.dark-mode .redaction-card:hover      { border-color: #3b82f6; }
html.dark-mode .redaction-card-title      { color: #e2e8f0; }
html.dark-mode .redaction-card-excerpt    { color: #94a3b8; }
html.dark-mode .redaction-card-meta       { color: #475569; }

html.dark-mode .form-input,
html.dark-mode .form-select,
html.dark-mode .form-textarea             { background: #162032; border-color: #334155; color: #e2e8f0; }
html.dark-mode .form-input:focus,
html.dark-mode .form-select:focus,
html.dark-mode .form-textarea:focus       { border-color: #3b82f6; }

html.dark-mode .btn-ghost                 { border-color: #334155; color: #94a3b8; }
html.dark-mode .btn-ghost:hover           { background: #263347; }

html.dark-mode .redaction-detail-body     { background: #162032; border-color: #334155; color: #cbd5e1; }
html.dark-mode .redaction-moderation-panel { background: #1a1500; border-color: #713f12; }
html.dark-mode .redaction-moderation-panel h4 { color: #fbbf24; }
html.dark-mode .redaction-publication-panel { border-color: #334155; }
html.dark-mode .redaction-publication-panel h4 { color: #e2e8f0; }
html.dark-mode .redaction-pub-row         { border-bottom-color: #1e293b; }
html.dark-mode .redaction-chan-name        { color: #e2e8f0; }
html.dark-mode .redaction-channel-row       { background: #162032; border-color: #334155; }
html.dark-mode .redaction-channel-add-form  { background: #162032; border-color: #334155; }
html.dark-mode .redaction-channel-edit-form .form-input { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html.dark-mode .redaction-channel-add-form h4 { color: #e2e8f0; }
html.dark-mode .redaction-form-wrap h3    { color: #e2e8f0; }
html.dark-mode .redaction-channels-wrap h3 { color: #e2e8f0; }
html.dark-mode .redaction-detail-title    { color: #e2e8f0; }
html.dark-mode .redaction-pending-badge   { background: #1a0f00; color: #fbbf24; border-color: #d97706; }
html.dark-mode .redaction-pub-url-input   { width: 200px; }
