/* ══════════════════════════════════════════════════════════════
   AssetVault Explorer Panel — Styles
   Companion to js/explorer.js
   ══════════════════════════════════════════════════════════════ */

/* ── Panel Shell ─────────────────────────────────────────────── */
.av-panel {
  background: rgba(9, 9, 15, 0.98);
  border: 1px solid rgba(90, 82, 255, 0.2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  position: relative;
}

/* ── macOS Title Bar ─────────────────────────────────────────── */
.av-titlebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.25rem;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  user-select: none;
}
.av-titlebar-dots { display: flex; gap: 6px; flex-shrink: 0; }
.av-titlebar-dots span {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: block;
}
.av-dot-r { background: #FF5F57; }
.av-dot-y { background: #FEBC2E; }
.av-dot-g { background: #28C840; }
.av-titlebar-name {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.02em;
}
.av-titlebar-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.av-meta-pill {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: rgba(90, 82, 255, 0.18);
  color: #7B75FF;
  border: 1px solid rgba(90, 82, 255, 0.3);
  white-space: nowrap;
}
.av-meta-pill.offline {
  background: rgba(251, 191, 36, 0.12);
  color: #FBB024;
  border-color: rgba(251, 191, 36, 0.25);
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.av-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.01);
}
.av-search-wrap {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 0.48rem 0.85rem;
  transition: border-color 0.15s ease;
}
.av-search-wrap:focus-within {
  border-color: #5A52FF;
  box-shadow: 0 0 0 3px rgba(90, 82, 255, 0.12);
}
.av-search-icon { color: rgba(255,255,255,0.3); flex-shrink: 0; }
.av-search {
  background: none;
  border: none;
  outline: none;
  color: #EEEEFF;
  font-size: 0.82rem;
  width: 100%;
  font-family: inherit;
}
.av-search::placeholder { color: rgba(255,255,255,0.25); }
.av-search-clear {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 0;
  display: none;
  align-items: center;
  font-size: 0.85rem;
  transition: color 0.15s;
}
.av-search-clear:hover { color: rgba(255,255,255,0.7); }
.av-search-clear.visible { display: flex; }

.av-sort {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem;
  padding: 0.44rem 0.7rem;
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}
.av-sort:focus { border-color: #5A52FF; }
.av-sort option { background: #111118; }

.av-view-grp { display: flex; gap: 0.2rem; }
.av-vbtn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.15s ease;
}
.av-vbtn:hover, .av-vbtn.active {
  background: rgba(90, 82, 255, 0.15);
  color: #7B75FF;
}

.av-result-count {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  flex-shrink: 0;
}
.av-result-count strong { color: #7B75FF; }

/* ── Main Layout ─────────────────────────────────────────────── */
.av-main {
  display: flex;
  height: 520px;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.av-sidebar {
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
  padding: 0.6rem 0;
}
.av-sidebar::-webkit-scrollbar { width: 3px; }
.av-sidebar::-webkit-scrollbar-thumb {
  background: rgba(90, 82, 255, 0.3);
  border-radius: 2px;
}
.av-sidebar-sec {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.2);
  padding: 0.4rem 1rem;
  margin-top: 0.5rem;
}
.av-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.52rem 1rem;
  font-size: 0.79rem;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}
.av-sidebar-item:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.03);
}
.av-sidebar-item.active {
  color: #7B75FF;
  border-left-color: #5A52FF;
  background: rgba(90, 82, 255, 0.08);
}
.av-sidebar-item svg { flex-shrink: 0; opacity: 0.7; }
.av-sidebar-item.active svg { opacity: 1; }
.av-sidebar-count {
  margin-left: auto;
  font-size: 0.62rem;
  background: rgba(255,255,255,0.06);
  padding: 0.1rem 0.4rem;
  border-radius: 100px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* ── Grid Wrapper ────────────────────────────────────────────── */
.av-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0.875rem;
  position: relative;
}
.av-grid-wrap::-webkit-scrollbar { width: 4px; }
.av-grid-wrap::-webkit-scrollbar-thumb {
  background: rgba(90, 82, 255, 0.25);
  border-radius: 2px;
}

/* ── Grid Modes ──────────────────────────────────────────────── */
/* Default: large grid */
.av-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 0.8rem;
}
/* Compact grid */
.av-grid.view-compact {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.55rem;
}
/* List view */
.av-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Loading / Error / Empty States ─────────────────────────── */
.av-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 100%;
  min-height: 200px;
  padding: 2rem;
  color: rgba(255,255,255,0.3);
  font-size: 0.88rem;
  text-align: center;
}
.av-state svg { opacity: 0.4; }

/* Skeleton */
.av-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 0.8rem;
}
.av-skel-card {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  animation: skelPulse 1.6s ease-in-out infinite;
}
@keyframes skelPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.av-skel-thumb {
  aspect-ratio: 16/9;
  background: rgba(255,255,255,0.05);
}
.av-skel-body { padding: 0.6rem 0.75rem; }
.av-skel-line {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  margin-bottom: 0.5rem;
}
.av-skel-line.short { width: 60%; }

/* Retry button */
.av-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  background: rgba(90, 82, 255, 0.15);
  border: 1px solid rgba(90, 82, 255, 0.3);
  color: #7B75FF;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.av-retry-btn:hover {
  background: rgba(90, 82, 255, 0.25);
  transform: translateY(-1px);
}

/* ── Asset Card (Grid View) ──────────────────────────────────── */
.av-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #111118;
  border: 1px solid rgba(255,255,255,0.055);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}
.av-card:hover {
  transform: scale(1.04);
  border-color: rgba(90, 82, 255, 0.45);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5),
              0 0 20px rgba(90, 82, 255, 0.2);
  z-index: 2;
}
.av-card:focus-visible {
  outline: 2px solid #5A52FF;
  outline-offset: 2px;
}

/* Compact card */
.av-grid.view-compact .av-card:hover { transform: scale(1.06); }

/* ── Card Thumbnail ──────────────────────────────────────────────
   Every card gets a fixed 16:9 dark frame regardless of the source
   image's aspect ratio. Thumbnails use object-fit:contain so
   vertical/square assets letterbox naturally inside the frame.
   ──────────────────────────────────────────────────────────────── */
.av-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;   /* uniform frame — never changes per-card */
  overflow: hidden;
  border-radius: 12px 12px 0 0; /* match card top corners */

  /* dark gradient backdrop so transparent PNGs read as native */
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, #16162a 0%, #0f0f1a 100%);

  /* subtle dot grid on the backdrop */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 40%, #16162a 0%, #0f0f1a 100%),
    radial-gradient(circle, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 100% 100%, 18px 18px;

  /* inner border so the frame reads as a distinct element */
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

/* Thumbnail image — contained, padded, never cropped */
.av-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;    /* letterbox — never stretch or crop */
  object-position: center;
  padding: 8%;            /* breathing room for vertical/square */
  display: block;
  transition: opacity 0.3s ease;
  /* remove any white fringe from transparent PNGs */
  mix-blend-mode: normal;
}

/* Hover video — same frame, same contain treatment */
.av-card-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Remove the old per-card aspect-ratio overrides —
   everything is now 16:9 with letterboxing */
.av-card.aspect-square .av-card-thumb,
.av-card.aspect-portrait .av-card-thumb { aspect-ratio: 16 / 9; }

/* ── Light background detection ───────────────────────────────
   .is-light is added by JS canvas corner-sampling.
   White-bg thumbnails get an inset "screen" framing treatment.
   ──────────────────────────────────────────────────────────── */
.av-card-thumb.is-light img {
  padding: 10%;
  border-radius: 10px;
  /* subtle dimming + contrast boost so it reads as a framed preview */
  filter: brightness(0.92) contrast(1.02);
}
/* soft dark vignette over light thumbnails */
.av-card-thumb.is-light::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 120% 100% at 50% 50%,
      transparent 45%,
      rgba(10,10,20,0.35) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* ── Error placeholder ─────────────────────────────────────── */
.av-card-thumb .av-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.18);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0.5rem;
  user-select: none;
}
.av-thumb-placeholder .av-thumb-initial {
  font-size: 1.4rem;
  font-weight: 800;
  color: rgba(90,82,255,0.35);
  line-height: 1;
}

/* ── Badges — fixed four-corner positions ──────────────────────
   NEW      → top-left
   Deps     → top-right
   Duration → bottom-right
   Aspect   → bottom-left
   All share the same base pill style; only color differs.
   ──────────────────────────────────────────────────────────── */
.av-badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* badges are absolutely positioned children, not flex */
}

/* Shared pill */
.av-badge {
  position: absolute;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  line-height: 1;
  /* frosted dark base for all badges */
  background: rgba(8, 8, 16, 0.72);
  color: rgba(255,255,255,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}

/* NEW — top-left, violet fill overrides the dark base */
.av-badge-new {
  top: 0.4rem;
  left: 0.4rem;
  background: linear-gradient(135deg, rgba(90,82,255,0.9), rgba(192,132,252,0.85));
  color: #fff;
  border-color: rgba(90,82,255,0.4);
}

/* Deps — top-right, amber outline only */
.av-badge-dep {
  top: 0.4rem;
  right: 0.4rem;
  background: rgba(8, 8, 16, 0.72);
  color: #FBB024;
  border-color: rgba(251,191,36,0.5);
}

/* Duration — bottom-right */
.av-badge-dur {
  bottom: 0.4rem;
  right: 0.4rem;
}

/* Aspect / resolution — bottom-left */
.av-badge-res {
  bottom: 0.4rem;
  left: 0.4rem;
  /* keep same dark base — no margin-left override needed */
  margin-left: 0;
}

/* Play overlay */
.av-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(0,0,0,0.25);
  pointer-events: none;
}
.av-card:hover .av-play-overlay { opacity: 1; }
.av-play-overlay svg {
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* ── Card Info — uniform footer height across all cards ─────────── */
.av-card-info {
  padding: 0.55rem 0.72rem 0.65rem;
  /* Fixed min-height so every card footer is the same height */
  min-height: 52px;
  box-sizing: border-box;
}
.av-card-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: #EEEEFF;
  /* 1-line clamp with ellipsis — always exactly one line */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.av-card-sub {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.28rem;
  flex-wrap: wrap;
}
.av-card-cat {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.35);
}
.av-card-dur {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.25);
}
.av-card-dep-icon {
  display: inline-flex;
  align-items: center;
  color: #FBB024;
  margin-left: auto;
  position: relative;
}
.av-card-dep-icon .av-dep-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #1a1a28;
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  max-width: 220px;
  white-space: normal;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 10;
}
.av-card-dep-icon:hover .av-dep-tooltip { display: block; }

.av-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  margin-top: 0.4rem;
}
.av-card-tag {
  font-size: 0.58rem;
  padding: 0.12rem 0.38rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.06);
}

/* compact card – hide tags, reduce info */
.view-compact .av-card-tags { display: none; }
.view-compact .av-card-info { padding: 0.4rem 0.55rem; }
.view-compact .av-card-name { font-size: 0.7rem; }

/* ── List View Card ──────────────────────────────────────────── */
.view-list .av-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0.55rem 0.875rem;
  transform: none !important;
}
.view-list .av-card:hover {
  background: rgba(90, 82, 255, 0.05);
  border-bottom-color: rgba(90, 82, 255, 0.2);
  box-shadow: none;
}
/* List-view thumbnail: fixed 80×45px dark frame (keeps 16:9 aspect).
   All aspect-ratio classes still produce the same visual frame —
   the image letterboxes inside via object-fit:contain. */
.view-list .av-card-thumb {
  width: 80px;
  height: 45px;
  aspect-ratio: unset; /* explicit width+height take precedence */
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  /* dark frame backdrop is inherited from .av-card-thumb background */
}
/* Uniform 80×45 regardless of source aspect — letterboxing handles the rest */
.view-list .av-card.aspect-square .av-card-thumb,
.view-list .av-card.aspect-portrait .av-card-thumb {
  width: 80px;
  height: 45px;
}
/* Badges in list view: absolute container is kept (no change);
   hide bottom-left res badge to save space, keep new/dep at top corners
   and dur at bottom-right. */
.view-list .av-badges { position: absolute; inset: 0; pointer-events: none; }
.view-list .av-badge { font-size: 0.52rem; padding: 0.15rem 0.35rem; }
.view-list .av-badge-res { display: none; }
.view-list .av-badge-dur { display: none; }  /* too cramped at 80px wide */
.view-list .av-play-overlay { display: none; }
.view-list .av-card-info {
  flex: 1;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.view-list .av-card-name {
  min-width: 0;
  flex: 1;
  font-size: 0.82rem;
}
.view-list .av-card-sub { margin: 0; }
.view-list .av-card-tags { display: none; }
.view-list .av-list-meta {
  display: flex;
  gap: 0.875rem;
  flex-shrink: 0;
  align-items: center;
}
.av-list-meta-item {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
}
.av-list-release {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 100px;
  background: rgba(90,82,255,0.1);
  color: #7B75FF;
  border: 1px solid rgba(90,82,255,0.2);
}

/* default hidden in grid view */
.av-list-meta { display: none; }
.view-list .av-list-meta { display: flex; }

/* ── Status Bar ──────────────────────────────────────────────── */
.av-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.52rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.012);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.av-status-left { display: flex; align-items: center; gap: 0.65rem; }
.av-status-online { display: flex; align-items: center; gap: 0.38rem; }
.av-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 6px #34D399;
  flex-shrink: 0;
}
.av-status-right { color: #7B75FF; font-weight: 500; }

/* ── Detail Drawer ───────────────────────────────────────────── */
.av-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.av-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.av-drawer {
  width: 360px;
  max-width: 100%;
  background: #0d0d18;
  border-left: 1px solid rgba(90, 82, 255, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
.av-drawer-overlay.open .av-drawer {
  transform: translateX(0);
}
.av-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.av-drawer-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #EEEEFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.av-drawer-close {
  background: rgba(255,255,255,0.07);
  border: none;
  color: rgba(255,255,255,0.5);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.9rem;
  transition: all 0.15s;
}
.av-drawer-close:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.av-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}
.av-drawer-body::-webkit-scrollbar { width: 3px; }
.av-drawer-body::-webkit-scrollbar-thumb { background: rgba(90,82,255,0.25); border-radius: 2px; }

/* Preview video/image in drawer — same dark-frame treatment as cards */
.av-drawer-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  /* dark backdrop for transparent PNGs */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 40%, #16162a 0%, #0f0f1a 100%),
    radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 100% 100%, 18px 18px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  aspect-ratio: 16 / 9;
}
.av-drawer-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.av-drawer-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 8%;
  display: block;
}
/* light-bg treatment in drawer */
.av-drawer-preview.is-light img {
  padding: 10%;
  border-radius: 10px;
  filter: brightness(0.92) contrast(1.02);
}
.av-drawer-preview.is-light::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 45%, rgba(10,10,20,0.35) 100%);
}
.av-drawer-preview-badge {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
}

/* Metadata table */
.av-drawer-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.av-meta-row {
  display: flex;
  padding: 0.6rem 0.875rem;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 0.75rem;
}
.av-meta-row:last-child { border-bottom: none; }
.av-meta-row:nth-child(even) { background: rgba(255,255,255,0.018); }
.av-meta-key {
  color: rgba(255,255,255,0.35);
  width: 90px;
  flex-shrink: 0;
}
.av-meta-val { color: rgba(255,255,255,0.75); word-break: break-all; }

/* Dependencies */
.av-dep-section { margin-bottom: 1.25rem; }
.av-dep-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  margin-bottom: 0.6rem;
}
.av-dep-list { display: flex; flex-direction: column; gap: 0.4rem; }
.av-dep-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  font-size: 0.76rem;
  color: rgba(255,255,255,0.6);
}
.av-dep-item.ok  { border-color: rgba(52,211,153,0.2); background: rgba(52,211,153,0.04); }
.av-dep-item.warn{ border-color: rgba(251,191,36,0.2); background: rgba(251,191,36,0.04); }
.av-dep-item.err { border-color: rgba(239,68,68,0.2);  background: rgba(239,68,68,0.04);  }
.av-dep-status { margin-left: auto; font-size: 0.66rem; }
.av-dep-item.ok   .av-dep-status { color: #34D399; }
.av-dep-item.warn .av-dep-status { color: #FBB024; }
.av-dep-item.err  .av-dep-status { color: #EF4444; }

/* Import button (disabled) */
.av-import-btn-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}
.av-import-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(135deg, #5A52FF, #9B8BFF);
  color: #fff;
  border: none;
  cursor: not-allowed;
  opacity: 0.6;
  font-family: inherit;
  position: relative;
}
.av-import-hint {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.av-import-hint a {
  color: #7B75FF;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .av-main { height: 460px; }
  .av-sidebar { width: 140px; }
  .av-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .av-drawer { width: 100%; border-left: none; border-top: 1px solid rgba(90,82,255,0.2); }
  .av-drawer-overlay { align-items: flex-end; }
  .av-titlebar-name { display: none; }
}
@media (max-width: 480px) {
  .av-sidebar { display: none; }
  .av-main { height: auto; flex-direction: column; }
  .av-grid-wrap { max-height: 400px; }
  .av-grid { grid-template-columns: repeat(2, 1fr); }
  .av-grid.view-compact { grid-template-columns: repeat(3, 1fr); }
}
