/* ── Badge / chip ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .175rem .625rem; border-radius: 9999px;
  font-size: .6875rem; font-weight: 700;
}

/* Change-type chips */
.chip-add { background:#dcfce7; color:#16a34a; }
.chip-fix { background:#fef9c3; color:#b45309; }
.chip-imp { background:#dbeafe; color:#1d4ed8; }
.chip-rem { background:#fee2e2; color:#dc2626; }
.dark .chip-add { background:#14532d; color:#86efac; }
.dark .chip-fix { background:#422006; color:#fde68a; }
.dark .chip-imp { background:#1e3a5f; color:#93c5fd; }
.dark .chip-rem { background:#450a0a; color:#fca5a5; }

/* Version pill */
.ver-pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: 999px;
  font-size: .6875rem; font-weight: 800;
  background: #eff6ff; color: #2563eb;
}
.dark .ver-pill { background: #1e3a5f; color: #93c5fd; }

/* Filter tabs */
.cl-filter-tab {
  padding: .375rem 1rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 700;
  cursor: pointer; border: none; transition: background .15s, color .15s;
  background: #f1f5f9; color: #64748b;
}
.cl-filter-tab:hover { background: #e2e8f0; color: #374151; }
.cl-filter-tab.active { background: #2563eb; color: white; }
.dark .cl-filter-tab { background: #1e293b; color: #94a3b8; }
.dark .cl-filter-tab.active { background: #2563eb; color: white; }
.dark .cl-filter-tab:hover { background: #334155; color: #e2e8f0; }

/* ── Timeline ──────────────────────────────────────────────────────────────── */
.cl-tl-container { position: relative; }
.cl-tl-container::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #3b82f6, #8b5cf6, #ec4899);
  transform: translateX(-50%);
}
@media (max-width: 767px) {
  .cl-tl-container::before { left: 1.5rem; }
}

.cl-tl-item { position: relative; display: block; margin-bottom: 2.5rem; min-height: 3rem; }

.cl-tl-card {
  background: white; border-radius: 1rem;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 1rem 1.25rem;
  width: calc(50% - 2rem);
  transition: box-shadow .15s;
}
.cl-tl-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.dark .cl-tl-card { background: #1e293b; border-color: #334155; }
.cl-tl-item:nth-child(odd)  .cl-tl-card { margin-right: auto; }
.cl-tl-item:nth-child(even) .cl-tl-card { margin-left: auto; }
@media (max-width: 767px) {
  .cl-tl-item:nth-child(odd)  .cl-tl-card,
  .cl-tl-item:nth-child(even) .cl-tl-card {
    width: auto;
    margin-left: 3.5rem;
    margin-right: 0;
  }
}

.cl-tl-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
}
@media (max-width: 767px) {
  .cl-tl-center { left: 1.5rem; }
}

.cl-tl-dot {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: white; flex-shrink: 0;
  box-shadow: 0 0 0 4px white;
}
.dark .cl-tl-dot { box-shadow: 0 0 0 4px #0f172a; }
.cl-tl-spacer { display: none; }

/* Dot tag colors */
.tag-primary   { background: #3b82f6; }
.tag-secondary { background: #64748b; }
.tag-success   { background: #22c55e; }
.tag-danger    { background: #ef4444; }
.tag-warning   { background: #f59e0b; }
.tag-info      { background: #06b6d4; }

/* Version summary strip */
.cl-ver-strip {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem; border-radius: .875rem;
  background: white; border: 1px solid #f1f5f9;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  cursor: pointer; transition: box-shadow .15s;
}
.cl-ver-strip:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }
.dark .cl-ver-strip { background: #1e293b; border-color: #334155; }

/* Custom dropdown */
.cl-dd { position: relative; }
.cl-dd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .375rem .75rem; border-radius: .5rem;
  background: #f8fafc; border: 1px solid #e2e8f0;
  font-size: .8125rem; font-weight: 600; color: #374151;
  cursor: pointer; width: 100%;
  transition: background .15s, border-color .15s;
}
.cl-dd-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.dark .cl-dd-btn { background: #334155; border-color: #475569; color: #e2e8f0; }
.dark .cl-dd-btn:hover { background: #3e506a; }
.cl-dd-chevron { font-size: .6rem; transition: transform .15s; color: #9ca3af; flex-shrink: 0; }
.cl-dd.open .cl-dd-chevron { transform: rotate(180deg); }
.cl-dd-panel {
  position: absolute; top: calc(100% + .25rem); left: 0; min-width: 100%;
  background: white; border: 1px solid #e2e8f0; border-radius: .625rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 50;
  max-height: 14rem; overflow-y: auto;
}
.dark .cl-dd-panel { background: #1e293b; border-color: #334155; }
.cl-dd-item {
  padding: .45rem .875rem; font-size: .8125rem; font-weight: 500; color: #374151;
  cursor: pointer; white-space: nowrap;
}
.cl-dd-item:hover { background: #f1f5f9; }
.cl-dd-item.selected { background: #eff6ff; color: #2563eb; font-weight: 700; }
.dark .cl-dd-item { color: #e2e8f0; }
.dark .cl-dd-item:hover { background: #334155; }
.dark .cl-dd-item.selected { background: #1e3a5f; color: #93c5fd; }

/* Detail modal */
.cl-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.cl-modal-overlay.hidden { display: none !important; }
.cl-modal-box {
  background: white; border-radius: 1.25rem;
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.dark .cl-modal-box { background: #0f172a; }
