/* ═══════════════════════════════════════════════════════════
   NiavlysHub — Style "Cosmic Navy"
   Palette: entre dark et white — bleu nuit profond + accents violet/indigo
   ═══════════════════════════════════════════════════════════ */

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

:root {
  /* ── Backgrounds ── */
  --bg:        #16192e;   /* bleu nuit — base */
  --bg2:       #1c2040;   /* surface secondaire */
  --bg3:       #222649;   /* inputs / thumbnails */
  --bg4:       #292e55;   /* hover / focus */
  --bg-card:   #1e2244;   /* fond des cards */

  /* ── Bordures ── */
  --border:    rgba(140, 150, 255, 0.09);
  --border-h:  rgba(140, 150, 255, 0.22);

  /* ── Texte ── */
  --text:      #dde1f6;   /* blanc-bleu doux */
  --muted:     #535878;   /* muted navy */
  --dim:       #8890c2;   /* secondaire */

  /* ── Accents ── */
  --accent:    #6366f1;   /* indigo */
  --accent2:   #8b5cf6;   /* violet */
  --success:   #22c55e;
  --danger:    #f43f5e;
  --warning:   #f59e0b;

  /* ── Design tokens ── */
  --r:         14px;
  --r-sm:      8px;
  --r-lg:      20px;
  --shadow:    0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 56px rgba(0, 0, 0, 0.55);
  --transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
html, body {
  min-height: 100vh;
  color: var(--text);
  font-family: 'Syne', system-ui, sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
html { scrollbar-width: thin; scrollbar-color: rgba(99,102,241,.35) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,.35); border-radius: 3px; }

/* ── Background (corps "cosmic navy") ────────────────────── */
body {
  background:
    radial-gradient(ellipse 70% 55% at 5%  0%,   rgba(99,102,241,.12) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 95% 100%,  rgba(139,92,246,.09) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 50% 50%,   rgba(99,102,241,.04) 0%, transparent 70%),
    var(--bg);
}

/* Grille pointillée subtile */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(99,102,241,.055) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ───────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1340px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

/* ── Header ───────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  animation: fadeUp .45s both;
}

.hl {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-svg {
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(99,102,241,.4));
}

.hl-text h1 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.04em;
  background: linear-gradient(120deg, #d0d3ff 0%, #818cf8 45%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.hl-text p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: .1em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Clock */
.clk {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}
.clk .t {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  display: block;
  letter-spacing: .06em;
  line-height: 1;
}
.clk .d {
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
  letter-spacing: .08em;
}

/* URL Toggle (header) */
.url-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-h);
  background: rgba(99,102,241,.08);
  color: var(--dim);
  cursor: pointer;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .08em;
  transition: all var(--transition);
}
.url-toggle:hover {
  border-color: rgba(99,102,241,.5);
  background: rgba(99,102,241,.15);
  color: #818cf8;
}
.url-toggle.hidden {
  border-color: rgba(244,63,94,.3);
  background: rgba(244,63,94,.07);
  color: #f87171;
}
.url-toggle.hidden:hover {
  border-color: rgba(244,63,94,.55);
  background: rgba(244,63,94,.14);
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 180px;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.btn-add-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid rgba(99,102,241,.3);
  background: rgba(99,102,241,.07);
  color: var(--dim);
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-add-cat:hover {
  border-color: rgba(99,102,241,.6);
  background: rgba(99,102,241,.15);
  color: #818cf8;
}

/* Search */
.search-wrap {
  position: relative;
  max-width: 340px;
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  border-color: rgba(99,102,241,.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

/* Filters */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filt-btn {
  padding: 7px 16px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--dim);
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.filt-btn:hover {
  border-color: rgba(99,102,241,.45);
  color: var(--text);
  background: rgba(99,102,241,.07);
}
.filt-btn.active {
  border-color: rgba(99,102,241,.8);
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(139,92,246,.1));
  color: #a5b4fc;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(99,102,241,.2);
}

/* ── Grid ─────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ── Section label ────────────────────────────────────────── */
.sl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sl::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  position: relative;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  height: 200px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  animation: fadeUp .45s both;
}

.card:hover {
  border-color: rgba(99,102,241,.55);
  transform: translateY(-5px);
  box-shadow:
    0 20px 50px rgba(0,0,0,.45),
    0 0 0 1px rgba(99,102,241,.2),
    0 0 35px rgba(99,102,241,.12);
}

/* Card backgrounds */
.card-bg { position: absolute; inset: 0; }
.card-bg-logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-bg-logo::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(.45) saturate(1.3);
  z-index: 1;
}
.card-logo-img {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  object-fit: contain;
  opacity: .9;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.55));
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Overlay gradient */
.card-ov {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22,25,46,0) 30%, rgba(22,25,46,.95) 100%);
}

/* Badge EN LIGNE */
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(34,197,94,.09);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,.2);
  z-index: 3;
  backdrop-filter: blur(6px);
}
.bdot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

/* Edit button */
.cedit {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(22,25,46,.75);
  color: var(--dim);
  border: 1px solid rgba(99,102,241,.35);
  display: none;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition);
  pointer-events: auto;
  z-index: 3;
  backdrop-filter: blur(8px);
}
.cedit:hover {
  background: rgba(99,102,241,.2);
  color: #a5b4fc;
  border-color: rgba(99,102,241,.55);
}
.card:hover .cedit { display: flex; }

/* Card content */
.card-ct {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.1rem;
}
.card-hd {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.cico {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border-h);
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cname {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.35;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.curl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  transition: color var(--transition);
}

/* Card ADD */
.card-add {
  border: 2px dashed rgba(99,102,241,.2);
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
}
.card-add:hover {
  border-color: rgba(99,102,241,.5);
  background: rgba(99,102,241,.05);
  transform: scale(1.01);
  box-shadow: 0 0 24px rgba(99,102,241,.1);
}
.plus {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(99,102,241,.35);
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 300;
  transition: all var(--transition);
  background: rgba(99,102,241,.06);
  line-height: 1;
}
.card-add:hover .plus {
  border-color: rgba(99,102,241,.65);
  background: rgba(99,102,241,.12);
  color: #818cf8;
}
.card-add span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
  transition: color var(--transition);
}
.card-add:hover span { color: var(--dim); }

/* Dragging state */
.card.dragging { opacity: .45; transform: scale(.97); }

/* ── Modal ────────────────────────────────────────────────── */
.mback {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.mback.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border-h);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  width: min(540px, 93vw);
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(16px) scale(.98);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99,102,241,.15);
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,.3) transparent;
}
.mback.open .modal { transform: translateY(0) scale(1); }

.mhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.mhead h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.mclose {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-h);
  background: var(--bg3);
  color: var(--dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.mclose:hover { background: rgba(244,63,94,.1); color: #f87171; border-color: rgba(244,63,94,.3); }

/* Fields */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border-h);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus {
  border-color: rgba(99,102,241,.55);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.field input::placeholder { color: var(--muted); }

/* Tag grid */
.tgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.topt {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 5px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  background: var(--bg3);
}
.topt:hover { border-color: var(--border-h); background: var(--bg4); }
.topt.sel {
  border-color: rgba(99,102,241,.7);
  background: rgba(99,102,241,.1);
  box-shadow: 0 0 12px rgba(99,102,241,.15);
}
.tprev {
  height: 54px;
  border-radius: 6px;
  margin-bottom: 5px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.04);
  background: var(--bg2);
}
.tlbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  color: var(--muted);
  letter-spacing: .04em;
}
.topt.sel .tlbl { color: #a5b4fc; }

/* URL toggle (modal) */
.url-toggle-modal {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-h);
  background: var(--bg3);
  color: var(--dim);
  cursor: pointer;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .06em;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.url-toggle-modal:hover {
  border-color: rgba(99,102,241,.45);
  background: rgba(99,102,241,.08);
  color: #818cf8;
}
.url-toggle-modal.hidden {
  border-color: rgba(244,63,94,.3);
  background: rgba(244,63,94,.07);
  color: #f87171;
}
.url-toggle-modal.hidden:hover {
  border-color: rgba(244,63,94,.5);
  background: rgba(244,63,94,.12);
}

.sep { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* Modal actions */
.macts {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--r-sm);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:active { transform: scale(.97); }

.btn-p {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
}
.btn-p:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 6px 24px rgba(99,102,241,.45);
}
.btn-p:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn-c {
  background: var(--bg3);
  color: var(--dim);
  border: 1px solid var(--border-h);
}
.btn-c:hover { color: var(--text); background: var(--bg4); }

.btn-del {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(244,63,94,.22);
  background: rgba(244,63,94,.07);
  color: #f87171;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-del:hover {
  background: rgba(244,63,94,.16);
  border-color: rgba(244,63,94,.45);
}
.btn-del.confirming {
  background: rgba(244,63,94,.2);
  border-color: rgba(244,63,94,.6);
  color: #fca5a5;
  animation: shake .4s;
}

/* ── Toasts ───────────────────────────────────────────────── */
.toasts {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(12px);
  border: 1px solid;
  box-shadow: var(--shadow);
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1) both;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}
.toast.success {
  background: rgba(22,197,94,.15);
  border-color: rgba(34,197,94,.35);
  color: #4ade80;
}
.toast.error {
  background: rgba(244,63,94,.15);
  border-color: rgba(244,63,94,.35);
  color: #f87171;
}
.toast.info {
  background: rgba(99,102,241,.15);
  border-color: rgba(99,102,241,.35);
  color: #818cf8;
}
.toast.out { animation: toastOut .25s ease both; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  letter-spacing: .06em;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .2; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(.92); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(.9); }
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 4rem 2rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  text-align: center;
}
.empty-state svg { opacity: .3; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .wrap { padding: 1.25rem 1rem 2rem; }
  header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .header-right { width: 100%; justify-content: space-between; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { height: 170px; }
  .tgrid { grid-template-columns: repeat(3, 1fr); }
  .section-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; }
}

/* ── Sections ────────────────────────────────────────────────────── */
#sections-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}
.section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  gap: .75rem;
  transition: background var(--transition);
}
.section-header:hover { background: rgba(140,150,255,.04); }
.section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.section-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.section-color-bar {
  display: inline-block;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
}
.section-label {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.section-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg3);
  border-radius: 99px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.section-edit-btn, .section-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}
.section-edit-btn:hover { background: var(--bg4); color: var(--dim); }
.section-toggle:hover   { background: var(--bg4); color: var(--dim); }
.section-body {
  padding: 0 16px 16px;
  overflow: hidden;
  transition: opacity var(--transition);
}
.section-body.hidden {
  display: none;
}
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

/* ── Color grid ────────────────────────────────────────────────── */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  outline: none;
}
.color-dot:hover  { transform: scale(1.15); }
.color-dot.sel    { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.3); }

/* ── Field select ────────────────────────────────────────────────── */
.field-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.field-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg4);
}
.field-select option { background: var(--bg2); }

/* ── Modal-sm (catégorie) ────────────────────────────────────── */
.modal-sm { max-width: 400px; }

/* ── Toggle btn: active state ─────────────────────────────────── */
.url-toggle-modal.active,
.url-toggle.active {
  background: rgba(99,102,241,.2);
  border-color: rgba(99,102,241,.5);
  color: #818cf8;
}
