/* ============================================================
   Mosalink v5 – CSS  |  Thème MMI Rose  |  Fond clair
   ============================================================ */

:root {
  --bg:          #f5f5f5;
  --bg2:         #ebebeb;
  --surface:     #ffffff;
  --surface2:    #f0f0f0;
  --border:      #e0e0e0;
  --border2:     #cccccc;

  --rose:        #E8187A;
  --rose2:       #c4126a;
  --rose-light:  #fde8f2;
  --rose-dim:    rgba(232,24,122,.10);

  --text:        #1a1a1a;
  --text-muted:  #666666;
  --text-faint:  #999999;

  --danger:      #c53030;
  --success:     #1e7e34;

  --radius:      14px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 40px rgba(0,0,0,.14);
  --transition:  .15s ease;

  --header-h:    56px;
  --sidebar-w:   270px;

  --font:        'Roboto', system-ui, sans-serif;
  --font-head:   'Space Grotesk', 'Roboto', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--rose); text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, textarea, select {
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  width: 100%;
  font-size: .92rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--rose-dim);
}

/* ── Loading ───────────────────────────────────────────────── */
#app-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100dvh; background: var(--bg);
}

/* ── Layout ────────────────────────────────────────────────── */
#app { min-height: 100dvh; width: 100%; overflow-x: hidden; }

.app-layout {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-columns: 1fr;
  min-height: 100dvh;
  max-width: 100vw;
  overflow-x: hidden;
}
@media (min-width: 900px) {
  .app-layout {
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
  }
}

/* ── Header ────────────────────────────────────────────────── */
.app-header {
  grid-column: 1 / -1;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.25rem;
  min-width: 0;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-logo {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.header-logo .logo-a    { color: #E8187A !important; font-weight: 800; } /* couleur fixe — ne pas modifier */
.header-logo .logo-link { color: var(--text); font-weight: 800; }

/* Bouton toggle sidebar — visible partout */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
  cursor: pointer;
}
.sidebar-toggle:hover { background: var(--bg2); color: var(--rose); }

/* Sidebar masquée sur desktop via bouton */
@media (min-width: 900px) {
  .app-sidebar.desktop-hidden {
    display: none !important;
  }
  .app-layout:has(.app-sidebar.desktop-hidden) {
    grid-template-columns: 1fr;
  }
}

.header-search {
  flex: 1;
  position: relative;
  max-width: 520px;
  min-width: 0;
  margin: 0 auto;
}
.header-search input {
  padding-left: 2.2rem;
  border-radius: 999px;
  height: 36px;
  font-size: .88rem;
  background: var(--bg2);
  border-color: transparent;
}
.header-search input:focus { background: var(--surface); border-color: var(--rose); }
.header-search .search-icon {
  position: absolute; left: .75rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}

.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* ── Sidebar ───────────────────────────────────────────────── */
.app-sidebar {
  background: var(--surface);
  border-right: 1.5px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 0;
  display: none;
  position: relative;
}
@media (min-width: 900px) { .app-sidebar { display: flex; flex-direction: column; } }

/* Sidebar mobile → drawer overlay */
.app-sidebar.mobile-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 90;
  box-shadow: var(--shadow-lg);
  animation: slideInLeft .2s ease;
}
@keyframes slideInLeft { from { transform: translateX(-100%); } }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  background: rgba(0,0,0,.25);
  z-index: 89;
}
.sidebar-overlay.visible { display: block; }

/* Sections sidebar */
.sidebar-section { margin-bottom: .25rem; }

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem .3rem;
  cursor: pointer;
  user-select: none;
}
.sidebar-section-header:hover .sidebar-label { color: var(--rose); }

.sidebar-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color var(--transition);
}

.sidebar-chevron {
  color: var(--text-faint);
  transition: transform var(--transition);
  font-size: .7rem;
}
.sidebar-section.collapsed .sidebar-chevron { transform: rotate(-90deg); }
.sidebar-section.collapsed .sidebar-body    { display: none; }

.sidebar-body { padding: 0 .5rem .5rem; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .88rem;
  transition: all var(--transition);
  cursor: pointer;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-link:hover  { background: var(--rose-light); color: var(--rose); }
.sidebar-link.active { background: var(--rose-light); color: var(--rose); font-weight: 600; }

.sidebar-link .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-link .count {
  margin-left: auto;
  font-size: .7rem;
  color: var(--text-faint);
  background: var(--bg2);
  padding: .05rem .35rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.sidebar-link.active .count {
  background: var(--rose-dim);
  color: var(--rose);
}

/* Tag cloud sidebar */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .3rem; padding: .25rem .5rem .5rem; }
.tag-pill {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .75rem;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}
.tag-pill:hover, .tag-pill.active {
  background: var(--rose-light);
  border-color: var(--rose);
  color: var(--rose);
  font-weight: 500;
}

/* Contributeurs */
.contributor-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}
.contributor-link:hover, .contributor-link.active {
  background: var(--rose-light);
  color: var(--rose);
}
.contributor-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--rose-dim);
  color: var(--rose);
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ── Main ──────────────────────────────────────────────────── */
.app-main {
  padding: 1.5rem 1.25rem;
  overflow-y: auto;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 900px) { .app-main { padding: 1.75rem 2rem; } }
@media (min-width: 900px) { .app-main { padding: 1.75rem 2rem; } }

/* ── Section title ─────────────────────────────────────────── */
.section-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.section-title .count-badge {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-faint);
  background: var(--bg2);
  padding: .1rem .5rem;
  border-radius: 999px;
  font-family: var(--font);
}

/* Filtre actif affiché */
.active-filter {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--rose-light);
  border: 1.5px solid var(--rose);
  color: var(--rose);
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .78rem;
  font-weight: 500;
  font-family: var(--font);
}
.active-filter button {
  color: var(--rose);
  font-size: .85rem;
  opacity: .7;
  padding: 0;
  line-height: 1;
}
.active-filter button:hover { opacity: 1; }

/* ── Bookmarks grid ────────────────────────────────────────── */
.bookmarks-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px)  { .bookmarks-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .bookmarks-grid { grid-template-columns: repeat(3, 1fr); } }
/* Tablette + sidebar ouverte → 2 colonnes pour éviter le débordement */
@media (min-width: 768px) and (max-width: 1099px) {
  .app-layout:has(.app-sidebar.mobile-open) .bookmarks-grid,
  .app-layout:has(.app-sidebar:not(.desktop-hidden)) .bookmarks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) { .bookmarks-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .bookmarks-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1650px) { .bookmarks-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1900px) { .bookmarks-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 2200px) { .bookmarks-grid { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 2560px) { .bookmarks-grid { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 3200px) { .bookmarks-grid { grid-template-columns: repeat(10, 1fr); } }
@media (min-width: 3840px) { .bookmarks-grid { grid-template-columns: repeat(12, 1fr); } }

/* ── Bookmark card ─────────────────────────────────────────── */
.bookmark-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.bookmark-card:hover {
  border-color: var(--rose);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

/* Image header — plus haute */
.bookmark-image {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block;
  background: var(--bg2);
}
.bookmark-image-placeholder {
  width: 100%;
  aspect-ratio: 3/2;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--rose-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bookmark-image-placeholder img {
  width: 36px; height: 36px;
  opacity: .35;
  object-fit: contain;
}

/* Corps de la card */
.bookmark-body {
  padding: 1rem 1.1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 1;
}

.bookmark-header { display: flex; align-items: flex-start; gap: .5rem; }
.bookmark-favicon {
  width: 18px; height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  object-fit: contain;
}
.bookmark-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bookmark-title a { color: var(--text); }
.bookmark-title a:hover { color: var(--rose); text-decoration: none; }

.bookmark-desc {
  font-size: .82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.bookmark-url {
  font-size: .72rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

/* Méta : catégorie + tags */
.bookmark-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .1rem;
}

.category-badge {
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  transition: opacity var(--transition);
}
.category-badge:hover { opacity: .8; }

.tag-badge {
  font-size: .7rem;
  color: var(--rose);
  background: var(--rose-light);
  border-radius: 999px;
  padding: .12rem .45rem;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition);
  border: none;
}
.tag-badge:hover { background: var(--rose); color: #fff; }

/* Footer : date + auteur + actions */
.bookmark-footer {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: auto;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}
.bookmark-date {
  font-size: .72rem;
  color: var(--text-faint);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--transition);
}
.bookmark-date:hover { color: var(--rose); text-decoration: underline; }

.bookmark-author {
  font-size: .72rem;
  color: var(--rose);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  transition: opacity var(--transition);
}
.bookmark-author:hover { opacity: .7; text-decoration: underline; }

.bookmark-actions {
  display: flex;
  gap: .2rem;
  margin-left: auto;
  opacity: .45;
  transition: opacity var(--transition);
}
.bookmark-card:hover .bookmark-actions { opacity: 1; }
/* Toujours visible sur mobile/tablette */
@media (max-width: 1099px) {
  .bookmark-actions { opacity: 1; }
}

.private-badge {
  position: absolute; top: .6rem; right: .6rem;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: .65rem;
  padding: .15rem .45rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

/* ── Badges circulaires rose (copie + publié) ───────────────── */
.card-badge {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--rose);
  background: var(--surface);
  color: var(--rose);
  font-size: .68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; pointer-events: none;
  line-height: 1;
}
.card-badge-tl { top: .5rem; left: .5rem; }
.card-badge-tr { top: .5rem; right: .5rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .86rem; font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap; cursor: pointer;
  font-family: var(--font); border: none;
}
.btn-primary { background: var(--rose); color: #fff; box-shadow: 0 2px 8px rgba(232,24,122,.2); }
.btn-primary:hover { background: var(--rose2); }
.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { border-color: var(--rose); color: var(--rose); }
.btn-danger { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-icon { padding: .3rem; border-radius: 6px; color: var(--text-faint); }
.btn-icon:hover { background: var(--bg2); color: var(--rose); }
.btn-sm { padding: .28rem .6rem; font-size: .78rem; }

/* ── FAB ───────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  right: 1.25rem;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(232,24,122,.4);
  z-index: 90;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer; border: none;
}
.fab:hover { transform: scale(1.07); }
@media (min-width: 900px) { .fab { display: none; } }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 560px) { .modal-backdrop { align-items: center; padding: 1rem; } }

.modal {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 560px;
  max-height: 92dvh; overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
@media (min-width: 560px) { .modal { border-radius: var(--radius-lg); animation: fadeScale .18s ease; } }
@keyframes slideUp   { from { transform: translateY(40px); opacity: 0; } }
@keyframes fadeScale { from { opacity: 0; transform: scale(.97); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1.5px solid var(--border);
}
.modal-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group   { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.form-label   { font-size: .82rem; color: var(--text-muted); font-weight: 600; }
.form-hint    { font-size: .74rem; color: var(--text-faint); }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* URL loading spinner */
.url-loading {
  display: none; align-items: center; gap: .5rem;
  font-size: .82rem; color: var(--text-faint); padding: .35rem 0;
}
.url-loading.visible { display: flex; }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* URL preview */
.url-preview {
  background: var(--bg2); border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: .85rem; display: none;
}
.url-preview.visible { display: block; }
.url-preview img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.url-preview-info { padding: .4rem .75rem; font-size: .75rem; color: var(--text-muted); }

/* Image picker */
.img-picker-panel {
  background: var(--bg2); border-radius: var(--radius-sm);
  padding: .75rem; border: 1.5px solid var(--border); margin-top: .5rem;
}
.img-tab-btn {
  flex: 1; padding: .3rem; border-radius: 6px;
  font-size: .78rem; font-weight: 600;
  border: 1.5px solid var(--border);
  background: transparent; color: var(--text-faint); cursor: pointer;
  transition: all var(--transition); font-family: var(--font);
}
.img-tab-btn.active { background: var(--surface); color: var(--text); border-color: var(--rose); }

/* Toggle */
.toggle-wrap { display: flex; align-items: center; gap: .6rem; }
.toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border2); border-radius: 999px; cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; left: 3px; top: 3px;
  background: var(--surface); border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked ~ .toggle-slider { background: var(--rose); }
.toggle input:checked ~ .toggle-slider::before { transform: translateX(16px); }

/* Tags input */
.tags-input-wrap {
  display: flex; flex-wrap: wrap; gap: .3rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: .35rem .6rem;
  min-height: 42px; cursor: text;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tags-input-wrap:focus-within { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-dim); }
.tags-input-wrap input {
  border: none; background: transparent; padding: .1rem .2rem;
  width: auto; flex: 1; min-width: 80px; height: auto; box-shadow: none;
}
.tag-token {
  background: var(--rose-light); color: var(--rose);
  border-radius: 999px; padding: .1rem .5rem;
  font-size: .76rem; display: flex; align-items: center; gap: .2rem; font-weight: 500;
}
.tag-token button { color: var(--rose); opacity: .7; padding: 0; font-size: .85rem; }
.tag-token button:hover { opacity: 1; }

/* ── Auth ──────────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh; display: flex; align-items: center;
  justify-content: center; padding: 1.5rem; background: var(--bg);
  /* Remonter le formulaire : padding-bottom compense align-items:center */
  padding-bottom: calc(1.5rem + 170px);
}
@media (max-width: 1099px) {
  .auth-page { padding-bottom: calc(1.5rem + 105px); }
}
@media (max-width: 600px) {
  .auth-page { padding-bottom: calc(1.5rem + 55px); }
}
.auth-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem 1.75rem;
  width: 100%; max-width: 400px; box-shadow: var(--shadow);
}
.auth-logo {
  font-family: var(--font-head); font-size: 1.9rem; font-weight: 800;
  color: var(--text); text-align: center; margin-bottom: 1.75rem; letter-spacing: -.03em;
}
.auth-logo .logo-a    { color: #E8187A !important; } /* couleur fixe */
.auth-logo .logo-link { color: var(--text); }
.auth-title    { font-size: 1.1rem; font-weight: 700; margin-bottom: .2rem; }
.auth-subtitle { color: var(--text-muted); font-size: .86rem; margin-bottom: 1.25rem; }

/* ── Admin ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: .75rem; margin-bottom: 2rem;
}
@media (min-width: 600px) { .stats-grid { grid-template-columns: repeat(4,1fr); } }
.stat-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat-value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 800; color: var(--rose); }
.stat-label { font-size: .78rem; color: var(--text-muted); }

.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th {
  text-align: left; padding: .55rem .75rem; color: var(--text-faint);
  font-weight: 600; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; border-bottom: 1.5px solid var(--border);
}
.data-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--bg2); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg2); }

.role-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.role-SUPER_ADMIN { background: rgba(217,48,37,.1); color: var(--danger); }
.role-SUPER_USER  { background: var(--rose-light); color: var(--rose); }
.role-USER        { background: var(--bg2); color: var(--text-muted); }

/* ── Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: calc(1.5rem + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: .4rem; pointer-events: none;
}
.toast {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: .55rem 1rem; font-size: .86rem;
  box-shadow: var(--shadow); animation: slideUp .2s ease; pointer-events: all; white-space: nowrap;
}
.toast.success { border-color: #1e7e34; color: #1e7e34; }
.toast.error   { border-color: var(--danger); color: var(--danger); }

/* ── Bottom nav mobile ─────────────────────────────────────── */
.bottom-nav {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1.5px solid var(--border);
  padding: .4rem 0 calc(.4rem + env(safe-area-inset-bottom)); z-index: 95;
}
.bottom-nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
  font-size: .62rem; color: var(--text-faint); padding: .3rem; transition: color var(--transition);
}
.bottom-nav-btn.active, .bottom-nav-btn:hover { color: var(--rose); }
@media (min-width: 900px) { .bottom-nav { display: none; } }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-faint); }
.empty-state p { font-size: .95rem; margin-top: .75rem; }

/* ── Tag autocomplete ──────────────────────────────────────── */
.tag-autocomplete {
  position: relative;
}
.tag-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.tag-suggestions.visible { display: block; }

.tag-suggestion-group {
  padding: .3rem .6rem .1rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}
.tag-suggestion-group:first-child { border-top: none; }

.tag-suggestion-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .75rem;
  cursor: pointer;
  font-size: .86rem;
  color: var(--text-muted);
  transition: background var(--transition);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font);
}
.tag-suggestion-item:hover,
.tag-suggestion-item.highlighted {
  background: var(--rose-light);
  color: var(--rose);
}
.tag-suggestion-item .dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--rose); }

/* ── Utilities ─────────────────────────────────────────────── */
.flex { display: flex; } .flex-1 { flex: 1; } .items-center { align-items: center; }
.gap-2 { gap: .5rem; } .w-full { width: 100%; } .hidden { display: none !important; }
.text-muted { color: var(--text-muted); } .text-rose { color: var(--rose); }
.admin-title { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; margin-bottom: 1rem; }
/* ── Accordéon invitation dans membres ─────────────────────── */
.invite-accordion {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.invite-accordion-summary {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  background: var(--bg2);
  color: var(--text);
  user-select: none;
}
.invite-accordion-summary::-webkit-details-marker { display: none; }
.invite-accordion-summary svg { color: var(--text-faint); flex-shrink: 0; }
.invite-accordion[open] > .invite-accordion-summary { color: var(--rose); }
.invite-accordion[open] > .invite-accordion-summary svg { color: var(--rose); }
.invite-accordion-body {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Sous-onglets SuperAdmin dans les accordéons domaine ───── */
.sa-domain-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg);
  padding: 0 1rem;
}
.sa-domain-tab {
  padding: .5rem .85rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  margin-bottom: -1.5px;
  transition: all var(--transition);
}
.sa-domain-tab:hover { color: var(--rose); }
.sa-domain-tab.active {
  color: var(--rose);
  border-bottom-color: var(--rose);
  font-weight: 600;
}
.sa-domain-panel {
  padding: .75rem 1rem;
}

/* ── Upload documents ───────────────────────────────────────── */

/* ── Onglets modale ajouter ─────────────────────────────────── */
.modal-tab {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.modal-tab:hover { border-color: var(--rose); color: var(--rose); }
.modal-tab.active {
  background: var(--rose-light);
  border-color: var(--rose);
  color: var(--rose);
  font-weight: 600;
}
.modal-tab svg { flex-shrink: 0; }

.upload-drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.upload-drop-zone.drag-over {
  border-color: var(--rose);
  background: var(--rose-light);
}
.upload-drop-zone:hover { border-color: var(--rose); }

/* Card document */
.bookmark-card.is-document .bm-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  font-size: 2rem;
}
.doc-icon-placeholder {
  width: 100%;
  aspect-ratio: 3/2;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.doc-type-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: .1rem .4rem;
  border-radius: 4px;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}
.doc-type-pdf  { background: #fee2e2; color: #c53030; }
.doc-type-docx { background: #dbeafe; color: #1d4ed8; }
.doc-type-xlsx { background: #dcfce7; color: #166534; }
.doc-type-pptx { background: #fff3e0; color: #b45309; }
.doc-type-doc  { background: #dbeafe; color: #1d4ed8; }
.doc-type-xls  { background: #dcfce7; color: #166534; }
.doc-type-mp3,
.doc-type-wav,
.doc-type-ogg,
.doc-type-m4a  { background: #f3e8ff; color: #7c3aed; }
.doc-type-mp4,
.doc-type-webm,
.doc-type-mov,
.doc-type-avi  { background: #e0f2fe; color: #0369a1; }

/* ── Onglet Style : prévisualisation ───────────────────────── */
.style-preview {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.style-preview-title {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .5rem .75rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.style-preview-inner {
  background: var(--bg);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.style-preview-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
}
.style-preview-logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
  margin-right: auto;
}
.style-preview-badge {
  font-size: .6rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 999px;
  transition: all .2s;
}
.style-preview-btn {
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .25rem .6rem;
  cursor: default;
  transition: background .2s;
}
.style-preview-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.style-preview-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}
.style-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.style-preview-card-img {
  height: 48px;
  transition: background .2s;
}
.style-preview-card-body {
  padding: .4rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.style-preview-card-title {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.style-preview-card-desc {
  font-size: .62rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.style-preview-card-tag {
  font-size: .6rem;
  padding: .1rem .35rem;
  border-radius: 999px;
  display: inline-block;
  transition: all .2s;
}
.style-preview-link {
  font-size: .62rem;
  font-weight: 600;
  transition: color .2s;
}
.style-preview-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem 0;
}
.style-preview-sidebar-item {
  font-size: .7rem;
  padding: .3rem .75rem;
  color: var(--text-muted);
  cursor: default;
}
.style-preview-sidebar-item.active {
  font-weight: 600;
  border-left: 3px solid;
  padding-left: calc(.75rem - 3px);
  transition: all .2s;
}

/* ── Console mobile : accordéons ───────────────────────────── */
.console-mobile .app-main {
  padding: 0;
  overflow-y: auto;
}
.console-accordion-item {
  border-bottom: 1.5px solid var(--border);
  background: var(--surface);
}
.console-accordion-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.console-accordion-header::-webkit-details-marker { display: none; }
.console-accordion-icon { color: var(--text-faint); flex-shrink: 0; }
.console-accordion-label { flex: 1; }
.console-accordion-chevron {
  color: var(--text-faint);
  transition: transform .2s;
}
details.console-accordion-item[open] .console-accordion-chevron {
  transform: rotate(90deg);
}
details.console-accordion-item[open] > .console-accordion-header {
  color: var(--rose);
}
details.console-accordion-item[open] > .console-accordion-header .console-accordion-icon {
  color: var(--rose);
}
.console-accordion-body {
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Lignes membres mobile */
.mob-member-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
}
.mob-member-row:last-child { border-bottom: none; }
.mob-member-info { flex: 1; min-width: 0; }
.mob-member-name {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-member-email {
  display: block;
  font-size: .72rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Console admin mobile : sidebar horizontale + tableau adaptatif ── */
@media (max-width: 899px) {
  .console-layout > .app-sidebar {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    overflow-y: hidden;
    height: auto !important;
    border-right: none;
    border-bottom: 1.5px solid var(--border);
    padding: .35rem .5rem;
    gap: .2rem;
    scrollbar-width: none;
    position: static !important;
    width: 100% !important;
  }
  .console-layout > .app-sidebar::-webkit-scrollbar { display: none; }
  .console-layout > .app-sidebar .console-nav-label,
  .console-layout > .app-sidebar .console-sidebar-footer,
  .console-layout > .app-sidebar div[style*="height:1px"] { display: none !important; }
  .console-layout > .app-sidebar .sidebar-link {
    white-space: nowrap;
    flex-shrink: 0;
    padding: .35rem .65rem;
    font-size: .78rem;
  }
  .console-layout > .app-sidebar button:not(.sidebar-link) {
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0 !important;
    width: auto !important;
    font-size: .75rem;
  }
  .console-layout > .app-main { overflow-x: auto; }

  /* Tableau membres : masquer colonnes non essentielles */
  #members-table th:nth-child(4),
  #members-table td:nth-child(4),
  #members-table th:nth-child(5),
  #members-table td:nth-child(5),
  #members-table th:nth-child(6),
  #members-table td:nth-child(6) { display: none; }
}

/* ── Boutons header adaptatifs mobile ───────────────────────── */
.btn-label-mobile  { display: none; }
.btn-label-desktop { display: inline-flex; align-items: center; gap: .3rem; }

@media (max-width: 600px) {
  .btn-label-mobile  { display: inline-flex; align-items: center; }
  .btn-label-desktop { display: none; }

  /* Uniformiser tous les éléments du header à la même taille */
  .app-header { gap: .4rem; padding: 0 .75rem; }

  .sidebar-toggle { width: 32px; height: 32px; }

  /* Bouton + : même taille que les autres icônes */
  .header-add-btn {
    width: 32px; height: 32px;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700;
    border-radius: var(--radius-sm);
  }

  /* Bouton Gérer : idem */
  .header-gear-btn {
    width: 32px; height: 32px;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
  }

  /* Avatar compte : aligné */
  .account-btn {
    padding: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent;
  }
  .account-chevron { display: none; }

  /* Champ recherche : occupe l'espace restant */
  .header-search { min-width: 0; flex: 1; }
  .header-search input { font-size: .82rem; }
}

/* ── Homogénéisation icônes SVG ─────────────────────────────── */
/* Tous les SVG dans les éléments interactifs en gris par défaut */
.sidebar-link svg,
.account-menu-item svg,
.btn-icon svg,
.btn svg,
.tool-card svg,
.domain-accordion-header svg {
  color: var(--text-faint);
  stroke: currentColor;
  flex-shrink: 0;
  vertical-align: middle;
}
/* Rose au hover */
.sidebar-link:hover svg,
.sidebar-link.active svg,
.account-menu-item:hover svg,
.btn-icon:hover svg,
.tool-card:hover svg,
.tool-card.active svg {
  color: var(--rose);
}
/* Bouton Gérer dans le header */
.header-actions .btn svg {
  color: var(--text-muted);
}
.header-actions .btn:hover svg {
  color: var(--rose);
}

/* ── Modale aide ────────────────────────────────────────────── */
.help-section {
  border-bottom: 1px solid var(--border);
  padding: .85rem 0;
}
.help-section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: .35rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.help-section-title svg {
  color: var(--text-faint);
  flex-shrink: 0;
}
.help-section p {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.help-list {
  font-size: .82rem;
  color: var(--text-muted);
  margin: .4rem 0 0 1.1rem;
  line-height: 1.8;
}

/* ── Modal sélection domaine ────────────────────────────────── */
.domain-select-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .5rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.domain-select-row:hover {
  border-color: var(--rose);
  background: var(--rose-light);
}

/* ── Badge renouvellements sidebar ─────────────────────────── */
.renewal-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rose); color: #fff;
  font-size: .65rem; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  margin-left: auto;
}

/* ── Section mot de passe publication ──────────────────────── */
.pub-password-section {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.pub-password-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Checkboxes membres ─────────────────────────────────────── */
#members-table input[type="checkbox"] {
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: var(--rose);
}

/* ── Modal suppression membre ───────────────────────────────── */
.remove-member-stats {
  display: flex; flex-direction: column; gap: .5rem;
  margin: .75rem 0;
}
.remove-stat {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .5rem .75rem;
  background: var(--bg2);
  border-radius: var(--radius-sm);
}
.remove-stat-num {
  font-family: var(--font-head);
  font-size: 1.4rem; font-weight: 800;
  line-height: 1;
}
.remove-stat-label { font-size: .85rem; color: var(--text-muted); }
.btn-danger {
  background: var(--danger, #c53030);
  color: #fff;
  border-color: transparent;
}
.btn-danger:hover { background: #a02020; }
.btn-danger:disabled { opacity: .6; cursor: not-allowed; }

/* ── Sélecteur de domaine (sidebar) ────────────────────────── */
.domain-switcher { padding: .6rem .75rem .25rem; }
.domain-switcher-select {
  width: 100%;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .88rem;
  color: var(--text);
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem .6rem;
  cursor: pointer;
  appearance: auto;
}
.domain-switcher-select:focus { border-color: var(--rose); outline: none; }

/* ── Menu compte (header) ───────────────────────────────────── */
.account-btn-wrap { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: .4rem;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .85rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
}
.account-btn:hover { background: var(--bg2); border-color: var(--border); color: var(--text); }
.account-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--rose-light);
  color: var(--rose);
  font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.account-chevron { font-size: .7rem; color: var(--text-faint); }
.account-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 220px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease;
}
.account-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.account-menu-header {
  padding: .6rem .9rem;
  font-size: .75rem;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-menu-item {
  display: block; width: 100%; text-align: left;
  padding: .55rem .9rem;
  font-size: .86rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.account-menu-item:hover { background: var(--bg2); color: var(--text); }
.account-menu-divider { height: 1px; background: var(--border); margin: .25rem 0; }
.account-menu-danger { color: var(--danger) !important; }
.account-menu-danger:hover { background: rgba(var(--danger-rgb, 197,48,48), .08); }


/* ── Console — layout commun aux 3 rôles ───────────────────── */
.console-nav-label {
  font-size: .65rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint);
  padding: .75rem .75rem .4rem;
  display: block;
}
.console-header-ctx { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.console-domain-slug {
  font-size: .83rem; color: var(--text-faint);
  font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.console-sidebar-footer {
  margin-top: auto;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .73rem;
  color: var(--text-faint);
}

/* ── Accordéon domaines (SuperAdmin) ───────────────────────── */
.domain-accordion {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .6rem;
  overflow: hidden;
}
.domain-accordion-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1rem;
  cursor: pointer;
  background: var(--surface);
  list-style: none; user-select: none;
}
.domain-accordion-header:hover { background: var(--bg2); }
.domain-accordion[open] .domain-accordion-header { border-bottom: 1px solid var(--border); }
.domain-accordion-header::-webkit-details-marker { display: none; }
.domain-accordion-name { font-family: var(--font-head); font-weight: 700; font-size: .95rem; }
.domain-accordion-slug { font-size: .78rem; color: var(--text-faint); font-family: monospace; }
.domain-accordion-meta { display: flex; gap: .4rem; align-items: center; }
.domain-accordion-chevron {
  margin-left: auto; color: var(--text-faint); font-size: .8rem;
  transition: transform var(--transition);
}
.domain-accordion[open] .domain-accordion-chevron { transform: rotate(180deg); }
.domain-accordion-body { padding: 0; }
.dc-email  { font-size: .8rem; color: var(--text-muted); }
.dc-count  { text-align: center; font-size: .83rem; }
.dc-actions select { padding: .15rem .3rem; font-size: .75rem; width: auto; margin-right: .25rem; }

/* ── Panneau résultats outils ───────────────────────────────── */
#tools-result-panel, #user-export-result-panel {
  margin-top: 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tools-result-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-head); font-weight: 700; font-size: .88rem;
}
.tools-result-icon { font-size: 1rem; }
#tools-result-content, #user-export-result-content { padding: 1rem; }
.tool-card.active {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--rose-dim);
}

.divider { height: 1.5px; background: var(--border); margin: .75rem 0; }

/* ── Copy count & button ───────────────────────────────────── */
.copy-count {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .7rem;
  color: var(--rose);
  font-weight: 600;
  opacity: .8;
}
.btn-icon.copied {
  color: var(--success);
  opacity: .7;
}

/* ── Tag suggestion items ──────────────────────────────────── */
.tag-suggestion-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .75rem; cursor: pointer;
  font-size: .86rem; color: var(--text-muted);
  transition: background var(--transition);
  width: 100%; text-align: left; background: none;
  border: none; font-family: var(--font);
}
.tag-suggestion-item:hover,
.tag-suggestion-item.highlighted {
  background: var(--rose-light); color: var(--rose);
}

/* ── Page publique vitrine ───────────────────────────────────── */
.pub-page { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }

.pub-header { background: var(--surface); border-bottom: 1.5px solid var(--border); padding: 2.5rem 1.5rem 2rem; text-align: left; }
.pub-header-inner { max-width: 100%; margin: 0; padding: 0; }
.pub-title { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--text); margin: 0 0 .4rem; }
.pub-subtitle { color: var(--text-muted); margin: 0 0 .6rem; font-size: .95rem; }
.pub-meta { font-size: .78rem; color: var(--text-faint); }

.pub-content { max-width: 100%; width: 100%; padding: 2rem 1.5rem; flex: 1; }

.pub-section { margin-bottom: 2.5rem; }
.pub-section-title { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0 0 1rem; display: flex; align-items: center; }

.pub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 480px)  { .pub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .pub-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .pub-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .pub-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1500px) { .pub-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1700px) { .pub-grid { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 1900px) { .pub-grid { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 2200px) { .pub-grid { grid-template-columns: repeat(9, 1fr); } }
@media (min-width: 2560px) { .pub-grid { grid-template-columns: repeat(10, 1fr); } }
@media (min-width: 3840px) { .pub-grid { grid-template-columns: repeat(14, 1fr); } }

.pub-card { display: flex; flex-direction: column; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: var(--text); transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.pub-card:hover { border-color: var(--rose); box-shadow: var(--shadow); transform: translateY(-2px); }
.pub-card-img img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.pub-card-img-placeholder { width: 100%; aspect-ratio: 3/2; background: var(--bg2); display: flex; align-items: center; justify-content: center; }
.pub-card-img-placeholder img { width: 32px; height: 32px; opacity: .3; }
.pub-card-body { padding: .85rem 1rem .9rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.pub-card-title { font-size: .9rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pub-card-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .4rem; }
.pub-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.pub-card-meta { font-size: .7rem; color: var(--text-faint); }
.pub-card-date { font-size: .68rem; color: var(--text-faint); white-space: nowrap; }

.pub-footer { text-align: center; padding: 1.5rem; font-size: .78rem; color: var(--text-faint); border-top: 1.5px solid var(--border); }

.pub-footer-link { color: var(--text-faint); text-decoration: none; transition: color var(--transition); }
.pub-footer-link:hover { color: var(--rose); }

/* ── Onglet Outils ───────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tool-card:hover { border-color: var(--rose); box-shadow: 0 4px 16px var(--rose-dim); }
.tool-icon { font-size: 1.75rem; }
.tool-name { font-family: var(--font-head); font-size: .95rem; font-weight: 700; }
.tool-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.tool-status { font-size: .82rem; margin: .25rem 0; }

.tool-badge {
  display: inline-block;
  font-size: .72rem; font-weight: 600;
  padding: .15rem .55rem; border-radius: 999px;
}
.tool-badge.ok       { background: #e6f9f0; color: #1a7a4a; }
.tool-badge.dead     { background: #fde8e8; color: #c53030; }
.tool-badge.redirect { background: #fff3e0; color: #b45309; }
.tool-badge.timeout  { background: #eeeeee; color: var(--text-faint); }
.tool-badge.unchecked{ background: var(--bg2); color: var(--text-faint); }

/* ── Link checker progress ───────────────────────────────────── */
.link-check-bar-bg {
  height: 6px; border-radius: 999px;
  background: var(--bg2); overflow: hidden;
}
.link-check-bar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--rose);
  transition: width .5s ease;
}
.link-check-spinner {
  display: inline-block;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--rose-light);
  border-top-color: var(--rose);
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
