.models-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.models-search {
  flex: 1;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.models-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(from var(--accent) r g b / 0.18);
}

.models-status {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  min-height: 18px;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1200px) { .models-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 980px)  { .models-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .models-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.model-tile {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.20);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color .15s;
}

.model-tile:hover {
  border-color: rgba(255,255,255,0.22);
}

.model-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.model-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .25s ease;
}

.model-img.active { opacity: 1; }

.model-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent, #7c6ef7);
  opacity: 0;
  pointer-events: none;
}

.model-tile { cursor: pointer; }

.model-meta {
  padding: 10px 12px 12px;
}

.model-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.model-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.model-tag {
  font-size: 10px;
  font-weight: 700;
  color: rgba(232,234,238,.65);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  padding: 3px 7px;
  border-radius: 999px;
}

.models-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 14px;
}

/* ── Lightbox ── */
#gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gallery-lightbox.lb-hidden { display: none; }

#lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.84);
}

#lb-box {
  position: relative;
  z-index: 1;
  background: #1a1a1f;
  border-radius: 16px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.75);
  max-width: min(900px, 95vw);
  width: 100%;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lb-close:hover { background: rgba(255,255,255,0.18); }

#lb-img-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

#lb-img {
  max-height: 70vh;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

#lb-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

#lb-prev, #lb-next {
  background: rgba(255,255,255,0.10);
  border: none;
  color: #fff;
  font-size: 26px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#lb-prev:hover, #lb-next:hover { background: rgba(255,255,255,0.22); }

#lb-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: background .15s;
}

.lb-dot.active { background: #fff; }
.lb-dot:hover  { background: rgba(255,255,255,0.6); }

#lb-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
}
