.fp-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 600;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fp-modal.open {
  display: flex;
}
.fp-box {
  background: #0b1628;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 720px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.fp-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}
.fp-tabs {
  display: flex;
  gap: 6px;
  padding: 0 22px 12px;
}
.fp-tab {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}
.fp-tab.active {
  background: rgba(128, 101, 248, 0.18);
  border-color: rgba(128, 101, 248, 0.35);
  color: #a78bfa;
}
.fp-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 0 22px 16px;
}
.fp-panel.active {
  display: flex;
}
.fp-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.fp-search {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #e2e8f0;
  outline: none;
}
.fp-search:focus {
  border-color: #8065f8;
}
.fp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  overflow-y: auto;
  max-height: 360px;
  padding: 2px;
}
.fp-item {
  background: #0f1f3d;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.fp-item:hover {
  border-color: rgba(128, 101, 248, 0.45);
  transform: translateY(-1px);
}
.fp-item .fp-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 6px;
}
.fp-item .fp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fp-item .fp-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.3);
}
.fp-drop {
  border: 2px dashed rgba(128, 101, 248, 0.4);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(128, 101, 248, 0.05);
}
.fp-drop.dragging {
  border-color: #8065f8;
  background: rgba(128, 101, 248, 0.1);
}
.fp-upload-queue {
  margin-top: 12px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}
.fp-upload-queue.hidden {
  display: none;
}
.fp-footer {
  padding: 12px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
}
.fp-primary {
  background: linear-gradient(135deg, #8065f8, #4490d3);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fp-primary:disabled {
  cursor: not-allowed;
}
.fp-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}
